diff --git a/README.md b/README.md index 06e8d4929..2062865dd 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,11 @@ [ocelot.social](https://ocelot.social) is free and open source software program code to run social networks. Its development is supported by a community of programmers and interested network operators. +
+ Our goal is to enable people to participate fairly and equally in online social networks. The equality of opportunity applies both to the fundamental equality of all people and to the possibility of letting their diverse voices be heard. diff --git a/SUMMARY.md b/SUMMARY.md index f848633d5..453a809b4 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -16,7 +16,7 @@ * [Frontend tests](webapp/testing.md) * [Backend tests](backend/testing.md) * [Docker More Closely](DOCKER_MORE_CLOSELY.md) -* [Deployment](https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/blob/master/deployment/README.md) +* [Deployment](deployment/README.md) * [Contributing](CONTRIBUTING.md) * [Feature Specification](cypress/features.md) * [Code of conduct](CODE_OF_CONDUCT.md) diff --git a/backend/.env.template b/backend/.env.template index c1742ef93..d398c2265 100644 --- a/backend/.env.template +++ b/backend/.env.template @@ -5,11 +5,19 @@ NEO4J_USERNAME=neo4j NEO4J_PASSWORD=letmein GRAPHQL_URI=http://localhost:4000 CLIENT_URI=http://localhost:3000 + +# EMail +EMAIL_SUPPORT="devops@ocelot.social" +EMAIL_DEFAULT_SENDER="devops@ocelot.social" SMTP_HOST= SMTP_PORT= SMTP_IGNORE_TLS=true SMTP_USERNAME= SMTP_PASSWORD= +SMTP_SECURE="false" # true for 465, false for other ports +SMTP_DKIM_DOMAINNAME= +SMTP_DKIM_KEYSELECTOR= +SMTP_DKIM_PRIVATKEY= JWT_SECRET="b/&&7b78BF&fv/Vd" JWT_EXPIRES="2y" @@ -28,7 +36,4 @@ AWS_ENDPOINT= AWS_REGION= AWS_BUCKET= -EMAIL_DEFAULT_SENDER="devops@ocelot.social" -EMAIL_SUPPORT="devops@ocelot.social" - CATEGORIES_ACTIVE=false diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index b6098df11..9f03622a5 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -40,6 +40,8 @@ const server = { JWT_EXPIRES: env.JWT_EXPIRES || '2y', } +const hasDKIMData = env.SMTP_DKIM_DOMAINNAME && env.SMTP_DKIM_KEYSELECTOR && env.SMTP_DKIM_PRIVATKEY + const smtp = { SMTP_HOST: env.SMTP_HOST, SMTP_PORT: env.SMTP_PORT, @@ -47,6 +49,10 @@ const smtp = { SMTP_SECURE: env.SMTP_SECURE === 'true', SMTP_USERNAME: env.SMTP_USERNAME, SMTP_PASSWORD: env.SMTP_PASSWORD, + SMTP_DKIM_DOMAINNAME: hasDKIMData && env.SMTP_DKIM_DOMAINNAME, + SMTP_DKIM_KEYSELECTOR: hasDKIMData && env.SMTP_DKIM_KEYSELECTOR, + // PEM format: https://docs.progress.com/bundle/datadirect-hybrid-data-pipeline-installation-46/page/PEM-file-format.html + SMTP_DKIM_PRIVATKEY: hasDKIMData && env.SMTP_DKIM_PRIVATKEY.replace(/\\n/g, '\n'), // replace all "\n" in .env string by real line break } const neo4j = { diff --git a/backend/src/middleware/helpers/email/sendMail.ts b/backend/src/middleware/helpers/email/sendMail.ts index 359efc91e..c0e54e7f7 100644 --- a/backend/src/middleware/helpers/email/sendMail.ts +++ b/backend/src/middleware/helpers/email/sendMail.ts @@ -5,6 +5,8 @@ import { htmlToText } from 'nodemailer-html-to-text' const hasEmailConfig = CONFIG.SMTP_HOST && CONFIG.SMTP_PORT const hasAuthData = CONFIG.SMTP_USERNAME && CONFIG.SMTP_PASSWORD +const hasDKIMData = + CONFIG.SMTP_DKIM_DOMAINNAME && CONFIG.SMTP_DKIM_KEYSELECTOR && CONFIG.SMTP_DKIM_PRIVATKEY let sendMailCallback: any = async () => {} if (!hasEmailConfig) { @@ -44,6 +46,11 @@ if (!hasEmailConfig) { user: CONFIG.SMTP_USERNAME, pass: CONFIG.SMTP_PASSWORD, }, + dkim: hasDKIMData && { + domainName: CONFIG.SMTP_DKIM_DOMAINNAME, + keySelector: CONFIG.SMTP_DKIM_KEYSELECTOR, + privateKey: CONFIG.SMTP_DKIM_PRIVATKEY, + }, }) transporter.use( diff --git a/deployment/README.md b/deployment/README.md index 030eb8a44..93d3fb86c 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -6,11 +6,11 @@ [](https://www.codetriage.com/ocelot-social-community/ocelot-social-deploy-rebranding) This repository is an in use template to rebrand, configure, and deploy [ocelot.social](https://github.com/Ocelot-Social-Community/Ocelot-Social) networks. -The forked original repository is [Ocelot-Social-Deploy-Rebranding](https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding). +The forked original repository is [stage.ocelot.social](https://github.com/Ocelot-Social-Community/stage.ocelot.social). @@ -47,7 +47,8 @@ Since all deployment methods described here depend on [Docker](https://docker.co The next step is: -- [Configure And Branding](/branding/README.md) +- [Set Environment Variables and Configurations](./deployment-values.md) +- [Configure And Branding](./configurations/stage.ocelot.social/branding/README.md) ### Optional: Locally Testing Configuration And Branding @@ -99,7 +100,7 @@ See the login details and browser addresses above. ### Deployment -Afterwards you can [deploy](/deployment/README.md) it on your server: +Afterwards you can [deploy](/deployment/deployment.md) it on your server: - [Kubernetes with Helm](/deployment/kubernetes/README.md) diff --git a/deployment/TODO-next-update.md b/deployment/TODO-next-update.md index 8e30d1f47..4470efa14 100644 --- a/deployment/TODO-next-update.md +++ b/deployment/TODO-next-update.md @@ -1,6 +1,13 @@ # Todo For Next Update -When you overtake this deploy and rebrand repo to your network you have to recognize the following changes and doings: +When you introduce a new version and branding and deploy it on your network, you need to consider the following changes and actions: + +## Version >= 3.3.0 with 'ocelotDockerVersionTag' 3.3.0-XXX + +- We have the new option to configure DKIM for sent e-mails in environment variables (`.env` or `values.yaml`), see [here](deployment.md): + - `SMTP_DKIM_DOMAINNAME=` + - `SMTP_DKIM_KEYSELECTOR=` + - `SMTP_DKIM_PRIVATKEY=` ## Version >= 2.7.0 with 'ocelotDockerVersionTag' 2.7.0-470 diff --git a/deployment/deployment-values.md b/deployment/deployment-values.md new file mode 100644 index 000000000..300a056dd --- /dev/null +++ b/deployment/deployment-values.md @@ -0,0 +1,38 @@ +# Deployment Values + +For each deployment, you need to set the environment variables and configurations. +Here is some specific information on how to set the values. + +## E-Mails + +You need to set environment variables to send registration and invitation information or notifications to users, for example. + +### SPF and DKIM + +More and more e-mail providers require settings for authorization and verification of e-mail senders. + +### SPF + +Sometimes it is enough to create an SPF record in your DNS. + +### DKIM + +However, if you need DKIM authorization and verification, you must set the appropriate environment variables: + +```bash +SMTP_DKIM_DOMAINNAME=