mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 1555-Admin-see-user-generated-link
This commit is contained in:
commit
09360f70ee
@ -1,3 +1,5 @@
|
||||
CONFIG_VERSION=v1.2022-03-18
|
||||
|
||||
GRAPHQL_URI=http://localhost:4000/graphql
|
||||
WALLET_AUTH_URL=http://localhost/authenticate?token={token}
|
||||
WALLET_URL=http://localhost/login
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
CONFIG_VERSION=$ADMIN_CONFIG_VERSION
|
||||
|
||||
GRAPHQL_URI=$GRAPHQL_URI
|
||||
WALLET_AUTH_URL=$WALLET_AUTH_URL
|
||||
WALLET_URL=$WALLET_URL
|
||||
|
||||
@ -4,11 +4,20 @@
|
||||
// Load Package Details for some default values
|
||||
const pkg = require('../../package')
|
||||
|
||||
const constants = {
|
||||
CONFIG_VERSION: {
|
||||
DEFAULT: 'DEFAULT',
|
||||
EXPECTED: 'v1.2022-03-18',
|
||||
CURRENT: '',
|
||||
},
|
||||
}
|
||||
|
||||
const version = {
|
||||
APP_VERSION: pkg.version,
|
||||
BUILD_COMMIT: process.env.BUILD_COMMIT || null,
|
||||
// self reference of `version.BUILD_COMMIT` is not possible at this point, hence the duplicate code
|
||||
BUILD_COMMIT_SHORT: (process.env.BUILD_COMMIT || '0000000').substr(0, 7),
|
||||
BUILD_COMMIT_SHORT: (process.env.BUILD_COMMIT || '0000000').slice(0, 7),
|
||||
PORT: process.env.PORT || 8080,
|
||||
}
|
||||
|
||||
const environment = {
|
||||
@ -27,14 +36,24 @@ const debug = {
|
||||
DEBUG_DISABLE_AUTH: process.env.DEBUG_DISABLE_AUTH === 'true' || false,
|
||||
}
|
||||
|
||||
const options = {}
|
||||
// Check config version
|
||||
constants.CONFIG_VERSION.CURRENT = process.env.CONFIG_VERSION || constants.CONFIG_VERSION.DEFAULT
|
||||
if (
|
||||
![constants.CONFIG_VERSION.EXPECTED, constants.CONFIG_VERSION.DEFAULT].includes(
|
||||
constants.CONFIG_VERSION.CURRENT,
|
||||
)
|
||||
) {
|
||||
throw new Error(
|
||||
`Fatal: Config Version incorrect - expected "${constants.CONFIG_VERSION.EXPECTED}" or "${constants.CONFIG_VERSION.DEFAULT}", but found "${constants.CONFIG_VERSION.CURRENT}"`,
|
||||
)
|
||||
}
|
||||
|
||||
const CONFIG = {
|
||||
...constants,
|
||||
...version,
|
||||
...environment,
|
||||
...endpoints,
|
||||
...options,
|
||||
...debug,
|
||||
}
|
||||
|
||||
export default CONFIG
|
||||
module.exports = CONFIG
|
||||
|
||||
@ -2,11 +2,12 @@ const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const Dotenv = require('dotenv-webpack')
|
||||
const StatsPlugin = require('stats-webpack-plugin')
|
||||
const CONFIG = require('./src/config')
|
||||
|
||||
// vue.config.js
|
||||
module.exports = {
|
||||
devServer: {
|
||||
port: process.env.PORT || 8080,
|
||||
port: CONFIG.PORT,
|
||||
},
|
||||
pluginOptions: {
|
||||
i18n: {
|
||||
@ -34,7 +35,7 @@ module.exports = {
|
||||
// 'process.env.DOCKER_WORKDIR': JSON.stringify(process.env.DOCKER_WORKDIR),
|
||||
// 'process.env.BUILD_DATE': JSON.stringify(process.env.BUILD_DATE),
|
||||
// 'process.env.BUILD_VERSION': JSON.stringify(process.env.BUILD_VERSION),
|
||||
'process.env.BUILD_COMMIT': JSON.stringify(process.env.BUILD_COMMIT),
|
||||
'process.env.BUILD_COMMIT': JSON.stringify(CONFIG.BUILD_COMMIT),
|
||||
// 'process.env.PORT': JSON.stringify(process.env.PORT),
|
||||
}),
|
||||
// generate webpack stats to allow analysis of the bundlesize
|
||||
@ -46,7 +47,7 @@ module.exports = {
|
||||
},
|
||||
css: {
|
||||
// Enable CSS source maps.
|
||||
sourceMap: process.env.NODE_ENV !== 'production',
|
||||
sourceMap: CONFIG.NODE_ENV !== 'production',
|
||||
},
|
||||
outputDir: path.resolve(__dirname, './dist'),
|
||||
}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
CONFIG_VERSION=v1.2022-03-18
|
||||
|
||||
# Server
|
||||
PORT=4000
|
||||
JWT_SECRET=secret123
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
CONFIG_VERSION=$BACKEND_CONFIG_VERSION
|
||||
|
||||
# Server
|
||||
JWT_SECRET=$JWT_SECRET
|
||||
JWT_EXPIRES_IN=10m
|
||||
|
||||
@ -12,6 +12,11 @@ Decimal.set({
|
||||
const constants = {
|
||||
DB_VERSION: '0033-add_referrer_id',
|
||||
DECAY_START_TIME: new Date('2021-05-13 17:46:31'), // GMT+0
|
||||
CONFIG_VERSION: {
|
||||
DEFAULT: 'DEFAULT',
|
||||
EXPECTED: 'v1.2022-03-18',
|
||||
CURRENT: '',
|
||||
},
|
||||
}
|
||||
|
||||
const server = {
|
||||
@ -78,6 +83,18 @@ const webhook = {
|
||||
// This is needed by graphql-directive-auth
|
||||
process.env.APP_SECRET = server.JWT_SECRET
|
||||
|
||||
// Check config version
|
||||
constants.CONFIG_VERSION.CURRENT = process.env.CONFIG_VERSION || constants.CONFIG_VERSION.DEFAULT
|
||||
if (
|
||||
![constants.CONFIG_VERSION.EXPECTED, constants.CONFIG_VERSION.DEFAULT].includes(
|
||||
constants.CONFIG_VERSION.CURRENT,
|
||||
)
|
||||
) {
|
||||
throw new Error(
|
||||
`Fatal: Config Version incorrect - expected "${constants.CONFIG_VERSION.EXPECTED}" or "${constants.CONFIG_VERSION.DEFAULT}", but found "${constants.CONFIG_VERSION.CURRENT}"`,
|
||||
)
|
||||
}
|
||||
|
||||
const CONFIG = {
|
||||
...constants,
|
||||
...server,
|
||||
|
||||
@ -117,6 +117,7 @@ export const executeTransaction = async (
|
||||
recipientFirstName: recipient.firstName,
|
||||
recipientLastName: recipient.lastName,
|
||||
email: recipient.email,
|
||||
senderEmail: sender.email,
|
||||
amount,
|
||||
memo,
|
||||
})
|
||||
|
||||
@ -17,6 +17,7 @@ describe('sendTransactionReceivedEmail', () => {
|
||||
recipientFirstName: 'Peter',
|
||||
recipientLastName: 'Lustig',
|
||||
email: 'peter@lustig.de',
|
||||
senderEmail: 'bibi@bloxberg.de',
|
||||
amount: new Decimal(42.0),
|
||||
memo: 'Vielen herzlichen Dank für den neuen Hexenbesen!',
|
||||
})
|
||||
@ -30,6 +31,7 @@ describe('sendTransactionReceivedEmail', () => {
|
||||
expect.stringContaining('Hallo Peter Lustig') &&
|
||||
expect.stringContaining('42,00 GDD') &&
|
||||
expect.stringContaining('Bibi Bloxberg') &&
|
||||
expect.stringContaining('(bibi@bloxberg.de)') &&
|
||||
expect.stringContaining('Vielen herzlichen Dank für den neuen Hexenbesen!'),
|
||||
})
|
||||
})
|
||||
|
||||
@ -8,6 +8,7 @@ export const sendTransactionReceivedEmail = (data: {
|
||||
recipientFirstName: string
|
||||
recipientLastName: string
|
||||
email: string
|
||||
senderEmail: string
|
||||
amount: Decimal
|
||||
memo: string
|
||||
}): Promise<boolean> => {
|
||||
|
||||
@ -9,6 +9,7 @@ export const transactionReceived = {
|
||||
recipientFirstName: string
|
||||
recipientLastName: string
|
||||
email: string
|
||||
senderEmail: string
|
||||
amount: Decimal
|
||||
memo: string
|
||||
}): string =>
|
||||
@ -16,7 +17,7 @@ export const transactionReceived = {
|
||||
|
||||
Du hast soeben ${data.amount.toFixed(2).replace('.', ',')} GDD von ${data.senderFirstName} ${
|
||||
data.senderLastName
|
||||
} erhalten.
|
||||
} (${data.senderEmail}) erhalten.
|
||||
${data.senderFirstName} ${data.senderLastName} schreibt:
|
||||
|
||||
${data.memo}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
CONFIG_VERSION=v1.2022-03-18
|
||||
|
||||
DB_HOST=localhost
|
||||
DB_PORT=3306
|
||||
DB_USER=root
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
CONFIG_VERSION=$DATABASE_CONFIG_VERSION
|
||||
|
||||
DB_HOST=localhost
|
||||
DB_PORT=3306
|
||||
DB_USER=$DB_USER
|
||||
|
||||
@ -3,6 +3,14 @@
|
||||
import dotenv from 'dotenv'
|
||||
dotenv.config()
|
||||
|
||||
const constants = {
|
||||
CONFIG_VERSION: {
|
||||
DEFAULT: 'DEFAULT',
|
||||
EXPECTED: 'v1.2022-03-18',
|
||||
CURRENT: '',
|
||||
},
|
||||
}
|
||||
|
||||
const database = {
|
||||
DB_HOST: process.env.DB_HOST || 'localhost',
|
||||
DB_PORT: process.env.DB_PORT ? parseInt(process.env.DB_PORT) : 3306,
|
||||
@ -15,6 +23,18 @@ const migrations = {
|
||||
MIGRATIONS_TABLE: process.env.MIGRATIONS_TABLE || 'migrations',
|
||||
}
|
||||
|
||||
const CONFIG = { ...database, ...migrations }
|
||||
// Check config version
|
||||
constants.CONFIG_VERSION.CURRENT = process.env.CONFIG_VERSION || constants.CONFIG_VERSION.DEFAULT
|
||||
if (
|
||||
![constants.CONFIG_VERSION.EXPECTED, constants.CONFIG_VERSION.DEFAULT].includes(
|
||||
constants.CONFIG_VERSION.CURRENT,
|
||||
)
|
||||
) {
|
||||
throw new Error(
|
||||
`Fatal: Config Version incorrect - expected "${constants.CONFIG_VERSION.EXPECTED}" or "${constants.CONFIG_VERSION.DEFAULT}", but found "${constants.CONFIG_VERSION.CURRENT}"`,
|
||||
)
|
||||
}
|
||||
|
||||
const CONFIG = { ...constants, ...database, ...migrations }
|
||||
|
||||
export default CONFIG
|
||||
|
||||
@ -18,6 +18,8 @@ WEBHOOK_GITHUB_SECRET=secret
|
||||
WEBHOOK_GITHUB_BRANCH=master
|
||||
|
||||
# backend
|
||||
BACKEND_CONFIG_VERSION=v1.2022-03-18
|
||||
|
||||
EMAIL=true
|
||||
EMAIL_USERNAME=peter@lustig.de
|
||||
EMAIL_SENDER=peter@lustig.de
|
||||
@ -43,6 +45,9 @@ KLICKTIPP_PASSWORD=
|
||||
KLICKTIPP_APIKEY_DE=
|
||||
KLICKTIPP_APIKEY_EN=
|
||||
|
||||
# database
|
||||
DATABASE_CONFIG_VERSION=v1.2022-03-18
|
||||
|
||||
# frontend
|
||||
GRAPHQL_URI=https://stage1.gradido.net/graphql
|
||||
ADMIN_AUTH_URL=https://stage1.gradido.net/admin/authenticate?token={token}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
CONFIG_VERSION=v1.2022-03-18
|
||||
|
||||
META_URL=http://localhost
|
||||
META_TITLE_DE="Gradido – Dein Dankbarkeitskonto"
|
||||
META_TITLE_EN="Gradido - Your gratitude account"
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
CONFIG_VERSION=$FRONTEND_CONFIG_VERSION
|
||||
|
||||
META_URL=$META_URL
|
||||
META_TITLE_DE=$META_TITLE_DE
|
||||
META_TITLE_EN=$META_TITLE_EN
|
||||
|
||||
@ -4,11 +4,19 @@
|
||||
// Load Package Details for some default values
|
||||
const pkg = require('../../package')
|
||||
|
||||
const constants = {
|
||||
CONFIG_VERSION: {
|
||||
DEFAULT: 'DEFAULT',
|
||||
EXPECTED: 'v1.2022-03-18',
|
||||
CURRENT: '',
|
||||
},
|
||||
}
|
||||
|
||||
const version = {
|
||||
APP_VERSION: pkg.version,
|
||||
BUILD_COMMIT: process.env.BUILD_COMMIT || null,
|
||||
// self reference of `version.BUILD_COMMIT` is not possible at this point, hence the duplicate code
|
||||
BUILD_COMMIT_SHORT: (process.env.BUILD_COMMIT || '0000000').substr(0, 7),
|
||||
BUILD_COMMIT_SHORT: (process.env.BUILD_COMMIT || '0000000').slice(0, 7),
|
||||
}
|
||||
|
||||
const environment = {
|
||||
@ -16,39 +24,51 @@ const environment = {
|
||||
DEBUG: process.env.NODE_ENV !== 'production' || false,
|
||||
PRODUCTION: process.env.NODE_ENV === 'production' || false,
|
||||
DEFAULT_PUBLISHER_ID: process.env.DEFAULT_PUBLISHER_ID || 2896,
|
||||
PORT: process.env.PORT || 3000,
|
||||
}
|
||||
|
||||
// const meta = {
|
||||
// META_URL: process.env.META_URL || 'http://localhost',
|
||||
// META_TITLE_DE: process.env.META_TITLE_DE || 'Gradido – Dein Dankbarkeitskonto',
|
||||
// META_TITLE_EN: process.env.META_TITLE_EN || 'Gradido - Your gratitude account',
|
||||
// META_DESCRIPTION_DE:
|
||||
// process.env.META_DESCRIPTION_DE ||
|
||||
// 'Dankbarkeit ist die Währung der neuen Zeit. Immer mehr Menschen entfalten ihr Potenzial und gestalten eine gute Zukunft für alle.',
|
||||
// META_DESCRIPTION_EN:
|
||||
// process.env.META_DESCRIPTION_EN ||
|
||||
// 'Gratitude is the currency of the new age. More and more people are unleashing their potential and shaping a good future for all.',
|
||||
// META_KEYWORDS_DE:
|
||||
// process.env.META_KEYWORDS_DE ||
|
||||
// 'Grundeinkommen, Währung, Dankbarkeit, Schenk-Ökonomie, Natürliche Ökonomie des Lebens, Ökonomie, Ökologie, Potenzialentfaltung, Schenken und Danken, Kreislauf des Lebens, Geldsystem',
|
||||
// META_KEYWORDS_EN:
|
||||
// process.env.META_KEYWORDS_EN ||
|
||||
// 'Basic Income, Currency, Gratitude, Gift Economy, Natural Economy of Life, Economy, Ecology, Potential Development, Giving and Thanking, Cycle of Life, Monetary System',
|
||||
// META_AUTHOR: process.env.META_AUTHOR || 'Bernd Hückstädt - Gradido-Akademie',
|
||||
// }
|
||||
const meta = {
|
||||
META_URL: process.env.META_URL || 'http://localhost',
|
||||
META_TITLE_DE: process.env.META_TITLE_DE || 'Gradido – Dein Dankbarkeitskonto',
|
||||
META_TITLE_EN: process.env.META_TITLE_EN || 'Gradido - Your gratitude account',
|
||||
META_DESCRIPTION_DE:
|
||||
process.env.META_DESCRIPTION_DE ||
|
||||
'Dankbarkeit ist die Währung der neuen Zeit. Immer mehr Menschen entfalten ihr Potenzial und gestalten eine gute Zukunft für alle.',
|
||||
META_DESCRIPTION_EN:
|
||||
process.env.META_DESCRIPTION_EN ||
|
||||
'Gratitude is the currency of the new age. More and more people are unleashing their potential and shaping a good future for all.',
|
||||
META_KEYWORDS_DE:
|
||||
process.env.META_KEYWORDS_DE ||
|
||||
'Grundeinkommen, Währung, Dankbarkeit, Schenk-Ökonomie, Natürliche Ökonomie des Lebens, Ökonomie, Ökologie, Potenzialentfaltung, Schenken und Danken, Kreislauf des Lebens, Geldsystem',
|
||||
META_KEYWORDS_EN:
|
||||
process.env.META_KEYWORDS_EN ||
|
||||
'Basic Income, Currency, Gratitude, Gift Economy, Natural Economy of Life, Economy, Ecology, Potential Development, Giving and Thanking, Cycle of Life, Monetary System',
|
||||
META_AUTHOR: process.env.META_AUTHOR || 'Bernd Hückstädt - Gradido-Akademie',
|
||||
}
|
||||
|
||||
const endpoints = {
|
||||
GRAPHQL_URI: process.env.GRAPHQL_URI || 'http://localhost/graphql',
|
||||
ADMIN_AUTH_URL: process.env.ADMIN_AUTH_URL || 'http://localhost/admin/authenticate?token={token}',
|
||||
}
|
||||
|
||||
const options = {}
|
||||
// Check config version
|
||||
constants.CONFIG_VERSION.CURRENT = process.env.CONFIG_VERSION || constants.CONFIG_VERSION.DEFAULT
|
||||
if (
|
||||
![constants.CONFIG_VERSION.EXPECTED, constants.CONFIG_VERSION.DEFAULT].includes(
|
||||
constants.CONFIG_VERSION.CURRENT,
|
||||
)
|
||||
) {
|
||||
throw new Error(
|
||||
`Fatal: Config Version incorrect - expected "${constants.CONFIG_VERSION.EXPECTED}" or "${constants.CONFIG_VERSION.DEFAULT}", but found "${constants.CONFIG_VERSION.CURRENT}"`,
|
||||
)
|
||||
}
|
||||
|
||||
const CONFIG = {
|
||||
...constants,
|
||||
...version,
|
||||
...environment,
|
||||
...endpoints,
|
||||
...options,
|
||||
...meta,
|
||||
}
|
||||
|
||||
export default CONFIG
|
||||
module.exports = CONFIG
|
||||
|
||||
@ -3,11 +3,12 @@ const webpack = require('webpack')
|
||||
const Dotenv = require('dotenv-webpack')
|
||||
const StatsPlugin = require('stats-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('vue-html-webpack-plugin')
|
||||
const CONFIG = require('./src/config')
|
||||
|
||||
// vue.config.js
|
||||
module.exports = {
|
||||
devServer: {
|
||||
port: process.env.PORT || 3000,
|
||||
port: CONFIG.PORT,
|
||||
},
|
||||
pluginOptions: {
|
||||
i18n: {
|
||||
@ -35,7 +36,7 @@ module.exports = {
|
||||
// 'process.env.DOCKER_WORKDIR': JSON.stringify(process.env.DOCKER_WORKDIR),
|
||||
// 'process.env.BUILD_DATE': JSON.stringify(process.env.BUILD_DATE),
|
||||
// 'process.env.BUILD_VERSION': JSON.stringify(process.env.BUILD_VERSION),
|
||||
'process.env.BUILD_COMMIT': JSON.stringify(process.env.BUILD_COMMIT),
|
||||
'process.env.BUILD_COMMIT': JSON.stringify(CONFIG.BUILD_COMMIT),
|
||||
// 'process.env.PORT': JSON.stringify(process.env.PORT),
|
||||
}),
|
||||
// generate webpack stats to allow analysis of the bundlesize
|
||||
@ -44,14 +45,14 @@ module.exports = {
|
||||
vue: true,
|
||||
template: 'public/index.html',
|
||||
meta: {
|
||||
title_de: process.env.META_TITLE_DE,
|
||||
title_en: process.env.META_TITLE_EN,
|
||||
description_de: process.env.META_DESCRIPTION_DE,
|
||||
description_en: process.env.META_DESCRIPTION_EN,
|
||||
keywords_de: process.env.META_KEYWORDS_DE,
|
||||
keywords_en: process.env.META_KEYWORDS_EN,
|
||||
author: process.env.META_AUTHOR,
|
||||
url: process.env.META_URL,
|
||||
title_de: CONFIG.META_TITLE_DE,
|
||||
title_en: CONFIG.META_TITLE_EN,
|
||||
description_de: CONFIG.META_DESCRIPTION_DE,
|
||||
description_en: CONFIG.META_DESCRIPTION_EN,
|
||||
keywords_de: CONFIG.META_KEYWORDS_DE,
|
||||
keywords_en: CONFIG.META_KEYWORDS_EN,
|
||||
author: CONFIG.META_AUTHOR,
|
||||
url: CONFIG.META_URL,
|
||||
},
|
||||
}),
|
||||
],
|
||||
@ -61,7 +62,7 @@ module.exports = {
|
||||
},
|
||||
css: {
|
||||
// Enable CSS source maps.
|
||||
sourceMap: process.env.NODE_ENV !== 'production',
|
||||
sourceMap: CONFIG.NODE_ENV !== 'production',
|
||||
},
|
||||
outputDir: path.resolve(__dirname, './dist'),
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user