mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
Merge branch 'master' into more-unit-tests-frontend
This commit is contained in:
commit
61d212c649
@ -21,11 +21,6 @@ KLICKTIPP_PASSWORD=secret321
|
||||
KLICKTIPP_APIKEY_DE=SomeFakeKeyDE
|
||||
KLICKTIPP_APIKEY_EN=SomeFakeKeyEN
|
||||
|
||||
# IOTA
|
||||
IOTA=false
|
||||
IOTA_API_URL=https://chrysalis-nodes.iota.org
|
||||
IOTA_COMMUNITY_ALIAS=GRADIDO: TestHelloWelt1
|
||||
|
||||
# Community
|
||||
COMMUNITY_NAME=Gradido Entwicklung
|
||||
COMMUNITY_URL=http://localhost/
|
||||
|
||||
@ -22,11 +22,6 @@ KLICKTIPP_PASSWORD=$KLICKTIPP_PASSWORD
|
||||
KLICKTIPP_APIKEY_DE=$KLICKTIPP_APIKEY_DE
|
||||
KLICKTIPP_APIKEY_EN=$KLICKTIPP_APIKEY_EN
|
||||
|
||||
# IOTA
|
||||
IOTA=$IOTA
|
||||
IOTA_API_URL=https://chrysalis-nodes.iota.org
|
||||
IOTA_COMMUNITY_ALIAS=GRADIDO: TestHelloWelt1
|
||||
|
||||
# Community
|
||||
COMMUNITY_NAME=$COMMUNITY_NAME
|
||||
COMMUNITY_URL=$COMMUNITY_URL
|
||||
|
||||
@ -33,8 +33,6 @@ LABEL maintainer="support@gradido.net"
|
||||
# Install Additional Software
|
||||
## install: git
|
||||
#RUN apk --no-cache add git
|
||||
# Install Build Tool for Rust for @iota/client
|
||||
RUN apk add --no-cache rust cargo python3 make g++
|
||||
|
||||
# Settings
|
||||
## Expose Container Port
|
||||
@ -94,9 +92,6 @@ CMD /bin/sh -c "yarn run start"
|
||||
##################################################################################
|
||||
FROM base as production
|
||||
|
||||
# Remove Build Tool for Rust else they would bloat the image unneccessary
|
||||
RUN apk del rust cargo python3 make g++
|
||||
|
||||
# Copy "binary"-files from build image
|
||||
COPY --from=build ${DOCKER_WORKDIR}/build ./build
|
||||
COPY --from=build ${DOCKER_WORKDIR}/../database/build ../database/build
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
"locales": "scripts/sort.sh"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iota/client": "^2",
|
||||
"apollo-server-express": "^2.25.2",
|
||||
"await-semaphore": "^0.1.3",
|
||||
"axios": "^0.21.1",
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import { IotaClientSingleton } from '@/apis/IotaConnector'
|
||||
import { CONFIG } from '@/config'
|
||||
|
||||
CONFIG.IOTA = true
|
||||
CONFIG.IOTA_COMMUNITY_ALIAS = 'GRADIDO: TestHelloWelt1'
|
||||
CONFIG.IOTA_API_URL = 'https://chrysalis-nodes.iota.org'
|
||||
|
||||
describe('apis/IotaConnector/enabled', () => {
|
||||
describe('Hello World', () => {
|
||||
const now = new Date()
|
||||
let messageId: string
|
||||
const messageString = 'Hello World - ' + now.toString()
|
||||
const messageHexString = Buffer.from(messageString, 'utf8').toString('hex')
|
||||
const indexHexString = Buffer.from(CONFIG.IOTA_COMMUNITY_ALIAS, 'utf8').toString('hex')
|
||||
it('sends hello world message to iota tangle', async () => {
|
||||
const iotaMessage = await IotaClientSingleton.getInstance()?.sendDataMessage(messageString)
|
||||
expect(iotaMessage).toMatchObject({
|
||||
message: {
|
||||
payload: {
|
||||
data: messageHexString,
|
||||
index: indexHexString,
|
||||
},
|
||||
},
|
||||
messageId: expect.any(String),
|
||||
})
|
||||
messageId =
|
||||
iotaMessage?.messageId ?? '5498130bc3918e1a7143969ce05805502417e3e1bd596d3c44d6a0adeea22710'
|
||||
})
|
||||
it('receives hello world message from iota tangle by message id', async () => {
|
||||
const iotaMessage = await IotaClientSingleton.getInstance()?.getMessage(messageId)
|
||||
expect(iotaMessage).toMatchObject({
|
||||
message: {
|
||||
payload: {
|
||||
data: messageHexString,
|
||||
index: indexHexString,
|
||||
},
|
||||
},
|
||||
messageId,
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -1,93 +0,0 @@
|
||||
import { Client, ClientBuilder } from '@iota/client'
|
||||
import { MessageWrapper } from '@iota/client/lib/types'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
// Source: https://refactoring.guru/design-patterns/singleton/typescript/example
|
||||
// and ../federation/client/FederationClientFactory.ts
|
||||
/**
|
||||
* A Singleton class defines the `getInstance` method that lets clients access
|
||||
* the unique singleton instance.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
||||
class IotaClientSingleton {
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
private static instance: IotaClientSingleton
|
||||
private client: Client
|
||||
/**
|
||||
* The Singleton's constructor should always be private to prevent direct
|
||||
* construction calls with the `new` operator.
|
||||
*/
|
||||
// eslint-disable-next-line no-useless-constructor, @typescript-eslint/no-empty-function
|
||||
private constructor() {}
|
||||
|
||||
/**
|
||||
* The static method that controls the access to the singleton instance.
|
||||
*
|
||||
* This implementation let you subclass the Singleton class while keeping
|
||||
* just one instance of each subclass around.
|
||||
*/
|
||||
public static getInstance(): IotaClientSingleton | undefined {
|
||||
if (!CONFIG.IOTA || !CONFIG.IOTA_API_URL) {
|
||||
logger.info(`Iota are disabled via config...`)
|
||||
return
|
||||
}
|
||||
if (!IotaClientSingleton.instance) {
|
||||
IotaClientSingleton.instance = new IotaClientSingleton()
|
||||
try {
|
||||
IotaClientSingleton.instance.client = new ClientBuilder().node(CONFIG.IOTA_API_URL).build()
|
||||
} catch (e) {
|
||||
logger.error("couldn't connect to iota")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return IotaClientSingleton.instance
|
||||
}
|
||||
|
||||
/**
|
||||
* send data message onto iota tangle
|
||||
* use CONFIG.IOTA_COMMUNITY_ALIAS for index
|
||||
* @param {string} message - the message as utf based string, will be converted to hex automatically from @iota/client
|
||||
* @return {Promise<MessageWrapper>} the iota message typed
|
||||
*/
|
||||
public sendDataMessage(message: string): Promise<MessageWrapper> {
|
||||
return this.client.message().index(CONFIG.IOTA_COMMUNITY_ALIAS).data(message).submit()
|
||||
}
|
||||
|
||||
/**
|
||||
* receive message for known message id from iota tangle
|
||||
* @param {string} messageId - as hex string
|
||||
* @return {Promise<MessageWrapper>} the iota message typed
|
||||
*/
|
||||
public getMessage(messageId: string): Promise<MessageWrapper> {
|
||||
return this.client.getMessage().data(messageId)
|
||||
}
|
||||
}
|
||||
|
||||
export { IotaClientSingleton }
|
||||
|
||||
/**
|
||||
* example for message:
|
||||
```json
|
||||
{
|
||||
message: {
|
||||
networkId: '1454675179895816119',
|
||||
parentMessageIds: [
|
||||
'5f30efecca59fdfef7c103e85ef691b2b1dc474e9eae9056888a6d58605083e7',
|
||||
'77cef2fb405daedcd7469e009bb87a6d9a4840e618cdb599cd21a30a9fec88dc',
|
||||
'7d2cfb39f40585ba568a29ad7e85c1478b2584496eb736d4001ac344f6a6cacf',
|
||||
'c66da602874220dfa26925f6be540d37c0084d37cd04726fcc5be9d80b36f850'
|
||||
],
|
||||
payload: {
|
||||
type: 2,
|
||||
index: '4752414449444f3a205465737448656c6c6f57656c7431',
|
||||
data: '48656c6c6f20576f726c64202d20546875204a756e20303820323032332031343a35393a343520474d542b3030303020284b6f6f7264696e69657274652057656c747a65697429'
|
||||
},
|
||||
nonce: '13835058055282465157'
|
||||
},
|
||||
messageId: '5498130bc3918e1a7143969ce05805502417e3e1bd596d3c44d6a0adeea22710'
|
||||
}
|
||||
```
|
||||
*/
|
||||
@ -1,26 +0,0 @@
|
||||
import { IotaClientSingleton } from '@/apis/IotaConnector'
|
||||
import { CONFIG } from '@/config'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
describe('apis/IotaConnector/disabled', () => {
|
||||
beforeEach(() => {
|
||||
CONFIG.IOTA = false
|
||||
})
|
||||
it('getInstance return undefined if iota is disabled', () => {
|
||||
const spyLog = jest.spyOn(logger, 'info')
|
||||
expect(IotaClientSingleton.getInstance()).toBeUndefined()
|
||||
expect(spyLog).toHaveBeenCalledWith('Iota are disabled via config...')
|
||||
})
|
||||
})
|
||||
|
||||
describe('apis/IotaConnector/invalidIotaUrl', () => {
|
||||
beforeEach(() => {
|
||||
CONFIG.IOTA = true
|
||||
CONFIG.IOTA_API_URL = 'invalidUrl'
|
||||
})
|
||||
it('log "couldn\'t connect to iota"', () => {
|
||||
const spyLog = jest.spyOn(logger, 'error')
|
||||
expect(IotaClientSingleton.getInstance()).toBeUndefined()
|
||||
expect(spyLog).toHaveBeenCalledWith("couldn't connect to iota")
|
||||
})
|
||||
})
|
||||
@ -19,7 +19,7 @@ const constants = {
|
||||
LOG_LEVEL: process.env.LOG_LEVEL ?? 'info',
|
||||
CONFIG_VERSION: {
|
||||
DEFAULT: 'DEFAULT',
|
||||
EXPECTED: 'v16.2023-06-08',
|
||||
EXPECTED: 'v17.2023-07-03',
|
||||
CURRENT: '',
|
||||
},
|
||||
}
|
||||
@ -51,12 +51,6 @@ const klicktipp = {
|
||||
KLICKTIPP_APIKEY_EN: process.env.KLICKTIPP_APIKEY_EN ?? 'SomeFakeKeyEN',
|
||||
}
|
||||
|
||||
const iota = {
|
||||
IOTA: process.env.IOTA === 'true' || false,
|
||||
IOTA_API_URL: process.env.IOTA_API_URL ?? 'https://chrysalis-nodes.iota.org',
|
||||
IOTA_COMMUNITY_ALIAS: process.env.IOTA_COMMUNITY_ALIAS ?? 'GRADIDO: TestHelloWelt1',
|
||||
}
|
||||
|
||||
const community = {
|
||||
COMMUNITY_NAME: process.env.COMMUNITY_NAME ?? 'Gradido Entwicklung',
|
||||
COMMUNITY_URL: process.env.COMMUNITY_URL ?? 'http://localhost/',
|
||||
@ -132,7 +126,6 @@ export const CONFIG = {
|
||||
...server,
|
||||
...database,
|
||||
...klicktipp,
|
||||
...iota,
|
||||
...community,
|
||||
...email,
|
||||
...loginServer,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -27,7 +27,7 @@ COMMUNITY_DESCRIPTION="Gradido Development Stage1 Test Community"
|
||||
COMMUNITY_SUPPORT_MAIL=support@supportmail.com
|
||||
|
||||
# backend
|
||||
BACKEND_CONFIG_VERSION=v16.2023-06-08
|
||||
BACKEND_CONFIG_VERSION=v17.2023-07-03
|
||||
|
||||
JWT_EXPIRES_IN=10m
|
||||
GDT_API_URL=https://gdt.gradido.net
|
||||
@ -40,9 +40,6 @@ KLICKTIPP_PASSWORD=
|
||||
KLICKTIPP_APIKEY_DE=
|
||||
KLICKTIPP_APIKEY_EN=
|
||||
|
||||
# IOTA
|
||||
IOTA=false
|
||||
|
||||
EMAIL=true
|
||||
EMAIL_TEST_MODUS=false
|
||||
EMAIL_TEST_RECEIVER=test_team@gradido.net
|
||||
|
||||
@ -1,35 +1,35 @@
|
||||
[
|
||||
{
|
||||
"locale": "de",
|
||||
"date": "13. juni 2023",
|
||||
"date": "4. Juli 2023",
|
||||
"text": "Neue Funktion verfügbar: Jetzt Benutzernamen eintragen!",
|
||||
"url": "/settings",
|
||||
"extra": "Deine persönlichen Daten sind uns wichtig, und wir legen großen Wert auf deren Schutz. Wir wissen, dass nicht jeder seine E-Mail-Adresse anderen Benutzern preisgeben möchte. Aus diesem Grund kannst du nun einen Benutzernamen deiner Wahl in den Einstellungen angeben. Dies ist auch ein wichtiger Bestandteil unserer Vorbereitung für die bevorstehende Einführung unserer dezentralen Community-Server."
|
||||
},
|
||||
{
|
||||
"locale": "en",
|
||||
"date": "13 june 2023",
|
||||
"date": "4 July 2023",
|
||||
"text": "New function available: Enter username now!",
|
||||
"url": "/settings",
|
||||
"extra": "Your personal information is important to us, and we take great care to protect it. We know that not everyone wants to reveal their email address to other users. For this reason, you can now enter a username of your choice in the settings. This is also an important part of our preparation for the upcoming launch of our decentralized community servers."
|
||||
},
|
||||
{
|
||||
"locale": "fr",
|
||||
"date": "13 juin 2023",
|
||||
"date": "4 juillet 2023",
|
||||
"text": "Nouvelle fonction disponible : Saisis ton nom d'utilisateur maintenant !",
|
||||
"url": "/settings",
|
||||
"extra": "Tes données personnelles sont importantes pour nous et nous attachons une grande importance à leur protection. Nous savons que certains ne souhaitent pas divulguer leur adresse e-mail à d'autres utilisateurs. C'est pourquoi tu peux désormais indiquer un nom d'utilisateur de ton choix dans les paramètres. Il s'agit également d'un élément important de notre préparation à l'introduction prochaine de nos serveurs communautaires décentralisés."
|
||||
},
|
||||
{
|
||||
"locale": "es",
|
||||
"date": "13 junio 20233",
|
||||
"date": "4 julio 20233",
|
||||
"text": "Nueva función disponible: Introduzca ahora su nombre de usuario",
|
||||
"url": "/settings",
|
||||
"extra": "Sus datos personales son importantes para nosotros y concedemos gran importancia a su protección. Sabemos que no todo el mundo quiere revelar su dirección de correo electrónico a otros usuarios. Por este motivo, ahora puede introducir un nombre de usuario de su elección en los ajustes. Esto es también una parte importante de nuestra preparación para el próximo lanzamiento de nuestros servidores comunitarios descentralizados."
|
||||
},
|
||||
{
|
||||
"locale": "nl",
|
||||
"date": "13 juni 2023",
|
||||
"date": "4 juli 2023",
|
||||
"text": "Nieuwe functie beschikbaar: Voer nu je gebruikersnaam in!",
|
||||
"url": "/settings",
|
||||
"extra": "Je persoonlijke gegevens zijn belangrijk voor ons en we hechten veel belang aan de bescherming ervan. We weten dat niet iedereen zijn e-mailadres bekend wil maken aan andere gebruikers. Daarom kun je nu een gebruikersnaam naar keuze invoeren in de instellingen. Dit is ook een belangrijk onderdeel van onze voorbereiding op de komende lancering van onze gedecentraliseerde community servers."
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
vid="username"
|
||||
v-slot="{ errors, valid, validated, ariaInput, ariaMsg }"
|
||||
>
|
||||
<b-form-group :label="$t('form.username')">
|
||||
<b-form-group :label="$t('form.username')" :description="$t('settings.usernameInfo')">
|
||||
<b-input-group>
|
||||
<b-form-input
|
||||
v-model="currentValue"
|
||||
|
||||
@ -2,13 +2,17 @@
|
||||
<div id="username_form">
|
||||
<div v-if="$store.state.username">
|
||||
<label>{{ $t('form.username') }}</label>
|
||||
<b-input-group class="mb-3" data-test="username-input-group">
|
||||
<b-form-group
|
||||
class="mb-3"
|
||||
data-test="username-input-group"
|
||||
:description="$t('settings.emailInfo')"
|
||||
>
|
||||
<b-form-input
|
||||
v-model="username"
|
||||
readonly
|
||||
data-test="username-input-readonly"
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
</b-form-group>
|
||||
</div>
|
||||
<div v-else>
|
||||
<validation-observer ref="usernameObserver" v-slot="{ handleSubmit, invalid }">
|
||||
|
||||
@ -337,7 +337,8 @@
|
||||
"username": {
|
||||
"change-success": "Dein Nutzername wurde erfolgreich geändert.",
|
||||
"no-username": "Bitte gib einen Benutzernamen ein. Damit hilfst du anderen Benutzern dich zu finden, ohne deine E-Mail-Adresse preisgeben zu müssen."
|
||||
}
|
||||
},
|
||||
"usernameInfo": "Kann nach dem speichern nicht mehr geändert werden!"
|
||||
},
|
||||
"signin": "Anmelden",
|
||||
"signup": "Registrieren",
|
||||
|
||||
@ -292,7 +292,7 @@
|
||||
"warningText": "Are you still there?"
|
||||
},
|
||||
"settings": {
|
||||
"emailInfo": "NCannot be changed at this time.",
|
||||
"emailInfo": "Cannot be changed at this time.",
|
||||
"hideAmountGDD": "Your GDD amount is hidden.",
|
||||
"hideAmountGDT": "Your GDT amount is hidden.",
|
||||
"info": "Transactions can now be made by username or email address.",
|
||||
@ -337,7 +337,8 @@
|
||||
"username": {
|
||||
"change-success": "Your username has been changed successfully.",
|
||||
"no-username": "Please enter a username. This will help other users find you without having to reveal your email address."
|
||||
}
|
||||
},
|
||||
"usernameInfo": "Cannot be changed after saving!"
|
||||
},
|
||||
"signin": "Sign in",
|
||||
"signup": "Sign up",
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="card bg-white gradido-border-radius appBoxShadow p-4 mt--3">
|
||||
<div class="h2">{{ $t('PersonalDetails') }}</div>
|
||||
<div class="m-4 text-small">
|
||||
<div class="my-4 text-small">
|
||||
{{ $t('settings.info') }}
|
||||
</div>
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
</b-row>
|
||||
|
||||
<hr />
|
||||
<div class="h3 mt-5">{{ $t('form.password') }}</div>
|
||||
<div class="mt-5">{{ $t('form.password') }}</div>
|
||||
<user-password />
|
||||
<hr />
|
||||
<b-row class="mb-5">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user