Merge branch 'master' into login_add_publisher_id

This commit is contained in:
einhornimmond 2021-09-17 13:22:57 +02:00
commit 5c60aa2c40
796 changed files with 37196 additions and 30268 deletions

View File

@ -5,21 +5,5 @@ labels: bug
title: 🐛 [Bug]
---
## :bug: Bugreport
## 🐛 Bugreport
<!-- Describe your issue in detail. Include screenshots if needed. Give us as much information as possible. Use a clear and concise description of what the bug is.-->
### Steps to reproduce the behavior
1.
2.
3.
4. ...
5. Profit
### Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
### Version & Environment
<!-- Add context about your environment and used version here. -->
### Additional context
<!-- Add any other context about the problem here. -->

View File

@ -7,18 +7,3 @@ title: 💥 [DevOps]
## 💥 DevOps ticket
<!-- Describe your issue in detail. Include screenshots if needed. Give us as much information as possible. Use a clear and concise description of what the problem is.-->
### Motive
<!-- Why does this task need to be done? What can we benefit from this? -->
### Related issues
<!-- Are there any related issues to link to? Please paste them below for reference. -->
### Implementation
<!-- Please, document any ideas of how the task can be performed. -->
### Validation
<!-- How can we make sure that this task was successful? -->
### Additional context
<!-- Add other context or background about the feature request here.-->

View File

@ -5,20 +5,5 @@ labels: feature
title: 🚀 [Feature]
---
## :rocket: Feature
## 🚀 Feature
<!-- Give a short summary of the Feature. Use Screenshots if you want. -->
### User Problem
<!-- Which problem is this solving? Why do you think this is important? Who will benefit from it and how? -->
### Implementation
<!-- How do you think this feature should be implemented? How will it be used? Where in the network should it be located? Which steps and screens are involved? -->
### Design & Layout
<!-- Attach Screenshots and Sketches to illustrate your idea. -->
### Validation
<!-- How can we make sure that this feature indeed solves the above problem? How do we know if it has been accepted by the users of the network, once released? -->
### Additional context
<!-- Add other context or background about the feature request here.-->

View File

@ -1,11 +1,11 @@
---
name: 💬 Question
about: If you need help understanding HumanConnection.
about: If you need help understanding Gradido.
labels: question
title: 💬 [Question]
---
<!-- Chat with Team Gradido -->
<!-- If you need an answer right away, visit the Gradido Discord: https://discord.gg/kA3zBAKQDC -->
## :speech_balloon: Question
## 💬 Question
<!-- Describe your Question in detail. Include screenshots and drawings if needed. -->

View File

@ -5,17 +5,5 @@ labels: refactor
title: 🔧 [Refactor]
---
## :zap: Refactor ticket
## 🔧 Refactor ticket
<!-- Describe your issue in detail. Include screenshots if needed. Give us as much information as possible. Use a clear and concise description of what the problem is.-->
### Motive
<!-- What is the purpose of this refactoring? If it's removing depcrecated code, please link to the deprecation notice. -->
### Related issues
<!-- Are there any related issues to link to? Please paste them below for reference. -->
### Implementation
<!-- Please, document any ideas of how the code should be refactored. -->
### Additional context
<!-- Add other context or background about the feature request here.-->

12
.github/ISSUE_TEMPLATE/release.md vendored Normal file
View File

@ -0,0 +1,12 @@
---
name: 🏅 Release
about: Define a Release
labels: release
title: 🏅 [RELEASE]
---
<!-- THIS ISSUE-TYPE IS NOT FOR YOU! -->
<!-- Proceed only if you know what you are doing - go chat with Team Gradido -->
<!-- Visit the Gradido Discord: https://discord.gg/kA3zBAKQDC -->
## 🏅 RELEASE
<!-- Describe your Release in detail. Include screenshots and drawings -->

View File

@ -7,7 +7,7 @@ on:
jobs:
##############################################################################
# JOB: DOCKER BUILD COMMUNITY NEO4J ##########################################
# JOB: DOCKER BUILD PRODUCTION FRONTEND ######################################
##############################################################################
build_production_frontend:
name: Docker Build Production - Frontend
@ -43,6 +43,69 @@ jobs:
name: docker-frontend-production
path: /tmp/frontend.tar
##############################################################################
# JOB: DOCKER BUILD PRODUCTION BACKEND #######################################
##############################################################################
build_production_backend:
name: Docker Build Production - Backend
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
##########################################################################
# BACKEND ################################################################
##########################################################################
- name: Backend | Build `production` image
run: |
docker build --target production -t "gradido/backend:latest" -t "gradido/backend:production" -t "gradido/backend:${VERSION}" -t "gradido/backend:${BUILD_VERSION}" backend/
docker save "gradido/backend" > /tmp/backend.tar
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: docker-backend-production
path: /tmp/backend.tar
##############################################################################
# JOB: DOCKER BUILD PRODUCTION DATABASE UP ###################################
##############################################################################
build_production_database_up:
name: Docker Build Production - Database up
runs-on: ubuntu-latest
#needs: [nothing]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v2
##########################################################################
# DATABASE UP ############################################################
##########################################################################
- name: Database | Build `production_up` image
run: |
docker build --target production_up -t "gradido/database:production_up" database/
docker save "gradido/database:production_up" > /tmp/database_up.tar
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: docker-database-production_up
path: /tmp/database_up.tar
##############################################################################
# JOB: DOCKER BUILD PRODUCTION LOGIN SERVER ##################################
##############################################################################
@ -199,7 +262,7 @@ jobs:
upload_to_dockerhub:
name: Upload to Dockerhub
runs-on: ubuntu-latest
needs: [build_production_frontend, build_production_login_server, build_production_community_server, build_production_mariadb, build_production_nginx]
needs: [build_production_frontend, build_production_backend, build_production_database_up, 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 }}
@ -212,13 +275,27 @@ jobs:
##########################################################################
# DOWNLOAD DOCKER IMAGES #################################################
##########################################################################
- name: Download Docker Image (Neo4J)
- name: Download Docker Image (Frontend)
uses: actions/download-artifact@v2
with:
name: docker-frontend-production
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 (Database)
uses: actions/download-artifact@v2
with:
name: docker-database-production_up
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/database_up.tar
- name: Download Docker Image (Login Server)
uses: actions/download-artifact@v2
with:
@ -254,6 +331,10 @@ 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 gradido/backend
- name: Push database
run: docker push --all-tags gradido/database
- name: Push login_server
run: docker push --all-tags gradido/login_server
- name: Push community_server

View File

@ -30,6 +30,58 @@ jobs:
name: docker-frontend-test
path: /tmp/frontend.tar
##############################################################################
# JOB: DOCKER BUILD TEST BACKEND #############################################
##############################################################################
build_test_backend:
name: Docker Build Test - Backend
runs-on: ubuntu-latest
#needs: [nothing]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v2
##########################################################################
# BACKEND ################################################################
##########################################################################
- name: Backend | Build `test` image
run: |
docker build --target test -t "gradido/backend:test" backend/
docker save "gradido/backend:test" > /tmp/backend.tar
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: docker-backend-test
path: /tmp/backend.tar
##############################################################################
# JOB: DOCKER BUILD TEST DATABASE UP #########################################
##############################################################################
build_test_database_up:
name: Docker Build Test - Database up
runs-on: ubuntu-latest
#needs: [nothing]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v2
##########################################################################
# DATABASE UP ############################################################
##########################################################################
- name: Database | Build `test_up` image
run: |
docker build --target test_up -t "gradido/database:test_up" database/
docker save "gradido/database:test_up" > /tmp/database_up.tar
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: docker-database-test_up
path: /tmp/database_up.tar
##############################################################################
# JOB: DOCKER BUILD TEST LOGIN SERVER ########################################
##############################################################################
@ -44,19 +96,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
submodules: true
##########################################################################
# BUILD LOGIN SERVER DOCKER IMAGE ########################################
##########################################################################
- name: login server | Build `test` image
- name: login server | Build `release` image
run: |
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-login-server-test
path: /tmp/login_server.tar
docker build -t "gradido/login_server:release" -f ./login_server/Dockerfile login_server/
##############################################################################
# JOB: DOCKER BUILD TEST COMMUNITY SERVER ####################################
@ -102,7 +148,7 @@ jobs:
##########################################################################
- name: mariadb | Build `test` image
run: |
docker build -t "gradido/mariadb:test" -f ./mariadb/Dockerfile ./
docker build --target mariadb_server_test -t "gradido/mariadb:test" -f ./mariadb/Dockerfile ./
docker save "gradido/mariadb:test" > /tmp/mariadb.tar
- name: Upload Artifact
uses: actions/upload-artifact@v2
@ -124,7 +170,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
##########################################################################
# BUILD NGINX DOCKER IMAGE #############################################
# BUILD NGINX DOCKER IMAGE ###############################################
##########################################################################
- name: nginx | Build `test` image
run: |
@ -136,6 +182,35 @@ jobs:
name: docker-nginx-test
path: /tmp/nginx.tar
##############################################################################
# JOB: LOCALES FRONTEND ######################################################
##############################################################################
locales_frontend:
name: Locales - Frontend
runs-on: ubuntu-latest
needs: [build_test_frontend]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v2
##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Frontend)
uses: actions/download-artifact@v2
with:
name: docker-frontend-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/frontend.tar
##########################################################################
# LOCALES FRONTEND #######################################################
##########################################################################
- name: frontend | Locales
run: docker run --rm gradido/frontend:test yarn run locales
##############################################################################
# JOB: LINT FRONTEND #########################################################
##############################################################################
@ -160,11 +235,69 @@ jobs:
- name: Load Docker Image
run: docker load < /tmp/frontend.tar
##########################################################################
# LINT FRONTEND ###########################################################
# LINT FRONTEND ##########################################################
##########################################################################
- name: frontend | Lint
run: docker run --rm gradido/frontend:test yarn run lint
##############################################################################
# JOB: LINT BACKEND #########################################################
##############################################################################
lint_backend:
name: Lint - Backend
runs-on: ubuntu-latest
needs: [build_test_backend]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v2
##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Backend)
uses: actions/download-artifact@v2
with:
name: docker-backend-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/backend.tar
##########################################################################
# LINT BACKEND ###########################################################
##########################################################################
- name: backend | Lint
run: docker run --rm gradido/backend:test yarn run lint
##############################################################################
# JOB: LINT DATABASE UP ######################################################
##############################################################################
lint_database_up:
name: Lint - Database Up
runs-on: ubuntu-latest
needs: [build_test_database_up]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v2
##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Backend)
uses: actions/download-artifact@v2
with:
name: docker-database-test_up
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/database_up.tar
##########################################################################
# LINT DATABASE ##########################################################
##########################################################################
- name: database | Lint
run: docker run --rm gradido/database:test_up yarn run lint
##############################################################################
# JOB: UNIT TEST FRONTEND ###################################################
##############################################################################
@ -212,20 +345,157 @@ jobs:
report_name: Coverage Frontend
type: lcov
result_path: ./coverage/lcov.info
min_coverage: 12
min_coverage: 67
token: ${{ github.token }}
#test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Build the stack
# run: |
# git submodule update --init --recursive
# docker-compose up -d
# - name: Test
# env:
# GN_INSTANCE_FOLDER: /tmp/gradio-node-instance
# GN_CONTAINER_NAME: gradido-node-build
# run: docker run gradido-node-test
# timeout-minutes: 2
##############################################################################
# JOB: UNIT TEST LOGIN-SERVER ###############################################
##############################################################################
unit_test_login_server:
name: Unit tests - Login-Server
runs-on: ubuntu-latest
needs: []
services:
mariadb:
image: gradido/mariadb:test
env:
MARIADB_ALLOW_EMPTY_PASSWORD: 1
MARIADB_USER: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping"
--health-interval=6s
--health-timeout=3s
--health-retries=4
steps:
- name: Debug service
run: echo "$(docker ps)"
- name: Debug container choosing script
run: echo "$(docker container ls | grep mariadb | awk '{ print $1 }')"
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
##########################################################################
# Build Login-Server Test Docker image ###################################
##########################################################################
- name: login server | Build `test` image
run: |
docker build -t "gradido/login_server:test" -f ./login_server/Dockerfiles/ubuntu/Dockerfile.test login_server/
##########################################################################
# UNIT TESTS BACKEND LOGIN-SERVER #######################################
##########################################################################
- name: Login-Server | Unit tests
run: |
docker run --network container:$(docker container ls | grep mariadb | awk '{ print $1 }') -v ~/coverage:/code/build_cov/coverage -v $(pwd)/configs/login_server:/etc/grd_login gradido/login_server:test
cp -r ~/coverage ./coverage
##########################################################################
# COVERAGE CHECK BACKEND LOGIN-SERVER ####################################
##########################################################################
- name: backend login | Coverage check
uses: webcraftmedia/coverage-check-action@master
with:
report_name: Coverage Backend Login
type: lcov
result_path: ./coverage/coverage.info
min_coverage: 34
token: ${{ github.token }}
##############################################################################
# JOB: UNIT TEST COMMUNITY-SERVER ###########################################
##############################################################################
unit_test_community_server:
name: Unit tests - Community Server
runs-on: ubuntu-latest
needs: [build_test_community_server]
services:
mariadb:
image: gradido/mariadb:test
env:
MARIADB_ALLOW_EMPTY_PASSWORD: 1
MARIADB_USER: root
# ports:
# - 3306:3306
options: --health-cmd="mysqladmin ping"
--health-interval=5s
--health-timeout=5s
--health-retries=3
steps:
- name: get mariadb container id
run: echo "::set-output name=id::$(docker container ls | grep mariadb | awk '{ print $1 }')"
id: mariadb_container
- name: show networks
run: echo "$(docker network ls)"
- name: get automatic created network
run: echo "::set-output name=id::$(docker network ls | grep github_network | awk '{ print $1 }')"
id: network
- name: Start Login-Server
run: docker run --network ${{ steps.network.outputs.id }} --name=login-server -d gradido/login_server:with-config
- name: get login-server container id
run: echo "::set-output name=id::$(docker container ls | grep login_server | awk '{ print $1 }')"
id: login_server_container
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v2
##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Community-Server)
uses: actions/download-artifact@v2
with:
name: docker-community-server-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/community_server.tar
# for debugging login-server
- name: check login-server
run: docker logs ${{ steps.login_server_container.outputs.id }}
- name: check mariadb
run: docker logs ${{ steps.mariadb_container.outputs.id }}
##########################################################################
# UNIT TESTS BACKEND COMMUNITY-SERVER #######################################
##########################################################################
- name: community server | Unit tests
run: |
docker run --network ${{ steps.network.outputs.id }} -v ~/coverage:/var/www/cakephp/webroot/coverage gradido/community_server:test
cp -r ~/coverage ./coverage
#########################################################################
# COVERAGE CHECK BACKEND COMMUNITY-SERVER ####################################
##########################################################################
- name: backend community | Coverage check
uses: einhornimmond/coverage-check-action@master
with:
report_name: Coverage Backend Community
type: phpunit
result_path: ./coverage/coverage.info
min_coverage: 10
token: ${{ github.token }}
##########################################################################
# DATABASE MIGRATION TEST UP + RESET #####################################
##########################################################################
database_migration_test:
name: Database Migration Test - Up + Reset
runs-on: ubuntu-latest
#needs: [nothing]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v2
##########################################################################
# DOCKER COMPOSE DATABASE UP + RESET #####################################
##########################################################################
- name: database | docker-compose
run: docker-compose -f docker-compose.yml up --detach mariadb
- name: database | up
run: docker-compose -f docker-compose.yml run -T database yarn up
- name: database | reset
run: docker-compose -f docker-compose.yml run -T database yarn reset

4
.gitignore vendored
View File

@ -1,3 +1,7 @@
*.log
/node_modules/*
.vscode
messages.pot
.skeema
nbproject
.metadata

17
.gitmodules vendored
View File

@ -15,17 +15,22 @@
[submodule "login_server/dependencies/spirit-po"]
path = login_server/dependencies/spirit-po
url = https://github.com/cbeck88/spirit-po.git
[submodule "login_server/dependencies/grpc"]
path = login_server/dependencies/grpc
url = https://github.com/grpc/grpc.git
[submodule "login_server/dependencies/poco"]
path = login_server/dependencies/poco
url = https://github.com/pocoproject/poco.git
[submodule "login_server/dependencies/cmake-modules"]
path = login_server/dependencies/cmake-modules
url = https://github.com/viaduck/cmake-modules.git
[submodule "community_server/src/protobuf"]
path = community_server/src/protobuf
url = git@github.com:gradido/gradido_protocol.git
url = https://github.com/gradido/gradido_protocol.git
[submodule "login_server/dependencies/libsodium"]
path = login_server/dependencies/libsodium
url = https://github.com/jedisct1/libsodium.git
[submodule "login_server/src/proto"]
path = login_server/src/proto
url = https://github.com/gradido/gradido_protocol.git
[submodule "login_server/dependencies/protobuf"]
path = login_server/dependencies/protobuf
url = https://github.com/protocolbuffers/protobuf.git

View File

@ -4,8 +4,301 @@ All notable changes to this project will be documented in this file. Dates are d
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### [1.3.1](https://github.com/gradido/gradido/compare/1.2.1...1.3.1)
- update code for correct transactions listening [`#725`](https://github.com/gradido/gradido/pull/725)
- bugfix: change to new frontend passwort reset [`#724`](https://github.com/gradido/gradido/pull/724)
- feat: Add Pagination Buttons to GDT Transaction List [`#716`](https://github.com/gradido/gradido/pull/716)
- fix bug, change statment from transaction infbox [`#712`](https://github.com/gradido/gradido/pull/712)
- 650-display of the gdt transactions [`#687`](https://github.com/gradido/gradido/pull/687)
- Login-Server bug fix, allow names with 2 characters also [`#714`](https://github.com/gradido/gradido/pull/714)
- Apollo sendCoins via Login-Server [`#699`](https://github.com/gradido/gradido/pull/699)
- increase coverage to 34% [`#700`](https://github.com/gradido/gradido/pull/700)
- mobile friendly, add text, change text [`#683`](https://github.com/gradido/gradido/pull/683)
- Css color input error [`#646`](https://github.com/gradido/gradido/pull/646)
- Apollo gdt [`#686`](https://github.com/gradido/gradido/pull/686)
- Backend Setup [`#584`](https://github.com/gradido/gradido/pull/584)
- text-size in textarea and font-variante if focus [`#677`](https://github.com/gradido/gradido/pull/677)
- 680 app large maximum width [`#681`](https://github.com/gradido/gradido/pull/681)
- linting, server is working [`34b30b2`](https://github.com/gradido/gradido/commit/34b30b216b6fafcb5b686d4b023b05f2e9766bdf)
- server stack seems to work. Graphql does not load properly yet [`43f7cf8`](https://github.com/gradido/gradido/commit/43f7cf87679713d436a64d569d6af1594a12ee33)
- initial commit, base packages [`fdf0979`](https://github.com/gradido/gradido/commit/fdf0979830fece04208a6b3bb06bb5323a3c149b)
#### [1.2.1](https://github.com/gradido/gradido/compare/1.2.0...1.2.1)
> 22 July 2021
- release 1.2.1 [`#670`](https://github.com/gradido/gradido/pull/670)
- exchange positions of decay in transaction in old frontend [`#662`](https://github.com/gradido/gradido/pull/662)
- fix unneccessary migration run on fresh (docker) setup [`#654`](https://github.com/gradido/gradido/pull/654)
- move back decay as standalone transaction in old frontend [`#656`](https://github.com/gradido/gradido/pull/656)
- fix display error with creation [`#652`](https://github.com/gradido/gradido/pull/652)
- release [`a0b8056`](https://github.com/gradido/gradido/commit/a0b8056c17b22570a1b1dbb6fa6ce71e561b04af)
- update content for frontend [`d37ce09`](https://github.com/gradido/gradido/commit/d37ce0949ef97d2a6c6ffaf0be31db9f6d92e743)
- exchange positions [`bc000ef`](https://github.com/gradido/gradido/commit/bc000efd87c9701480c4aeaa7b819ab49bfe8f01)
#### [1.2.0](https://github.com/gradido/gradido/compare/1.1.1...1.2.0)
> 20 July 2021
- feat: Release v1.2.0 [`#648`](https://github.com/gradido/gradido/pull/648)
- 630 frontend text improvemets [`#645`](https://github.com/gradido/gradido/pull/645)
- #435 Visual Feedback on not sending GDD [`#647`](https://github.com/gradido/gradido/pull/647)
- Make E-Mail Text 100% German [`#643`](https://github.com/gradido/gradido/pull/643)
- Login fix crash [`#641`](https://github.com/gradido/gradido/pull/641)
- check for null date [`#640`](https://github.com/gradido/gradido/pull/640)
- Login fix wrong check email link [`#642`](https://github.com/gradido/gradido/pull/642)
- Change timeout for email resend to 10 Minutes [`#635`](https://github.com/gradido/gradido/pull/635)
- fix last Transaction are not shown in new frontend [`#633`](https://github.com/gradido/gradido/pull/633)
- fix bug with user roles and pending transactions [`#627`](https://github.com/gradido/gradido/pull/627)
- fix type not found error in listTransaction Call [`#628`](https://github.com/gradido/gradido/pull/628)
- refactor: Use Vue-Toasted to Toast Messages [`#619`](https://github.com/gradido/gradido/pull/619)
- feat: Test UserProfileTransactionList [`#624`](https://github.com/gradido/gradido/pull/624)
- fix: QRCode Error after Logout [`#623`](https://github.com/gradido/gradido/pull/623)
- fix: Fix Infinite Loop in Transaction List [`#622`](https://github.com/gradido/gradido/pull/622)
- feat: Transaction Details [`#607`](https://github.com/gradido/gradido/pull/607)
- fix: Test for ScrollTo in Transaction List [`#621`](https://github.com/gradido/gradido/pull/621)
- Allow empty description [`#618`](https://github.com/gradido/gradido/pull/618)
- fix: Do Not Pass Userdata Description to Server [`#617`](https://github.com/gradido/gradido/pull/617)
- fix: Transaction Pagination Scroll Top [`#615`](https://github.com/gradido/gradido/pull/615)
- fix: Mobile Pagination [`#614`](https://github.com/gradido/gradido/pull/614)
- feat: Test AccountOverview [`#611`](https://github.com/gradido/gradido/pull/611)
- feat: Test Validation Rules [`#610`](https://github.com/gradido/gradido/pull/610)
- refactor: Reset Password Page [`#606`](https://github.com/gradido/gradido/pull/606)
- refactor: Change Password [`#603`](https://github.com/gradido/gradido/pull/603)
- refactor: Forgot Password Form [`#602`](https://github.com/gradido/gradido/pull/602)
- refactor: Update Store Tests [`#601`](https://github.com/gradido/gradido/pull/601)
- Community fix [`#598`](https://github.com/gradido/gradido/pull/598)
- refactor: Password Component [`#564`](https://github.com/gradido/gradido/pull/564)
- Fix crashing Problem with Login-Server [`#600`](https://github.com/gradido/gradido/pull/600)
- Update Password Reset E-Mail Subject Encoding [`#579`](https://github.com/gradido/gradido/pull/579)
- move decay between transactions into the transactions [`#483`](https://github.com/gradido/gradido/pull/483)
- fix #591 [`#591`](https://github.com/gradido/gradido/issues/591)
- fix style decay startblick [`cc7778b`](https://github.com/gradido/gradido/commit/cc7778b55d1baaa7be2d9440480e0fb27bb9a930)
- Remove dynamic cast because it lead to errors again and agin (Poco::AutoPtr don't work correct with that) [`0db5912`](https://github.com/gradido/gradido/commit/0db5912a67158be8f313c01f06350f8339cb0e28)
- Remove dynamic cast because it lead to errors again and agin (Poco::AutoPtr don't work correct with that) [`cee7d7a`](https://github.com/gradido/gradido/commit/cee7d7ac3c4c8c1f481cc3a87fb15422c858413b)
#### [1.1.1](https://github.com/gradido/gradido/compare/1.1.0...1.1.1)
> 22 June 2021
- release [`#581`](https://github.com/gradido/gradido/pull/581)
- Auto deploy [`#580`](https://github.com/gradido/gradido/pull/580)
- update transfer email text [`#574`](https://github.com/gradido/gradido/pull/574)
- update mysql because tuple has changed [`#576`](https://github.com/gradido/gradido/pull/576)
- Login fix pending transactions [`#578`](https://github.com/gradido/gradido/pull/578)
- add test to prevent bug in future [`630d667`](https://github.com/gradido/gradido/commit/630d667e996870a1bf9aa9586b0467d58419e525)
- use standard path. add nginx example [`ac249b4`](https://github.com/gradido/gradido/commit/ac249b46830a8039aec52d30b48084b50a264b6f)
- add autodeploy bash scripts [`f49cf4d`](https://github.com/gradido/gradido/commit/f49cf4d7f8054d87efa1e12055a7ef0c6d3b9872)
#### [1.1.0](https://github.com/gradido/gradido/compare/1.0.2...1.1.0)
> 17 June 2021
- add first error additional as msg [`#573`](https://github.com/gradido/gradido/pull/573)
- fix: Remove Grouping for Max Error [`#572`](https://github.com/gradido/gradido/pull/572)
- fix: API Call for Reset Password [`#571`](https://github.com/gradido/gradido/pull/571)
- Login reset password [`#570`](https://github.com/gradido/gradido/pull/570)
- Hide unuse components in profil [`#566`](https://github.com/gradido/gradido/pull/566)
- fix: Thousend Dividers on GDD Send Amount Field [`#567`](https://github.com/gradido/gradido/pull/567)
- reorganisiere Dockerfiles [`#550`](https://github.com/gradido/gradido/pull/550)
- hot fixes shown by test [`#551`](https://github.com/gradido/gradido/pull/551)
- fix to big text ths [`#565`](https://github.com/gradido/gradido/pull/565)
- feat: Trim Email on Blur [`#556`](https://github.com/gradido/gradido/pull/556)
- Mobile UI send gdd form [`#562`](https://github.com/gradido/gradido/pull/562)
- fix: Change Password Form [`#561`](https://github.com/gradido/gradido/pull/561)
- change userdata button disable rules [`#548`](https://github.com/gradido/gradido/pull/548)
- Change password require old password [`#519`](https://github.com/gradido/gradido/pull/519)
- feat: Test Forget Password [`#546`](https://github.com/gradido/gradido/pull/546)
- feat: Validate Change Username [`#545`](https://github.com/gradido/gradido/pull/545)
- Remove base input example login vue [`#524`](https://github.com/gradido/gradido/pull/524)
- Feature: Change Username [`#490`](https://github.com/gradido/gradido/pull/490)
- feat: Toaster to Display Messages [`#512`](https://github.com/gradido/gradido/pull/512)
- fix: Validation of GDD Send Amount Field [`#525`](https://github.com/gradido/gradido/pull/525)
- Community coverage [`#496`](https://github.com/gradido/gradido/pull/496)
- compare with last transaction sended [`#523`](https://github.com/gradido/gradido/pull/523)
- remove check decays for being at least 100 GDD cent [`#526`](https://github.com/gradido/gradido/pull/526)
- fix: Remove Target Date in Send Coins Request [`#518`](https://github.com/gradido/gradido/pull/518)
- Feature profile page bugs [`#511`](https://github.com/gradido/gradido/pull/511)
- fix: GDD Send Amount Input Field [`#491`](https://github.com/gradido/gradido/pull/491)
- change transfer confirmation email [`#485`](https://github.com/gradido/gradido/pull/485)
- Login wait on passwords with missing chars [`#487`](https://github.com/gradido/gradido/pull/487)
- fix problem with create User [`#486`](https://github.com/gradido/gradido/pull/486)
- Feature: Profile Page + Update API [`#474`](https://github.com/gradido/gradido/pull/474)
- add new API Call checkUsername [`#482`](https://github.com/gradido/gradido/pull/482)
- feat: Pagination Buttons for Transaction List [`#473`](https://github.com/gradido/gradido/pull/473)
- Login-Server & Community-Server Coverage [`#472`](https://github.com/gradido/gradido/pull/472)
- login without hedera [`#478`](https://github.com/gradido/gradido/pull/478)
- fix: Show Correct Version Number in Footer [`#475`](https://github.com/gradido/gradido/pull/475)
- refactor: Remove Element-UI [`#476`](https://github.com/gradido/gradido/pull/476)
- remove components Charts, Notification, SearchUser, ButtonCheckbox, Button RadioGroup, Breadcrumb [`159bff7`](https://github.com/gradido/gradido/commit/159bff71df20a5c48f93389b2f990f7fe54e53b9)
- fix bug, update dockerfiles to use dependencies without grpc [`dedcebd`](https://github.com/gradido/gradido/commit/dedcebdb95ee0f3dfd2ad62074d4181af38476a2)
- add warning to able to forward warnings from community server to client [`2fc3fe9`](https://github.com/gradido/gradido/commit/2fc3fe94a09bae199bf2f34f9df90e8fc3879c2b)
#### [1.0.2](https://github.com/gradido/gradido/compare/1.0.1...1.0.2)
> 27 May 2021
- feat: Test Transaction List [`#470`](https://github.com/gradido/gradido/pull/470)
- fixed problem with finding cpsp parse binary under windows with conan [`#471`](https://github.com/gradido/gradido/pull/471)
- fix: GDD Amount is Always Displayed with Two Digits [`#468`](https://github.com/gradido/gradido/pull/468)
- fix: Date Time Formats [`#469`](https://github.com/gradido/gradido/pull/469)
- Community ipv6 localhost [`#466`](https://github.com/gradido/gradido/pull/466)
- Login html pages autoparse [`#464`](https://github.com/gradido/gradido/pull/464)
- everything I find and fix crash related in login server this week (kw 20) [`#448`](https://github.com/gradido/gradido/pull/448)
- 437 bug mobile transaction list is not easy to read [`#462`](https://github.com/gradido/gradido/pull/462)
- Require memo in send [`#455`](https://github.com/gradido/gradido/pull/455)
- bug: Thx Page Shows Content Dependent of Route From [`#459`](https://github.com/gradido/gradido/pull/459)
- bug: responsive display error on pads fixed [`#461`](https://github.com/gradido/gradido/pull/461)
- [Bug] German "Dir" is written with capital D in send validation bug [`#460`](https://github.com/gradido/gradido/pull/460)
- feat: Save Locale in Database [`#450`](https://github.com/gradido/gradido/pull/450)
- attention! notice in send area removed [`#458`](https://github.com/gradido/gradido/pull/458)
- Remove Error Message encoding [`#456`](https://github.com/gradido/gradido/pull/456)
- bug fix:mobile menu closes on logout, probs value problem on logout f… [`#454`](https://github.com/gradido/gradido/pull/454)
- bug-login password change show hide inserted [`#453`](https://github.com/gradido/gradido/pull/453)
- fix sorting and use total count [`#451`](https://github.com/gradido/gradido/pull/451)
- add dynamic error email if transaction failed [`#452`](https://github.com/gradido/gradido/pull/452)
- ceil the last decay [`#449`](https://github.com/gradido/gradido/pull/449)
- feat: Raise Coverage of Frontend Unit Tets to 18% [`#447`](https://github.com/gradido/gradido/pull/447)
- parse cpsp files automatic in build [`a4a12bb`](https://github.com/gradido/gradido/commit/a4a12bb62b4000e035ff15e17c5a5f5861653ff6)
- translate german html encoded error messages to english and use gettext for automatic translation [`d339627`](https://github.com/gradido/gradido/commit/d33962736d94c1cb7a12ff775bc2c8d7505d646e)
- 100% coverage of GddTransactionList [`96fb245`](https://github.com/gradido/gradido/commit/96fb245821c69f4d321204a663247d5eee60d92f)
#### [1.0.1](https://github.com/gradido/gradido/compare/1.0.0...1.0.1)
> 14 May 2021
- Login crash fix [`#444`](https://github.com/gradido/gradido/pull/444)
- add try catch blocks to prevent login-server from crashing [`22ff220`](https://github.com/gradido/gradido/commit/22ff22072956f8b843037c75c5b16b7ff5d6a2a3)
- fix [`14a4243`](https://github.com/gradido/gradido/commit/14a424347817b1fe6912a113bffd70e55d688112)
### [1.0.0](https://github.com/gradido/gradido/compare/0.9.4...1.0.0)
> 14 May 2021
- Login build alpine [`#423`](https://github.com/gradido/gradido/pull/423)
- Release fix [`#428`](https://github.com/gradido/gradido/pull/428)
- Send button only click [`#427`](https://github.com/gradido/gradido/pull/427)
- use new function for balance overview in old frontend, update balance… [`#422`](https://github.com/gradido/gradido/pull/422)
- thx.vue coloured background removed. design adapted to app [`#426`](https://github.com/gradido/gradido/pull/426)
- translation password rules in Register.vue and ResetPasswort.vue fixed [`#424`](https://github.com/gradido/gradido/pull/424)
- 06x style [`#419`](https://github.com/gradido/gradido/pull/419)
- feat: Dash is Shown When Balance is Loading [`#396`](https://github.com/gradido/gradido/pull/396)
- refactor: Split GddSend into Components [`#415`](https://github.com/gradido/gradido/pull/415)
- fix: Set Maximum Transactions Loaded to 1000 [`#395`](https://github.com/gradido/gradido/pull/395)
- BUG : preRELEASE : thx transaction false [`#394`](https://github.com/gradido/gradido/pull/394)
- feat: Validation of Input Fields of GddSend [`#386`](https://github.com/gradido/gradido/pull/386)
- add validation, check if user has tried to send themself gradidos [`#277`](https://github.com/gradido/gradido/pull/277)
- fix link generation [`#347`](https://github.com/gradido/gradido/pull/347)
- Community start decay [`#387`](https://github.com/gradido/gradido/pull/387)
- transaction error message, translations [`#388`](https://github.com/gradido/gradido/pull/388)
- docu: locales schöpfen-mysql befehl [`#392`](https://github.com/gradido/gradido/pull/392)
- Fix: QR Scanner Hide [`#380`](https://github.com/gradido/gradido/pull/380)
- change design- dark-blue of text-ligth [`#381`](https://github.com/gradido/gradido/pull/381)
- spelling & translation [`#385`](https://github.com/gradido/gradido/pull/385)
- 350 6 login [`#383`](https://github.com/gradido/gradido/pull/383)
- fix: breakout error [`#375`](https://github.com/gradido/gradido/pull/375)
- 233-Support-Button fix, and col error fix [`#343`](https://github.com/gradido/gradido/pull/343)
- fix: membersarea open in a new tap [`#370`](https://github.com/gradido/gradido/pull/370)
- 00x table footer componente [`#345`](https://github.com/gradido/gradido/pull/345)
- clickevent from icon to button [`#364`](https://github.com/gradido/gradido/pull/364)
- 404 link to login page fix [`#366`](https://github.com/gradido/gradido/pull/366)
- bug: session_id vs sessionId [`#365`](https://github.com/gradido/gradido/pull/365)
- eslint rule standard [`#344`](https://github.com/gradido/gradido/pull/344)
- don't show decays smaller than 0,01 GDD [`#329`](https://github.com/gradido/gradido/pull/329)
- 338 - mt-5 margin top 5 eingebunden [`#341`](https://github.com/gradido/gradido/pull/341)
- feat: Update Transactions When GddTable Is Rendered [`#339`](https://github.com/gradido/gradido/pull/339)
- my profile auskommentiert [`#337`](https://github.com/gradido/gradido/pull/337)
- give balance as float value in GDD (not longer GDD cent) [`#273`](https://github.com/gradido/gradido/pull/273)
- fix error with password reset email [`#276`](https://github.com/gradido/gradido/pull/276)
- transaction.show_all in en.json hinzugefügt [`#335`](https://github.com/gradido/gradido/pull/335)
- refactor: Add Paramerts to ListTransactions API Call [`#332`](https://github.com/gradido/gradido/pull/332)
- css abstände vom rand in mobilen style [`#272`](https://github.com/gradido/gradido/pull/272)
- error messages are displayed [`#304`](https://github.com/gradido/gradido/pull/304)
- cancel to reset, form rest event added [`#334`](https://github.com/gradido/gradido/pull/334)
- remove from error messages because its no longer exist [`#330`](https://github.com/gradido/gradido/pull/330)
- xx deleted [`#333`](https://github.com/gradido/gradido/pull/333)
- fix bug on Login group add host [`#274`](https://github.com/gradido/gradido/pull/274)
- transactionslist load and icon [`#324`](https://github.com/gradido/gradido/pull/324)
- THX changed to Thank you [`#305`](https://github.com/gradido/gradido/pull/305)
- fix_bug_template [`#284`](https://github.com/gradido/gradido/pull/284)
- feat: Restructure Overview [`#271`](https://github.com/gradido/gradido/pull/271)
- fix: Dynamic Balance in User Profile [`#278`](https://github.com/gradido/gradido/pull/278)
- refactor: Test and Clean Up Store [`#270`](https://github.com/gradido/gradido/pull/270)
- remove links to not work [`#267`](https://github.com/gradido/gradido/pull/267)
- change order of session_id [`#269`](https://github.com/gradido/gradido/pull/269)
- bug: Dynamic Balance [`#260`](https://github.com/gradido/gradido/pull/260)
- Fix problems with transactions in docker environment [`#261`](https://github.com/gradido/gradido/pull/261)
- update skeema call to allow also for unsafe db updates [`#250`](https://github.com/gradido/gradido/pull/250)
- turn registration on and off [`#266`](https://github.com/gradido/gradido/pull/266)
- 243 vue loader component - varante 2 [`#257`](https://github.com/gradido/gradido/pull/257)
- fix_issue_templates [`#262`](https://github.com/gradido/gradido/pull/262)
- fix_nginx_docker [`#253`](https://github.com/gradido/gradido/pull/253)
- 13_coverage [`#255`](https://github.com/gradido/gradido/pull/255)
- add language as fields which will be returned with user-object [`#244`](https://github.com/gradido/gradido/pull/244)
- add short description for target date in creation transaction [`#252`](https://github.com/gradido/gradido/pull/252)
- fix error "Integrity constraint violation: 1052 Column 'id' in where … [`#251`](https://github.com/gradido/gradido/pull/251)
- Clicks on button [`#246`](https://github.com/gradido/gradido/pull/246)
- Change css [`#231`](https://github.com/gradido/gradido/pull/231)
- feat: Reset Password [`#212`](https://github.com/gradido/gradido/pull/212)
- fix bug #221 [`#228`](https://github.com/gradido/gradido/pull/228)
- fix empty reply by empty group_id [`#227`](https://github.com/gradido/gradido/pull/227)
- Bugfix 22 04 21 [`#226`](https://github.com/gradido/gradido/pull/226)
- Rollback use prebuild dependencies [`#225`](https://github.com/gradido/gradido/pull/225)
- Docu [`#199`](https://github.com/gradido/gradido/pull/199)
- update login-server build [`#222`](https://github.com/gradido/gradido/pull/222)
- Login add language [`#220`](https://github.com/gradido/gradido/pull/220)
- User Object on Json Login [`#219`](https://github.com/gradido/gradido/pull/219)
- refactor: Remove loginAPI Call from Store [`#215`](https://github.com/gradido/gradido/pull/215)
- fix: Remove Rules for Password on Login [`#214`](https://github.com/gradido/gradido/pull/214)
- Community 15 04 2021 [`#198`](https://github.com/gradido/gradido/pull/198)
- refactor: Remove Right Menu [`#204`](https://github.com/gradido/gradido/pull/204)
- feat: Raise Frontend Test Coverage to 12% [`#206`](https://github.com/gradido/gradido/pull/206)
- refactor: Remove Cookies [`#202`](https://github.com/gradido/gradido/pull/202)
- fix_docker_compose [`#205`](https://github.com/gradido/gradido/pull/205)
- 62 pwd reset [`#203`](https://github.com/gradido/gradido/pull/203)
- workflows_refactor [`#200`](https://github.com/gradido/gradido/pull/200)
- feat: Link to Whitepaper in Content-Footer [`#196`](https://github.com/gradido/gradido/pull/196)
- update code which produce error which last fix (._.); [`#197`](https://github.com/gradido/gradido/pull/197)
- refactor: Redirects and Misuse of Children in Router [`#194`](https://github.com/gradido/gradido/pull/194)
- fix: Gradido-Akademie in Footer Links to gradido.net [`#170`](https://github.com/gradido/gradido/pull/170)
- fix register [`#160`](https://github.com/gradido/gradido/pull/160)
- Login 14.04.21 [`#175`](https://github.com/gradido/gradido/pull/175)
- coverage_no_report [`#176`](https://github.com/gradido/gradido/pull/176)
- Community 14.04.21 [`#174`](https://github.com/gradido/gradido/pull/174)
- feat: Add Coverage Check To GitHub Workflow [`#158`](https://github.com/gradido/gradido/pull/158)
- Stage2 [`#49`](https://github.com/gradido/gradido/pull/49)
- feat: Unit Test for KontoOverview [`#169`](https://github.com/gradido/gradido/pull/169)
- fix: Remove Hashtag From Route [`#167`](https://github.com/gradido/gradido/pull/167)
- documentation for reset password [`#166`](https://github.com/gradido/gradido/pull/166)
- 90 show release version in frontend [`#153`](https://github.com/gradido/gradido/pull/153)
- docu frontend menu page structur [`#159`](https://github.com/gradido/gradido/pull/159)
- userstorry_button.txt example [`#157`](https://github.com/gradido/gradido/pull/157)
- fix getBalance API call [`#147`](https://github.com/gradido/gradido/pull/147)
- Locale clear list merge master [`#119`](https://github.com/gradido/gradido/pull/119)
- fix-125-link-to-community [`#152`](https://github.com/gradido/gradido/pull/152)
- feat: Test Dashboard Layout [`#154`](https://github.com/gradido/gradido/pull/154)
- feat: Activate Coverage Report For Unit Tests In Frontend [`#156`](https://github.com/gradido/gradido/pull/156)
- Docu [`#120`](https://github.com/gradido/gradido/pull/120)
- Fix compose bug [`#138`](https://github.com/gradido/gradido/pull/138)
- feat: Test Login Form [`#113`](https://github.com/gradido/gradido/pull/113)
- at last, fix email-bug [`#134`](https://github.com/gradido/gradido/pull/134)
- Api password reset [`#82`](https://github.com/gradido/gradido/pull/82)
- Optimize login server build [`#101`](https://github.com/gradido/gradido/pull/101)
- markdown of login server api [`#111`](https://github.com/gradido/gradido/pull/111)
- Fix lineendings [`#112`](https://github.com/gradido/gradido/pull/112)
- Background color change [`#117`](https://github.com/gradido/gradido/pull/117)
- Delete unused files [`#116`](https://github.com/gradido/gradido/pull/116)
- store aufräumen teil 1 [`#115`](https://github.com/gradido/gradido/pull/115)
- add migrations table for automatic table data migration [`40a9a8c`](https://github.com/gradido/gradido/commit/40a9a8c2b587f5bef0fcc54136ed7bd13dd91b2b)
- update yarn.lock after running yarn install [`7f38c80`](https://github.com/gradido/gradido/commit/7f38c801213ad886e9d34a8d43b00ae423f5f2a0)
- use new function for balance overview in old frontend, update balance in session on every php-request [`97c570c`](https://github.com/gradido/gradido/commit/97c570c08cc51ed17a69eb8be8d987f95f3c2ce0)
#### [0.9.4](https://github.com/gradido/gradido/compare/0.9.3...0.9.4)
> 30 March 2021
- Vue with nginx [`#84`](https://github.com/gradido/gradido/pull/84)
- Build on run [`#103`](https://github.com/gradido/gradido/pull/103)
- update debug docker to use dependencies container pushed to docker hub [`1f002f4`](https://github.com/gradido/gradido/commit/1f002f4ed0b12d4b2bf63efceabe546d0c5b58ea)
- removed email tasks complete [`8a143be`](https://github.com/gradido/gradido/commit/8a143be8423d7bd894d4f512848895df8b9694b0)

View File

@ -2,7 +2,7 @@
Healthy money for a healthy world
![logo](https://gradido.net/wp-content/uploads/2020/07/gradido_logo_web.png)
![logo](https://gradido.net/wp-content/uploads/2021/06/gradido_logo%E2%97%8Fpreview.png)
The Gradido model can create global prosperity and peace
The Corona crisis has fundamentally changed our world within a very short time.
@ -39,4 +39,3 @@ git submodule update --recursive --init
## Useful Links
- [Gradido.net](https://gradido.net/)
- [Discord](https://discord.gg/kA3zBAKQDC)

17
backend/.env.dist Normal file
View File

@ -0,0 +1,17 @@
PORT=4000
JWT_SECRET=secret123
JWT_EXPIRES_IN=10m
GRAPHIQL=false
LOGIN_API_URL=http://login-server:1201/
COMMUNITY_API_URL=http://nginx/api/
GDT_API_URL=https://gdt.gradido.net
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=
DB_DATABASE=gradido_community
#KLICKTIPP_USER=
#KLICKTIPP_PASSWORD=
#KLICKTIPP_APIKEY_DE=
#KLICKTIPP_APIKEY_EN=
#KLICKTIPP=true

3
backend/.eslintignore Normal file
View File

@ -0,0 +1,3 @@
node_modules
**/*.min.js
build

26
backend/.eslintrc.js Normal file
View File

@ -0,0 +1,26 @@
module.exports = {
root: true,
env: {
node: true,
// jest: true,
},
parser: '@typescript-eslint/parser',
plugins: ['prettier', '@typescript-eslint' /*, 'jest' */],
extends: [
'standard',
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended',
],
// add your custom rules here
rules: {
'no-console': ['error'],
'no-debugger': 'error',
'prettier/prettier': [
'error',
{
htmlWhitespaceSensitivity: 'ignore',
},
],
},
}

6
backend/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
/node_modules/
/.env
/build/
# emacs
*~

8
backend/.prettierrc.js Normal file
View File

@ -0,0 +1,8 @@
module.exports = {
semi: false,
printWidth: 100,
singleQuote: true,
trailingComma: "all",
tabWidth: 2,
bracketSpacing: true,
};

418
backend/CHANGELOG.md Normal file
View File

@ -0,0 +1,418 @@
### Changelog
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### [1.4.0](https://github.com/gradido/gradido/compare/1.3.1...1.4.0)
- Integration of the KlicktippAPI to the User management [`#753`](https://github.com/gradido/gradido/pull/753)
- feat: Locale Management [`#809`](https://github.com/gradido/gradido/pull/809)
- feat: Increase Coverage Test Frontend [`#812`](https://github.com/gradido/gradido/pull/812)
- My thoughts to jwt [`#800`](https://github.com/gradido/gradido/pull/800)
- Remove discord link [`#808`](https://github.com/gradido/gradido/pull/808)
- refactor: Pagination Buttons [`#806`](https://github.com/gradido/gradido/pull/806)
- add new components selectLanguage and Usercard_Language [`#798`](https://github.com/gradido/gradido/pull/798)
- gdt transaction with arrays and without slots [`#793`](https://github.com/gradido/gradido/pull/793)
- feat: New JWT in Every Authenticated Response [`#797`](https://github.com/gradido/gradido/pull/797)
- fix euro after comma gdt view [`#799`](https://github.com/gradido/gradido/pull/799)
- different path for checkEmail and resetPassword [`#796`](https://github.com/gradido/gradido/pull/796)
- fix old frontend wrong display of event gdt [`#795`](https://github.com/gradido/gradido/pull/795)
- update scripts and doc for login-server setup without docker [`#783`](https://github.com/gradido/gradido/pull/783)
- fix: Flaky Test for Logout [`#792`](https://github.com/gradido/gradido/pull/792)
- Analyse Iota Colored Coins [`#779`](https://github.com/gradido/gradido/pull/779)
- Fix Bug in displaying GDT in Old frontend [`#788`](https://github.com/gradido/gradido/pull/788)
- feat: JSON Web Token for Authentification [`#777`](https://github.com/gradido/gradido/pull/777)
- select language during registration [`#778`](https://github.com/gradido/gradido/pull/778)
- Fix missing gdt id [`#782`](https://github.com/gradido/gradido/pull/782)
- Remove Migrations from community server [`#776`](https://github.com/gradido/gradido/pull/776)
- fix_database_migrations [`#775`](https://github.com/gradido/gradido/pull/775)
- decay with the value 0 is no longer displayed [`#773`](https://github.com/gradido/gradido/pull/773)
- database_migrations [`#770`](https://github.com/gradido/gradido/pull/770)
- backend_version [`#756`](https://github.com/gradido/gradido/pull/756)
- issue_type_release [`#769`](https://github.com/gradido/gradido/pull/769)
- some_docu [`#771`](https://github.com/gradido/gradido/pull/771)
- database_reachable_in_testmode [`#768`](https://github.com/gradido/gradido/pull/768)
- logo changed, old logos and icons deleted [`#734`](https://github.com/gradido/gradido/pull/734)
- change default value of communty url [`#755`](https://github.com/gradido/gradido/pull/755)
- feat: Testing Tabs of TransactionLists [`#737`](https://github.com/gradido/gradido/pull/737)
- Added a fetchPolicy: 'no-cache' to the login vall. [`#736`](https://github.com/gradido/gradido/pull/736)
- Docu fragen community [`#731`](https://github.com/gradido/gradido/pull/731)
- feat: Vue Apollo Client [`#701`](https://github.com/gradido/gradido/pull/701)
- change text from Geld to Gradidos [`#711`](https://github.com/gradido/gradido/pull/711)
- fix fix [`#728`](https://github.com/gradido/gradido/pull/728)
- sort locales [`ec12a28`](https://github.com/gradido/gradido/commit/ec12a28f81577d530f58b42b7f8c2c7d20dffd64)
- feat: Unify and Sort Locales [`aba4f4d`](https://github.com/gradido/gradido/commit/aba4f4d20e0a13016e3528a1c5c30c111eb3a9f1)
- feat: Increase Coverage [`3c061bc`](https://github.com/gradido/gradido/commit/3c061bcb8d1a3a47442ed6a351e1428e15b314aa)
#### [1.3.1](https://github.com/gradido/gradido/compare/1.3.0...1.3.1)
> 12 August 2021
- fix: Translations and Formula Display [`#727`](https://github.com/gradido/gradido/pull/727)
- 612 docu structure [`#688`](https://github.com/gradido/gradido/pull/688)
- Community update for gdt list GDT transaction format [`#726`](https://github.com/gradido/gradido/pull/726)
- [#612] new directory structure in /docu/Concepts [`10bf3b0`](https://github.com/gradido/gradido/commit/10bf3b0cdfa6c44f879be0155e93f636601a051b)
- #612 additional documents [`ac0ed4f`](https://github.com/gradido/gradido/commit/ac0ed4fee81caff26d09b5de47dd130f12abdb45)
- #612 docu restructuring [`e67e1c4`](https://github.com/gradido/gradido/commit/e67e1c41e78264698e6fae4cf1d29751de7e7b29)
#### [1.3.0](https://github.com/gradido/gradido/compare/1.2.1...1.3.0)
> 12 August 2021
- Update README.md [`#719`](https://github.com/gradido/gradido/pull/719)
- fixed bugs, step 1 [`#718`](https://github.com/gradido/gradido/pull/718)
- update code for correct transactions listening [`#725`](https://github.com/gradido/gradido/pull/725)
- bugfix: change to new frontend passwort reset [`#724`](https://github.com/gradido/gradido/pull/724)
- feat: Add Pagination Buttons to GDT Transaction List [`#716`](https://github.com/gradido/gradido/pull/716)
- fix bug, change statment from transaction infbox [`#712`](https://github.com/gradido/gradido/pull/712)
- 650-display of the gdt transactions [`#687`](https://github.com/gradido/gradido/pull/687)
- Login-Server bug fix, allow names with 2 characters also [`#714`](https://github.com/gradido/gradido/pull/714)
- Apollo sendCoins via Login-Server [`#699`](https://github.com/gradido/gradido/pull/699)
- increase coverage to 34% [`#700`](https://github.com/gradido/gradido/pull/700)
- mobile friendly, add text, change text [`#683`](https://github.com/gradido/gradido/pull/683)
- Css color input error [`#646`](https://github.com/gradido/gradido/pull/646)
- Apollo gdt [`#686`](https://github.com/gradido/gradido/pull/686)
- Backend Setup [`#584`](https://github.com/gradido/gradido/pull/584)
- text-size in textarea and font-variante if focus [`#677`](https://github.com/gradido/gradido/pull/677)
- 680 app large maximum width [`#681`](https://github.com/gradido/gradido/pull/681)
- linting, server is working [`34b30b2`](https://github.com/gradido/gradido/commit/34b30b216b6fafcb5b686d4b023b05f2e9766bdf)
- server stack seems to work. Graphql does not load properly yet [`43f7cf8`](https://github.com/gradido/gradido/commit/43f7cf87679713d436a64d569d6af1594a12ee33)
- initial commit, base packages [`fdf0979`](https://github.com/gradido/gradido/commit/fdf0979830fece04208a6b3bb06bb5323a3c149b)
#### [1.2.1](https://github.com/gradido/gradido/compare/1.2.0...1.2.1)
> 22 July 2021
- release 1.2.1 [`#670`](https://github.com/gradido/gradido/pull/670)
- exchange positions of decay in transaction in old frontend [`#662`](https://github.com/gradido/gradido/pull/662)
- fix unneccessary migration run on fresh (docker) setup [`#654`](https://github.com/gradido/gradido/pull/654)
- move back decay as standalone transaction in old frontend [`#656`](https://github.com/gradido/gradido/pull/656)
- fix display error with creation [`#652`](https://github.com/gradido/gradido/pull/652)
- release [`a0b8056`](https://github.com/gradido/gradido/commit/a0b8056c17b22570a1b1dbb6fa6ce71e561b04af)
- update content for frontend [`d37ce09`](https://github.com/gradido/gradido/commit/d37ce0949ef97d2a6c6ffaf0be31db9f6d92e743)
- exchange positions [`bc000ef`](https://github.com/gradido/gradido/commit/bc000efd87c9701480c4aeaa7b819ab49bfe8f01)
#### [1.2.0](https://github.com/gradido/gradido/compare/1.1.1...1.2.0)
> 20 July 2021
- feat: Release v1.2.0 [`#648`](https://github.com/gradido/gradido/pull/648)
- 630 frontend text improvemets [`#645`](https://github.com/gradido/gradido/pull/645)
- #435 Visual Feedback on not sending GDD [`#647`](https://github.com/gradido/gradido/pull/647)
- Make E-Mail Text 100% German [`#643`](https://github.com/gradido/gradido/pull/643)
- Login fix crash [`#641`](https://github.com/gradido/gradido/pull/641)
- check for null date [`#640`](https://github.com/gradido/gradido/pull/640)
- Login fix wrong check email link [`#642`](https://github.com/gradido/gradido/pull/642)
- Change timeout for email resend to 10 Minutes [`#635`](https://github.com/gradido/gradido/pull/635)
- fix last Transaction are not shown in new frontend [`#633`](https://github.com/gradido/gradido/pull/633)
- fix bug with user roles and pending transactions [`#627`](https://github.com/gradido/gradido/pull/627)
- fix type not found error in listTransaction Call [`#628`](https://github.com/gradido/gradido/pull/628)
- refactor: Use Vue-Toasted to Toast Messages [`#619`](https://github.com/gradido/gradido/pull/619)
- feat: Test UserProfileTransactionList [`#624`](https://github.com/gradido/gradido/pull/624)
- fix: QRCode Error after Logout [`#623`](https://github.com/gradido/gradido/pull/623)
- fix: Fix Infinite Loop in Transaction List [`#622`](https://github.com/gradido/gradido/pull/622)
- feat: Transaction Details [`#607`](https://github.com/gradido/gradido/pull/607)
- fix: Test for ScrollTo in Transaction List [`#621`](https://github.com/gradido/gradido/pull/621)
- Allow empty description [`#618`](https://github.com/gradido/gradido/pull/618)
- fix: Do Not Pass Userdata Description to Server [`#617`](https://github.com/gradido/gradido/pull/617)
- fix: Transaction Pagination Scroll Top [`#615`](https://github.com/gradido/gradido/pull/615)
- fix: Mobile Pagination [`#614`](https://github.com/gradido/gradido/pull/614)
- feat: Test AccountOverview [`#611`](https://github.com/gradido/gradido/pull/611)
- feat: Test Validation Rules [`#610`](https://github.com/gradido/gradido/pull/610)
- refactor: Reset Password Page [`#606`](https://github.com/gradido/gradido/pull/606)
- refactor: Change Password [`#603`](https://github.com/gradido/gradido/pull/603)
- refactor: Forgot Password Form [`#602`](https://github.com/gradido/gradido/pull/602)
- refactor: Update Store Tests [`#601`](https://github.com/gradido/gradido/pull/601)
- Community fix [`#598`](https://github.com/gradido/gradido/pull/598)
- refactor: Password Component [`#564`](https://github.com/gradido/gradido/pull/564)
- Fix crashing Problem with Login-Server [`#600`](https://github.com/gradido/gradido/pull/600)
- Update Password Reset E-Mail Subject Encoding [`#579`](https://github.com/gradido/gradido/pull/579)
- move decay between transactions into the transactions [`#483`](https://github.com/gradido/gradido/pull/483)
- fix #591 [`#591`](https://github.com/gradido/gradido/issues/591)
- fix style decay startblick [`cc7778b`](https://github.com/gradido/gradido/commit/cc7778b55d1baaa7be2d9440480e0fb27bb9a930)
- Remove dynamic cast because it lead to errors again and agin (Poco::AutoPtr don't work correct with that) [`0db5912`](https://github.com/gradido/gradido/commit/0db5912a67158be8f313c01f06350f8339cb0e28)
- Remove dynamic cast because it lead to errors again and agin (Poco::AutoPtr don't work correct with that) [`cee7d7a`](https://github.com/gradido/gradido/commit/cee7d7ac3c4c8c1f481cc3a87fb15422c858413b)
#### [1.1.1](https://github.com/gradido/gradido/compare/1.1.0...1.1.1)
> 22 June 2021
- release [`#581`](https://github.com/gradido/gradido/pull/581)
- Auto deploy [`#580`](https://github.com/gradido/gradido/pull/580)
- update transfer email text [`#574`](https://github.com/gradido/gradido/pull/574)
- update mysql because tuple has changed [`#576`](https://github.com/gradido/gradido/pull/576)
- Login fix pending transactions [`#578`](https://github.com/gradido/gradido/pull/578)
- add test to prevent bug in future [`630d667`](https://github.com/gradido/gradido/commit/630d667e996870a1bf9aa9586b0467d58419e525)
- use standard path. add nginx example [`ac249b4`](https://github.com/gradido/gradido/commit/ac249b46830a8039aec52d30b48084b50a264b6f)
- add autodeploy bash scripts [`f49cf4d`](https://github.com/gradido/gradido/commit/f49cf4d7f8054d87efa1e12055a7ef0c6d3b9872)
#### [1.1.0](https://github.com/gradido/gradido/compare/1.0.2...1.1.0)
> 17 June 2021
- add first error additional as msg [`#573`](https://github.com/gradido/gradido/pull/573)
- fix: Remove Grouping for Max Error [`#572`](https://github.com/gradido/gradido/pull/572)
- fix: API Call for Reset Password [`#571`](https://github.com/gradido/gradido/pull/571)
- Login reset password [`#570`](https://github.com/gradido/gradido/pull/570)
- Hide unuse components in profil [`#566`](https://github.com/gradido/gradido/pull/566)
- fix: Thousend Dividers on GDD Send Amount Field [`#567`](https://github.com/gradido/gradido/pull/567)
- reorganisiere Dockerfiles [`#550`](https://github.com/gradido/gradido/pull/550)
- hot fixes shown by test [`#551`](https://github.com/gradido/gradido/pull/551)
- fix to big text ths [`#565`](https://github.com/gradido/gradido/pull/565)
- feat: Trim Email on Blur [`#556`](https://github.com/gradido/gradido/pull/556)
- Mobile UI send gdd form [`#562`](https://github.com/gradido/gradido/pull/562)
- fix: Change Password Form [`#561`](https://github.com/gradido/gradido/pull/561)
- change userdata button disable rules [`#548`](https://github.com/gradido/gradido/pull/548)
- Change password require old password [`#519`](https://github.com/gradido/gradido/pull/519)
- feat: Test Forget Password [`#546`](https://github.com/gradido/gradido/pull/546)
- feat: Validate Change Username [`#545`](https://github.com/gradido/gradido/pull/545)
- Remove base input example login vue [`#524`](https://github.com/gradido/gradido/pull/524)
- Feature: Change Username [`#490`](https://github.com/gradido/gradido/pull/490)
- feat: Toaster to Display Messages [`#512`](https://github.com/gradido/gradido/pull/512)
- fix: Validation of GDD Send Amount Field [`#525`](https://github.com/gradido/gradido/pull/525)
- Community coverage [`#496`](https://github.com/gradido/gradido/pull/496)
- compare with last transaction sended [`#523`](https://github.com/gradido/gradido/pull/523)
- remove check decays for being at least 100 GDD cent [`#526`](https://github.com/gradido/gradido/pull/526)
- fix: Remove Target Date in Send Coins Request [`#518`](https://github.com/gradido/gradido/pull/518)
- Feature profile page bugs [`#511`](https://github.com/gradido/gradido/pull/511)
- fix: GDD Send Amount Input Field [`#491`](https://github.com/gradido/gradido/pull/491)
- change transfer confirmation email [`#485`](https://github.com/gradido/gradido/pull/485)
- Login wait on passwords with missing chars [`#487`](https://github.com/gradido/gradido/pull/487)
- fix problem with create User [`#486`](https://github.com/gradido/gradido/pull/486)
- Feature: Profile Page + Update API [`#474`](https://github.com/gradido/gradido/pull/474)
- add new API Call checkUsername [`#482`](https://github.com/gradido/gradido/pull/482)
- feat: Pagination Buttons for Transaction List [`#473`](https://github.com/gradido/gradido/pull/473)
- Login-Server & Community-Server Coverage [`#472`](https://github.com/gradido/gradido/pull/472)
- login without hedera [`#478`](https://github.com/gradido/gradido/pull/478)
- fix: Show Correct Version Number in Footer [`#475`](https://github.com/gradido/gradido/pull/475)
- refactor: Remove Element-UI [`#476`](https://github.com/gradido/gradido/pull/476)
- remove components Charts, Notification, SearchUser, ButtonCheckbox, Button RadioGroup, Breadcrumb [`159bff7`](https://github.com/gradido/gradido/commit/159bff71df20a5c48f93389b2f990f7fe54e53b9)
- fix bug, update dockerfiles to use dependencies without grpc [`dedcebd`](https://github.com/gradido/gradido/commit/dedcebdb95ee0f3dfd2ad62074d4181af38476a2)
- add warning to able to forward warnings from community server to client [`2fc3fe9`](https://github.com/gradido/gradido/commit/2fc3fe94a09bae199bf2f34f9df90e8fc3879c2b)
#### [1.0.2](https://github.com/gradido/gradido/compare/1.0.1...1.0.2)
> 27 May 2021
- feat: Test Transaction List [`#470`](https://github.com/gradido/gradido/pull/470)
- fixed problem with finding cpsp parse binary under windows with conan [`#471`](https://github.com/gradido/gradido/pull/471)
- fix: GDD Amount is Always Displayed with Two Digits [`#468`](https://github.com/gradido/gradido/pull/468)
- fix: Date Time Formats [`#469`](https://github.com/gradido/gradido/pull/469)
- Community ipv6 localhost [`#466`](https://github.com/gradido/gradido/pull/466)
- Login html pages autoparse [`#464`](https://github.com/gradido/gradido/pull/464)
- everything I find and fix crash related in login server this week (kw 20) [`#448`](https://github.com/gradido/gradido/pull/448)
- 437 bug mobile transaction list is not easy to read [`#462`](https://github.com/gradido/gradido/pull/462)
- Require memo in send [`#455`](https://github.com/gradido/gradido/pull/455)
- bug: Thx Page Shows Content Dependent of Route From [`#459`](https://github.com/gradido/gradido/pull/459)
- bug: responsive display error on pads fixed [`#461`](https://github.com/gradido/gradido/pull/461)
- [Bug] German "Dir" is written with capital D in send validation bug [`#460`](https://github.com/gradido/gradido/pull/460)
- feat: Save Locale in Database [`#450`](https://github.com/gradido/gradido/pull/450)
- attention! notice in send area removed [`#458`](https://github.com/gradido/gradido/pull/458)
- Remove Error Message encoding [`#456`](https://github.com/gradido/gradido/pull/456)
- bug fix:mobile menu closes on logout, probs value problem on logout f… [`#454`](https://github.com/gradido/gradido/pull/454)
- bug-login password change show hide inserted [`#453`](https://github.com/gradido/gradido/pull/453)
- fix sorting and use total count [`#451`](https://github.com/gradido/gradido/pull/451)
- add dynamic error email if transaction failed [`#452`](https://github.com/gradido/gradido/pull/452)
- ceil the last decay [`#449`](https://github.com/gradido/gradido/pull/449)
- feat: Raise Coverage of Frontend Unit Tets to 18% [`#447`](https://github.com/gradido/gradido/pull/447)
- parse cpsp files automatic in build [`a4a12bb`](https://github.com/gradido/gradido/commit/a4a12bb62b4000e035ff15e17c5a5f5861653ff6)
- translate german html encoded error messages to english and use gettext for automatic translation [`d339627`](https://github.com/gradido/gradido/commit/d33962736d94c1cb7a12ff775bc2c8d7505d646e)
- 100% coverage of GddTransactionList [`96fb245`](https://github.com/gradido/gradido/commit/96fb245821c69f4d321204a663247d5eee60d92f)
#### [1.0.1](https://github.com/gradido/gradido/compare/1.0.0...1.0.1)
> 14 May 2021
- Login crash fix [`#444`](https://github.com/gradido/gradido/pull/444)
- add try catch blocks to prevent login-server from crashing [`22ff220`](https://github.com/gradido/gradido/commit/22ff22072956f8b843037c75c5b16b7ff5d6a2a3)
- fix [`14a4243`](https://github.com/gradido/gradido/commit/14a424347817b1fe6912a113bffd70e55d688112)
### [1.0.0](https://github.com/gradido/gradido/compare/0.9.4...1.0.0)
> 14 May 2021
- Login build alpine [`#423`](https://github.com/gradido/gradido/pull/423)
- Release fix [`#428`](https://github.com/gradido/gradido/pull/428)
- Send button only click [`#427`](https://github.com/gradido/gradido/pull/427)
- use new function for balance overview in old frontend, update balance… [`#422`](https://github.com/gradido/gradido/pull/422)
- thx.vue coloured background removed. design adapted to app [`#426`](https://github.com/gradido/gradido/pull/426)
- translation password rules in Register.vue and ResetPasswort.vue fixed [`#424`](https://github.com/gradido/gradido/pull/424)
- 06x style [`#419`](https://github.com/gradido/gradido/pull/419)
- feat: Dash is Shown When Balance is Loading [`#396`](https://github.com/gradido/gradido/pull/396)
- refactor: Split GddSend into Components [`#415`](https://github.com/gradido/gradido/pull/415)
- fix: Set Maximum Transactions Loaded to 1000 [`#395`](https://github.com/gradido/gradido/pull/395)
- BUG : preRELEASE : thx transaction false [`#394`](https://github.com/gradido/gradido/pull/394)
- feat: Validation of Input Fields of GddSend [`#386`](https://github.com/gradido/gradido/pull/386)
- add validation, check if user has tried to send themself gradidos [`#277`](https://github.com/gradido/gradido/pull/277)
- fix link generation [`#347`](https://github.com/gradido/gradido/pull/347)
- Community start decay [`#387`](https://github.com/gradido/gradido/pull/387)
- transaction error message, translations [`#388`](https://github.com/gradido/gradido/pull/388)
- docu: locales schöpfen-mysql befehl [`#392`](https://github.com/gradido/gradido/pull/392)
- Fix: QR Scanner Hide [`#380`](https://github.com/gradido/gradido/pull/380)
- change design- dark-blue of text-ligth [`#381`](https://github.com/gradido/gradido/pull/381)
- spelling & translation [`#385`](https://github.com/gradido/gradido/pull/385)
- 350 6 login [`#383`](https://github.com/gradido/gradido/pull/383)
- fix: breakout error [`#375`](https://github.com/gradido/gradido/pull/375)
- 233-Support-Button fix, and col error fix [`#343`](https://github.com/gradido/gradido/pull/343)
- fix: membersarea open in a new tap [`#370`](https://github.com/gradido/gradido/pull/370)
- 00x table footer componente [`#345`](https://github.com/gradido/gradido/pull/345)
- clickevent from icon to button [`#364`](https://github.com/gradido/gradido/pull/364)
- 404 link to login page fix [`#366`](https://github.com/gradido/gradido/pull/366)
- bug: session_id vs sessionId [`#365`](https://github.com/gradido/gradido/pull/365)
- eslint rule standard [`#344`](https://github.com/gradido/gradido/pull/344)
- don't show decays smaller than 0,01 GDD [`#329`](https://github.com/gradido/gradido/pull/329)
- 338 - mt-5 margin top 5 eingebunden [`#341`](https://github.com/gradido/gradido/pull/341)
- feat: Update Transactions When GddTable Is Rendered [`#339`](https://github.com/gradido/gradido/pull/339)
- my profile auskommentiert [`#337`](https://github.com/gradido/gradido/pull/337)
- give balance as float value in GDD (not longer GDD cent) [`#273`](https://github.com/gradido/gradido/pull/273)
- fix error with password reset email [`#276`](https://github.com/gradido/gradido/pull/276)
- transaction.show_all in en.json hinzugefügt [`#335`](https://github.com/gradido/gradido/pull/335)
- refactor: Add Paramerts to ListTransactions API Call [`#332`](https://github.com/gradido/gradido/pull/332)
- css abstände vom rand in mobilen style [`#272`](https://github.com/gradido/gradido/pull/272)
- error messages are displayed [`#304`](https://github.com/gradido/gradido/pull/304)
- cancel to reset, form rest event added [`#334`](https://github.com/gradido/gradido/pull/334)
- remove from error messages because its no longer exist [`#330`](https://github.com/gradido/gradido/pull/330)
- xx deleted [`#333`](https://github.com/gradido/gradido/pull/333)
- fix bug on Login group add host [`#274`](https://github.com/gradido/gradido/pull/274)
- transactionslist load and icon [`#324`](https://github.com/gradido/gradido/pull/324)
- THX changed to Thank you [`#305`](https://github.com/gradido/gradido/pull/305)
- fix_bug_template [`#284`](https://github.com/gradido/gradido/pull/284)
- feat: Restructure Overview [`#271`](https://github.com/gradido/gradido/pull/271)
- fix: Dynamic Balance in User Profile [`#278`](https://github.com/gradido/gradido/pull/278)
- refactor: Test and Clean Up Store [`#270`](https://github.com/gradido/gradido/pull/270)
- remove links to not work [`#267`](https://github.com/gradido/gradido/pull/267)
- change order of session_id [`#269`](https://github.com/gradido/gradido/pull/269)
- bug: Dynamic Balance [`#260`](https://github.com/gradido/gradido/pull/260)
- Fix problems with transactions in docker environment [`#261`](https://github.com/gradido/gradido/pull/261)
- update skeema call to allow also for unsafe db updates [`#250`](https://github.com/gradido/gradido/pull/250)
- turn registration on and off [`#266`](https://github.com/gradido/gradido/pull/266)
- 243 vue loader component - varante 2 [`#257`](https://github.com/gradido/gradido/pull/257)
- fix_issue_templates [`#262`](https://github.com/gradido/gradido/pull/262)
- fix_nginx_docker [`#253`](https://github.com/gradido/gradido/pull/253)
- 13_coverage [`#255`](https://github.com/gradido/gradido/pull/255)
- add language as fields which will be returned with user-object [`#244`](https://github.com/gradido/gradido/pull/244)
- add short description for target date in creation transaction [`#252`](https://github.com/gradido/gradido/pull/252)
- fix error "Integrity constraint violation: 1052 Column 'id' in where … [`#251`](https://github.com/gradido/gradido/pull/251)
- Clicks on button [`#246`](https://github.com/gradido/gradido/pull/246)
- Change css [`#231`](https://github.com/gradido/gradido/pull/231)
- feat: Reset Password [`#212`](https://github.com/gradido/gradido/pull/212)
- fix bug #221 [`#228`](https://github.com/gradido/gradido/pull/228)
- fix empty reply by empty group_id [`#227`](https://github.com/gradido/gradido/pull/227)
- Bugfix 22 04 21 [`#226`](https://github.com/gradido/gradido/pull/226)
- Rollback use prebuild dependencies [`#225`](https://github.com/gradido/gradido/pull/225)
- Docu [`#199`](https://github.com/gradido/gradido/pull/199)
- update login-server build [`#222`](https://github.com/gradido/gradido/pull/222)
- Login add language [`#220`](https://github.com/gradido/gradido/pull/220)
- User Object on Json Login [`#219`](https://github.com/gradido/gradido/pull/219)
- refactor: Remove loginAPI Call from Store [`#215`](https://github.com/gradido/gradido/pull/215)
- fix: Remove Rules for Password on Login [`#214`](https://github.com/gradido/gradido/pull/214)
- Community 15 04 2021 [`#198`](https://github.com/gradido/gradido/pull/198)
- refactor: Remove Right Menu [`#204`](https://github.com/gradido/gradido/pull/204)
- feat: Raise Frontend Test Coverage to 12% [`#206`](https://github.com/gradido/gradido/pull/206)
- refactor: Remove Cookies [`#202`](https://github.com/gradido/gradido/pull/202)
- fix_docker_compose [`#205`](https://github.com/gradido/gradido/pull/205)
- 62 pwd reset [`#203`](https://github.com/gradido/gradido/pull/203)
- workflows_refactor [`#200`](https://github.com/gradido/gradido/pull/200)
- feat: Link to Whitepaper in Content-Footer [`#196`](https://github.com/gradido/gradido/pull/196)
- update code which produce error which last fix (._.); [`#197`](https://github.com/gradido/gradido/pull/197)
- refactor: Redirects and Misuse of Children in Router [`#194`](https://github.com/gradido/gradido/pull/194)
- fix: Gradido-Akademie in Footer Links to gradido.net [`#170`](https://github.com/gradido/gradido/pull/170)
- fix register [`#160`](https://github.com/gradido/gradido/pull/160)
- Login 14.04.21 [`#175`](https://github.com/gradido/gradido/pull/175)
- coverage_no_report [`#176`](https://github.com/gradido/gradido/pull/176)
- Community 14.04.21 [`#174`](https://github.com/gradido/gradido/pull/174)
- feat: Add Coverage Check To GitHub Workflow [`#158`](https://github.com/gradido/gradido/pull/158)
- Stage2 [`#49`](https://github.com/gradido/gradido/pull/49)
- feat: Unit Test for KontoOverview [`#169`](https://github.com/gradido/gradido/pull/169)
- fix: Remove Hashtag From Route [`#167`](https://github.com/gradido/gradido/pull/167)
- documentation for reset password [`#166`](https://github.com/gradido/gradido/pull/166)
- 90 show release version in frontend [`#153`](https://github.com/gradido/gradido/pull/153)
- docu frontend menu page structur [`#159`](https://github.com/gradido/gradido/pull/159)
- userstorry_button.txt example [`#157`](https://github.com/gradido/gradido/pull/157)
- fix getBalance API call [`#147`](https://github.com/gradido/gradido/pull/147)
- Locale clear list merge master [`#119`](https://github.com/gradido/gradido/pull/119)
- fix-125-link-to-community [`#152`](https://github.com/gradido/gradido/pull/152)
- feat: Test Dashboard Layout [`#154`](https://github.com/gradido/gradido/pull/154)
- feat: Activate Coverage Report For Unit Tests In Frontend [`#156`](https://github.com/gradido/gradido/pull/156)
- Docu [`#120`](https://github.com/gradido/gradido/pull/120)
- Fix compose bug [`#138`](https://github.com/gradido/gradido/pull/138)
- feat: Test Login Form [`#113`](https://github.com/gradido/gradido/pull/113)
- at last, fix email-bug [`#134`](https://github.com/gradido/gradido/pull/134)
- Api password reset [`#82`](https://github.com/gradido/gradido/pull/82)
- Optimize login server build [`#101`](https://github.com/gradido/gradido/pull/101)
- markdown of login server api [`#111`](https://github.com/gradido/gradido/pull/111)
- Fix lineendings [`#112`](https://github.com/gradido/gradido/pull/112)
- Background color change [`#117`](https://github.com/gradido/gradido/pull/117)
- Delete unused files [`#116`](https://github.com/gradido/gradido/pull/116)
- store aufräumen teil 1 [`#115`](https://github.com/gradido/gradido/pull/115)
- add migrations table for automatic table data migration [`40a9a8c`](https://github.com/gradido/gradido/commit/40a9a8c2b587f5bef0fcc54136ed7bd13dd91b2b)
- update yarn.lock after running yarn install [`7f38c80`](https://github.com/gradido/gradido/commit/7f38c801213ad886e9d34a8d43b00ae423f5f2a0)
- use new function for balance overview in old frontend, update balance in session on every php-request [`97c570c`](https://github.com/gradido/gradido/commit/97c570c08cc51ed17a69eb8be8d987f95f3c2ce0)
#### [0.9.4](https://github.com/gradido/gradido/compare/0.9.3...0.9.4)
> 30 March 2021
- Vue with nginx [`#84`](https://github.com/gradido/gradido/pull/84)
- Build on run [`#103`](https://github.com/gradido/gradido/pull/103)
- update debug docker to use dependencies container pushed to docker hub [`1f002f4`](https://github.com/gradido/gradido/commit/1f002f4ed0b12d4b2bf63efceabe546d0c5b58ea)
- removed email tasks complete [`8a143be`](https://github.com/gradido/gradido/commit/8a143be8423d7bd894d4f512848895df8b9694b0)
- build login-server on docker-compose up in a docker volume so it rebuild only neccessary parts if some c++ files have changed [`0da5279`](https://github.com/gradido/gradido/commit/0da527917523530186e6effe63dc001fc99bd3e3)
#### [0.9.3](https://github.com/gradido/gradido/compare/0.9.2...0.9.3)
> 30 March 2021
- new version 0.9.3 [`#110`](https://github.com/gradido/gradido/pull/110)
- feat: Frontend tests for Content Footer [`#102`](https://github.com/gradido/gradido/pull/102)
- add check session state json function and doc [`#96`](https://github.com/gradido/gradido/pull/96)
- activity page stap 2 [`#86`](https://github.com/gradido/gradido/pull/86)
- qrcode scanner fixed, datum in activitäten fixed, sprache not null fixed [`#88`](https://github.com/gradido/gradido/pull/88)
- add additional docker container which is running skeema on startup to… [`#83`](https://github.com/gradido/gradido/pull/83)
- New fix up frontend for presentation [`#85`](https://github.com/gradido/gradido/pull/85)
- feat: Tougher eslint rules [`#77`](https://github.com/gradido/gradido/pull/77)
- feat: improve translations [`#81`](https://github.com/gradido/gradido/pull/81)
- use_correct_send_api [`#80`](https://github.com/gradido/gradido/pull/80)
- fix bug with access rights [`#78`](https://github.com/gradido/gradido/pull/78)
- make response.html better accessible [`#75`](https://github.com/gradido/gradido/pull/75)
- feat: Lokalize Validation Messages [`#67`](https://github.com/gradido/gradido/pull/67)
- feat: Localize links to gradito.net [`#74`](https://github.com/gradido/gradido/pull/74)
- fix-padding [`#73`](https://github.com/gradido/gradido/pull/73)
- Correctly use transactions API in frontend [`#69`](https://github.com/gradido/gradido/pull/69)
- Qr code scanner [`#72`](https://github.com/gradido/gradido/pull/72)
- Login fail message [`#71`](https://github.com/gradido/gradido/pull/71)
- Setup unit tests for frontend [`#55`](https://github.com/gradido/gradido/pull/55)
- Update doc [`#63`](https://github.com/gradido/gradido/pull/63)
- Add Feature in user search old frontend because Support has requested the feature long ago [`#56`](https://github.com/gradido/gradido/pull/56)
- sprache angepasst, for login, pwd, sigin [`#54`](https://github.com/gradido/gradido/pull/54)
- Improve workflows [`#53`](https://github.com/gradido/gradido/pull/53)
- setup eslint with tougher rules [`1f13507`](https://github.com/gradido/gradido/commit/1f13507eacfd93c2248fb841de5f481c9eb1e6bd)
- semicolon rule implemented [`6762a02`](https://github.com/gradido/gradido/commit/6762a028f2a3e4f2713b26bed81029defe686ad7)
- dev meeting, bernd [`a99de7f`](https://github.com/gradido/gradido/commit/a99de7f5d1f7557c0877eae565aa4263d65aaaf3)
#### [0.9.2](https://github.com/gradido/gradido/compare/0.9.1...0.9.2)
> 18 March 2021
- v0.9.2 [`#51`](https://github.com/gradido/gradido/pull/51)
- Reload after login fixed [`#50`](https://github.com/gradido/gradido/pull/50)
- Monorepo login server [`#48`](https://github.com/gradido/gradido/pull/48)
- Stage0 [`#3`](https://github.com/gradido/gradido/pull/3)
- Add auto-sign Transaction functionality [`5592275`](https://github.com/gradido/gradido/commit/55922753a7ffd9552be132501d744da491c409b5)
- read in login the real client ip X-Real-IP from nginx forwarded not from community server [`512d307`](https://github.com/gradido/gradido/commit/512d307a19b955bb6e26ae8b274def354829b50f)
- move check if all passwords allow direct into pwdValidation so it will work with every code which ask for password [`e2c38c1`](https://github.com/gradido/gradido/commit/e2c38c1a0fc25a4a2bc922c4bbc44d86b6d00d8b)
#### 0.9.1
> 13 March 2021
- Login gbb [`#12`](https://github.com/gradido/gradido/pull/12)
- Admin prework axios json [`#10`](https://github.com/gradido/gradido/pull/10)
- Merge pull request #1 from gradido/master [`#8`](https://github.com/gradido/gradido/pull/8)
- [WIP] 2 create a dockerfile for the frontend application [`#6`](https://github.com/gradido/gradido/pull/6)
- Master - first step [`#1`](https://github.com/gradido/gradido/pull/1)
- Add docker compose [`#7`](https://github.com/gradido/gradido/pull/7)
- style 404 side :) [`c7bdf89`](https://github.com/gradido/gradido/commit/c7bdf8978594b932615e48f9bb1c19d3c3bf3fcf)
- publish workflow test [`df6f66f`](https://github.com/gradido/gradido/commit/df6f66ffe70baa9ed3f70b460a6c0c14011bb944)
- many translations. translation structure [`bf68547`](https://github.com/gradido/gradido/commit/bf685479767d19c246c4d6abe3577dc3cb666346)

95
backend/Dockerfile Normal file
View File

@ -0,0 +1,95 @@
##################################################################################
# BASE ###########################################################################
##################################################################################
FROM node:12.19.0-alpine3.10 as base
# ENVs (available in production aswell, can be overwritten by commandline or env file)
## DOCKER_WORKDIR would be a classical ARG, but that is not multi layer persistent - shame
ENV DOCKER_WORKDIR="/app"
## We Cannot do `$(date -u +'%Y-%m-%dT%H:%M:%SZ')` here so we use unix timestamp=0
ENV BUILD_DATE="1970-01-01T00:00:00.00Z"
## We cannot do $(npm run version).${BUILD_NUMBER} here so we default to 0.0.0.0
ENV BUILD_VERSION="0.0.0.0"
## We cannot do `$(git rev-parse --short HEAD)` here so we default to 0000000
ENV BUILD_COMMIT="0000000"
## SET NODE_ENV
ENV NODE_ENV="production"
## App relevant Envs
ENV PORT="4000"
# Labels
LABEL org.label-schema.build-date="${BUILD_DATE}"
LABEL org.label-schema.name="gradido:backend"
LABEL org.label-schema.description="Gradido GraphQL Backend"
LABEL org.label-schema.usage="https://github.com/gradido/gradido/blob/master/README.md"
LABEL org.label-schema.url="https://gradido.net"
LABEL org.label-schema.vcs-url="https://github.com/gradido/gradido/tree/master/backend"
LABEL org.label-schema.vcs-ref="${BUILD_COMMIT}"
LABEL org.label-schema.vendor="Gradido Community"
LABEL org.label-schema.version="${BUILD_VERSION}"
LABEL org.label-schema.schema-version="1.0"
LABEL maintainer="support@gradido.net"
# Install Additional Software
## install: git
#RUN apk --no-cache add git
# Settings
## Expose Container Port
EXPOSE ${PORT}
## Workdir
RUN mkdir -p ${DOCKER_WORKDIR}
WORKDIR ${DOCKER_WORKDIR}
##################################################################################
# DEVELOPMENT (Connected to the local environment, to reload on demand) ##########
##################################################################################
FROM base as development
# We don't need to copy or build anything since we gonna bind to the
# local filesystem which will need a rebuild anyway
# Run command
# (for development we need to execute npm install since the
# node_modules are on another volume and need updating)
CMD /bin/sh -c "yarn install && yarn run dev"
##################################################################################
# BUILD (Does contain all files and is therefore bloated) ########################
##################################################################################
FROM base as build
# Copy everything
COPY . .
# npm install
RUN yarn install --production=false --frozen-lockfile --non-interactive
# npm build
RUN yarn run build
##################################################################################
# TEST ###########################################################################
##################################################################################
FROM build as test
# Run command
CMD /bin/sh -c "yarn run dev"
##################################################################################
# PRODUCTION (Does contain only "binary"- and static-files to reduce image size) #
##################################################################################
FROM base as production
# Copy "binary"-files from build image
COPY --from=build ${DOCKER_WORKDIR}/build ./build
# We also copy the node_modules express and serve-static for the run script
# COPY --from=build ${DOCKER_WORKDIR}/node_modules ./node_modules
# Copy static files
# COPY --from=build ${DOCKER_WORKDIR}/public ./public
# Copy package.json for script definitions (lock file should not be needed)
COPY --from=build ${DOCKER_WORKDIR}/package.json ./package.json
# Copy run scripts run/
# COPY --from=build ${DOCKER_WORKDIR}/run ./run
# Run command
CMD /bin/sh -c "yarn run start"

4563
backend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

47
backend/package.json Normal file
View File

@ -0,0 +1,47 @@
{
"name": "gradido-backend",
"version": "1.4.0",
"description": "Gradido unified backend providing an API-Service for Gradido Transactions",
"main": "src/index.ts",
"repository": "https://github.com/gradido/gradido/backend",
"author": "Ulf Gebhardt",
"license": "MIT",
"private": false,
"scripts": {
"build": "tsc --build",
"clean": "tsc --build --clean",
"start": "node build/index.js",
"dev": "nodemon -w src --ext ts --exec ts-node src/index.ts",
"lint": "eslint . --ext .js,.ts"
},
"dependencies": {
"apollo-server-express": "^2.25.2",
"axios": "^0.21.1",
"class-validator": "^0.13.1",
"cors": "^2.8.5",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"graphql": "^15.5.1",
"jsonwebtoken": "^8.5.1",
"mysql2": "^2.3.0",
"reflect-metadata": "^0.1.13",
"type-graphql": "^1.1.1"
},
"devDependencies": {
"@types/express": "^4.17.12",
"@types/jsonwebtoken": "^8.5.2",
"@typescript-eslint/eslint-plugin": "^4.28.0",
"@typescript-eslint/parser": "^4.28.0",
"eslint": "^7.29.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-promise": "^5.1.0",
"nodemon": "^2.0.7",
"prettier": "^2.3.1",
"ts-node": "^10.0.0",
"typescript": "^4.3.4"
}
}

View File

@ -0,0 +1,37 @@
import axios from 'axios'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const apiPost = async (url: string, payload: unknown): Promise<any> => {
return axios
.post(url, payload)
.then((result) => {
if (result.status !== 200) {
throw new Error('HTTP Status Error ' + result.status)
}
if (result.data.state !== 'success') {
throw new Error(result.data.msg)
}
return { success: true, data: result.data }
})
.catch((error) => {
return { success: false, data: error.message }
})
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const apiGet = async (url: string): Promise<any> => {
return axios
.get(url)
.then((result) => {
if (result.status !== 200) {
throw new Error('HTTP Status Error ' + result.status)
}
if (!['success', 'warning'].includes(result.data.state)) {
throw new Error(result.data.msg)
}
return { success: true, data: result.data }
})
.catch((error) => {
return { success: false, data: error.message }
})
}

View File

@ -0,0 +1,77 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { KlicktippConnector } from './klicktippConnector'
import CONFIG from '../config'
const klicktippConnector = new KlicktippConnector()
export const signIn = async (
email: string,
language: string,
firstName?: string,
lastName?: string,
): Promise<boolean> => {
const fields = {
fieldFirstName: firstName,
fieldLastName: lastName,
}
const apiKey = language === 'de' ? CONFIG.KLICKTIPP_APIKEY_DE : CONFIG.KLICKTIPP_APIKEY_EN
const result = await klicktippConnector.signin(apiKey, email, fields)
return result
}
export const signout = async (email: string, language: string): Promise<boolean> => {
const apiKey = language === 'de' ? CONFIG.KLICKTIPP_APIKEY_DE : CONFIG.KLICKTIPP_APIKEY_EN
const result = await klicktippConnector.signoff(apiKey, email)
return result
}
export const unsubscribe = async (email: string): Promise<boolean> => {
const isLogin = await loginKlicktippUser()
if (isLogin) {
return await klicktippConnector.unsubscribe(email)
}
throw new Error(`Could not unsubscribe ${email}`)
}
export const getKlickTippUser = async (email: string): Promise<any> => {
const isLogin = await loginKlicktippUser()
if (isLogin) {
const subscriberId = await klicktippConnector.subscriberSearch(email)
const result = await klicktippConnector.subscriberGet(subscriberId)
return result
}
return false
}
export const loginKlicktippUser = async (): Promise<boolean> => {
return await klicktippConnector.login(CONFIG.KLICKTIPP_USER, CONFIG.KLICKTIPP_PASSWORD)
}
export const logoutKlicktippUser = async (): Promise<boolean> => {
return await klicktippConnector.logout()
}
export const untagUser = async (email: string, tagId: string): Promise<boolean> => {
const isLogin = await loginKlicktippUser()
if (isLogin) {
return await klicktippConnector.untag(email, tagId)
}
return false
}
export const tagUser = async (email: string, tagIds: string): Promise<boolean> => {
const isLogin = await loginKlicktippUser()
if (isLogin) {
return await klicktippConnector.tag(email, tagIds)
}
return false
}
export const getKlicktippTagMap = async () => {
const isLogin = await loginKlicktippUser()
if (isLogin) {
return await klicktippConnector.tagIndex()
}
return ''
}

View File

@ -0,0 +1,620 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import axios, { AxiosRequestConfig, Method } from 'axios'
export class KlicktippConnector {
private baseURL: string
private sessionName: string
private sessionId: string
private error: string
constructor(service?: string) {
this.baseURL = service !== undefined ? service : 'https://api.klicktipp.com'
this.sessionName = ''
this.sessionId = ''
}
/**
* Get last error
*
* @return string an error description of the last error
*/
getLastError(): string {
const result = this.error
return result
}
/**
* login
*
* @param username The login name of the user to login.
* @param password The password of the user.
* @return TRUE on success
*/
async login(username: string, password: string): Promise<boolean> {
if (!(username.length > 0 && password.length > 0)) {
throw new Error('Klicktipp Login failed: Illegal Arguments')
}
const res = await this.httpRequest('/account/login', 'POST', { username, password }, false)
if (!res.isAxiosError) {
this.sessionId = res.data.sessid
this.sessionName = res.data.session_name
return true
}
throw new Error(`Klicktipp Login failed: ${res.response.statusText}`)
}
/**
* Logs out the user currently logged in.
*
* @return TRUE on success
*/
async logout(): Promise<boolean> {
const res = await this.httpRequest('/account/logout', 'POST')
if (!res.isAxiosError) {
this.sessionId = ''
this.sessionName = ''
return true
}
throw new Error(`Klicktipp Logout failed: ${res.response.statusText}`)
}
/**
* Get all subscription processes (lists) of the logged in user. Requires to be logged in.
*
* @return A associative obeject <list id> => <list name>
*/
async subscriptionProcessIndex(): Promise<any> {
const res = await this.httpRequest('/list', 'GET', {}, true)
if (!res.isAxiosError) {
return res.data
}
throw new Error(`Klicktipp Subscription process index failed: ${res.response.statusText}`)
}
/**
* Get subscription process (list) definition. Requires to be logged in.
*
* @param listid The id of the subscription process
*
* @return An object representing the Klicktipp subscription process.
*/
async subscriptionProcessGet(listid: string): Promise<any> {
if (!listid || listid === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// retrieve
const res = await this.httpRequest(`/subscriber/${listid}`, 'GET', {}, true)
if (!res.isAxiosError) {
return res.data
}
throw new Error(`Klicktipp Subscription process get failed: ${res.response.statusText}`)
}
/**
* Get subscription process (list) redirection url for given subscription.
*
* @param listid The id of the subscription process.
* @param email The email address of the subscriber.
*
* @return A redirection url as defined in the subscription process.
*/
async subscriptionProcessRedirect(listid: string, email: string): Promise<any> {
if (!listid || listid === '' || !email || email === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// update
const data = { listid, email }
const res = await this.httpRequest('/list/redirect', 'POST', data)
if (!res.isAxiosError) {
return res.data
}
throw new Error(
`Klicktipp Subscription process get redirection url failed: ${res.response.statusText}`,
)
}
/**
* Get all manual tags of the logged in user. Requires to be logged in.
*
* @return A associative object <tag id> => <tag name>
*/
async tagIndex(): Promise<any> {
const res = await this.httpRequest('/tag', 'GET', {}, true)
if (!res.isAxiosError) {
return res.data
}
throw new Error(`Klicktipp Tag index failed: ${res.response.statusText}`)
}
/**
* Get a tag definition. Requires to be logged in.
*
* @param tagid The tag id.
*
* @return An object representing the Klicktipp tag object.
*/
async tagGet(tagid: string): Promise<any> {
if (!tagid || tagid === '') {
throw new Error('Klicktipp Illegal Arguments')
}
const res = await this.httpRequest(`/tag/${tagid}`, 'GET', {}, true)
if (!res.isAxiosError) {
return res.data
}
throw new Error(`Klicktipp Tag get failed: ${res.response.statusText}`)
}
/**
* Create a new manual tag. Requires to be logged in.
*
* @param name The name of the tag.
* @param text (optional) An additional description of the tag.
*
* @return The id of the newly created tag or false if failed.
*/
async tagCreate(name: string, text?: string): Promise<boolean> {
if (!name || name === '') {
throw new Error('Klicktipp Illegal Arguments')
}
const data = {
name,
text: text !== undefined ? text : '',
}
const res = await this.httpRequest('/tag', 'POST', data, true)
if (!res.isAxiosError) {
return res.data
}
throw new Error(`Klicktipp Tag creation failed: ${res.response.statusText}`)
}
/**
* Updates a tag. Requires to be logged in.
*
* @param tagid The tag id used to identify which tag to modify.
* @param name (optional) The new tag name. Set empty to leave it unchanged.
* @param text (optional) The new tag description. Set empty to leave it unchanged.
*
* @return TRUE on success
*/
async tagUpdate(tagid: string, name?: string, text?: string): Promise<boolean> {
if (!tagid || tagid === '' || (name === '' && text === '')) {
throw new Error('Klicktipp Illegal Arguments')
}
const data = {
name: name !== undefined ? name : '',
text: text !== undefined ? text : '',
}
const res = await this.httpRequest(`/tag/${tagid}`, 'PUT', data, true)
if (!res.isAxiosError) {
return true
}
throw new Error(`Klicktipp Tag update failed: ${res.response.statusText}`)
}
/**
* Deletes a tag. Requires to be logged in.
*
* @param tagid The user id of the user to delete.
*
* @return TRUE on success
*/
async tagDelete(tagid: string): Promise<boolean> {
if (!tagid || tagid === '') {
throw new Error('Klicktipp Illegal Arguments')
}
const res = await this.httpRequest(`/tag/${tagid}`, 'DELETE')
if (!res.isAxiosError) {
return true
}
throw new Error(`Klicktipp Tag deletion failed: ${res.response.statusText}`)
}
/**
* Get all contact fields of the logged in user. Requires to be logged in.
*
* @return A associative object <field id> => <field name>
*/
async fieldIndex(): Promise<any> {
const res = await this.httpRequest('/field', 'GET', {}, true)
if (!res.isAxiosError) {
return res.data
}
throw new Error(`Klicktipp Field index failed: ${res.response.statusText}`)
}
/**
* Subscribe an email. Requires to be logged in.
*
* @param email The email address of the subscriber.
* @param listid (optional) The id subscription process.
* @param tagid (optional) The id of the manual tag the subscriber will be tagged with.
* @param fields (optional) Additional fields of the subscriber.
*
* @return An object representing the Klicktipp subscriber object.
*/
async subscribe(
email: string,
listid?: number,
tagid?: number,
fields?: any,
smsnumber?: string,
): Promise<any> {
if ((!email || email === '') && smsnumber === '') {
throw new Error('Illegal Arguments')
}
// subscribe
const data = {
email,
fields: fields !== undefined ? fields : {},
smsnumber: smsnumber !== undefined ? smsnumber : '',
listid: listid !== undefined ? listid : 0,
tagid: tagid !== undefined ? tagid : 0,
}
const res = await this.httpRequest('/subscriber', 'POST', data, true)
if (!res.isAxiosError) {
return res.data
}
throw new Error(`Klicktipp Subscription failed: ${res.response.statusText}`)
}
/**
* Unsubscribe an email. Requires to be logged in.
*
* @param email The email address of the subscriber.
*
* @return TRUE on success
*/
async unsubscribe(email: string): Promise<boolean> {
if (!email || email === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// unsubscribe
const data = { email }
const res = await this.httpRequest('/subscriber/unsubscribe', 'POST', data, true)
if (!res.isAxiosError) {
return true
}
throw new Error(`Klicktipp Unsubscription failed: ${res.response.statusText}`)
}
/**
* Tag an email. Requires to be logged in.
*
* @param email The email address of the subscriber.
* @param tagids an array of the manual tag(s) the subscriber will be tagged with.
*
* @return TRUE on success
*/
async tag(email: string, tagids: string): Promise<boolean> {
if (!email || email === '' || !tagids || tagids === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// tag
const data = {
email,
tagids,
}
const res = await this.httpRequest('/subscriber/tag', 'POST', data, true)
if (!res.isAxiosError) {
return res.data
}
throw new Error(`Klicktipp Tagging failed: ${res.response.statusText}`)
}
/**
* Untag an email. Requires to be logged in.
*
* @param mixed $email The email address of the subscriber.
* @param mixed $tagid The id of the manual tag that will be removed from the subscriber.
*
* @return TRUE on success.
*/
async untag(email: string, tagid: string): Promise<boolean> {
if (!email || email === '' || !tagid || tagid === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// subscribe
const data = {
email,
tagid,
}
const res = await this.httpRequest('/subscriber/untag', 'POST', data, true)
if (!res.isAxiosError) {
return true
}
throw new Error(`Klicktipp Untagging failed: ${res.response.statusText}`)
}
/**
* Resend an autoresponder for an email address. Requires to be logged in.
*
* @param email A valid email address
* @param autoresponder An id of the autoresponder
*
* @return TRUE on success
*/
async resend(email: string, autoresponder: string): Promise<boolean> {
if (!email || email === '' || !autoresponder || autoresponder === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// resend/reset autoresponder
const data = { email, autoresponder }
const res = await this.httpRequest('/subscriber/resend', 'POST', data, true)
if (!res.isAxiosError) {
return true
}
throw new Error(`Klicktipp Resend failed: ${res.response.statusText}`)
}
/**
* Get all active subscribers. Requires to be logged in.
*
* @return An array of subscriber ids.
*/
async subscriberIndex(): Promise<[string]> {
const res = await this.httpRequest('/subscriber', 'GET', undefined, true)
if (!res.isAxiosError) {
return res.data
}
throw new Error(`Klicktipp Subscriber index failed: ${res.response.statusText}`)
}
/**
* Get subscriber information. Requires to be logged in.
*
* @param subscriberid The subscriber id.
*
* @return An object representing the Klicktipp subscriber.
*/
async subscriberGet(subscriberid: string): Promise<any> {
if (!subscriberid || subscriberid === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// retrieve
const res = await this.httpRequest(`/subscriber/${subscriberid}`, 'GET', {}, true)
if (!res.isAxiosError) {
return res.data
}
throw new Error(`Klicktipp Subscriber get failed: ${res.response.statusText}`)
}
/**
* Get a subscriber id by email. Requires to be logged in.
*
* @param email The email address of the subscriber.
*
* @return The id of the subscriber. Use subscriber_get to get subscriber details.
*/
async subscriberSearch(email: string): Promise<any> {
if (!email || email === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// search
const data = { email }
const res = await this.httpRequest('/subscriber/search', 'POST', data, true)
if (!res.isAxiosError) {
return res.data
}
throw new Error(`Klicktipp Subscriber search failed: ${res.response.statusText}`)
}
/**
* Get all active subscribers tagged with the given tag id. Requires to be logged in.
*
* @param tagid The id of the tag.
*
* @return An array with id -> subscription date of the tagged subscribers. Use subscriber_get to get subscriber details.
*/
async subscriberTagged(tagid: string): Promise<any> {
if (!tagid || tagid === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// search
const data = { tagid }
const res = await this.httpRequest('/subscriber/tagged', 'POST', data, true)
if (!res.isAxiosError) {
return res.data
}
throw new Error(`Klicktipp subscriber tagged failed: ${res.response.statusText}`)
}
/**
* Updates a subscriber. Requires to be logged in.
*
* @param subscriberid The id of the subscriber to update.
* @param fields (optional) The fields of the subscriber to update
* @param newemail (optional) The new email of the subscriber to update
*
* @return TRUE on success
*/
async subscriberUpdate(
subscriberid: string,
fields?: any,
newemail?: string,
newsmsnumber?: string,
): Promise<boolean> {
if (!subscriberid || subscriberid === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// update
const data = {
fields: fields !== undefined ? fields : {},
newemail: newemail !== undefined ? newemail : '',
newsmsnumber: newsmsnumber !== undefined ? newsmsnumber : '',
}
const res = await this.httpRequest(`/subscriber/${subscriberid}`, 'PUT', data, true)
if (!res.isAxiosError) {
return true
}
throw new Error(`Klicktipp Subscriber update failed: ${res.response.statusText}`)
}
/**
* Delete a subscribe. Requires to be logged in.
*
* @param subscriberid The id of the subscriber to update.
*
* @return TRUE on success.
*/
async subscriberDelete(subscriberid: string): Promise<boolean> {
if (!subscriberid || subscriberid === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// delete
const res = await this.httpRequest(`/subscriber/${subscriberid}`, 'DELETE', {}, true)
if (!res.isAxiosError) {
return true
}
throw new Error(`Klicktipp Subscriber deletion failed: ${res.response.statusText}`)
}
/**
* Subscribe an email. Requires an api key.
*
* @param apikey The api key (listbuildng configuration).
* @param email The email address of the subscriber.
* @param fields (optional) Additional fields of the subscriber.
*
* @return A redirection url as defined in the subscription process.
*/
async signin(apikey: string, email: string, fields?: any, smsnumber?: string): Promise<boolean> {
if (!apikey || apikey === '' || ((!email || email === '') && smsnumber === '')) {
throw new Error('Klicktipp Illegal Arguments')
}
// subscribe
const data = {
apikey,
email,
fields: fields !== undefined ? fields : {},
smsnumber: smsnumber !== undefined ? smsnumber : '',
}
const res = await this.httpRequest('/subscriber/signin', 'POST', data)
if (!res.isAxiosError) {
return true
}
throw new Error(`Klicktipp Subscription failed: ${res.response.statusText}`)
}
/**
* Untag an email. Requires an api key.
*
* @param apikey The api key (listbuildng configuration).
* @param email The email address of the subscriber.
*
* @return TRUE on success
*/
async signout(apikey: string, email: string): Promise<boolean> {
if (!apikey || apikey === '' || !email || email === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// untag
const data = { apikey, email }
const res = await this.httpRequest('/subscriber/signout', 'POST', data)
if (!res.isAxiosError) {
return true
}
throw new Error(`Klicktipp Untagging failed: ${res.response.statusText}`)
}
/**
* Unsubscribe an email. Requires an api key.
*
* @param apikey The api key (listbuildng configuration).
* @param email The email address of the subscriber.
*
* @return TRUE on success
*/
async signoff(apikey: string, email: string): Promise<boolean> {
if (!apikey || apikey === '' || !email || email === '') {
throw new Error('Klicktipp Illegal Arguments')
}
// unsubscribe
const data = { apikey, email }
const res = await this.httpRequest('/subscriber/signoff', 'POST', data)
if (!res.isAxiosError) {
return true
}
throw new Error(`Klicktipp Unsubscription failed: ${res.response.statusText}`)
}
async httpRequest(path: string, method?: Method, data?: any, usesession?: boolean): Promise<any> {
if (method === undefined) {
method = 'GET'
}
const options: AxiosRequestConfig = {
baseURL: this.baseURL,
method,
url: path,
data,
headers: {
'Content-Type': 'application/json',
Content: 'application/json',
Cookie:
usesession && this.sessionName !== '' ? `${this.sessionName}=${this.sessionId}` : '',
},
}
return axios(options)
.then((res) => res)
.catch((error) => error)
}
}

23
backend/src/auth/auth.ts Normal file
View File

@ -0,0 +1,23 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { AuthChecker } from 'type-graphql'
import decode from '../jwt/decode'
import { apiGet } from '../apis/HttpRequest'
import CONFIG from '../config'
import encode from '../jwt/encode'
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
export const isAuthorized: AuthChecker<any> = async ({ root, args, context, info }, roles) => {
if (context.token) {
const decoded = decode(context.token)
if (decoded.sessionId && decoded.sessionId !== 0) {
const result = await apiGet(
`${CONFIG.LOGIN_API_URL}checkSessionState?session_id=${decoded.sessionId}`,
)
context.sessionId = decoded.sessionId
context.setHeaders.push({ key: 'token', value: encode(decoded.sessionId) })
return result.success
}
}
return false
}

View File

@ -0,0 +1,38 @@
// ATTENTION: DO NOT PUT ANY SECRETS IN HERE (or the .env)
import dotenv from 'dotenv'
dotenv.config()
const server = {
PORT: process.env.PORT || 4000,
JWT_SECRET: process.env.JWT_SECRET || 'secret123',
JWT_EXPIRES_IN: process.env.JWT_EXPIRES_IN || '10m',
GRAPHIQL: process.env.GRAPHIQL === 'true' || false,
LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://login-server:1201/',
COMMUNITY_API_URL: process.env.COMMUNITY_API_URL || 'http://nginx/api/',
GDT_API_URL: process.env.GDT_API_URL || 'https://gdt.gradido.net',
}
const database = {
DB_HOST: process.env.DB_HOST || 'localhost',
DB_PORT: process.env.DB_PORT ? parseInt(process.env.DB_PORT) : 3306,
DB_USER: process.env.DB_USER || 'root',
DB_PASSWORD: process.env.DB_PASSWORD || '',
DB_DATABASE: process.env.DB_DATABASE || 'gradido_community',
}
const klicktipp = {
KLICKTIPP: process.env.KLICKTIPP === 'true' || false,
KLICKTTIPP_API_URL: process.env.KLICKTIPP_API_URL || 'https://api.klicktipp.com',
KLICKTIPP_USER: process.env.KLICKTIPP_USER || 'gradido_test',
KLICKTIPP_PASSWORD: process.env.KLICKTIPP_PASSWORD || 'secret321',
KLICKTIPP_APIKEY_DE: process.env.KLICKTIPP_APIKEY_DE || 'SomeFakeKeyDE',
KLICKTIPP_APIKEY_EN: process.env.KLICKTIPP_APIKEY_EN || 'SomeFakeKeyEN',
}
// This is needed by graphql-directive-auth
process.env.APP_SECRET = server.JWT_SECRET
const CONFIG = { ...server, ...database, ...klicktipp }
export default CONFIG

View File

@ -0,0 +1,18 @@
import { createConnection, Connection } from 'mysql2/promise'
import CONFIG from '../config'
const connection = async (): Promise<Connection> => {
const con = await createConnection({
host: CONFIG.DB_HOST,
port: CONFIG.DB_PORT,
user: CONFIG.DB_USER,
password: CONFIG.DB_PASSWORD,
database: CONFIG.DB_DATABASE,
})
await con.connect()
return con
}
export default connection

View File

@ -0,0 +1,28 @@
import { ArgsType, Field, Int } from 'type-graphql'
@ArgsType()
export class GdtTransactionInput {
@Field(() => String)
email: string
@Field(() => Int, { nullable: true })
currentPage?: number
@Field(() => Int, { nullable: true })
pageSize?: number
@Field(() => String, { nullable: true })
order?: string
}
@ArgsType()
export class GdtTransactionSessionIdInput {
@Field(() => Int, { nullable: true })
currentPage?: number
@Field(() => Int, { nullable: true })
pageSize?: number
@Field(() => String, { nullable: true })
order?: string
}

View File

@ -0,0 +1,10 @@
import { ArgsType, Field } from 'type-graphql'
@ArgsType()
export class SubscribeNewsletterArguments {
@Field(() => String)
email: string
@Field(() => String)
language: string
}

View File

@ -0,0 +1,76 @@
import { ArgsType, Field } from 'type-graphql'
@ArgsType()
export class UnsecureLoginArgs {
@Field(() => String)
email: string
@Field(() => String)
password: string
}
@ArgsType()
export class CreateUserArgs {
@Field(() => String)
email: string
@Field(() => String)
firstName: string
@Field(() => String)
lastName: string
@Field(() => String)
password: string
@Field(() => String)
language: string
}
@ArgsType()
export class ChangePasswordArgs {
@Field(() => Number)
sessionId: number
@Field(() => String)
email: string
@Field(() => String)
password: string
}
@ArgsType()
export class UpdateUserInfosArgs {
@Field(() => String)
email!: string
@Field({ nullable: true })
firstName?: string
@Field({ nullable: true })
lastName?: string
@Field({ nullable: true })
description?: string
@Field({ nullable: true })
username?: string
@Field({ nullable: true })
language?: string
@Field({ nullable: true })
password?: string
@Field({ nullable: true })
passwordNew?: string
}
@ArgsType()
export class CheckUsernameArgs {
@Field(() => String)
username: string
@Field(() => Number, { nullable: true })
groupId?: number
}

View File

@ -0,0 +1,25 @@
import { ArgsType, Field, Int } from 'type-graphql'
@ArgsType()
export class TransactionListInput {
@Field(() => Int)
firstPage: number
@Field(() => Int)
items: number
@Field(() => String)
order: string
}
@ArgsType()
export class TransactionSendArgs {
@Field(() => String)
email: string
@Field(() => Number)
amount: number
@Field(() => String)
memo: string
}

View File

@ -0,0 +1,21 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { ObjectType, Field } from 'type-graphql'
@ObjectType()
export class Balance {
constructor(json: any) {
this.balance = Number(json.balance)
this.decay = Number(json.decay)
this.decayDate = json.decay_date
}
@Field(() => Number)
balance: number
@Field(() => Number)
decay: number
@Field(() => String)
decayDate: string
}

View File

@ -0,0 +1,29 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { ObjectType, Field } from 'type-graphql'
@ObjectType()
export class CheckEmailResponse {
constructor(json: any) {
this.sessionId = json.session_id
this.email = json.user.email
this.language = json.user.language
this.firstName = json.user.first_name
this.lastName = json.user.last_name
}
@Field(() => Number)
sessionId: number
@Field(() => String)
email: string
@Field(() => String)
firstName: string
@Field(() => String)
lastName: string
@Field(() => String)
language: string
}

View File

@ -0,0 +1,21 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { ObjectType, Field } from 'type-graphql'
@ObjectType()
export class CheckUsernameResponse {
constructor(json: any) {
this.state = json.state
this.msg = json.msg
this.groupId = json.group_id
}
@Field(() => String)
state: string
@Field(() => String)
msg?: string
@Field(() => Number)
groupId?: number
}

View File

@ -0,0 +1,29 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { ObjectType, Field, Int } from 'type-graphql'
@ObjectType()
export class Decay {
constructor(json: any) {
this.balance = Number(json.balance)
this.decayStart = json.decay_start
this.decayEnd = json.decay_end
this.decayDuration = json.decay_duration
this.decayStartBlock = json.decay_start_block
}
@Field(() => Number)
balance: number
@Field(() => Int, { nullable: true })
decayStart?: number
@Field(() => Int, { nullable: true })
decayEnd?: number
@Field(() => String, { nullable: true })
decayDuration?: string
@Field(() => Int, { nullable: true })
decayStartBlock?: number
}

View File

@ -0,0 +1,63 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { ObjectType, Field } from 'type-graphql'
export enum GdtEntryType {
FORM = 1,
CVS = 2,
ELOPAGE = 3,
ELOPAGE_PUBLISHER = 4,
DIGISTORE = 5,
CVS2 = 6,
GLOBAL_MODIFICATOR = 7,
}
@ObjectType()
export class GdtEntry {
constructor(json: any) {
this.id = json.id
this.amount = json.amount
this.date = json.date
this.email = json.email
this.comment = json.comment
this.couponCode = json.coupon_code
this.gdtEntryType = json.gdt_entry_type_id
this.factor = json.factor
this.amount2 = json.amount2
this.factor2 = json.factor2
this.gdt = json.gdt
}
@Field(() => Number)
id: number
@Field(() => Number)
amount: number
@Field(() => String)
date: string
@Field(() => String)
email: string
@Field(() => String)
comment: string
@Field(() => String)
couponCode: string
@Field(() => Number)
gdtEntryType: GdtEntryType
@Field(() => Number)
factor: number
@Field(() => Number)
amount2: number
@Field(() => Number)
factor2: number
@Field(() => Number)
gdt: number
}

View File

@ -0,0 +1,44 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { GdtEntry } from './GdtEntry'
import { ObjectType, Field } from 'type-graphql'
@ObjectType()
export class GdtSumPerEmail {
constructor(email: string, summe: number) {
this.email = email
this.summe = summe
}
@Field(() => String)
email: string
@Field(() => Number)
summe: number
}
@ObjectType()
export class GdtEntryList {
constructor(json: any) {
this.state = json.state
this.count = json.count
this.gdtEntries = json.gdtEntries ? json.gdtEntries.map((json: any) => new GdtEntry(json)) : []
this.gdtSum = json.gdtSum
this.timeUsed = json.timeUsed
}
@Field(() => String)
state: string
@Field(() => Number)
count: number
@Field(() => [GdtEntry], { nullable: true })
gdtEntries?: GdtEntry[]
@Field(() => Number)
gdtSum: number
@Field(() => Number)
timeUsed: number
}

View File

@ -0,0 +1,13 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { ObjectType, Field } from 'type-graphql'
@ObjectType()
export class KlickTipp {
constructor(json: any) {
this.newsletterState = json.status === 'Subscribed'
}
@Field(() => Boolean)
newsletterState: boolean
}

View File

@ -0,0 +1,17 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { ObjectType, Field } from 'type-graphql'
@ObjectType()
export class LoginViaVerificationCode {
constructor(json: any) {
this.sessionId = json.session_id
this.email = json.user.email
}
@Field(() => Number)
sessionId: number
@Field(() => String)
email: string
}

View File

@ -0,0 +1,17 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { ObjectType, Field } from 'type-graphql'
@ObjectType()
export class SendPasswordResetEmailResponse {
constructor(json: any) {
this.state = json.state
this.msg = json.msg
}
@Field(() => String)
state: string
@Field(() => String)
msg?: string
}

View File

@ -0,0 +1,91 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { ObjectType, Field } from 'type-graphql'
import { Decay } from './Decay'
// we need a better solution for the decay block:
// the first transaction on the first page shows the decay since the last transaction
// the format is actually a Decay and not a Transaction.
// Therefore we have a lot of nullable fields, which should be always present
@ObjectType()
export class Transaction {
constructor(json: any) {
this.type = json.type
this.balance = Number(json.balance)
this.decayStart = json.decay_start
this.decayEnd = json.decay_end
this.decayDuration = json.decay_duration
this.memo = json.memo
this.transactionId = json.transaction_id
this.name = json.name
this.email = json.email
this.date = json.date
this.decay = json.decay ? new Decay(json.decay) : undefined
}
@Field(() => String)
type: string
@Field(() => Number)
balance: number
@Field({ nullable: true })
decayStart?: number
@Field({ nullable: true })
decayEnd?: number
@Field({ nullable: true })
decayDuration?: string
@Field(() => String)
memo: string
@Field(() => Number, { nullable: true })
transactionId?: number
@Field({ nullable: true })
name?: string
@Field({ nullable: true })
email?: string
@Field({ nullable: true })
date?: string
@Field({ nullable: true })
decay?: Decay
}
@ObjectType()
export class TransactionList {
constructor(json: any) {
this.gdtSum = Number(json.gdtSum)
this.count = json.count
this.balance = Number(json.balance)
this.decay = Number(json.decay)
this.decayDate = json.decay_date
this.transactions = json.transactions.map((el: any) => {
return new Transaction(el)
})
}
@Field(() => Number)
gdtSum: number
@Field(() => Number)
count: number
@Field(() => Number)
balance: number
@Field(() => Number)
decay: number
@Field(() => String)
decayDate: string
@Field(() => [Transaction])
transactions: Transaction[]
}

View File

@ -0,0 +1,13 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { ObjectType, Field } from 'type-graphql'
@ObjectType()
export class UpdateUserInfosResponse {
constructor(json: any) {
this.validValues = json.valid_values
}
@Field(() => Number)
validValues: number
}

View File

@ -0,0 +1,71 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { ObjectType, Field } from 'type-graphql'
import { KlickTipp } from './KlickTipp'
@ObjectType()
export class User {
/*
@Field(() => ID)
@PrimaryGeneratedColumn()
id: number
*/
constructor(json: any) {
this.email = json.email
this.firstName = json.first_name
this.lastName = json.last_name
this.username = json.username
this.description = json.description
this.language = json.language
}
@Field(() => String)
email: string
@Field(() => String)
firstName: string
@Field(() => String)
lastName: string
@Field(() => String)
username: string
@Field(() => String)
description: string
/*
@Field(() => String)
pubkey: string
// not sure about the type here. Maybe better to have a string
@Field(() => number)
created: number
@Field(() => Boolean)
emailChecked: boolean
@Field(() => Boolean)
passphraseShown: boolean
*/
@Field(() => String)
language: string
/*
@Field(() => Boolean)
disabled: boolean
*/
/* I suggest to have a group as type here
@Field(() => ID)
groupId: number
// what is puvlisherId?
@Field(() => ID)
publisherId: number
*/
@Field(() => KlickTipp)
klickTipp: KlickTipp
}

View File

@ -0,0 +1,18 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Resolver, Query, Ctx, Authorized } from 'type-graphql'
import CONFIG from '../../config'
import { Balance } from '../models/Balance'
import { apiGet } from '../../apis/HttpRequest'
@Resolver()
export class BalanceResolver {
@Authorized()
@Query(() => Balance)
async balance(@Ctx() context: any): Promise<Balance> {
const result = await apiGet(CONFIG.COMMUNITY_API_URL + 'getBalance/' + context.sessionId)
if (!result.success) throw new Error(result.data)
return new Balance(result.data)
}
}

View File

@ -0,0 +1,29 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Resolver, Query, Args, Ctx, Authorized } from 'type-graphql'
import CONFIG from '../../config'
import { GdtEntryList } from '../models/GdtEntryList'
import { GdtTransactionSessionIdInput } from '../inputs/GdtInputs'
import { apiGet } from '../../apis/HttpRequest'
@Resolver()
export class GdtResolver {
@Authorized()
@Query(() => GdtEntryList)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async listGDTEntries(
@Args()
{ currentPage = 1, pageSize = 5, order = 'DESC' }: GdtTransactionSessionIdInput,
@Ctx() context: any,
): Promise<GdtEntryList> {
const result = await apiGet(
`${CONFIG.COMMUNITY_API_URL}listGDTTransactions/${currentPage}/${pageSize}/${order}/${context.sessionId}`,
)
if (!result.success) {
throw new Error(result.data)
}
return new GdtEntryList(result.data)
}
}

View File

@ -0,0 +1,40 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Resolver, Query, Authorized, Arg, Mutation, Args } from 'type-graphql'
import {
getKlickTippUser,
getKlicktippTagMap,
unsubscribe,
signIn,
} from '../../apis/KlicktippController'
import { SubscribeNewsletterArguments } from '../inputs/KlickTippInputs'
@Resolver()
export class KlicktippResolver {
@Authorized()
@Query(() => String)
async getKlicktippUser(@Arg('email') email: string): Promise<string> {
return await getKlickTippUser(email)
}
@Authorized()
@Query(() => String)
async getKlicktippTagMap(): Promise<string> {
return await getKlicktippTagMap()
}
@Authorized()
@Mutation(() => Boolean)
async unsubscribeNewsletter(@Arg('email') email: string): Promise<boolean> {
return await unsubscribe(email)
}
@Authorized()
@Mutation(() => Boolean)
async subscribeNewsletter(
@Args() { email, language }: SubscribeNewsletterArguments,
): Promise<boolean> {
return await signIn(email, language)
}
}

View File

@ -0,0 +1,46 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Resolver, Query, Args, Authorized, Ctx } from 'type-graphql'
import CONFIG from '../../config'
import { TransactionList } from '../models/Transaction'
import { TransactionListInput, TransactionSendArgs } from '../inputs/TransactionInput'
import { apiGet, apiPost } from '../../apis/HttpRequest'
@Resolver()
export class TransactionResolver {
@Authorized()
@Query(() => TransactionList)
async transactionList(
@Args() { firstPage = 1, items = 25, order = 'DESC' }: TransactionListInput,
@Ctx() context: any,
): Promise<TransactionList> {
const result = await apiGet(
`${CONFIG.COMMUNITY_API_URL}listTransactions/${firstPage}/${items}/${order}/${context.sessionId}`,
)
if (!result.success) throw new Error(result.data)
return new TransactionList(result.data)
}
@Authorized()
@Query(() => String)
async sendCoins(
@Args() { email, amount, memo }: TransactionSendArgs,
@Ctx() context: any,
): Promise<string> {
const payload = {
session_id: context.sessionId,
target_email: email,
amount: amount * 10000,
memo,
auto_sign: true,
transaction_type: 'transfer',
blockchain_type: 'mysql',
}
const result = await apiPost(CONFIG.LOGIN_API_URL + 'createTransaction', payload)
if (!result.success) {
throw new Error(result.data)
}
return 'success'
}
}

View File

@ -0,0 +1,179 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Resolver, Query, Args, Arg, Authorized, Ctx, UseMiddleware } from 'type-graphql'
import CONFIG from '../../config'
import { CheckUsernameResponse } from '../models/CheckUsernameResponse'
import { LoginViaVerificationCode } from '../models/LoginViaVerificationCode'
import { SendPasswordResetEmailResponse } from '../models/SendPasswordResetEmailResponse'
import { UpdateUserInfosResponse } from '../models/UpdateUserInfosResponse'
import { User } from '../models/User'
import encode from '../../jwt/encode'
import {
ChangePasswordArgs,
CheckUsernameArgs,
CreateUserArgs,
UnsecureLoginArgs,
UpdateUserInfosArgs,
} from '../inputs/LoginUserInput'
import { apiPost, apiGet } from '../../apis/HttpRequest'
import {
klicktippRegistrationMiddleware,
klicktippNewsletterStateMiddleware,
} from '../../middleware/klicktippMiddleware'
import { CheckEmailResponse } from '../models/CheckEmailResponse'
@Resolver()
export class UserResolver {
@Query(() => User)
@UseMiddleware(klicktippNewsletterStateMiddleware)
async login(@Args() { email, password }: UnsecureLoginArgs, @Ctx() context: any): Promise<User> {
email = email.trim().toLowerCase()
const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', { email, password })
// if there is no user, throw an authentication error
if (!result.success) {
throw new Error(result.data)
}
context.setHeaders.push({ key: 'token', value: encode(result.data.session_id) })
return new User(result.data.user)
}
@Query(() => LoginViaVerificationCode)
async loginViaEmailVerificationCode(
@Arg('optin') optin: string,
): Promise<LoginViaVerificationCode> {
// I cannot use number as type here.
// The value received is not the same as sent by the query
const result = await apiGet(
CONFIG.LOGIN_API_URL + 'loginViaEmailVerificationCode?emailVerificationCode=' + optin,
)
if (!result.success) {
throw new Error(result.data)
}
return new LoginViaVerificationCode(result.data)
}
@Authorized()
@Query(() => String)
async logout(@Ctx() context: any): Promise<string> {
const payload = { session_id: context.sessionId }
const result = await apiPost(CONFIG.LOGIN_API_URL + 'logout', payload)
if (!result.success) {
throw new Error(result.data)
}
return 'success'
}
@Query(() => String)
async create(
@Args() { email, firstName, lastName, password, language }: CreateUserArgs,
): Promise<string> {
const payload = {
email,
first_name: firstName,
last_name: lastName,
password,
emailType: 2,
login_after_register: true,
language: language,
}
const result = await apiPost(CONFIG.LOGIN_API_URL + 'createUser', payload)
if (!result.success) {
throw new Error(result.data)
}
return 'success'
}
@Query(() => SendPasswordResetEmailResponse)
async sendResetPasswordEmail(
@Arg('email') email: string,
): Promise<SendPasswordResetEmailResponse> {
const payload = {
email,
email_text: 7,
email_verification_code_type: 'resetPassword',
}
const response = await apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', payload)
if (!response.success) {
throw new Error(response.data)
}
return new SendPasswordResetEmailResponse(response.data)
}
@Query(() => String)
async resetPassword(
@Args()
{ sessionId, email, password }: ChangePasswordArgs,
): Promise<string> {
const payload = {
session_id: sessionId,
email,
password,
}
const result = await apiPost(CONFIG.LOGIN_API_URL + 'resetPassword', payload)
if (!result.success) {
throw new Error(result.data)
}
return 'success'
}
@Authorized()
@Query(() => UpdateUserInfosResponse)
async updateUserInfos(
@Args()
{
email,
firstName,
lastName,
description,
username,
language,
password,
passwordNew,
}: UpdateUserInfosArgs,
@Ctx() context: any,
): Promise<UpdateUserInfosResponse> {
const payload = {
session_id: context.sessionId,
email,
update: {
'User.first_name': firstName || undefined,
'User.last_name': lastName || undefined,
'User.description': description || undefined,
'User.username': username || undefined,
'User.language': language || undefined,
'User.password': passwordNew || undefined,
'User.password_old': password || undefined,
},
}
const result = await apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload)
if (!result.success) throw new Error(result.data)
return new UpdateUserInfosResponse(result.data)
}
@Query(() => CheckUsernameResponse)
async checkUsername(
@Args() { username, groupId = 1 }: CheckUsernameArgs,
): Promise<CheckUsernameResponse> {
const response = await apiGet(
CONFIG.LOGIN_API_URL + `checkUsername?username=${username}&group_id=${groupId}`,
)
if (!response.success) throw new Error(response.data)
return new CheckUsernameResponse(response.data)
}
@Query(() => CheckEmailResponse)
@UseMiddleware(klicktippRegistrationMiddleware)
async checkEmail(@Arg('optin') optin: string): Promise<CheckEmailResponse> {
const result = await apiGet(
CONFIG.LOGIN_API_URL + 'loginViaEmailVerificationCode?emailVerificationCode=' + optin,
)
if (!result.success) {
throw new Error(result.data)
}
return new CheckEmailResponse(result.data)
}
}

109
backend/src/index.ts Normal file
View File

@ -0,0 +1,109 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import 'reflect-metadata'
import express from 'express'
import cors from 'cors'
import { buildSchema } from 'type-graphql'
import { ApolloServer } from 'apollo-server-express'
import { RowDataPacket } from 'mysql2/promise'
import connection from './database/connection'
import CONFIG from './config'
// TODO move to extern
import { UserResolver } from './graphql/resolvers/UserResolver'
import { BalanceResolver } from './graphql/resolvers/BalanceResolver'
import { GdtResolver } from './graphql/resolvers/GdtResolver'
import { TransactionResolver } from './graphql/resolvers/TransactionResolver'
import { KlicktippResolver } from './graphql/resolvers/KlicktippResolver'
import { isAuthorized } from './auth/auth'
// TODO implement
// import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity";
const DB_VERSION = '0001-init_db'
const context = (args: any) => {
const authorization = args.req.headers.authorization
let token = null
if (authorization) {
token = authorization.replace(/^Bearer /, '')
}
const context = {
token,
setHeaders: [],
}
return context
}
async function main() {
// check for correct database version
const con = await connection()
const [rows] = await con.query(`SELECT * FROM migrations ORDER BY version DESC LIMIT 1;`)
if (
(<RowDataPacket>rows).length === 0 ||
!(<RowDataPacket>rows)[0].fileName ||
(<RowDataPacket>rows)[0].fileName.indexOf(DB_VERSION) === -1
) {
throw new Error(`Wrong database version - the backend requires '${DB_VERSION}'`)
}
// const connection = await createConnection()
const schema = await buildSchema({
resolvers: [UserResolver, BalanceResolver, TransactionResolver, GdtResolver, KlicktippResolver],
authChecker: isAuthorized,
})
// Graphiql interface
let playground = false
if (CONFIG.GRAPHIQL) {
playground = true
}
// Express Server
const server = express()
const corsOptions = {
origin: '*',
exposedHeaders: ['token'],
}
server.use(cors(corsOptions))
const plugins = [
{
requestDidStart() {
return {
willSendResponse(requestContext: any) {
const { setHeaders = [] } = requestContext.context
setHeaders.forEach(({ key, value }: { [key: string]: string }) => {
requestContext.response.http.headers.append(key, value)
})
return requestContext
},
}
},
},
]
// Apollo Server
const apollo = new ApolloServer({ schema, playground, context, plugins })
apollo.applyMiddleware({ app: server })
// Start Server
server.listen(CONFIG.PORT, () => {
// eslint-disable-next-line no-console
console.log(`Server is running at http://localhost:${CONFIG.PORT}`)
if (CONFIG.GRAPHIQL) {
// eslint-disable-next-line no-console
console.log(`GraphIQL available at http://localhost:${CONFIG.PORT}/graphql`)
}
})
}
main().catch((e) => {
// eslint-disable-next-line no-console
console.error(e)
process.exit(1)
})

20
backend/src/jwt/decode.ts Normal file
View File

@ -0,0 +1,20 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import jwt from 'jsonwebtoken'
import CONFIG from '../config/'
export default (token: string): any => {
if (!token) return null
let sessionId = null
try {
const decoded = jwt.verify(token, CONFIG.JWT_SECRET)
sessionId = decoded.sub
return {
token,
sessionId,
}
} catch (err) {
return null
}
}

14
backend/src/jwt/encode.ts Normal file
View File

@ -0,0 +1,14 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import jwt from 'jsonwebtoken'
import CONFIG from '../config/'
// Generate an Access Token
export default function encode(sessionId: string): string {
const token = jwt.sign({ sessionId }, CONFIG.JWT_SECRET, {
expiresIn: CONFIG.JWT_EXPIRES_IN,
subject: sessionId.toString(),
})
return token
}

View File

@ -0,0 +1,34 @@
import { MiddlewareFn } from 'type-graphql'
import { signIn, getKlickTippUser } from '../apis/KlicktippController'
import { KlickTipp } from '../graphql/models/KlickTipp'
import CONFIG from '../config/index'
export const klicktippRegistrationMiddleware: MiddlewareFn = async (
// Only for demo
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
{ root, args, context, info },
next,
) => {
// Do Something here before resolver is called
const result = await next()
// Do Something here after resolver is completed
await signIn(result.email, result.language, result.firstName, result.lastName)
return result
}
export const klicktippNewsletterStateMiddleware: MiddlewareFn = async (
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
{ root, args, context, info },
next,
) => {
const result = await next()
let klickTipp = new KlickTipp({ status: 'Unsubscribed' })
if (CONFIG.KLICKTIPP) {
const klickTippUser = await getKlickTippUser(result.email)
if (klickTippUser) {
klickTipp = new KlickTipp(klickTippUser)
}
}
result.klickTipp = klickTipp
return result
}

72
backend/tsconfig.json Normal file
View File

@ -0,0 +1,72 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./build", /* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
"strictPropertyInitialization": false, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
/* Source Map Options */
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
"emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
/* Advanced Options */
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}
}

3503
backend/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
FROM phpdockerio/php74-fpm
FROM phpdockerio/php74-fpm as community_server
# install php fpm
RUN apt-get update \
&& apt-get -y --no-install-recommends install curl unzip php7.4-curl php7.4-fpm php7.4-mbstring php7.4-intl php7.4-xml php7.4-pdo php7.4-mysql \
&& apt-get -y --no-install-recommends install curl unzip php7.4-curl php7.4-fpm php7.4-mbstring php7.4-intl php7.4-xml php7.4-pdo php7.4-mysql php7.4-xdebug \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
WORKDIR /var/www/cakephp
@ -13,5 +13,18 @@ COPY ./configs/community_server/app.php ./config/
RUN composer update
RUN composer dump-autoload
######### special for code coverage and testing
FROM community_server as test
RUN apt-get update \
&& apt-get -y --no-install-recommends install php7.4-xdebug \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
ENV XDEBUG_MODE=coverage
#RUN composer require --dev rregeer/phpunit-coverage-check
#CMD ./vendor/bin/phpunit --coverage-clover=./webroot/coverage/clover.xml
CMD ./vendor/bin/phpunit --coverage-text=./webroot/coverage/coverage.info

View File

@ -7,7 +7,6 @@
"require": {
"php": ">=5.6",
"cakephp/cakephp": "3.9.*",
"cakephp/migrations": "^2.0.0",
"cakephp/plugin-installer": "^1.0",
"datto/json-rpc": "^6.0",
"google/protobuf": "v3.10.*",

View File

@ -60,18 +60,21 @@ Router::scope('/', function (RouteBuilder $routes) {
$whitelist = ['JsonRequestHandler', 'ElopageWebhook', 'AppRequests'];
$ajaxWhitelist = ['TransactionSendCoins', 'TransactionCreations'];
$callerIp = $request->clientIp();
foreach($whitelist as $entry) {
if($request->getParam('controller') === $entry) {
if($entry == 'ElopageWebhook' || $entry == 'AppRequests') {
return true;
}
if($request->clientIp() == '127.0.0.1' || $request->clientIp() == 'localhost' || $request->clientIp() == '') {
return true;
$allowedIpLocalhost = ['127.0.0.1', 'localhost', '', '::1'];
if(in_array($callerIp, $allowedIpLocalhost)) {
return true;
}
$allowedCaller = Configure::read('API.allowedCaller');
$ipPerHost = [];
if($allowedCaller && count($allowedCaller) > 0) {
$callerIp = $request->clientIp();
foreach($allowedCaller as $allowed) {
$ip = gethostbyname($allowed);
$ipPerHost[$allowed] = $ip;

View File

@ -1,6 +0,0 @@
CREATE TABLE `address_types` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(25) NOT NULL,
`text` VARCHAR(255) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,7 +0,0 @@
CREATE TABLE `operators` (
`id` INT NOT NULL AUTO_INCREMENT ,
`username` VARCHAR(128) NOT NULL ,
`data_base64` VARCHAR(255) NOT NULL ,
PRIMARY KEY (`id`), UNIQUE (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,7 +0,0 @@
CREATE TABLE `state_balances` (
`id` int(11) NOT NULL,
`state_user_id` int(11) NOT NULL,
`modified` datetime NOT NULL,
`amount` bigint(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,10 +0,0 @@
CREATE TABLE `state_created` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`month` tinyint(4) NOT NULL,
`year` smallint(6) NOT NULL,
`state_user_id` int(11) NOT NULL,
`created` datetime NOT NULL,
`short_ident_hash` int(11) NOT NULL,
PRIMARY KEY (`id`), INDEX(`short_ident_hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,7 +0,0 @@
CREATE TABLE `state_group_addresses` (
`id` int(11) NOT NULL,
`state_group_id` int(11) NOT NULL,
`public_key` binary(32) NOT NULL,
`address_type_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,7 +0,0 @@
CREATE TABLE `state_group_relationships` (
`id` int(11) NOT NULL,
`state_group1_id` int(11) NOT NULL,
`state_group2_id` int(11) NOT NULL,
`state_relationship_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,8 +0,0 @@
CREATE TABLE `state_groups` (
`id` INT NOT NULL AUTO_INCREMENT,
`index_id` VARBINARY(64) NOT NULL,
`name` VARCHAR(50) NOT NULL,
`root_public_key` BINARY(32) NOT NULL,
`user_count` SMALLINT NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,6 +0,0 @@
CREATE TABLE `state_relationship_types` (
`id` int(11) NOT NULL,
`name` varchar(25) COLLATE utf8_bin NOT NULL,
`text` varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,7 +0,0 @@
CREATE TABLE `state_users` (
`id` int(11) NOT NULL,
`index_id` smallint(6) NOT NULL,
`state_group_id` int(11) NOT NULL,
`public_key` binary(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,10 +0,0 @@
CREATE TABLE `transaction_creations` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`state_user_id` int(11) NOT NULL,
`amount` bigint(20) NOT NULL,
`ident_hash` binary(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,8 +0,0 @@
CREATE TABLE `transaction_group_addaddress` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`address_type_id` int(11) NOT NULL,
`public_key` binary(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,8 +0,0 @@
CREATE TABLE `transaction_group_allowtrades` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`group_id` int(11) NOT NULL,
`allow` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,9 +0,0 @@
CREATE TABLE `transaction_group_creates` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`group_public_key` binary(32) NOT NULL,
`state_group_id` int(11) COLLATE utf8_bin NOT NULL,
`name` varchar(64) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,11 +0,0 @@
CREATE TABLE `transaction_send_coins` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`state_user_id` int(11) NOT NULL,
`receiver_public_key` binary(32) NOT NULL,
`receiver_user_id` varbinary(64) NOT NULL,
`amount` bigint(20) NOT NULL,
`sender_final_balance` bigint(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,7 +0,0 @@
CREATE TABLE `transaction_signatures` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`signature` binary(64) NOT NULL,
`pubkey` binary(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,6 +0,0 @@
CREATE TABLE `transaction_types` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(24) NOT NULL,
`text` VARCHAR(255) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,9 +0,0 @@
CREATE TABLE `transactions` (
`id` bigint(20) NOT NULL,
`state_group_id` int(11) NOT NULL,
`transaction_type_id` int(11) NOT NULL,
`tx_hash` binary(32) NOT NULL,
`received` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,7 +0,0 @@
CREATE TABLE `address_types` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`text` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,11 +0,0 @@
CREATE TABLE `admin_errors` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`state_user_id` int(11) NOT NULL,
`controller` varchar(255) NOT NULL,
`action` varchar(255) NOT NULL,
`state` varchar(255) NOT NULL,
`msg` varchar(255) NOT NULL,
`details` varchar(255) DEFAULT NULL,
`created` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

View File

@ -1,17 +0,0 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Author: einhornimmond
* Created: 06.04.2021
*/
CREATE TABLE `blockchain_types` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`text` varchar(255) NULL,
`symbol` varchar(10) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,8 +0,0 @@
CREATE TABLE `community_profiles` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`state_user_id` int(10) unsigned NOT NULL,
`profile_img` longblob,
`profile_desc` varchar(2000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `state_user_id` (`state_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,2 +0,0 @@
INSERT INTO `address_types` (`id`, `name`, `text`) VALUES
(1, 'user main', 'user main address');

View File

@ -1,5 +0,0 @@
INSERT INTO `blockchain_types` (`id`, `name`, `text`, `symbol`) VALUES
(1, 'mysql', 'use mysql db as blockchain, work only with single community-server', NULL),
(2, 'hedera', 'use hedera for transactions', 'HBAR');

View File

@ -1,10 +0,0 @@
INSERT INTO `transaction_types` (`id`, `name`, `text`) VALUES
(1, 'creation', 'create new gradidos for member and also for group (in development)'),
(2, 'transfer', 'send gradidos from one member to another, also cross group transfer'),
(3, 'group create', 'create a new group, trigger creation of new hedera topic and new blockchain on node server'),
(4, 'group add member', 'add user to a group or move if he was already in a group'),
(5, 'group remove member', 'remove user from group, maybe he was moved elsewhere'),
(6, 'hedera topic create', 'create new topic on hedera'),
(7, 'hedera topic send message', 'send consensus message over hedera topic'),
(8, 'hedera account create', 'create new account on hedera for holding some founds with unencrypted keys');

View File

@ -1,6 +0,0 @@
CREATE TABLE `operator_types` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
`text` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,8 +0,0 @@
CREATE TABLE `operators` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_pubkey` binary(32) NOT NULL,
`data_base64` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`modified` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,10 +0,0 @@
CREATE TABLE `pending_transactions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`transactionID` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
`service` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
`method` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
`h_server_id` int(11) NOT NULL,
`timeout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `transactionID` (`transactionID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,5 +0,0 @@
CREATE TABLE `roles` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,12 +0,0 @@
CREATE TABLE `server_users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`role` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'admin',
`activated` tinyint(4) NOT NULL DEFAULT '0',
`last_login` datetime DEFAULT NULL,
`created` datetime NOT NULL,
`modified` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,8 +0,0 @@
CREATE TABLE `state_balances` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`state_user_id` int(10) unsigned NOT NULL,
`modified` datetime NOT NULL,
`record_date`datetime NULL,
`amount` bigint(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,11 +0,0 @@
CREATE TABLE `state_created` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`transaction_id` int(10) unsigned NOT NULL,
`month` tinyint(3) unsigned NOT NULL,
`year` smallint(5) unsigned NOT NULL,
`state_user_id` int(10) unsigned NOT NULL,
`created` datetime NOT NULL,
`short_ident_hash` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `short_ident_hash` (`short_ident_hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,8 +0,0 @@
CREATE TABLE `state_errors` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`state_user_id` int(10) unsigned NOT NULL,
`transaction_type_id` int(10) unsigned NOT NULL,
`created` datetime NOT NULL,
`message_json` text COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,8 +0,0 @@
CREATE TABLE `state_group_addresses` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`group_id` int(10) unsigned NOT NULL,
`public_key` binary(32) NOT NULL,
`address_type_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE(`public_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,7 +0,0 @@
CREATE TABLE `state_group_relationships` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`group1_id` int(10) unsigned NOT NULL,
`group2_id` int(10) unsigned NOT NULL,
`state_relationship_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,8 +0,0 @@
CREATE TABLE `state_groups` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`index_id` varbinary(64) NOT NULL,
`name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`root_public_key` binary(32) NOT NULL,
`user_count` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,6 +0,0 @@
CREATE TABLE `state_relationship_types` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
`text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,6 +0,0 @@
CREATE TABLE `state_user_roles` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`state_user_id` int(11) NOT NULL,
`role_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,9 +0,0 @@
CREATE TABLE `state_user_transactions` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`state_user_id` int UNSIGNED NOT NULL,
`transaction_id` int UNSIGNED NOT NULL,
`transaction_type_id` int UNSIGNED NOT NULL,
`balance` bigint(20) DEFAULT 0,
`balance_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,13 +0,0 @@
CREATE TABLE `state_users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`index_id` smallint(6) NOT NULL DEFAULT '0',
`group_id` int(10) unsigned NOT NULL DEFAULT '0',
`public_key` binary(32) NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`first_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`last_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`disabled` tinyint(4) DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `public_key` (`public_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,9 +0,0 @@
CREATE TABLE `transaction_creations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`transaction_id` int(10) unsigned NOT NULL,
`state_user_id` int(10) unsigned NOT NULL,
`amount` bigint(20) NOT NULL,
`ident_hash` binary(32) NOT NULL,
`target_date` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,9 +0,0 @@
CREATE TABLE `transaction_group_addaddress` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`transaction_id` int unsigned NOT NULL,
`address_type_id` int unsigned NOT NULL,
`remove_from_group` BOOLEAN DEFAULT FALSE,
`public_key` binary(32) NOT NULL,
`state_user_id` int unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -1,7 +0,0 @@
CREATE TABLE `transaction_group_allowtrades` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`transaction_id` int(10) unsigned NOT NULL,
`remote_group_id` varbinary(64) NOT NULL,
`allow` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Some files were not shown because too many files have changed in this diff Show More