mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 1393-have-an-delete-button-for-the-search-input
This commit is contained in:
commit
96376eaeeb
50
.github/workflows/publish.yml
vendored
50
.github/workflows/publish.yml
vendored
@ -106,45 +106,6 @@ jobs:
|
||||
name: docker-database-production_up
|
||||
path: /tmp/database_up.tar
|
||||
|
||||
##############################################################################
|
||||
# JOB: DOCKER BUILD PRODUCTION LOGIN SERVER ##################################
|
||||
##############################################################################
|
||||
build_production_login_server:
|
||||
name: Docker Build Production - Login Server
|
||||
runs-on: ubuntu-latest
|
||||
#needs: [nothing]
|
||||
steps:
|
||||
##########################################################################
|
||||
# CHECKOUT CODE ##########################################################
|
||||
##########################################################################
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
##########################################################################
|
||||
# SET ENVS ###############################################################
|
||||
##########################################################################
|
||||
- name: ENV - VERSION
|
||||
run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV
|
||||
- name: ENV - BUILD_DATE
|
||||
run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
|
||||
- name: ENV - BUILD_VERSION
|
||||
run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
|
||||
- name: ENV - BUILD_COMMIT
|
||||
run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV
|
||||
##########################################################################
|
||||
# LOGIN SERVER ###########################################################
|
||||
##########################################################################
|
||||
- name: Login Server | Build `production` image
|
||||
run: |
|
||||
docker build -t "gradido/login_server:latest" -t "gradido/login_server:production" -t "gradido/login_server:${VERSION}" -t "gradido/login_server:${BUILD_VERSION}" login_server/
|
||||
docker save "gradido/login_server" > /tmp/login_server.tar
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: docker-login-server-production
|
||||
path: /tmp/login_server.tar
|
||||
|
||||
##############################################################################
|
||||
# JOB: DOCKER BUILD PRODUCTION COMMUNITY SERVER ##############################
|
||||
##############################################################################
|
||||
@ -262,7 +223,7 @@ jobs:
|
||||
upload_to_dockerhub:
|
||||
name: Upload to Dockerhub
|
||||
runs-on: ubuntu-latest
|
||||
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]
|
||||
needs: [build_production_frontend, build_production_backend, build_production_database_up, build_production_community_server, build_production_mariadb, build_production_nginx]
|
||||
env:
|
||||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
@ -296,13 +257,6 @@ jobs:
|
||||
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:
|
||||
name: docker-login-server-production
|
||||
path: /tmp
|
||||
- name: Load Docker Image
|
||||
run: docker load < /tmp/login_server.tar
|
||||
- name: Download Docker Image (Community Server)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
@ -335,8 +289,6 @@ jobs:
|
||||
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
|
||||
run: docker push --all-tags gradido/community_server
|
||||
- name: Push MariaDB
|
||||
|
||||
99
.github/workflows/test.yml
vendored
99
.github/workflows/test.yml
vendored
@ -107,28 +107,6 @@ jobs:
|
||||
name: docker-database-test_up
|
||||
path: /tmp/database_up.tar
|
||||
|
||||
##############################################################################
|
||||
# JOB: DOCKER BUILD TEST LOGIN SERVER ########################################
|
||||
##############################################################################
|
||||
build_test_login_server:
|
||||
name: Docker Build Test - Login Server
|
||||
runs-on: ubuntu-latest
|
||||
#needs: [nothing]
|
||||
steps:
|
||||
##########################################################################
|
||||
# CHECKOUT CODE ##########################################################
|
||||
##########################################################################
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
##########################################################################
|
||||
# BUILD LOGIN SERVER DOCKER IMAGE ########################################
|
||||
##########################################################################
|
||||
- name: login server | Build `release` image
|
||||
run: |
|
||||
docker build -t "gradido/login_server:release" -f ./login_server/Dockerfile login_server/
|
||||
|
||||
##############################################################################
|
||||
# JOB: DOCKER BUILD TEST COMMUNITY SERVER ####################################
|
||||
##############################################################################
|
||||
@ -470,7 +448,7 @@ jobs:
|
||||
report_name: Coverage Admin Interface
|
||||
type: lcov
|
||||
result_path: ./coverage/lcov.info
|
||||
min_coverage: 78
|
||||
min_coverage: 81
|
||||
token: ${{ github.token }}
|
||||
|
||||
##############################################################################
|
||||
@ -531,73 +509,6 @@ jobs:
|
||||
min_coverage: 38
|
||||
token: ${{ github.token }}
|
||||
|
||||
##############################################################################
|
||||
# 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 }')"
|
||||
- name: get mariadb container id
|
||||
run: echo "::set-output name=id::$(docker container ls | grep mariadb | awk '{ print $1 }')"
|
||||
id: mariadb_container
|
||||
- name: get automatic created network
|
||||
run: echo "::set-output name=id::$(docker network ls | grep github_network | awk '{ print $1 }')"
|
||||
id: network
|
||||
##########################################################################
|
||||
# CHECKOUT CODE ##########################################################
|
||||
##########################################################################
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
# Database migration
|
||||
- name: Start database migration
|
||||
run: |
|
||||
docker build --target production_up -t "gradido/database:production_up" database/
|
||||
docker run --network ${{ steps.network.outputs.id }} --name=database --env NODE_ENV=production --env DB_HOST=mariadb --env DB_DATABASE=gradido_community_test -d gradido/database:production_up
|
||||
##########################################################################
|
||||
# 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 ###########################################
|
||||
##############################################################################
|
||||
@ -627,11 +538,6 @@ jobs:
|
||||
- name: get database migration container id
|
||||
run: echo "::set-output name=id::$(docker container ls | grep database | awk '{ print $1 }')"
|
||||
id: database_container
|
||||
- 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 ##########################################################
|
||||
##########################################################################
|
||||
@ -647,9 +553,6 @@ jobs:
|
||||
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 }}
|
||||
- name: check migration
|
||||
|
||||
28
.gitmodules
vendored
28
.gitmodules
vendored
@ -3,34 +3,6 @@
|
||||
url = https://github.com/gradido/gn.git
|
||||
branch = master
|
||||
|
||||
[submodule "login_server/dependencies/tinf"]
|
||||
path = login_server/dependencies/tinf
|
||||
url = https://github.com/jibsen/tinf.git
|
||||
[submodule "login_server/dependencies/mariadb-connector-c"]
|
||||
path = login_server/dependencies/mariadb-connector-c
|
||||
url = https://github.com/MariaDB/mariadb-connector-c.git
|
||||
[submodule "login_server/src/proto"]
|
||||
path = login_server/src/proto
|
||||
url = https://github.com/gradido/gradido_protocol.git
|
||||
[submodule "login_server/dependencies/spirit-po"]
|
||||
path = login_server/dependencies/spirit-po
|
||||
url = https://github.com/cbeck88/spirit-po.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 = 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
|
||||
|
||||
@ -60,7 +60,6 @@ docker-compose -f docker-compose.yml up
|
||||
- [frontend](./frontend) Wallet frontend
|
||||
- [backend](./backend) GraphQL & Business logic backend
|
||||
- [mariadb](./mariadb) Database backend
|
||||
- [login_server](./login_server) User credential storage & business logic backend
|
||||
- [community_server](./community_server/) Business logic backend
|
||||
|
||||
We are currently restructuring the service to reduce dependencies and unify business logic into one place. Furthermore the databases defined for each service will be unified into one.
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
"dev": "yarn run serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "eslint --ext .js,.vue .",
|
||||
"test": "jest --coverage",
|
||||
"test": "TZ=UTC jest --coverage",
|
||||
"locales": "scripts/missing-keys.sh && scripts/sort.sh"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -36,14 +36,12 @@
|
||||
"graphql": "^15.6.1",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"jest": "26.6.3",
|
||||
"moment": "^2.29.1",
|
||||
"regenerator-runtime": "^0.13.9",
|
||||
"stats-webpack-plugin": "^0.7.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-apollo": "^3.0.8",
|
||||
"vue-i18n": "^8.26.5",
|
||||
"vue-jest": "^3.0.7",
|
||||
"vue-moment": "^4.1.0",
|
||||
"vue-router": "^3.5.3",
|
||||
"vue-toasted": "^1.1.28",
|
||||
"vuex": "^3.6.2",
|
||||
|
||||
@ -5,14 +5,6 @@ import { createPendingCreations } from '../graphql/createPendingCreations'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
const apolloMock = jest.fn().mockResolvedValue({
|
||||
data: {
|
||||
verifyLogin: {
|
||||
name: 'success',
|
||||
id: 0,
|
||||
},
|
||||
},
|
||||
})
|
||||
const apolloMutateMock = jest.fn().mockResolvedValue({
|
||||
data: {
|
||||
createPendingCreation: [0, 0, 0],
|
||||
@ -23,19 +15,12 @@ const toastedErrorMock = jest.fn()
|
||||
const toastedSuccessMock = jest.fn()
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
$moment: jest.fn(() => {
|
||||
return {
|
||||
format: jest.fn((m) => m),
|
||||
subtract: jest.fn(() => {
|
||||
return {
|
||||
format: jest.fn((m) => m),
|
||||
}
|
||||
}),
|
||||
}
|
||||
$t: jest.fn((t, options) => (options ? [t, options] : t)),
|
||||
$d: jest.fn((d) => {
|
||||
const date = new Date(d)
|
||||
return date.toISOString().split('T')[0]
|
||||
}),
|
||||
$apollo: {
|
||||
query: apolloMock,
|
||||
mutate: apolloMutateMock,
|
||||
},
|
||||
$store: {
|
||||
@ -56,7 +41,12 @@ const mocks = {
|
||||
const propsData = {
|
||||
type: '',
|
||||
creation: [],
|
||||
itemsMassCreation: {},
|
||||
}
|
||||
|
||||
const now = new Date(Date.now())
|
||||
const getCreationDate = (sub) => {
|
||||
const date = sub === 0 ? now : new Date(now.getFullYear(), now.getMonth() - sub, 1, 0)
|
||||
return date.toISOString().split('T')[0]
|
||||
}
|
||||
|
||||
describe('CreationFormular', () => {
|
||||
@ -75,21 +65,24 @@ describe('CreationFormular', () => {
|
||||
expect(wrapper.find('.component-creation-formular').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
describe('server sends back moderator data', () => {
|
||||
it('called store commit with mocked data', () => {
|
||||
expect(stateCommitMock).toBeCalledWith('moderator', { name: 'success', id: 0 })
|
||||
})
|
||||
})
|
||||
|
||||
describe('server throws error for moderator data call', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
apolloMock.mockRejectedValueOnce({ message: 'Ouch!' })
|
||||
wrapper = Wrapper()
|
||||
describe('text and value form props', () => {
|
||||
beforeEach(async () => {
|
||||
wrapper = mount(CreationFormular, {
|
||||
localVue,
|
||||
mocks,
|
||||
propsData: {
|
||||
creationUserData: { memo: 'Memo from property', amount: 42 },
|
||||
...propsData,
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it('has called store commit with fake data', () => {
|
||||
expect(stateCommitMock).toBeCalledWith('moderator', { id: 0, name: 'Test Moderator' })
|
||||
it('has text taken from props', () => {
|
||||
expect(wrapper.vm.text).toBe('Memo from property')
|
||||
})
|
||||
|
||||
it('has value taken from props', () => {
|
||||
expect(wrapper.vm.value).toBe(42)
|
||||
})
|
||||
})
|
||||
|
||||
@ -98,52 +91,6 @@ describe('CreationFormular', () => {
|
||||
expect(wrapper.findAll('input[type="radio"]').length).toBe(3)
|
||||
})
|
||||
|
||||
describe('with mass creation', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
await wrapper.setProps({ type: 'massCreation', creation: [200, 400, 600] })
|
||||
await wrapper.setData({ rangeMin: 180 })
|
||||
await wrapper.setData({ text: 'Test create coins' })
|
||||
await wrapper.setData({ value: 90 })
|
||||
})
|
||||
|
||||
describe('first radio button', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.findAll('input[type="radio"]').at(0).setChecked()
|
||||
})
|
||||
|
||||
it('emits update-radio-selected with index 0', () => {
|
||||
expect(wrapper.emitted()['update-radio-selected']).toEqual([
|
||||
[expect.arrayContaining([0])],
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe('second radio button', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.findAll('input[type="radio"]').at(1).setChecked()
|
||||
})
|
||||
|
||||
it('emits update-radio-selected with index 1', () => {
|
||||
expect(wrapper.emitted()['update-radio-selected']).toEqual([
|
||||
[expect.arrayContaining([1])],
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe('third radio button', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.findAll('input[type="radio"]').at(2).setChecked()
|
||||
})
|
||||
|
||||
it('emits update-radio-selected with index 2', () => {
|
||||
expect(wrapper.emitted()['update-radio-selected']).toEqual([
|
||||
[expect.arrayContaining([2])],
|
||||
])
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('with single creation', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
@ -153,17 +100,17 @@ describe('CreationFormular', () => {
|
||||
item: { email: 'benjamin@bluemchen.de' },
|
||||
})
|
||||
await wrapper.findAll('input[type="radio"]').at(1).setChecked()
|
||||
await wrapper.find('textarea').setValue('Test create coins')
|
||||
await wrapper.find('input[type="number"]').setValue(90)
|
||||
})
|
||||
|
||||
describe('first radio button', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.findAll('input[type="radio"]').at(0).setChecked()
|
||||
await wrapper.find('textarea').setValue('Test create coins')
|
||||
})
|
||||
|
||||
it('sets rangeMax to 200', () => {
|
||||
expect(wrapper.vm.rangeMax).toBe(400)
|
||||
expect(wrapper.vm.rangeMax).toBe(200)
|
||||
})
|
||||
|
||||
describe('sendForm', () => {
|
||||
@ -177,7 +124,7 @@ describe('CreationFormular', () => {
|
||||
mutation: createPendingCreation,
|
||||
variables: {
|
||||
email: 'benjamin@bluemchen.de',
|
||||
creationDate: 'YYYY-MM-01',
|
||||
creationDate: getCreationDate(2),
|
||||
amount: 90,
|
||||
memo: 'Test create coins',
|
||||
moderator: 0,
|
||||
@ -185,9 +132,30 @@ describe('CreationFormular', () => {
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('emits update-user-data', () => {
|
||||
expect(wrapper.emitted('update-user-data')).toEqual([
|
||||
[{ email: 'benjamin@bluemchen.de' }, [0, 0, 0]],
|
||||
])
|
||||
})
|
||||
|
||||
it('toasts a success message', () => {
|
||||
expect(toastedSuccessMock).toBeCalledWith([
|
||||
'creation_form.toasted',
|
||||
{ email: 'benjamin@bluemchen.de', value: '90' },
|
||||
])
|
||||
})
|
||||
|
||||
it('updates open creations in store', () => {
|
||||
expect(stateCommitMock).toBeCalledWith('openCreationsPlus', 1)
|
||||
})
|
||||
|
||||
it('resets the form data', () => {
|
||||
expect(wrapper.vm.value).toBe(0)
|
||||
})
|
||||
})
|
||||
|
||||
describe('sendForm', () => {
|
||||
describe('sendForm with server error', () => {
|
||||
beforeEach(async () => {
|
||||
apolloMutateMock.mockRejectedValueOnce({ message: 'Ouch!' })
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
@ -373,9 +341,18 @@ describe('CreationFormular', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('with mass creation', () => {
|
||||
describe('mass creation with success', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
apolloMutateMock.mockResolvedValue({
|
||||
data: {
|
||||
createPendingCreations: {
|
||||
success: true,
|
||||
successfulCreation: ['bob@baumeister.de', 'bibi@bloxberg.de'],
|
||||
failedCreation: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
await wrapper.setProps({
|
||||
type: 'massCreation',
|
||||
creation: [200, 400, 600],
|
||||
@ -395,14 +372,14 @@ describe('CreationFormular', () => {
|
||||
pendingCreations: [
|
||||
{
|
||||
email: 'bob@baumeister.de',
|
||||
creationDate: 'YYYY-MM-01',
|
||||
creationDate: getCreationDate(1),
|
||||
amount: 200,
|
||||
memo: 'Test mass create coins',
|
||||
moderator: 0,
|
||||
},
|
||||
{
|
||||
email: 'bibi@bloxberg.de',
|
||||
creationDate: 'YYYY-MM-01',
|
||||
creationDate: getCreationDate(1),
|
||||
amount: 200,
|
||||
memo: 'Test mass create coins',
|
||||
moderator: 0,
|
||||
@ -412,6 +389,73 @@ describe('CreationFormular', () => {
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('updates open creations in store', () => {
|
||||
expect(stateCommitMock).toBeCalledWith('openCreationsPlus', 2)
|
||||
})
|
||||
|
||||
it('emits remove-all-bookmark', () => {
|
||||
expect(wrapper.emitted('remove-all-bookmark')).toBeTruthy()
|
||||
})
|
||||
})
|
||||
|
||||
describe('mass creation with success but all failed', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
apolloMutateMock.mockResolvedValue({
|
||||
data: {
|
||||
createPendingCreations: {
|
||||
success: true,
|
||||
successfulCreation: [],
|
||||
failedCreation: ['bob@baumeister.de', 'bibi@bloxberg.de'],
|
||||
},
|
||||
},
|
||||
})
|
||||
await wrapper.setProps({
|
||||
type: 'massCreation',
|
||||
creation: [200, 400, 600],
|
||||
items: [{ email: 'bob@baumeister.de' }, { email: 'bibi@bloxberg.de' }],
|
||||
})
|
||||
await wrapper.findAll('input[type="radio"]').at(1).setChecked()
|
||||
await wrapper.find('textarea').setValue('Test mass create coins')
|
||||
await wrapper.find('input[type="number"]').setValue(200)
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
it('updates open creations in store', () => {
|
||||
expect(stateCommitMock).toBeCalledWith('openCreationsPlus', 0)
|
||||
})
|
||||
|
||||
it('toasts two errors', () => {
|
||||
expect(toastedErrorMock).toBeCalledWith(
|
||||
'Could not created PendingCreation for bob@baumeister.de',
|
||||
)
|
||||
expect(toastedErrorMock).toBeCalledWith(
|
||||
'Could not created PendingCreation for bibi@bloxberg.de',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('mass creation with error', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
apolloMutateMock.mockRejectedValue({
|
||||
message: 'Oh no!',
|
||||
})
|
||||
await wrapper.setProps({
|
||||
type: 'massCreation',
|
||||
creation: [200, 400, 600],
|
||||
items: [{ email: 'bob@baumeister.de' }, { email: 'bibi@bloxberg.de' }],
|
||||
})
|
||||
await wrapper.findAll('input[type="radio"]').at(1).setChecked()
|
||||
await wrapper.find('textarea').setValue('Test mass create coins')
|
||||
await wrapper.find('input[type="number"]').setValue(200)
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
it('toasts an error message', () => {
|
||||
expect(toastedErrorMock).toBeCalledWith('Oh no!')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -7,51 +7,15 @@
|
||||
<label>{{ $t('creation_form.select_month') }}</label>
|
||||
</div>
|
||||
<b-row class="ml-4">
|
||||
<b-col>
|
||||
<b-form-radio
|
||||
id="beforeLastMonth"
|
||||
v-model="radioSelected"
|
||||
:value="beforeLastMonth"
|
||||
:disabled="creation[0] === 0"
|
||||
size="lg"
|
||||
@change="updateRadioSelected(beforeLastMonth, 0, creation[0])"
|
||||
>
|
||||
<label for="beforeLastMonth">
|
||||
{{ beforeLastMonth.short }} {{ creation[0] != null ? creation[0] + ' GDD' : '' }}
|
||||
</label>
|
||||
</b-form-radio>
|
||||
</b-col>
|
||||
<b-col>
|
||||
<b-form-radio
|
||||
id="lastMonth"
|
||||
v-model="radioSelected"
|
||||
:value="lastMonth"
|
||||
:disabled="creation[1] === 0"
|
||||
size="lg"
|
||||
@change="updateRadioSelected(lastMonth, 1, creation[1])"
|
||||
>
|
||||
<label for="lastMonth">
|
||||
{{ lastMonth.short }} {{ creation[1] != null ? creation[1] + ' GDD' : '' }}
|
||||
</label>
|
||||
</b-form-radio>
|
||||
</b-col>
|
||||
<b-col>
|
||||
<b-form-radio
|
||||
id="currentMonth"
|
||||
v-model="radioSelected"
|
||||
:value="currentMonth"
|
||||
:disabled="creation[2] === 0"
|
||||
size="lg"
|
||||
@change="updateRadioSelected(currentMonth, 2, creation[2])"
|
||||
>
|
||||
<label for="currentMonth">
|
||||
{{ currentMonth.short }} {{ creation[2] != null ? creation[2] + ' GDD' : '' }}
|
||||
</label>
|
||||
</b-form-radio>
|
||||
</b-col>
|
||||
<b-form-radio-group
|
||||
v-model="selected"
|
||||
:options="radioOptions"
|
||||
value-field="item"
|
||||
text-field="name"
|
||||
name="month-selection"
|
||||
></b-form-radio-group>
|
||||
</b-row>
|
||||
|
||||
<div class="m-4" v-show="createdIndex != null">
|
||||
<b-row class="m-4" v-show="selected !== ''">
|
||||
<label>{{ $t('creation_form.select_value') }}</label>
|
||||
<div>
|
||||
<b-input-group prepend="GDD" append=".00">
|
||||
@ -62,7 +26,6 @@
|
||||
:max="rangeMax"
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
|
||||
<b-input-group prepend="0" :append="String(rangeMax)" class="mt-3">
|
||||
<b-form-input
|
||||
type="range"
|
||||
@ -73,7 +36,7 @@
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
</div>
|
||||
</b-row>
|
||||
<div class="m-4">
|
||||
<label>{{ $t('creation_form.enter_text') }}</label>
|
||||
<div>
|
||||
@ -100,18 +63,17 @@
|
||||
variant="success"
|
||||
class="test-submit"
|
||||
@click="submitCreation"
|
||||
:disabled="radioSelected === '' || value <= 0 || text.length < 10"
|
||||
:disabled="selected === '' || value <= 0 || text.length < 10"
|
||||
>
|
||||
{{ $t('creation_form.update_creation') }}
|
||||
</b-button>
|
||||
|
||||
<b-button
|
||||
v-else
|
||||
type="button"
|
||||
variant="success"
|
||||
class="test-submit"
|
||||
@click="submitCreation"
|
||||
:disabled="radioSelected === '' || value <= 0 || text.length < 10"
|
||||
:disabled="selected === '' || value <= 0 || text.length < 10"
|
||||
>
|
||||
{{ $t('creation_form.submit_creation') }}
|
||||
</b-button>
|
||||
@ -123,11 +85,12 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { verifyLogin } from '../graphql/verifyLogin'
|
||||
import { createPendingCreation } from '../graphql/createPendingCreation'
|
||||
import { createPendingCreations } from '../graphql/createPendingCreations'
|
||||
import { creationMonths } from '../mixins/creationMonths'
|
||||
export default {
|
||||
name: 'CreationFormular',
|
||||
mixins: [creationMonths],
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
@ -166,71 +129,39 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
radioSelected: '',
|
||||
text: !this.creationUserData.memo ? '' : this.creationUserData.memo,
|
||||
value: !this.creationUserData.amount ? 0 : this.creationUserData.amount,
|
||||
rangeMin: 0,
|
||||
rangeMax: 1000,
|
||||
currentMonth: {
|
||||
short: this.$moment().format('MMMM'),
|
||||
long: this.$moment().format('YYYY-MM-DD'),
|
||||
year: this.$moment().format('YYYY'),
|
||||
},
|
||||
lastMonth: {
|
||||
short: this.$moment().subtract(1, 'month').format('MMMM'),
|
||||
long: this.$moment().subtract(1, 'month').format('YYYY-MM') + '-01',
|
||||
year: this.$moment().subtract(1, 'month').format('YYYY'),
|
||||
},
|
||||
beforeLastMonth: {
|
||||
short: this.$moment().subtract(2, 'month').format('MMMM'),
|
||||
long: this.$moment().subtract(2, 'month').format('YYYY-MM') + '-01',
|
||||
year: this.$moment().subtract(2, 'month').format('YYYY'),
|
||||
},
|
||||
submitObj: null,
|
||||
isdisabled: true,
|
||||
createdIndex: null,
|
||||
selected: '',
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// Auswählen eines Zeitraumes
|
||||
updateRadioSelected(name, index, openCreation) {
|
||||
this.createdIndex = index
|
||||
updateRadioSelected(name) {
|
||||
// do we want to reset the memo everytime the month changes?
|
||||
this.text = this.$t('creation_form.creation_for') + ' ' + name.short + ' ' + name.year
|
||||
// Wenn Mehrfachschöpfung
|
||||
if (this.type === 'massCreation') {
|
||||
// An Creation.vue emitten und radioSelectedMass aktualisieren
|
||||
this.$emit('update-radio-selected', [name, index])
|
||||
} else if (this.type === 'singleCreation') {
|
||||
if (this.type === 'singleCreation') {
|
||||
this.rangeMin = 0
|
||||
// Der maximale offene Betrag an GDD die für ein User noch geschöpft werden kann
|
||||
this.rangeMax = openCreation
|
||||
this.rangeMax = name.creation
|
||||
}
|
||||
},
|
||||
submitCreation() {
|
||||
let submitObj = []
|
||||
if (this.type === 'massCreation') {
|
||||
// Die anzahl der Mitglieder aus der Mehrfachschöpfung
|
||||
const i = Object.keys(this.items).length
|
||||
// hinweis das eine Mehrfachschöpfung ausgeführt wird an (Anzahl der MItgleider an die geschöpft wird)
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('SUBMIT CREATION => ' + this.type + ' >> für VIELE ' + i + ' Mitglieder')
|
||||
this.submitObj = []
|
||||
this.items.forEach((item) => {
|
||||
this.submitObj.push({
|
||||
submitObj.push({
|
||||
email: item.email,
|
||||
creationDate: this.radioSelected.long,
|
||||
creationDate: this.selected.date,
|
||||
amount: Number(this.value),
|
||||
memo: this.text,
|
||||
moderator: Number(this.$store.state.moderator.id),
|
||||
})
|
||||
})
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('MehrfachSCHÖPFUNG ABSENDEN FÜR >> ' + i + ' Mitglieder')
|
||||
this.$apollo
|
||||
.mutate({
|
||||
mutation: createPendingCreations,
|
||||
variables: {
|
||||
pendingCreations: this.submitObj,
|
||||
pendingCreations: submitObj,
|
||||
},
|
||||
fetchPolicy: 'no-cache',
|
||||
})
|
||||
@ -241,6 +172,7 @@ export default {
|
||||
)
|
||||
if (result.data.createPendingCreations.failedCreation.length > 0) {
|
||||
result.data.createPendingCreations.failedCreation.forEach((failed) => {
|
||||
// TODO: Please localize this error message
|
||||
this.$toasted.error('Could not created PendingCreation for ' + failed)
|
||||
})
|
||||
}
|
||||
@ -250,18 +182,17 @@ export default {
|
||||
this.$toasted.error(error.message)
|
||||
})
|
||||
} else if (this.type === 'singleCreation') {
|
||||
this.submitObj = {
|
||||
submitObj = {
|
||||
email: this.item.email,
|
||||
creationDate: this.radioSelected.long,
|
||||
creationDate: this.selected.date,
|
||||
amount: Number(this.value),
|
||||
memo: this.text,
|
||||
moderator: Number(this.$store.state.moderator.id),
|
||||
}
|
||||
|
||||
this.$apollo
|
||||
.mutate({
|
||||
mutation: createPendingCreation,
|
||||
variables: this.submitObj,
|
||||
variables: submitObj,
|
||||
})
|
||||
.then((result) => {
|
||||
this.$emit('update-user-data', this.item, result.data.createPendingCreation)
|
||||
@ -272,36 +203,22 @@ export default {
|
||||
}),
|
||||
)
|
||||
this.$store.commit('openCreationsPlus', 1)
|
||||
this.submitObj = null
|
||||
this.createdIndex = null
|
||||
// das creation Formular reseten
|
||||
// what is this? Tests says that this.text is not reseted
|
||||
this.$refs.creationForm.reset()
|
||||
// Den geschöpften Wert auf o setzen
|
||||
this.value = 0
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toasted.error(error.message)
|
||||
this.submitObj = null
|
||||
// das creation Formular reseten
|
||||
this.$refs.creationForm.reset()
|
||||
// Den geschöpften Wert auf o setzen
|
||||
this.value = 0
|
||||
})
|
||||
}
|
||||
},
|
||||
searchModeratorData() {
|
||||
this.$apollo
|
||||
.query({ query: verifyLogin })
|
||||
.then((result) => {
|
||||
this.$store.commit('moderator', result.data.verifyLogin)
|
||||
})
|
||||
.catch(() => {
|
||||
this.$store.commit('moderator', { id: 0, name: 'Test Moderator' })
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.searchModeratorData()
|
||||
watch: {
|
||||
selected() {
|
||||
this.updateRadioSelected(this.selected)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -7,8 +7,9 @@ const apolloMutateMock = jest.fn().mockResolvedValue({
|
||||
data: {
|
||||
updatePendingCreation: {
|
||||
creation: [0, 0, 0],
|
||||
amount: 500,
|
||||
date: new Date(),
|
||||
memo: 'qwertzuiopasdfghjkl',
|
||||
memo: 'Test Schöpfung 2',
|
||||
moderator: 0,
|
||||
},
|
||||
},
|
||||
@ -20,15 +21,9 @@ const toastedSuccessMock = jest.fn()
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
$moment: jest.fn(() => {
|
||||
return {
|
||||
format: jest.fn((m) => m),
|
||||
subtract: jest.fn(() => {
|
||||
return {
|
||||
format: jest.fn((m) => m),
|
||||
}
|
||||
}),
|
||||
}
|
||||
$d: jest.fn((d) => {
|
||||
const date = new Date(d)
|
||||
return date.toISOString().split('T')[0]
|
||||
}),
|
||||
$apollo: {
|
||||
mutate: apolloMutateMock,
|
||||
@ -48,12 +43,18 @@ const mocks = {
|
||||
},
|
||||
}
|
||||
|
||||
const now = new Date(Date.now())
|
||||
const getCreationDate = (sub) => {
|
||||
const date = sub === 0 ? now : new Date(now.getFullYear(), now.getMonth() - sub, 1, 0)
|
||||
return date.toISOString().split('T')[0]
|
||||
}
|
||||
|
||||
const propsData = {
|
||||
creation: [200, 400, 600],
|
||||
creationUserData: {
|
||||
memo: 'Test schöpfung 1',
|
||||
amount: 100,
|
||||
date: '2021-12-01',
|
||||
date: getCreationDate(0),
|
||||
},
|
||||
item: {
|
||||
id: 0,
|
||||
@ -82,196 +83,79 @@ describe('EditCreationFormular', () => {
|
||||
expect(wrapper.findAll('input[type="radio"]').length).toBe(3)
|
||||
})
|
||||
|
||||
describe('with single creation', () => {
|
||||
it('has the third radio button checked', () => {
|
||||
expect(wrapper.findAll('input[type="radio"]').at(0).element.checked).toBeFalsy()
|
||||
expect(wrapper.findAll('input[type="radio"]').at(1).element.checked).toBeFalsy()
|
||||
expect(wrapper.findAll('input[type="radio"]').at(2).element.checked).toBeTruthy()
|
||||
})
|
||||
|
||||
it('has rangeMax of 700', () => {
|
||||
expect(wrapper.find('input[type="number"]').attributes('max')).toBe('700')
|
||||
})
|
||||
|
||||
describe('change and save memo and value with success', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
await wrapper.setProps({ creation: [200, 400, 600] })
|
||||
await wrapper.setData({ rangeMin: 180 })
|
||||
await wrapper.setData({ text: 'Test create coins' })
|
||||
await wrapper.setData({ value: 90 })
|
||||
await wrapper.find('input[type="number"]').setValue(500)
|
||||
await wrapper.find('textarea').setValue('Test Schöpfung 2')
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
describe('first radio button', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.findAll('input[type="radio"]').at(0).setChecked()
|
||||
})
|
||||
|
||||
it('sets rangeMin to 0', () => {
|
||||
expect(wrapper.vm.rangeMin).toBe(0)
|
||||
})
|
||||
|
||||
it('sets rangeMax to 200', () => {
|
||||
expect(wrapper.vm.rangeMax).toBe(200)
|
||||
})
|
||||
|
||||
describe('sendForm', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
it('sends ... to apollo', () => {
|
||||
expect(apolloMutateMock).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
variables: {
|
||||
amount: 90,
|
||||
creationDate: 'YYYY-MM-01',
|
||||
email: 'bob@baumeister.de',
|
||||
id: 0,
|
||||
memo: 'Test create coins',
|
||||
moderator: 0,
|
||||
},
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('emits update-user-data', () => {
|
||||
expect(wrapper.emitted('update-user-data')).toBeTruthy()
|
||||
expect(wrapper.emitted('update-user-data')).toEqual([
|
||||
[
|
||||
{
|
||||
id: 0,
|
||||
email: 'bob@baumeister.de',
|
||||
},
|
||||
[0, 0, 0],
|
||||
],
|
||||
])
|
||||
})
|
||||
|
||||
it('toast success message', () => {
|
||||
expect(toastedSuccessMock).toBeCalledWith('creation_form.toasted_update')
|
||||
})
|
||||
|
||||
describe('sendForm with error', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
apolloMutateMock.mockRejectedValue({
|
||||
message: 'Ouch!',
|
||||
})
|
||||
wrapper = Wrapper()
|
||||
await wrapper.setProps({ type: 'singleCreation', creation: [200, 400, 600] })
|
||||
await wrapper.setData({ text: 'Test create coins' })
|
||||
await wrapper.setData({ value: 90 })
|
||||
await wrapper.findAll('input[type="radio"]').at(0).setChecked()
|
||||
await wrapper.setData({ rangeMin: 100 })
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
it('toast error message', () => {
|
||||
expect(toastedErrorMock).toBeCalledWith('Ouch!')
|
||||
})
|
||||
})
|
||||
})
|
||||
it('calls the API', () => {
|
||||
expect(apolloMutateMock).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
variables: {
|
||||
id: 0,
|
||||
email: 'bob@baumeister.de',
|
||||
creationDate: getCreationDate(0),
|
||||
amount: 500,
|
||||
memo: 'Test Schöpfung 2',
|
||||
moderator: 0,
|
||||
},
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
describe('second radio button', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.findAll('input[type="radio"]').at(1).setChecked()
|
||||
})
|
||||
|
||||
it('sets rangeMin to 0', () => {
|
||||
expect(wrapper.vm.rangeMin).toBe(0)
|
||||
})
|
||||
|
||||
it('sets rangeMax to 400', () => {
|
||||
expect(wrapper.vm.rangeMax).toBe(400)
|
||||
})
|
||||
|
||||
describe('sendForm', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
it('sends ... to apollo', () => {
|
||||
expect(apolloMutateMock).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
variables: {
|
||||
amount: 90,
|
||||
creationDate: 'YYYY-MM-01',
|
||||
email: 'bob@baumeister.de',
|
||||
id: 0,
|
||||
memo: 'Test create coins',
|
||||
moderator: 0,
|
||||
},
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
describe('sendForm with error', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
apolloMutateMock.mockRejectedValue({
|
||||
message: 'Ouch!',
|
||||
})
|
||||
wrapper = Wrapper()
|
||||
await wrapper.setProps({ creation: [200, 400, 600] })
|
||||
await wrapper.setData({ text: 'Test create coins' })
|
||||
await wrapper.setData({ value: 100 })
|
||||
await wrapper.findAll('input[type="radio"]').at(1).setChecked()
|
||||
await wrapper.setData({ rangeMin: 180 })
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
it('toast error message', () => {
|
||||
expect(toastedErrorMock).toBeCalledWith('Ouch!')
|
||||
})
|
||||
})
|
||||
})
|
||||
it('emits update-user-data', () => {
|
||||
expect(wrapper.emitted('update-user-data')).toEqual([
|
||||
[
|
||||
{
|
||||
id: 0,
|
||||
email: 'bob@baumeister.de',
|
||||
},
|
||||
[0, 0, 0],
|
||||
],
|
||||
])
|
||||
})
|
||||
|
||||
describe('third radio button', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.setData({ rangeMin: 180 })
|
||||
await wrapper.findAll('input[type="radio"]').at(2).setChecked()
|
||||
})
|
||||
it('emits update-creation-data', () => {
|
||||
expect(wrapper.emitted('update-creation-data')).toEqual([
|
||||
[
|
||||
{
|
||||
amount: 500,
|
||||
date: expect.any(Date),
|
||||
memo: 'Test Schöpfung 2',
|
||||
moderator: 0,
|
||||
row: expect.any(Object),
|
||||
},
|
||||
],
|
||||
])
|
||||
})
|
||||
|
||||
it('sets rangeMin to 180', () => {
|
||||
expect(wrapper.vm.rangeMin).toBe(180)
|
||||
})
|
||||
it('toasts a success message', () => {
|
||||
expect(toastedSuccessMock).toBeCalledWith('creation_form.toasted_update')
|
||||
})
|
||||
})
|
||||
|
||||
it('sets rangeMax to 700', () => {
|
||||
expect(wrapper.vm.rangeMax).toBe(700)
|
||||
})
|
||||
describe('change and save memo and value with error', () => {
|
||||
beforeEach(async () => {
|
||||
apolloMutateMock.mockRejectedValue({ message: 'Oh no!' })
|
||||
await wrapper.find('input[type="number"]').setValue(500)
|
||||
await wrapper.find('textarea').setValue('Test Schöpfung 2')
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
describe('sendForm with success', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
it('sends ... to apollo', () => {
|
||||
expect(apolloMutateMock).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
variables: {
|
||||
amount: 90,
|
||||
creationDate: 'YYYY-MM-DD',
|
||||
email: 'bob@baumeister.de',
|
||||
id: 0,
|
||||
memo: 'Test create coins',
|
||||
moderator: 0,
|
||||
},
|
||||
}),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('sendForm with error', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
apolloMutateMock.mockRejectedValue({
|
||||
message: 'Ouch!',
|
||||
})
|
||||
wrapper = Wrapper()
|
||||
await wrapper.setProps({ creation: [200, 400, 600] })
|
||||
await wrapper.setData({ text: 'Test create coins' })
|
||||
await wrapper.setData({ value: 90 })
|
||||
await wrapper.findAll('input[type="radio"]').at(2).setChecked()
|
||||
await wrapper.setData({ rangeMin: 180 })
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
it('toast error message', () => {
|
||||
expect(toastedErrorMock).toBeCalledWith('Ouch!')
|
||||
})
|
||||
})
|
||||
it('toasts an error message', () => {
|
||||
expect(toastedErrorMock).toBeCalledWith('Oh no!')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -6,65 +6,14 @@
|
||||
<label>{{ $t('creation_form.select_month') }}</label>
|
||||
</div>
|
||||
<b-row class="m-4">
|
||||
<b-col class="text-left">
|
||||
<b-form-radio
|
||||
id="beforeLastMonth"
|
||||
v-model="radioSelected"
|
||||
:value="beforeLastMonth"
|
||||
:disabled="selectedOpenCreationAmount[0] === 0"
|
||||
size="lg"
|
||||
@change="updateRadioSelected(beforeLastMonth, 0, selectedOpenCreationAmount[0])"
|
||||
>
|
||||
<label for="beforeLastMonth">
|
||||
{{ beforeLastMonth.short }}
|
||||
{{
|
||||
selectedOpenCreationAmount[0] != null
|
||||
? selectedOpenCreationAmount[0] + ' GDD'
|
||||
: ''
|
||||
}}
|
||||
</label>
|
||||
</b-form-radio>
|
||||
</b-col>
|
||||
<b-col>
|
||||
<b-form-radio
|
||||
id="lastMonth"
|
||||
v-model="radioSelected"
|
||||
:value="lastMonth"
|
||||
:disabled="selectedOpenCreationAmount[1] === 0"
|
||||
size="lg"
|
||||
@change="updateRadioSelected(lastMonth, 1, selectedOpenCreationAmount[1])"
|
||||
>
|
||||
<label for="lastMonth">
|
||||
{{ lastMonth.short }}
|
||||
{{
|
||||
selectedOpenCreationAmount[1] != null
|
||||
? selectedOpenCreationAmount[1] + ' GDD'
|
||||
: ''
|
||||
}}
|
||||
</label>
|
||||
</b-form-radio>
|
||||
</b-col>
|
||||
<b-col class="text-right">
|
||||
<b-form-radio
|
||||
id="currentMonth"
|
||||
v-model="radioSelected"
|
||||
:value="currentMonth"
|
||||
:disabled="selectedOpenCreationAmount[2] === 0"
|
||||
size="lg"
|
||||
@change="updateRadioSelected(currentMonth, 2, selectedOpenCreationAmount[2])"
|
||||
>
|
||||
<label for="currentMonth">
|
||||
{{ currentMonth.short }}
|
||||
{{
|
||||
selectedOpenCreationAmount[2] != null
|
||||
? selectedOpenCreationAmount[2] + ' GDD'
|
||||
: ''
|
||||
}}
|
||||
</label>
|
||||
</b-form-radio>
|
||||
</b-col>
|
||||
<b-form-radio-group
|
||||
v-model="selected"
|
||||
:options="radioOptions"
|
||||
value-field="item"
|
||||
text-field="name"
|
||||
name="month-selection"
|
||||
></b-form-radio-group>
|
||||
</b-row>
|
||||
|
||||
<div class="m-4">
|
||||
<label>{{ $t('creation_form.select_value') }}</label>
|
||||
<div>
|
||||
@ -76,7 +25,6 @@
|
||||
:max="rangeMax"
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
|
||||
<b-input-group prepend="0" :append="String(rangeMax)" class="mt-3">
|
||||
<b-form-input
|
||||
type="range"
|
||||
@ -113,7 +61,7 @@
|
||||
variant="success"
|
||||
class="test-submit"
|
||||
@click="submitCreation"
|
||||
:disabled="radioSelected === '' || value <= 0 || text.length < 10"
|
||||
:disabled="selected === '' || value <= 0 || text.length < 10"
|
||||
>
|
||||
{{ $t('creation_form.update_creation') }}
|
||||
</b-button>
|
||||
@ -126,8 +74,11 @@
|
||||
</template>
|
||||
<script>
|
||||
import { updatePendingCreation } from '../graphql/updatePendingCreation'
|
||||
import { creationMonths } from '../mixins/creationMonths'
|
||||
|
||||
export default {
|
||||
name: 'EditCreationFormular',
|
||||
mixins: [creationMonths],
|
||||
props: {
|
||||
item: {
|
||||
type: Object,
|
||||
@ -151,51 +102,26 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
radioSelected: '',
|
||||
text: !this.creationUserData.memo ? '' : this.creationUserData.memo,
|
||||
value: !this.creationUserData.amount ? 0 : this.creationUserData.amount,
|
||||
rangeMin: 0,
|
||||
rangeMax: 1000,
|
||||
currentMonth: {
|
||||
short: this.$moment().format('MMMM'),
|
||||
long: this.$moment().format('YYYY-MM-DD'),
|
||||
},
|
||||
lastMonth: {
|
||||
short: this.$moment().subtract(1, 'month').format('MMMM'),
|
||||
long: this.$moment().subtract(1, 'month').format('YYYY-MM') + '-01',
|
||||
},
|
||||
beforeLastMonth: {
|
||||
short: this.$moment().subtract(2, 'month').format('MMMM'),
|
||||
long: this.$moment().subtract(2, 'month').format('YYYY-MM') + '-01',
|
||||
},
|
||||
submitObj: null,
|
||||
isdisabled: true,
|
||||
createdIndex: null,
|
||||
selectedOpenCreationAmount: {},
|
||||
selected: '',
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
updateRadioSelected(name, index, openCreation) {
|
||||
this.createdIndex = index
|
||||
this.rangeMin = 0
|
||||
this.rangeMax = this.creation[index]
|
||||
},
|
||||
submitCreation() {
|
||||
this.submitObj = {
|
||||
id: this.item.id,
|
||||
email: this.item.email,
|
||||
creationDate: this.radioSelected.long,
|
||||
amount: Number(this.value),
|
||||
memo: this.text,
|
||||
moderator: Number(this.$store.state.moderator.id),
|
||||
}
|
||||
|
||||
// hinweis das eine ein einzelne Schöpfung abgesendet wird an (email)
|
||||
this.$apollo
|
||||
.mutate({
|
||||
mutation: updatePendingCreation,
|
||||
variables: this.submitObj,
|
||||
variables: {
|
||||
id: this.item.id,
|
||||
email: this.item.email,
|
||||
creationDate: this.selected.date,
|
||||
amount: Number(this.value),
|
||||
memo: this.text,
|
||||
moderator: Number(this.$store.state.moderator.id),
|
||||
},
|
||||
})
|
||||
.then((result) => {
|
||||
this.$emit('update-user-data', this.item, result.data.updatePendingCreation.creation)
|
||||
@ -212,8 +138,6 @@ export default {
|
||||
email: this.item.email,
|
||||
}),
|
||||
)
|
||||
this.submitObj = null
|
||||
this.createdIndex = null
|
||||
// das creation Formular reseten
|
||||
this.$refs.updateCreationForm.reset()
|
||||
// Den geschöpften Wert auf o setzen
|
||||
@ -221,7 +145,6 @@ export default {
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toasted.error(error.message)
|
||||
this.submitObj = null
|
||||
// das creation Formular reseten
|
||||
this.$refs.updateCreationForm.reset()
|
||||
// Den geschöpften Wert auf o setzen
|
||||
@ -231,25 +154,10 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (this.creationUserData.date) {
|
||||
switch (this.$moment(this.creationUserData.date).format('MMMM')) {
|
||||
case this.currentMonth.short:
|
||||
this.createdIndex = 2
|
||||
this.radioSelected = this.currentMonth
|
||||
break
|
||||
case this.lastMonth.short:
|
||||
this.createdIndex = 1
|
||||
this.radioSelected = this.lastMonth
|
||||
break
|
||||
case this.beforeLastMonth.short:
|
||||
this.createdIndex = 0
|
||||
this.radioSelected = this.beforeLastMonth
|
||||
break
|
||||
default:
|
||||
throw new Error('Something went wrong')
|
||||
}
|
||||
this.selectedOpenCreationAmount[this.createdIndex] =
|
||||
this.creation[this.createdIndex] + this.creationUserData.amount
|
||||
this.rangeMax = this.selectedOpenCreationAmount[this.createdIndex]
|
||||
const month = this.$d(new Date(this.creationUserData.date), 'month')
|
||||
const index = this.radioOptions.findIndex((obj) => obj.item.short === month)
|
||||
this.selected = this.radioOptions[index].item
|
||||
this.rangeMax = this.creation[index] + this.creationUserData.amount
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@ -107,16 +107,7 @@ describe('UserTable', () => {
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
$moment: jest.fn(() => {
|
||||
return {
|
||||
format: jest.fn((m) => m),
|
||||
subtract: jest.fn(() => {
|
||||
return {
|
||||
format: jest.fn((m) => m),
|
||||
}
|
||||
}),
|
||||
}
|
||||
}),
|
||||
$d: jest.fn((d) => d),
|
||||
$apollo: {
|
||||
query: apolloQueryMock,
|
||||
},
|
||||
@ -199,11 +190,6 @@ describe('UserTable', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
// it('expect(wrapper.html()).', () => {
|
||||
// // eslint-disable-next-line no-console
|
||||
// console.log(wrapper.html())
|
||||
// })
|
||||
})
|
||||
|
||||
describe('type UserListSearch', () => {
|
||||
@ -214,11 +200,6 @@ describe('UserTable', () => {
|
||||
it('has a DIV element with the class.component-user-table', () => {
|
||||
expect(wrapper.find('.component-user-table').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
// it('expect(wrapper.html()).', () => {
|
||||
// // eslint-disable-next-line no-console
|
||||
// console.log(wrapper.html())
|
||||
// })
|
||||
})
|
||||
|
||||
describe('type UserListMassCreation', () => {
|
||||
@ -229,11 +210,6 @@ describe('UserTable', () => {
|
||||
it('has a DIV element with the class.component-user-table', () => {
|
||||
expect(wrapper.find('.component-user-table').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
// it('expect(wrapper.html()).', () => {
|
||||
// // eslint-disable-next-line no-console
|
||||
// console.log(wrapper.html())
|
||||
// })
|
||||
})
|
||||
|
||||
describe('type PageCreationConfirm', () => {
|
||||
@ -244,48 +220,6 @@ describe('UserTable', () => {
|
||||
it('has a DIV element with the class.component-user-table', () => {
|
||||
expect(wrapper.find('.component-user-table').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
// it('expect(wrapper.html()).', () => {
|
||||
// // eslint-disable-next-line no-console
|
||||
// console.log(wrapper.html())
|
||||
// })
|
||||
})
|
||||
/**
|
||||
<user-table
|
||||
v-if="itemsList.length > 0"
|
||||
type="UserListSearch"
|
||||
:itemsUser="itemsList"
|
||||
:fieldsTable="Searchfields"
|
||||
:criteria="criteria"
|
||||
:creation="creation"
|
||||
@update-item="updateItem"
|
||||
/>
|
||||
|
||||
<user-table
|
||||
v-show="itemsMassCreation.length > 0"
|
||||
class="shadow p-3 mb-5 bg-white rounded"
|
||||
type="UserListMassCreation"
|
||||
:itemsUser="itemsMassCreation"
|
||||
:fieldsTable="fields"
|
||||
:criteria="null"
|
||||
:creation="creation"
|
||||
@update-item="updateItem"
|
||||
/>
|
||||
|
||||
<user-table
|
||||
class="mt-4"
|
||||
type="PageCreationConfirm"
|
||||
:itemsUser="confirmResult"
|
||||
:fieldsTable="fields"
|
||||
@remove-confirm-result="removeConfirmResult"
|
||||
/>
|
||||
|
||||
<user-table
|
||||
type="PageUserSearch"
|
||||
:itemsUser="searchResult"
|
||||
:fieldsTable="fields"
|
||||
:criteria="criteria"
|
||||
/>
|
||||
*/
|
||||
})
|
||||
})
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
<confirm-register-mail-formular
|
||||
:checked="row.item.emailChecked"
|
||||
:email="row.item.email"
|
||||
:dateLastSend="$moment().subtract(1, 'month').format('dddd, DD.MMMM.YYYY HH:mm'),"
|
||||
:dateLastSend="$d(new Date(), 'long')"
|
||||
/>
|
||||
</template>
|
||||
<template #show-transaction-list>
|
||||
@ -287,11 +287,11 @@ export default {
|
||||
this.overlay = false
|
||||
},
|
||||
bookmarkPush(item) {
|
||||
this.$emit('update-item', item, 'push')
|
||||
this.$emit('push-item', item)
|
||||
},
|
||||
bookmarkRemove(item) {
|
||||
if (this.type === 'UserListMassCreation') {
|
||||
this.$emit('update-item', item, 'remove')
|
||||
this.$emit('remove-item', item)
|
||||
}
|
||||
|
||||
if (this.type === 'PageCreationConfirm') {
|
||||
|
||||
@ -60,6 +60,15 @@ const dateTimeFormats = {
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
},
|
||||
monthShort: {
|
||||
month: 'short',
|
||||
},
|
||||
month: {
|
||||
month: 'long',
|
||||
},
|
||||
year: {
|
||||
year: 'numeric',
|
||||
},
|
||||
},
|
||||
de: {
|
||||
short: {
|
||||
@ -75,6 +84,15 @@ const dateTimeFormats = {
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
},
|
||||
monthShort: {
|
||||
month: 'short',
|
||||
},
|
||||
month: {
|
||||
month: 'long',
|
||||
},
|
||||
year: {
|
||||
year: 'numeric',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
"toasted_update": "`Offene Schöpfung {value} GDD) für {email} wurde geändert und liegt zur Bestätigung bereit",
|
||||
"update_creation": "Schöpfung aktualisieren"
|
||||
},
|
||||
"date": "Datum",
|
||||
"details": "Details",
|
||||
"e_mail": "E-Mail",
|
||||
"firstname": "Vorname",
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
"toasted_update": "Open creation {value} GDD) for {email} has been changed and is ready for confirmation.",
|
||||
"update_creation": "Creation update"
|
||||
},
|
||||
"date": "Date",
|
||||
"details": "Details",
|
||||
"e_mail": "E-mail",
|
||||
"firstname": "Firstname",
|
||||
|
||||
@ -17,7 +17,6 @@ import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
|
||||
import 'bootstrap/dist/css/bootstrap.css'
|
||||
import 'bootstrap-vue/dist/bootstrap-vue.css'
|
||||
|
||||
import moment from 'vue-moment'
|
||||
import Toasted from 'vue-toasted'
|
||||
|
||||
import { apolloProvider } from './plugins/apolloProvider'
|
||||
@ -26,8 +25,6 @@ Vue.use(BootstrapVue)
|
||||
|
||||
Vue.use(IconsPlugin)
|
||||
|
||||
Vue.use(moment)
|
||||
|
||||
Vue.use(VueApollo)
|
||||
|
||||
Vue.use(Toasted, {
|
||||
@ -48,7 +45,6 @@ i18n.locale =
|
||||
store.state.moderator && store.state.moderator.language ? store.state.moderator.language : 'en'
|
||||
|
||||
new Vue({
|
||||
moment,
|
||||
router,
|
||||
store,
|
||||
i18n,
|
||||
|
||||
@ -6,7 +6,6 @@ import Vue from 'vue'
|
||||
import VueApollo from 'vue-apollo'
|
||||
import i18n from './i18n'
|
||||
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
|
||||
import moment from 'vue-moment'
|
||||
import store from './store/store'
|
||||
import router from './router/router'
|
||||
|
||||
@ -14,7 +13,6 @@ jest.mock('vue')
|
||||
jest.mock('vue-apollo')
|
||||
jest.mock('vuex')
|
||||
jest.mock('vue-i18n')
|
||||
jest.mock('vue-moment')
|
||||
jest.mock('./store/store', () => {
|
||||
return {
|
||||
state: {
|
||||
@ -90,10 +88,6 @@ describe('main', () => {
|
||||
expect(Vue.use).toBeCalledWith(IconsPlugin)
|
||||
})
|
||||
|
||||
it('calls Moment', () => {
|
||||
expect(Vue.use).toBeCalledWith(moment)
|
||||
})
|
||||
|
||||
it('creates a store', () => {
|
||||
expect(Vue).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
|
||||
35
admin/src/mixins/creationMonths.js
Normal file
35
admin/src/mixins/creationMonths.js
Normal file
@ -0,0 +1,35 @@
|
||||
export const creationMonths = {
|
||||
props: {
|
||||
creation: [1000, 1000, 1000],
|
||||
},
|
||||
computed: {
|
||||
creationDates() {
|
||||
const now = new Date(Date.now())
|
||||
const dates = [now]
|
||||
for (let i = 1; i < 3; i++) {
|
||||
dates.push(new Date(now.getFullYear(), now.getMonth() - i, 1))
|
||||
}
|
||||
return dates.reverse()
|
||||
},
|
||||
creationDateObjects() {
|
||||
const result = []
|
||||
this.creationDates.forEach((date) => {
|
||||
result.push({
|
||||
short: this.$d(date, 'month'),
|
||||
long: this.$d(date, 'short'),
|
||||
year: this.$d(date, 'year'),
|
||||
date: this.$d(date, 'short', 'en'),
|
||||
})
|
||||
})
|
||||
return result
|
||||
},
|
||||
radioOptions() {
|
||||
return this.creationDateObjects.map((obj, idx) => {
|
||||
return {
|
||||
item: { ...obj, creation: this.creation[idx] },
|
||||
name: obj.short + (this.creation[idx] ? ' ' + this.creation[idx] + ' GDD' : ''),
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
import Creation from './Creation.vue'
|
||||
import Vue from 'vue'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
@ -29,25 +28,23 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
|
||||
})
|
||||
|
||||
const toastErrorMock = jest.fn()
|
||||
const storeCommitMock = jest.fn()
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
$d: jest.fn((d) => d),
|
||||
$apollo: {
|
||||
query: apolloQueryMock,
|
||||
},
|
||||
$toasted: {
|
||||
error: toastErrorMock,
|
||||
},
|
||||
$moment: jest.fn(() => {
|
||||
return {
|
||||
format: jest.fn((m) => m),
|
||||
subtract: jest.fn(() => {
|
||||
return {
|
||||
format: jest.fn((m) => m),
|
||||
}
|
||||
}),
|
||||
}
|
||||
}),
|
||||
$store: {
|
||||
commit: storeCommitMock,
|
||||
state: {
|
||||
userSelectedInMassCreation: [],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
describe('Creation', () => {
|
||||
@ -59,6 +56,7 @@ describe('Creation', () => {
|
||||
|
||||
describe('shallowMount', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
@ -68,7 +66,15 @@ describe('Creation', () => {
|
||||
|
||||
describe('apollo returns user array', () => {
|
||||
it('calls the searchUser query', () => {
|
||||
expect(apolloQueryMock).toBeCalled()
|
||||
expect(apolloQueryMock).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
variables: {
|
||||
searchText: '',
|
||||
currentPage: 1,
|
||||
pageSize: 25,
|
||||
},
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('sets the data of itemsList', () => {
|
||||
@ -93,121 +99,33 @@ describe('Creation', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('update item', () => {
|
||||
describe('push item', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
})
|
||||
|
||||
describe('push', () => {
|
||||
beforeEach(() => {
|
||||
wrapper.findComponent({ name: 'UserTable' }).vm.$emit(
|
||||
'update-item',
|
||||
{
|
||||
userId: 2,
|
||||
firstName: 'Benjamin',
|
||||
lastName: 'Blümchen',
|
||||
email: 'benjamin@bluemchen.de',
|
||||
creation: [800, 600, 400],
|
||||
showDetails: false,
|
||||
},
|
||||
'push',
|
||||
)
|
||||
})
|
||||
|
||||
it('removes the pushed item from itemsList', () => {
|
||||
expect(wrapper.vm.itemsList).toEqual([
|
||||
{
|
||||
userId: 1,
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
email: 'bibi@bloxberg.de',
|
||||
creation: [200, 400, 600],
|
||||
showDetails: false,
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
it('adds the pushed item to itemsMassCreation', () => {
|
||||
expect(wrapper.vm.itemsMassCreation).toEqual([
|
||||
{
|
||||
userId: 2,
|
||||
firstName: 'Benjamin',
|
||||
lastName: 'Blümchen',
|
||||
email: 'benjamin@bluemchen.de',
|
||||
creation: [800, 600, 400],
|
||||
showDetails: false,
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
describe('remove', () => {
|
||||
beforeEach(() => {
|
||||
wrapper.findComponent({ name: 'UserTable' }).vm.$emit(
|
||||
'update-item',
|
||||
{
|
||||
userId: 2,
|
||||
firstName: 'Benjamin',
|
||||
lastName: 'Blümchen',
|
||||
email: 'benjamin@bluemchen.de',
|
||||
creation: [800, 600, 400],
|
||||
showDetails: false,
|
||||
},
|
||||
'remove',
|
||||
)
|
||||
})
|
||||
|
||||
it('removes the item from itemsMassCreation', () => {
|
||||
expect(wrapper.vm.itemsMassCreation).toEqual([])
|
||||
})
|
||||
|
||||
it('adds the item to itemsList', () => {
|
||||
expect(wrapper.vm.itemsList).toEqual([
|
||||
{
|
||||
userId: 1,
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
email: 'bibi@bloxberg.de',
|
||||
creation: [200, 400, 600],
|
||||
showDetails: false,
|
||||
},
|
||||
{
|
||||
userId: 2,
|
||||
firstName: 'Benjamin',
|
||||
lastName: 'Blümchen',
|
||||
email: 'benjamin@bluemchen.de',
|
||||
creation: [800, 600, 400],
|
||||
showDetails: false,
|
||||
},
|
||||
])
|
||||
})
|
||||
wrapper.findComponent({ name: 'UserTable' }).vm.$emit('push-item', {
|
||||
userId: 2,
|
||||
firstName: 'Benjamin',
|
||||
lastName: 'Blümchen',
|
||||
email: 'benjamin@bluemchen.de',
|
||||
creation: [800, 600, 400],
|
||||
showDetails: false,
|
||||
})
|
||||
})
|
||||
|
||||
describe('error', () => {
|
||||
const consoleErrorMock = jest.fn()
|
||||
const warnHandler = Vue.config.warnHandler
|
||||
|
||||
beforeEach(() => {
|
||||
Vue.config.warnHandler = (w) => {}
|
||||
// eslint-disable-next-line no-console
|
||||
console.error = consoleErrorMock
|
||||
wrapper.findComponent({ name: 'UserTable' }).vm.$emit('update-item', {}, 'no-rule')
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
Vue.config.warnHandler = warnHandler
|
||||
})
|
||||
|
||||
it('throws an error', () => {
|
||||
expect(consoleErrorMock).toBeCalledWith(expect.objectContaining({ message: 'no-rule' }))
|
||||
})
|
||||
it('removes the pushed item from itemsList', () => {
|
||||
expect(wrapper.vm.itemsList).toEqual([
|
||||
{
|
||||
userId: 1,
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
email: 'bibi@bloxberg.de',
|
||||
creation: [200, 400, 600],
|
||||
showDetails: false,
|
||||
},
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe('remove all bookmarks', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.findComponent({ name: 'UserTable' }).vm.$emit(
|
||||
'update-item',
|
||||
it('adds the pushed item to itemsMassCreation', () => {
|
||||
expect(wrapper.vm.itemsMassCreation).toEqual([
|
||||
{
|
||||
userId: 2,
|
||||
firstName: 'Benjamin',
|
||||
@ -216,8 +134,87 @@ describe('Creation', () => {
|
||||
creation: [800, 600, 400],
|
||||
showDetails: false,
|
||||
},
|
||||
'push',
|
||||
)
|
||||
])
|
||||
})
|
||||
|
||||
it('updates userSelectedInMassCreation in store', () => {
|
||||
expect(storeCommitMock).toBeCalledWith('setUserSelectedInMassCreation', [
|
||||
{
|
||||
userId: 2,
|
||||
firstName: 'Benjamin',
|
||||
lastName: 'Blümchen',
|
||||
email: 'benjamin@bluemchen.de',
|
||||
creation: [800, 600, 400],
|
||||
showDetails: false,
|
||||
},
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe('remove item', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.findComponent({ name: 'UserTable' }).vm.$emit('push-item', {
|
||||
userId: 2,
|
||||
firstName: 'Benjamin',
|
||||
lastName: 'Blümchen',
|
||||
email: 'benjamin@bluemchen.de',
|
||||
creation: [800, 600, 400],
|
||||
showDetails: false,
|
||||
})
|
||||
await wrapper
|
||||
.findAllComponents({ name: 'UserTable' })
|
||||
.at(1)
|
||||
.vm.$emit('remove-item', {
|
||||
userId: 2,
|
||||
firstName: 'Benjamin',
|
||||
lastName: 'Blümchen',
|
||||
email: 'benjamin@bluemchen.de',
|
||||
creation: [800, 600, 400],
|
||||
showDetails: false,
|
||||
})
|
||||
})
|
||||
|
||||
it('adds the removed item to itemsList', () => {
|
||||
expect(wrapper.vm.itemsList).toEqual([
|
||||
{
|
||||
userId: 2,
|
||||
firstName: 'Benjamin',
|
||||
lastName: 'Blümchen',
|
||||
email: 'benjamin@bluemchen.de',
|
||||
creation: [800, 600, 400],
|
||||
showDetails: false,
|
||||
},
|
||||
{
|
||||
userId: 1,
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
email: 'bibi@bloxberg.de',
|
||||
creation: [200, 400, 600],
|
||||
showDetails: false,
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
it('removes the item from itemsMassCreation', () => {
|
||||
expect(wrapper.vm.itemsMassCreation).toEqual([])
|
||||
})
|
||||
|
||||
it('commits empty array as userSelectedInMassCreation', () => {
|
||||
expect(storeCommitMock).toBeCalledWith('setUserSelectedInMassCreation', [])
|
||||
})
|
||||
})
|
||||
|
||||
describe('remove all bookmarks', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.findComponent({ name: 'UserTable' }).vm.$emit('push-item', {
|
||||
userId: 2,
|
||||
firstName: 'Benjamin',
|
||||
lastName: 'Blümchen',
|
||||
email: 'benjamin@bluemchen.de',
|
||||
creation: [800, 600, 400],
|
||||
showDetails: false,
|
||||
})
|
||||
jest.clearAllMocks()
|
||||
wrapper.findComponent({ name: 'CreationFormular' }).vm.$emit('remove-all-bookmark')
|
||||
})
|
||||
|
||||
@ -225,8 +222,41 @@ describe('Creation', () => {
|
||||
expect(wrapper.vm.itemsMassCreation).toEqual([])
|
||||
})
|
||||
|
||||
it('adds all items to itemsList', () => {
|
||||
expect(wrapper.vm.itemsList).toHaveLength(2)
|
||||
it('commits empty array to userSelectedInMassCreation', () => {
|
||||
expect(storeCommitMock).toBeCalledWith('setUserSelectedInMassCreation', [])
|
||||
})
|
||||
|
||||
it('calls searchUsers', () => {
|
||||
expect(apolloQueryMock).toBeCalled()
|
||||
})
|
||||
})
|
||||
|
||||
describe('store has items in userSelectedInMassCreation', () => {
|
||||
beforeEach(() => {
|
||||
mocks.$store.state.userSelectedInMassCreation = [
|
||||
{
|
||||
userId: 2,
|
||||
firstName: 'Benjamin',
|
||||
lastName: 'Blümchen',
|
||||
email: 'benjamin@bluemchen.de',
|
||||
creation: [800, 600, 400],
|
||||
showDetails: false,
|
||||
},
|
||||
]
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('has only one item itemsList', () => {
|
||||
expect(wrapper.vm.itemsList).toEqual([
|
||||
{
|
||||
userId: 1,
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
email: 'bibi@bloxberg.de',
|
||||
creation: [200, 400, 600],
|
||||
showDetails: false,
|
||||
},
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
@ -237,12 +267,28 @@ describe('Creation', () => {
|
||||
|
||||
it('calls API when criteria changes', async () => {
|
||||
await wrapper.setData({ criteria: 'XX' })
|
||||
expect(apolloQueryMock).toBeCalled()
|
||||
expect(apolloQueryMock).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
variables: {
|
||||
searchText: 'XX',
|
||||
currentPage: 1,
|
||||
pageSize: 25,
|
||||
},
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('calls API when currentPage changes', async () => {
|
||||
await wrapper.setData({ currentPage: 2 })
|
||||
expect(apolloQueryMock).toBeCalled()
|
||||
expect(apolloQueryMock).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
variables: {
|
||||
searchText: '',
|
||||
currentPage: 2,
|
||||
pageSize: 25,
|
||||
},
|
||||
}),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
:fieldsTable="Searchfields"
|
||||
:criteria="criteria"
|
||||
:creation="creation"
|
||||
@update-item="updateItem"
|
||||
@push-item="pushItem"
|
||||
/>
|
||||
<b-pagination
|
||||
pills
|
||||
@ -43,7 +43,7 @@
|
||||
:fieldsTable="fields"
|
||||
:criteria="null"
|
||||
:creation="creation"
|
||||
@update-item="updateItem"
|
||||
@remove-item="removeItem"
|
||||
/>
|
||||
<div v-if="itemsMassCreation.length === 0">
|
||||
{{ $t('multiple_creation_text') }}
|
||||
@ -73,52 +73,15 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
showArrays: false,
|
||||
Searchfields: [
|
||||
{ key: 'bookmark', label: 'bookmark' },
|
||||
{ key: 'firstName', label: this.$t('firstname') },
|
||||
{ key: 'lastName', label: this.$t('lastname') },
|
||||
{
|
||||
key: 'creation',
|
||||
// label: this.$t('open_creation') + 'Jan | Feb | März',
|
||||
label:
|
||||
this.$moment().subtract(2, 'month').format('MMM') +
|
||||
' | ' +
|
||||
this.$moment().subtract(1, 'month').format('MMM') +
|
||||
' | ' +
|
||||
this.$moment().format('MMM'),
|
||||
formatter: (value, key, item) => {
|
||||
return String(value[0]) + ` | ` + String(value[1]) + ` | ` + String(value[2])
|
||||
},
|
||||
},
|
||||
{ key: 'email', label: this.$t('e_mail') },
|
||||
],
|
||||
fields: [
|
||||
{ key: 'email', label: this.$t('e_mail') },
|
||||
{ key: 'firstName', label: this.$t('firstname') },
|
||||
{ key: 'lastName', label: this.$t('lastname') },
|
||||
{
|
||||
key: 'creation',
|
||||
// label: this.$t('open_creation') + 'Jan | Feb | März',
|
||||
label:
|
||||
this.$moment().subtract(2, 'month').format('MMM') +
|
||||
' | ' +
|
||||
this.$moment().subtract(1, 'month').format('MMM') +
|
||||
' | ' +
|
||||
this.$moment().format('MMM'),
|
||||
formatter: (value, key, item) => {
|
||||
return String(value[0]) + ` | ` + String(value[1]) + ` | ` + String(value[2])
|
||||
},
|
||||
},
|
||||
{ key: 'bookmark', label: this.$t('remove') },
|
||||
],
|
||||
itemsList: [],
|
||||
itemsMassCreation: [],
|
||||
itemsMassCreation: this.$store.state.userSelectedInMassCreation,
|
||||
radioSelectedMass: '',
|
||||
criteria: '',
|
||||
creation: [null, null, null],
|
||||
rows: 0,
|
||||
currentPage: 1,
|
||||
perPage: 25,
|
||||
now: Date.now(),
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
@ -144,37 +107,81 @@ export default {
|
||||
showDetails: false,
|
||||
}
|
||||
})
|
||||
if (this.itemsMassCreation.length !== 0) {
|
||||
const selectedIndices = this.itemsMassCreation.map((item) => item.userId)
|
||||
this.itemsList = this.itemsList.filter((item) => !selectedIndices.includes(item.userId))
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toasted.error(error.message)
|
||||
})
|
||||
},
|
||||
updateItem(e, event) {
|
||||
let index = 0
|
||||
let findArr = {}
|
||||
|
||||
switch (event) {
|
||||
case 'push':
|
||||
findArr = this.itemsList.find((item) => e.userId === item.userId)
|
||||
index = this.itemsList.indexOf(findArr)
|
||||
this.itemsList.splice(index, 1)
|
||||
this.itemsMassCreation.push(findArr)
|
||||
break
|
||||
case 'remove':
|
||||
findArr = this.itemsMassCreation.find((item) => e.userId === item.userId)
|
||||
index = this.itemsMassCreation.indexOf(findArr)
|
||||
this.itemsMassCreation.splice(index, 1)
|
||||
this.itemsList.push(findArr)
|
||||
break
|
||||
default:
|
||||
throw new Error(event)
|
||||
}
|
||||
pushItem(selectedItem) {
|
||||
this.itemsMassCreation = [
|
||||
this.itemsList.find((item) => selectedItem.userId === item.userId),
|
||||
...this.itemsMassCreation,
|
||||
]
|
||||
this.itemsList = this.itemsList.filter((item) => selectedItem.userId !== item.userId)
|
||||
this.$store.commit('setUserSelectedInMassCreation', this.itemsMassCreation)
|
||||
},
|
||||
removeItem(selectedItem) {
|
||||
this.itemsList = [
|
||||
this.itemsMassCreation.find((item) => selectedItem.userId === item.userId),
|
||||
...this.itemsList,
|
||||
]
|
||||
this.itemsMassCreation = this.itemsMassCreation.filter(
|
||||
(item) => selectedItem.userId !== item.userId,
|
||||
)
|
||||
this.$store.commit('setUserSelectedInMassCreation', this.itemsMassCreation)
|
||||
},
|
||||
removeAllBookmark() {
|
||||
this.itemsMassCreation = []
|
||||
this.$store.commit('setUserSelectedInMassCreation', [])
|
||||
this.getUsers()
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
Searchfields() {
|
||||
return [
|
||||
{ key: 'bookmark', label: 'bookmark' },
|
||||
{ key: 'firstName', label: this.$t('firstname') },
|
||||
{ key: 'lastName', label: this.$t('lastname') },
|
||||
{
|
||||
key: 'creation',
|
||||
label: this.creationLabel,
|
||||
formatter: (value, key, item) => {
|
||||
return value.join(' | ')
|
||||
},
|
||||
},
|
||||
{ key: 'email', label: this.$t('e_mail') },
|
||||
]
|
||||
},
|
||||
fields() {
|
||||
return [
|
||||
{ key: 'email', label: this.$t('e_mail') },
|
||||
{ key: 'firstName', label: this.$t('firstname') },
|
||||
{ key: 'lastName', label: this.$t('lastname') },
|
||||
{
|
||||
key: 'creation',
|
||||
label: this.creationLabel,
|
||||
formatter: (value, key, item) => {
|
||||
return value.join(' | ')
|
||||
},
|
||||
},
|
||||
{ key: 'bookmark', label: this.$t('remove') },
|
||||
]
|
||||
},
|
||||
creationLabel() {
|
||||
const now = new Date(this.now)
|
||||
const lastMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1)
|
||||
const beforeLastMonth = new Date(now.getFullYear(), now.getMonth() - 2, 1)
|
||||
return [
|
||||
this.$d(beforeLastMonth, 'monthShort'),
|
||||
this.$d(lastMonth, 'monthShort'),
|
||||
this.$d(now, 'monthShort'),
|
||||
].join(' | ')
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
currentPage() {
|
||||
this.getUsers()
|
||||
|
||||
@ -39,6 +39,7 @@ const apolloMutateMock = jest.fn().mockResolvedValue({})
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
$d: jest.fn((d) => d),
|
||||
$store: {
|
||||
commit: storeCommitMock,
|
||||
},
|
||||
@ -50,11 +51,6 @@ const mocks = {
|
||||
error: toastedErrorMock,
|
||||
success: toastedSuccessMock,
|
||||
},
|
||||
$moment: jest.fn((value) => {
|
||||
return {
|
||||
format: jest.fn((format) => value),
|
||||
}
|
||||
}),
|
||||
}
|
||||
|
||||
describe('CreationConfirm', () => {
|
||||
|
||||
@ -96,9 +96,9 @@ export default {
|
||||
{ key: 'memo', label: 'Text' },
|
||||
{
|
||||
key: 'date',
|
||||
label: 'Datum',
|
||||
label: this.$t('date'),
|
||||
formatter: (value) => {
|
||||
return this.$moment(value).format('ll')
|
||||
return this.$d(new Date(value), 'short')
|
||||
},
|
||||
},
|
||||
{ key: 'moderator', label: 'Moderator' },
|
||||
|
||||
@ -24,22 +24,13 @@ const toastErrorMock = jest.fn()
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
$d: jest.fn((d) => d),
|
||||
$apollo: {
|
||||
query: apolloQueryMock,
|
||||
},
|
||||
$toasted: {
|
||||
error: toastErrorMock,
|
||||
},
|
||||
$moment: jest.fn(() => {
|
||||
return {
|
||||
format: jest.fn((m) => m),
|
||||
subtract: jest.fn(() => {
|
||||
return {
|
||||
format: jest.fn((m) => m),
|
||||
}
|
||||
}),
|
||||
}
|
||||
}),
|
||||
}
|
||||
|
||||
describe('UserSearch', () => {
|
||||
|
||||
@ -53,41 +53,14 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
showArrays: false,
|
||||
fields: [
|
||||
{ key: 'email', label: this.$t('e_mail') },
|
||||
{ key: 'firstName', label: this.$t('firstname') },
|
||||
{ key: 'lastName', label: this.$t('lastname') },
|
||||
{
|
||||
key: 'creation',
|
||||
label: [
|
||||
this.$moment().subtract(2, 'month').format('MMM'),
|
||||
this.$moment().subtract(1, 'month').format('MMM'),
|
||||
this.$moment().format('MMM'),
|
||||
].join(' | '),
|
||||
formatter: (value, key, item) => {
|
||||
return value.join(' | ')
|
||||
},
|
||||
},
|
||||
{ key: 'show_details', label: this.$t('details') },
|
||||
{ key: 'confirm_mail', label: this.$t('confirmed') },
|
||||
{ key: 'transactions_list', label: this.$t('transaction') },
|
||||
],
|
||||
searchResult: [],
|
||||
massCreation: [],
|
||||
criteria: '',
|
||||
currentMonth: {
|
||||
short: this.$moment().format('MMMM'),
|
||||
},
|
||||
lastMonth: {
|
||||
short: this.$moment().subtract(1, 'month').format('MMMM'),
|
||||
},
|
||||
beforeLastMonth: {
|
||||
short: this.$moment().subtract(2, 'month').format('MMMM'),
|
||||
},
|
||||
filterCheckedEmails: false,
|
||||
rows: 0,
|
||||
currentPage: 1,
|
||||
perPage: 25,
|
||||
now: Date.now(),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -123,6 +96,37 @@ export default {
|
||||
this.getUsers()
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
lastMonthDate() {
|
||||
const now = new Date(this.now)
|
||||
return new Date(now.getFullYear(), now.getMonth() - 1, 1)
|
||||
},
|
||||
beforeLastMonthDate() {
|
||||
const now = new Date(this.now)
|
||||
return new Date(now.getFullYear(), now.getMonth() - 2, 1)
|
||||
},
|
||||
fields() {
|
||||
return [
|
||||
{ key: 'email', label: this.$t('e_mail') },
|
||||
{ key: 'firstName', label: this.$t('firstname') },
|
||||
{ key: 'lastName', label: this.$t('lastname') },
|
||||
{
|
||||
key: 'creation',
|
||||
label: [
|
||||
this.$d(this.beforeLastMonthDate, 'monthShort'),
|
||||
this.$d(this.lastMonthDate, 'monthShort'),
|
||||
this.$d(this.now, 'monthShort'),
|
||||
].join(' | '),
|
||||
formatter: (value, key, item) => {
|
||||
return value.join(' | ')
|
||||
},
|
||||
},
|
||||
{ key: 'show_details', label: this.$t('details') },
|
||||
{ key: 'confirm_mail', label: this.$t('confirmed') },
|
||||
{ key: 'transactions_list', label: this.$t('transaction') },
|
||||
]
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getUsers()
|
||||
},
|
||||
|
||||
@ -24,6 +24,9 @@ export const mutations = {
|
||||
moderator: (state, moderator) => {
|
||||
state.moderator = moderator
|
||||
},
|
||||
setUserSelectedInMassCreation: (state, userSelectedInMassCreation) => {
|
||||
state.userSelectedInMassCreation = userSelectedInMassCreation
|
||||
},
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
@ -44,6 +47,7 @@ const store = new Vuex.Store({
|
||||
token: CONFIG.DEBUG_DISABLE_AUTH ? 'validToken' : null,
|
||||
moderator: null,
|
||||
openCreations: 0,
|
||||
userSelectedInMassCreation: [],
|
||||
},
|
||||
// Syncronous mutation of the state
|
||||
mutations,
|
||||
|
||||
@ -10,6 +10,7 @@ const {
|
||||
resetOpenCreations,
|
||||
setOpenCreations,
|
||||
moderator,
|
||||
setUserSelectedInMassCreation,
|
||||
} = mutations
|
||||
const { logout } = actions
|
||||
|
||||
@ -64,6 +65,14 @@ describe('Vuex store', () => {
|
||||
expect(state.openCreations).toEqual(12)
|
||||
})
|
||||
})
|
||||
|
||||
describe('setUserSelectedInMassCreation', () => {
|
||||
it('sets userSelectedInMassCreation to given value', () => {
|
||||
const state = { userSelectedInMassCreation: [] }
|
||||
setUserSelectedInMassCreation(state, [0, 1, 2])
|
||||
expect(state.userSelectedInMassCreation).toEqual([0, 1, 2])
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('actions', () => {
|
||||
|
||||
@ -9032,11 +9032,6 @@ mkdirp@0.x, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.1:
|
||||
dependencies:
|
||||
minimist "^1.2.5"
|
||||
|
||||
moment@^2.19.2, moment@^2.29.1:
|
||||
version "2.29.1"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
|
||||
integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
|
||||
|
||||
move-concurrently@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92"
|
||||
@ -12491,13 +12486,6 @@ vue-loader@^15.9.2:
|
||||
vue-hot-reload-api "^2.3.0"
|
||||
vue-style-loader "^4.1.0"
|
||||
|
||||
vue-moment@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/vue-moment/-/vue-moment-4.1.0.tgz#092a8ff723a96c6f85a0a8e23ad30f0bf320f3b0"
|
||||
integrity sha512-Gzisqpg82ItlrUyiD9d0Kfru+JorW2o4mQOH06lEDZNgxci0tv/fua1Hl0bo4DozDV2JK1r52Atn/8QVCu8qQw==
|
||||
dependencies:
|
||||
moment "^2.19.2"
|
||||
|
||||
vue-router@^3.5.3:
|
||||
version "3.5.3"
|
||||
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.5.3.tgz#041048053e336829d05dafacf6a8fb669a2e7999"
|
||||
|
||||
@ -4,7 +4,7 @@ import dotenv from 'dotenv'
|
||||
dotenv.config()
|
||||
|
||||
const constants = {
|
||||
DB_VERSION: '0012-login_user_backups_unify_wordlist',
|
||||
DB_VERSION: '0016-transaction_signatures',
|
||||
}
|
||||
|
||||
const server = {
|
||||
|
||||
@ -10,7 +10,6 @@ import { UpdatePendingCreation } from '../model/UpdatePendingCreation'
|
||||
import { RIGHTS } from '../../auth/RIGHTS'
|
||||
import { TransactionRepository } from '../../typeorm/repository/Transaction'
|
||||
import { TransactionCreationRepository } from '../../typeorm/repository/TransactionCreation'
|
||||
import { LoginPendingTasksAdminRepository } from '../../typeorm/repository/LoginPendingTasksAdmin'
|
||||
import { UserRepository } from '../../typeorm/repository/User'
|
||||
import CreatePendingCreationArgs from '../arg/CreatePendingCreationArgs'
|
||||
import UpdatePendingCreationArgs from '../arg/UpdatePendingCreationArgs'
|
||||
@ -23,7 +22,7 @@ import { UserTransactionRepository } from '../../typeorm/repository/UserTransact
|
||||
import { BalanceRepository } from '../../typeorm/repository/Balance'
|
||||
import { calculateDecay } from '../../util/decay'
|
||||
import { LoginUserRepository } from '../../typeorm/repository/LoginUser'
|
||||
import { LoginPendingTasksAdmin } from '@entity/LoginPendingTasksAdmin'
|
||||
import { AdminPendingCreation } from '@entity/AdminPendingCreation'
|
||||
|
||||
@Resolver()
|
||||
export class AdminResolver {
|
||||
@ -68,16 +67,15 @@ export class AdminResolver {
|
||||
const creations = await getUserCreations(user.id)
|
||||
const creationDateObj = new Date(creationDate)
|
||||
if (isCreationValid(creations, amount, creationDateObj)) {
|
||||
const loginPendingTasksAdminRepository = getCustomRepository(LoginPendingTasksAdminRepository)
|
||||
const loginPendingTaskAdmin = loginPendingTasksAdminRepository.create()
|
||||
loginPendingTaskAdmin.userId = user.id
|
||||
loginPendingTaskAdmin.amount = BigInt(amount * 10000)
|
||||
loginPendingTaskAdmin.created = new Date()
|
||||
loginPendingTaskAdmin.date = creationDateObj
|
||||
loginPendingTaskAdmin.memo = memo
|
||||
loginPendingTaskAdmin.moderator = moderator
|
||||
const adminPendingCreation = AdminPendingCreation.create()
|
||||
adminPendingCreation.userId = user.id
|
||||
adminPendingCreation.amount = BigInt(amount * 10000)
|
||||
adminPendingCreation.created = new Date()
|
||||
adminPendingCreation.date = creationDateObj
|
||||
adminPendingCreation.memo = memo
|
||||
adminPendingCreation.moderator = moderator
|
||||
|
||||
await loginPendingTasksAdminRepository.save(loginPendingTaskAdmin)
|
||||
await AdminPendingCreation.save(adminPendingCreation)
|
||||
}
|
||||
return getUserCreations(user.id)
|
||||
}
|
||||
@ -116,8 +114,7 @@ export class AdminResolver {
|
||||
const userRepository = getCustomRepository(UserRepository)
|
||||
const user = await userRepository.findByEmail(email)
|
||||
|
||||
const loginPendingTasksAdminRepository = getCustomRepository(LoginPendingTasksAdminRepository)
|
||||
const pendingCreationToUpdate = await loginPendingTasksAdminRepository.findOneOrFail({ id })
|
||||
const pendingCreationToUpdate = await AdminPendingCreation.findOneOrFail({ id })
|
||||
|
||||
if (pendingCreationToUpdate.userId !== user.id) {
|
||||
throw new Error('user of the pending creation and send user does not correspond')
|
||||
@ -137,7 +134,7 @@ export class AdminResolver {
|
||||
pendingCreationToUpdate.date = new Date(creationDate)
|
||||
pendingCreationToUpdate.moderator = moderator
|
||||
|
||||
await loginPendingTasksAdminRepository.save(pendingCreationToUpdate)
|
||||
await AdminPendingCreation.save(pendingCreationToUpdate)
|
||||
const result = new UpdatePendingCreation()
|
||||
result.amount = parseInt(amount.toString())
|
||||
result.memo = pendingCreationToUpdate.memo
|
||||
@ -151,8 +148,7 @@ export class AdminResolver {
|
||||
@Authorized([RIGHTS.SEARCH_PENDING_CREATION])
|
||||
@Query(() => [PendingCreation])
|
||||
async getPendingCreations(): Promise<PendingCreation[]> {
|
||||
const loginPendingTasksAdminRepository = getCustomRepository(LoginPendingTasksAdminRepository)
|
||||
const pendingCreations = await loginPendingTasksAdminRepository.find()
|
||||
const pendingCreations = await AdminPendingCreation.find()
|
||||
|
||||
const pendingCreationsPromise = await Promise.all(
|
||||
pendingCreations.map(async (pendingCreation) => {
|
||||
@ -179,18 +175,15 @@ export class AdminResolver {
|
||||
@Authorized([RIGHTS.DELETE_PENDING_CREATION])
|
||||
@Mutation(() => Boolean)
|
||||
async deletePendingCreation(@Arg('id') id: number): Promise<boolean> {
|
||||
const loginPendingTasksAdminRepository = getCustomRepository(LoginPendingTasksAdminRepository)
|
||||
const entity = await loginPendingTasksAdminRepository.findOneOrFail(id)
|
||||
const res = await loginPendingTasksAdminRepository.delete(entity)
|
||||
const entity = await AdminPendingCreation.findOneOrFail(id)
|
||||
const res = await AdminPendingCreation.delete(entity)
|
||||
return !!res
|
||||
}
|
||||
|
||||
@Authorized([RIGHTS.CONFIRM_PENDING_CREATION])
|
||||
@Mutation(() => Boolean)
|
||||
async confirmPendingCreation(@Arg('id') id: number, @Ctx() context: any): Promise<boolean> {
|
||||
const loginPendingTasksAdminRepository = getCustomRepository(LoginPendingTasksAdminRepository)
|
||||
const pendingCreation = await loginPendingTasksAdminRepository.findOneOrFail(id)
|
||||
|
||||
const pendingCreation = await AdminPendingCreation.findOneOrFail(id)
|
||||
const userRepository = getCustomRepository(UserRepository)
|
||||
const moderatorUser = await userRepository.findByPubkeyHex(context.pubKey)
|
||||
if (moderatorUser.id === pendingCreation.userId)
|
||||
@ -202,7 +195,6 @@ export class AdminResolver {
|
||||
transaction.transactionTypeId = 1
|
||||
transaction.memo = pendingCreation.memo
|
||||
transaction.received = receivedCallDate
|
||||
transaction.blockchainTypeId = 1
|
||||
transaction = await transactionRepository.save(transaction)
|
||||
if (!transaction) throw new Error('Could not create transaction')
|
||||
|
||||
@ -251,7 +243,7 @@ export class AdminResolver {
|
||||
userBalance.modified = receivedCallDate
|
||||
userBalance.recordDate = receivedCallDate
|
||||
await balanceRepository.save(userBalance)
|
||||
await loginPendingTasksAdminRepository.delete(pendingCreation)
|
||||
await AdminPendingCreation.delete(pendingCreation)
|
||||
|
||||
return true
|
||||
}
|
||||
@ -280,12 +272,12 @@ async function getUserCreations(id: number): Promise<number[]> {
|
||||
.orderBy('target_month', 'ASC')
|
||||
.getRawMany()
|
||||
|
||||
const loginPendingTasksAdminRepository = getCustomRepository(LoginPendingTasksAdminRepository)
|
||||
const pendingAmountsQuery = await loginPendingTasksAdminRepository
|
||||
.createQueryBuilder('login_pending_tasks_admin')
|
||||
.select('MONTH(login_pending_tasks_admin.date)', 'target_month')
|
||||
.addSelect('SUM(login_pending_tasks_admin.amount)', 'sum')
|
||||
.where('login_pending_tasks_admin.userId = :id', { id })
|
||||
const pendingAmountsQuery = await AdminPendingCreation.createQueryBuilder(
|
||||
'admin_pending_creations',
|
||||
)
|
||||
.select('MONTH(admin_pending_creations.date)', 'target_month')
|
||||
.addSelect('SUM(admin_pending_creations.amount)', 'sum')
|
||||
.where('admin_pending_creations.userId = :id', { id })
|
||||
.andWhere({
|
||||
date: Raw((alias) => `${alias} >= :date and ${alias} < :endDate`, {
|
||||
date: dateBeforeLastMonth,
|
||||
@ -336,7 +328,7 @@ async function getUserCreations(id: number): Promise<number[]> {
|
||||
]
|
||||
}
|
||||
|
||||
function updateCreations(creations: number[], pendingCreation: LoginPendingTasksAdmin): number[] {
|
||||
function updateCreations(creations: number[], pendingCreation: AdminPendingCreation): number[] {
|
||||
const dateMonth = moment().format('YYYY-MM')
|
||||
const dateLastMonth = moment().subtract(1, 'month').format('YYYY-MM')
|
||||
const dateBeforeLastMonth = moment().subtract(2, 'month').format('YYYY-MM')
|
||||
|
||||
@ -36,172 +36,6 @@ import { hasUserAmount, isHexPublicKey } from '../../util/validate'
|
||||
import { LoginUserRepository } from '../../typeorm/repository/LoginUser'
|
||||
import { RIGHTS } from '../../auth/RIGHTS'
|
||||
|
||||
/*
|
||||
# Test
|
||||
|
||||
## Prepare
|
||||
> sudo systemctl start docker
|
||||
> docker-compose up mariadb
|
||||
> DROP all databases
|
||||
> docker-compose down
|
||||
> docker compose up mariadb database
|
||||
> verify there is exactly one database `gradido_community`
|
||||
|
||||
TODO:
|
||||
INSERT INTO `login_groups` (`id`, `alias`, `name`, `url`, `host`, `home`, `description`) VALUES
|
||||
(1, 'docker', 'docker gradido group', 'localhost', 'nginx', '/', 'gradido test group for docker and stage2 with blockchain db');
|
||||
|
||||
>> Database is cool
|
||||
|
||||
### Start login server
|
||||
> docker-compose up login-server community-server nginx
|
||||
>> Login & community servers and nginx proxy are up and running
|
||||
|
||||
## Build database
|
||||
> cd database
|
||||
> yarn
|
||||
> yarn build
|
||||
> cd ..
|
||||
>> Database has been built successful
|
||||
|
||||
### Start backend (no docker for debugging)
|
||||
> cd backend
|
||||
> yarn
|
||||
> yarn dev
|
||||
>> Backend is up and running
|
||||
|
||||
### Create users
|
||||
> chromium http://localhost:4000/graphql
|
||||
> mutation{createUser(email: "receiver@user.net", firstName: "Receiver", lastName: "user", password: "123!AAAb", language: "de")}
|
||||
> mutation{createUser(email: "sender@user.net", firstName: "Sender", lastName: "user", password: "123!AAAb", language: "de")}
|
||||
> mutation{createUser(email: "creator@user.net", firstName: "Creator", lastName: "user", password: "123!AAAb", language: "de")}
|
||||
>> Verify you have 3 entries in `login_users`, `login_user_backups` and `state_users`
|
||||
|
||||
### make creator an admin
|
||||
> INSERT INTO login_user_roles (id, user_id, role_id) VALUES (NULL, '3', '1');
|
||||
> UPDATE login_users SET email_checked = 1 WHERE id = 3;
|
||||
> uncomment line: 19 in community_server/src/Controller/ServerUsersController.php
|
||||
> chromium http://localhost/server-users/add
|
||||
> create user `creator` `123` `creator@different.net`
|
||||
>> verify you have 1 entry in `server_users`
|
||||
> login with user on http://localhost/server-users
|
||||
> activate server user by changing the corresponding flag in the interface
|
||||
> navigate to http://localhost/transaction-creations/create-multi
|
||||
> create 1000GDD for user sender@user.net
|
||||
> navigate to http://localhost
|
||||
> login with `creator@user.net` `123!AAAb`
|
||||
> confirm transaction (top right corner - click the thingy, click the green button `Transaktion abschließen`)
|
||||
|
||||
### the test:
|
||||
> chromium http://localhost:4000/graphql
|
||||
> query{login(email: "sender@user.net", password: "123!AAAb"){pubkey}}
|
||||
>> copy token from network tab (inspect)
|
||||
> mutation{sendCoins(email: "receiver@user.net", amount: 10.0, memo: "Hier!")}
|
||||
> mutation{sendCoins(email: "receiver@user.net", amount: 10.0, memo: "Hier!")}
|
||||
> Headers: {"Authorization": "Bearer ${token}"}
|
||||
>> Verify via Database that stuff is as it should see `state_balance` & `transaction_send_coins`
|
||||
|
||||
### create decay block
|
||||
> chromium http://localhost/transactions/add
|
||||
> login with `creator` `123`
|
||||
> select `decay start`
|
||||
> press submit
|
||||
> wait for at least 0.02 display of decay on user sender@user.net on old frontend, this should be aprox 10min
|
||||
> chromium http://localhost:4000/graphql
|
||||
> query{login(email: "sender@user.net", password: "123!AAAb"){pubkey}}
|
||||
>> copy token from network tab (inspect)
|
||||
> mutation{sendCoins(email: "receiver@user.net", amount: 10.0, memo: "Hier!")}
|
||||
>> verify in `transaction_send_coins` that a decay was taken into account
|
||||
>> same in `state_balances`
|
||||
>> now check the old frontend
|
||||
>>> sender@user.net should have a decay of 0.02
|
||||
>>> while receiver@user.net should have zero decay on anything (old frontend)
|
||||
|
||||
### Export data
|
||||
> docker-compose up phpmyadmin
|
||||
> chromium http://localhost:8074/
|
||||
> select gradido_community
|
||||
> export
|
||||
> select custom
|
||||
> untick structure
|
||||
> ok
|
||||
|
||||
## Results
|
||||
NOTE: We decided not to write the `transaction_signatures` since its unused. This is the main difference.
|
||||
NOTE: We fixed a bug in the `state_user_transactions code` with the new implementation of apollo
|
||||
|
||||
|
||||
Master:
|
||||
|
||||
--
|
||||
-- Dumping data for table `state_user_transactions`
|
||||
--
|
||||
|
||||
INSERT INTO `state_user_transactions` (`id`, `state_user_id`, `transaction_id`, `transaction_type_id`, `balance`, `balance_date`) VALUES
|
||||
(1, 2, 1, 1, 10000000, '2021-11-05 12:45:18'),
|
||||
(2, 2, 2, 2, 9900000, '2021-11-05 12:48:35'),
|
||||
(3, 1, 2, 2, 100000, '2021-11-05 12:48:35'),
|
||||
(4, 2, 3, 2, 9800000, '2021-11-05 12:49:07'),
|
||||
(5, 1, 3, 2, 200000, '2021-11-05 12:49:07'),
|
||||
(6, 2, 5, 2, 9699845, '2021-11-05 13:03:50'),
|
||||
(7, 1, 5, 2, 99996, '2021-11-05 13:03:50');
|
||||
|
||||
--
|
||||
-- Dumping data for table `transactions`
|
||||
--
|
||||
|
||||
INSERT INTO `transactions` (`id`, `state_group_id`, `transaction_type_id`, `tx_hash`, `memo`, `received`, `blockchain_type_id`) VALUES
|
||||
(1, NULL, 1, 0x9ccdcd01ccb6320c09c2d1da2f0bf735a95ece0e7c1df6bbff51918fbaec061700000000000000000000000000000000, '', '2021-11-05 12:45:18', 1),
|
||||
(2, NULL, 2, 0x58d7706a67fa4ff4b8038168c6be39a2963d7e28e9d3872759ad09c519fe093700000000000000000000000000000000, 'Hier!', '2021-11-05 12:48:35', 1),
|
||||
(3, NULL, 2, 0x427cd214f92ef35af671129d50edc5a478c53d1e464f285b7615d9794a69f69b00000000000000000000000000000000, 'Hier!', '2021-11-05 12:49:07', 1),
|
||||
(4, NULL, 9, 0x32807368f0906a21b94c072599795bc9eeab88fb565df82e85cc62a4fdcde48500000000000000000000000000000000, '', '2021-11-05 12:51:51', 1),
|
||||
(5, NULL, 2, 0x75eb729e0f60a1c8cead1342955853d2440d7a2ea57dfef6d4a18bff0d94491e00000000000000000000000000000000, 'Hier!', '2021-11-05 13:03:50', 1);
|
||||
|
||||
--
|
||||
-- Dumping data for table `transaction_signatures`
|
||||
--
|
||||
|
||||
INSERT INTO `transaction_signatures` (`id`, `transaction_id`, `signature`, `pubkey`) VALUES
|
||||
(1, 1, 0x5888edcdcf77aaadad6d321882903bc831d7416f17213fd5020a764365b5fcb336e4c7917385a1278ea44ccdb31eac4a09e448053b5e3f8f1fe5da3baf53c008, 0xd5b20f8dee415038bfa2b6b0e1b40ff54850351109444863b04d6d28825b7b7d),
|
||||
(2, 2, 0xf6fef428f8f22faf7090f7d740e6088d1d90c58ae92d757117d7d91d799e659f3a3a0c65a3fd97cbde798e761f9d23eff13e8810779a184c97c411f28e7c4608, 0xdc74a589004377ab14836dce68ce2ca34e5b17147cd78ad4b3afe8137524ae8a),
|
||||
(3, 3, 0x8ebe9730c6cf61f56ef401d6f2bd229f3c298ca3c2791ee9137e4827b7af6c6d6566fca616eb1fe7adc2e4d56b5c7350ae3990c9905580630fa75ecffca8e001, 0xdc74a589004377ab14836dce68ce2ca34e5b17147cd78ad4b3afe8137524ae8a),
|
||||
(4, 5, 0x50cf418f7e217391e89ab9c2879ae68d7c7c597d846b4fe1c082b5b16e5d0c85c328fbf48ad3490bcfe94f446700ae0a4b0190e76d26cc752abced58f480c80f, 0xdc74a589004377ab14836dce68ce2ca34e5b17147cd78ad4b3afe8137524ae8a);
|
||||
|
||||
This Feature Branch:
|
||||
|
||||
|
||||
--
|
||||
-- Dumping data for table `state_user_transactions`
|
||||
--
|
||||
|
||||
INSERT INTO `state_user_transactions` (`id`, `state_user_id`, `transaction_id`, `transaction_type_id`, `balance`, `balance_date`) VALUES
|
||||
(1, 2, 1, 1, 10000000, '2021-11-05 00:25:46'),
|
||||
(12, 2, 7, 2, 9900000, '2021-11-05 00:55:37'),
|
||||
(13, 1, 7, 2, 100000, '2021-11-05 00:55:37'),
|
||||
(14, 2, 8, 2, 9800000, '2021-11-05 01:00:04'),
|
||||
(15, 1, 8, 2, 200000, '2021-11-05 01:00:04'),
|
||||
(16, 2, 10, 2, 9699772, '2021-11-05 01:17:41'),
|
||||
(17, 1, 10, 2, 299995, '2021-11-05 01:17:41');
|
||||
|
||||
--
|
||||
-- Dumping data for table `transactions`
|
||||
--
|
||||
|
||||
INSERT INTO `transactions` (`id`, `state_group_id`, `transaction_type_id`, `tx_hash`, `memo`, `received`, `blockchain_type_id`) VALUES
|
||||
(1, NULL, 1, 0xdd030d475479877587d927ed9024784ba62266cf1f3d87862fc98ad68f7b26e400000000000000000000000000000000, '', '2021-11-05 00:25:46', 1),
|
||||
(7, NULL, 2, NULL, 'Hier!', '2021-11-05 00:55:37', 1),
|
||||
(8, NULL, 2, NULL, 'Hier!', '2021-11-05 01:00:04', 1),
|
||||
(9, NULL, 9, 0xb1cbedbf126aa35f5edbf06e181c415361d05228ab4da9d19a4595285a673dfa00000000000000000000000000000000, '', '2021-11-05 01:05:34', 1),
|
||||
(10, NULL, 2, NULL, 'Hier!', '2021-11-05 01:17:41', 1);
|
||||
|
||||
--
|
||||
-- Dumping data for table `transaction_signatures`
|
||||
--
|
||||
|
||||
INSERT INTO `transaction_signatures` (`id`, `transaction_id`, `signature`, `pubkey`) VALUES
|
||||
(1, 1, 0x60d632479707e5d01cdc32c3326b5a5bae11173a0c06b719ee7b552f9fd644de1a0cd4afc207253329081d39dac1a63421f51571d836995c649fc39afac7480a, 0x48c45cb4fea925e83850f68f2fa8f27a1a4ed1bcba68cdb59fcd86adef3f52ee);
|
||||
*/
|
||||
|
||||
// Helper function
|
||||
async function calculateAndAddDecayTransactions(
|
||||
userTransactions: dbUserTransaction[],
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
import { EntityRepository, Repository } from '@dbTools/typeorm'
|
||||
import { LoginPendingTasksAdmin } from '@entity/LoginPendingTasksAdmin'
|
||||
|
||||
@EntityRepository(LoginPendingTasksAdmin)
|
||||
export class LoginPendingTasksAdminRepository extends Repository<LoginPendingTasksAdmin> {}
|
||||
Binary file not shown.
@ -1,515 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-06-21 13:37+0200\n"
|
||||
"PO-Revision-Date: 2021-06-21 13:38+0200\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: de_DE\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 3.0\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:196 build/http_pages/LoginPage.cpp:275
|
||||
msgid "Login"
|
||||
msgstr "Anmeldung"
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:196
|
||||
msgid "E-Mail or password isn't right, please try again!"
|
||||
msgstr ""
|
||||
"E-Mail und Passwort Kombination stimmen nicht, bitte versuche es erneut. "
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:205
|
||||
msgid "Passwort"
|
||||
msgstr "Passwort"
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:205
|
||||
msgid ""
|
||||
"Passwort wird noch berechnet, bitte versuche es in etwa 1 Minute erneut."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:208 build/http_pages/LoginPage.cpp:211
|
||||
msgid "User"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:208
|
||||
msgid "Error in saved data, the server admin will look at it."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:211
|
||||
msgid "Benutzer ist deaktiviert, kein Login möglich!"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:275
|
||||
msgid "Username and password are needed!"
|
||||
msgstr "E-Mail und Passwort werden benötigt!"
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:376 src/cpp/model/Session.cpp:161
|
||||
#: src/cpp/model/Session.cpp:168 src/cpp/model/Session.cpp:220
|
||||
#: src/cpp/model/Session.cpp:231
|
||||
msgid "E-Mail"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:381
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:603
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:609
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:614
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:619
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:624
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:629
|
||||
msgid "Password"
|
||||
msgstr "Passwort"
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:384
|
||||
msgid " Login "
|
||||
msgstr "Anmeldung"
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:391
|
||||
msgid "You haven't any account yet? Please follow the link to create one."
|
||||
msgstr "Du hast noch kein Gradido-Konto?"
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:395
|
||||
msgid "Create New Account"
|
||||
msgstr "Neues Konto erstellen"
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:403
|
||||
msgid "Passwort vergessen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:155
|
||||
msgid "E-Mail verifizieren"
|
||||
msgstr "E-Mail überprüfen"
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:165
|
||||
msgid ""
|
||||
"Deine E-Mail wurde erfolgreich bestätigt. Du kannst nun Gradidos versenden."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:170
|
||||
msgid "Zur Startseite"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:175
|
||||
msgid "Bitte gib deinen E-Mail Verification Code ein:"
|
||||
msgstr "Bitte gib deinen E-Mail Verification Code ein:"
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:178 src/cpp/model/Session.cpp:184
|
||||
msgid "Email Verification Code"
|
||||
msgstr "Email Verification Code"
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:185
|
||||
msgid "Überprüfe Code"
|
||||
msgstr "Überprüfe Code"
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:190
|
||||
msgid "Du hast bisher keinen Code erhalten?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:193
|
||||
msgid "E-Mail erneut zuschicken (in Arbeit)"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:198
|
||||
msgid "Funktioniert dein E-Mail Verification Code nicht?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:201
|
||||
msgid "Schicke uns eine E-Mail und wir kümmern uns darum: "
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:208
|
||||
#: build/http_pages/ResetPasswordPage.cpp:273
|
||||
msgid "E-Mail an Support schicken"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:174
|
||||
#: build/http_pages/ResetPasswordPage.cpp:217
|
||||
msgid "Gib bitte hier deine E-Mail Adresse an:"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:183
|
||||
msgid "Bestätigen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:225
|
||||
msgid "Hast du dir deine Passphrase notiert oder gemerkt?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:234
|
||||
#: build/http_pages/PassphrasePage.cpp:373
|
||||
msgid "Ja"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:241
|
||||
msgid "Nein"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:247
|
||||
msgid "Absenden"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:255
|
||||
msgid "Dir wird eine E-Mail zugeschickt um dein Passwort zurückzusetzen."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:260
|
||||
msgid "Der Admin hat eine E-Mail bekommen und wird sich bei dir melden."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:265
|
||||
msgid ""
|
||||
"Du hast bereits eine E-Mail bekommen. Bitte schau auch in dein Spam-"
|
||||
"Verzeichnis nach. "
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:268
|
||||
msgid ""
|
||||
"Du hast wirklich keine E-Mail erhalten und auch schon ein paar Minuten "
|
||||
"gewartet?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:41
|
||||
#: build/http_pages/PassphrasePage.cpp:111
|
||||
#: build/http_pages/PassphrasePage.cpp:132 src/cpp/model/Session.cpp:465
|
||||
#: src/cpp/model/Session.cpp:477 src/cpp/model/Session.cpp:491
|
||||
msgid "Passphrase"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:42
|
||||
#: build/http_pages/PassphrasePage.cpp:451
|
||||
msgid "Neues Konto anlegen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:43
|
||||
msgid "2/3"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:111
|
||||
msgid ""
|
||||
"Diese Passphrase ist ungültig, bitte überprüfen oder neu "
|
||||
"generieren (lassen)."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:132
|
||||
msgid "intern error please try again later"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:147
|
||||
msgid "3/3"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:150
|
||||
#: build/http_pages/PassphrasePage.cpp:153
|
||||
msgid "1/3"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:152
|
||||
msgid "Neues Passwort anlegen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:270
|
||||
msgid "Passphrase abschreiben"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:287
|
||||
msgid "Was ist eine Passphrase?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:290
|
||||
msgid "Deine Passphrase besteht aus den im grünen Feld angezeigten Wörtern."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:293
|
||||
msgid "Sie dient deiner Sicherheit."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:296
|
||||
msgid ""
|
||||
"Du brauchst deine Passphrase um dein Konto wiederherzustellen, wenn du mal "
|
||||
"dein Passwort vergessen haben solltest."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:300
|
||||
msgid "Deine Passphrase (Groß/Kleinschreibung beachten)"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:309
|
||||
#: build/http_pages/PassphrasePage.cpp:352
|
||||
msgid "Was zu tun ist:"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:312
|
||||
msgid ""
|
||||
"Schreibe dir die obenstehende Passphrase <b>von Hand</b> auf ein Blatt "
|
||||
"Papier!"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:315
|
||||
msgid "Speichere sie auf keinen Fall auf deinem Rechner oder Mobilgerät!!"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:318
|
||||
msgid "Bewahre sie an einem sicheren Ort auf!"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:322
|
||||
#: build/http_pages/PassphrasePage.cpp:478
|
||||
#: build/http_pages/PassphrasePage.cpp:487
|
||||
#: build/http_pages/PassphrasePage.cpp:511
|
||||
msgid "Weiter"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:355
|
||||
msgid "Hast du dir deine Passphrase gemerkt?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:358
|
||||
msgid ""
|
||||
"Dann zeig es mir. Zur Unterstützung gebe ich dir deine Wörter aber in "
|
||||
"anderer Reihenfolge."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:361
|
||||
msgid "Klicke sie an um sie einzusetzen."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:364
|
||||
msgid "Überprüfe dabei, ob du alle Wörter richtig geschrieben hast!"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:370
|
||||
msgid ""
|
||||
"Weil du kein Javascript verwendest geht es direkt weiter. Hast du dir deine "
|
||||
"Passphrase gemerkt oder aufgeschrieben?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:429
|
||||
msgid "Deine E-Mail Adresse wurde erfolgreich bestätigt."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:437
|
||||
msgid "Neue Gradido Adresse anlegen / wiederherstellen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:440
|
||||
msgid ""
|
||||
"Möchtest du ein neues Gradido-Konto anlegen oder ein bestehendes "
|
||||
"wiederherstellen?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:460
|
||||
msgid "Bestehendes Konto wiederherstellen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:469
|
||||
msgid ""
|
||||
"Falls du ein bestehendes Konto wiederherstellen willst, gib hier deine "
|
||||
"Passphrase ein:"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:497
|
||||
msgid "Konto wiederherstellen / Neues Passwort anlegen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:501
|
||||
msgid ""
|
||||
"Um dein Konto wiederherzustellen und dir ein Neues Passwort auswählen zu "
|
||||
"können, tippe hier bitte die Wörter deiner Passphrase in der richtigen "
|
||||
"Reihenfolge ein, welche du dir aufgeschrieben hast."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:524
|
||||
msgid "Fehler"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:527
|
||||
msgid ""
|
||||
"Ungültige Seite, wenn du das siehst stimmt hier etwas nicht. Bitte wende "
|
||||
"dich an den Server-Admin."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:147 src/cpp/model/Session.cpp:177
|
||||
#: src/cpp/model/Session.cpp:645 src/cpp/model/Session.cpp:651
|
||||
#: src/cpp/model/Session.cpp:937 src/cpp/model/Session.cpp:953
|
||||
msgid "Benutzer"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:147
|
||||
msgid "Eingeloggter Benutzer ist kein Admin"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:153 src/cpp/model/Session.cpp:212
|
||||
msgid "Vorname"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:153 src/cpp/model/Session.cpp:157
|
||||
#: src/cpp/model/Session.cpp:212 src/cpp/model/Session.cpp:216
|
||||
msgid ""
|
||||
"Bitte gebe einen Namen an. Mindestens 3 Zeichen, keines folgender Zeichen "
|
||||
"<>&;"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:157 src/cpp/model/Session.cpp:216
|
||||
msgid "Nachname"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:161 src/cpp/model/Session.cpp:220
|
||||
msgid "Bitte gebe eine gültige E-Mail Adresse an."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:168
|
||||
msgid "Für diese E-Mail Adresse gibt es bereits einen Account"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:177 src/cpp/model/Session.cpp:184
|
||||
msgid "Fehler beim speichern!"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:231
|
||||
msgid "Für diese E-Mail Adresse gibt es bereits ein Konto"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:255
|
||||
msgid "Server"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:255
|
||||
msgid "Fehler beim speichen des Kontos bitte versuche es später noch einmal"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:350 src/cpp/model/Session.cpp:390
|
||||
#: src/cpp/model/Session.cpp:832 src/cpp/model/Session.cpp:841
|
||||
msgid "E-Mail Verification"
|
||||
msgstr "E-Mail Überprüfung"
|
||||
|
||||
#: src/cpp/model/Session.cpp:350
|
||||
msgid "Du hast dein Konto bereits aktiviert!"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:390
|
||||
msgid "Falscher Code für aktiven Login"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:465
|
||||
msgid "Deine Passphrase ist ungütig"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:477
|
||||
msgid "Ein Fehler trat auf, bitte versuche es erneut"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:491
|
||||
msgid "Das ist nicht die richtige Passphrase."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:645
|
||||
msgid "Konnte Community Server nicht erreichen. E-Mail an den Admin ist raus."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:651
|
||||
msgid ""
|
||||
"Fehler beim Löschen des Accounts. Bitte logge dich erneut ein und "
|
||||
"versuche es nochmal."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:832
|
||||
msgid "Konnte kein passendes Konto finden."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:841
|
||||
msgid "Fehler beim laden des Benutzers."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:937
|
||||
msgid "Kein gültiger Benutzer, bitte logge dich erneut ein."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:953
|
||||
msgid "Fehler beim generieren der Passphrase, der Admin bekommt eine E-Mail. "
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/email/Email.cpp:174
|
||||
msgid "Default Email Subject"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/email/Email.cpp:180
|
||||
msgid "Error from Gradido Login Server"
|
||||
msgstr "Fehler auf dem Gradido Login Server"
|
||||
|
||||
#: src/cpp/model/email/Email.cpp:200
|
||||
msgid "Gradido: E-Mail Verification"
|
||||
msgstr "Gradido: E-Mail Überprüfung"
|
||||
|
||||
#: src/cpp/model/email/Email.cpp:246
|
||||
msgid "Gradido: Reset Password"
|
||||
msgstr "Gradido: Passwort zurücksetzen"
|
||||
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:604
|
||||
msgid ""
|
||||
"Please enter a valid password with at least 8 characters, upper and lower "
|
||||
"case letters, at least one number and one special character (@$!%*?&+-_)!"
|
||||
msgstr ""
|
||||
"Bitte gebe ein gültiges Password ein mit mindestens 8 Zeichen, Groß- und "
|
||||
"Kleinbuchstaben, mindestens einer Zahl und einem Sonderzeichen (@$!%*?&+-_) "
|
||||
"ein!"
|
||||
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:610
|
||||
msgid "Your password is to short!"
|
||||
msgstr "Dein Passwort ist zu kurz!"
|
||||
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:615
|
||||
msgid "Your password does not contain lowercase letters!"
|
||||
msgstr "Dein Passwort enthält keine Kleinbuchstaben!"
|
||||
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:620
|
||||
msgid "Your password does not contain any capital letters!"
|
||||
msgstr " Dein Passwort enthält keine Großbuchstaben!"
|
||||
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:625
|
||||
msgid "Your password does not contain any number!"
|
||||
msgstr "Dein Passwort enthält keine Zahlen!"
|
||||
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:630
|
||||
msgid "Your password does not contain special characters (@$!%*?&+-)!"
|
||||
msgstr "Dein Passwort enthält keine Sonderzeichen (@$!%*?&+-)!"
|
||||
|
||||
#~ msgid "Account"
|
||||
#~ msgstr "Konto"
|
||||
|
||||
#~ msgid "E-Mail Address not checked, do you already get one?"
|
||||
#~ msgstr ""
|
||||
#~ "E-Mail Adresse wurde noch nicht überprüft. Hast du schon in deine E-Mails "
|
||||
#~ "geschaut? Bitte schau auch in dein Spam-Verzeichnis nach."
|
||||
|
||||
#~ msgid ""
|
||||
#~ "Schreibe dir deine Passphrase auf und packe sie gut weg. Du brauchst sie "
|
||||
#~ "um deine Adresse wiederherzustellen. Wenn du sie verlierst, sind auch "
|
||||
#~ "deine Gradidos verloren."
|
||||
#~ msgstr ""
|
||||
#~ "Schreibe dir deine Passphrase auf oder drucke sie aus und bewahre sie "
|
||||
#~ "<b>in Papier-Form</b> an einem sicheren Ort auf (speichere sie nicht auf "
|
||||
#~ "deinem Rechner oder Mobilgerät)! Du brauchst deine Passphrase um dein "
|
||||
#~ "Konto wiederherzustellen, wenn du mal dein Passort vergessen haben "
|
||||
#~ "solltest. "
|
||||
|
||||
#~ msgid ""
|
||||
#~ "Der neue Gradido basiert technisch auf einer Kryptowährung (wie z.B. "
|
||||
#~ "Bitcoin) um maximale Sicherheit zu erreichen."
|
||||
#~ msgstr ""
|
||||
#~ "Der neue Gradido basiert technisch auf einer Kryptowährung (wie z.B. "
|
||||
#~ "Bitcoin) um für dich die maximale Sicherheit zu gewährleisten."
|
||||
|
||||
#~ msgid ""
|
||||
#~ "Der Code stimmt nicht, bitte überprüfe ihn nochmal oder "
|
||||
#~ "registriere dich erneut oder wende dich an den Server-Admin"
|
||||
#~ msgstr ""
|
||||
#~ "Der Code stimmt nicht, bitte überprüfe ihn nochmal oder "
|
||||
#~ "schreibe mir eine E-Mail an: coin@gradido.net."
|
||||
Binary file not shown.
@ -1,428 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-05-28 10:50+0200\n"
|
||||
"PO-Revision-Date: 2020-05-28 10:53+0200\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: en_GB\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.3.1\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:85
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:124
|
||||
msgid "Login"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:85
|
||||
msgid "E-Mail or password isn't right, please try again!"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:88
|
||||
msgid "Passwort"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:88
|
||||
msgid ""
|
||||
"Passwort wird noch berechnet, bitte versuche es in etwa 1 Minute erneut."
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:91
|
||||
msgid "Account"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:91
|
||||
msgid "E-Mail Address not checked, do you already get one?"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:124
|
||||
msgid "Username and password are needed!"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:175
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:50
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:54
|
||||
#: model/Session.cpp:163 model/Session.cpp:170 model/Session.cpp:209
|
||||
#: model/Session.cpp:234
|
||||
msgid "E-Mail"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:178
|
||||
msgid "Password"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:180
|
||||
msgid " Login "
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:182
|
||||
msgid "You haven't any account yet? Please follow the link to create one."
|
||||
msgstr "Don't have an Gradido-account yet?"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:183
|
||||
msgid "Create New Account"
|
||||
msgstr "Sign Up"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp:186
|
||||
msgid "Passwort vergessen"
|
||||
msgstr "Reset Password"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\checkEmail.cpsp:97
|
||||
msgid "Bitte gebe deinen E-Mail Verification Code ein:"
|
||||
msgstr "Please enter your E-Mail Verification Code:"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\checkEmail.cpsp:98
|
||||
#: model/Session.cpp:186
|
||||
msgid "Email Verification Code"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\checkEmail.cpsp:100
|
||||
msgid "Überprüfe Code"
|
||||
msgstr "Check Code"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\checkEmail.cpsp:104
|
||||
msgid "Du hast bisher keinen Code erhalten?"
|
||||
msgstr "You didn't get a code yet?"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\checkEmail.cpsp:105
|
||||
msgid "E-Mail erneut zuschicken (in Arbeit)"
|
||||
msgstr "Re-Send E-Mail (work in progress)"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\checkEmail.cpsp:108
|
||||
msgid "Funktioniert dein E-Mail Verification Code nicht?"
|
||||
msgstr "Your E-Mail Verfication Code doesn't work?"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\checkEmail.cpsp:109
|
||||
msgid "Schicke uns eine E-Mail und wir kümmern uns darum: "
|
||||
msgstr "Send us a E-Mail and we take care of it:"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\checkEmail.cpsp:110
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:133
|
||||
msgid "E-Mail an Support schicken"
|
||||
msgstr "Send E-Mail to support"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:50
|
||||
msgid "E-Mail Adresse konnte nicht gefunden werden oder ist nicht aktiviert."
|
||||
msgstr "E-Mail not found or not activated."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:54
|
||||
msgid "E-Mail Adresse nicht angegeben."
|
||||
msgstr "Please give your E-Mail Address."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:59
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:74
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:26
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:94
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:114
|
||||
#: model/Session.cpp:495 model/Session.cpp:507 model/Session.cpp:515
|
||||
msgid "Passphrase"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:59
|
||||
msgid "Bitte wähle eine Option aus."
|
||||
msgstr "Please choose one Option."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:74
|
||||
msgid "Ungültige Option"
|
||||
msgstr "Invalid option"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:107
|
||||
msgid "Gebe bitte hier deine E-Mail Adresse an:"
|
||||
msgstr "Please enter a valid email."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:109
|
||||
msgid "Hast du dir deine Passphrase notiert oder gemerkt?"
|
||||
msgstr "Do you memorized your passphrase?"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:113
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:196
|
||||
msgid "Ja"
|
||||
msgstr "Yes"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:118
|
||||
msgid "Nein"
|
||||
msgstr "No"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:123
|
||||
msgid "Absenden"
|
||||
msgstr "Send"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:127
|
||||
msgid "Dir wird eine E-Mail zugeschickt um dein Passwort zurückzusetzen."
|
||||
msgstr "You get an E-Mail to reset your password."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:129
|
||||
msgid "Der Admin hat eine E-Mail bekommen und wird sich bei dir melden."
|
||||
msgstr "The Admin get an E-Mail, wait on his replay."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:131
|
||||
msgid ""
|
||||
"Du hast bereits eine E-Mail bekommen. Bitte schau auch in dein Spam-"
|
||||
"Verzeichnis nach. "
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\resetPassword.cpsp:132
|
||||
msgid ""
|
||||
"Du hast wirklich keine E-Mail erhalten und auch schon ein paar Minuten "
|
||||
"gewartet?"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:27
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:256
|
||||
msgid "Neues Konto anlegen"
|
||||
msgstr "Create new Account"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:28
|
||||
msgid "2/3"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:94
|
||||
msgid ""
|
||||
"Diese Passphrase ist ungültig, bitte überprüfen oder neu "
|
||||
"generieren (lassen)."
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:114
|
||||
msgid "intern error please try again later"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:129
|
||||
msgid "3/3"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:132
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:135
|
||||
msgid "1/3"
|
||||
msgstr ""
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:134
|
||||
msgid "Neues Passwort anlegen"
|
||||
msgstr "Create new Password"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:153
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:188
|
||||
msgid "Was zu tun ist:"
|
||||
msgstr "What to do:"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:154
|
||||
msgid ""
|
||||
"Schreibe dir deine Passphrase auf und packe sie gut weg. Du brauchst sie um "
|
||||
"deine Adresse wiederherzustellen. Wenn du sie verlierst, sind auch deine "
|
||||
"Gradidos verloren."
|
||||
msgstr ""
|
||||
"Write down your passphrase and put it away well. You need it to restore your "
|
||||
"address. If you lose them, your Gradidos are lost too."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:157
|
||||
msgid "Deine Passphrase (Groß/Kleinschreibung beachten)"
|
||||
msgstr "Your Passphrase"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:161
|
||||
msgid "Was ist eine Passphrase?"
|
||||
msgstr "What is a passphrase?"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:162
|
||||
msgid ""
|
||||
"Die Passphrase kommt aus dem Crypto-Bereich und ist ein Weg einen "
|
||||
"komplizierte kryptografischen Schlüssel in einer lesbaren Form darzustellen."
|
||||
msgstr ""
|
||||
"The passphrase comes from the crypto area and is a way to represent a "
|
||||
"complicated cryptographic key in a legible form."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:163
|
||||
msgid ""
|
||||
"Der neue Gradido basiert technisch auf einer Kryptowährung (wie z.B. "
|
||||
"Bitcoin) um maximale Sicherheit zu erreichen."
|
||||
msgstr ""
|
||||
"The new Gradido is technically based on a cryptocurrency (such as Bitcoin) "
|
||||
"to achieve maximum security for you."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:165
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:275
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:280
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:293
|
||||
msgid "Weiter"
|
||||
msgstr "Next"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:189
|
||||
msgid "Hast du dir deine Passphrase gemerkt?"
|
||||
msgstr "Do you memorized your passphrase?"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:190
|
||||
msgid ""
|
||||
"Dann zeig es mir. Zur Unterstützung gebe ich dir deine Wörter aber in "
|
||||
"anderer Reihenfolge."
|
||||
msgstr ""
|
||||
"Then show me. I will give you your words in a different order as support."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:191
|
||||
msgid "Klicke sie an um sie einzusetzen."
|
||||
msgstr "Click on it to use it."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:195
|
||||
msgid ""
|
||||
"Weil du kein Javascript verwendest geht es direkt weiter. Hast du dir deine "
|
||||
"Passphrase gemerkt oder aufgeschrieben?"
|
||||
msgstr ""
|
||||
"Because you don't use javascript it goes straight on. Did you remember or "
|
||||
"write down your passphrase?"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:242
|
||||
msgid "Deine E-Mail Adresse wurde erfolgreich bestätigt."
|
||||
msgstr "Your email address has been successfully confirmed."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:246
|
||||
msgid "Neue Gradido Adresse anlegen / wiederherstellen"
|
||||
msgstr "Create / restore new Gradido address"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:247
|
||||
msgid ""
|
||||
"Möchtest du ein neues Gradido-Konto anlegen oder ein bestehendes "
|
||||
"wiederherstellen?"
|
||||
msgstr ""
|
||||
"Do you want to restore an existing Gradido account or create a new one?"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:263
|
||||
msgid "Bestehendes Konto wiederherstellen"
|
||||
msgstr "Restore existing Account"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:270
|
||||
msgid ""
|
||||
"Falls du ein bestehendes Konto wiederherstellen willst, gib hier deine "
|
||||
"Passphrase ein:"
|
||||
msgstr ""
|
||||
"If you want to restore an existing account, enter your passphrase here:"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:288
|
||||
msgid "Konto wiederherstellen / Neues Passwort anlegen"
|
||||
msgstr "Restore account / create new password"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:289
|
||||
msgid ""
|
||||
"Um dein Konto wiederherzustellen, dir ein Neues Passwort auswählen zu "
|
||||
"können, tippe hier bitte die Wörter deiner Passphrase in der richtigen "
|
||||
"Reihenfolge ein, welche du dir aufgeschrieben hast."
|
||||
msgstr ""
|
||||
"To restore your account and to be able to choose a new password, please type "
|
||||
"in the words of your passphrase in the correct order, which you have written "
|
||||
"down."
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:303
|
||||
msgid "Fehler"
|
||||
msgstr "Erro"
|
||||
|
||||
#: F:\\Gradido\\gradido_login_server\\src\\cpsp\\passphrase.cpsp:304
|
||||
msgid ""
|
||||
"Ungültige Seite, wenn du das siehst stimmt hier etwas nicht. Bitte wende "
|
||||
"dich an den Server-Admin."
|
||||
msgstr ""
|
||||
"Invalid page, if you see that something is wrong here. Please contact the "
|
||||
"server admin."
|
||||
|
||||
#: model/Session.cpp:149 model/Session.cpp:180 model/Session.cpp:700
|
||||
#: model/Session.cpp:706 model/Session.cpp:1005
|
||||
msgid "Benutzer"
|
||||
msgstr "User"
|
||||
|
||||
#: model/Session.cpp:149
|
||||
msgid "Eingeloggter Benutzer ist kein Admin"
|
||||
msgstr "Logged in user is not admin"
|
||||
|
||||
#: model/Session.cpp:155 model/Session.cpp:201
|
||||
msgid "Vorname"
|
||||
msgstr "Firstname"
|
||||
|
||||
#: model/Session.cpp:155 model/Session.cpp:159 model/Session.cpp:201
|
||||
#: model/Session.cpp:205
|
||||
msgid ""
|
||||
"Bitte gebe einen Namen an. Mindestens 3 Zeichen, keines folgender Zeichen "
|
||||
"<>&;"
|
||||
msgstr "Please enter your Name. At least 3 Character, without <>& and ;"
|
||||
|
||||
#: model/Session.cpp:159 model/Session.cpp:205
|
||||
msgid "Nachname"
|
||||
msgstr "Lastname"
|
||||
|
||||
#: model/Session.cpp:163 model/Session.cpp:209
|
||||
msgid "Bitte gebe eine gültige E-Mail Adresse an."
|
||||
msgstr "Please enter a valid email."
|
||||
|
||||
#: model/Session.cpp:170 model/Session.cpp:234
|
||||
msgid "Für diese E-Mail Adresse gibt es bereits einen Account"
|
||||
msgstr "This email has an account already."
|
||||
|
||||
#: model/Session.cpp:180 model/Session.cpp:186
|
||||
msgid "Fehler beim speichern!"
|
||||
msgstr "Error while saving!"
|
||||
|
||||
#: model/Session.cpp:379 model/Session.cpp:438 model/Session.cpp:881
|
||||
#: model/Session.cpp:889
|
||||
msgid "E-Mail Verification"
|
||||
msgstr ""
|
||||
|
||||
#: model/Session.cpp:379
|
||||
msgid "Du hast dein Konto bereits aktiviert!"
|
||||
msgstr "You already activated your account!"
|
||||
|
||||
#: model/Session.cpp:438
|
||||
msgid "Falscher Code für aktiven Login"
|
||||
msgstr "Wrong Code for active Login."
|
||||
|
||||
#: model/Session.cpp:495
|
||||
msgid "Deine Passphrase ist ungütig"
|
||||
msgstr "Your passphrase is invalid"
|
||||
|
||||
#: model/Session.cpp:507
|
||||
msgid "Ein Fehler trat auf, bitte versuche es erneut"
|
||||
msgstr "An error occurred, please try again"
|
||||
|
||||
#: model/Session.cpp:515
|
||||
msgid "Das ist nicht die richtige Passphrase."
|
||||
msgstr "This is not the correct passphrase."
|
||||
|
||||
#: model/Session.cpp:700
|
||||
msgid "Konnte Community Server nicht erreichen. E-Mail an den Admin ist raus."
|
||||
msgstr "Couldn't connect to the community server, send E-Mail to admin."
|
||||
|
||||
#: model/Session.cpp:706
|
||||
msgid ""
|
||||
"Fehler beim Löschen des Accounts. Bitte logge dich erneut ein und "
|
||||
"versuche es nochmal."
|
||||
msgstr "Error by deleting the account. Please re-login and try again."
|
||||
|
||||
#: model/Session.cpp:881
|
||||
msgid "Konnte kein passendes Konto finden."
|
||||
msgstr "This Account didn't seem to exist."
|
||||
|
||||
#: model/Session.cpp:889
|
||||
msgid "Fehler beim laden des Benutzers."
|
||||
msgstr ""
|
||||
|
||||
#: model/Session.cpp:1005
|
||||
msgid "Kein gültiger Benutzer, bitte logge dich erneut ein."
|
||||
msgstr "Invalid User, please re-login."
|
||||
|
||||
#~ msgid "*Das Konto muss nach dem 01.09.2019 angelegt worden sein."
|
||||
#~ msgstr "* The account must have been created after September 1st, 2019."
|
||||
|
||||
#~ msgid "Nein, bitte ein neues erstellen!"
|
||||
#~ msgstr "No, please create a new one!"
|
||||
|
||||
#~ msgid "Deine Passphrase"
|
||||
#~ msgstr "Your passphrase"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "Der Code stimmt nicht, bitte überprüfe ihn nochmal oder "
|
||||
#~ "registriere dich erneut oder wende dich an den Server-Admin"
|
||||
#~ msgstr ""
|
||||
#~ "The email verification code isn't correct. Please check at spell errors "
|
||||
#~ "and try again or ask the server admin."
|
||||
@ -1,477 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-06-21 13:37+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:196 build/http_pages/LoginPage.cpp:275
|
||||
msgid "Login"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:196
|
||||
msgid "E-Mail or password isn't right, please try again!"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:205
|
||||
msgid "Passwort"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:205
|
||||
msgid ""
|
||||
"Passwort wird noch berechnet, bitte versuche es in etwa 1 Minute erneut."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:208 build/http_pages/LoginPage.cpp:211
|
||||
msgid "User"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:208
|
||||
msgid "Error in saved data, the server admin will look at it."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:211
|
||||
msgid "Benutzer ist deaktiviert, kein Login möglich!"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:275
|
||||
msgid "Username and password are needed!"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:376 src/cpp/model/Session.cpp:161
|
||||
#: src/cpp/model/Session.cpp:168 src/cpp/model/Session.cpp:220
|
||||
#: src/cpp/model/Session.cpp:231
|
||||
msgid "E-Mail"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:381
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:603
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:609
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:614
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:619
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:624
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:629
|
||||
msgid "Password"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:384
|
||||
msgid " Login "
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:391
|
||||
msgid "You haven't any account yet? Please follow the link to create one."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:395
|
||||
msgid "Create New Account"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/LoginPage.cpp:403
|
||||
msgid "Passwort vergessen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:155
|
||||
msgid "E-Mail verifizieren"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:165
|
||||
msgid ""
|
||||
"Deine E-Mail wurde erfolgreich bestätigt. Du kannst nun Gradidos versenden."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:170
|
||||
msgid "Zur Startseite"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:175
|
||||
msgid "Bitte gib deinen E-Mail Verification Code ein:"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:178 src/cpp/model/Session.cpp:184
|
||||
msgid "Email Verification Code"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:185
|
||||
msgid "Überprüfe Code"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:190
|
||||
msgid "Du hast bisher keinen Code erhalten?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:193
|
||||
msgid "E-Mail erneut zuschicken (in Arbeit)"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:198
|
||||
msgid "Funktioniert dein E-Mail Verification Code nicht?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:201
|
||||
msgid "Schicke uns eine E-Mail und wir kümmern uns darum: "
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/CheckEmailPage.cpp:208
|
||||
#: build/http_pages/ResetPasswordPage.cpp:273
|
||||
msgid "E-Mail an Support schicken"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:174
|
||||
#: build/http_pages/ResetPasswordPage.cpp:217
|
||||
msgid "Gib bitte hier deine E-Mail Adresse an:"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:183
|
||||
msgid "Bestätigen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:225
|
||||
msgid "Hast du dir deine Passphrase notiert oder gemerkt?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:234
|
||||
#: build/http_pages/PassphrasePage.cpp:373
|
||||
msgid "Ja"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:241
|
||||
msgid "Nein"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:247
|
||||
msgid "Absenden"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:255
|
||||
msgid "Dir wird eine E-Mail zugeschickt um dein Passwort zurückzusetzen."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:260
|
||||
msgid "Der Admin hat eine E-Mail bekommen und wird sich bei dir melden."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:265
|
||||
msgid ""
|
||||
"Du hast bereits eine E-Mail bekommen. Bitte schau auch in dein Spam-"
|
||||
"Verzeichnis nach. "
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/ResetPasswordPage.cpp:268
|
||||
msgid ""
|
||||
"Du hast wirklich keine E-Mail erhalten und auch schon ein paar Minuten "
|
||||
"gewartet?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:41
|
||||
#: build/http_pages/PassphrasePage.cpp:111
|
||||
#: build/http_pages/PassphrasePage.cpp:132 src/cpp/model/Session.cpp:465
|
||||
#: src/cpp/model/Session.cpp:477 src/cpp/model/Session.cpp:491
|
||||
msgid "Passphrase"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:42
|
||||
#: build/http_pages/PassphrasePage.cpp:451
|
||||
msgid "Neues Konto anlegen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:43
|
||||
msgid "2/3"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:111
|
||||
msgid ""
|
||||
"Diese Passphrase ist ungültig, bitte überprüfen oder neu "
|
||||
"generieren (lassen)."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:132
|
||||
msgid "intern error please try again later"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:147
|
||||
msgid "3/3"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:150
|
||||
#: build/http_pages/PassphrasePage.cpp:153
|
||||
msgid "1/3"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:152
|
||||
msgid "Neues Passwort anlegen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:270
|
||||
msgid "Passphrase abschreiben"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:287
|
||||
msgid "Was ist eine Passphrase?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:290
|
||||
msgid "Deine Passphrase besteht aus den im grünen Feld angezeigten Wörtern."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:293
|
||||
msgid "Sie dient deiner Sicherheit."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:296
|
||||
msgid ""
|
||||
"Du brauchst deine Passphrase um dein Konto wiederherzustellen, wenn du mal "
|
||||
"dein Passwort vergessen haben solltest."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:300
|
||||
msgid "Deine Passphrase (Groß/Kleinschreibung beachten)"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:309
|
||||
#: build/http_pages/PassphrasePage.cpp:352
|
||||
msgid "Was zu tun ist:"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:312
|
||||
msgid ""
|
||||
"Schreibe dir die obenstehende Passphrase <b>von Hand</b> auf ein Blatt "
|
||||
"Papier!"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:315
|
||||
msgid "Speichere sie auf keinen Fall auf deinem Rechner oder Mobilgerät!!"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:318
|
||||
msgid "Bewahre sie an einem sicheren Ort auf!"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:322
|
||||
#: build/http_pages/PassphrasePage.cpp:478
|
||||
#: build/http_pages/PassphrasePage.cpp:487
|
||||
#: build/http_pages/PassphrasePage.cpp:511
|
||||
msgid "Weiter"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:355
|
||||
msgid "Hast du dir deine Passphrase gemerkt?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:358
|
||||
msgid ""
|
||||
"Dann zeig es mir. Zur Unterstützung gebe ich dir deine Wörter aber in "
|
||||
"anderer Reihenfolge."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:361
|
||||
msgid "Klicke sie an um sie einzusetzen."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:364
|
||||
msgid "Überprüfe dabei, ob du alle Wörter richtig geschrieben hast!"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:370
|
||||
msgid ""
|
||||
"Weil du kein Javascript verwendest geht es direkt weiter. Hast du dir deine "
|
||||
"Passphrase gemerkt oder aufgeschrieben?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:429
|
||||
msgid "Deine E-Mail Adresse wurde erfolgreich bestätigt."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:437
|
||||
msgid "Neue Gradido Adresse anlegen / wiederherstellen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:440
|
||||
msgid ""
|
||||
"Möchtest du ein neues Gradido-Konto anlegen oder ein bestehendes "
|
||||
"wiederherstellen?"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:460
|
||||
msgid "Bestehendes Konto wiederherstellen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:469
|
||||
msgid ""
|
||||
"Falls du ein bestehendes Konto wiederherstellen willst, gib hier deine "
|
||||
"Passphrase ein:"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:497
|
||||
msgid "Konto wiederherstellen / Neues Passwort anlegen"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:501
|
||||
msgid ""
|
||||
"Um dein Konto wiederherzustellen und dir ein Neues Passwort auswählen zu "
|
||||
"können, tippe hier bitte die Wörter deiner Passphrase in der richtigen "
|
||||
"Reihenfolge ein, welche du dir aufgeschrieben hast."
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:524
|
||||
msgid "Fehler"
|
||||
msgstr ""
|
||||
|
||||
#: build/http_pages/PassphrasePage.cpp:527
|
||||
msgid ""
|
||||
"Ungültige Seite, wenn du das siehst stimmt hier etwas nicht. Bitte wende "
|
||||
"dich an den Server-Admin."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:147 src/cpp/model/Session.cpp:177
|
||||
#: src/cpp/model/Session.cpp:645 src/cpp/model/Session.cpp:651
|
||||
#: src/cpp/model/Session.cpp:937 src/cpp/model/Session.cpp:953
|
||||
msgid "Benutzer"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:147
|
||||
msgid "Eingeloggter Benutzer ist kein Admin"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:153 src/cpp/model/Session.cpp:212
|
||||
msgid "Vorname"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:153 src/cpp/model/Session.cpp:157
|
||||
#: src/cpp/model/Session.cpp:212 src/cpp/model/Session.cpp:216
|
||||
msgid ""
|
||||
"Bitte gebe einen Namen an. Mindestens 3 Zeichen, keines folgender Zeichen "
|
||||
"<>&;"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:157 src/cpp/model/Session.cpp:216
|
||||
msgid "Nachname"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:161 src/cpp/model/Session.cpp:220
|
||||
msgid "Bitte gebe eine gültige E-Mail Adresse an."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:168
|
||||
msgid "Für diese E-Mail Adresse gibt es bereits einen Account"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:177 src/cpp/model/Session.cpp:184
|
||||
msgid "Fehler beim speichern!"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:231
|
||||
msgid "Für diese E-Mail Adresse gibt es bereits ein Konto"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:255
|
||||
msgid "Server"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:255
|
||||
msgid "Fehler beim speichen des Kontos bitte versuche es später noch einmal"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:350 src/cpp/model/Session.cpp:390
|
||||
#: src/cpp/model/Session.cpp:832 src/cpp/model/Session.cpp:841
|
||||
msgid "E-Mail Verification"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:350
|
||||
msgid "Du hast dein Konto bereits aktiviert!"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:390
|
||||
msgid "Falscher Code für aktiven Login"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:465
|
||||
msgid "Deine Passphrase ist ungütig"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:477
|
||||
msgid "Ein Fehler trat auf, bitte versuche es erneut"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:491
|
||||
msgid "Das ist nicht die richtige Passphrase."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:645
|
||||
msgid "Konnte Community Server nicht erreichen. E-Mail an den Admin ist raus."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:651
|
||||
msgid ""
|
||||
"Fehler beim Löschen des Accounts. Bitte logge dich erneut ein und "
|
||||
"versuche es nochmal."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:832
|
||||
msgid "Konnte kein passendes Konto finden."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:841
|
||||
msgid "Fehler beim laden des Benutzers."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:937
|
||||
msgid "Kein gültiger Benutzer, bitte logge dich erneut ein."
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/Session.cpp:953
|
||||
msgid "Fehler beim generieren der Passphrase, der Admin bekommt eine E-Mail. "
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/email/Email.cpp:174
|
||||
msgid "Default Email Subject"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/email/Email.cpp:180
|
||||
msgid "Error from Gradido Login Server"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/email/Email.cpp:200
|
||||
msgid "Gradido: E-Mail Verification"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/model/email/Email.cpp:246
|
||||
msgid "Gradido: Reset Password"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:604
|
||||
msgid ""
|
||||
"Please enter a valid password with at least 8 characters, upper and lower "
|
||||
"case letters, at least one number and one special character (@$!%*?&+-_)!"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:610
|
||||
msgid "Your password is to short!"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:615
|
||||
msgid "Your password does not contain lowercase letters!"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:620
|
||||
msgid "Your password does not contain any capital letters!"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:625
|
||||
msgid "Your password does not contain any number!"
|
||||
msgstr ""
|
||||
|
||||
#: src/cpp/SingletonManager/SessionManager.cpp:630
|
||||
msgid "Your password does not contain special characters (@$!%*?&+-)!"
|
||||
msgstr ""
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,58 +0,0 @@
|
||||
HTTPServer.port = 1200
|
||||
JSONServer.port = 1201
|
||||
Gradido.group_id = 1
|
||||
|
||||
crypto.server_admin_public = f909a866baec97c5460b8d7a93b72d3d4d20cc45d9f15d78bd83944eb9286b7f
|
||||
crypto.server_key = a51ef8ac7ef1abf162fb7a65261acd7a
|
||||
# TODO auto-generate in docker build step
|
||||
crypto.app_secret = 21ffbbc616fe
|
||||
|
||||
# Server admin Passphrase
|
||||
# nerve execute merit pool talk hockey basic win cargo spin disagree ethics swear price purchase say clutch decrease slow half forest reform cheese able
|
||||
#
|
||||
|
||||
phpServer.url = http://localhost/
|
||||
phpServer.host = nginx
|
||||
|
||||
loginServer.path = http://localhost/account
|
||||
loginServer.default_locale = de
|
||||
loginServer.db.host = mariadb
|
||||
loginServer.db.name = gradido_community
|
||||
loginServer.db.user = root
|
||||
loginServer.db.password =
|
||||
loginServer.db.port = 3306
|
||||
|
||||
frontend.checkEmailPath = vue/checkEmail
|
||||
frontend.resetPasswordPath = vue/reset
|
||||
|
||||
email.disable = true
|
||||
|
||||
#email.username =
|
||||
#email.sender =
|
||||
#email.admin_receiver =
|
||||
#email.password =
|
||||
#email.smtp.url =
|
||||
#email.smtp.port =
|
||||
|
||||
# binary is default, for debugging also json is possible
|
||||
#hedera.consensus.message_format = json
|
||||
# TESTNET or MAINNET, TESTNET is default
|
||||
hedera.nettype = TESTNET
|
||||
|
||||
# server setup types: test, staging or production
|
||||
ServerSetupType=test
|
||||
dev.default_group = docker
|
||||
|
||||
|
||||
# Session timeout in minutes
|
||||
#
|
||||
session.timeout = 15
|
||||
|
||||
# Disabling security features for faster develop and testing
|
||||
unsecure.allow_passwort_via_json_request = 1
|
||||
unsecure.allow_auto_sign_transactions = 1
|
||||
unsecure.allow_cors_all = 1
|
||||
# default disable, passwords must contain a number, a lower character, a high character, special character, and be at least 8 characters long
|
||||
|
||||
unsecure.allow_all_passwords = 1
|
||||
|
||||
@ -1,57 +0,0 @@
|
||||
HTTPServer.port = 1200
|
||||
JSONServer.port = 1201
|
||||
Gradido.group_id = 1
|
||||
|
||||
crypto.server_admin_public = f909a866baec97c5460b8d7a93b72d3d4d20cc45d9f15d78bd83944eb9286b7f
|
||||
crypto.server_key = a51ef8ac7ef1abf162fb7a65261acd7a
|
||||
# TODO auto-generate in docker build step
|
||||
crypto.app_secret = 21ffbbc616fe
|
||||
|
||||
# Server admin Passphrase
|
||||
# nerve execute merit pool talk hockey basic win cargo spin disagree ethics swear price purchase say clutch decrease slow half forest reform cheese able
|
||||
#
|
||||
|
||||
phpServer.url = http://localhost/
|
||||
phpServer.host = nginx
|
||||
|
||||
loginServer.path = http://localhost/account
|
||||
loginServer.default_locale = de
|
||||
loginServer.db.host = mariadb
|
||||
loginServer.db.name = gradido_community_test
|
||||
loginServer.db.user = root
|
||||
loginServer.db.password =
|
||||
loginServer.db.port = 3306
|
||||
|
||||
frontend.checkEmailPath = http://localhost/reset
|
||||
|
||||
email.disable = true
|
||||
|
||||
#email.username =
|
||||
#email.sender =
|
||||
#email.admin_receiver =
|
||||
#email.password =
|
||||
#email.smtp.url =
|
||||
#email.smtp.port =
|
||||
|
||||
# binary is default, for debugging also json is possible
|
||||
#hedera.consensus.message_format = json
|
||||
# TESTNET or MAINNET, TESTNET is default
|
||||
hedera.nettype = TESTNET
|
||||
|
||||
# server setup types: test, staging or production
|
||||
ServerSetupType=test
|
||||
dev.default_group = docker
|
||||
|
||||
|
||||
# Session timeout in minutes
|
||||
#
|
||||
session.timeout = 15
|
||||
|
||||
# Disabling security features for faster develop and testing
|
||||
unsecure.allow_passwort_via_json_request = 1
|
||||
unsecure.allow_auto_sign_transactions = 1
|
||||
unsecure.allow_cors_all = 1
|
||||
# default disable, passwords must contain a number, a lower character, a high character, special character, and be at least 8 characters long
|
||||
|
||||
unsecure.allow_all_passwords = 1
|
||||
|
||||
@ -1,25 +1,34 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToOne } from 'typeorm'
|
||||
import { TransactionCreation } from './TransactionCreation'
|
||||
import { TransactionSendCoin } from './TransactionSendCoin'
|
||||
import { TransactionCreation } from '../TransactionCreation'
|
||||
import { TransactionSendCoin } from '../TransactionSendCoin'
|
||||
|
||||
@Entity('transactions')
|
||||
export class Transaction extends BaseEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number
|
||||
|
||||
@Column({ name: 'transaction_type_id' })
|
||||
@Column({ name: 'state_group_id', unsigned: true, default: null })
|
||||
stateGroupId: number
|
||||
|
||||
@Column({ name: 'transaction_type_id', unsigned: true, nullable: false })
|
||||
transactionTypeId: number
|
||||
|
||||
@Column({ name: 'tx_hash', type: 'binary', length: 48 })
|
||||
@Column({ name: 'tx_hash', type: 'binary', length: 48, default: null })
|
||||
txHash: Buffer
|
||||
|
||||
@Column()
|
||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||
memo: string
|
||||
|
||||
@Column({ type: 'timestamp' })
|
||||
@Column({ type: 'timestamp', nullable: false, default: () => 'CURRENT_TIMESTAMP' })
|
||||
received: Date
|
||||
|
||||
@Column({ name: 'blockchain_type_id' })
|
||||
@Column({
|
||||
name: 'blockchain_type_id',
|
||||
type: 'bigint',
|
||||
unsigned: true,
|
||||
nullable: false,
|
||||
default: 1,
|
||||
})
|
||||
blockchainTypeId: number
|
||||
|
||||
@OneToOne(() => TransactionSendCoin, (transactionSendCoin) => transactionSendCoin.transaction)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm'
|
||||
import { Transaction } from './Transaction'
|
||||
import { Transaction } from '../Transaction'
|
||||
|
||||
@Entity('transaction_creations')
|
||||
export class TransactionCreation extends BaseEntity {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm'
|
||||
import { Transaction } from './Transaction'
|
||||
import { Transaction } from '../Transaction'
|
||||
|
||||
@Entity('transaction_send_coins')
|
||||
export class TransactionSendCoin extends BaseEntity {
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm'
|
||||
import { Transaction } from './Transaction'
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm'
|
||||
import { Transaction } from '../Transaction'
|
||||
|
||||
@Entity('transaction_signatures')
|
||||
export class TransactionSignature extends BaseEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||
id: number
|
||||
|
||||
@Column({ name: 'transaction_id' })
|
||||
transactionId: number
|
||||
|
||||
@Column({ type: 'binary', length: 64 })
|
||||
@Column({ type: 'binary', length: 64, nullable: false })
|
||||
signature: Buffer
|
||||
|
||||
@Column({ type: 'binary', length: 32 })
|
||||
@Column({ type: 'binary', length: 32, nullable: false })
|
||||
pubkey: Buffer
|
||||
|
||||
@ManyToOne(() => Transaction)
|
||||
@OneToOne(() => Transaction)
|
||||
@JoinColumn({ name: 'transaction_id' })
|
||||
transaction: Transaction
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToMany } from 'typeorm'
|
||||
import { UserSetting } from './UserSetting'
|
||||
import { UserSetting } from '../UserSetting'
|
||||
|
||||
// Moriz: I do not like the idea of having two user tables
|
||||
@Entity('state_users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm'
|
||||
import { User } from './User'
|
||||
import { User } from '../User'
|
||||
|
||||
@Entity()
|
||||
export class UserSetting extends BaseEntity {
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
||||
|
||||
@Entity('admin_pending_creations')
|
||||
export class AdminPendingCreation extends BaseEntity {
|
||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||
id: number
|
||||
|
||||
@Column({ unsigned: true, nullable: false })
|
||||
userId: number
|
||||
|
||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
||||
created: Date
|
||||
|
||||
@Column({ type: 'datetime', nullable: false })
|
||||
date: Date
|
||||
|
||||
@Column({ length: 256, nullable: true, default: null })
|
||||
memo: string
|
||||
|
||||
@Column({ type: 'bigint', nullable: false })
|
||||
amount: BigInt
|
||||
|
||||
@Column()
|
||||
moderator: number
|
||||
}
|
||||
34
database/entity/0016-transaction_signatures/Transaction.ts
Normal file
34
database/entity/0016-transaction_signatures/Transaction.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToOne } from 'typeorm'
|
||||
import { TransactionCreation } from '../TransactionCreation'
|
||||
import { TransactionSendCoin } from '../TransactionSendCoin'
|
||||
|
||||
@Entity('transactions')
|
||||
export class Transaction extends BaseEntity {
|
||||
// TODO the id is defined as bigint(20) - there might be problems with that: https://github.com/typeorm/typeorm/issues/2400
|
||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||
id: number
|
||||
|
||||
@Column({ name: 'transaction_type_id', unsigned: true, nullable: false })
|
||||
transactionTypeId: number
|
||||
|
||||
@Column({ name: 'tx_hash', type: 'binary', length: 48, default: null })
|
||||
txHash: Buffer
|
||||
|
||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||
memo: string
|
||||
|
||||
@Column({ type: 'timestamp', nullable: false, default: () => 'CURRENT_TIMESTAMP' })
|
||||
received: Date
|
||||
|
||||
@Column({ type: 'binary', length: 64, nullable: true, default: null })
|
||||
signature: Buffer
|
||||
|
||||
@Column({ type: 'binary', length: 32, nullable: true, default: null })
|
||||
pubkey: Buffer
|
||||
|
||||
@OneToOne(() => TransactionSendCoin, (transactionSendCoin) => transactionSendCoin.transaction)
|
||||
transactionSendCoin: TransactionSendCoin
|
||||
|
||||
@OneToOne(() => TransactionCreation, (transactionCreation) => transactionCreation.transaction)
|
||||
transactionCreation: TransactionCreation
|
||||
}
|
||||
1
database/entity/AdminPendingCreation.ts
Normal file
1
database/entity/AdminPendingCreation.ts
Normal file
@ -0,0 +1 @@
|
||||
export { AdminPendingCreation } from './0015-admin_pending_creations/AdminPendingCreation'
|
||||
@ -1 +0,0 @@
|
||||
export { LoginPendingTasksAdmin } from './0005-admin_tables/LoginPendingTasksAdmin'
|
||||
@ -1 +0,0 @@
|
||||
export { LoginUserRoles } from './0003-login_server_tables/LoginUserRoles'
|
||||
@ -1 +1 @@
|
||||
export { Transaction } from './0001-init_db/Transaction'
|
||||
export { Transaction } from './0016-transaction_signatures/Transaction'
|
||||
|
||||
@ -1 +0,0 @@
|
||||
export { TransactionSignature } from './0001-init_db/TransactionSignature'
|
||||
@ -2,34 +2,30 @@ import { Balance } from './Balance'
|
||||
import { LoginElopageBuys } from './LoginElopageBuys'
|
||||
import { LoginEmailOptIn } from './LoginEmailOptIn'
|
||||
import { LoginUser } from './LoginUser'
|
||||
import { LoginUserRoles } from './LoginUserRoles'
|
||||
import { LoginUserBackup } from './LoginUserBackup'
|
||||
import { Migration } from './Migration'
|
||||
import { ServerUser } from './ServerUser'
|
||||
import { Transaction } from './Transaction'
|
||||
import { TransactionCreation } from './TransactionCreation'
|
||||
import { TransactionSignature } from './TransactionSignature'
|
||||
import { TransactionSendCoin } from './TransactionSendCoin'
|
||||
import { User } from './User'
|
||||
import { UserSetting } from './UserSetting'
|
||||
import { UserTransaction } from './UserTransaction'
|
||||
import { LoginPendingTasksAdmin } from './LoginPendingTasksAdmin'
|
||||
import { AdminPendingCreation } from './AdminPendingCreation'
|
||||
|
||||
export const entities = [
|
||||
AdminPendingCreation,
|
||||
Balance,
|
||||
LoginElopageBuys,
|
||||
LoginEmailOptIn,
|
||||
LoginUser,
|
||||
LoginUserRoles,
|
||||
LoginUserBackup,
|
||||
Migration,
|
||||
ServerUser,
|
||||
Transaction,
|
||||
TransactionCreation,
|
||||
TransactionSignature,
|
||||
TransactionSendCoin,
|
||||
User,
|
||||
UserSetting,
|
||||
UserTransaction,
|
||||
LoginPendingTasksAdmin,
|
||||
]
|
||||
|
||||
142
database/migrations/0013-drop_unused_tables.ts
Normal file
142
database/migrations/0013-drop_unused_tables.ts
Normal file
@ -0,0 +1,142 @@
|
||||
/* MIGRATION TO DROP UNUSED TABLES
|
||||
*
|
||||
* This migration removes all tables without data and entity definition.
|
||||
* Base for evaluation are the production data from 27.01.2022 which had 40 tables present
|
||||
* The migration reduces the amount of tables to 28
|
||||
*/
|
||||
|
||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn(`DROP TABLE \`login_app_access_tokens\`;`)
|
||||
await queryFn(`DROP TABLE \`pending_transactions\`;`)
|
||||
await queryFn(`DROP TABLE \`roles\`;`)
|
||||
await queryFn(`DROP TABLE \`state_created\`;`)
|
||||
await queryFn(`DROP TABLE \`state_groups\`;`)
|
||||
await queryFn(`DROP TABLE \`state_group_addresses\`;`)
|
||||
await queryFn(`DROP TABLE \`state_group_relationships\`;`)
|
||||
await queryFn(`DROP TABLE \`state_relationship_types\`;`)
|
||||
await queryFn(`DROP TABLE \`state_user_roles\`;`)
|
||||
await queryFn(`DROP TABLE \`transaction_group_addaddress\`;`)
|
||||
await queryFn(`DROP TABLE \`transaction_group_allowtrades\`;`)
|
||||
await queryFn(`DROP TABLE \`transaction_group_creates\`;`)
|
||||
}
|
||||
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn(`
|
||||
CREATE TABLE IF NOT EXISTS \`login_app_access_tokens\` (
|
||||
\`id\` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`user_id\` int NOT NULL,
|
||||
\`access_code\` bigint unsigned NOT NULL,
|
||||
\`created\` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
\`updated\` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (\`id\`),
|
||||
UNIQUE KEY \`access_code\` (\`access_code\`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
`)
|
||||
await queryFn(`
|
||||
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;
|
||||
`)
|
||||
await queryFn(`
|
||||
CREATE TABLE \`roles\` (
|
||||
\`id\` int(10) 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;
|
||||
`)
|
||||
await queryFn(`
|
||||
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;
|
||||
`)
|
||||
await queryFn(`
|
||||
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;
|
||||
`)
|
||||
await queryFn(`
|
||||
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 KEY \`public_key\` (\`public_key\`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`)
|
||||
await queryFn(`
|
||||
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;
|
||||
`)
|
||||
await queryFn(`
|
||||
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;
|
||||
`)
|
||||
await queryFn(`
|
||||
CREATE TABLE \`state_user_roles\` (
|
||||
\`id\` int(10) 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;
|
||||
`)
|
||||
await queryFn(`
|
||||
CREATE TABLE \`transaction_group_addaddress\` (
|
||||
\`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`transaction_id\` int(10) unsigned NOT NULL,
|
||||
\`address_type_id\` int(10) unsigned NOT NULL,
|
||||
\`remove_from_group\` tinyint(1) DEFAULT 0,
|
||||
\`public_key\` binary(32) NOT NULL,
|
||||
\`state_user_id\` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`)
|
||||
await queryFn(`
|
||||
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;
|
||||
`)
|
||||
await queryFn(`
|
||||
CREATE TABLE \`transaction_group_creates\` (
|
||||
\`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`transaction_id\` int(10) unsigned NOT NULL,
|
||||
\`group_public_key\` binary(32) NOT NULL,
|
||||
\`group_id\` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
\`name\` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`)
|
||||
}
|
||||
351
database/migrations/0014-drop_unused_tables_with_data.ts
Normal file
351
database/migrations/0014-drop_unused_tables_with_data.ts
Normal file
@ -0,0 +1,351 @@
|
||||
/* MIGRATION TO DROP UNUSED TABLES
|
||||
*
|
||||
* This migration removes all tables with static or unused data and entity definition.
|
||||
* Base for evaluation are the production data from 27.01.2022 which had 28 tables present
|
||||
* The migration reduces the amount of tables to 16
|
||||
*/
|
||||
|
||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn(`DROP TABLE \`address_types\`;`)
|
||||
await queryFn(`DROP TABLE \`admin_errors\`;`)
|
||||
await queryFn(`DROP TABLE \`blockchain_types\`;`)
|
||||
await queryFn(`DROP TABLE \`community_profiles\`;`)
|
||||
await queryFn(`DROP TABLE \`login_email_opt_in_types\`;`)
|
||||
await queryFn(`DROP TABLE \`login_groups\`;`)
|
||||
await queryFn(`DROP TABLE \`login_roles\`;`)
|
||||
await queryFn(`DROP TABLE \`login_user_roles\`;`)
|
||||
await queryFn(`DROP TABLE \`operators\`;`)
|
||||
await queryFn(`DROP TABLE \`operator_types\`;`)
|
||||
await queryFn(`DROP TABLE \`state_errors\`;`)
|
||||
await queryFn(`DROP TABLE \`transaction_types\`;`)
|
||||
}
|
||||
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn(`
|
||||
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 AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`)
|
||||
// NOTE: Static data might be needed as enum definitions
|
||||
await queryFn(`
|
||||
INSERT INTO \`address_types\` VALUES
|
||||
(1,'user main','user main address');
|
||||
`)
|
||||
|
||||
await queryFn(`
|
||||
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 AUTO_INCREMENT=155 DEFAULT CHARSET=utf8mb4;
|
||||
`)
|
||||
// NOTE: This data is no longer generated
|
||||
await queryFn(`
|
||||
INSERT INTO \`admin_errors\` VALUES
|
||||
(54,272,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2020-11-04 17:57:07'),
|
||||
(55,272,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2020-11-04 17:57:16'),
|
||||
(56,193,'StateBalancesController','overview','error','server response status code isn\\'t 200','403','2020-11-24 12:44:31'),
|
||||
(57,79,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2020-12-31 19:17:52'),
|
||||
(58,79,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2020-12-31 19:18:04'),
|
||||
(59,44,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-01-12 20:58:45'),
|
||||
(60,44,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-01-12 21:02:02'),
|
||||
(61,44,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-01-12 21:02:04'),
|
||||
(62,44,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-01-12 21:02:19'),
|
||||
(63,20,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-01-13 22:32:59'),
|
||||
(64,20,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-01-14 23:54:19'),
|
||||
(65,161,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-01-27 10:29:09'),
|
||||
(66,161,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-01-27 10:29:11'),
|
||||
(67,161,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-01-27 10:29:23'),
|
||||
(68,20,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-02-03 00:27:36'),
|
||||
(69,685,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-02-06 11:48:09'),
|
||||
(70,685,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-02-06 11:53:14'),
|
||||
(71,685,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-02-06 11:53:20'),
|
||||
(72,502,'TransactionCreations','createMulti','error','json exception','System exception: cannot unlock mutex','2021-03-24 21:22:14'),
|
||||
(73,502,'TransactionCreations','createMulti','error','json exception','System exception: cannot unlock mutex','2021-03-24 21:23:38'),
|
||||
(74,259,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-02 15:07:07'),
|
||||
(75,79,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-14 20:31:50'),
|
||||
(76,79,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-14 20:31:57'),
|
||||
(77,79,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-14 20:32:23'),
|
||||
(78,79,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-14 20:32:57'),
|
||||
(79,199,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-14 21:43:13'),
|
||||
(80,199,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-14 21:43:47'),
|
||||
(81,199,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-14 21:44:45'),
|
||||
(82,272,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-14 22:57:10'),
|
||||
(83,272,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-14 22:57:18'),
|
||||
(84,1162,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-21 12:50:53'),
|
||||
(85,1162,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-21 12:51:27'),
|
||||
(86,1162,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-21 12:51:32'),
|
||||
(87,1162,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-21 12:51:54'),
|
||||
(88,1162,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-21 12:52:29'),
|
||||
(89,1162,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-21 12:53:33'),
|
||||
(90,1162,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-21 12:53:37'),
|
||||
(91,1162,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-23 12:27:57'),
|
||||
(92,1162,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-23 12:28:02'),
|
||||
(93,900,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-27 18:59:08'),
|
||||
(94,900,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-27 18:59:16'),
|
||||
(95,900,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-27 18:59:27'),
|
||||
(96,900,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-27 19:00:51'),
|
||||
(97,900,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-27 19:01:18'),
|
||||
(98,900,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-27 19:04:22'),
|
||||
(99,900,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-27 19:04:39'),
|
||||
(100,1087,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-27 19:43:18'),
|
||||
(101,240,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-28 22:00:05'),
|
||||
(102,240,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-28 22:00:35'),
|
||||
(103,240,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-28 22:00:37'),
|
||||
(104,240,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-28 22:00:44'),
|
||||
(105,90,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-29 14:05:59'),
|
||||
(106,90,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-29 14:06:07'),
|
||||
(107,90,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-29 14:06:15'),
|
||||
(108,90,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-04-29 14:07:13'),
|
||||
(109,79,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-05-01 10:18:03'),
|
||||
(110,20,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-05-08 00:25:20'),
|
||||
(111,84,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-05-08 22:34:27'),
|
||||
(112,84,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-05-08 22:35:47'),
|
||||
(113,776,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-05-12 10:24:55'),
|
||||
(114,776,'TransactionSendCoins','create','success','(Leere Message)','(Leere Details)','2021-05-13 13:47:07'),
|
||||
(115,1339,'StateBalancesController','overview','success','(Leere Message)','(Leere Details)','2021-07-13 08:54:30'),
|
||||
(116,1339,'StateBalancesController','overview','success','(Leere Message)','(Leere Details)','2021-07-13 08:54:30'),
|
||||
(117,943,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:46:40'),
|
||||
(118,943,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:05'),
|
||||
(119,943,'StateBalancesController','ajaxGdtOverview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:05'),
|
||||
(120,751,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:20'),
|
||||
(121,943,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:21'),
|
||||
(122,943,'StateBalancesController','ajaxGdtOverview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:21'),
|
||||
(123,751,'StateBalancesController','ajaxGdtOverview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:22'),
|
||||
(124,751,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:22'),
|
||||
(125,11,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:36'),
|
||||
(126,11,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:43'),
|
||||
(127,943,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:43'),
|
||||
(128,11,'StateBalancesController','ajaxGdtOverview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:43'),
|
||||
(129,943,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:46'),
|
||||
(130,943,'StateBalancesController','ajaxGdtOverview','error','server response status code isn\\'t 200','500','2021-08-12 14:47:46'),
|
||||
(131,11,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:48:47'),
|
||||
(132,11,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:48:52'),
|
||||
(133,11,'StateBalancesController','ajaxGdtOverview','error','server response status code isn\\'t 200','500','2021-08-12 14:48:52'),
|
||||
(134,943,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:49:24'),
|
||||
(135,943,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:49:26'),
|
||||
(136,943,'StateBalancesController','ajaxGdtOverview','error','server response status code isn\\'t 200','500','2021-08-12 14:49:26'),
|
||||
(137,751,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:49:58'),
|
||||
(138,751,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:50:00'),
|
||||
(139,751,'StateBalancesController','ajaxGdtOverview','error','server response status code isn\\'t 200','500','2021-08-12 14:50:00'),
|
||||
(140,943,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:50:57'),
|
||||
(141,943,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:51:01'),
|
||||
(142,943,'StateBalancesController','ajaxGdtOverview','error','server response status code isn\\'t 200','500','2021-08-12 14:51:02'),
|
||||
(143,11,'StateBalancesController','ajaxGdtOverview','error','server response status code isn\\'t 200','500','2021-08-12 14:51:10'),
|
||||
(144,11,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:51:10'),
|
||||
(145,11,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:52:39'),
|
||||
(146,943,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:52:44'),
|
||||
(147,82,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:54:25'),
|
||||
(148,284,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-08-12 14:54:35'),
|
||||
(149,1439,'StateBalancesController','overview','success','(Leere Message)','(Leere Details)','2021-09-16 15:44:16'),
|
||||
(150,1439,'StateBalancesController','overview','success','(Leere Message)','(Leere Details)','2021-09-16 15:44:27'),
|
||||
(151,11,'StateBalancesController','overview','error','server response status code isn\\'t 200','500','2021-09-22 11:03:10'),
|
||||
(152,11,'StateBalancesController','ajaxGdtOverview','error','server response status code isn\\'t 200','500','2021-09-22 11:16:33'),
|
||||
(153,82,'StateBalancesController','overview','error','server response status code isn\\'t 200','403','2021-11-23 16:03:57'),
|
||||
(154,82,'StateBalancesController','overview','error','server response status code isn\\'t 200','403','2021-11-23 16:04:10');
|
||||
`)
|
||||
|
||||
await queryFn(`
|
||||
CREATE TABLE \`blockchain_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 DEFAULT NULL,
|
||||
\`symbol\` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`)
|
||||
// NOTE: Static data might be needed as enum definitions
|
||||
await queryFn(`
|
||||
INSERT INTO \`blockchain_types\` VALUES
|
||||
(1,'mysql','use mysql db as blockchain, work only with single community-server',NULL),
|
||||
(2,'hedera','use hedera for transactions','HBAR');
|
||||
`)
|
||||
|
||||
await queryFn(`
|
||||
CREATE TABLE \`community_profiles\` (
|
||||
\`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`state_user_id\` int(10) unsigned NOT NULL,
|
||||
\`profile_img\` longblob DEFAULT NULL,
|
||||
\`profile_desc\` varchar(2000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||
PRIMARY KEY (\`id\`),
|
||||
KEY \`state_user_id\` (\`state_user_id\`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`)
|
||||
// NOTE: The data was removed due to large binary images in the database. If this data is needed please get it from the backup file.
|
||||
|
||||
await queryFn(`
|
||||
CREATE TABLE \`login_email_opt_in_types\` (
|
||||
\`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`name\` varchar(255) NOT NULL,
|
||||
\`description\` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
|
||||
`)
|
||||
// NOTE: Static data might be needed as enum definitions
|
||||
await queryFn(`
|
||||
INSERT INTO \`login_email_opt_in_types\` VALUES
|
||||
(1,'register','Email Verification Code for register from new User.'),
|
||||
(2,'resetPassword','Email Verification Code for reset Password (only if passphrase is known)');
|
||||
`)
|
||||
|
||||
await queryFn(`
|
||||
CREATE TABLE \`login_groups\` (
|
||||
\`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`alias\` varchar(190) NOT NULL,
|
||||
\`name\` varchar(255) NOT NULL,
|
||||
\`url\` varchar(255) NOT NULL,
|
||||
\`host\` varchar(255) DEFAULT '/',
|
||||
\`home\` varchar(255) DEFAULT '/',
|
||||
\`description\` text DEFAULT NULL,
|
||||
PRIMARY KEY (\`id\`),
|
||||
UNIQUE KEY \`alias\` (\`alias\`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
|
||||
`)
|
||||
// NOTE: Static data might be needed as enum definitions
|
||||
await queryFn(`
|
||||
INSERT INTO \`login_groups\` VALUES
|
||||
(1,'gdd1','gdd1','gdd1.gradido.com','','/','gdd1 group');
|
||||
`)
|
||||
|
||||
await queryFn(`
|
||||
CREATE TABLE \`login_roles\` (
|
||||
\`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`name\` varchar(255) NOT NULL,
|
||||
\`description\` varchar(255) NOT NULL,
|
||||
\`flags\` bigint(20) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
|
||||
`)
|
||||
// NOTE: Static data might be needed as enum definitions
|
||||
await queryFn(`
|
||||
INSERT INTO \`login_roles\` VALUES
|
||||
(1,'admin','darf einfach alles',0);
|
||||
`)
|
||||
|
||||
await queryFn(`
|
||||
CREATE TABLE \`login_user_roles\` (
|
||||
\`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`user_id\` int(11) NOT NULL,
|
||||
\`role_id\` int(11) NOT NULL,
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;
|
||||
`)
|
||||
// NOTE: This data is not used - therefore we remove it.
|
||||
// This data is aligned to the `server_users` table except the entry 4,
|
||||
// this one is missing in the other table
|
||||
// and after checking with administration, we figured out that
|
||||
// this is a data fragement no longer needed.
|
||||
await queryFn(`
|
||||
INSERT INTO \`login_user_roles\` VALUES
|
||||
(1,28,1),
|
||||
(2,37,1),
|
||||
(3,50,1),
|
||||
(4,44,1),
|
||||
(5,872,1);
|
||||
`)
|
||||
|
||||
await queryFn(`
|
||||
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 AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`)
|
||||
// NOTE: This data seems not to have any use
|
||||
await queryFn(`
|
||||
INSERT INTO \`operators\` VALUES
|
||||
(5,'einhornimmond',0x78DCFAA8341B3A39B3C5502B4D9ACDBC4B181A10CC0D94187498E0A0C74288E0,'i99a5/wWGmQN4AF8ilUXhHJVV/3At82f6CNNh3ewdVyTTAqugcdeG53DEMNUxCTFwk7KIg==','2019-09-17 13:08:22');
|
||||
`)
|
||||
|
||||
await queryFn(`
|
||||
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 AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`)
|
||||
// NOTE: Static data might be needed as enum definitions
|
||||
await queryFn(`
|
||||
INSERT INTO \`operator_types\` VALUES
|
||||
(1,'hedera','Hedera Keys for sign and pay hedera transactions'),
|
||||
(2,'gradido-user','default gradido user keys'),
|
||||
(3,'gradido-group','default gradido group root keys, other address are derived');
|
||||
`)
|
||||
|
||||
await queryFn(`
|
||||
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 AUTO_INCREMENT=161 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`)
|
||||
// NOTE: This data is no longer generated
|
||||
await queryFn(`
|
||||
INSERT INTO \`state_errors\` VALUES
|
||||
(9,11,1,'2020-08-07 10:40:03','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(17,528,2,'2021-02-10 08:04:32','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"sender 0 hasn\\'t enough GDD"}]}'),
|
||||
(115,82,1,'2021-09-01 11:14:25','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(119,82,1,'2021-09-06 18:55:55','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(138,502,1,'2021-10-31 00:00:32','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(139,502,1,'2021-11-02 19:50:36','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(140,502,1,'2021-11-07 13:32:11','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(141,502,1,'2021-11-16 22:04:59','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(142,502,1,'2021-11-21 23:47:14','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(143,502,1,'2021-11-22 00:14:40','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(144,502,1,'2021-11-25 21:40:15','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(145,502,1,'2021-11-25 22:45:06','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(146,502,1,'2021-11-29 12:52:12','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(147,502,1,'2021-12-04 01:56:10','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(148,502,1,'2021-12-06 13:12:08','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(149,502,1,'2021-12-06 13:18:20','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(150,502,1,'2021-12-16 21:06:34','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(151,502,1,'2021-12-20 23:11:44','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(152,502,1,'2022-01-04 13:19:31','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(153,502,1,'2022-01-04 13:54:33','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(154,502,1,'2022-01-04 13:55:32','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(155,502,1,'2022-01-04 14:02:35','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(156,502,1,'2022-01-04 14:50:49','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(157,502,1,'2022-01-04 14:51:41','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(158,502,1,'2022-01-19 00:32:46','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(159,502,1,'2022-01-19 00:52:42','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}'),
|
||||
(160,502,1,'2022-01-25 08:31:57','{"state":"error","msg":"error validate transaction","details":[{"TransactionCreation::validate":"Creation more than 1.000 GDD per Month for in target_date not allowed"}]}');
|
||||
`)
|
||||
|
||||
await queryFn(`
|
||||
CREATE TABLE \`transaction_types\` (
|
||||
\`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`name\` varchar(90) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
\`text\` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`)
|
||||
// NOTE: Static data might be needed as enum definitions
|
||||
await queryFn(`
|
||||
INSERT INTO \`transaction_types\` 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'),
|
||||
(9,'decay start','signalize the starting point for decay calculation, allowed only once per chain');
|
||||
`)
|
||||
}
|
||||
35
database/migrations/0015-admin_pending_creations.ts
Normal file
35
database/migrations/0015-admin_pending_creations.ts
Normal file
@ -0,0 +1,35 @@
|
||||
/* MIGRATION TO PROPERLY STORE PENDING CREATIONS
|
||||
*
|
||||
* There were two tables for the pending tasks,
|
||||
* since the login_server used some crypto to store its
|
||||
* tasks there. It was easier to create a new table.
|
||||
* This migration drops the old unused table and renames
|
||||
* the new table to properly describe what it does
|
||||
*/
|
||||
|
||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
// drop duplicate table, it was unused
|
||||
await queryFn('DROP TABLE `login_pending_tasks`;')
|
||||
|
||||
// rename the new pending creations table to a proper table name
|
||||
await queryFn('RENAME TABLE `login_pending_tasks_admin` TO `admin_pending_creations`;')
|
||||
}
|
||||
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn('RENAME TABLE `admin_pending_creations` TO `login_pending_tasks_admin`;')
|
||||
await queryFn(`
|
||||
CREATE TABLE \`login_pending_tasks\` (
|
||||
\`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`user_id\` int(10) unsigned DEFAULT 0,
|
||||
\`request\` varbinary(2048) NOT NULL,
|
||||
\`created\` datetime NOT NULL,
|
||||
\`finished\` datetime DEFAULT '2000-01-01 00:00:00',
|
||||
\`result_json\` text DEFAULT NULL,
|
||||
\`param_json\` text DEFAULT NULL,
|
||||
\`task_type_id\` int(10) unsigned NOT NULL,
|
||||
\`child_pending_task_id\` int(10) unsigned DEFAULT 0,
|
||||
\`parent_pending_task_id\` int(10) unsigned DEFAULT 0,
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=795 DEFAULT CHARSET=utf8mb4
|
||||
`)
|
||||
}
|
||||
60
database/migrations/0016-transaction_signatures.ts
Normal file
60
database/migrations/0016-transaction_signatures.ts
Normal file
@ -0,0 +1,60 @@
|
||||
/* MIGRATION TO CLEANUP TRANSACTIONS TABLE
|
||||
*
|
||||
* This migration cleans up the transactions table and
|
||||
* combines its data with transaction_signatures.
|
||||
*/
|
||||
|
||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
// Drop column `state_group_id` since it only contains "0" as value, no variation.
|
||||
// Furthermore it was not present in our model itself (meaning that newly created )
|
||||
await queryFn('ALTER TABLE `transactions` DROP COLUMN `state_group_id`;')
|
||||
|
||||
// Drop column `blockchain_type_id` since it only contains "1" as value, no variation.
|
||||
await queryFn('ALTER TABLE `transactions` DROP COLUMN `blockchain_type_id`;')
|
||||
|
||||
// Create `signature` column - for data from `transaction_signatures` table.
|
||||
await queryFn(
|
||||
'ALTER TABLE `transactions` ADD COLUMN `signature` binary(64) DEFAULT NULL AFTER `received`;',
|
||||
)
|
||||
|
||||
// Create `pubkey` column - for data from `transaction_signatures` table.
|
||||
await queryFn(
|
||||
'ALTER TABLE `transactions` ADD COLUMN `pubkey` binary(32) DEFAULT NULL AFTER `signature`;',
|
||||
)
|
||||
|
||||
// Transfer data from `transaction_signatures` table to `transactions` table
|
||||
await queryFn(`
|
||||
UPDATE transactions
|
||||
INNER JOIN transaction_signatures ON transactions.id = transaction_signatures.transaction_id
|
||||
SET transactions.signature = transaction_signatures.signature, transactions.pubkey = transaction_signatures.pubkey;
|
||||
`)
|
||||
|
||||
// Drop `transaction_signatures` table
|
||||
await queryFn('DROP TABLE `transaction_signatures`;')
|
||||
}
|
||||
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn(`
|
||||
CREATE TABLE \`transaction_signatures\` (
|
||||
\`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`transaction_id\` int(10) unsigned NOT NULL,
|
||||
\`signature\` binary(64) NOT NULL,
|
||||
\`pubkey\` binary(32) NOT NULL,
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
|
||||
`)
|
||||
await queryFn(`
|
||||
INSERT INTO transaction_signatures (transaction_id, signature, pubkey)
|
||||
(SELECT id as transaction_id, signature, pubkey FROM transactions WHERE signature IS NOT NULL and pubkey IS NOT NULL);
|
||||
`)
|
||||
await queryFn('ALTER TABLE `transactions` DROP COLUMN `pubkey`;')
|
||||
await queryFn('ALTER TABLE `transactions` DROP COLUMN `signature`;')
|
||||
await queryFn(
|
||||
'ALTER TABLE `transactions` ADD COLUMN `blockchain_type_id` bigint(20) unsigned NOT NULL DEFAULT 1 AFTER `received` ;',
|
||||
)
|
||||
await queryFn(
|
||||
'ALTER TABLE `transactions` ADD COLUMN `state_group_id` int(10) unsigned DEFAULT NULL AFTER `id`;',
|
||||
)
|
||||
// We have to set the correct values previously in the table , since its not the same as the column's default
|
||||
await queryFn('UPDATE `transactions` SET `state_group_id` = 0;')
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
import Faker from 'faker'
|
||||
import { define } from 'typeorm-seeding'
|
||||
import { LoginUserRoles } from '../../entity/LoginUserRoles'
|
||||
import { LoginUserRolesContext } from '../interface/UserContext'
|
||||
|
||||
define(LoginUserRoles, (faker: typeof Faker, context?: LoginUserRolesContext) => {
|
||||
if (!context) context = {}
|
||||
if (!context.userId) throw new Error('LoginUserRoles: No userId present!')
|
||||
if (!context.roleId) throw new Error('LoginUserRoles: No roleId present!')
|
||||
|
||||
const userRoles = new LoginUserRoles()
|
||||
userRoles.userId = context.userId
|
||||
userRoles.roleId = context.roleId
|
||||
|
||||
return userRoles
|
||||
})
|
||||
@ -1,18 +0,0 @@
|
||||
import Faker from 'faker'
|
||||
import { define } from 'typeorm-seeding'
|
||||
import { TransactionSignature } from '../../entity/TransactionSignature'
|
||||
import { TransactionSignatureContext } from '../interface/TransactionContext'
|
||||
import { randomBytes } from 'crypto'
|
||||
|
||||
define(TransactionSignature, (faker: typeof Faker, context?: TransactionSignatureContext) => {
|
||||
if (!context || !context.transaction) {
|
||||
throw new Error('TransactionSignature: No transaction present!')
|
||||
}
|
||||
|
||||
const transactionSignature = new TransactionSignature()
|
||||
transactionSignature.signature = context.signature ? context.signature : randomBytes(64)
|
||||
transactionSignature.pubkey = context.pubkey ? context.pubkey : randomBytes(32)
|
||||
transactionSignature.transaction = context.transaction
|
||||
|
||||
return transactionSignature
|
||||
})
|
||||
@ -12,7 +12,8 @@ define(Transaction, (faker: typeof Faker, context?: TransactionContext) => {
|
||||
transaction.txHash = context.txHash ? context.txHash : randomBytes(48)
|
||||
transaction.memo = context.memo || context.memo === '' ? context.memo : faker.lorem.sentence()
|
||||
transaction.received = context.received ? context.received : new Date()
|
||||
transaction.blockchainTypeId = context.blockchainTypeId ? context.blockchainTypeId : 1
|
||||
transaction.signature = context.signature ? context.signature : randomBytes(64)
|
||||
transaction.pubkey = context.signaturePubkey ? context.signaturePubkey : randomBytes(32)
|
||||
if (context.transactionSendCoin) transaction.transactionSendCoin = context.transactionSendCoin
|
||||
if (context.transactionCreation) transaction.transactionCreation = context.transactionCreation
|
||||
|
||||
|
||||
@ -9,6 +9,8 @@ export interface TransactionContext {
|
||||
memo?: string
|
||||
received?: Date
|
||||
blockchainTypeId?: number
|
||||
signature?: Buffer
|
||||
signaturePubkey?: Buffer
|
||||
transactionSendCoin?: TransactionSendCoin
|
||||
transactionCreation?: TransactionCreation
|
||||
}
|
||||
@ -43,10 +45,6 @@ export interface UserTransactionContext {
|
||||
transactionTypeId?: number
|
||||
balance?: number
|
||||
balanceDate?: Date
|
||||
}
|
||||
|
||||
export interface TransactionSignatureContext {
|
||||
signature?: Buffer
|
||||
pubkey?: Buffer
|
||||
transaction?: Transaction
|
||||
}
|
||||
|
||||
@ -10,17 +10,14 @@ import {
|
||||
TransactionContext,
|
||||
TransactionCreationContext,
|
||||
UserTransactionContext,
|
||||
TransactionSignatureContext,
|
||||
} from '../../interface/TransactionContext'
|
||||
import { UserInterface } from '../../interface/UserInterface'
|
||||
import { User } from '../../../entity/User'
|
||||
import { LoginUser } from '../../../entity/LoginUser'
|
||||
import { LoginUserBackup } from '../../../entity/LoginUserBackup'
|
||||
import { ServerUser } from '../../../entity/ServerUser'
|
||||
import { LoginUserRoles } from '../../../entity/LoginUserRoles'
|
||||
import { Balance } from '../../../entity/Balance'
|
||||
import { Transaction } from '../../../entity/Transaction'
|
||||
import { TransactionSignature } from '../../../entity/TransactionSignature'
|
||||
import { UserTransaction } from '../../../entity/UserTransaction'
|
||||
import { TransactionCreation } from '../../../entity/TransactionCreation'
|
||||
import { Factory } from 'typeorm-seeding'
|
||||
@ -33,10 +30,6 @@ export const userSeeder = async (factory: Factory, userData: UserInterface): Pro
|
||||
|
||||
if (userData.isAdmin) {
|
||||
await factory(ServerUser)(createServerUserContext(userData)).create()
|
||||
|
||||
// This is crazy: we just need the relation to roleId but no role at all
|
||||
// It works with LoginRoles empty!!
|
||||
await factory(LoginUserRoles)(createLoginUserRolesContext(loginUser)).create()
|
||||
}
|
||||
|
||||
if (userData.addBalance) {
|
||||
@ -51,9 +44,6 @@ export const userSeeder = async (factory: Factory, userData: UserInterface): Pro
|
||||
await factory(UserTransaction)(
|
||||
createUserTransactionContext(userData, user, transaction),
|
||||
).create()
|
||||
await factory(TransactionSignature)(
|
||||
createTransactionSignatureContext(userData, transaction),
|
||||
).create()
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,16 +156,7 @@ const createUserTransactionContext = (
|
||||
transactionTypeId: transaction.transactionTypeId,
|
||||
balance: context.amount,
|
||||
balanceDate: context.recordDate,
|
||||
}
|
||||
}
|
||||
|
||||
const createTransactionSignatureContext = (
|
||||
context: UserInterface,
|
||||
transaction: Transaction,
|
||||
): TransactionSignatureContext => {
|
||||
return {
|
||||
signature: context.signature,
|
||||
pubkey: context.signaturePubkey,
|
||||
transaction,
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,28 +78,6 @@ services:
|
||||
# bind the local folder to the docker to allow live reload
|
||||
- ./database:/app
|
||||
|
||||
#########################################################
|
||||
## LOGIN SERVER #########################################
|
||||
#########################################################
|
||||
login-server:
|
||||
build:
|
||||
dockerfile: Dockerfiles/ubuntu/Dockerfile.debug
|
||||
networks:
|
||||
- external-net
|
||||
- internal-net
|
||||
security_opt:
|
||||
- seccomp:unconfined
|
||||
cap_add:
|
||||
- SYS_PTRACE
|
||||
volumes:
|
||||
- ./logs:/var/log/grd_login
|
||||
- ./login_server/src:/code/src
|
||||
- ./login_server/dependencies:/code/dependencies
|
||||
- ./login_server/scripts:/code/scripts
|
||||
- ./configs/login_server:/etc/grd_login
|
||||
- login_build_ubuntu_3.1:/code/build
|
||||
|
||||
|
||||
#########################################################
|
||||
## COMMUNITY SERVER (cakephp with php-fpm) ##############
|
||||
#########################################################
|
||||
@ -156,4 +134,3 @@ volumes:
|
||||
backend_database_build:
|
||||
database_node_modules:
|
||||
database_build:
|
||||
login_build_ubuntu_3.1:
|
||||
@ -35,28 +35,6 @@ services:
|
||||
volumes:
|
||||
- db_test_vol:/var/lib/mysql
|
||||
|
||||
#########################################################
|
||||
## LOGIN SERVER #########################################
|
||||
#########################################################
|
||||
login-server:
|
||||
build:
|
||||
context: ./login_server/
|
||||
dockerfile: Dockerfiles/ubuntu/Dockerfile.test
|
||||
security_opt:
|
||||
- seccomp:unconfined
|
||||
cap_add:
|
||||
- SYS_PTRACE
|
||||
depends_on:
|
||||
- mariadb
|
||||
networks:
|
||||
- internal-net
|
||||
volumes:
|
||||
- ./logs:/var/log/grd_login
|
||||
- ./login_server/src:/code/src
|
||||
- ./configs/login_server:/etc/grd_login
|
||||
- login_build_cov:/code/build_cov
|
||||
- ./coverage/login:/code/build_cov/coverage_html
|
||||
|
||||
#########################################################
|
||||
## COMMUNITY SERVER (cakephp with php-fpm) ##############
|
||||
#########################################################
|
||||
@ -98,4 +76,3 @@ networks:
|
||||
|
||||
volumes:
|
||||
db_test_vol:
|
||||
login_build_cov:
|
||||
@ -129,26 +129,9 @@ services:
|
||||
#env_file:
|
||||
# - ./frontend/.env
|
||||
|
||||
#########################################################
|
||||
## LOGIN SERVER #########################################
|
||||
#########################################################
|
||||
login-server:
|
||||
build:
|
||||
context: ./login_server/
|
||||
depends_on:
|
||||
- mariadb
|
||||
networks:
|
||||
- internal-net
|
||||
ports:
|
||||
- 1200:1200
|
||||
- 1201:1201
|
||||
volumes:
|
||||
- ./configs/login_server:/etc/grd_login
|
||||
|
||||
#########################################################
|
||||
## NGINX ################################################
|
||||
#########################################################
|
||||
## nginx, connect login-server and community-server together (and php-fpm to community-server)
|
||||
nginx:
|
||||
build:
|
||||
context: ./nginx/
|
||||
|
||||
9
login_server/.gitignore
vendored
9
login_server/.gitignore
vendored
@ -1,9 +0,0 @@
|
||||
src/cpsp/lib*
|
||||
src/cpsp/cpspc
|
||||
src/cpsp/compile_unix.sh
|
||||
src/cpsp/*.h
|
||||
src/cpsp/*.cpp
|
||||
src/cpp/proto/
|
||||
build*/
|
||||
|
||||
src/LOCALE/messages.pot
|
||||
24
login_server/.gitmodules
vendored
24
login_server/.gitmodules
vendored
@ -1,24 +0,0 @@
|
||||
[submodule "dependencies/tinf"]
|
||||
path = dependencies/tinf
|
||||
url = https://github.com/jibsen/tinf.git
|
||||
[submodule "dependencies/mariadb-connector-c"]
|
||||
path = dependencies/mariadb-connector-c
|
||||
url = https://github.com/MariaDB/mariadb-connector-c.git
|
||||
[submodule "src/proto"]
|
||||
path = src/proto
|
||||
url = https://github.com/gradido/gradido_protocol.git
|
||||
[submodule "dependencies/iroha-ed25519"]
|
||||
path = dependencies/iroha-ed25519
|
||||
url = https://github.com/gradido/iroha-ed25519.git
|
||||
[submodule "dependencies/spirit-po"]
|
||||
path = dependencies/spirit-po
|
||||
url = https://github.com/cbeck88/spirit-po.git
|
||||
[submodule "dependencies/grpc"]
|
||||
path = dependencies/grpc
|
||||
url = https://github.com/grpc/grpc.git
|
||||
[submodule "dependencies/poco"]
|
||||
path = dependencies/poco
|
||||
url = https://github.com/pocoproject/poco.git
|
||||
[submodule "dependencies/cmake-modules"]
|
||||
path = dependencies/cmake-modules
|
||||
url = https://github.com/viaduck/cmake-modules.git
|
||||
@ -1,354 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.18.2)
|
||||
project(Gradido_LoginServer C CXX)
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin" )
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "-std=c++17" )
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
IF(WIN32)
|
||||
set(CMAKE_CXX_FLAGS "/MP /EHsc")
|
||||
ENDIF()
|
||||
|
||||
set(INSTALL_BINDIR "bin")
|
||||
set(INSTALL_PLUGINDIR "bin")
|
||||
|
||||
include_directories(
|
||||
"dependencies"
|
||||
"dependencies/tinf/src/"
|
||||
"dependencies/mariadb-connector-c/include"
|
||||
"dependencies/mariadb-connector-c/build/include"
|
||||
"dependencies/spirit-po/include"
|
||||
"dependencies/protobuf/src"
|
||||
"build"
|
||||
"build/proto"
|
||||
"build/http_pages"
|
||||
"src/cpp"
|
||||
)
|
||||
|
||||
IF(UNIX)
|
||||
include_directories(
|
||||
"dependencies/poco/Crypto/include"
|
||||
"dependencies/poco/Data/include"
|
||||
"dependencies/poco/Util/include"
|
||||
"dependencies/poco/Foundation/include"
|
||||
"dependencies/poco/JSON/include"
|
||||
"dependencies/poco/Net/include"
|
||||
"dependencies/poco/NetSSL_OpenSSL/include"
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
############################## find protobuf #########################################
|
||||
add_subdirectory(dependencies/protobuf/cmake)
|
||||
|
||||
############################## parse protobuf files ###################################
|
||||
|
||||
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/proto GRADIDO_PROTO_MODEL_PATH)
|
||||
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build/proto PROTOBINDING_PATH)
|
||||
file(MAKE_DIRECTORY ${PROTOBINDING_PATH})
|
||||
file(MAKE_DIRECTORY ${PROTOBINDING_PATH}/gradido)
|
||||
|
||||
FILE(GLOB DATAMODEL_GRADIDO_PROTOS "${GRADIDO_PROTO_MODEL_PATH}/gradido/*.proto")
|
||||
|
||||
IF(WIN32)
|
||||
set(PROTOC_BIN_PATH "build/dependencies/protobuf/cmake/bin")
|
||||
find_program(PROTOBUF_PROTOC_EXECUTABLE protoc PATHS "${PROTOC_BIN_PATH}/Debug" )
|
||||
find_program(PROTOBUF_PROTOC_EXECUTABLE protoc PATHS "${PROTOC_BIN_PATH}/Release" )
|
||||
ELSE()
|
||||
find_program(PROTOBUF_PROTOC_EXECUTABLE protoc PATHS "build/dependencies/protobuf/cmake/bin" )
|
||||
ENDIF()
|
||||
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/protobuf/src GOOGLE_PROTOBUF_INCLUDES)
|
||||
MESSAGE("protoc: ${PROTOBUF_PROTOC_EXECUTABLE} in build/dependencies/protobuf/bin/${CMAKE_BUILD_TYPE}")
|
||||
FOREACH(proto ${DATAMODEL_GRADIDO_PROTOS})
|
||||
FILE(TO_NATIVE_PATH ${proto} proto_native)
|
||||
get_filename_component(proto_parsed ${proto} NAME_WLE)
|
||||
FILE(TO_NATIVE_PATH ${PROTOBINDING_PATH}/gradido/${proto_parsed}.pb.h proto_parsed_native)
|
||||
|
||||
IF(${proto_native} IS_NEWER_THAN ${proto_parsed_native})
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND
|
||||
${PROTOBUF_PROTOC_EXECUTABLE}
|
||||
--proto_path=${GRADIDO_PROTO_MODEL_PATH}
|
||||
--cpp_out=${PROTOBINDING_PATH}
|
||||
${proto_native}
|
||||
RESULT_VARIABLE rv
|
||||
)
|
||||
# Optional, but that can show the user if something have gone wrong with the proto generation
|
||||
IF(${rv})
|
||||
MESSAGE("Generation of data model returned ${rv} for proto ${proto_native}")
|
||||
ELSE()
|
||||
MESSAGE("Parsed: src/proto/gradido/${proto_parsed}.proto")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
ENDFOREACH(proto)
|
||||
|
||||
|
||||
############################## parse cpsp Files ####################################
|
||||
|
||||
IF(WIN32)
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup()
|
||||
#add_compile_definitions(POCO_NETSSL_WIN)
|
||||
ENDIF()
|
||||
|
||||
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/cpsp GRADIDO_CPSP_PAGE_SRC_PATH)
|
||||
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build/http_pages GRADIDO_HTTP_PAGES_PATH)
|
||||
file(MAKE_DIRECTORY ${GRADIDO_HTTP_PAGES_PATH})
|
||||
|
||||
FILE(GLOB GRADIDO_HTTP_PAGES_SRC "${GRADIDO_CPSP_PAGE_SRC_PATH}/*.cpsp")
|
||||
IF(WIN32)
|
||||
string(REGEX REPLACE "(.*)package/([a-f0-9]*)" "\\1build/\\2/build/bin" POCO_BUILD_BIN "${CONAN_POCO_ROOT}")
|
||||
find_program(POCO_PAGE_COMPILER cpspc.exe PATHS "${CONAN_POCO_ROOT}")
|
||||
find_program(POCO_PAGE_COMPILER cpspc.exe PATHS "${POCO_BUILD_BIN}")
|
||||
ELSE()
|
||||
find_program(POCO_PAGE_COMPILER cpspc PATHS "${CMAKE_CURRENT_SOURCE_DIR}/build/bin")
|
||||
ENDIF()
|
||||
|
||||
MESSAGE("Poco Page Compiler: ${POCO_PAGE_COMPILER}")
|
||||
|
||||
FOREACH(cpsp_file ${GRADIDO_HTTP_PAGES_SRC})
|
||||
FILE(TO_NATIVE_PATH ${cpsp_file} cpsp_file_native)
|
||||
get_filename_component(cpsp_file_parsed ${cpsp_file} NAME_WLE)
|
||||
|
||||
FILE(TO_NATIVE_PATH ${GRADIDO_HTTP_PAGES_PATH}/${cpsp_file_parsed}Page.cpp cpsp_file_parsed_native)
|
||||
|
||||
IF(${cpsp_file_native} IS_NEWER_THAN ${cpsp_file_parsed_native})
|
||||
IF(WIN32)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND
|
||||
${POCO_PAGE_COMPILER}
|
||||
/output-dir=${GRADIDO_HTTP_PAGES_PATH}
|
||||
/header-output-dir=${GRADIDO_HTTP_PAGES_PATH}
|
||||
/noline
|
||||
${cpsp_file_native}
|
||||
RESULT_VARIABLE rv
|
||||
)
|
||||
ELSE()
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND
|
||||
${POCO_PAGE_COMPILER}
|
||||
--output-dir=${GRADIDO_HTTP_PAGES_PATH}
|
||||
--header-output-dir=${GRADIDO_HTTP_PAGES_PATH}
|
||||
--noline
|
||||
${cpsp_file_native}
|
||||
RESULT_VARIABLE rv
|
||||
)
|
||||
ENDIF()
|
||||
# Optional, but that can show the user if something have gone wrong with the proto generation
|
||||
IF(${rv})
|
||||
MESSAGE("Generation of HTTP Page return ${rv} for cpsp ${cpsp_file_native}")
|
||||
ELSE()
|
||||
MESSAGE("Parsed: src/cpsp/${cpsp_file_parsed}.cpsp")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
ENDFOREACH(cpsp_file)
|
||||
|
||||
############################## bind source files ###################################
|
||||
|
||||
FILE(GLOB CONTROLLER "src/cpp/controller/*.cpp" "src/cpp/controller/*.h")
|
||||
FILE(GLOB TINF "dependencies/tinf/src/*.c" "dependencies/tinf/src/*.h")
|
||||
FILE(GLOB HTTPInterface "src/cpp/HTTPInterface/*.h" "src/cpp/HTTPInterface/*.cpp")
|
||||
FILE(GLOB COMPILED_PAGES "build/http_pages/*.h" "build/http_pages/*.cpp")
|
||||
FILE(GLOB JSONInterface "src/cpp/JSONInterface/*.h" "src/cpp/JSONInterface/*.cpp")
|
||||
FILE(GLOB TASKS "src/cpp/tasks/*.cpp" "src/cpp/tasks/*.h")
|
||||
FILE(GLOB SINGLETON_MANAGER "src/cpp/SingletonManager/*.h" "src/cpp/SingletonManager/*.cpp")
|
||||
FILE(GLOB LIB_SRC "src/cpp/lib/*.h" "src/cpp/lib/*.cpp")
|
||||
FILE(GLOB MODEL "src/cpp/model/*.h" "src/cpp/model/*.cpp")
|
||||
FILE(GLOB MODEL_TABLE "src/cpp/model/table/*.h" "src/cpp/model/table/*.cpp")
|
||||
FILE(GLOB MODEL_EMAIL "src/cpp/model/email/*.h" "src/cpp/model/email/*.cpp")
|
||||
FILE(GLOB MODEL_GRADIDO "src/cpp/model/gradido/*.h" "src/cpp/model/gradido/*.cpp")
|
||||
FILE(GLOB CRYPTO "src/cpp/Crypto/*.h" "src/cpp/Crypto/*.cpp")
|
||||
FILE(GLOB MAIN "src/cpp/*.cpp" "src/cpp/*.c" "src/cpp/*.h")
|
||||
FILE(GLOB MYSQL "src/cpp/MySQL/*.cpp" "src/cpp/MySQL/*.h" "src/cpp/MySQL/Poco/*.h")
|
||||
FILE(GLOB PROTO_GRADIDO "build/proto/gradido/*.cc" "build/proto/gradido/*.h")
|
||||
|
||||
# used only for test project
|
||||
FILE(GLOB TEST "src/cpp/test/*.cpp" "src/cpp/test/*.h")
|
||||
FILE(GLOB TEST_CRYPTO "src/cpp/test/crypto/*.cpp" "src/cpp/test/crypto/*.h")
|
||||
FILE(GLOB TEST_MODEL "src/cpp/test/model/*.cpp" "src/cpp/test/model/*.h")
|
||||
FILE(GLOB TEST_MODEL_TABLE "src/cpp/test/model/table/*.cpp" "src/cpp/test/model/table/*.h")
|
||||
FILE(GLOB TEST_CONTROLLER "src/cpp/test/controller/*.cpp" "src/cpp/test/controller/*.h")
|
||||
FILE(GLOB TEST_JSON_INTERFACE "src/cpp/test/JSONInterface/*.cpp" "src/cpp/test/JSONInterface/*.h")
|
||||
|
||||
SET(LOCAL_SRCS
|
||||
${CONTROLLER} ${TINF} ${MAIN} ${HTTPInterface} ${COMPILED_PAGES}
|
||||
${JSONInterface} ${CRYPTO}
|
||||
${MODEL} ${MODEL_TABLE} ${MODEL_EMAIL} ${MODEL_GRADIDO}
|
||||
${SINGLETON_MANAGER} ${LIB_SRC} ${MYSQL} ${TASKS}
|
||||
${PROTO_GRADIDO}
|
||||
)
|
||||
SET(LOCAL_TEST_SRC
|
||||
${TEST} ${TEST_CRYPTO} ${TEST_MODEL} ${TEST_MODEL_TABLE} ${TEST_CONTROLLER} ${TEST_JSON_INTERFACE}
|
||||
)
|
||||
aux_source_directory("src/cpp" LOCAL_SRCS)
|
||||
|
||||
if(MSVC)
|
||||
# src
|
||||
source_group("controller" FILES ${CONTROLLER})
|
||||
source_group("proto\\gradido" FILES ${PROTO_GRADIDO})
|
||||
source_group("tinf" FILES ${TINF})
|
||||
source_group("Crypto" FILES ${CRYPTO})
|
||||
source_group("tasks" FILES ${TASKS})
|
||||
source_group("model\\table" FILES ${MODEL_TABLE})
|
||||
source_group("model\\email" FILES ${MODEL_EMAIL})
|
||||
source_group("model\\gradido" FILES ${MODEL_GRADIDO})
|
||||
source_group("model" FILES ${MODEL})
|
||||
source_group("mysql" FILES ${MYSQL})
|
||||
source_group("SingletonManager" FILES ${SINGLETON_MANAGER})
|
||||
source_group("lib" FILES ${LIB_SRC})
|
||||
source_group("HTTP-Interface\\pages" FILES ${COMPILED_PAGES})
|
||||
source_group("HTTP-Interface" FILES ${HTTPInterface})
|
||||
source_group("Json-Interface" FILES ${JSONInterface})
|
||||
source_group("Test\\crypto" FILES ${TEST_CRYPTO})
|
||||
source_group("Test\\model\\table" FILES ${TEST_MODEL_TABLE})
|
||||
source_group("Test\\model" FILES ${TEST_MODEL})
|
||||
source_group("Test\\controller" FILES ${TEST_CONTROLLER})
|
||||
source_group("Test\\Json-Interface" FILES ${TEST_JSON_INTERFACE})
|
||||
source_group("Test" FILES ${TEST})
|
||||
endif()
|
||||
|
||||
|
||||
add_executable(Gradido_LoginServer ${LOCAL_SRCS})
|
||||
|
||||
############################## config and add mariadb ###################################
|
||||
set(CLIENT_PLUGIN_DIALOG OFF)
|
||||
set(CLIENT_PLUGIN_MYSQL_CLEAR_PASSWORD OFF)
|
||||
set(CLIENT_PLUGIN_REMOTE_IO OFF)
|
||||
IF(WIN32)
|
||||
#set(CLIENT_PLUGIN_caching_sha2_password OFF)
|
||||
set(CLIENT_PLUGIN_CACHING_SHA2_PASSWORD OFF)
|
||||
set(CLIENT_PLUGIN_SHA256_PASSWORD OFF)
|
||||
set(CLIENT_PLUGIN_AUTH_GSSAPI_CLIENT OFF)
|
||||
set(CLIENT_PLUGIN_PVIO_NPIPE STATIC)
|
||||
set(CLIENT_PLUGIN_PVIO_SHMEM STATIC)
|
||||
set(CLIENT_PLUGIN_CLIENT_ED25519 OFF)
|
||||
ELSEIF()
|
||||
set(CLIENT_PLUGIN_client_ed25519 OFF)
|
||||
ENDIF()
|
||||
|
||||
set(WITH_SSL OFF)
|
||||
add_subdirectory("dependencies/mariadb-connector-c")
|
||||
|
||||
set(DEP_PATH "dependencies")
|
||||
set(MARIADB_CONNECTOR_PATH "${DEP_PATH}/mariadb-connector-c/build/libmariadb")
|
||||
|
||||
#if(WIN32)
|
||||
#find_library(MYSQL_LIBRARIES mariadbclient PATHS "${MARIADB_CONNECTOR_PATH}/Release" REQUIRED)
|
||||
#find_library(COMPILED_MARIADB_CLIENT_DEBUG mariadbclient PATHS "${MARIADB_CONNECTOR_PATH}/Debug" REQUIRED)
|
||||
#endif()
|
||||
|
||||
############################## config and add poco ###################################
|
||||
#SET(SOME_EXPAT_OPTION OFF CACHE BOOL "Use some expat option")
|
||||
IF(UNIX)
|
||||
SET(ENABLE_MONGODB OFF CACHE BOOL "" FORCE)
|
||||
SET(ENABLE_DATA_SQLITE OFF CACHE BOOL "" FORCE)
|
||||
SET(ENABLE_REDIS OFF CACHE BOOL "" FORCE)
|
||||
SET(ENABLE_PAGECOMPILER_FILE2PAGE OFF CACHE BOOL "" FORCE)
|
||||
add_subdirectory("dependencies/poco")
|
||||
|
||||
set(POCO_LIBS PocoFoundation PocoUtil PocoNet PocoNetSSL PocoData)
|
||||
ENDIF()
|
||||
|
||||
|
||||
############################## build login server ###################################
|
||||
|
||||
target_link_libraries(Gradido_LoginServer ${GRPC_LIBS})
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(Gradido_LoginServer mariadbclient libprotobuf ${CONAN_LIBS})
|
||||
#TARGET_LINK_LIBRARIES(Gradido_LoginServer optimized ${MYSQL_LIBRARIES} Shlwapi)
|
||||
#TARGET_LINK_LIBRARIES(Gradido_LoginServer debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi)
|
||||
else() # unix
|
||||
target_link_libraries(Gradido_LoginServer ${POCO_LIBS} libmariadb sodium libprotobuf)
|
||||
endif()
|
||||
|
||||
# install
|
||||
if(UNIX)
|
||||
install(TARGETS Gradido_LoginServer RUNTIME DESTINATION /usr/local/bin)
|
||||
#install(LIBRARYS DESTINATION /usr/local/lib)
|
||||
#install(FILES lib/libmariadb /usr/local/lib)
|
||||
install(FILES DESTINATION lib COMPONENT libmariadb)
|
||||
install(DIRECTORY src/LOCALE DESTINATION /etc/grd_login/
|
||||
FILES_MATCHING PATTERN "*.po(t)")
|
||||
|
||||
|
||||
endif(UNIX)
|
||||
|
||||
# ---------------------- Test -----------------------------------------
|
||||
|
||||
enable_testing()
|
||||
|
||||
option(COLLECT_COVERAGE_DATA "Use cov to collect coverage informations" OFF)
|
||||
set(COVERAGE_TOOL "Coverage Tool (gcovr|lcov|fastcov)" CACHE STRING "gcovr")
|
||||
|
||||
if(COLLECT_COVERAGE_DATA)
|
||||
|
||||
include(cmake/CodeCoverage.cmake)
|
||||
append_coverage_compiler_flags()
|
||||
set(EXCLUDE_FOR_HTML_COV
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/build/proto/*"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/dependencies/*"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/test/*"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/googletest/googletest/include/gtest/internal/*"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/googletest/googletest/src/"
|
||||
)
|
||||
if("${COVERAGE_TOOL}" STREQUAL "gcovr")
|
||||
setup_target_for_coverage_gcovr_html(
|
||||
NAME coverage
|
||||
EXECUTABLE Gradido_LoginServer_Test
|
||||
EXCLUDE ${EXCLUDE_FOR_HTML_COV}
|
||||
GCOVR_ADDITIONAL_ARGS "--txt "
|
||||
#DEPENDENCIES lib/libmariadb.so.3
|
||||
)
|
||||
endif()
|
||||
|
||||
set(EXCLUDE_FOR_COV
|
||||
${EXCLUDE_FOR_HTML_COV}
|
||||
"/usr/include/*"
|
||||
)
|
||||
if("${COVERAGE_TOOL}" STREQUAL "lcov")
|
||||
setup_target_for_coverage_lcov(
|
||||
NAME coverage
|
||||
EXECUTABLE Gradido_LoginServer_Test
|
||||
EXCLUDE "${EXCLUDE_FOR_COV}"
|
||||
#DEPENDENCIES lib/libmariadb.so.3
|
||||
)
|
||||
endif()
|
||||
|
||||
if("${COVERAGE_TOOL}" STREQUAL "fastcov")
|
||||
setup_target_for_coverage_fastcov(
|
||||
NAME coverage # New target name
|
||||
EXECUTABLE Gradido_LoginServer_Test -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
|
||||
#BASE_DIRECTORY "../" # Base directory for report
|
||||
# (defaults to PROJECT_SOURCE_DIR)
|
||||
EXCLUDE "${EXCLUDE_FOR_COV}" # Patterns to exclude.
|
||||
NO_DEMANGLE # Don't demangle C++ symbols
|
||||
# even if c++filt is found
|
||||
SKIP_HTML # Don't create html report
|
||||
)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
project(Gradido_LoginServer_Test C CXX)
|
||||
#_TEST_BUILD
|
||||
#find_package(GTest CONFIG REQUIRED)
|
||||
#add_subdirectory("dependencies/protobuf/third_party/googletest")
|
||||
|
||||
add_executable(Gradido_LoginServer_Test ${LOCAL_SRCS} ${LOCAL_TEST_SRC})
|
||||
target_compile_definitions(Gradido_LoginServer_Test PUBLIC "_TEST_BUILD")
|
||||
|
||||
target_link_libraries(Gradido_LoginServer_Test ${GRPC_LIBS} )
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(Gradido_LoginServer_Test ${CONAN_LIBS} libmariadb libprotobuf)
|
||||
#TARGET_LINK_LIBRARIES(Gradido_LoginServer_Test optimized ${MYSQL_LIBRARIES} Shlwapi)
|
||||
#TARGET_LINK_LIBRARIES(Gradido_LoginServer_Test debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi)
|
||||
#TARGET_LINK_LIBRARIES(Gradido_LoginServer_Test debug ${GRPC_LIBS} ${PROTOBUF_DEBUG_LIBS})
|
||||
else()
|
||||
target_link_libraries(Gradido_LoginServer_Test ${POCO_LIBS} libmariadb sodium gtest)
|
||||
endif()
|
||||
|
||||
add_test(NAME main COMMAND Gradido_LoginServer_Test)
|
||||
@ -1,255 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.18.2)
|
||||
project(Gradido_LoginServer C CXX)
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin" )
|
||||
|
||||
SET ( CMAKE_CXX_FLAGS "-std=c++17" )
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_CXX_FLAGS "/MP /EHsc")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
||||
else()
|
||||
set(INSTALL_BINDIR "bin")
|
||||
set(INSTALL_PLUGINDIR "bin")
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
"dependencies"
|
||||
"dependencies/tinf/src"
|
||||
"dependencies/spirit-po/include"
|
||||
"/usr/local/include/mariadb"
|
||||
"build"
|
||||
"build/proto"
|
||||
"build/http_pages"
|
||||
"src/cpp"
|
||||
)
|
||||
|
||||
############################## config and add grpc ###################################
|
||||
find_package(Protobuf REQUIRED)
|
||||
include_directories(${Protobuf_INCLUDE_DIRS})
|
||||
|
||||
set(PROTOBUF_LIBS protobuf::libprotobuf protobuf::libprotobuf-lite protobuf::libprotoc)
|
||||
|
||||
############################## parse proto files ###################################
|
||||
|
||||
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/proto GRADIDO_PROTO_MODEL_PATH)
|
||||
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build/proto PROTOBINDING_PATH)
|
||||
file(MAKE_DIRECTORY ${PROTOBINDING_PATH})
|
||||
file(MAKE_DIRECTORY ${PROTOBINDING_PATH}/gradido)
|
||||
|
||||
FILE(GLOB DATAMODEL_GRADIDO_PROTOS "${GRADIDO_PROTO_MODEL_PATH}/gradido/*.proto")
|
||||
|
||||
FOREACH(proto ${DATAMODEL_GRADIDO_PROTOS})
|
||||
FILE(TO_NATIVE_PATH ${proto} proto_native)
|
||||
get_filename_component(proto_parsed ${proto} NAME_WLE)
|
||||
FILE(TO_NATIVE_PATH ${PROTOBINDING_PATH}/gradido/${proto_parsed}.pb.h proto_parsed_native)
|
||||
|
||||
IF(${proto_native} IS_NEWER_THAN ${proto_parsed_native})
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND
|
||||
${PROTOBUF_PROTOC_EXECUTABLE}
|
||||
--proto_path=${GRADIDO_PROTO_MODEL_PATH}
|
||||
--cpp_out=${PROTOBINDING_PATH}
|
||||
${proto_native}
|
||||
RESULT_VARIABLE rv
|
||||
)
|
||||
# Optional, but that can show the user if something have gone wrong with the proto generation
|
||||
IF(${rv})
|
||||
MESSAGE("Generation of data model returned ${rv} for proto ${proto_native}")
|
||||
ELSE()
|
||||
MESSAGE("Parsed: src/proto/gradido/${proto_parsed}.proto")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
ENDFOREACH(proto)
|
||||
|
||||
############################## parse cpsp Files ####################################
|
||||
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/cpsp GRADIDO_CPSP_PAGE_SRC_PATH)
|
||||
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build/http_pages GRADIDO_HTTP_PAGES_PATH)
|
||||
file(MAKE_DIRECTORY ${GRADIDO_HTTP_PAGES_PATH})
|
||||
|
||||
FILE(GLOB GRADIDO_HTTP_PAGES_SRC "${GRADIDO_CPSP_PAGE_SRC_PATH}/*.cpsp")
|
||||
|
||||
find_program(POCO_PAGE_COMPILER cpspc)
|
||||
|
||||
MESSAGE("Poco Page Compiler: ${POCO_PAGE_COMPILER}")
|
||||
|
||||
FOREACH(cpsp_file ${GRADIDO_HTTP_PAGES_SRC})
|
||||
FILE(TO_NATIVE_PATH ${cpsp_file} cpsp_file_native)
|
||||
get_filename_component(cpsp_file_parsed ${cpsp_file} NAME_WLE)
|
||||
|
||||
FILE(TO_NATIVE_PATH ${GRADIDO_HTTP_PAGES_PATH}/${cpsp_file_parsed}Page.cpp cpsp_file_parsed_native)
|
||||
|
||||
IF(${cpsp_file_native} IS_NEWER_THAN ${cpsp_file_parsed_native})
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND
|
||||
${POCO_PAGE_COMPILER}
|
||||
--output-dir=${GRADIDO_HTTP_PAGES_PATH}
|
||||
--header-output-dir=${GRADIDO_HTTP_PAGES_PATH}
|
||||
--noline
|
||||
${cpsp_file_native}
|
||||
RESULT_VARIABLE rv
|
||||
)
|
||||
# Optional, but that can show the user if something have gone wrong with the proto generation
|
||||
IF(${rv})
|
||||
MESSAGE("Generation of HTTP Page return ${rv} for cpsp ${cpsp_file_native}")
|
||||
ELSE()
|
||||
MESSAGE("Parsed: src/cpsp/${cpsp_file_parsed}.cpsp")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
ENDFOREACH(cpsp_file)
|
||||
|
||||
############################## include src files ###################################
|
||||
#set(MYSQL_INCLUDE_DIR "dependencies/mariadb-connector-c/include")
|
||||
|
||||
FILE(GLOB CONTROLLER "src/cpp/controller/*.cpp" "src/cpp/controller/*.h")
|
||||
FILE(GLOB TINF "dependencies/tinf/src/*.c" "dependencies/tinf/src/*.h")
|
||||
FILE(GLOB HTTPInterface "src/cpp/HTTPInterface/*.h" "src/cpp/HTTPInterface/*.cpp")
|
||||
FILE(GLOB COMPILED_PAGES "build/http_pages/*.h" "build/http_pages/*.cpp")
|
||||
FILE(GLOB JSONInterface "src/cpp/JSONInterface/*.h" "src/cpp/JSONInterface/*.cpp")
|
||||
FILE(GLOB TASKS "src/cpp/tasks/*.cpp" "src/cpp/tasks/*.h")
|
||||
FILE(GLOB SINGLETON_MANAGER "src/cpp/SingletonManager/*.h" "src/cpp/SingletonManager/*.cpp")
|
||||
FILE(GLOB LIB_SRC "src/cpp/lib/*.h" "src/cpp/lib/*.cpp")
|
||||
FILE(GLOB MODEL "src/cpp/model/*.h" "src/cpp/model/*.cpp")
|
||||
FILE(GLOB MODEL_TABLE "src/cpp/model/table/*.h" "src/cpp/model/table/*.cpp")
|
||||
FILE(GLOB MODEL_EMAIL "src/cpp/model/email/*.h" "src/cpp/model/email/*.cpp")
|
||||
FILE(GLOB MODEL_HEDERA "src/cpp/model/hedera/*.h" "src/cpp/model/hedera/*.cpp")
|
||||
FILE(GLOB MODEL_GRADIDO "src/cpp/model/gradido/*.h" "src/cpp/model/gradido/*.cpp")
|
||||
FILE(GLOB CRYPTO "src/cpp/Crypto/*.h" "src/cpp/Crypto/*.cpp")
|
||||
FILE(GLOB MAIN "src/cpp/*.cpp" "src/cpp/*.c" "src/cpp/*.h")
|
||||
FILE(GLOB MYSQL "src/cpp/MySQL/*.cpp" "src/cpp/MySQL/*.h" "src/cpp/MySQL/Poco/*.h")
|
||||
FILE(GLOB PROTO_GRADIDO "${PROTOBINDING_PATH}/gradido/*.cc" "${PROTOBINDING_PATH}/gradido/*.h")
|
||||
|
||||
# used only for test project
|
||||
FILE(GLOB TEST "src/cpp/test/*.cpp" "src/cpp/test/*.h")
|
||||
FILE(GLOB TEST_CRYPTO "src/cpp/test/crypto/*.cpp" "src/cpp/test/crypto/*.h")
|
||||
FILE(GLOB TEST_MODEL "src/cpp/test/model/*.cpp" "src/cpp/test/model/*.h")
|
||||
FILE(GLOB TEST_MODEL_TABLE "src/cpp/test/model/table/*.cpp" "src/cpp/test/model/table/*.h")
|
||||
FILE(GLOB TEST_CONTROLLER "src/cpp/test/controller/*.cpp" "src/cpp/test/controller/*.h")
|
||||
FILE(GLOB TEST_JSON_INTERFACE "src/cpp/test/JSONInterface/*.cpp" "src/cpp/test/JSONInterface/*.h")
|
||||
|
||||
SET(LOCAL_SRCS
|
||||
${CONTROLLER} ${TINF} ${MAIN} ${HTTPInterface} ${COMPILED_PAGES}
|
||||
${JSONInterface} ${CRYPTO}
|
||||
${MODEL} ${MODEL_TABLE} ${MODEL_EMAIL} ${MODEL_HEDERA} ${MODEL_GRADIDO}
|
||||
${SINGLETON_MANAGER} ${LIB_SRC} ${MYSQL} ${TASKS}
|
||||
${PROTO_GRADIDO} ${PROTO_HEDERA}
|
||||
)
|
||||
SET(LOCAL_TEST_SRC
|
||||
${TEST} ${TEST_CRYPTO} ${TEST_MODEL} ${TEST_MODEL_TABLE} ${TEST_CONTROLLER} ${TEST_JSON_INTERFACE}
|
||||
)
|
||||
aux_source_directory("src/cpp" LOCAL_SRCS)
|
||||
|
||||
add_executable(Gradido_LoginServer ${LOCAL_SRCS})
|
||||
|
||||
############################## find mariadb ###################################
|
||||
find_library(MYSQL_LIBRARIES mariadb PATHS "/usr/local/lib/mariadb" REQUIRED)
|
||||
############################## config and add poco ###################################
|
||||
set(BUILD_LIB_PATH "(/usr/local/lib")
|
||||
|
||||
IF(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
find_library(POCO_FOUNDATION_LIB PocoFoundationd PATHS ${BUILD_LIB_PATH} REQUIRED)
|
||||
find_library(POCO_UTIL_LIB PocoUtild PATHS ${BUILD_LIB_PATH} REQUIRED)
|
||||
find_library(POCO_NET_SSL_LIB PocoNetSSLd PATHS ${BUILD_LIB_PATH} REQUIRED)
|
||||
find_library(POCO_DATA_LIB PocoDatad PATHS ${BUILD_LIB_PATH} REQUIRED)
|
||||
find_library(POCO_JSON_LIB PocoJSONd PATHS ${BUILD_LIB_PATH} REQUIRED)
|
||||
find_library(POCO_NET_LIB PocoNetd PATHS ${BUILD_LIB_PATH} REQUIRED)
|
||||
message("use Poco Debug libs")
|
||||
ELSE()
|
||||
find_library(POCO_FOUNDATION_LIB PocoFoundation PATHS ${BUILD_LIB_PATH} REQUIRED)
|
||||
find_library(POCO_UTIL_LIB PocoUtil PATHS ${BUILD_LIB_PATH} REQUIRED)
|
||||
find_library(POCO_NET_SSL_LIB PocoNetSSL PATHS ${BUILD_LIB_PATH} REQUIRED)
|
||||
find_library(POCO_DATA_LIB PocoData PATHS ${BUILD_LIB_PATH} REQUIRED)
|
||||
find_library(POCO_JSON_LIB PocoJSON PATHS ${BUILD_LIB_PATH} REQUIRED)
|
||||
find_library(POCO_NET_LIB PocoNet PATHS ${BUILD_LIB_PATH} REQUIRED)
|
||||
message("use Poco Release libs")
|
||||
ENDIF()
|
||||
|
||||
set(POCO_LIBS ${POCO_FOUNDATION_LIB} ${POCO_UTIL_LIB} ${POCO_NET_SSL_LIB} ${POCO_DATA_LIB} ${POCO_JSON_LIB} ${POCO_NET_LIB})
|
||||
|
||||
|
||||
############################## build login server ###################################
|
||||
|
||||
target_link_libraries(Gradido_LoginServer ${PROTOBUF_LIBS} ${MYSQL_LIBRARIES} ${POCO_LIBS} sodium pthread)
|
||||
|
||||
############################## build login server test ###################################
|
||||
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
project(Gradido_LoginServer_Test C CXX)
|
||||
|
||||
enable_testing()
|
||||
|
||||
option(COLLECT_COVERAGE_DATA "Use cov to collect coverage informations" OFF)
|
||||
set(COVERAGE_TOOL "Coverage Tool (gcovr|lcov|fastcov)" CACHE STRING "gcovr")
|
||||
|
||||
|
||||
if(COLLECT_COVERAGE_DATA)
|
||||
|
||||
include(cmake/CodeCoverage.cmake)
|
||||
append_coverage_compiler_flags()
|
||||
set(EXCLUDE_FOR_HTML_COV
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/build/proto/*"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/dependencies/*"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/test/*"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/googletest/googletest/include/gtest/internal/*"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/googletest/googletest/src/"
|
||||
)
|
||||
if("${COVERAGE_TOOL}" STREQUAL "gcovr")
|
||||
setup_target_for_coverage_gcovr_html(
|
||||
NAME coverage
|
||||
EXECUTABLE Gradido_LoginServer_Test
|
||||
EXCLUDE ${EXCLUDE_FOR_HTML_COV}
|
||||
GCOVR_ADDITIONAL_ARGS "--txt "
|
||||
#DEPENDENCIES lib/libmariadb.so.3
|
||||
)
|
||||
endif()
|
||||
|
||||
set(EXCLUDE_FOR_COV
|
||||
${EXCLUDE_FOR_HTML_COV}
|
||||
"/usr/include/*"
|
||||
)
|
||||
if("${COVERAGE_TOOL}" STREQUAL "lcov")
|
||||
setup_target_for_coverage_lcov(
|
||||
NAME coverage
|
||||
EXECUTABLE Gradido_LoginServer_Test
|
||||
EXCLUDE "${EXCLUDE_FOR_COV}"
|
||||
#DEPENDENCIES lib/libmariadb.so.3
|
||||
)
|
||||
endif()
|
||||
|
||||
if("${COVERAGE_TOOL}" STREQUAL "fastcov")
|
||||
setup_target_for_coverage_fastcov(
|
||||
NAME coverage # New target name
|
||||
EXECUTABLE Gradido_LoginServer_Test -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
|
||||
#BASE_DIRECTORY "coverage" # Base directory for report
|
||||
# (defaults to PROJECT_SOURCE_DIR)
|
||||
EXCLUDE "${EXCLUDE_FOR_COV}" # Patterns to exclude.
|
||||
NO_DEMANGLE # Don't demangle C++ symbols
|
||||
# even if c++filt is found
|
||||
SKIP_HTML # Don't create html report
|
||||
)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
#_TEST_BUILD
|
||||
|
||||
add_subdirectory("googletest")
|
||||
|
||||
add_executable(Gradido_LoginServer_Test ${LOCAL_SRCS} ${LOCAL_TEST_SRC})
|
||||
target_compile_definitions(Gradido_LoginServer_Test PUBLIC "_TEST_BUILD")
|
||||
|
||||
target_link_libraries(Gradido_LoginServer_Test ${GRPC_LIBS} )
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(Gradido_LoginServer_Test ${CONAN_LIBS} )
|
||||
#TARGET_LINK_LIBRARIES(Gradido_LoginServer_Test optimized ${MYSQL_LIBRARIES} Shlwapi)
|
||||
#TARGET_LINK_LIBRARIES(Gradido_LoginServer_Test debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi)
|
||||
#TARGET_LINK_LIBRARIES(Gradido_LoginServer_Test debug ${GRPC_LIBS} ${PROTOBUF_DEBUG_LIBS})
|
||||
else()
|
||||
target_link_libraries(Gradido_LoginServer_Test ${PROTOBUF_LIBS} ${MYSQL_LIBRARIES} ${POCO_LIBS} sodium pthread gtest)
|
||||
endif()
|
||||
|
||||
add_test(NAME main COMMAND Gradido_LoginServer_Test)
|
||||
ENDIF()
|
||||
@ -1,49 +0,0 @@
|
||||
|
||||
#########################################################################################################
|
||||
# Build release
|
||||
#########################################################################################################
|
||||
FROM gradido/login_dependencies:alpine-release-3 as release
|
||||
|
||||
ENV DOCKER_WORKDIR="/code"
|
||||
WORKDIR ${DOCKER_WORKDIR}
|
||||
|
||||
COPY ./CMakeLists.txt.lib ./CMakeLists.txt
|
||||
COPY ./src ./src
|
||||
RUN ln -s /usr/local/googletest ./googletest
|
||||
COPY ./dependencies/cmake-modules ./dependencies/cmake-modules
|
||||
COPY ./dependencies/spirit-po ./dependencies/spirit-po
|
||||
COPY ./dependencies/tinf ./dependencies/tinf
|
||||
COPY ./scripts ./scripts
|
||||
|
||||
RUN mkdir build && \
|
||||
cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release .. && \
|
||||
make -j$(nproc) Gradido_LoginServer
|
||||
|
||||
RUN cd scripts && \
|
||||
chmod +x compile_pot.sh && \
|
||||
./compile_pot.sh
|
||||
|
||||
|
||||
#########################################################################################################
|
||||
# run release
|
||||
#########################################################################################################
|
||||
#From alpine:latest as login_server
|
||||
FROM alpine:3.13.5 as login_server
|
||||
|
||||
USER root
|
||||
WORKDIR "/usr/bin"
|
||||
|
||||
COPY --from=release /code/build/bin/Gradido_LoginServer /usr/bin/
|
||||
|
||||
COPY --from=release /usr/local/lib/mariadb/libmariadb.so.3 /usr/local/lib/
|
||||
COPY --from=release /usr/local/lib/libPoco* /usr/local/lib/
|
||||
COPY --from=release /usr/local/lib/libproto* /usr/local/lib/
|
||||
COPY --from=release /usr/lib/libsodium.so.23 /usr/lib/
|
||||
COPY --from=release /usr/lib/libstdc++.so.6 /usr/lib/
|
||||
COPY --from=release /usr/lib/libgcc_s.so.1 /usr/lib/
|
||||
|
||||
|
||||
RUN chmod +x /usr/bin/Gradido_LoginServer
|
||||
ENTRYPOINT ["/usr/bin/Gradido_LoginServer"]
|
||||
#CMD Gradido_LoginServer
|
||||
@ -1,16 +0,0 @@
|
||||
FROM gradido/login_dependencies:alpine-debug-3 as login_server_alpine_debug
|
||||
|
||||
ENV DOCKER_WORKDIR="/code"
|
||||
|
||||
|
||||
EXPOSE 1200
|
||||
EXPOSE 1201
|
||||
WORKDIR ${DOCKER_WORKDIR}
|
||||
|
||||
COPY ./CMakeLists.txt.lib ./CMakeLists.txt
|
||||
COPY ./scripts ./scripts
|
||||
COPY ./cmake ./cmake
|
||||
RUN ln -s /usr/local/googletest ./googletest
|
||||
|
||||
CMD cd scripts; ./build_debug.sh; cd ..; ./build/bin/Gradido_LoginServer
|
||||
|
||||
@ -1,95 +0,0 @@
|
||||
# Login-Server Build dependencies for alpine
|
||||
# Uploaded to hub.docker.com with the tag:
|
||||
# gradido/login_dependencies:alpine-debug-3 for debug build
|
||||
# and
|
||||
# gradido/login_dependencies:alpine-release-3 for release build
|
||||
# Update tag when dependencies are added or removed
|
||||
|
||||
# Control Build Type with ARG BUILD_TYPE
|
||||
# Valid values do you find here: https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
|
||||
# Default is set to Debug
|
||||
|
||||
|
||||
##### BUILD-ENV #####
|
||||
FROM alpine:3.13.5 as alpine-build
|
||||
|
||||
RUN apk add --update --no-cache icu-dev
|
||||
RUN apk add --no-cache git openssl-dev make gcc musl-dev g++ linux-headers libintl gettext-dev boost-dev libsodium-dev
|
||||
|
||||
|
||||
##### CMAKE #####
|
||||
FROM alpine-build as alpine-gxx-cmake
|
||||
|
||||
RUN git clone https://github.com/Kitware/CMake.git --branch=v3.19.8 && \
|
||||
cd CMake && \
|
||||
./bootstrap --parallel=$(nproc) && \
|
||||
make -j$(nproc) && \
|
||||
make install
|
||||
|
||||
######### BUILD grpc ##############
|
||||
FROM alpine-gxx-cmake as alpine-gxx-protobuf
|
||||
|
||||
ARG BUILD_TYPE=Debug
|
||||
|
||||
RUN apk add --no-cache autoconf automake libtool curl unzip
|
||||
|
||||
RUN git clone https://github.com/protocolbuffers/protobuf.git --recursive -j4 && \
|
||||
cd protobuf && \
|
||||
./autogen.sh && \
|
||||
./configure && \
|
||||
make -j$(nproc) && \
|
||||
make install
|
||||
|
||||
# protobuf libs missing after make install
|
||||
#RUN cp grpc/build/third_party/protobuf/*.a /usr/local/lib/
|
||||
|
||||
######### BUILD poco ##############
|
||||
FROM alpine-gxx-cmake as alpine-gxx-poco
|
||||
|
||||
ARG BUILD_TYPE=Debug
|
||||
|
||||
RUN git clone https://github.com/pocoproject/poco.git --recursive && \
|
||||
cd poco && \
|
||||
git checkout poco-1.9.4-release && \
|
||||
mkdir cmake-build && cd cmake-build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && make -j$(nproc) && \
|
||||
make install
|
||||
|
||||
######### BUILD mariadb ###########
|
||||
FROM alpine-gxx-cmake as alpine-gxx-mariadb-connector
|
||||
|
||||
ARG BUILD_TYPE=Debug
|
||||
|
||||
RUN git clone https://github.com/mariadb-corporation/mariadb-connector-c.git && \
|
||||
cd mariadb-connector-c && \
|
||||
git checkout 159540f && \
|
||||
mkdir build && cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && make -j$(nproc) && \
|
||||
make install
|
||||
|
||||
#########################################################################################################
|
||||
# builded libs and binaries
|
||||
#########################################################################################################
|
||||
FROM alpine-build as alpine-libs
|
||||
|
||||
# copy CMake from cmake stage
|
||||
COPY --from=alpine-gxx-cmake /usr/local/bin/cmake /usr/local/bin/cmake
|
||||
COPY --from=alpine-gxx-cmake /usr/local/share/cmake-3.19/Modules /usr/local/share/cmake-3.19/Modules
|
||||
COPY --from=alpine-gxx-cmake /usr/local/share/cmake-3.19/Templates /usr/local/share/cmake-3.19/Templates
|
||||
|
||||
# copy from grpc
|
||||
COPY --from=alpine-gxx-protobuf /usr/local /usr/local
|
||||
|
||||
# COPY from poco
|
||||
COPY --from=alpine-gxx-poco /usr/local /usr/local
|
||||
|
||||
# COPY from mariadb
|
||||
COPY --from=alpine-gxx-mariadb-connector /usr/local /usr/local
|
||||
|
||||
#########################################################################################################
|
||||
# COPY Things only needed for testing
|
||||
#########################################################################################################
|
||||
FROM alpine-libs as alpine-libs-test
|
||||
|
||||
COPY --from=alpine-gxx-protobuf /protobuf/third_party/googletest /usr/local/googletest
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
|
||||
#########################################################################################################
|
||||
# Build release
|
||||
#########################################################################################################
|
||||
FROM gradido/login_dependencies:alpine-release-3 as release
|
||||
|
||||
ENV DOCKER_WORKDIR="/code"
|
||||
WORKDIR ${DOCKER_WORKDIR}
|
||||
|
||||
COPY ./CMakeLists.txt.lib ./CMakeLists.txt
|
||||
COPY ./src ./src
|
||||
RUN ln -s /usr/local/googletest ./googletest
|
||||
COPY ./dependencies/cmake-modules ./dependencies/cmake-modules
|
||||
COPY ./dependencies/spirit-po ./dependencies/spirit-po
|
||||
COPY ./dependencies/tinf ./dependencies/tinf
|
||||
COPY ./scripts ./scripts
|
||||
|
||||
RUN mkdir build && \
|
||||
cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release .. && \
|
||||
make -j$(nproc) Gradido_LoginServer
|
||||
|
||||
RUN cd scripts && \
|
||||
chmod +x compile_pot.sh && \
|
||||
./compile_pot.sh
|
||||
|
||||
|
||||
#########################################################################################################
|
||||
# run release
|
||||
#########################################################################################################
|
||||
#From alpine:latest as login_server
|
||||
FROM alpine:3.13.5 as login_server
|
||||
|
||||
USER root
|
||||
WORKDIR "/usr/bin"
|
||||
|
||||
COPY --from=release /code/build/bin/Gradido_LoginServer /usr/bin/
|
||||
|
||||
COPY --from=release /usr/local/lib/mariadb/libmariadb.so.3 /usr/local/lib/
|
||||
COPY --from=release /usr/local/lib/libPoco* /usr/local/lib/
|
||||
COPY --from=release /usr/local/lib/libproto* /usr/local/lib/
|
||||
COPY --from=release /usr/lib/libsodium.so.23 /usr/lib/
|
||||
COPY --from=release /usr/lib/libstdc++.so.6 /usr/lib/
|
||||
COPY --from=release /usr/lib/libgcc_s.so.1 /usr/lib/
|
||||
|
||||
|
||||
RUN chmod +x /usr/bin/Gradido_LoginServer
|
||||
ENTRYPOINT ["/usr/bin/Gradido_LoginServer"]
|
||||
#CMD Gradido_LoginServer
|
||||
@ -1,63 +0,0 @@
|
||||
|
||||
|
||||
# Login Server build which contain the config file, found on docker hub with tag:
|
||||
# gradido/login_server:with-config
|
||||
# Used for community-server tests on staging
|
||||
|
||||
#########################################################################################################
|
||||
# Build release
|
||||
#########################################################################################################
|
||||
FROM gradido/login_dependencies:alpine-release-3 as release_default
|
||||
|
||||
ENV DOCKER_WORKDIR="/code"
|
||||
WORKDIR ${DOCKER_WORKDIR}
|
||||
|
||||
COPY ./login_server/CMakeLists.txt.lib ./CMakeLists.txt
|
||||
COPY ./login_server/src ./src
|
||||
COPY ./login_server/dependencies/cmake-modules ./dependencies/cmake-modules
|
||||
COPY ./login_server/dependencies/spirit-po ./dependencies/spirit-po
|
||||
COPY ./login_server/dependencies/tinf ./dependencies/tinf
|
||||
COPY ./login_server/scripts ./scripts
|
||||
|
||||
RUN mkdir build && \
|
||||
cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release .. && \
|
||||
make -j$(nproc) Gradido_LoginServer
|
||||
|
||||
RUN cd scripts && \
|
||||
chmod +x compile_pot.sh && \
|
||||
./compile_pot.sh
|
||||
|
||||
|
||||
#########################################################################################################
|
||||
# run release with docker default config
|
||||
#########################################################################################################
|
||||
#From alpine:latest as login_server
|
||||
FROM alpine:3.13.5 as login_server_default
|
||||
|
||||
USER root
|
||||
WORKDIR "/usr/bin"
|
||||
|
||||
COPY --from=release_default /code/build/bin/Gradido_LoginServer /usr/bin/
|
||||
|
||||
COPY --from=release_default /usr/local/lib/mariadb/libmariadb.so.3 /usr/local/lib/
|
||||
COPY --from=release_default /usr/local/lib/libPoco* /usr/local/lib/
|
||||
COPY --from=release_default /usr/lib/libsodium.so.23 /usr/lib/
|
||||
COPY --from=release_default /usr/lib/libstdc++.so.6 /usr/lib/
|
||||
COPY --from=release_default /usr/lib/libgcc_s.so.1 /usr/lib/
|
||||
|
||||
COPY ./configs/login_server/grd_login.properties /etc/grd_login/
|
||||
COPY ./configs/login_server/cacert.pem /etc/grd_login/
|
||||
COPY ./configs/login_server/LOCALE /etc/grd_login/
|
||||
|
||||
EXPOSE 1200
|
||||
EXPOSE 1201
|
||||
|
||||
RUN chmod +x /usr/bin/Gradido_LoginServer
|
||||
ENTRYPOINT ["/usr/bin/Gradido_LoginServer"]
|
||||
#CMD Gradido_LoginServer
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
|
||||
#########################################################################################################
|
||||
# Prepare debug
|
||||
#########################################################################################################
|
||||
FROM gradido/login_dependencies:gcc9-debug-3 as prepare_debug
|
||||
|
||||
ENV DOCKER_WORKDIR="/code"
|
||||
WORKDIR ${DOCKER_WORKDIR}
|
||||
|
||||
RUN echo '/usr/local/lib' >> /etc/ld.so.conf && ldconfig
|
||||
|
||||
COPY ./CMakeLists.txt.lib ./CMakeLists.txt
|
||||
RUN ln -s /usr/local/googletest ./googletest
|
||||
COPY ./src ./src
|
||||
COPY ./dependencies/cmake-modules ./dependencies/cmake-modules
|
||||
COPY ./dependencies/spirit-po ./dependencies/spirit-po
|
||||
COPY ./dependencies/tinf ./dependencies/tinf
|
||||
COPY ./scripts ./scripts
|
||||
|
||||
|
||||
#########################################################################################################
|
||||
# Build debug
|
||||
#########################################################################################################
|
||||
FROM prepare_debug as debug
|
||||
|
||||
ENV DOCKER_WORKDIR="/code"
|
||||
WORKDIR ${DOCKER_WORKDIR}
|
||||
|
||||
RUN mkdir build && \
|
||||
cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||
|
||||
RUN cd scripts && \
|
||||
chmod +x compile_pot.sh && \
|
||||
./compile_pot.sh
|
||||
|
||||
CMD cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug && make -j$(nproc) Gradido_LoginServer && ./bin/Gradido_LoginServer
|
||||
|
||||
@ -1,93 +0,0 @@
|
||||
# Login-Server Build dependencies for ubuntu
|
||||
# Uploaded to hub.docker.com with the tag:
|
||||
# gradido/login_dependencies:gcc9-debug-3 for debug build
|
||||
# Update tag when dependencies are added or removed
|
||||
|
||||
# Control Build Type with ARG BUILD_TYPE
|
||||
# Valid values do you find here: https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
|
||||
# Default is set to Debug
|
||||
|
||||
##### BUILD-ENV #####
|
||||
FROM gcc:9 as gcc9_build
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends libssl-dev libboost-dev gettext libsodium-dev lcov && \
|
||||
apt-get autoclean && \
|
||||
apt-get autoremove && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
#########################################################################################################
|
||||
# gcc 9 cmake
|
||||
#########################################################################################################
|
||||
FROM gcc9_build as gcc_9_cmake
|
||||
|
||||
RUN git clone https://github.com/Kitware/CMake.git --branch=v3.19.8 && \
|
||||
cd CMake && \
|
||||
./bootstrap --parallel=$(nproc) && \
|
||||
make -j$(nproc) && \
|
||||
make install
|
||||
|
||||
######### BUILD grpc ##############
|
||||
FROM gcc_9_cmake as gcc_9_protobuf
|
||||
|
||||
ARG BUILD_TYPE=Debug
|
||||
|
||||
RUN git clone https://github.com/protocolbuffers/protobuf.git --recursive -j4 && \
|
||||
cd protobuf && \
|
||||
./autogen.sh && \
|
||||
./configure && \
|
||||
make -j$(nproc) && \
|
||||
make install && \
|
||||
ldconfig
|
||||
|
||||
# protobuf libs missing after make install
|
||||
#RUN cp grpc/build/third_party/protobuf/*.a /usr/local/lib/
|
||||
|
||||
######### BUILD poco ##############
|
||||
FROM gcc_9_cmake as gcc_9_poco
|
||||
|
||||
ARG BUILD_TYPE=Debug
|
||||
|
||||
RUN git clone https://github.com/pocoproject/poco.git --recursive && \
|
||||
cd poco && \
|
||||
git checkout poco-1.9.4-release && \
|
||||
mkdir cmake-build && cd cmake-build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && make -j$(nproc) && \
|
||||
make install
|
||||
|
||||
######### BUILD mariadb ###########
|
||||
FROM gcc_9_cmake as gcc_9_mariadb-connector
|
||||
|
||||
ARG BUILD_TYPE=Debug
|
||||
|
||||
RUN git clone https://github.com/mariadb-corporation/mariadb-connector-c.git && \
|
||||
cd mariadb-connector-c && \
|
||||
git checkout 159540f && \
|
||||
mkdir build && cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && make -j$(nproc) && \
|
||||
make install
|
||||
|
||||
#########################################################################################################
|
||||
# builded libs and binaries
|
||||
#########################################################################################################
|
||||
FROM gcc9_build as gcc9_libs
|
||||
|
||||
RUN echo '/usr/local/lib' >> /etc/ld.so.conf && ldconfig
|
||||
|
||||
# copy CMake from cmake stage
|
||||
COPY --from=gcc_9_cmake /usr/local/bin/cmake /usr/local/bin/cmake
|
||||
COPY --from=gcc_9_cmake /usr/local/share/cmake-3.19/Modules /usr/local/share/cmake-3.19/Modules
|
||||
COPY --from=gcc_9_cmake /usr/local/share/cmake-3.19/Templates /usr/local/share/cmake-3.19/Templates
|
||||
|
||||
# copy from grpc
|
||||
COPY --from=gcc_9_protobuf /usr/local /usr/local
|
||||
COPY --from=gcc_9_protobuf /protobuf/third_party/googletest /usr/local/googletest
|
||||
|
||||
# COPY from poco
|
||||
COPY --from=gcc_9_poco /usr/local /usr/local
|
||||
|
||||
# COPY from mariadb
|
||||
COPY --from=gcc_9_mariadb-connector /usr/local /usr/local
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
|
||||
#########################################################################################################
|
||||
# Build release
|
||||
#########################################################################################################
|
||||
FROM gradido/login_dependencies:ubuntu-release-3 as release
|
||||
|
||||
ENV DOCKER_WORKDIR="/code"
|
||||
WORKDIR ${DOCKER_WORKDIR}
|
||||
|
||||
COPY ./CMakeLists.txt.lib ./CMakeLists.txt
|
||||
COPY ./src ./src
|
||||
RUN ln -s /usr/local/googletest ./googletest
|
||||
COPY ./dependencies/cmake-modules ./dependencies/cmake-modules
|
||||
COPY ./dependencies/spirit-po ./dependencies/spirit-po
|
||||
COPY ./dependencies/tinf ./dependencies/tinf
|
||||
COPY ./scripts ./scripts
|
||||
|
||||
RUN mkdir build && \
|
||||
cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release .. && \
|
||||
make -j$(nproc) Gradido_LoginServer
|
||||
|
||||
RUN cd scripts && \
|
||||
chmod +x compile_pot.sh && \
|
||||
./compile_pot.sh
|
||||
|
||||
|
||||
#########################################################################################################
|
||||
# run release
|
||||
#########################################################################################################
|
||||
#From alpine:latest as login_server
|
||||
FROM ubuntu:latest as login_server
|
||||
|
||||
USER root
|
||||
WORKDIR "/usr/bin"
|
||||
|
||||
COPY --from=release /code/build/bin/Gradido_LoginServer /usr/bin/
|
||||
|
||||
COPY --from=release /usr/local/lib/mariadb/libmariadb.so.3 /usr/local/lib/
|
||||
COPY --from=release /usr/local/lib/libPoco* /usr/local/lib/
|
||||
COPY --from=release /usr/local/lib/libproto* /usr/local/lib/
|
||||
COPY --from=release /usr/lib/libsodium.so.23 /usr/lib/
|
||||
COPY --from=release /usr/lib/libstdc++.so.6 /usr/lib/
|
||||
COPY --from=release /usr/lib/libgcc_s.so.1 /usr/lib/
|
||||
|
||||
|
||||
RUN chmod +x /usr/bin/Gradido_LoginServer
|
||||
ENTRYPOINT ["/usr/bin/Gradido_LoginServer"]
|
||||
#CMD Gradido_LoginServer
|
||||
@ -1,58 +0,0 @@
|
||||
|
||||
#########################################################################################################
|
||||
# Prepare debug
|
||||
#########################################################################################################
|
||||
FROM gradido/login_dependencies:gcc9-debug-3 as prepare_debug
|
||||
|
||||
ENV DOCKER_WORKDIR="/code"
|
||||
WORKDIR ${DOCKER_WORKDIR}
|
||||
|
||||
RUN echo '/usr/local/lib' >> /etc/ld.so.conf && ldconfig
|
||||
|
||||
COPY ./CMakeLists.txt.lib ./CMakeLists.txt
|
||||
RUN ln -s /usr/local/googletest ./googletest
|
||||
COPY ./src ./src
|
||||
COPY ./cmake/CodeCoverage.cmake ./cmake/CodeCoverage.cmake
|
||||
COPY ./dependencies/cmake-modules ./dependencies/cmake-modules
|
||||
COPY ./dependencies/spirit-po ./dependencies/spirit-po
|
||||
COPY ./dependencies/tinf ./dependencies/tinf
|
||||
COPY ./scripts ./scripts
|
||||
|
||||
|
||||
#########################################################################################################
|
||||
# Install Coverage tool
|
||||
#########################################################################################################
|
||||
FROM prepare_debug as coverage
|
||||
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends python3-pip && \
|
||||
apt-get autoclean && \
|
||||
apt-get autoremove && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
# fastcov need gcovr to work
|
||||
RUN pip3 install gcovr setuptools wheel && \
|
||||
pip3 install fastcov
|
||||
|
||||
|
||||
#########################################################################################################
|
||||
# Build test
|
||||
#########################################################################################################
|
||||
FROM coverage as test
|
||||
|
||||
ENV DOCKER_WORKDIR="/code"
|
||||
WORKDIR ${DOCKER_WORKDIR}
|
||||
|
||||
|
||||
RUN if [ ! -d "./build_cov" ] ; then mkdir build_cov; fi
|
||||
|
||||
RUN cd build_cov && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DCOLLECT_COVERAGE_DATA=ON -DCOVERAGE_TOOL=fastcov .. && \
|
||||
make -j$(nproc) Gradido_LoginServer_Test
|
||||
|
||||
#ENTRYPOINT make -C build_cov coverage
|
||||
CMD cd build_cov && make coverage && \
|
||||
if [ ! -d "./coverage" ] ; then mkdir coverage; fi && \
|
||||
cp coverage.info ./coverage/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,111 +0,0 @@
|
||||
|
||||
|
||||
function(conan_message MESSAGE_OUTPUT)
|
||||
if(NOT CONAN_CMAKE_SILENT_OUTPUT)
|
||||
message(${ARGV${0}})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
conan_message(STATUS "Conan: Using autogenerated FindOpenSSL.cmake")
|
||||
# Global approach
|
||||
set(OpenSSL_FOUND 1)
|
||||
set(OpenSSL_VERSION "1.0.2o")
|
||||
|
||||
find_package_handle_standard_args(OpenSSL REQUIRED_VARS
|
||||
OpenSSL_VERSION VERSION_VAR OpenSSL_VERSION)
|
||||
mark_as_advanced(OpenSSL_FOUND OpenSSL_VERSION)
|
||||
|
||||
|
||||
set(OpenSSL_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_OPENSSL}")
|
||||
set(OpenSSL_INCLUDE_DIR "${CONAN_INCLUDE_DIRS_OPENSSL}")
|
||||
set(OpenSSL_INCLUDES "${CONAN_INCLUDE_DIRS_OPENSSL}")
|
||||
set(OpenSSL_RES_DIRS "${CONAN_RES_DIRS_OPENSSL}")
|
||||
set(OPENSSL_ROOT_DIR "${CONAN_OPENSSL_ROOT}")
|
||||
set(OPENSSL_DIR "${CONAN_OPENSSL_ROOT}")
|
||||
set(OpenSSL_DEFINITIONS )
|
||||
set(OpenSSL_LINKER_FLAGS_LIST
|
||||
"$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
|
||||
"$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
|
||||
"$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
|
||||
)
|
||||
set(OpenSSL_COMPILE_DEFINITIONS )
|
||||
set(OpenSSL_COMPILE_OPTIONS_LIST "" "")
|
||||
set(OpenSSL_COMPILE_OPTIONS_C "")
|
||||
set(OpenSSL_COMPILE_OPTIONS_CXX "")
|
||||
set(OpenSSL_LIBRARIES_TARGETS "") # Will be filled later, if CMake 3
|
||||
set(OpenSSL_LIBRARIES "") # Will be filled later
|
||||
set(OpenSSL_LIBS "") # Same as OpenSSL_LIBRARIES
|
||||
set(OpenSSL_FRAMEWORKS_FOUND "") # Will be filled later
|
||||
set(OpenSSL_BUILD_MODULES_PATHS )
|
||||
|
||||
|
||||
mark_as_advanced(OpenSSL_INCLUDE_DIRS
|
||||
OpenSSL_INCLUDE_DIR
|
||||
OpenSSL_INCLUDES
|
||||
OpenSSL_DEFINITIONS
|
||||
OpenSSL_LINKER_FLAGS_LIST
|
||||
OpenSSL_COMPILE_DEFINITIONS
|
||||
OpenSSL_COMPILE_OPTIONS_LIST
|
||||
OpenSSL_LIBRARIES
|
||||
OpenSSL_LIBS
|
||||
OpenSSL_LIBRARIES_TARGETS)
|
||||
|
||||
# Find the real .lib/.a and add them to OpenSSL_LIBS and OpenSSL_LIBRARY_LIST
|
||||
set(OpenSSL_LIBRARY_LIST ssl crypto dl pthread)
|
||||
set(OpenSSL_LIB_DIRS "${CONAN_LIB_DIRS_OPENSSL}")
|
||||
|
||||
# Gather all the libraries that should be linked to the targets (do not touch existing variables):
|
||||
set(_OpenSSL_DEPENDENCIES "zlib::zlib")
|
||||
|
||||
conan_package_library_targets("${OpenSSL_LIBRARY_LIST}" # libraries
|
||||
"${OpenSSL_LIB_DIRS}" # package_libdir
|
||||
"${_OpenSSL_DEPENDENCIES}" # deps
|
||||
OpenSSL_LIBRARIES # out_libraries
|
||||
OpenSSL_LIBRARIES_TARGETS # out_libraries_targets
|
||||
"" # build_type
|
||||
"OpenSSL") # package_name
|
||||
|
||||
set(OpenSSL_LIBS ${OpenSSL_LIBRARIES})
|
||||
|
||||
# We need to add our requirements too
|
||||
set(OpenSSL_LIBRARIES_TARGETS "${OpenSSL_LIBRARIES_TARGETS};zlib::zlib")
|
||||
set(OpenSSL_LIBRARIES "${OpenSSL_LIBRARIES};zlib::zlib")
|
||||
|
||||
set(CMAKE_MODULE_PATH "/home/dario/.conan/data/OpenSSL/1.0.2o/conan/stable/package/b781af3f476d0aa5070a0a35b544db7a3c193cc8/" ${CMAKE_MODULE_PATH})
|
||||
set(CMAKE_PREFIX_PATH "/home/dario/.conan/data/OpenSSL/1.0.2o/conan/stable/package/b781af3f476d0aa5070a0a35b544db7a3c193cc8/" ${CMAKE_PREFIX_PATH})
|
||||
|
||||
foreach(_BUILD_MODULE_PATH ${OpenSSL_BUILD_MODULES_PATHS})
|
||||
include(${_BUILD_MODULE_PATH})
|
||||
endforeach()
|
||||
|
||||
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
|
||||
# Target approach
|
||||
if(NOT TARGET OpenSSL::OpenSSL)
|
||||
add_library(OpenSSL::OpenSSL INTERFACE IMPORTED)
|
||||
if(OpenSSL_INCLUDE_DIRS)
|
||||
set_target_properties(OpenSSL::OpenSSL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${OpenSSL_INCLUDE_DIRS}")
|
||||
endif()
|
||||
set_property(TARGET OpenSSL::OpenSSL PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
"${OpenSSL_LIBRARIES_TARGETS};${OpenSSL_LINKER_FLAGS_LIST}")
|
||||
set_property(TARGET OpenSSL::OpenSSL PROPERTY INTERFACE_COMPILE_DEFINITIONS
|
||||
${OpenSSL_COMPILE_DEFINITIONS})
|
||||
set_property(TARGET OpenSSL::OpenSSL PROPERTY INTERFACE_COMPILE_OPTIONS
|
||||
"${OpenSSL_COMPILE_OPTIONS_LIST}")
|
||||
|
||||
# Library dependencies
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
if(NOT zlib_FOUND)
|
||||
find_dependency(zlib REQUIRED)
|
||||
else()
|
||||
message(STATUS "Dependency zlib already found")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endif()
|
||||
@ -1,146 +0,0 @@
|
||||
# Build Login-Server yourself
|
||||
## Linux (Ubuntu) Packets
|
||||
install build essentials
|
||||
|
||||
```bash
|
||||
sudo apt install -y gcovr build-essential gettext libcurl4-openssl-dev libssl-dev libsodium-dev libboost-dev
|
||||
```
|
||||
|
||||
## CMake
|
||||
CMake is used for build file generation and the Login-Server needs at least version v3.18.2
|
||||
You can build and install it from source.
|
||||
The Version in apt is sadly to old.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/Kitware/CMake.git --branch v3.18.2
|
||||
cd CMake
|
||||
./bootstrap --parallel=$(nproc) && make -j$(nproc) && sudo make install
|
||||
```
|
||||
|
||||
## dependencies
|
||||
load git submodules if you haven't done it yet
|
||||
|
||||
```bash
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
## build tools
|
||||
build protoc and page compiler needed for generating some additional code
|
||||
|
||||
```bash
|
||||
cd scripts
|
||||
./prepare_build.sh
|
||||
```
|
||||
|
||||
## build
|
||||
build login-server in debug mode
|
||||
|
||||
```bash
|
||||
cd scripts
|
||||
./build_debug.sh
|
||||
```
|
||||
|
||||
## multilanguage text
|
||||
Login-Server uses gettext translations found after build in src/LOCALE
|
||||
On Linux Login-Server expect the *.po files in folder /etc/grd_login/LOCALE
|
||||
on windows next to Binary in Folder LOCALE.
|
||||
So please copy them over by yourself on first run or after change.
|
||||
|
||||
If you like to update some translations your find a messages.pot in src/LOCALE.
|
||||
Use it together with poedit and don't forget to copy over *.po files after change to /etc/grd_login/LOCALE
|
||||
To update messages.pot run
|
||||
|
||||
```bash
|
||||
./scripts/compile_pot.sh
|
||||
```
|
||||
This will be also called by ./scripts/build_debug.sh
|
||||
|
||||
## database
|
||||
Login-Server needs a db to run, it is tested with mariadb.
|
||||
Currently at least one group must be present in table groups.
|
||||
For example:
|
||||
```sql
|
||||
INSERT INTO `groups` (`id`, `alias`, `name`, `url`, `host`, `home`, `description`) VALUES
|
||||
(1, 'docker', 'docker gradido group', 'localhost', 'localhost', '/', 'gradido test group for docker with blockchain db');
|
||||
```
|
||||
|
||||
## configuration
|
||||
Login-Server needs a configuration file to able to run.
|
||||
On Linux it expect it to find the file /etc/grd_login/grd_login.properties
|
||||
and /etc/grd_login/grd_login_test.properties for unittest
|
||||
|
||||
Example configuration (ini-format)
|
||||
```ini
|
||||
# Port for Web-Interface
|
||||
HTTPServer.port = 1200
|
||||
# Port for json-Interface (used by new backend)
|
||||
JSONServer.port = 1201
|
||||
# default group id for new users, if no group was choosen
|
||||
Gradido.group_id = 1
|
||||
|
||||
# currently not used
|
||||
crypto.server_admin_public = f909a866baec97c5460b8d7a93b72d3d4d20cc45d9f15d78bd83944eb9286b7f
|
||||
# Server admin Passphrase
|
||||
# nerve execute merit pool talk hockey basic win cargo spin disagree ethics swear price purchase say clutch decrease slow half forest reform cheese able
|
||||
#
|
||||
|
||||
# TODO: auto-generate in docker build step
|
||||
# expect valid hex 32 character long (16 Byte)
|
||||
# salt for hashing user password, should be moved into db generated and saved per user, used for hardening against hash-tables
|
||||
crypto.server_key = a51ef8ac7ef1abf162fb7a65261acd7a
|
||||
|
||||
# TODO: auto-generate in docker build step
|
||||
# salt for hashing user encryption key, expect valid hex, as long as you like, used in sha512
|
||||
crypto.app_secret = 21ffbbc616fe
|
||||
|
||||
# for url forwarding to old frontend, path of community server
|
||||
phpServer.url = http://localhost/
|
||||
# host for community server api calls
|
||||
phpServer.host = localhost
|
||||
# port for community server api calls
|
||||
phpServer.port = 80
|
||||
|
||||
# Path for Login-Server Web-Interface used for link-generation
|
||||
loginServer.path = http://localhost/account
|
||||
# default language for new users and if no one is logged in
|
||||
loginServer.default_locale = de
|
||||
|
||||
# db setup tested with mariadb, should also work with mysql
|
||||
loginServer.db.host = localhost
|
||||
loginServer.db.name = gradido_login
|
||||
loginServer.db.user = root
|
||||
loginServer.db.password =
|
||||
loginServer.db.port = 3306
|
||||
|
||||
# check email path for new frontend for link generation in emails
|
||||
frontend.checkEmailPath = http://localhost/reset
|
||||
|
||||
# disable email all together
|
||||
email.disable = true
|
||||
|
||||
# setup email smtp server for sending emails
|
||||
#email.username =
|
||||
#email.sender =
|
||||
#email.admin_receiver =
|
||||
#email.password =
|
||||
#email.smtp.url =
|
||||
#email.smtp.port =
|
||||
|
||||
# server setup types: test, staging or production
|
||||
# used mainly to decide if using http or https for links
|
||||
# test use http and staging and production uses https
|
||||
ServerSetupType=test
|
||||
dev.default_group = docker
|
||||
|
||||
# Session timeout in minutes
|
||||
session.timeout = 15
|
||||
|
||||
# Disabling security features for faster develop and testing
|
||||
unsecure.allow_passwort_via_json_request = 1
|
||||
unsecure.allow_auto_sign_transactions = 1
|
||||
unsecure.allow_cors_all = 1
|
||||
|
||||
# default disable, passwords must contain a number, a lower character, a high character, special character, and be at least 8 characters long
|
||||
unsecure.allow_all_passwords = 1
|
||||
|
||||
```
|
||||
@ -1,682 +0,0 @@
|
||||
# Copyright (c) 2012 - 2017, Lars Bilke
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this
|
||||
# list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without
|
||||
# specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# CHANGES:
|
||||
#
|
||||
# 2012-01-31, Lars Bilke
|
||||
# - Enable Code Coverage
|
||||
#
|
||||
# 2013-09-17, Joakim Söderberg
|
||||
# - Added support for Clang.
|
||||
# - Some additional usage instructions.
|
||||
#
|
||||
# 2016-02-03, Lars Bilke
|
||||
# - Refactored functions to use named parameters
|
||||
#
|
||||
# 2017-06-02, Lars Bilke
|
||||
# - Merged with modified version from github.com/ufz/ogs
|
||||
#
|
||||
# 2019-05-06, Anatolii Kurotych
|
||||
# - Remove unnecessary --coverage flag
|
||||
#
|
||||
# 2019-12-13, FeRD (Frank Dana)
|
||||
# - Deprecate COVERAGE_LCOVR_EXCLUDES and COVERAGE_GCOVR_EXCLUDES lists in favor
|
||||
# of tool-agnostic COVERAGE_EXCLUDES variable, or EXCLUDE setup arguments.
|
||||
# - CMake 3.4+: All excludes can be specified relative to BASE_DIRECTORY
|
||||
# - All setup functions: accept BASE_DIRECTORY, EXCLUDE list
|
||||
# - Set lcov basedir with -b argument
|
||||
# - Add automatic --demangle-cpp in lcovr, if 'c++filt' is available (can be
|
||||
# overridden with NO_DEMANGLE option in setup_target_for_coverage_lcovr().)
|
||||
# - Delete output dir, .info file on 'make clean'
|
||||
# - Remove Python detection, since version mismatches will break gcovr
|
||||
# - Minor cleanup (lowercase function names, update examples...)
|
||||
#
|
||||
# 2019-12-19, FeRD (Frank Dana)
|
||||
# - Rename Lcov outputs, make filtered file canonical, fix cleanup for targets
|
||||
#
|
||||
# 2020-01-19, Bob Apthorpe
|
||||
# - Added gfortran support
|
||||
#
|
||||
# 2020-02-17, FeRD (Frank Dana)
|
||||
# - Make all add_custom_target()s VERBATIM to auto-escape wildcard characters
|
||||
# in EXCLUDEs, and remove manual escaping from gcovr targets
|
||||
#
|
||||
# 2021-01-19, Robin Mueller
|
||||
# - Add CODE_COVERAGE_VERBOSE option which will allow to print out commands which are run
|
||||
# - Added the option for users to set the GCOVR_ADDITIONAL_ARGS variable to supply additional
|
||||
# flags to the gcovr command
|
||||
#
|
||||
# 2020-05-04, Mihchael Davis
|
||||
# - Add -fprofile-abs-path to make gcno files contain absolute paths
|
||||
# - Fix BASE_DIRECTORY not working when defined
|
||||
# - Change BYPRODUCT from folder to index.html to stop ninja from complaining about double defines
|
||||
# USAGE:
|
||||
#
|
||||
# 1. Copy this file into your cmake modules path.
|
||||
#
|
||||
# 2. Add the following line to your CMakeLists.txt (best inside an if-condition
|
||||
# using a CMake option() to enable it just optionally):
|
||||
# include(CodeCoverage)
|
||||
#
|
||||
# 3. Append necessary compiler flags:
|
||||
# append_coverage_compiler_flags()
|
||||
#
|
||||
# 3.a (OPTIONAL) Set appropriate optimization flags, e.g. -O0, -O1 or -Og
|
||||
#
|
||||
# 4. If you need to exclude additional directories from the report, specify them
|
||||
# using full paths in the COVERAGE_EXCLUDES variable before calling
|
||||
# setup_target_for_coverage_*().
|
||||
# Example:
|
||||
# set(COVERAGE_EXCLUDES
|
||||
# '${PROJECT_SOURCE_DIR}/src/dir1/*'
|
||||
# '/path/to/my/src/dir2/*')
|
||||
# Or, use the EXCLUDE argument to setup_target_for_coverage_*().
|
||||
# Example:
|
||||
# setup_target_for_coverage_lcov(
|
||||
# NAME coverage
|
||||
# EXECUTABLE testrunner
|
||||
# EXCLUDE "${PROJECT_SOURCE_DIR}/src/dir1/*" "/path/to/my/src/dir2/*")
|
||||
#
|
||||
# 4.a NOTE: With CMake 3.4+, COVERAGE_EXCLUDES or EXCLUDE can also be set
|
||||
# relative to the BASE_DIRECTORY (default: PROJECT_SOURCE_DIR)
|
||||
# Example:
|
||||
# set(COVERAGE_EXCLUDES "dir1/*")
|
||||
# setup_target_for_coverage_gcovr_html(
|
||||
# NAME coverage
|
||||
# EXECUTABLE testrunner
|
||||
# BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src"
|
||||
# EXCLUDE "dir2/*")
|
||||
#
|
||||
# 5. Use the functions described below to create a custom make target which
|
||||
# runs your test executable and produces a code coverage report.
|
||||
#
|
||||
# 6. Build a Debug build:
|
||||
# cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||
# make
|
||||
# make my_coverage_target
|
||||
#
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
option(CODE_COVERAGE_VERBOSE "Verbose information" FALSE)
|
||||
|
||||
# Check prereqs
|
||||
find_program( GCOV_PATH gcov )
|
||||
find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
|
||||
find_program( FASTCOV_PATH NAMES fastcov fastcov.py )
|
||||
find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat )
|
||||
find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
|
||||
find_program( CPPFILT_PATH NAMES c++filt )
|
||||
|
||||
if(NOT GCOV_PATH)
|
||||
message(FATAL_ERROR "gcov not found! Aborting...")
|
||||
endif() # NOT GCOV_PATH
|
||||
|
||||
get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
list(GET LANGUAGES 0 LANG)
|
||||
|
||||
if("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
|
||||
if("${CMAKE_${LANG}_COMPILER_VERSION}" VERSION_LESS 3)
|
||||
message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
|
||||
endif()
|
||||
elseif(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "[Ff]lang")
|
||||
# Do nothing; exit conditional without error if true
|
||||
elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
|
||||
# Do nothing; exit conditional without error if true
|
||||
else()
|
||||
message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage"
|
||||
CACHE INTERNAL "")
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
|
||||
include(CheckCXXCompilerFlag)
|
||||
check_cxx_compiler_flag(-fprofile-abs-path HAVE_fprofile_abs_path)
|
||||
if(HAVE_fprofile_abs_path)
|
||||
set(COVERAGE_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_Fortran_FLAGS_COVERAGE
|
||||
${COVERAGE_COMPILER_FLAGS}
|
||||
CACHE STRING "Flags used by the Fortran compiler during coverage builds."
|
||||
FORCE )
|
||||
set(CMAKE_CXX_FLAGS_COVERAGE
|
||||
${COVERAGE_COMPILER_FLAGS}
|
||||
CACHE STRING "Flags used by the C++ compiler during coverage builds."
|
||||
FORCE )
|
||||
set(CMAKE_C_FLAGS_COVERAGE
|
||||
${COVERAGE_COMPILER_FLAGS}
|
||||
CACHE STRING "Flags used by the C compiler during coverage builds."
|
||||
FORCE )
|
||||
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
||||
""
|
||||
CACHE STRING "Flags used for linking binaries during coverage builds."
|
||||
FORCE )
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
|
||||
""
|
||||
CACHE STRING "Flags used by the shared libraries linker during coverage builds."
|
||||
FORCE )
|
||||
mark_as_advanced(
|
||||
CMAKE_Fortran_FLAGS_COVERAGE
|
||||
CMAKE_CXX_FLAGS_COVERAGE
|
||||
CMAKE_C_FLAGS_COVERAGE
|
||||
CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
||||
CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
|
||||
endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
|
||||
link_libraries(gcov)
|
||||
endif()
|
||||
|
||||
# Defines a target for running and collection code coverage information
|
||||
# Builds dependencies, runs the given executable and outputs reports.
|
||||
# NOTE! The executable should always have a ZERO as exit code otherwise
|
||||
# the coverage generation will not complete.
|
||||
#
|
||||
# setup_target_for_coverage_lcov(
|
||||
# NAME testrunner_coverage # New target name
|
||||
# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
|
||||
# DEPENDENCIES testrunner # Dependencies to build first
|
||||
# BASE_DIRECTORY "../" # Base directory for report
|
||||
# # (defaults to PROJECT_SOURCE_DIR)
|
||||
# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
|
||||
# # to BASE_DIRECTORY, with CMake 3.4+)
|
||||
# NO_DEMANGLE # Don't demangle C++ symbols
|
||||
# # even if c++filt is found
|
||||
# )
|
||||
function(setup_target_for_coverage_lcov)
|
||||
|
||||
set(options NO_DEMANGLE)
|
||||
set(oneValueArgs BASE_DIRECTORY NAME)
|
||||
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS)
|
||||
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if(NOT LCOV_PATH)
|
||||
message(FATAL_ERROR "lcov not found! Aborting...")
|
||||
endif() # NOT LCOV_PATH
|
||||
|
||||
if(NOT GENHTML_PATH)
|
||||
message(FATAL_ERROR "genhtml not found! Aborting...")
|
||||
endif() # NOT GENHTML_PATH
|
||||
|
||||
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
|
||||
if(DEFINED Coverage_BASE_DIRECTORY)
|
||||
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
|
||||
else()
|
||||
set(BASEDIR ${PROJECT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
# Collect excludes (CMake 3.4+: Also compute absolute paths)
|
||||
set(LCOV_EXCLUDES "")
|
||||
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_LCOV_EXCLUDES})
|
||||
if(CMAKE_VERSION VERSION_GREATER 3.4)
|
||||
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
|
||||
endif()
|
||||
list(APPEND LCOV_EXCLUDES "${EXCLUDE}")
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES LCOV_EXCLUDES)
|
||||
|
||||
# Conditional arguments
|
||||
if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
|
||||
set(GENHTML_EXTRA_ARGS "--demangle-cpp")
|
||||
endif()
|
||||
|
||||
# Setting up commands which will be run to generate coverage data.
|
||||
# Cleanup lcov
|
||||
set(LCOV_CLEAN_CMD
|
||||
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory .
|
||||
-b ${BASEDIR} --zerocounters
|
||||
)
|
||||
# Create baseline to make sure untouched files show up in the report
|
||||
set(LCOV_BASELINE_CMD
|
||||
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d . -b
|
||||
${BASEDIR} -o ${Coverage_NAME}.base
|
||||
)
|
||||
# Run tests
|
||||
set(LCOV_EXEC_TESTS_CMD
|
||||
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
|
||||
)
|
||||
# Capturing lcov counters and generating report
|
||||
set(LCOV_CAPTURE_CMD
|
||||
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . -b
|
||||
${BASEDIR} --capture --output-file ${Coverage_NAME}.capture
|
||||
)
|
||||
# add baseline counters
|
||||
set(LCOV_BASELINE_COUNT_CMD
|
||||
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a ${Coverage_NAME}.base
|
||||
-a ${Coverage_NAME}.capture --output-file ${Coverage_NAME}.total
|
||||
)
|
||||
# filter collected data to final coverage report
|
||||
set(LCOV_FILTER_CMD
|
||||
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove
|
||||
${Coverage_NAME}.total ${LCOV_EXCLUDES} --output-file ${Coverage_NAME}.info
|
||||
)
|
||||
# Generate HTML output
|
||||
set(LCOV_GEN_HTML_CMD
|
||||
${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} -o
|
||||
${Coverage_NAME} ${Coverage_NAME}.info
|
||||
)
|
||||
|
||||
|
||||
if(CODE_COVERAGE_VERBOSE)
|
||||
message(STATUS "Executed command report")
|
||||
message(STATUS "Command to clean up lcov: ")
|
||||
string(REPLACE ";" " " LCOV_CLEAN_CMD_SPACED "${LCOV_CLEAN_CMD}")
|
||||
message(STATUS "${LCOV_CLEAN_CMD_SPACED}")
|
||||
|
||||
message(STATUS "Command to create baseline: ")
|
||||
string(REPLACE ";" " " LCOV_BASELINE_CMD_SPACED "${LCOV_BASELINE_CMD}")
|
||||
message(STATUS "${LCOV_BASELINE_CMD_SPACED}")
|
||||
|
||||
message(STATUS "Command to run the tests: ")
|
||||
string(REPLACE ";" " " LCOV_EXEC_TESTS_CMD_SPACED "${LCOV_EXEC_TESTS_CMD}")
|
||||
message(STATUS "${LCOV_EXEC_TESTS_CMD_SPACED}")
|
||||
|
||||
message(STATUS "Command to capture counters and generate report: ")
|
||||
string(REPLACE ";" " " LCOV_CAPTURE_CMD_SPACED "${LCOV_CAPTURE_CMD}")
|
||||
message(STATUS "${LCOV_CAPTURE_CMD_SPACED}")
|
||||
|
||||
message(STATUS "Command to add baseline counters: ")
|
||||
string(REPLACE ";" " " LCOV_BASELINE_COUNT_CMD_SPACED "${LCOV_BASELINE_COUNT_CMD}")
|
||||
message(STATUS "${LCOV_BASELINE_COUNT_CMD_SPACED}")
|
||||
|
||||
message(STATUS "Command to filter collected data: ")
|
||||
string(REPLACE ";" " " LCOV_FILTER_CMD_SPACED "${LCOV_FILTER_CMD}")
|
||||
message(STATUS "${LCOV_FILTER_CMD_SPACED}")
|
||||
|
||||
message(STATUS "Command to generate lcov HTML output: ")
|
||||
string(REPLACE ";" " " LCOV_GEN_HTML_CMD_SPACED "${LCOV_GEN_HTML_CMD}")
|
||||
message(STATUS "${LCOV_GEN_HTML_CMD_SPACED}")
|
||||
endif()
|
||||
|
||||
# Setup target
|
||||
add_custom_target(${Coverage_NAME}
|
||||
COMMAND ${LCOV_CLEAN_CMD}
|
||||
COMMAND ${LCOV_BASELINE_CMD}
|
||||
COMMAND ${LCOV_EXEC_TESTS_CMD}
|
||||
COMMAND ${LCOV_CAPTURE_CMD}
|
||||
COMMAND ${LCOV_BASELINE_COUNT_CMD}
|
||||
COMMAND ${LCOV_FILTER_CMD}
|
||||
COMMAND ${LCOV_GEN_HTML_CMD}
|
||||
|
||||
# Set output files as GENERATED (will be removed on 'make clean')
|
||||
BYPRODUCTS
|
||||
${Coverage_NAME}.base
|
||||
${Coverage_NAME}.capture
|
||||
${Coverage_NAME}.total
|
||||
${Coverage_NAME}.info
|
||||
${Coverage_NAME}/index.html
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
DEPENDS ${Coverage_DEPENDENCIES}
|
||||
VERBATIM # Protect arguments to commands
|
||||
COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
|
||||
)
|
||||
|
||||
# Show where to find the lcov info report
|
||||
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
|
||||
COMMAND ;
|
||||
COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info."
|
||||
)
|
||||
|
||||
# Show info where to find the report
|
||||
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
|
||||
COMMAND ;
|
||||
COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
|
||||
)
|
||||
|
||||
endfunction() # setup_target_for_coverage_lcov
|
||||
|
||||
# Defines a target for running and collection code coverage information
|
||||
# Builds dependencies, runs the given executable and outputs reports.
|
||||
# NOTE! The executable should always have a ZERO as exit code otherwise
|
||||
# the coverage generation will not complete.
|
||||
#
|
||||
# setup_target_for_coverage_gcovr_xml(
|
||||
# NAME ctest_coverage # New target name
|
||||
# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
|
||||
# DEPENDENCIES executable_target # Dependencies to build first
|
||||
# BASE_DIRECTORY "../" # Base directory for report
|
||||
# # (defaults to PROJECT_SOURCE_DIR)
|
||||
# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
|
||||
# # to BASE_DIRECTORY, with CMake 3.4+)
|
||||
# )
|
||||
# The user can set the variable GCOVR_ADDITIONAL_ARGS to supply additional flags to the
|
||||
# GCVOR command.
|
||||
function(setup_target_for_coverage_gcovr_xml)
|
||||
|
||||
set(options NONE)
|
||||
set(oneValueArgs BASE_DIRECTORY NAME)
|
||||
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
|
||||
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if(NOT GCOVR_PATH)
|
||||
message(FATAL_ERROR "gcovr not found! Aborting...")
|
||||
endif() # NOT GCOVR_PATH
|
||||
|
||||
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
|
||||
if(DEFINED Coverage_BASE_DIRECTORY)
|
||||
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
|
||||
else()
|
||||
set(BASEDIR ${PROJECT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
# Collect excludes (CMake 3.4+: Also compute absolute paths)
|
||||
set(GCOVR_EXCLUDES "")
|
||||
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
|
||||
if(CMAKE_VERSION VERSION_GREATER 3.4)
|
||||
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
|
||||
endif()
|
||||
list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
|
||||
|
||||
# Combine excludes to several -e arguments
|
||||
set(GCOVR_EXCLUDE_ARGS "")
|
||||
foreach(EXCLUDE ${GCOVR_EXCLUDES})
|
||||
list(APPEND GCOVR_EXCLUDE_ARGS "-e")
|
||||
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
|
||||
endforeach()
|
||||
|
||||
# Set up commands which will be run to generate coverage data
|
||||
# Run tests
|
||||
set(GCOVR_XML_EXEC_TESTS_CMD
|
||||
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
|
||||
)
|
||||
# Running gcovr
|
||||
set(GCOVR_XML_CMD
|
||||
${GCOVR_PATH} --xml -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS} ${GCOVR_EXCLUDE_ARGS}
|
||||
--object-directory=${PROJECT_BINARY_DIR} -o ${Coverage_NAME}.xml
|
||||
)
|
||||
|
||||
if(CODE_COVERAGE_VERBOSE)
|
||||
message(STATUS "Executed command report")
|
||||
|
||||
message(STATUS "Command to run tests: ")
|
||||
string(REPLACE ";" " " GCOVR_XML_EXEC_TESTS_CMD_SPACED "${GCOVR_XML_EXEC_TESTS_CMD}")
|
||||
message(STATUS "${GCOVR_XML_EXEC_TESTS_CMD_SPACED}")
|
||||
|
||||
message(STATUS "Command to generate gcovr XML coverage data: ")
|
||||
string(REPLACE ";" " " GCOVR_XML_CMD_SPACED "${GCOVR_XML_CMD}")
|
||||
message(STATUS "${GCOVR_XML_CMD_SPACED}")
|
||||
endif()
|
||||
|
||||
add_custom_target(${Coverage_NAME}
|
||||
COMMAND ${GCOVR_XML_EXEC_TESTS_CMD}
|
||||
COMMAND ${GCOVR_XML_CMD}
|
||||
|
||||
BYPRODUCTS ${Coverage_NAME}.xml
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
DEPENDS ${Coverage_DEPENDENCIES}
|
||||
VERBATIM # Protect arguments to commands
|
||||
COMMENT "Running gcovr to produce Cobertura code coverage report."
|
||||
)
|
||||
|
||||
# Show info where to find the report
|
||||
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
|
||||
COMMAND ;
|
||||
COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml."
|
||||
)
|
||||
endfunction() # setup_target_for_coverage_gcovr_xml
|
||||
|
||||
# Defines a target for running and collection code coverage information
|
||||
# Builds dependencies, runs the given executable and outputs reports.
|
||||
# NOTE! The executable should always have a ZERO as exit code otherwise
|
||||
# the coverage generation will not complete.
|
||||
#
|
||||
# setup_target_for_coverage_gcovr_html(
|
||||
# NAME ctest_coverage # New target name
|
||||
# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
|
||||
# DEPENDENCIES executable_target # Dependencies to build first
|
||||
# BASE_DIRECTORY "../" # Base directory for report
|
||||
# # (defaults to PROJECT_SOURCE_DIR)
|
||||
# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
|
||||
# # to BASE_DIRECTORY, with CMake 3.4+)
|
||||
# )
|
||||
# The user can set the variable GCOVR_ADDITIONAL_ARGS to supply additional flags to the
|
||||
# GCVOR command.
|
||||
function(setup_target_for_coverage_gcovr_html)
|
||||
|
||||
set(options NONE)
|
||||
set(oneValueArgs BASE_DIRECTORY NAME)
|
||||
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
|
||||
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if(NOT GCOVR_PATH)
|
||||
message(FATAL_ERROR "gcovr not found! Aborting...")
|
||||
endif() # NOT GCOVR_PATH
|
||||
|
||||
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
|
||||
if(DEFINED Coverage_BASE_DIRECTORY)
|
||||
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
|
||||
else()
|
||||
set(BASEDIR ${PROJECT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
# Collect excludes (CMake 3.4+: Also compute absolute paths)
|
||||
set(GCOVR_EXCLUDES "")
|
||||
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
|
||||
if(CMAKE_VERSION VERSION_GREATER 3.4)
|
||||
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
|
||||
endif()
|
||||
list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
|
||||
|
||||
# Combine excludes to several -e arguments
|
||||
set(GCOVR_EXCLUDE_ARGS "")
|
||||
foreach(EXCLUDE ${GCOVR_EXCLUDES})
|
||||
list(APPEND GCOVR_EXCLUDE_ARGS "-e")
|
||||
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
|
||||
endforeach()
|
||||
|
||||
# Set up commands which will be run to generate coverage data
|
||||
# Run tests
|
||||
set(GCOVR_HTML_EXEC_TESTS_CMD
|
||||
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
|
||||
)
|
||||
# Create folder
|
||||
set(GCOVR_HTML_FOLDER_CMD
|
||||
${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${Coverage_NAME}
|
||||
)
|
||||
# Running gcovr
|
||||
set(GCOVR_HTML_CMD
|
||||
${GCOVR_PATH} --html --html-details -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS}
|
||||
${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR}
|
||||
-o ${Coverage_NAME}/index.html
|
||||
)
|
||||
|
||||
if(CODE_COVERAGE_VERBOSE)
|
||||
message(STATUS "Executed command report")
|
||||
|
||||
message(STATUS "Command to run tests: ")
|
||||
string(REPLACE ";" " " GCOVR_HTML_EXEC_TESTS_CMD_SPACED "${GCOVR_HTML_EXEC_TESTS_CMD}")
|
||||
message(STATUS "${GCOVR_HTML_EXEC_TESTS_CMD_SPACED}")
|
||||
|
||||
message(STATUS "Command to create a folder: ")
|
||||
string(REPLACE ";" " " GCOVR_HTML_FOLDER_CMD_SPACED "${GCOVR_HTML_FOLDER_CMD}")
|
||||
message(STATUS "${GCOVR_HTML_FOLDER_CMD_SPACED}")
|
||||
|
||||
message(STATUS "Command to generate gcovr HTML coverage data: ")
|
||||
string(REPLACE ";" " " GCOVR_HTML_CMD_SPACED "${GCOVR_HTML_CMD}")
|
||||
message(STATUS "${GCOVR_HTML_CMD_SPACED}")
|
||||
endif()
|
||||
|
||||
add_custom_target(${Coverage_NAME}
|
||||
COMMAND ${GCOVR_HTML_EXEC_TESTS_CMD}
|
||||
COMMAND ${GCOVR_HTML_FOLDER_CMD}
|
||||
COMMAND ${GCOVR_HTML_CMD}
|
||||
|
||||
BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html # report directory
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
DEPENDS ${Coverage_DEPENDENCIES}
|
||||
VERBATIM # Protect arguments to commands
|
||||
COMMENT "Running gcovr to produce HTML code coverage report."
|
||||
)
|
||||
|
||||
# Show info where to find the report
|
||||
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
|
||||
COMMAND ;
|
||||
COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
|
||||
)
|
||||
|
||||
endfunction() # setup_target_for_coverage_gcovr_html
|
||||
|
||||
# Defines a target for running and collection code coverage information
|
||||
# Builds dependencies, runs the given executable and outputs reports.
|
||||
# NOTE! The executable should always have a ZERO as exit code otherwise
|
||||
# the coverage generation will not complete.
|
||||
#
|
||||
# setup_target_for_coverage_fastcov(
|
||||
# NAME testrunner_coverage # New target name
|
||||
# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
|
||||
# DEPENDENCIES testrunner # Dependencies to build first
|
||||
# BASE_DIRECTORY "../" # Base directory for report
|
||||
# # (defaults to PROJECT_SOURCE_DIR)
|
||||
# EXCLUDE "src/dir1/" "src/dir2/" # Patterns to exclude.
|
||||
# NO_DEMANGLE # Don't demangle C++ symbols
|
||||
# # even if c++filt is found
|
||||
# SKIP_HTML # Don't create html report
|
||||
# )
|
||||
function(setup_target_for_coverage_fastcov)
|
||||
|
||||
set(options NO_DEMANGLE SKIP_HTML)
|
||||
set(oneValueArgs BASE_DIRECTORY NAME)
|
||||
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES FASTCOV_ARGS GENHTML_ARGS)
|
||||
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if(NOT FASTCOV_PATH)
|
||||
message(FATAL_ERROR "fastcov not found! Aborting...")
|
||||
endif()
|
||||
|
||||
if(NOT GENHTML_PATH)
|
||||
message(FATAL_ERROR "genhtml not found! Aborting...")
|
||||
endif()
|
||||
|
||||
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
|
||||
if(Coverage_BASE_DIRECTORY)
|
||||
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
|
||||
else()
|
||||
set(BASEDIR ${PROJECT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
# Collect excludes (Patterns, not paths, for fastcov)
|
||||
set(FASTCOV_EXCLUDES "")
|
||||
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_FASTCOV_EXCLUDES})
|
||||
list(APPEND FASTCOV_EXCLUDES "${EXCLUDE}")
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES FASTCOV_EXCLUDES)
|
||||
|
||||
# Conditional arguments
|
||||
if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
|
||||
set(GENHTML_EXTRA_ARGS "--demangle-cpp")
|
||||
endif()
|
||||
|
||||
# Set up commands which will be run to generate coverage data
|
||||
set(FASTCOV_EXEC_TESTS_CMD ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS})
|
||||
|
||||
set(FASTCOV_CAPTURE_CMD ${FASTCOV_PATH} ${Coverage_FASTCOV_ARGS} --gcov ${GCOV_PATH}
|
||||
--search-directory ${BASEDIR}
|
||||
--process-gcno
|
||||
--lcov
|
||||
--output ${Coverage_NAME}.info
|
||||
--exclude ${FASTCOV_EXCLUDES}
|
||||
--exclude ${FASTCOV_EXCLUDES}
|
||||
)
|
||||
|
||||
if(Coverage_SKIP_HTML)
|
||||
set(FASTCOV_HTML_CMD ";")
|
||||
else()
|
||||
set(FASTCOV_HTML_CMD ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS}
|
||||
-o ${Coverage_NAME} ${Coverage_NAME}.info
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CODE_COVERAGE_VERBOSE)
|
||||
message(STATUS "Code coverage commands for target ${Coverage_NAME} (fastcov):")
|
||||
|
||||
message(" Running tests:")
|
||||
string(REPLACE ";" " " FASTCOV_EXEC_TESTS_CMD_SPACED "${FASTCOV_EXEC_TESTS_CMD}")
|
||||
message(" ${FASTCOV_EXEC_TESTS_CMD_SPACED}")
|
||||
|
||||
message(" Capturing fastcov counters and generating report:")
|
||||
string(REPLACE ";" " " FASTCOV_CAPTURE_CMD_SPACED "${FASTCOV_CAPTURE_CMD}")
|
||||
message(" ${FASTCOV_CAPTURE_CMD_SPACED}")
|
||||
|
||||
if(NOT Coverage_SKIP_HTML)
|
||||
message(" Generating HTML report: ")
|
||||
string(REPLACE ";" " " FASTCOV_HTML_CMD_SPACED "${FASTCOV_HTML_CMD}")
|
||||
message(" ${FASTCOV_HTML_CMD_SPACED}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Setup target
|
||||
add_custom_target(${Coverage_NAME}
|
||||
|
||||
# Cleanup fastcov
|
||||
COMMAND ${FASTCOV_PATH} ${Coverage_FASTCOV_ARGS} --gcov ${GCOV_PATH}
|
||||
--search-directory ${BASEDIR}
|
||||
--zerocounters
|
||||
|
||||
COMMAND ${FASTCOV_EXEC_TESTS_CMD}
|
||||
COMMAND ${FASTCOV_CAPTURE_CMD}
|
||||
COMMAND ${FASTCOV_HTML_CMD}
|
||||
|
||||
# Set output files as GENERATED (will be removed on 'make clean')
|
||||
BYPRODUCTS
|
||||
${Coverage_NAME}.info
|
||||
${Coverage_NAME}/index.html # report directory
|
||||
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
DEPENDS ${Coverage_DEPENDENCIES}
|
||||
VERBATIM # Protect arguments to commands
|
||||
COMMENT "Resetting code coverage counters to zero. Processing code coverage counters and generating report."
|
||||
)
|
||||
|
||||
set(INFO_MSG "fastcov code coverage info report saved in ${Coverage_NAME}.info.")
|
||||
if(NOT Coverage_SKIP_HTML)
|
||||
string(APPEND INFO_MSG " Open ${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html in your browser to view the coverage report.")
|
||||
endif()
|
||||
# Show where to find the fastcov info report
|
||||
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E echo ${INFO_MSG}
|
||||
)
|
||||
|
||||
endfunction() # setup_target_for_coverage_fastcov
|
||||
|
||||
function(append_coverage_compiler_flags)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
|
||||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
|
||||
message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
|
||||
endfunction() # append_coverage_compiler_flags
|
||||
@ -1,141 +0,0 @@
|
||||
# - Returns a version string from Git
|
||||
#
|
||||
# These functions force a re-configure on each git commit so that you can
|
||||
# trust the values of the variables in your build system.
|
||||
#
|
||||
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the refspec and sha hash of the current head revision
|
||||
#
|
||||
# git_describe(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe on the source tree, and adjusting
|
||||
# the output so that it tests false if an error occurs.
|
||||
#
|
||||
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe --exact-match on the source tree,
|
||||
# and adjusting the output so that it tests false if there was no exact
|
||||
# matching tag.
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
#
|
||||
# Copyright Iowa State University 2009-2010.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
if(__get_git_revision_description)
|
||||
return()
|
||||
endif()
|
||||
set(__get_git_revision_description YES)
|
||||
|
||||
# We must run the following at "include" time, not at function call time,
|
||||
# to find the path to this module rather than the path to a calling list file
|
||||
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||
|
||||
function(get_git_head_revision _refspecvar _hashvar)
|
||||
set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
||||
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
|
||||
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
|
||||
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
|
||||
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
|
||||
# We have reached the root directory, we are not in git
|
||||
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
|
||||
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
||||
endwhile()
|
||||
# check if this is a submodule
|
||||
if(NOT IS_DIRECTORY ${GIT_DIR})
|
||||
file(READ ${GIT_DIR} submodule)
|
||||
string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
|
||||
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
|
||||
|
||||
if (IS_ABSOLUTE ${GIT_DIR_RELATIVE})
|
||||
set(GIT_DIR ${GIT_DIR_RELATIVE})
|
||||
else()
|
||||
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
|
||||
if(NOT EXISTS "${GIT_DATA}")
|
||||
file(MAKE_DIRECTORY "${GIT_DATA}")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${GIT_DIR}/HEAD")
|
||||
return()
|
||||
endif()
|
||||
set(HEAD_FILE "${GIT_DATA}/HEAD")
|
||||
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
|
||||
|
||||
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
|
||||
"${GIT_DATA}/grabRef.cmake"
|
||||
@ONLY)
|
||||
include("${GIT_DATA}/grabRef.cmake")
|
||||
|
||||
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
|
||||
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_describe _var)
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
get_git_head_revision(refspec hash)
|
||||
if(NOT GIT_FOUND)
|
||||
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
if(NOT hash)
|
||||
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# TODO sanitize
|
||||
#if((${ARGN}" MATCHES "&&") OR
|
||||
# (ARGN MATCHES "||") OR
|
||||
# (ARGN MATCHES "\\;"))
|
||||
# message("Please report the following error to the project!")
|
||||
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
|
||||
#endif()
|
||||
|
||||
#message(STATUS "Arguments to execute_process: ${ARGN}")
|
||||
|
||||
execute_process(COMMAND
|
||||
${GIT_EXECUTABLE}
|
||||
describe
|
||||
${hash}
|
||||
${ARGN}
|
||||
WORKING_DIRECTORY
|
||||
"${CMAKE_SOURCE_DIR}"
|
||||
RESULT_VARIABLE
|
||||
res
|
||||
OUTPUT_VARIABLE
|
||||
out
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT res EQUAL 0)
|
||||
set(out "${out}-${res}-NOTFOUND")
|
||||
endif()
|
||||
|
||||
set(${_var} "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_get_exact_tag _var)
|
||||
git_describe(out --exact-match ${ARGN})
|
||||
set(${_var} "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_get_tag _var)
|
||||
git_describe(out --tags ${ARGN})
|
||||
set(${_var} "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
@ -1,23 +0,0 @@
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
@ -1,72 +0,0 @@
|
||||
Additional CMake Modules
|
||||
========================
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
This is a collection of additional CMake modules.
|
||||
Most of them are from Ryan Pavlik (<http://academic.cleardefinition.com>).
|
||||
|
||||
How to Integrate
|
||||
----------------
|
||||
|
||||
These modules are probably best placed wholesale into a "cmake" subdirectory
|
||||
of your project source.
|
||||
|
||||
If you use Git, try installing [git-subtree][1],
|
||||
so you can easily use this repository for subtree merges, updating simply.
|
||||
|
||||
For the initial checkout:
|
||||
|
||||
cd projectdir
|
||||
|
||||
git subtree add --squash --prefix=cmake git@github.com:bilke/cmake-modules.git master
|
||||
|
||||
For updates:
|
||||
|
||||
cd projectdir
|
||||
|
||||
git subtree pull --squash --prefix=cmake git@github.com:bilke/cmake-modules.git master
|
||||
|
||||
For pushing to upstream:
|
||||
|
||||
cd projectdir
|
||||
|
||||
git subtree push --prefix=cmake git@github.com:bilke/cmake-modules.git master
|
||||
|
||||
|
||||
How to Use
|
||||
----------
|
||||
|
||||
At the minimum, all you have to do is add a line like this near the top
|
||||
of your root CMakeLists.txt file (but not before your project() call):
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
|
||||
Licenses
|
||||
--------
|
||||
|
||||
The modules that are written by Ryan Pavlik are all subject to this license:
|
||||
|
||||
> Copyright Iowa State University 2009-2011
|
||||
>
|
||||
> Distributed under the Boost Software License, Version 1.0.
|
||||
>
|
||||
> (See accompanying file `LICENSE_1_0.txt` or copy at
|
||||
> <http://www.boost.org/LICENSE_1_0.txt>)
|
||||
|
||||
Modules based on those included with CMake as well as modules added by me (Lars
|
||||
Bilke) are under the OSI-approved **BSD** license, which is included in each of
|
||||
those modules. A few other modules are modified from other sources - when in
|
||||
doubt, look at the .cmake.
|
||||
|
||||
Important License Note!
|
||||
-----------------------
|
||||
|
||||
If you find this file inside of another project, rather at the top-level
|
||||
directory, you're in a separate project that is making use of these modules.
|
||||
That separate project can (and probably does) have its own license specifics.
|
||||
|
||||
|
||||
[1]: http://github.com/apenwarr/git-subtree "Git Subtree master"
|
||||
@ -1,11 +0,0 @@
|
||||
[requires]
|
||||
Poco/1.9.4@pocoproject/stable
|
||||
libsodium/1.0.18@bincrafters/stable
|
||||
boost/1.71.0@conan/stable
|
||||
gtest/1.10.0
|
||||
|
||||
[options]
|
||||
Poco:enable_pagecompiler=True
|
||||
|
||||
[generators]
|
||||
cmake
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit 7304f680be32915e772466ebddc5b7d3b453abd9
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit 8aedf4733884a25434b5c17c79c7e7dee27e6eb0
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit 159540fe8c8f30b281748fe8a1b79e8b17993a67
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit b95393dcc3640807838e8323b4e600e54d2e8116
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit 0b8d13a1d4cd9be16ed8a2230577aa9c296aa1ca
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit 336789e62363357d87894983e6cbdd6da6c838ea
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit 9929246b87f0946b124cfa2a89894b8943b0b072
|
||||
1
login_server/doc/.gitignore
vendored
1
login_server/doc/.gitignore
vendored
@ -1 +0,0 @@
|
||||
html
|
||||
@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
chmod +x compile_pot.sh
|
||||
./compile_pot.sh
|
||||
|
||||
cd ../build
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||
make -j$(nproc) Gradido_LoginServer
|
||||
|
||||
chmod +x ./bin/Gradido_LoginServer
|
||||
@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
xgettext -D ../ -p ../src/LOCALE -o messages.pot --from-code=UTF-8 --files-from=files_to_translate.txt
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
build/http_pages/LoginPage.cpp
|
||||
build/http_pages/CheckEmailPage.cpp
|
||||
build/http_pages/ResetPasswordPage.cpp
|
||||
build/http_pages/PassphrasePage.cpp
|
||||
src/cpp/model/Session.cpp
|
||||
src/cpp/model/email/Email.cpp
|
||||
src/cpp/model/email/EmailCustomReply.cpp
|
||||
src/cpp/model/email/EmailNotificationCreation.cpp
|
||||
src/cpp/model/email/EmailNotificationTransfer.cpp
|
||||
src/cpp/SingletonManager/SessionManager.cpp
|
||||
@ -1,20 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# generate version for mariadb connector
|
||||
|
||||
cd ../dependencies/mariadb-connector-c
|
||||
if [ -d "./build" ] ; then
|
||||
rm -rf ./build
|
||||
fi
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DWITH_SSL=OFF ..
|
||||
cd ../../../
|
||||
|
||||
if [ ! -d "./build" ] ; then
|
||||
mkdir build
|
||||
fi
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||
make -j$(nproc) protoc PageCompiler
|
||||
cmake ..
|
||||
@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ../build
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DCOLLECT_COVERAGE_DATA=ON -DCOVERAGE_TOOL=gcovr .. && \
|
||||
make -j$(nproc) Gradido_LoginServer_Test
|
||||
make coverage
|
||||
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
if [ ! -d "../src/cpp/proto" ] ; then
|
||||
mkdir ../src/cpp/proto
|
||||
fi
|
||||
if [ ! -d "../src/cpp/proto/gradido" ] ; then
|
||||
mkdir ../src/cpp/proto/gradido
|
||||
fi
|
||||
PROTOC_PATH=../build/bin
|
||||
CPP_PLUGIN_PATH=../build/bin
|
||||
$PROTOC_PATH/protoc --cpp_out=../src/cpp/proto --proto_path=../src/proto ../src/proto/gradido/*.proto
|
||||
|
||||
if [ ! -d "../src/cpp/proto/hedera" ] ; then
|
||||
mkdir ../src/cpp/proto/hedera
|
||||
fi
|
||||
|
||||
GOOGLE_PROTOBUF_INCLUDES=../dependencies/grpc/third_party/protobuf/src
|
||||
$PROTOC_PATH/protoc --plugin=protoc-gen-grpc=$CPP_PLUGIN_PATH/grpc_cpp_plugin --cpp_out=../src/cpp/proto/hedera --grpc_out=../src/cpp/proto/hedera --proto_path=$GOOGLE_PROTOBUF_INCLUDES --proto_path=../src/proto/hedera/hedera-protobuf/src/main/proto ../src/proto/hedera/hedera-protobuf/src/main/proto/*.proto
|
||||
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ ! -d "../src/cpp/proto" ] ; then
|
||||
mkdir ../src/cpp/proto
|
||||
fi
|
||||
if [ ! -d "../src/cpp/proto/gradido" ] ; then
|
||||
mkdir ../src/cpp/proto/gradido
|
||||
fi
|
||||
PROTOC_PATH=../build/dependencies/protobuf/cmake/bin/Debug
|
||||
|
||||
$PROTOC_PATH/protoc.exe --cpp_out=../build/proto/gradido --proto_path=../src/proto ../src/proto/gradido/*.proto
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user