From d6480c14e5ac47577d4cd24bbd036063d06544f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 18 Jul 2022 07:56:06 +0200 Subject: [PATCH 01/19] Rename Neo4j Docker image in general to 'neo4j-community:*' --- docker-compose.ocelotsocial-branded.yml | 27 ++++++++++------ docker-compose.yml | 41 ++++++++++++++++--------- docker/neo4j.Dockerfile | 3 +- 3 files changed, 47 insertions(+), 24 deletions(-) diff --git a/docker-compose.ocelotsocial-branded.yml b/docker-compose.ocelotsocial-branded.yml index 6d4c148..7591b4a 100644 --- a/docker-compose.ocelotsocial-branded.yml +++ b/docker-compose.ocelotsocial-branded.yml @@ -2,10 +2,12 @@ version: "3.4" services: + ######################################################## # WEBAPP ############################################### ######################################################## webapp: + # name the image to match our image to be tested from our DockerHub repository so that it can be pulled from there, otherwise it will be created locally from the 'dockerfile' image: ocelotsocialnetwork/webapp-branded:latest ports: - 3000:3000 @@ -19,10 +21,12 @@ services: - MAPBOX_TOKEN="pk.eyJ1IjoiYnVzZmFrdG9yIiwiYSI6ImNraDNiM3JxcDBhaWQydG1uczhpZWtpOW4ifQ.7TNRTO-o9aK1Y6MyW_Nd4g" # - WEBSOCKETS_URI=ws://backend:4000/graphql # is not working and not given in Docker YAML in main repo - PUBLIC_REGISTRATION=true + ######################################################## # BACKEND ############################################## ######################################################## backend: + # name the image to match our image to be tested from our DockerHub repository so that it can be pulled from there, otherwise it will be created locally from the 'dockerfile' image: ocelotsocialnetwork/backend-branded:latest networks: - test-network @@ -47,10 +51,23 @@ services: - SMTP_HOST=mailserver - SMTP_PORT=25 - SMTP_IGNORE_TLS=true + + ######################################################## + # MAINTENANCE ########################################## + ######################################################## + maintenance: + # name the image to match our image to be tested from our DockerHub repository so that it can be pulled from there, otherwise it will be created locally from the 'dockerfile' + image: ocelotsocialnetwork/maintenance-branded:latest + networks: + - test-network + ports: + - 3001:80 + ######################################################## # NEO4J ################################################ ######################################################## neo4j: + # name the image to match our image to be tested from our DockerHub repository so that it can be pulled from there, otherwise it will be created locally from the 'dockerfile' image: ocelotsocialnetwork/neo4j-community-branded:latest networks: - test-network @@ -62,15 +79,7 @@ services: - 7687:7687 volumes: - neo4j_data:/data - ######################################################## - # MAINTENANCE ########################################## - ######################################################## - maintenance: - image: ocelotsocialnetwork/maintenance-branded:latest - networks: - - test-network - ports: - - 5000:80 + ######################################################## # MAILSERVER TO FAKE SMTP ############################## ######################################################## diff --git a/docker-compose.yml b/docker-compose.yml index 41d515d..5610511 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,15 @@ # This docker-compose file is just here for testing + version: "3.4" services: + ######################################################## # WEBAPP ############################################### ######################################################## webapp: + # name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there + image: ocelotsocialnetwork/webapp-branded:local-production build: dockerfile: docker/webapp.Dockerfile target: branded @@ -22,10 +26,13 @@ services: - MAPBOX_TOKEN="pk.eyJ1IjoiYnVzZmFrdG9yIiwiYSI6ImNraDNiM3JxcDBhaWQydG1uczhpZWtpOW4ifQ.7TNRTO-o9aK1Y6MyW_Nd4g" # - WEBSOCKETS_URI=ws://backend:4000/graphql # is not working and not given in Docker YAML in main repo - PUBLIC_REGISTRATION=true + ######################################################## # BACKEND ############################################## ######################################################## backend: + # name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there + image: ocelotsocialnetwork/backend-branded:local-production build: dockerfile: docker/backend.Dockerfile target: branded @@ -53,11 +60,29 @@ services: - SMTP_HOST=mailserver - SMTP_PORT=25 - SMTP_IGNORE_TLS=true + + ######################################################## + # MAINTENANCE ########################################## + ######################################################## + maintenance: + # name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there + image: ocelotsocialnetwork/maintenance-branded:local-production + build: + # TODO: Separate from webapp, this must be independent + dockerfile: docker/maintenance.Dockerfile + target: branded + context: . + networks: + - test-network + ports: + - 3001:80 + ######################################################## # NEO4J ################################################ ######################################################## neo4j: - image: ocelotsocialnetwork/neo4j:community + # name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there + image: ocelotsocialnetwork/neo4j-community-branded:local-production networks: - test-network volumes: @@ -68,19 +93,7 @@ services: - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes ports: - 7687:7687 - ######################################################## - # MAINTENANCE ########################################## - ######################################################## - maintenance: - build: - # TODO: Separate from webapp, this must be independent - dockerfile: docker/maintenance.Dockerfile - target: branded - context: . - networks: - - test-network - ports: - - 5000:80 + ######################################################## # MAILSERVER TO FAKE SMTP ############################## ######################################################## diff --git a/docker/neo4j.Dockerfile b/docker/neo4j.Dockerfile index 980c45e..eddc7be 100644 --- a/docker/neo4j.Dockerfile +++ b/docker/neo4j.Dockerfile @@ -1,4 +1,4 @@ -ARG APP_IMAGE=ocelotsocialnetwork/neo4j +ARG APP_IMAGE=ocelotsocialnetwork/neo4j-community ARG APP_IMAGE_TAG=latest ARG APP_IMAGE_COMMUNITY=${APP_IMAGE}:${APP_IMAGE_TAG} @@ -10,4 +10,5 @@ FROM $APP_IMAGE_COMMUNITY as community-branded ################################################################################## # ENTERPRISE ##################################################################### ################################################################################## +# Todo: refactor this with 'APP_IMAGE', 'APP_IMAGE_TAG', and similar to 'APP_IMAGE_COMMUNITY', Neo4j 'dockerfile' from main code FROM ocelotsocialnetwork/neo4j-enterprise:latest as enterprise-branded From d66e8f0f1752b55879a452ee0091ba77087c0db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 18 Jul 2022 10:55:10 +0200 Subject: [PATCH 02/19] Adjust maintenance container name in deployment with Helm --- deployment/kubernetes/templates/maintenance/Deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/kubernetes/templates/maintenance/Deployment.yaml b/deployment/kubernetes/templates/maintenance/Deployment.yaml index 5a2eb39..fd1aa31 100644 --- a/deployment/kubernetes/templates/maintenance/Deployment.yaml +++ b/deployment/kubernetes/templates/maintenance/Deployment.yaml @@ -26,7 +26,7 @@ spec: rollme: {{ randAlphaNum 5 | quote }} spec: containers: - - name: maintenance + - name: container-{{ .Release.Name }}-maintenance image: "{{ .Values.MAINTENANCE.DOCKER_IMAGE_REPO }}:{{ .Chart.AppVersion }}" imagePullPolicy: {{ .Values.MAINTENANCE.DOCKER_IMAGE_PULL_POLICY }} envFrom: From 86a613cbe025f94fb6a02185c8da246716fd44db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 18 Jul 2022 13:39:40 +0200 Subject: [PATCH 03/19] Release new build version v1.0.8-184 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9963e69..57fcb26 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ocelot-social-branded", "version": "1.0.8", - "ocelotDockerVersionTag": "1.0.8-182", + "ocelotDockerVersionTag": "1.0.8-184", "dockerOrganisation": "ocelotsocialnetwork", "description": "ocelot.social Branded", "author": "ocelot.social Community", From a9d43d88e5c24d10cd3737eb4b7ee7781703fcf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 18 Jul 2022 18:38:30 +0200 Subject: [PATCH 04/19] Fix 'apiVersion: cert-manager.io/v1alpha2' to '*/v1' --- .../kubernetes/templates/issuer/letsencrypt-production.yaml | 2 +- deployment/kubernetes/templates/issuer/letsencrypt-staging.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/kubernetes/templates/issuer/letsencrypt-production.yaml b/deployment/kubernetes/templates/issuer/letsencrypt-production.yaml index 2836cce..6f82f36 100644 --- a/deployment/kubernetes/templates/issuer/letsencrypt-production.yaml +++ b/deployment/kubernetes/templates/issuer/letsencrypt-production.yaml @@ -1,4 +1,4 @@ -apiVersion: cert-manager.io/v1alpha2 +apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: letsencrypt-production diff --git a/deployment/kubernetes/templates/issuer/letsencrypt-staging.yaml b/deployment/kubernetes/templates/issuer/letsencrypt-staging.yaml index 7190e65..e488d93 100644 --- a/deployment/kubernetes/templates/issuer/letsencrypt-staging.yaml +++ b/deployment/kubernetes/templates/issuer/letsencrypt-staging.yaml @@ -1,4 +1,4 @@ -apiVersion: cert-manager.io/v1alpha2 +apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: letsencrypt-staging From f09a32d0d19f984a186cf343c54560b3d6e07e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 20 Jul 2022 08:28:13 +0200 Subject: [PATCH 05/19] Implement 'PRODUCTION_DB_CLEAN_ALLOW' for production environments on staging servers --- deployment/kubernetes/templates/backend/ConfigMap.yml | 1 + deployment/kubernetes/values.template.yaml | 1 + docker-compose.ocelotsocial-branded.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/deployment/kubernetes/templates/backend/ConfigMap.yml b/deployment/kubernetes/templates/backend/ConfigMap.yml index 4ea065c..a4c8405 100644 --- a/deployment/kubernetes/templates/backend/ConfigMap.yml +++ b/deployment/kubernetes/templates/backend/ConfigMap.yml @@ -11,6 +11,7 @@ metadata: app.kubernetes.io/managed-by: "{{ .Release.Service }}" helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" data: + PRODUCTION_DB_CLEAN_ALLOW: "{{ .Values.PRODUCTION_DB_CLEAN_ALLOW }}" PUBLIC_REGISTRATION: "{{ .Values.PUBLIC_REGISTRATION }}" INVITE_REGISTRATION: "{{ .Values.INVITE_REGISTRATION }}" CLIENT_URI: "{{ .Values.BACKEND.CLIENT_URI }}" diff --git a/deployment/kubernetes/values.template.yaml b/deployment/kubernetes/values.template.yaml index 921ce3c..9b5b751 100644 --- a/deployment/kubernetes/values.template.yaml +++ b/deployment/kubernetes/values.template.yaml @@ -1,6 +1,7 @@ # please duplicate template file and rename to "values.yaml" and fill in your value # change all the below if needed +PRODUCTION_DB_CLEAN_ALLOW: false # only true for production environments on staging servers PUBLIC_REGISTRATION: false INVITE_REGISTRATION: false COOKIE_EXPIRE_TIME: 730 # days (730 days, two years is the default in main code) diff --git a/docker-compose.ocelotsocial-branded.yml b/docker-compose.ocelotsocial-branded.yml index 7591b4a..9d678ec 100644 --- a/docker-compose.ocelotsocial-branded.yml +++ b/docker-compose.ocelotsocial-branded.yml @@ -45,6 +45,7 @@ services: - PRIVATE_KEY_PASSPHRASE=a7dsf78sadg87ad87sfagsadg78 - EMAIL_SUPPORT=support@wir.social - EMAIL_DEFAULT_SENDER=info@wir.social + - PRODUCTION_DB_CLEAN_ALLOW=true # because this is stage.ocelot.social # false # only true for production environments on staging servers - PUBLIC_REGISTRATION=true - SMTP_USERNAME=${SMTP_USERNAME} - SMTP_PASSWORD=${SMTP_PASSWORD} From 0317d44adee9db47eb59aca3e49c124003dca107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 20 Jul 2022 09:37:16 +0200 Subject: [PATCH 06/19] Set push branch temporary to this branch as well --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0fde053..c89ab3f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,7 +4,7 @@ on: push: branches: - master - # - 14-new-deployment-with-base-and-code # for testing while developing + - 5065-automatic-deployment-to-stage.ocelot.social-on-push-to-master-branch # for testing while developing jobs: ############################################################################## From efc78594de545471b9498b1203681aa0b95d1a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 20 Jul 2022 09:38:50 +0200 Subject: [PATCH 07/19] Add Documentation for 'Kubernetes Commands (Without Helm) To Deploy New Docker Images To A Kubernetes Cluster' --- deployment/kubernetes/README.md | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/deployment/kubernetes/README.md b/deployment/kubernetes/README.md index c519cb0..e14ab40 100644 --- a/deployment/kubernetes/README.md +++ b/deployment/kubernetes/README.md @@ -225,3 +225,50 @@ support, try this [helm chart](https://github.com/helm/charts/tree/master/stable On our kubernetes cluster we get "mult-attach" errors for persistent volumes. Apparently DigitalOcean's kubernetes clusters do not fulfill the requirements. + +## Kubernetes Commands (Without Helm) To Deploy New Docker Images To A Kubernetes Cluster + +### Deploy A Version + +```bash +# !!! be aware of the correct kube context !!! +$ kubectl config get-contexts + +# deploy version '$BUILD_VERSION' +# !!! 'latest' is not recommended on production !!! + +# for easyness set env +$ export BUILD_VERSION=1.0.8-48-ocelot.social1.0.8-184 # example +# check this with +$ echo $BUILD_VERSION +1.0.8-48-ocelot.social1.0.8-184 + +# deploy actual version '$BUILD_VERSION' to Kubernetes cluster +$ kubectl -n default set image deployment/ocelot-webapp container-ocelot-webapp=ocelotsocialnetwork/webapp:$BUILD_VERSION +$ kubectl -n default rollout restart deployment/ocelot-webapp +$ kubectl -n default set image deployment/ocelot-backend container-ocelot-backend=ocelotsocialnetwork/backend:$BUILD_VERSION +$ kubectl -n default rollout restart deployment/ocelot-backend +$ kubectl -n default set image deployment/ocelot-maintenance container-ocelot-maintenance=ocelotsocialnetwork/maintenance:$BUILD_VERSION +$ kubectl -n default rollout restart deployment/ocelot-maintenance +$ kubectl -n default set image deployment/ocelot-neo4j container-ocelot-neo4j=ocelotsocialnetwork/neo4j-community:$BUILD_VERSION +$ kubectl -n default rollout restart deployment/ocelot-neo4j +# verify deployment and wait for the pods of each deployment to get ready for cleaning and seeding of the database +$ kubectl -n default rollout status deployment/ocelot-webapp --timeout=240s +$ kubectl -n default rollout status deployment/ocelot-maintenance --timeout=240s +$ kubectl -n default rollout status deployment/ocelot-backend --timeout=240s +$ kubectl -n default rollout status deployment/ocelot-neo4j --timeout=240s +``` + +### Staging – Clean And Seed Neo4j Database + +***ATTENTION:*** Cleaning and seeding of our Neo4j database is only possible in production if env `PRODUCTION_DB_CLEAN_ALLOW=true` is set in our deployment. + +```bash +# !!! be aware of the correct kube context !!! +$ kubectl config get-contexts + +# reset and seed Neo4j database via backend for staging +$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "node dist/db/clean.js" +$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "node dist/db/seed.js" + +``` From eafc73dc0f449827598a538dc85518acdf5e7226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 20 Jul 2022 09:51:30 +0200 Subject: [PATCH 08/19] Comment out 'PRODUCTION_DB_CLEAN_ALLOW' in 'docker-compose.ocelotsocial-branded.yml' --- docker-compose.ocelotsocial-branded.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.ocelotsocial-branded.yml b/docker-compose.ocelotsocial-branded.yml index 9d678ec..b8c3ce4 100644 --- a/docker-compose.ocelotsocial-branded.yml +++ b/docker-compose.ocelotsocial-branded.yml @@ -45,7 +45,7 @@ services: - PRIVATE_KEY_PASSPHRASE=a7dsf78sadg87ad87sfagsadg78 - EMAIL_SUPPORT=support@wir.social - EMAIL_DEFAULT_SENDER=info@wir.social - - PRODUCTION_DB_CLEAN_ALLOW=true # because this is stage.ocelot.social # false # only true for production environments on staging servers + # - PRODUCTION_DB_CLEAN_ALLOW=false # only true for production environments on staging servers - PUBLIC_REGISTRATION=true - SMTP_USERNAME=${SMTP_USERNAME} - SMTP_PASSWORD=${SMTP_PASSWORD} From ac19f5959c6ad7c3a322e4ebf27c02aa7b57de0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 20 Jul 2022 09:52:56 +0200 Subject: [PATCH 09/19] Comment out 'PRODUCTION_DB_CLEAN_ALLOW' in 'docker-compose.yml' --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 5610511..285a0d3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -54,6 +54,7 @@ services: - PRIVATE_KEY_PASSPHRASE=a7dsf78sadg87ad87sfagsadg78 - EMAIL_SUPPORT=support@wir.social - EMAIL_DEFAULT_SENDER=info@wir.social + # - PRODUCTION_DB_CLEAN_ALLOW=false # only true for production environments on staging servers - PUBLIC_REGISTRATION=true - SMTP_USERNAME=${SMTP_USERNAME} - SMTP_PASSWORD=${SMTP_PASSWORD} From 126c92480b8b55e742799838bac83a7a5013d2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 20 Jul 2022 10:00:55 +0200 Subject: [PATCH 10/19] Fix changing of push branch temporary to this branch as well --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c89ab3f..ce08ee1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,7 +4,7 @@ on: push: branches: - master - - 5065-automatic-deployment-to-stage.ocelot.social-on-push-to-master-branch # for testing while developing + - 55-implement-PRODUCTION_DB_CLEAN_ALLOW-for-staging-production-evironments # for testing while developing jobs: ############################################################################## From a44f00310490aa20c128e15ea7c9185e43898e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 20 Jul 2022 10:11:35 +0200 Subject: [PATCH 11/19] Add Docker Compose override for Apple M1 --- docker-compose.apple-m1.override.yml | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 docker-compose.apple-m1.override.yml diff --git a/docker-compose.apple-m1.override.yml b/docker-compose.apple-m1.override.yml new file mode 100644 index 0000000..80344e4 --- /dev/null +++ b/docker-compose.apple-m1.override.yml @@ -0,0 +1,36 @@ +# This docker-compose file is just here for testing + +version: "3.4" + +services: + + ######################################################## + # WEBAPP ############################################### + ######################################################## + webapp: + platform: linux/amd64 + + ######################################################## + # BACKEND ############################################## + ######################################################## + backend: + platform: linux/amd64 + + ######################################################## + # MAINTENANCE ########################################## + ######################################################## + maintenance: + platform: linux/amd64 + + ######################################################## + # NEO4J ################################################ + ######################################################## + neo4j: + platform: linux/amd64 + + ######################################################## + # MAILSERVER TO FAKE SMTP ############################## + ######################################################## + # commented out, because otherwise override of production would error. and it seems unnecessary + # mailserver: + # platform: linux/amd64 From b36eb508a64363ef7b3a60ad2bd040765cabd7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 20 Jul 2022 10:45:38 +0200 Subject: [PATCH 12/19] Document Docker Compose override for Apple M1 --- docker/DOCKER_MORE_CLOSELY.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 docker/DOCKER_MORE_CLOSELY.md diff --git a/docker/DOCKER_MORE_CLOSELY.md b/docker/DOCKER_MORE_CLOSELY.md new file mode 100644 index 0000000..113e3a4 --- /dev/null +++ b/docker/DOCKER_MORE_CLOSELY.md @@ -0,0 +1,33 @@ +# Docker + +## Apple M1 Platform + +***Attention:** For using Docker commands in Apple M1 environments!* + +```bash +# set env variable for your shell +$ export DOCKER_DEFAULT_PLATFORM=linux/amd64 +``` + +For even more informations, see [Docker More Closely](#docker-more-closely) + +### Docker Compose Override File For Apple M1 Platform + +For Docker compose `up` or `build` commands, you can use our Apple M1 override file that specifies the M1 platform: + +```bash +# in main folder + +# for production +$ docker compose -f docker-compose.yml -f docker-compose.apple-m1.override.yml up + +# for production testing Docker images from DockerHub +$ docker compose -f docker-compose.ocelotsocial-branded.yml -f docker-compose.apple-m1.override.yml up + +# only once: init admin user and create indexes and contraints in Neo4j database +$ docker compose exec backend /bin/sh -c "yarn prod:migrate init" +``` + +## Docker More Closely In Main Code + +To get more informations about the Apple M1 platform and to analyze the Docker builds etc. you find our documentation in our main code, [here](https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/DOCKER_MORE_CLOSELY.md). From 0adbe7696b8540814367f614ad230995150a7377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 20 Jul 2022 14:50:07 +0200 Subject: [PATCH 13/19] Change back to only publish on master branch push --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ce08ee1..2743a25 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,7 +4,7 @@ on: push: branches: - master - - 55-implement-PRODUCTION_DB_CLEAN_ALLOW-for-staging-production-evironments # for testing while developing + # - 55-implement-PRODUCTION_DB_CLEAN_ALLOW-for-staging-production-evironments # for testing while developing jobs: ############################################################################## From 92007dfb7452a1b072dd8f927ae2ada9d4407dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 20 Jul 2022 14:53:10 +0200 Subject: [PATCH 14/19] Change document by accumulate Neo4j db 'clean.js' and 'seed.js' and make the node calls await with flag '--experimental-repl-await' in 'publish.yml' --- deployment/kubernetes/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/kubernetes/README.md b/deployment/kubernetes/README.md index e14ab40..1a9a762 100644 --- a/deployment/kubernetes/README.md +++ b/deployment/kubernetes/README.md @@ -268,7 +268,7 @@ $ kubectl -n default rollout status deployment/ocelot-neo4j --timeout=240s $ kubectl config get-contexts # reset and seed Neo4j database via backend for staging -$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "node dist/db/clean.js" -$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "node dist/db/seed.js" +$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "node --experimental-repl-await dist/db/clean.js && node --experimental-repl-await dist/db/seed.js" + ``` From eb8d3903a289177127075dcb56b75202639fa2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 20 Jul 2022 16:17:24 +0200 Subject: [PATCH 15/19] Release v1.0.9-199 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 57fcb26..da08624 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ocelot-social-branded", - "version": "1.0.8", - "ocelotDockerVersionTag": "1.0.8-184", + "version": "1.0.9", + "ocelotDockerVersionTag": "1.0.9-199", "dockerOrganisation": "ocelotsocialnetwork", "description": "ocelot.social Branded", "author": "ocelot.social Community", From 7afb2d688e390c61a985ad3b87b8f4d5da14158f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 25 Jul 2022 18:07:53 +0200 Subject: [PATCH 16/19] Update issue templates --- .github/ISSUE_TEMPLATE/---bug-report.md | 11 +++++++++++ .github/ISSUE_TEMPLATE/---devops-ticket.md | 11 +++++++++++ .github/ISSUE_TEMPLATE/---epic.md | 15 +++++++++++++++ .github/ISSUE_TEMPLATE/---feature-request.md | 11 +++++++++++ .github/ISSUE_TEMPLATE/---question.md | 15 +++++++++++++++ .github/ISSUE_TEMPLATE/---refactor.md | 11 +++++++++++ .github/ISSUE_TEMPLATE/custom.md | 10 ++++++++++ 7 files changed, 84 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/---bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/---devops-ticket.md create mode 100644 .github/ISSUE_TEMPLATE/---epic.md create mode 100644 .github/ISSUE_TEMPLATE/---feature-request.md create mode 100644 .github/ISSUE_TEMPLATE/---question.md create mode 100644 .github/ISSUE_TEMPLATE/---refactor.md create mode 100644 .github/ISSUE_TEMPLATE/custom.md diff --git a/.github/ISSUE_TEMPLATE/---bug-report.md b/.github/ISSUE_TEMPLATE/---bug-report.md new file mode 100644 index 0000000..602283a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/---bug-report.md @@ -0,0 +1,11 @@ +--- +name: "\U0001F41B Bug Report" +about: Create a report to help us improve +title: "\U0001F41B [Bug] XXX" +labels: bug +assignees: '' + +--- + +## :bug: Bug Report + diff --git a/.github/ISSUE_TEMPLATE/---devops-ticket.md b/.github/ISSUE_TEMPLATE/---devops-ticket.md new file mode 100644 index 0000000..a382d1f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/---devops-ticket.md @@ -0,0 +1,11 @@ +--- +name: "\U0001F4A5 DevOps Ticket" +about: Help us manage our deployed app. +title: "\U0001F4A5 [DevOps] XXX" +labels: '' +assignees: '' + +--- + +## 💥 DevOps Ticket + diff --git a/.github/ISSUE_TEMPLATE/---epic.md b/.github/ISSUE_TEMPLATE/---epic.md new file mode 100644 index 0000000..8dcb195 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/---epic.md @@ -0,0 +1,15 @@ +--- +name: "\U0001F31F Epic" +about: Define a big development step. +title: "\U0001F31F [EPIC] XXX" +labels: '' +assignees: '' + +--- + + + + +## 🌟 EPIC + diff --git a/.github/ISSUE_TEMPLATE/---feature-request.md b/.github/ISSUE_TEMPLATE/---feature-request.md new file mode 100644 index 0000000..f387d77 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/---feature-request.md @@ -0,0 +1,11 @@ +--- +name: "\U0001F680 Feature Request" +about: Suggest an idea for this project. +title: "\U0001F680 [Feature] XXX" +labels: enhancement +assignees: '' + +--- + +## :rocket: Feature Request + diff --git a/.github/ISSUE_TEMPLATE/---question.md b/.github/ISSUE_TEMPLATE/---question.md new file mode 100644 index 0000000..cbbcaaa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/---question.md @@ -0,0 +1,15 @@ +--- +name: "\U0001F4AC Question" +about: If you need help understanding ocelot.social. +title: "\U0001F4AC [Question] XXX" +labels: '' +assignees: '' + +--- + + + + +## 💬 Question + diff --git a/.github/ISSUE_TEMPLATE/---refactor.md b/.github/ISSUE_TEMPLATE/---refactor.md new file mode 100644 index 0000000..fb1ac4e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/---refactor.md @@ -0,0 +1,11 @@ +--- +name: "\U0001F527 Refactor" +about: Help us improve our code by refactoring it. +title: "\U0001F527 [Refactor] XXX" +labels: enhancement +assignees: '' + +--- + +## 🔧 Refactor + diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md new file mode 100644 index 0000000..48d5f81 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -0,0 +1,10 @@ +--- +name: Custom issue template +about: Describe this issue template's purpose here. +title: '' +labels: '' +assignees: '' + +--- + + From 323b73680a0efe0f7abdde6bc3513a7bc8466fd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 3 Aug 2022 15:50:21 +0200 Subject: [PATCH 17/19] Add 'CATEGORIES_ACTIVE' config --- TODO-next-update.md | 7 +++++++ deployment/kubernetes/templates/backend/ConfigMap.yml | 1 + deployment/kubernetes/templates/webapp/ConfigMap.yml | 1 + deployment/kubernetes/values.template.yaml | 1 + 4 files changed, 10 insertions(+) diff --git a/TODO-next-update.md b/TODO-next-update.md index b27f5f1..59bbf83 100644 --- a/TODO-next-update.md +++ b/TODO-next-update.md @@ -2,6 +2,13 @@ When you overtake this deploy and rebrand repo to your network you have to recognize the following changes and doings … +## This Latest Version > 1.0.9 with 'ocelotDockerVersionTag' 1.0.9-199 + +### PR – chore: 🍰 Release v1.1.0 - Implement Categories Again #63 + +- You have to add the `CATEGORIES_ACTIVE` from the `deployment/kubernetes/values.template.yaml` to your `deployment/kubernetes/values.yaml` and set it to your prevered value. +- Make sure the correct categories are in your Neo4j database on the server. + ## This Latest Version > 1.0.7 with 'ocelotDockerVersionTag' 1.0.7-171 ### PR – feat: 🍰 Configure Cookie Expire Time #43 diff --git a/deployment/kubernetes/templates/backend/ConfigMap.yml b/deployment/kubernetes/templates/backend/ConfigMap.yml index a4c8405..1222b0d 100644 --- a/deployment/kubernetes/templates/backend/ConfigMap.yml +++ b/deployment/kubernetes/templates/backend/ConfigMap.yml @@ -14,6 +14,7 @@ data: PRODUCTION_DB_CLEAN_ALLOW: "{{ .Values.PRODUCTION_DB_CLEAN_ALLOW }}" PUBLIC_REGISTRATION: "{{ .Values.PUBLIC_REGISTRATION }}" INVITE_REGISTRATION: "{{ .Values.INVITE_REGISTRATION }}" + CATEGORIES_ACTIVE: "{{ .Values.CATEGORIES_ACTIVE }}" CLIENT_URI: "{{ .Values.BACKEND.CLIENT_URI }}" EMAIL_DEFAULT_SENDER: "{{ .Values.BACKEND.EMAIL_DEFAULT_SENDER }}" SMTP_HOST: "{{ .Values.BACKEND.SMTP_HOST }}" diff --git a/deployment/kubernetes/templates/webapp/ConfigMap.yml b/deployment/kubernetes/templates/webapp/ConfigMap.yml index 685f676..762b355 100644 --- a/deployment/kubernetes/templates/webapp/ConfigMap.yml +++ b/deployment/kubernetes/templates/webapp/ConfigMap.yml @@ -14,6 +14,7 @@ data: HOST: "0.0.0.0" PUBLIC_REGISTRATION: "{{ .Values.PUBLIC_REGISTRATION }}" INVITE_REGISTRATION: "{{ .Values.INVITE_REGISTRATION }}" + CATEGORIES_ACTIVE: "{{ .Values.CATEGORIES_ACTIVE }}" COOKIE_EXPIRE_TIME: "{{ .Values.COOKIE_EXPIRE_TIME }}" WEBSOCKETS_URI: "{{ .Values.WEBAPP.WEBSOCKETS_URI }}" GRAPHQL_URI: "http://{{ .Release.Name }}-backend:4000" \ No newline at end of file diff --git a/deployment/kubernetes/values.template.yaml b/deployment/kubernetes/values.template.yaml index 9b5b751..e601f1a 100644 --- a/deployment/kubernetes/values.template.yaml +++ b/deployment/kubernetes/values.template.yaml @@ -5,6 +5,7 @@ PRODUCTION_DB_CLEAN_ALLOW: false # only true for production environments on stag PUBLIC_REGISTRATION: false INVITE_REGISTRATION: false COOKIE_EXPIRE_TIME: 730 # days (730 days, two years is the default in main code) +CATEGORIES_ACTIVE: false BACKEND: # change all the below if needed From b094bdb27822112a80796978af74c07b6fa9f5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 4 Aug 2022 06:18:18 +0200 Subject: [PATCH 18/19] Refine 'TODO-next-update.md' --- TODO-next-update.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TODO-next-update.md b/TODO-next-update.md index 59bbf83..f05dfcb 100644 --- a/TODO-next-update.md +++ b/TODO-next-update.md @@ -2,7 +2,7 @@ When you overtake this deploy and rebrand repo to your network you have to recognize the following changes and doings … -## This Latest Version > 1.0.9 with 'ocelotDockerVersionTag' 1.0.9-199 +## This Latest Version >= 1.1.0 with 'ocelotDockerVersionTag' 1.1.0-205 ### PR – chore: 🍰 Release v1.1.0 - Implement Categories Again #63 From bfa39422385fcfa32842918020268128d69c60db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 4 Aug 2022 06:19:03 +0200 Subject: [PATCH 19/19] Release v1.1.0-205 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index da08624..1bbd611 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ocelot-social-branded", - "version": "1.0.9", - "ocelotDockerVersionTag": "1.0.9-199", + "version": "1.1.0", + "ocelotDockerVersionTag": "1.1.0-205", "dockerOrganisation": "ocelotsocialnetwork", "description": "ocelot.social Branded", "author": "ocelot.social Community",