diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 000000000..bd12985d2
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,46 @@
+name: CI
+
+on: [push]
+
+jobs:
+ build:
+ name: Continuous Integration
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Check translation files
+ run: |
+ scripts/translations/sort.sh
+ scripts/translations/missing-keys.sh
+
+ - name: Build neo4j image
+ uses: docker/build-push-action@v1.1.0
+ with:
+ repository: humanconnection/neo4j
+ tags: latest
+ path: neo4j/
+ push: false
+ - name: Build backend base image
+ uses: docker/build-push-action@v1.1.0
+ with:
+ repository: humanconnection/backend
+ tags: build-and-test
+ target: build-and-test
+ path: backend/
+ push: false
+ - name: Build webapp base image
+ uses: docker/build-push-action@v1.1.0
+ with:
+ repository: humanconnection/webapp
+ tags: build-and-test
+ target: build-and-test
+ path: webapp/
+ push: false
+
+ - name: Lint backend
+ run: docker run --rm humanconnection/backend:build-and-test yarn run lint
+ - name: Lint webapp
+ run: docker run --rm humanconnection/webapp:build-and-test yarn run lint
+
diff --git a/backend/.env.template b/backend/.env.template
index 8531e6cd7..9cdceaa45 100644
--- a/backend/.env.template
+++ b/backend/.env.template
@@ -23,3 +23,6 @@ AWS_SECRET_ACCESS_KEY=
AWS_ENDPOINT=
AWS_REGION=
AWS_BUCKET=
+
+EMAIL_DEFAULT_SENDER="info@human-connection.org"
+EMAIL_SUPPORT="support@human-connection.org"
diff --git a/backend/Dockerfile b/backend/Dockerfile
index 9c32e83d5..6bef3579c 100644
--- a/backend/Dockerfile
+++ b/backend/Dockerfile
@@ -1,11 +1,10 @@
FROM node:12.19.0-alpine3.10 as base
-LABEL Description="Backend of the Social Network Human-Connection.org" Vendor="Human Connection gGmbH" Version="0.0.1" Maintainer="Human Connection gGmbH (developer@human-connection.org)"
EXPOSE 4000
CMD ["yarn", "run", "start"]
ARG BUILD_COMMIT
ENV BUILD_COMMIT=$BUILD_COMMIT
-ARG WORKDIR=/develop-backend
+ARG WORKDIR=/backend
RUN mkdir -p $WORKDIR
WORKDIR $WORKDIR
@@ -22,7 +21,7 @@ RUN NODE_ENV=production yarn run build
# reduce image size with a multistage build
FROM base as production
ENV NODE_ENV=production
-COPY --from=build-and-test /develop-backend/dist ./dist
+COPY --from=build-and-test /backend/dist ./dist
COPY ./public/img/ ./public/img/
COPY ./public/providers.json ./public/providers.json
RUN yarn install --production=true --frozen-lockfile --non-interactive --no-cache
diff --git a/backend/graphql-playground.png b/backend/graphql-playground.png
deleted file mode 100644
index 32396a577..000000000
Binary files a/backend/graphql-playground.png and /dev/null differ
diff --git a/backend/humanconnection.png b/backend/humanconnection.png
deleted file mode 100644
index f0576413f..000000000
Binary files a/backend/humanconnection.png and /dev/null differ
diff --git a/backend/src/activitypub/NitroDataSource.js b/backend/src/activitypub/NitroDataSource.js
index 2df895f58..476c91439 100644
--- a/backend/src/activitypub/NitroDataSource.js
+++ b/backend/src/activitypub/NitroDataSource.js
@@ -14,7 +14,7 @@ import { InMemoryCache } from 'apollo-cache-inmemory'
import fetch from 'node-fetch'
import { ApolloClient } from 'apollo-client'
import trunc from 'trunc-html'
-const debug = require('debug')('ea:nitro-datasource')
+const debug = require('debug')('ea:datasource')
export default class NitroDataSource {
constructor(uri) {
diff --git a/backend/src/activitypub/routes/webfinger.js b/backend/src/activitypub/routes/webfinger.js
index e624d306a..6b8f3e14c 100644
--- a/backend/src/activitypub/routes/webfinger.js
+++ b/backend/src/activitypub/routes/webfinger.js
@@ -45,7 +45,7 @@ export async function handler(req, res) {
} catch (error) {
debug(error)
return res.status(500).json({
- error: 'Something went terribly wrong. Please contact support@human-connection.org',
+ error: `Something went terribly wrong. Please visit ${CONFIG.SUPPORT_URL}`,
})
} finally {
session.close()
diff --git a/backend/src/config/index.js b/backend/src/config/index.js
index 4c81bb181..96fcac44a 100644
--- a/backend/src/config/index.js
+++ b/backend/src/config/index.js
@@ -1,7 +1,15 @@
import dotenv from 'dotenv'
+import links from './links.js'
+import metadata from './metadata.js'
+
if (require.resolve) {
// are we in a nodejs environment?
- dotenv.config({ path: require.resolve('../../.env') })
+ try {
+ dotenv.config({ path: require.resolve('../../.env') })
+ } catch (error) {
+ if (error.code !== 'MODULE_NOT_FOUND') throw error
+ console.log('WARN: No `.env` file found in /backend') // eslint-disable-line no-console
+ }
}
// eslint-disable-next-line no-undef
@@ -31,6 +39,7 @@ const {
REDIS_DOMAIN,
REDIS_PORT,
REDIS_PASSWORD,
+ EMAIL_DEFAULT_SENDER,
} = env
export const requiredConfigs = {
@@ -83,6 +92,12 @@ export const s3Configs = {
S3_CONFIGURED,
}
+export const customConfigs = {
+ EMAIL_DEFAULT_SENDER,
+ SUPPORT_URL: links.SUPPORT,
+ APPLICATION_NAME: metadata.APPLICATION_NAME,
+}
+
export default {
...requiredConfigs,
...smtpConfigs,
@@ -92,4 +107,5 @@ export default {
...sentryConfigs,
...redisConfigs,
...s3Configs,
+ ...customConfigs,
}
diff --git a/backend/src/config/links.js b/backend/src/config/links.js
new file mode 100644
index 000000000..6068498c2
--- /dev/null
+++ b/backend/src/config/links.js
@@ -0,0 +1,6 @@
+export default {
+ ORGANIZATION: 'https://human-connection.org/',
+ DONATE: 'https://human-connection.org/spenden/',
+ FAQ: 'https://faq.human-connection.org/',
+ SUPPORT: 'https://human-connection.org/support'
+}
diff --git a/backend/src/config/metadata.js b/backend/src/config/metadata.js
new file mode 100644
index 000000000..6017cd1af
--- /dev/null
+++ b/backend/src/config/metadata.js
@@ -0,0 +1,7 @@
+export default {
+ APPLICATION_NAME: 'fyphe_O',
+ APPLICATION_SHORT_NAME: 'fyphe',
+ APPLICATION_DESCRIPTION: 'The Schools in Motion Network',
+ ORGANIZATION_NAME: 'Ensible e.V.',
+ ORGANIZATION_JURISDICTION: 'Köln',
+}
diff --git a/backend/src/middleware/email/templateBuilder.js b/backend/src/middleware/email/templateBuilder.js
index b4b7b78ca..28acb633e 100644
--- a/backend/src/middleware/email/templateBuilder.js
+++ b/backend/src/middleware/email/templateBuilder.js
@@ -3,11 +3,17 @@ import CONFIG from '../../config'
import * as templates from './templates'
-const from = '"Human Connection" Sollte der Button für Dich nicht funktionieren, kannst Du auch folgenden Code in
Dein Browserfenster kopieren: {{{ nonce }}} Bis bald bei Human Connection! – Dein Human Connection Team – Dein {{APPLICATION_NAME}} Team If the above button doesn't work you can also copy the following code into your
browser window: {{{ nonce }}} See you soon on Human Connection! – The Human Connection Team – The {{APPLICATION_NAME}} Team Sollte der Button für Dich nicht funktionieren, kannst Du auch folgenden Code in
Dein Browserfenster kopieren: {{{ nonce }}} Bis bald bei Human Connection! – Dein Human Connection Team – Dein {{APPLICATION_NAME}} Team If the above button doesn't work you can also copy the following code into your
browser window: {{{ nonce }}} See you soon on Human Connection! – The Human Connection Team – The {{APPLICATION_NAME}} Team Danke, dass Du dich angemeldet hast – wir freuen uns, Dich dabei zu haben. Jetzt
fehlt nur noch eine Kleinigkeit, bevor wir gemeinsam die Welt verbessern können ... Bitte bestätige
Deine E-Mail Adresse: Sollte der Button für Dich nicht funktionieren, kannst Du auch folgenden Code in Dein Browserfenster kopieren: {{{ nonce }}} Das funktioniert allerdings nur, wenn du Dich über unsere Website registriert hast. Falls Du Dich nicht selbst bei Human Connection angemeldet hast, schau doch mal vorbei!
+ style="color: #17b53e;">{{APPLICATION_NAME}} angemeldet hast, schau doch mal vorbei!
Wir sind ein gemeinnütziges Aktionsnetzwerk – von Menschen für Menschen. PS: Wenn Du keinen Account bei uns möchtest, kannst Du diese
E-Mail einfach ignorieren. ;) Melde Dich gerne bei
unserem Support Team, wenn Du Fragen hast. Bis bald bei Human Connection! – Dein Human Connection Team – Dein {{APPLICATION_NAME}} Team Thank you for joining our cause – it's awesome to have you on board. There's
just one tiny step missing before we can start shaping the world together ... Please confirm your
e-mail address by clicking the button below: If the above button doesn't work, you can also copy the following code into your browser window: {{{ nonce }}} However, this only works if you have registered through our website. If you didn't sign up for Human Connection we recommend you to check it out!
+ style="color: #17b53e;">{{APPLICATION_NAME}} we recommend you to check it out!
It's a social network from people for people who want to connect and change the world together. PS: If you ignore this e-mail we will not create an account
for
@@ -201,8 +201,8 @@
support team with any
questions you have. See you soon on Human Connection! – The Human Connection Team – The {{APPLICATION_NAME}} Team Wenn Du noch keinen Account bei Human Connection hast oder Dein Password gar nicht ändern willst,
+ style="color: #17b53e;">{{APPLICATION_NAME}} hast oder Dein Password gar nicht ändern willst,
kannst Du diese E-Mail einfach ignorieren! Ansonsten hilft Dir unser
Support Team gerne weiter. Bis bald bei Human Connection! – Dein Human Connection Team
@@ -75,8 +75,8 @@
@@ -104,8 +104,8 @@
diff --git a/backend/src/middleware/email/templates/layout.html b/backend/src/middleware/email/templates/layout.html
index 7e1c39ace..a5731395d 100644
--- a/backend/src/middleware/email/templates/layout.html
+++ b/backend/src/middleware/email/templates/layout.html
@@ -170,7 +170,7 @@
@@ -173,8 +173,8 @@
diff --git a/backend/src/middleware/email/templates/resetPassword.html b/backend/src/middleware/email/templates/resetPassword.html
index 768051070..8eb2203cb 100644
--- a/backend/src/middleware/email/templates/resetPassword.html
+++ b/backend/src/middleware/email/templates/resetPassword.html
@@ -6,8 +6,8 @@
- Human Connection gGmbH
Bahnhofstraße 11, 73235 Weilheim /
+ {{ORGANIZATION_NAME}}
Bahnhofstraße 11, 73235 Weilheim /
Teck
Germany
@@ -75,8 +75,8 @@
@@ -104,8 +104,8 @@
diff --git a/backend/src/middleware/email/templates/signup.html b/backend/src/middleware/email/templates/signup.html
index ad60d9323..e939bc217 100644
--- a/backend/src/middleware/email/templates/signup.html
+++ b/backend/src/middleware/email/templates/signup.html
@@ -6,8 +6,8 @@
@@ -172,8 +172,8 @@
@@ -23,7 +23,7 @@
style="padding: 20px; padding-top: 0; font-family: Lato, sans-serif; font-size: 16px; line-height: 22px; color: #555555;">
- Willkommen bei Human Connection!
+ Willkommen bei {{APPLICATION_NAME}}!
@@ -117,8 +117,8 @@
diff --git a/backend/src/middleware/email/templates/wrongAccount.html b/backend/src/middleware/email/templates/wrongAccount.html
index cbf6e3cbb..f828a4d1d 100644
--- a/backend/src/middleware/email/templates/wrongAccount.html
+++ b/backend/src/middleware/email/templates/wrongAccount.html
@@ -6,8 +6,8 @@
@@ -134,7 +134,7 @@
style="padding: 20px; padding-top: 0; font-family: Lato, sans-serif; font-size: 16px; line-height: 22px; color: #555555;">
- Welcome to Human Connection!
+ Welcome to {{APPLICATION_NAME}}!
@@ -56,7 +56,7 @@
@@ -75,8 +75,8 @@
– Dein {{APPLICATION_NAME}} Team
If you don't have an account at Human Connection yet or if you didn't want to reset your password, + style="color: #17b53e;">{{APPLICATION_NAME}} yet or if you didn't want to reset your password, please ignore this e-mail.
Otherwise our support team will be happy to help you out.
See you soon on Human Connection!
-– The Human Connection Team
+ style="color: #17b53e;">{{APPLICATION_NAME}}! +– The {{APPLICATION_NAME}} Team
diff --git a/deployment/helm/human-connection/templates/deployments/deployment-backend.yaml b/deployment/helm/human-connection/templates/deployments/deployment-backend.yaml index e3f75a44c..4d5c34a21 100644 --- a/deployment/helm/human-connection/templates/deployments/deployment-backend.yaml +++ b/deployment/helm/human-connection/templates/deployments/deployment-backend.yaml @@ -44,7 +44,7 @@ spec: terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - - mountPath: /develop-backend/public/uploads + - mountPath: /backend/public/uploads name: uploads dnsPolicy: ClusterFirst restartPolicy: Always diff --git a/deployment/helm/human-connection/values.yaml b/deployment/helm/human-connection/values.yaml index 792e22084..085c36fcb 100644 --- a/deployment/helm/human-connection/values.yaml +++ b/deployment/helm/human-connection/values.yaml @@ -50,4 +50,4 @@ privateKeyPassphrase: "YTdkc2Y3OHNhZGc4N2FkODdzZmFnc2FkZzc4" mapboxToken: "cGsuZXlKMUlqb2lhSFZ0WVc0dFkyOXVibVZqZEdsdmJpSXNJbUVpT2lKamFqbDBjbkJ1Ykdvd2VUVmxNM1Z3WjJsek5UTnVkM1p0SW4wLktaOEtLOWw3MG9talhiRWtrYkhHc1E=" uploadsStorage: "25Gi" neo4jStorage: "5Gi" -developmentMailserverDomain: nitro-mailserver.human-connection.org \ No newline at end of file +developmentMailserverDomain: nitro-mailserver.human-connection.org diff --git a/deployment/minikube/README.md b/deployment/minikube/README.md index 499fc8290..f582007a4 100644 --- a/deployment/minikube/README.md +++ b/deployment/minikube/README.md @@ -18,8 +18,8 @@ minikube dashboard, expose the services you want on your host system. For example: ```text -$ minikube service develop-webapp --namespace=human-connection +$ minikube service develop-webapp --namespace=ocelotsocialnetwork # optionally -$ minikube service develop-backend --namespace=human-connection +$ minikube service develop-backend --namespace=ocelotsocialnetwork ``` diff --git a/deployment/volumes/neo4j-online-backup/README.md b/deployment/volumes/neo4j-online-backup/README.md index 4eaa511ef..babb68d26 100644 --- a/deployment/volumes/neo4j-online-backup/README.md +++ b/deployment/volumes/neo4j-online-backup/README.md @@ -56,4 +56,4 @@ $ kubectl --namespace=human-connection exec -it