diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7f252fe08..66bc2bbf8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,34 +6,13 @@ on: - master jobs: - ############################################################################## - # JOB: PREPARE ############################################################### - ############################################################################## - #prepare: - # name: Prepare - # runs-on: ubuntu-latest - # # needs: [nothing] - # steps: - # ########################################################################## - # # CHECKOUT CODE ########################################################## - # ########################################################################## - # - name: Checkout code - # uses: actions/checkout@v2 - # ########################################################################## - # # TODO: DO STUFF ??? ##################################################### - # ########################################################################## - # - name: Check translation files - # run: | - # scripts/translations/sort.sh - # scripts/translations/missing-keys.sh - ############################################################################## # JOB: DOCKER BUILD COMMUNITY NEO4J ########################################## ############################################################################## build_production_frontend: name: Docker Build Production - Frontend runs-on: ubuntu-latest - #needs: [prepare] [nothing] + #needs: [nothing] steps: ########################################################################## # CHECKOUT CODE ########################################################## @@ -65,116 +44,154 @@ jobs: path: /tmp/frontend.tar ############################################################################## - # JOB: DOCKER BUILD PRODUCTION BACKEND ####################################### + # JOB: DOCKER BUILD PRODUCTION LOGIN SERVER ################################## ############################################################################## - #build_production_backend: - # name: Docker Build Production - Backend - # runs-on: ubuntu-latest - # needs: [prepare] - # steps: - # ########################################################################## - # # CHECKOUT CODE ########################################################## - # ########################################################################## - # - name: Checkout code - # uses: actions/checkout@v2 - # ########################################################################## - # # SET ENVS ############################################################### - # ########################################################################## - # - name: ENV - VERSION - # run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV - # - name: ENV - BUILD_DATE - # run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV - # - name: ENV - BUILD_VERSION - # run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV - # - name: ENV - BUILD_COMMIT - # run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV - # ########################################################################## - # # BUILD BACKEND DOCKER IMAGE (production) ################################ - # ########################################################################## - # - name: backend | Build `production` image - # run: | - # docker build --target production -t "ocelotsocialnetwork/backend:latest" -t "ocelotsocialnetwork/backend:${VERSION}" -t "ocelotsocialnetwork/backend:${BUILD_VERSION}" backend/ - # docker save "ocelotsocialnetwork/backend" > /tmp/backend.tar - # - name: Upload Artifact - # uses: actions/upload-artifact@v2 - # with: - # name: docker-backend-production - # path: /tmp/backend.tar + build_production_login_server: + name: Docker Build Production - Login Server + runs-on: ubuntu-latest + #needs: [nothing] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: recursive + ########################################################################## + # SET ENVS ############################################################### + ########################################################################## + - name: ENV - VERSION + run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV + - name: ENV - BUILD_DATE + run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - BUILD_VERSION + run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + - name: ENV - BUILD_COMMIT + run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV + ########################################################################## + # LOGIN SERVER ########################################################### + ########################################################################## + - name: Login Server | Build `production` image + run: | + docker build -t "gradido/login_server:latest" -t "gradido/login_server:production" -t "gradido/login_server:${VERSION}" -t "gradido/login_server:${BUILD_VERSION}" login_server/ + docker save "gradido/login_server" > /tmp/login_server.tar + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: docker-login-server-production + path: /tmp/login_server.tar ############################################################################## - # JOB: DOCKER BUILD PRODUCTION WEBAPP ######################################## + # JOB: DOCKER BUILD PRODUCTION COMMUNITY SERVER ############################## ############################################################################## - #build_production_webapp: - # name: Docker Build Production - WebApp - # runs-on: ubuntu-latest - # needs: [prepare] - # steps: - # ########################################################################## - # # CHECKOUT CODE ########################################################## - # ########################################################################## - # - name: Checkout code - # uses: actions/checkout@v2 - # ########################################################################## - # # SET ENVS ############################################################### - # ########################################################################## - # - name: ENV - VERSION - # run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV - # - name: ENV - BUILD_DATE - # run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV - # - name: ENV - BUILD_VERSION - # run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV - # - name: ENV - BUILD_COMMIT - # run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV - # ########################################################################## - # # BUILD WEBAPP DOCKER IMAGE (build) ###################################### - # ########################################################################## - # - name: webapp | Build `production` image - # run: | - # docker build --target production -t "ocelotsocialnetwork/webapp:latest" -t "ocelotsocialnetwork/webapp:${VERSION}" -t "ocelotsocialnetwork/webapp:${BUILD_VERSION}" webapp/ - # docker save "ocelotsocialnetwork/webapp" > /tmp/webapp.tar - # - name: Upload Artifact - # uses: actions/upload-artifact@v2 - # with: - # name: docker-webapp-production - # path: /tmp/webapp.tar + build_production_community_server: + name: Docker Build Production - Community Server + runs-on: ubuntu-latest + #needs: [nothing] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + ########################################################################## + # SET ENVS ############################################################### + ########################################################################## + - name: ENV - VERSION + run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV + - name: ENV - BUILD_DATE + run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - BUILD_VERSION + run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + - name: ENV - BUILD_COMMIT + run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV + ########################################################################## + # COMMUNITY SERVER ####################################################### + ########################################################################## + - name: Community Server | Build `production` image + run: | + docker build -t "gradido/community_server:latest" -t "gradido/community_server:production" -t "gradido/community_server:${VERSION}" -t "gradido/community_server:${BUILD_VERSION}" -f ./community_server/Dockerfile ./ + docker save "gradido/community_server" > /tmp/community_server.tar + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: docker-community-server-production + path: /tmp/community_server.tar ############################################################################## - # JOB: DOCKER BUILD PRODUCTION MAINTENANCE ################################### + # JOB: DOCKER BUILD PRODUCTION MARIADB ####################################### ############################################################################## - #build_production_maintenance: - # name: Docker Build Production - Maintenance - # runs-on: ubuntu-latest - # needs: [prepare] - # steps: - # ########################################################################## - # # CHECKOUT CODE ########################################################## - # ########################################################################## - # - name: Checkout code - # uses: actions/checkout@v2 - # ########################################################################## - # # SET ENVS ############################################################### - # ########################################################################## - # - name: ENV - VERSION - # run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV - # - name: ENV - BUILD_DATE - # run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV - # - name: ENV - BUILD_VERSION - # run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV - # - name: ENV - BUILD_COMMIT - # run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV - # ########################################################################## - # # BUILD MAINTENANCE DOCKER IMAGE (build) ################################# - # ########################################################################## - # - name: maintenance | Build `production` image - # # TODO: --target production - # run: | - # docker build -t "ocelotsocialnetwork/maintenance:latest" -t "ocelotsocialnetwork/maintenance:${VERSION}" -t "ocelotsocialnetwork/maintenance:${BUILD_VERSION}" webapp/ -f webapp/Dockerfile.maintenance - # docker save "ocelotsocialnetwork/maintenance" > /tmp/maintenance.tar - # - name: Upload Artifact - # uses: actions/upload-artifact@v2 - # with: - # name: docker-maintenance-production - # path: /tmp/maintenance.tar + build_production_mariadb: + name: Docker Build Production - MariaDB + runs-on: ubuntu-latest + #needs: [nothing] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + ########################################################################## + # SET ENVS ############################################################### + ########################################################################## + - name: ENV - VERSION + run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV + - name: ENV - BUILD_DATE + run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - BUILD_VERSION + run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + - name: ENV - BUILD_COMMIT + run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV + ########################################################################## + # MARIADB ################################################################ + ########################################################################## + - name: MariaDB | Build `production` image + run: | + docker build -t "gradido/mariadb:latest" -t "gradido/mariadb:production" -t "gradido/mariadb:${VERSION}" -t "gradido/mariadb:${BUILD_VERSION}" -f ./mariadb/Dockerfile ./ + docker save "gradido/mariadb" > /tmp/mariadb.tar + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: docker-mariadb-production + path: /tmp/mariadb.tar + + ############################################################################## + # JOB: DOCKER BUILD PRODUCTION NGINX ######################################### + ############################################################################## + build_production_nginx: + name: Docker Build Production - Nginx + runs-on: ubuntu-latest + #needs: [nothing] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + ########################################################################## + # SET ENVS ############################################################### + ########################################################################## + - name: ENV - VERSION + run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV + - name: ENV - BUILD_DATE + run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - BUILD_VERSION + run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + - name: ENV - BUILD_COMMIT + run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV + ########################################################################## + # NGINX ################################################################## + ########################################################################## + - name: Nginx | Build `production` image + run: | + docker build -t "gradido/nginx:latest" -t "gradido/nginx:production" -t "gradido/nginx:${VERSION}" -t "gradido/nginx:${BUILD_VERSION}" -f ./nginx/Dockerfile ./ + docker save "gradido/nginx" > /tmp/nginx.tar + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: docker-nginx-production + path: /tmp/nginx.tar ############################################################################## # JOB: UPLOAD TO DOCKERHUB ################################################### @@ -182,7 +199,7 @@ jobs: upload_to_dockerhub: name: Upload to Dockerhub runs-on: ubuntu-latest - needs: [build_production_frontend] + needs: [build_production_frontend, build_production_login_server, build_production_community_server, build_production_mariadb, build_production_nginx] env: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} @@ -202,27 +219,34 @@ jobs: path: /tmp - name: Load Docker Image run: docker load < /tmp/frontend.tar - #- name: Download Docker Image (Backend) - # uses: actions/download-artifact@v2 - # with: - # name: docker-backend-production - # path: /tmp - #- name: Load Docker Image - # run: docker load < /tmp/backend.tar - #- name: Download Docker Image (WebApp) - # uses: actions/download-artifact@v2 - # with: - # name: docker-webapp-production - # path: /tmp - #- name: Load Docker Image - # run: docker load < /tmp/webapp.tar - #- name: Download Docker Image (Maintenance) - # uses: actions/download-artifact@v2 - # with: - # name: docker-maintenance-production - # path: /tmp - #- name: Load Docker Image - # run: docker load < /tmp/maintenance.tar + - name: Download Docker Image (Login Server) + uses: actions/download-artifact@v2 + with: + name: docker-login-server-production + path: /tmp + - name: Load Docker Image + run: docker load < /tmp/login_server.tar + - name: Download Docker Image (Community Server) + uses: actions/download-artifact@v2 + with: + name: docker-community-server-production + path: /tmp + - name: Load Docker Image + run: docker load < /tmp/community_server.tar + - name: Download Docker Image (MariaDB) + uses: actions/download-artifact@v2 + with: + name: docker-mariadb-production + path: /tmp + - name: Load Docker Image + run: docker load < /tmp/mariadb.tar + - name: Download Docker Image (Nginx) + uses: actions/download-artifact@v2 + with: + name: docker-nginx-production + path: /tmp + - name: Load Docker Image + run: docker load < /tmp/nginx.tar ########################################################################## # Upload ################################################################# ########################################################################## @@ -230,16 +254,18 @@ jobs: run: echo "${DOCKERHUB_TOKEN}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin - name: Push frontend run: docker push --all-tags gradido/frontend - #- name: Push backend - # run: docker push --all-tags ocelotsocialnetwork/backend - #- name: Push webapp - # run: docker push --all-tags ocelotsocialnetwork/webapp - #- name: Push maintenance - # run: docker push --all-tags ocelotsocialnetwork/maintenance + - name: Push login_server + run: docker push --all-tags gradido/login_server + - name: Push community_server + run: docker push --all-tags gradido/community_server + - name: Push MariaDB + run: docker push --all-tags gradido/mariadb + - name: Push Nginx + run: docker push --all-tags gradido/nginx - ############################################################################## # JOB: GITHUB TAG LATEST VERSION ############################################# ############################################################################## + ############################################################################## github_tag: name: Tag latest version on Github runs-on: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78d381820..9023a5df9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,17 +46,17 @@ jobs: with: submodules: recursive ########################################################################## - # BUILD LOGIN SERVER DOCKER IMAGE (build) ################################ + # BUILD LOGIN SERVER DOCKER IMAGE ######################################## ########################################################################## - name: login server | Build `test` image run: | - docker build --target login_server_debug -t "gradido/loginserver:test" -f ./login_server/Dockerfile.debug login_server/ - docker save "gradido/loginserver:test" > /tmp/loginserver.tar + docker build --target login_server_debug -t "gradido/login_server:test" -f ./login_server/Dockerfile.debug login_server/ + docker save "gradido/login_server:test" > /tmp/login_server.tar - name: Upload Artifact uses: actions/upload-artifact@v2 with: - name: docker-loginserver-test - path: /tmp/loginserver.tar + name: docker-login-server-test + path: /tmp/login_server.tar ############################################################################## # JOB: DOCKER BUILD TEST COMMUNITY SERVER #################################### @@ -72,23 +72,75 @@ jobs: - name: Checkout code uses: actions/checkout@v2 ########################################################################## - # BUILD COMMUNITY SERVER DOCKER IMAGE (build) ############################ + # BUILD COMMUNITY SERVER DOCKER IMAGE #################################### ########################################################################## - name: community server | Build `test` image run: | - docker build -t "gradido/communityserver:test" -f ./community_server/Dockerfile ./ - docker save "gradido/communityserver:test" > /tmp/communityserver.tar + docker build -t "gradido/community_server:test" -f ./community_server/Dockerfile ./ + docker save "gradido/community_server:test" > /tmp/community_server.tar - name: Upload Artifact uses: actions/upload-artifact@v2 with: - name: docker-communityserver-test - path: /tmp/communityserver.tar + name: docker-community-server-test + path: /tmp/community_server.tar + + ############################################################################## + # JOB: DOCKER BUILD TEST MARIADB ############################################# + ############################################################################## + build_test_mariadb: + name: Docker Build Test - MariaDB + runs-on: ubuntu-latest + #needs: [nothing] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + ########################################################################## + # BUILD MARIADB DOCKER IMAGE ############################################# + ########################################################################## + - name: mariadb | Build `test` image + run: | + docker build -t "gradido/mariadb:test" -f ./mariadb/Dockerfile ./ + docker save "gradido/mariadb:test" > /tmp/mariadb.tar + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: docker-mariadb-test + path: /tmp/mariadb.tar + + ############################################################################## + # JOB: DOCKER BUILD TEST NGINX ############################################### + ############################################################################## + build_test_nginx: + name: Docker Build Test - Nginx + runs-on: ubuntu-latest + #needs: [nothing] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + ########################################################################## + # BUILD NGINX DOCKER IMAGE ############################################# + ########################################################################## + - name: nginx | Build `test` image + run: | + docker build -t "gradido/nginx:test" -f ./nginx/Dockerfile ./ + docker save "gradido/nginx:test" > /tmp/nginx.tar + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: docker-nginx-test + path: /tmp/nginx.tar ############################################################################## # JOB: LINT FRONTEND ######################################################### ############################################################################## lint_frontend: - name: Lint frontend + name: Lint - Frontend runs-on: ubuntu-latest needs: [build_test_frontend] steps: @@ -155,11 +207,12 @@ jobs: # COVERAGE CHECK FRONTEND ################################################ ########################################################################## - name: frontend | Coverage check - uses: devmasx/coverage-check-action@v1.2.0 + uses: webcraftmedia/coverage-check-action@master with: + report_name: Coverage Frontend type: lcov result_path: ./coverage/lcov.info - min_coverage: 10 + min_coverage: 11 token: ${{ github.token }} #test: diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 08665fd04..7dad57d93 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -37,9 +37,9 @@ services: ######################################################### ## COMMUNITY SERVER (cakephp with php-fpm) ############## ######################################################### - community-server: - volumes: - - ./community_server + #community-server: + # volumes: + # - ./community_server ######################################################### diff --git a/frontend/src/App.vue b/frontend/src/App.vue index f9cc4216f..6cf78bb54 100755 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -17,7 +17,7 @@
- +
@@ -26,11 +26,15 @@ import { ParticlesBg } from 'particles-bg-vue' import icon from './icon.js' import { localeChanged } from 'vee-validate' +import DashboardLayout from '@/views/Layout/DashboardLayout_gdd.vue' +import AuthLayoutGDD from '@/views/Layout/AuthLayout_gdd.vue' export default { name: 'app', components: { ParticlesBg, + DashboardLayout, + AuthLayoutGDD, }, data() { return { @@ -56,7 +60,10 @@ export default { this.$router.push('overview') } else { //console.log('app.vue to Logout') - this.$store.dispatch('logout') + if (this.$route.path == '/reset') { + } else { + this.$store.dispatch('logout') + } } }, data() { diff --git a/frontend/src/apis/communityAPI.js b/frontend/src/apis/communityAPI.js index 1c90163d3..fb8696949 100644 --- a/frontend/src/apis/communityAPI.js +++ b/frontend/src/apis/communityAPI.js @@ -36,7 +36,9 @@ const communityAPI = { return apiGet(CONFIG.COMMUNITY_API_STATE_BALANCE_URL + 'getBalance/' + session_id) }, transactions: async (session_id) => { - return apiGet(CONFIG.COMMUNITY_API_STATE_BALANCE_URL + 'listTransactions/1/25/ASC/' + session_id) + return apiGet( + CONFIG.COMMUNITY_API_STATE_BALANCE_URL + 'listTransactions/1/25/ASC/' + session_id, + ) }, /*create: async (session_id, email, amount, memo, target_date = new Date() ) => { const payload = { diff --git a/frontend/src/apis/loginAPI.js b/frontend/src/apis/loginAPI.js index d422fe3ff..91020ddbb 100644 --- a/frontend/src/apis/loginAPI.js +++ b/frontend/src/apis/loginAPI.js @@ -63,6 +63,15 @@ const loginAPI = { } return apiPost(CONFIG.LOGIN_API_URL + 'createUser', payload) }, + sendEmail: async (email, email_text = 7, email_verification_code_type = 'resetPassword') => { + //console.log('api email', email) + const payload = { + email, + email_text, + email_verification_code_type, + } + return apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', payload) + }, } export default loginAPI diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 3b9d2e217..0e60a3094 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -8,6 +8,7 @@ "imprint":"Impressum", "privacy_policy":"Datenschutzerklärung", "members_area": "Mitgliedsbereich", + "whitepaper": "Whitepaper", "back":"Zurück", "send":"Senden", "transactions":"Transaktionen", @@ -24,7 +25,7 @@ "sender":"Absender", "firstname":"Vorname", "lastname":"Nachname", - "email":"eMail", + "email":"E-Mail", "email_repeat":"eMail wiederholen", "password":"Passwort", "password_repeat":"Passwort wiederholen", @@ -59,9 +60,12 @@ "signup": { "title": "Erstelle dein Gradido-Konto", "subtitle": "Werde Teil der Gemeinschaft!", - "strength":"Passwortsicherheit:", - "strong":"stark", - "agree":"habe ich gelesen und verstanden und stimme diesen zu." + "agree":"Ich stimme der Datenschutzerklärung zu.", + "lowercase":"Ein Kleinbuchstabe erforderlich.", + "uppercase":"Ein Großbuchstabe erforderlich.", + "minimum":"Mindestens 8 Zeichen.", + "one_number":"Eine Zahl erforderlich.", + "dont_match":"Die Passwörter stimmen nicht überein." }, "password": { "title": "Passwort zurücksetzen", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index d05a9e0d5..1dc703f14 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -8,6 +8,7 @@ "imprint":"Legal notice", "privacy_policy":"Privacy policy", "members_area": "Member's area", + "whitepaper": "Whitepaper", "back":"Back", "send":"Send", "transactions":"Transactions", @@ -59,9 +60,12 @@ "signup": { "title": "Create your Gradido account", "subtitle": "Become a part of the community!", - "strength":"Password strength:", - "strong":"strong", - "agree":"I have read and understood and agree to them" + "agree":"I agree to the privacy policy.", + "lowercase":"One lowercase letter required.", + "uppercase":"One uppercase letter required.", + "minimum":"8 characters minimum.", + "one_number":"One number required.", + "dont_match":"Passwords don't match." }, "password": { "title": "Reset password", diff --git a/frontend/src/routes/router.js b/frontend/src/routes/router.js index cd3646fe0..571c64582 100644 --- a/frontend/src/routes/router.js +++ b/frontend/src/routes/router.js @@ -21,10 +21,6 @@ const router = new VueRouter({ }) router.beforeEach((to, from, next) => { - let language = to.params.lang - if (!language) { - language = 'de' - } next() }) diff --git a/frontend/src/routes/routes.js b/frontend/src/routes/routes.js index fba892f1a..f70afa1b5 100755 --- a/frontend/src/routes/routes.js +++ b/frontend/src/routes/routes.js @@ -1,66 +1,48 @@ -import DashboardLayout from '@/views/Layout/DashboardLayout_gdd.vue' -import AuthLayoutGDD from '@/views/Layout/AuthLayout_gdd.vue' - import NotFound from '@/views/NotFoundPage.vue' const routes = [ { - path: '/login', - redirect: 'login', - component: AuthLayoutGDD, - children: [ - { - path: '/login', - component: () => import('../views/Pages/Login.vue'), - }, - { - path: '/thx', - component: () => import('../views/Pages/thx.vue'), - }, - { - path: '/register', - component: () => import('../views/Pages/Register.vue'), - }, - { - path: '/password', - component: () => import('../views/Pages/Password.vue'), - }, - { - path: '/explorer', - name: 'Explorer', - component: () => import('../views/Pages/Explorer.vue'), - }, - ], + path: '/overview', + component: () => import('../views/Pages/KontoOverview.vue'), + meta: { + requiresAuth: true, + }, }, { - path: '/overview', - redirect: 'overview', - component: DashboardLayout, - children: [ - { - path: '/overview', - component: () => import('../views/KontoOverview.vue'), - meta: { - requiresAuth: true, - }, - }, - { - path: '/profile', - component: () => import('../views/Pages/UserProfileCard.vue'), - }, - { - path: '/profileedit', - component: () => import('../views/Pages/UserProfileEdit.vue'), - }, - { - path: '/activity', - component: () => import('../views/Pages/UserProfileActivity.vue'), - }, - { - path: '/transactions', - component: () => import('../views/Pages/UserProfileTransactionList.vue'), - }, - ], + path: '/profile', + component: () => import('../views/Pages/UserProfileCard.vue'), + }, + { + path: '/profileedit', + component: () => import('../views/Pages/UserProfileEdit.vue'), + }, + { + path: '/activity', + component: () => import('../views/Pages/UserProfileActivity.vue'), + }, + { + path: '/transactions', + component: () => import('../views/Pages/UserProfileTransactionList.vue'), + }, + { + path: '/login', + component: () => import('../views/Pages/Login.vue'), + }, + { + path: '/thx', + component: () => import('../views/Pages/thx.vue'), + }, + { + path: '/register', + component: () => import('../views/Pages/Register.vue'), + }, + { + path: '/password', + component: () => import('../views/Pages/ForgotPassword.vue'), + }, + { + path: '/reset', + component: () => import('../views/Pages/ResetPassword.vue'), }, { path: '*', component: NotFound }, ] diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js index 96b2c4be8..65463a3df 100644 --- a/frontend/src/store/store.js +++ b/frontend/src/store/store.js @@ -63,7 +63,6 @@ export const store = new Vuex.Store({ state.user.balance_gdt = balance / 10000 }, }, - // Asyncronous actions - used for api calls actions: { login: async ({ dispatch, commit }, data) => { const result = await loginAPI.login(data.email, data.password) @@ -74,19 +73,11 @@ export const store = new Vuex.Store({ $cookies.set('gdd_u', data.email) router.push('/overview') } else { - // Register failed, we perform a logout - //alert('>>>>> FAIl LOGIN') commit('loginfail', true) //dispatch('logout') } }, - passwordReset: async (data) => { - //console.log('<<<<<<<<<<< PASSWORT RESET TODO >>>>>>>>>>>', data.email) - }, - schoepfen: async (data) => { - // http://localhost/transaction-creations/ajaxCreate - }, createUser: async ({ commit, dispatch }, data) => { // console.log('action: createUser') const result = await loginAPI.create( diff --git a/frontend/src/views/Layout/Content.vue b/frontend/src/views/Layout/Content.vue deleted file mode 100755 index d29de692c..000000000 --- a/frontend/src/views/Layout/Content.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/frontend/src/views/Layout/ContentFooter.spec.js b/frontend/src/views/Layout/ContentFooter.spec.js index 6af55fe16..ec4d3ff74 100644 --- a/frontend/src/views/Layout/ContentFooter.spec.js +++ b/frontend/src/views/Layout/ContentFooter.spec.js @@ -41,63 +41,97 @@ describe('ContentFooter', () => { }) it('links to the login page when clicked on copyright', () => { - expect(wrapper.find('div.copyright').find('a').attributes('href')).toEqual('#/Login') + expect(wrapper.find('div.copyright').find('a').attributes('href')).toEqual( + 'https://gradido.net/en', + ) + }) + }) + + describe('version', () => { + it('shows the current version', async () => { + wrapper.setData({ version: 1.23 }) + await wrapper.vm.$nextTick() + expect(wrapper.find('div.copyright').findAll('a').at(1).text()).toEqual('App version 1.23') + }) + + it('links to latest release on GitHub', () => { + expect(wrapper.find('div.copyright').findAll('a').at(1).attributes('href')).toEqual( + 'https://github.com/gradido/gradido/releases/latest', + ) }) }) describe('links to gradido.net', () => { - it('has a link to the gradido.net', () => { - expect(wrapper.findAll('a.nav-link').at(0).text()).toEqual('Gradido') - }) - - it('links to the https://gradido.net/en when locale is en', () => { - expect(wrapper.findAll('a.nav-link').at(0).attributes('href')).toEqual( - 'https://gradido.net/en', - ) - }) - it('has a link to the legal notice', () => { - expect(wrapper.findAll('a.nav-link').at(1).text()).toEqual('imprint') + expect(wrapper.findAll('a.nav-link').at(0).text()).toEqual('imprint') }) it('links to the https://gradido.net/en/impressum when locale is en', () => { - expect(wrapper.findAll('a.nav-link').at(1).attributes('href')).toEqual( + expect(wrapper.findAll('a.nav-link').at(0).attributes('href')).toEqual( 'https://gradido.net/en/impressum/', ) }) it('has a link to the privacy policy', () => { - expect(wrapper.findAll('a.nav-link').at(2).text()).toEqual('privacy_policy') + expect(wrapper.findAll('a.nav-link').at(1).text()).toEqual('privacy_policy') }) it('links to the https://gradido.net/en/datenschutz when locale is en', () => { - expect(wrapper.findAll('a.nav-link').at(2).attributes('href')).toEqual( + expect(wrapper.findAll('a.nav-link').at(1).attributes('href')).toEqual( 'https://gradido.net/en/datenschutz/', ) }) + it('has a link to the members area', () => { + expect(wrapper.findAll('a.nav-link').at(2).text()).toEqual('members_area') + }) + + it('links to the elopage', () => { + expect(wrapper.findAll('a.nav-link').at(2).attributes('href')).toEqual( + 'https://elopage.com/s/gradido/sign_in?locale=en', + ) + }) + + it('links to the whitepaper', () => { + expect(wrapper.findAll('a.nav-link').at(3).attributes('href')).toEqual( + 'https://docs.google.com/document/d/1kcX1guOi6tDgnFHD9tf7fB_MneKTx-0nHJxzdN8ygNs/edit?usp=sharing', + ) + }) + describe('links are localized', () => { beforeEach(() => { mocks.$i18n.locale = 'de' }) it('links to the https://gradido.net/de when locale is de', () => { - expect(wrapper.findAll('a.nav-link').at(0).attributes('href')).toEqual( + expect(wrapper.find('div.copyright').find('a').attributes('href')).toEqual( 'https://gradido.net/de', ) }) it('links to the https://gradido.net/de/impressum when locale is de', () => { - expect(wrapper.findAll('a.nav-link').at(1).attributes('href')).toEqual( + expect(wrapper.findAll('a.nav-link').at(0).attributes('href')).toEqual( 'https://gradido.net/de/impressum/', ) }) it('links to the https://gradido.net/de/datenschutz when locale is de', () => { - expect(wrapper.findAll('a.nav-link').at(2).attributes('href')).toEqual( + expect(wrapper.findAll('a.nav-link').at(1).attributes('href')).toEqual( 'https://gradido.net/de/datenschutz/', ) }) + + it('links to the German elopage when locale is de', () => { + expect(wrapper.findAll('a.nav-link').at(2).attributes('href')).toEqual( + 'https://elopage.com/s/gradido/sign_in?locale=de', + ) + }) + + it('links to the German whitepaper when locale is de', () => { + expect(wrapper.findAll('a.nav-link').at(3).attributes('href')).toEqual( + 'https://docs.google.com/document/d/1jZp-DiiMPI9ZPNXmjsvOQ1BtnfDFfx8BX7CDmA8KKjY/edit?usp=sharing', + ) + }) }) }) }) diff --git a/frontend/src/views/Layout/ContentFooter.vue b/frontend/src/views/Layout/ContentFooter.vue index a12831a49..b261cafb3 100755 --- a/frontend/src/views/Layout/ContentFooter.vue +++ b/frontend/src/views/Layout/ContentFooter.vue @@ -4,10 +4,12 @@ @@ -15,9 +17,6 @@ - - Gradido - {{ $t('imprint') }} @@ -30,6 +29,16 @@ > {{ $t('members_area') }} + + {{ $t('whitepaper') }} + diff --git a/frontend/src/views/Pages/Password.vue b/frontend/src/views/Pages/ForgotPassword.vue similarity index 79% rename from frontend/src/views/Pages/Password.vue rename to frontend/src/views/Pages/ForgotPassword.vue index 0db2a2725..d99d7731e 100644 --- a/frontend/src/views/Pages/Password.vue +++ b/frontend/src/views/Pages/ForgotPassword.vue @@ -26,17 +26,10 @@ :placeholder="$t('form.email')" name="Email" :rules="{ required: true, email: true }" - v-model="model.email" + v-model="form.email" > - {{ form }}
- + {{ $t('site.password.reset_now') }}
@@ -53,21 +46,26 @@ diff --git a/frontend/src/views/Pages/ResetPassword.spec.js b/frontend/src/views/Pages/ResetPassword.spec.js new file mode 100644 index 000000000..ebff0fc20 --- /dev/null +++ b/frontend/src/views/Pages/ResetPassword.spec.js @@ -0,0 +1,107 @@ +import { mount, RouterLinkStub } from '@vue/test-utils' +import Vuex from 'vuex' +import flushPromises from 'flush-promises' + +import ResetPassword from './ResetPassword' + +const localVue = global.localVue + +describe('ResetPassword', () => { + let wrapper + + let mocks = { + $i18n: { + locale: 'en', + }, + $t: jest.fn((t) => t), + } + + let state = { + // loginfail: false, + } + + let store = new Vuex.Store({ + state, + }) + + let stubs = { + RouterLink: RouterLinkStub, + } + + const Wrapper = () => { + return mount(ResetPassword, { localVue, mocks, store, stubs }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders the Reset Password form', () => { + expect(wrapper.find('div.resetpwd-form').exists()).toBeTruthy() + }) + + //describe('Register header', () => { + // it('has a welcome message', () => { + // expect(wrapper.find('div.header').text()).toBe('site.signup.title site.signup.subtitle') + // }) + //}) + + //describe('links', () => { + // it('has a link "Back"', () => { + // expect(wrapper.findAllComponents(RouterLinkStub).at(0).text()).toEqual('back') + // }) + + // it('links to /login when clicking "Back"', () => { + // expect(wrapper.findAllComponents(RouterLinkStub).at(0).props().to).toBe('/login') + // }) + //}) + + //describe('Register form', () => { + // it('has a register form', () => { + // expect(wrapper.find('form').exists()).toBeTruthy() + // }) + + // it('has 3 text input fields', () => { + // expect(wrapper.findAll('input[type="text"]').length).toBe(3) + // }) + + // it('has 2 password input fields', () => { + // expect(wrapper.findAll('input[type="password"]').length).toBe(2) + // }) + + // it('has 1 checkbox input fields', () => { + // expect(wrapper.findAll('input[type="checkbox"]').length).toBe(1) + // }) + + // it('has no submit button when not completely filled', () => { + // expect(wrapper.find('button[type="submit"]').exists()).toBe(false) + // }) + + // it('shows a warning when no valid Email is entered', async () => { + // wrapper.findAll('input[type="text"]').at(2).setValue('no_valid@Email') + // await flushPromises() + // await expect(wrapper.find('.invalid-feedback').text()).toEqual( + // 'The Email field must be a valid email', + // ) + // }) + + // it('shows 4 warnings when no password is set', async () => { + // const passwords = wrapper.findAll('input[type="password"]') + // passwords.at(0).setValue('') + // passwords.at(1).setValue('') + // await flushPromises() + // await expect(wrapper.find('div.hints').text()).toContain( + // 'site.signup.lowercase', + // 'site.signup.uppercase', + // 'site.signup.minimum', + // 'site.signup.one_number', + // ) + // }) + + // //TODO test different invalid password combinations + //}) + + // TODO test submit button + }) +}) diff --git a/frontend/src/views/Pages/ResetPassword.vue b/frontend/src/views/Pages/ResetPassword.vue new file mode 100644 index 000000000..145fba404 --- /dev/null +++ b/frontend/src/views/Pages/ResetPassword.vue @@ -0,0 +1,147 @@ + + + diff --git a/login_server/Dockerfile b/login_server/Dockerfile index 7d51a7ca4..e6c2d6b89 100644 --- a/login_server/Dockerfile +++ b/login_server/Dockerfile @@ -1,47 +1,36 @@ ######################################################################################################### # Build release ######################################################################################################### -From conanio/gcc7 as release +From conanio/gcc9 as release ENV DOCKER_WORKDIR="/code" USER root -COPY --from=unicorny/protoc:3.9.1 /usr/bin/protoc /usr/bin/ -COPY --from=unicorny/protoc:3.9.1 /usr/lib/libprotobuf.so.20 /usr/lib/libprotobuf.so.20 -COPY --from=unicorny/protoc:3.9.1 /usr/lib/libprotoc.so.20 /usr/lib/libprotoc.so.20 -COPY --from=unicorny/protoc:3.9.1 /usr/include/google/protobuf/* /usr/include/google/protobuf/ - RUN mkdir -p ${DOCKER_WORKDIR} WORKDIR ${DOCKER_WORKDIR} COPY . . -#RUN git submodule update --init --recursive -RUN ls -la -RUN cd dependencies/iroha-ed25519 && \ - ls -la && \ - mkdir build && \ - cd build && \ - cmake .. -DEDIMPL=ref10 -DHASH=sha2_sphlib -DRANDOM=bcryptgen -DBUILD=STATIC && \ - make -j$(nproc) RUN cd dependencies/mariadb-connector-c && \ mkdir build && \ cd build && \ cmake -DWITH_SSL=OFF .. -RUN chmod +x compile_proto.sh -RUN chmod +x compile_pot.sh -RUN ls -la -RUN ./compile_pot.sh -RUN ./compile_proto.sh +RUN chmod +x compile_pot.sh && ./compile_pot.sh + RUN mkdir build && \ cd build && \ conan install .. --build=missing && \ cmake .. && \ - make -j$(nproc) Gradido_LoginServer + make -j$(nproc) protoc grpc_cpp_plugin +RUN chmod +x unix_parse_proto.sh && ./unix_parse_proto.sh + +RUN cd build && \ + cmake .. && \ + make -j$(nproc) Gradido_LoginServer CMD ["./code"] diff --git a/login_server/src/cpp/SingletonManager/PendingTasksManager.cpp b/login_server/src/cpp/SingletonManager/PendingTasksManager.cpp index 1f8071908..619c6382b 100644 --- a/login_server/src/cpp/SingletonManager/PendingTasksManager.cpp +++ b/login_server/src/cpp/SingletonManager/PendingTasksManager.cpp @@ -192,7 +192,8 @@ void PendingTasksManager::checkForFinishedTasks(Poco::Timer& timer) auto json = transaction->getModel()->getResultJson(); bool removeIt = false; if (!json.isNull()) { - if (json->get("state").toString() == "success") { + auto state = json->get("state"); + if (!state.isEmpty() && state.toString() == "success") { removeIt = true; } } diff --git a/login_server/src/proto b/login_server/src/proto index ff412f735..924b51c87 160000 --- a/login_server/src/proto +++ b/login_server/src/proto @@ -1 +1 @@ -Subproject commit ff412f735667b30233c0ce00d461f209ac7dde7c +Subproject commit 924b51c87fea29d5aaf053af43251dab44c2eeb7