From 2b560327ff8262a4d43e76237f19187df1cf213a Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 5 Jul 2020 18:59:14 -0400 Subject: [PATCH] feat: add 2fa option to admin security --- client/components/admin/admin-auth.vue | 24 ---------------------- client/components/admin/admin-security.vue | 12 +++++++++++ dev/cypress/ci-setup.sh | 6 +++--- 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/client/components/admin/admin-auth.vue b/client/components/admin/admin-auth.vue index e4217cd6..26134235 100644 --- a/client/components/admin/admin-auth.vue +++ b/client/components/admin/admin-auth.vue @@ -176,30 +176,6 @@ multiple chips ) - template(v-if='strategy.useForm') - v-divider.mt-3 - .d-flex.my-5.align-center - .overline {{$t('admin:auth.security')}} - v-chip.ml-3.grey--text(outlined, small, label) Coming soon - v-switch.ml-3( - v-if='strategy.key === `local`' - :disabled='!strategy.selfRegistration || true' - v-model='strategy.recaptcha' - label='Use reCAPTCHA by Google' - color='primary' - hint='Protects against spam robots and malicious registrations.' - persistent-hint - inset - ) - v-switch.ml-3( - v-model='strategy.recaptcha' - :disabled='true' - :label='$t(`admin:auth.force2fa`)' - color='primary' - :hint='$t(`admin:auth.force2faHint`)' - persistent-hint - inset - ) v-card.mt-4.wiki-form.animated.fadeInUp.wait-p4s(v-if='selectedStrategy !== `local`') v-toolbar(color='primary', dense, flat, dark) diff --git a/client/components/admin/admin-security.vue b/client/components/admin/admin-security.vue index c4d7fd6c..0454d542 100644 --- a/client/components/admin/admin-security.vue +++ b/client/components/admin/admin-security.vue @@ -179,6 +179,18 @@ :hint='$t(`admin:security.hideLocalLoginHint`)' ) v-divider.mt-3 + .overline.grey--text.pa-4 {{$t('admin:security.loginSecurity')}} + .px-4.pb-3 + v-switch.mt-0( + inset + :label='$t(`admin:security.enforce2fa`)' + color='primary' + v-model='config.authEnforce2FA' + prepend-icon='mdi-two-factor-authentication' + :hint='$t(`admin:security.enforce2faHint`)' + persistent-hint + ) + v-divider.mt-3 .overline.grey--text.pa-4 {{$t('admin:security.jwt')}} .px-4.pb-3 v-text-field( diff --git a/dev/cypress/ci-setup.sh b/dev/cypress/ci-setup.sh index eec427de..59347177 100644 --- a/dev/cypress/ci-setup.sh +++ b/dev/cypress/ci-setup.sh @@ -13,6 +13,9 @@ mariadb) echo "Using MariaDB..." docker run -d -p 3306:3306 --name db --network="host" -e "MYSQL_ROOT_PASSWORD=Password123!" -e "MYSQL_USER=wiki" -e "MYSQL_PASSWORD=Password123!" -e "MYSQL_DATABASE=wiki" mariadb:10 docker run -d -p 3000:3000 --name wiki --network="host" -e "DB_TYPE=mariadb" -e "DB_HOST=localhost" -e "DB_PORT=3306" -e "DB_NAME=wiki" -e "DB_USER=wiki" -e "DB_PASS=Password123!" requarks/wiki:canary-$BUILD_BUILDNUMBER + sleep 5 + docker logs wiki + echo "MariaDB environment started." ;; mssql) echo "Using MS SQL Server..." @@ -29,6 +32,3 @@ sqlite) echo "Invalid DB Type!" ;; esac - -sleep 5 -docker logs wiki