From fd7e39e95906020870ecff022eadab4961bef5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 22 Mar 2023 16:17:57 +0100 Subject: [PATCH 01/30] Add script to set Neo4j in offline (maintenance) mode and back online --- deployment/scripts/cluster.neo4j.sh | 45 +++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 deployment/scripts/cluster.neo4j.sh diff --git a/deployment/scripts/cluster.neo4j.sh b/deployment/scripts/cluster.neo4j.sh new file mode 100755 index 000000000..9d996b0be --- /dev/null +++ b/deployment/scripts/cluster.neo4j.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# base setup +SCRIPT_PATH=$(realpath $0) +SCRIPT_DIR=$(dirname $SCRIPT_PATH) + +# check CONFIGURATION +if [ -z ${CONFIGURATION} ]; then + echo "You must provide a `CONFIGURATION` via environment variable" + exit 1 +fi + +# configuration +KUBECONFIG=${KUBECONFIG:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubeconfig.yaml} + +case $1 in + offline-mode) + # maintenance mode on + ${SCRIPT_DIR}/cluster.maintenance.sh on + + # set Neo4j in offline mode (maintenance) + kubectl --kubeconfig=${KUBECONFIG} get deployment ocelot-neo4j -o json \ + | jq '.spec.template.spec.containers[] += {"command": ["tail", "-f", "/dev/null"]}' \ + | kubectl --kubeconfig=${KUBECONFIG} apply -f - + + # wait for the container to restart + sleep 60 + ;; + online-mode) + # set Neo4j in online mode + kubectl --kubeconfig=${KUBECONFIG} get deployment ocelot-neo4j -o json \ + | jq 'del(.spec.template.spec.containers[].command)' \ + | kubectl --kubeconfig=${KUBECONFIG} apply -f - + + # wait for the container to restart + sleep 60 + + # maintenance mode off + ${SCRIPT_DIR}/cluster.maintenance.sh off + ;; + *) + echo -e "Run this script with first argument either 'offline-mode' or 'online-mode'" + exit + ;; +esac From 8d68537e3212dea6492c28faba0e8c1c58e7c5b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 22 Mar 2023 16:18:07 +0100 Subject: [PATCH 02/30] Refactor backup script by using new 'cluster.neo4j.sh' --- deployment/scripts/cluster.backup.sh | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/deployment/scripts/cluster.backup.sh b/deployment/scripts/cluster.backup.sh index 7d9cbd44d..22be2869b 100755 --- a/deployment/scripts/cluster.backup.sh +++ b/deployment/scripts/cluster.backup.sh @@ -19,15 +19,8 @@ BACKUP_FOLDER=${BACKUP_FOLDER:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/ mkdir -p ${BACKUP_FOLDER} # maintenance mode on -${SCRIPT_DIR}/cluster.maintenance.sh on - -# shutdown database -kubectl --kubeconfig=${KUBECONFIG} get deployment ocelot-neo4j -o json \ - | jq '.spec.template.spec.containers[] += {"command": ["tail", "-f", "/dev/null"]}' \ - | kubectl --kubeconfig=${KUBECONFIG} apply -f - - -# wait for the container to restart -sleep 60 +# set Neo4j in offline mode (maintenance) +${SCRIPT_DIR}/cluster.neo4j.sh offline-mode # database backup kubectl --kubeconfig=${KUBECONFIG} -n default exec -it \ @@ -40,13 +33,6 @@ kubectl --kubeconfig=${KUBECONFIG} cp \ kubectl --kubeconfig=${KUBECONFIG} cp \ default/$(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-backend |awk '{ print $1 }'):/app/public/uploads $BACKUP_FOLDER/public-uploads -# restart database -kubectl --kubeconfig=${KUBECONFIG} get deployment ocelot-neo4j -o json \ - | jq 'del(.spec.template.spec.containers[].command)' \ - | kubectl --kubeconfig=${KUBECONFIG} apply -f - - -# wait for the container to restart -sleep 60 - +# set Neo4j in online mode # maintenance mode off -${SCRIPT_DIR}/cluster.maintenance.sh off \ No newline at end of file +${SCRIPT_DIR}/cluster.neo4j.sh online-mode \ No newline at end of file From b6e0a490f8c23c2825aced557f49280f249f34fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 12 Sep 2023 14:01:54 +0200 Subject: [PATCH 03/30] Fix link in 'deployment/TODO-next-update.md' to 'deployment/deployment-values.md' --- deployment/TODO-next-update.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/TODO-next-update.md b/deployment/TODO-next-update.md index 4470efa14..591ce899f 100644 --- a/deployment/TODO-next-update.md +++ b/deployment/TODO-next-update.md @@ -4,7 +4,7 @@ When you introduce a new version and branding and deploy it on your network, you ## 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): +- We have the new option to configure DKIM for sent e-mails in environment variables (`.env` or `values.yaml`), see [deployment-values.md](deployment-values.md): - `SMTP_DKIM_DOMAINNAME=` - `SMTP_DKIM_KEYSELECTOR=` - `SMTP_DKIM_PRIVATKEY=` From d1b7ac62bbbdb9b63c59cfb4778938a2ff85a312 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 9 Oct 2023 14:20:30 +0200 Subject: [PATCH 04/30] fix(webapp): event date format --- webapp/components/ContributionForm/ContributionForm.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index 0a5eba0cd..5af3d7a99 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -328,9 +328,9 @@ export default { eventInput() { if (this.createEvent) { return { - eventStart: this.formData.eventStart, + eventStart: new Date(this.formData.eventStart).toISOString(), eventVenue: this.formData.eventVenue, - eventEnd: this.formData.eventEnd, + eventEnd: this.formData.eventEnd ? new Date(this.formData.eventEnd).toISOString() : null, eventIsOnline: this.formData.eventIsOnline, eventLocationName: !this.formData.eventIsOnline ? this.formData.eventLocationName : null, } From 972d23f76bf8544e530009b4b2a2f5b5cfd1620e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 10 Oct 2023 11:58:43 +0200 Subject: [PATCH 05/30] Add database name '--database=graph.db' to Neo4j commands --- deployment/src/kubernetes/Backup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/src/kubernetes/Backup.md b/deployment/src/kubernetes/Backup.md index 227b5765f..34011a512 100644 --- a/deployment/src/kubernetes/Backup.md +++ b/deployment/src/kubernetes/Backup.md @@ -137,7 +137,7 @@ $ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j # bash: enter bash of Neo4j $ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') -- bash # generate Dump -neo4j% neo4j-admin dump --to=/var/lib/neo4j/$(date +%F)-neo4j-dump +neo4j% neo4j-admin dump --database=graph.db --to=/var/lib/neo4j/$(date +%F)-neo4j-dump # exit bash neo4j% exit From 760083caf0c6b66d5f3663a69a3f275454a9a0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 10 Oct 2023 12:00:47 +0200 Subject: [PATCH 06/30] Adjust `docker-compose.yml` in deployment by allowing database upgrade --- deployment/docker-compose.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/deployment/docker-compose.yml b/deployment/docker-compose.yml index 973dc6ac5..5236a7025 100644 --- a/deployment/docker-compose.yml +++ b/deployment/docker-compose.yml @@ -142,19 +142,35 @@ services: - 3001:80 neo4j: + # Neo4j v3.5.14-community + # image: wollehuss/neo4j-community-branded:latest + # Neo4j 4.4-community image: ocelotsocialnetwork/neo4j-community:latest container_name: neo4j-branded networks: - test-network + ports: + - 7687:7687 + # only for development + # - 7474:7474 + - 7474:7474 volumes: - neo4j_data:/data environment: + # settings reference: https://neo4j.com/docs/operations-manual/4.4/docker/ref-settings/ + # TODO: This sounds scary for a production environment - NEO4J_AUTH=none - NEO4J_dbms_security_procedures_unrestricted=algo.*,apoc.* - - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes - ports: - - 7687:7687 - - 7474:7474 + - NEO4J_dbms_allow__format__migration=true + - NEO4J_dbms_allow__upgrade=true + # TODO: clarify if that is the only thing needed to unlock the Enterprise version + # - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes + # Uncomment following line for Neo4j Enterprise version instead of Community version + # TODO: clarify if that is the only thing needed to unlock the Enterprise version + # - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes + # TODO: Remove the playground from production + # bring the database in offline mode to export or load dumps + # command: ["tail", "-f", "/dev/null"] mailserver: image: djfarrelly/maildev From 788e08d03ec71dbb1695f1fe7c268009e410baa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 10 Oct 2023 12:01:06 +0200 Subject: [PATCH 07/30] Adjust `docker-compose.yml` in main folder by a comment --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 41e4dc261..78cee69b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -108,6 +108,7 @@ services: volumes: - neo4j_data:/data environment: + # settings reference: https://neo4j.com/docs/operations-manual/4.4/docker/ref-settings/ # TODO: This sounds scary for a production environment - NEO4J_AUTH=none - NEO4J_dbms_security_procedures_unrestricted=algo.*,apoc.* From ce589f5983f02101e52750f74774ecf41734a7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 10 Oct 2023 12:01:58 +0200 Subject: [PATCH 08/30] Add in docs the description of how to create a dump in a Docker container --- neo4j/README.md | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/neo4j/README.md b/neo4j/README.md index 1e0a1d477..dcf5714ea 100644 --- a/neo4j/README.md +++ b/neo4j/README.md @@ -53,15 +53,45 @@ Start Neo4J and confirm the database is running at [http://localhost:7474](http: ## Operations on Neo4j -### Import Neo4j Dump Locally in Docker +### Docker or Docker Compose + +- we need to set `command: ["tail", "-f", "/dev/null"]` in the Neo4j block of `docker-compose.yml` on top level so the Neo4j database is in maintenance mode + +### Create Neo4j Dump + +To create a dump in Neo4j running in a Docker container: + +- set the database to maintenance mode, see above +- entering the following commands: + +```bash +# connect to the Docker containers Neo4j terminal +$ docker exec -it neo4j bash +# generate Dump +neo4j% neo4j-admin dump --database=graph.db --to=/var/lib/neo4j/$(date +%F)-neo4j-dump +# exit bash +neo4j% exit +# copy the dump out of the running Docker container +$ docker cp :/var/lib/neo4j/neo4j-dump /$(date +%F)-neo4j-dump +``` + +### Import Neo4j Dump To import a dump into Neo4j running in a Docker container: -- we need to set `command: ["tail", "-f", "/dev/null"]` in the Neo4j block of `docker-compose.yml` on top level so the Neo4j database is in maintenance mode -- copy the dump into the running Docker container: `docker cp /path/to/dump :/existing-directory-in-docker/` -- connect to the Docker containers Neo4j terminal: `docker exec -it neo4j bash` -- to load the dump into the database we need the following command in this terminal: `neo4j-admin load --expand-commands --database=graph.db --from /backups/neo4j-dump --force` -- leave the terminal by entering: `exit` +- set the database to maintenance mode, see above +- entering the following commands: + +```bash +# copy the dump into the running Docker container +$ docker cp /neo4j-dump :/var/lib/neo4j/$(date +%F)-neo4j-dump +# connect to the Docker containers Neo4j terminal +$ docker exec -it neo4j bash +# to load the dump into the database we need the following command in this terminal +neo4j% neo4j-admin load --expand-commands --database=graph.db --from /var/lib/neo4j/$(date +%F)-neo4j-dump --force +# leave the terminal by entering +neo4j% exit +``` ## Commands From c6e78403ab36a40f5137085c81fc0cb242b8f66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 10 Oct 2023 12:11:08 +0200 Subject: [PATCH 09/30] Revert "fix(webapp): event date format" This reverts commit d1b7ac62bbbdb9b63c59cfb4778938a2ff85a312. --- webapp/components/ContributionForm/ContributionForm.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index 5af3d7a99..0a5eba0cd 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -328,9 +328,9 @@ export default { eventInput() { if (this.createEvent) { return { - eventStart: new Date(this.formData.eventStart).toISOString(), + eventStart: this.formData.eventStart, eventVenue: this.formData.eventVenue, - eventEnd: this.formData.eventEnd ? new Date(this.formData.eventEnd).toISOString() : null, + eventEnd: this.formData.eventEnd, eventIsOnline: this.formData.eventIsOnline, eventLocationName: !this.formData.eventIsOnline ? this.formData.eventLocationName : null, } From 2fd09cdd9d099532eb4f8a431dfcd90ceb804ce8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Oct 2023 01:34:31 +0000 Subject: [PATCH 10/30] Bump cypress from 13.2.0 to 13.3.1 Bumps [cypress](https://github.com/cypress-io/cypress) from 13.2.0 to 13.3.1. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v13.2.0...v13.3.1) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 453f6cafa..90042bf3c 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "bcryptjs": "^2.4.3", "cross-env": "^7.0.3", "cucumber": "^6.0.5", - "cypress": "^13.2.0", + "cypress": "^13.3.1", "cypress-network-idle": "^1.14.2", "date-fns": "^2.25.0", "dotenv": "^16.3.1", diff --git a/yarn.lock b/yarn.lock index 24a79a381..e70fdfd22 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2668,10 +2668,10 @@ cypress-network-idle@^1.14.2: resolved "https://registry.yarnpkg.com/cypress-network-idle/-/cypress-network-idle-1.14.2.tgz#0837100861feeb5a18f4c2d9815be079f8590f4d" integrity sha512-xAdR8dH58KFPv8eCDWjviScITrJOcUpuMXYfYTc175nk2/NvnJ+I6ylSn1CM7yZmoV/gLbFa36QLiH5NfNEaLQ== -cypress@^13.2.0: - version "13.2.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.2.0.tgz#10f73d06a0764764ffbb903a31e96e2118dcfc1d" - integrity sha512-AvDQxBydE771GTq0TR4ZUBvv9m9ffXuB/ueEtpDF/6gOcvFR96amgwSJP16Yhqw6VhmwqspT5nAGzoxxB+D89g== +cypress@^13.3.1: + version "13.3.1" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.3.1.tgz#d72f922e167891574c7773d07ac64d7114e11d49" + integrity sha512-g4mJLZxYN+UAF2LMy3Znd4LBnUmS59Vynd81VES59RdW48Yt+QtR2cush3melOoVNz0PPbADpWr8DcUx6mif8Q== dependencies: "@cypress/request" "^3.0.0" "@cypress/xvfb" "^1.2.4" From d034db3b2fc616d35c69a317ae6f5e63e59a17c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 19 Oct 2023 17:41:34 +0200 Subject: [PATCH 11/30] Fix main readme wiki links --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2062865dd..9d657f98b 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ In other words, we are interested in a network of networks and in keeping the da Post feed -Check out more screenshots [here](/wiki/en:Screenshots). +Check out more screenshots [here](https://github.com/Ocelot-Social-Community/Ocelot-Social/wiki/en:Screenshots). ## Features @@ -40,14 +40,14 @@ Ocelot.social networks feature: * filters * and more … -Check out the [full feature list](/wiki/en:FAQ#what-are-the-features). +Check out the [full feature list](https://github.com/Ocelot-Social-Community/Ocelot-Social/wiki/en:FAQ#what-are-the-features). ## User Guide and Frequently Asked Questions -In the [wiki](/wiki) you can find more information. +In the [wiki](https://github.com/Ocelot-Social-Community/Ocelot-Social/wiki) you can find more information. -* [User Guide](/wiki/en:User-Guide) -* [Frequently Asked Questions](/wiki/en:FAQ) +* [User Guide](https://github.com/Ocelot-Social-Community/Ocelot-Social/wiki/en:User-Guide) +* [Frequently Asked Questions](https://github.com/Ocelot-Social-Community/Ocelot-Social/wiki/en:FAQ) ## Demo From 3a65830e144bad06076efec1efc7abfcba567dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 19 Oct 2023 17:42:27 +0200 Subject: [PATCH 12/30] Fix deployment readme links --- deployment/src/kubernetes/DigitalOcean.md | 2 +- deployment/src/kubernetes/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/src/kubernetes/DigitalOcean.md b/deployment/src/kubernetes/DigitalOcean.md index 2c919d5f2..71c49d783 100644 --- a/deployment/src/kubernetes/DigitalOcean.md +++ b/deployment/src/kubernetes/DigitalOcean.md @@ -75,7 +75,7 @@ The IPs of the DigitalOcean machines are not necessarily stable, so the cluster' ## Deploy -Yeah, you're done here. Back to [Deployment with Helm for Kubernetes](/deployment/kubernetes/README.md). +Yeah, you're done here. Back to [Deployment with Helm for Kubernetes](/deployment/src/kubernetes/README.md). ## Backups On DigitalOcean diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index 126c37e9c..8453213cd 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -9,7 +9,7 @@ Please contact us if you are interested in options not listed below. Managed Kubernetes: -- [DigitalOcean](/deployment/kubernetes/DigitalOcean.md) +- [DigitalOcean](/deployment/src/kubernetes/DigitalOcean.md) ## Configuration From ce923cd6980fe2192b49c96e4c8f79928596e83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 19 Oct 2023 17:44:38 +0200 Subject: [PATCH 13/30] Update cert-manager and kubectl version in deployment --- deployment/src/kubernetes/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index 8453213cd..b86ad12a2 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -46,7 +46,7 @@ Please have a look here: - [Installing with Helm](https://cert-manager.io/docs/installation/helm/#installing-with-helm) -Our Helm installation is optimized for cert-manager version `v1.9.1` and `kubectl` version `"v1.24.2`. +Our Helm installation is optimized for cert-manager version `v1.13.1` and `kubectl` version `"v1.28.2`. Please search here for cert-manager versions that are compatible with your `kubectl` version on the cluster and on the client: [cert-manager Supported Releases](https://cert-manager.io/docs/installation/supported-releases/#supported-releases). From 70471f6e07eaf7ac5b03add114936339b9bd2c56 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 21 Oct 2023 01:17:06 +0000 Subject: [PATCH 14/30] Bump @faker-js/faker from 8.1.0 to 8.2.0 Bumps [@faker-js/faker](https://github.com/faker-js/faker) from 8.1.0 to 8.2.0. - [Release notes](https://github.com/faker-js/faker/releases) - [Changelog](https://github.com/faker-js/faker/blob/next/CHANGELOG.md) - [Commits](https://github.com/faker-js/faker/compare/v8.1.0...v8.2.0) --- updated-dependencies: - dependency-name: "@faker-js/faker" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 90042bf3c..04250c1f6 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@babel/register": "^7.22.15", "@badeball/cypress-cucumber-preprocessor": "^18.0.6", "@cypress/browserify-preprocessor": "^3.0.2", - "@faker-js/faker": "8.1.0", + "@faker-js/faker": "8.2.0", "auto-changelog": "^2.3.0", "bcryptjs": "^2.4.3", "cross-env": "^7.0.3", diff --git a/yarn.lock b/yarn.lock index e70fdfd22..73f9c00b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1395,10 +1395,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.3.tgz#e5036be529f757e58d9a7771f2f1b14782986a74" integrity sha512-FbUN+0ZRXsypPyWE2IwIkVjDkDnJoMJARWOcFZn4KPPli+QnKqF0z1anvfaYe3ev5HFCpRDLLBDHyOALLppWHw== -"@faker-js/faker@8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-8.1.0.tgz#e14896f1c57af2495e341dc4c7bf04125c8aeafd" - integrity sha512-38DT60rumHfBYynif3lmtxMqMqmsOQIxQgEuPZxCk2yUYN0eqWpTACgxi0VpidvsJB8CRxCpvP7B3anK85FjtQ== +"@faker-js/faker@8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-8.2.0.tgz#d4656d2cb485fe6ec4e7b340da9f16fac2c36c4a" + integrity sha512-VacmzZqVxdWdf9y64lDOMZNDMM/FQdtM9IsaOPKOm2suYwEatb8VkdHqOzXcDnZbk7YDE2BmsJmy/2Hmkn563g== "@hapi/address@2.x.x": version "2.1.4" From 97e1829970278e575e8b4bc2f8ed03389829f30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 24 Oct 2023 13:58:57 +0200 Subject: [PATCH 15/30] Fix explicit Kubernetes terminal commands for installing cert-manager --- deployment/src/kubernetes/README.md | 31 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index b86ad12a2..dbb2e7303 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -52,23 +52,14 @@ Please search here for cert-manager versions that are compatible with your `kube ***ATTENTION:*** *When uninstalling cert-manager, be sure to use the same method as for installation! Otherwise, we could end up in a broken state, see [Uninstall](https://cert-manager.io/docs/installation/kubectl/#uninstalling).* - From 30ae9981c0eb3c2a7ae35ecfd8e6954eecaa7a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 24 Oct 2023 14:01:23 +0200 Subject: [PATCH 16/30] Fix explicit Kubernetes terminal commands for install, upgrade, rollback, uninstall ocelot --- deployment/src/kubernetes/README.md | 56 ++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index dbb2e7303..eeac3cf54 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -190,10 +190,22 @@ All commands for ocelot need to be executed in the kubernetes folder. Therefore Only run once for the first time of installation: ```bash +# in configuration/ + # kubeconfig.yaml set globaly -$ helm install ocelot ./ +helm install ocelot \ + --values ./kubernetes/values.yaml \ + --set appVersion="latest" \ + ../../src/kubernetes/ \ + --timeout 10m + # or kubeconfig.yaml in your repo, then adjust -$ helm --kubeconfig=/../kubeconfig.yaml install ocelot ./ +helm install ocelot \ + --kubeconfig ./kubeconfig.yaml \ + --values ./kubernetes/values.yaml \ + --set appVersion="latest" \ + ../../src/kubernetes/ \ + --timeout 10m ``` #### Upgrade & Update @@ -201,10 +213,24 @@ $ helm --kubeconfig=/../kubeconfig.yaml install ocelot ./ Run for all upgrades and updates: ```bash +# !!! untested for now for new deployment structure !!! + +# in configuration/ + # kubeconfig.yaml set globaly -$ helm upgrade ocelot ./ +helm upgrade ocelot \ + --values ./kubernetes/values.yaml \ + --set appVersion="latest" \ + ../../src/kubernetes/ \ + --timeout 10m + # or kubeconfig.yaml in your repo, then adjust -$ helm --kubeconfig=/../kubeconfig.yaml upgrade ocelot ./ +helm upgrade ocelot \ + --kubeconfig ./kubeconfig.yaml \ + --values ./kubernetes/values.yaml \ + --set appVersion="latest" \ + ../../src/kubernetes/ \ + --timeout 10m ``` #### Rollback @@ -212,10 +238,17 @@ $ helm --kubeconfig=/../kubeconfig.yaml upgrade ocelot ./ Run for a rollback, in case something went wrong: ```bash +# !!! untested for now for new deployment structure !!! + +# in configuration/ + # kubeconfig.yaml set globaly -$ helm rollback ocelot +helm rollback ocelot --timeout 10m + # or kubeconfig.yaml in your repo, then adjust -$ helm --kubeconfig=/../kubeconfig.yaml rollback ocelot +helm rollback ocelot \ + --kubeconfig ./kubeconfig.yaml \ + --timeout 10m ``` #### Uninstall @@ -223,10 +256,17 @@ $ helm --kubeconfig=/../kubeconfig.yaml rollback ocelot Be aware that if you uninstall ocelot the formerly bound volumes become unbound. Those volumes contain all data from uploads and database. You have to manually free their reference in order to bind them again when reinstalling. Once unbound from their former container references they should automatically be rebound (considering the sizes did not change) ```bash +# !!! untested for now for new deployment structure !!! + +# in configuration/ + # kubeconfig.yaml set globaly -$ helm uninstall ocelot +helm uninstall ocelot --timeout 10m + # or kubeconfig.yaml in your repo, then adjust -$ helm --kubeconfig=/../kubeconfig.yaml uninstall ocelot +helm uninstall ocelot \ + --kubeconfig ./kubeconfig.yaml \ + --timeout 10m ``` ## Backups From e9ac5032aa6d6938c6da2df8a8a55e2ccb8459ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 24 Oct 2023 14:10:44 +0200 Subject: [PATCH 17/30] Fix explicit Kubernetes terminal commands for installing nginx --- deployment/src/kubernetes/README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index eeac3cf54..f827341a0 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -100,10 +100,15 @@ $ helm repo update #### 2. Install ingress-nginx ```bash +# in configuration/ + # kubeconfig.yaml set globaly -$ helm install ingress-nginx ingress-nginx/ingress-nginx -f nginx.values.yaml +helm install ingress-nginx ingress-nginx/ingress-nginx -f ../../src/kubernetes/nginx.values.yaml + # or kubeconfig.yaml in your repo, then adjust -$ helm --kubeconfig=/../kubeconfig.yaml install ingress-nginx ingress-nginx/ingress-nginx -f nginx.values.yaml +helm install \ + ingress-nginx ingress-nginx/ingress-nginx -f ../../src/kubernetes/nginx.values.yaml \ + --kubeconfig ./kubeconfig.yaml ``` ### DigitalOcean Firewall @@ -158,6 +163,8 @@ $ doctl compute firewall get --context ### DNS +***ATTENTION:** This seems not to work at all so we leave it away at the moment* + ***TODO:** I thought this is necessary if we use the DigitalOcean DNS management service? See [Manage DNS With DigitalOcean](/deployment/kubernetes/DigitalOcean.md#manage-dns-with-digitalocean)* This chart is only necessary (recommended is more precise) if you run DigitalOcean without load balancer. From 1ba1f1f3efd25107c4d68e96c599ffbcd7f7249e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 25 Oct 2023 12:17:34 +0200 Subject: [PATCH 18/30] Add Kubernetes terminal to set Neo4j database indexes, constrains, and initial admin account plus run migrate up --- deployment/src/kubernetes/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index f827341a0..d63528c25 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -338,8 +338,11 @@ $ kubectl -n default rollout status deployment/ocelot-neo4j --timeout=240s # !!! be aware of the correct kube context !!! $ kubectl config get-contexts -# reset and seed Neo4j database via backend for staging +# for staging: reset and seed Neo4j database via backend $ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "node --experimental-repl-await build/src/db/clean.js && node --experimental-repl-await build/src/db/seed.js" +# or alternatively +# for production: set Neo4j database indexes, constrains, and initial admin account plus run migrate up via backend +$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "yarn prod:migrate init && yarn prod:migrate up" ``` From 844ad0ff2132584cb07e8231e127af56f89f2877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 25 Oct 2023 12:29:55 +0200 Subject: [PATCH 19/30] Add Kubernetes cluster installation script to Kubernetes deployment --- deployment/scripts/cluster.install.sh | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 deployment/scripts/cluster.install.sh diff --git a/deployment/scripts/cluster.install.sh b/deployment/scripts/cluster.install.sh new file mode 100755 index 000000000..9dd7ed15a --- /dev/null +++ b/deployment/scripts/cluster.install.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +# !!! never tested !!! + +# base setup +SCRIPT_PATH=$(realpath $0) +SCRIPT_DIR=$(dirname $SCRIPT_PATH) + +# check CONFIGURATION +if [ -z ${CONFIGURATION} ]; then + echo "You must provide a `CONFIGURATION` via environment variable" + exit 1 +fi +echo "Using CONFIGURATION=${CONFIGURATION}" + +# configuration +KUBECONFIG=${KUBECONFIG:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubeconfig.yaml} +VALUES=${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubernetes/values.yaml +DOCKERHUB_OCELOT_TAG=${DOCKERHUB_OCELOT_TAG:-"latest"} + + +## install Ingress-Nginx +helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx +helm repo update +helm install \ + ingress-nginx ingress-nginx/ingress-nginx \ + --kubeconfig=${KUBECONFIG} \ + -f ${SCRIPT_DIR}/../src/kubernetes/nginx.values.yaml + +## install Cert-Manager +helm repo add jetstack https://charts.jetstack.io +helm repo update +helm install \ + cert-manager jetstack/cert-manager \ + --kubeconfig=${KUBECONFIG} \ + --namespace cert-manager \ + --create-namespace \ + --version v1.13.1 \ + --set installCRDs=true + +## install Ocelot with helm +helm install \ + ocelot \ + --kubeconfig=${KUBECONFIG} \ + --values ${VALUES} \ + --set appVersion="${DOCKERHUB_OCELOT_TAG}" \ + ${SCRIPT_DIR}/../src/kubernetes/ \ + --timeout 10m + +## set Neo4j database indexes, constrains, and initial admin account plus run migrate up +kubectl --kubeconfig=${KUBECONFIG} \ + -n default \ + exec -it \ + $(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- \ + /bin/sh -c "yarn prod:migrate init && yarn prod:migrate up" + # /bin/sh -c "node --experimental-repl-await build/src/db/clean.js && node --experimental-repl-await build/src/db/seed.js" + +echo "!!! You must install a firewall or similar !!! (for DigitalOcean see: deployment/src/kubernetes/README.md)" From 98652848ba6fe5a2bbdce23199ff8adc3e81c9e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 25 Oct 2023 12:32:58 +0200 Subject: [PATCH 20/30] Add comment in readme --- deployment/src/kubernetes/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index d63528c25..17773d736 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -180,6 +180,8 @@ $ helm repo update #### 2. Install DNS ```bash +# !!! untested for now for new deployment structure !!! + # kubeconfig.yaml set globaly $ helm install dns bitnami/external-dns -f dns.values.yaml # or kubeconfig.yaml in your repo, then adjust From 16ce5673a315ec5ee97fd4f791d79d052f3a5af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 25 Oct 2023 13:26:23 +0200 Subject: [PATCH 21/30] Change 'cluster.neo4j.sh' switching command to same mechanic as maintenance --- deployment/scripts/cluster.backup.sh | 4 ++-- deployment/scripts/cluster.neo4j.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deployment/scripts/cluster.backup.sh b/deployment/scripts/cluster.backup.sh index 64ea2a756..2ca7bd206 100755 --- a/deployment/scripts/cluster.backup.sh +++ b/deployment/scripts/cluster.backup.sh @@ -20,7 +20,7 @@ mkdir -p ${BACKUP_FOLDER} # maintenance mode on # set Neo4j in offline mode (maintenance) -${SCRIPT_DIR}/cluster.neo4j.sh offline-mode +${SCRIPT_DIR}/cluster.neo4j.sh off # database backup kubectl --kubeconfig=${KUBECONFIG} -n default exec -it \ @@ -35,4 +35,4 @@ kubectl --kubeconfig=${KUBECONFIG} cp \ # set Neo4j in online mode # maintenance mode off -${SCRIPT_DIR}/cluster.neo4j.sh online-mode \ No newline at end of file +${SCRIPT_DIR}/cluster.neo4j.sh on \ No newline at end of file diff --git a/deployment/scripts/cluster.neo4j.sh b/deployment/scripts/cluster.neo4j.sh index 9d996b0be..f886b0916 100755 --- a/deployment/scripts/cluster.neo4j.sh +++ b/deployment/scripts/cluster.neo4j.sh @@ -14,7 +14,7 @@ fi KUBECONFIG=${KUBECONFIG:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubeconfig.yaml} case $1 in - offline-mode) + off) # maintenance mode on ${SCRIPT_DIR}/cluster.maintenance.sh on @@ -26,7 +26,7 @@ case $1 in # wait for the container to restart sleep 60 ;; - online-mode) + on) # set Neo4j in online mode kubectl --kubeconfig=${KUBECONFIG} get deployment ocelot-neo4j -o json \ | jq 'del(.spec.template.spec.containers[].command)' \ @@ -39,7 +39,7 @@ case $1 in ${SCRIPT_DIR}/cluster.maintenance.sh off ;; *) - echo -e "Run this script with first argument either 'offline-mode' or 'online-mode'" + echo -e "Run this script with first argument either 'off' or 'on'" exit ;; esac From 85e6b5fc48d7f42d1a1ed3d0c69b327bc5d84670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 25 Oct 2023 13:56:14 +0200 Subject: [PATCH 22/30] Change 'cluster.neo4j.sh' commands to 'maintenance on' and 'maintenance off' --- deployment/scripts/cluster.backup.sh | 10 +++--- deployment/scripts/cluster.neo4j.sh | 48 ++++++++++++++++------------ 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/deployment/scripts/cluster.backup.sh b/deployment/scripts/cluster.backup.sh index 2ca7bd206..9503061cf 100755 --- a/deployment/scripts/cluster.backup.sh +++ b/deployment/scripts/cluster.backup.sh @@ -18,9 +18,8 @@ BACKUP_FOLDER=${BACKUP_FOLDER:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/ # create backup fodler mkdir -p ${BACKUP_FOLDER} -# maintenance mode on -# set Neo4j in offline mode (maintenance) -${SCRIPT_DIR}/cluster.neo4j.sh off +# cluster maintenance mode on && Neo4j maintenance mode on +${SCRIPT_DIR}/cluster.neo4j.sh maintenance on # database backup kubectl --kubeconfig=${KUBECONFIG} -n default exec -it \ @@ -33,6 +32,5 @@ kubectl --kubeconfig=${KUBECONFIG} cp \ kubectl --kubeconfig=${KUBECONFIG} cp \ default/$(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-backend |awk '{ print $1 }'):/app/public/uploads $BACKUP_FOLDER/public-uploads -# set Neo4j in online mode -# maintenance mode off -${SCRIPT_DIR}/cluster.neo4j.sh on \ No newline at end of file +# Neo4j maintenance mode off && cluster maintenance mode off +${SCRIPT_DIR}/cluster.neo4j.sh maintenance off \ No newline at end of file diff --git a/deployment/scripts/cluster.neo4j.sh b/deployment/scripts/cluster.neo4j.sh index f886b0916..41ebe4227 100755 --- a/deployment/scripts/cluster.neo4j.sh +++ b/deployment/scripts/cluster.neo4j.sh @@ -14,32 +14,40 @@ fi KUBECONFIG=${KUBECONFIG:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubeconfig.yaml} case $1 in - off) - # maintenance mode on - ${SCRIPT_DIR}/cluster.maintenance.sh on + maintenance) + case $2 in + on) + # maintenance mode on + ${SCRIPT_DIR}/cluster.maintenance.sh on - # set Neo4j in offline mode (maintenance) - kubectl --kubeconfig=${KUBECONFIG} get deployment ocelot-neo4j -o json \ - | jq '.spec.template.spec.containers[] += {"command": ["tail", "-f", "/dev/null"]}' \ - | kubectl --kubeconfig=${KUBECONFIG} apply -f - + # set Neo4j in offline mode (maintenance) + kubectl --kubeconfig=${KUBECONFIG} get deployment ocelot-neo4j -o json \ + | jq '.spec.template.spec.containers[] += {"command": ["tail", "-f", "/dev/null"]}' \ + | kubectl --kubeconfig=${KUBECONFIG} apply -f - - # wait for the container to restart - sleep 60 - ;; - on) - # set Neo4j in online mode - kubectl --kubeconfig=${KUBECONFIG} get deployment ocelot-neo4j -o json \ - | jq 'del(.spec.template.spec.containers[].command)' \ - | kubectl --kubeconfig=${KUBECONFIG} apply -f - + # wait for the container to restart + sleep 60 + ;; + off) + # set Neo4j in online mode + kubectl --kubeconfig=${KUBECONFIG} get deployment ocelot-neo4j -o json \ + | jq 'del(.spec.template.spec.containers[].command)' \ + | kubectl --kubeconfig=${KUBECONFIG} apply -f - - # wait for the container to restart - sleep 60 + # wait for the container to restart + sleep 60 - # maintenance mode off - ${SCRIPT_DIR}/cluster.maintenance.sh off + # maintenance mode off + ${SCRIPT_DIR}/cluster.maintenance.sh off + ;; + *) + echo -e "Run this script with first argument either 'off' or 'on'" + exit + ;; + esac ;; *) - echo -e "Run this script with first argument either 'off' or 'on'" + echo -e "Run this script with first argument 'maintenance'" exit ;; esac From 9fa94995ce3a6285b6fc3cfd75594e5de9a6a55c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 26 Oct 2023 16:58:14 +0200 Subject: [PATCH 23/30] Fix divers links etc. in main readme --- README.md | 98 +++++++++++++++++++++++++++---------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 2062865dd..73e26deb3 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,19 @@ Check out more screenshots [here](/wiki/en:Screenshots). ## Features -Ocelot.social networks feature: -* user accounts -* user roles -* posts and comments -* groups -* maps -* search -* filters -* and more … +Ocelot.social networks features: + +- **news feed** +- **posts** +- as **articles** and **events** +- **comments** +- **filter** +- **search** +- **groups** +- **map** +- **user accounts** +- **user roles** +- and more … Check out the [full feature list](/wiki/en:FAQ#what-are-the-features). @@ -46,8 +50,8 @@ Check out the [full feature list](/wiki/en:FAQ#what-are-the-features). In the [wiki](/wiki) you can find more information. -* [User Guide](/wiki/en:User-Guide) -* [Frequently Asked Questions](/wiki/en:FAQ) +- [User Guide](/wiki/en:User-Guide) +- [Frequently Asked Questions](/wiki/en:FAQ) ## Demo @@ -57,27 +61,28 @@ Try out our live demo network, see [here](#live-demo-and-developer-logins). If you're wondering how you could help, there are plenty of ways, e.g.: -* Spread the good word about ocelot.social to make it more popular: - * Add the link [ocelot.social](https://ocelot.social) to your website. - * Give ocelot.social a Like at https://alternativeto.net/software/ocelot-social/. - * Star our project on GitHub at https://github.com/Ocelot-Social-Community/Ocelot-Social/. - * Promote it on your social networks. - * Tell your friends about it by word-of-mouth. - * Write a press article on ocelot.social or contact the editorial office of your local newspage or radio station. -* Take a [good first issue](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) or issues that need help. Make sure to read [CONTRIBUTING.md](/CONTRIBUTING.md) first though. -* Testing and [reporting](/issues/new/choose) bugs. -* Translating: Please [contact us](#contact). -* Reviewing and testing pull requests. +- Spread the good word about ocelot.social to make it more popular: + - Add the link [ocelot.social](https://ocelot.social) to your website. + - Give ocelot.social a Like at . + - Star our project on GitHub at . + - Promote it on your social networks. + - Tell your friends about it by word-of-mouth. + - Write a press article on ocelot.social or contact the editorial office of your local news page or radio station. +- Take a [good first issue](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) or issues that need help. Make sure to read [CONTRIBUTING.md](/CONTRIBUTING.md) first though. +- Testing and [reporting](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues/new/choose) bugs. +- Translating: Please [contact us](#contact). +- Reviewing and testing pull requests. -## Donate +## Donate -Your donation is very welcome and helps to enhance and improve the network. This software is mostly developped and maintained by the association [busFaktor() e.V.](https://www.busfaktor.org/en). Please support us with a [donation](https://www.busfaktor.org/en/donations) to busFaktor() e.V.. Thanks a lot! ❤️ +Your donation is very welcome and helps to enhance and improve the network. This software is mostly developed and maintained by the association [busFaktor() e.V.](https://www.busfaktor.org/en) . Please support us with a [donation](https://www.busfaktor.org/en/donations) to busFaktor() e.V. . Thanks a lot! ❤️ ## Contact Are you interested in operating your own ocelot.social network or becoming a user? Please contact us here: -* [hello@ocelot.social](mailto:hello@ocelot.social) -* [Discord](https://discord.com/invite/DFSjPaX) + +- [hello@ocelot.social](mailto:hello@ocelot.social) +- our developer chat on [Discord](https://discord.com/invite/DFSjPaX) ## For Developers and Contributors @@ -90,17 +95,17 @@ Have a look into our short video: There are three important directories: -* [Backend](./backend) runs on the server and is a middleware between database and frontend -* [Frontend](./webapp) is a server-side-rendered and client-side-rendered web frontend -* [Cypress](./cypress) contains end-to-end tests and executable feature specifications +- [Backend](./backend) runs on the server and is a middleware between database and frontend +- [Frontend](./webapp) is a server-side-rendered and client-side-rendered web frontend +- [Cypress](./cypress) contains end-to-end tests and executable feature specifications In order to setup the application and start to develop features you have to -setup **frontend** and **backend**. +setup **webapp** and **backend**. There are two approaches: 1. [Local](#local-installation) installation, which means you have to take care of dependencies yourself. -2. **Or** Install everything through [Docker](#docker-installation) which takes care of dependencies for you. +2. **Or** install everything through [Docker](#docker-installation) which takes care of dependencies for you. ### Installation @@ -126,7 +131,7 @@ Change into the new folder. $ cd Ocelot-Social ``` -### Live Demo And Developer Logins +### Live Demo and Developer Logins **Try out our deployed [development environment](https://stage.ocelot.social).** @@ -151,19 +156,14 @@ Docker is a software development container tool that combines software and its d ##### General Installation of Docker -There are [several ways to install Docker CE](https://docs.docker.com/install/) on your computer or server. - - * [install Docker Desktop on macOS](https://docs.docker.com/docker-for-mac/install/) - * [install Docker Desktop on Windows](https://docs.docker.com/docker-for-windows/install/) - * [install Docker CE on Linux](https://docs.docker.com/install/) +There are [several ways to install Docker](https://docs.docker.com/get-docker/) on your computer or server. Check the correct Docker installation by checking the version before proceeding. E.g. we have the following versions: ```bash +# use Docker version 24.0.6 or newer +# includes Docker Compose $ docker --version -Docker version 18.09.2 -$ docker-compose --version -docker-compose version 1.23.2 ``` ##### Start Ocelot-Social via Docker-Compose @@ -182,14 +182,14 @@ For Development: ```bash # in main folder -$ docker-compose up +$ docker compose up ``` For Production: ```bash # in main folder -$ docker-compose -f docker-compose.yml up +$ docker compose -f docker-compose.yml up ``` This will start all required Docker containers. @@ -198,7 +198,7 @@ Make sure your database is running on `http://localhost:7474/browser/`. Prepare database once before you start by running the following command in a second terminal: ```bash -# in main folder while docker-compose is up +# in main folder while docker compose is up $ docker compose exec backend yarn run db:migrate init $ docker compose exec backend yarn run db:migrate up ``` @@ -206,17 +206,17 @@ $ docker compose exec backend yarn run db:migrate up Then clear and seed database by running the following command as well in the second terminal: ```bash -# in main folder while docker-compose is up -$ docker-compose exec backend yarn run db:reset -$ docker-compose exec backend yarn run db:seed +# in main folder while docker compose is up +$ docker compose exec backend yarn run db:reset +$ docker compose exec backend yarn run db:seed ``` -For a closer description see [backend README.md](./backend/README.md). -For a full documentation see [SUMMARY](./SUMMARY.md). +For a closer description see [backend](./backend/README.md). +For a full documentation of the Docker installation see [summary](./SUMMARY.md). #### Local Installation -For a full documentation see [SUMMARY](./SUMMARY.md). +For a full documentation of the local installation see [summary](./SUMMARY.md). ### Contributing From 33fbafd5cbb40e4b97090802c83cacc8f349fee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 26 Oct 2023 18:31:45 +0200 Subject: [PATCH 24/30] Refine main readme --- README.md | 60 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 73e26deb3..2a90b6aca 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,17 @@ Our goal is to enable people to participate fairly and equally in online social We therefore consider it desirable that operators offer such networks so that people can choose where they want to be on the move. -At the same time, it should be possible in the future to link these networks with each other (ActivityPub, Fediverse), so that users can also connect with people from other networks - for example by making friends or following posts or other contributions. +Our vision for the future is that at some point it should be possible to link these networks together (ActivityPub, Fediverse) so that users can also connect with people from other networks - for example, by friending them or following posts or other contributions. + +If you would like to help set up this capability with us, please contact us. In other words, we are interested in a network of networks and in keeping the data as close as possible to the user and the operator they trusts. ## Screenshots + Post feed + Check out more screenshots [here](/wiki/en:Screenshots). @@ -42,6 +46,7 @@ Ocelot.social networks features: - **map** - **user accounts** - **user roles** +- make your own **branded network** - and more … Check out the [full feature list](/wiki/en:FAQ#what-are-the-features). @@ -82,7 +87,7 @@ Your donation is very welcome and helps to enhance and improve the network. This Are you interested in operating your own ocelot.social network or becoming a user? Please contact us here: - [hello@ocelot.social](mailto:hello@ocelot.social) -- our developer chat on [Discord](https://discord.com/invite/DFSjPaX) +- our developer chat on [Discord](https://discord.gg/AJSX9DCSUA) ## For Developers and Contributors @@ -137,7 +142,7 @@ $ cd Ocelot-Social Visit our staging networks: -* central staging network: [stage.ocelot.social](https://stage.ocelot.social) +- central staging network: [stage.ocelot.social](https://stage.ocelot.social) #### Login @@ -225,7 +230,9 @@ To have the necessary permission to push directly to this repository, please acc We are happy if you fork our repository, but we don't recommend it for development. You do not need a fork. -Clone this repository locally as [described above](#clone-the-repository), create your branch named `-`, add your code and push your branch to this repository. Then create a PR by comparing it to our `master`. +Clone this repository locally as [described above](#clone-the-repository), create your branch named `-`, add your code and push your branch direct to this repository. Then create a PR by comparing it to our `master`. + +**_!!! Be aware:_** Please don't compare from a fork, because the tests are breaking caused by credential problems. Please run the following commands before you push: @@ -246,33 +253,48 @@ Check out our [contribution guideline](./CONTRIBUTING.md), too! #### Developer Chat -Join our friendly open-source community on [Discord](https://discord.gg/AJSX9DCSUA) :heart_eyes_cat: -Just introduce yourself at `#introduce-yourself` and mention a mentor or `@@Mentors` to get you onboard :neckbeard: +Join our friendly open-source community on [Discord](https://discord.gg/AJSX9DCSUA) 😻 +Just introduce yourself at `#introduce-yourself` and mention a mentor or `@@Mentors` to get you onboard 🤓 We give write permissions to every developer who asks for it. Just text us on [Discord](https://discord.gg/AJSX9DCSUA). ### Deployment -Deployment methods can be found in the [Ocelot-Social-Deploy-Rebranding](https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding) repository. +Deployment methods can be found in our `deployment` folder described in the deployment [README](./deployment/README.md). +Our branding template is our [stage.ocelot.social](https://github.com/Ocelot-Social-Community/stage.ocelot.social) repository. +Place your branding repository inside `deployment/configurations`. -The only deployment method in this repository for development purposes as described above is `docker-compose`. +The only deployment method in this repository for production purposes is [Kubernetes](https://kubernetes.io) for now. +But we just started to develop a deployment for [Docker Compose](https://docs.docker.com/compose/) as well. + +The only deployment method with branding in this repository for development purposes as described above is [Docker Compose](https://docs.docker.com/compose/): + +```bash +# in folder deployment/ +# set your branding folder name in .env +# then run +$ docker compose up +``` + +The code is branded automatically. +To setup the Neo4j database see above. ### Technology Stack -* [VueJS](https://vuejs.org/) -* [NuxtJS](https://nuxtjs.org/) -* [GraphQL](https://graphql.org/) -* [NodeJS](https://nodejs.org/en/) -* [Neo4J](https://neo4j.com/) +- [VueJS](https://vuejs.org/) +- [NuxtJS](https://nuxtjs.org/) +- [GraphQL](https://graphql.org/) +- [NodeJS](https://nodejs.org/en/) +- [Neo4J](https://neo4j.com/) #### For Testing -* [Cypress](https://docs.cypress.io/) -* [Storybook](https://storybook.js.org/) -* [Jest](https://jestjs.io/) -* [Vue Test Utils](https://vue-test-utils.vuejs.org/) -* [ESLint](https://eslint.org/) +- [Cypress](https://docs.cypress.io/) +- [Storybook](https://storybook.js.org/) +- [Jest](https://jestjs.io/) +- [Vue Test Utils](https://vue-test-utils.vuejs.org/) +- [ESLint](https://eslint.org/) ### Attributions @@ -280,7 +302,9 @@ Locale Icons made by [Freepik](http://www.freepik.com/) from [www.flaticon.com]( Browser compatibility testing with [BrowserStack](https://www.browserstack.com/). + BrowserStack Logo + ### License From 64f276e56ce5ca0f2ab91117abd1de1cef0a1302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 26 Oct 2023 19:04:51 +0200 Subject: [PATCH 25/30] Fix divers links etc. in diverse readmes --- README.md | 4 ++-- SUMMARY.md | 12 +++++------- backend/graphql.md | 7 ++++--- backend/src/graphql/GraphQL-Playground.md | 2 ++ backend/testing.md | 1 + edit-this-documentation.md | 21 +++++++++++---------- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 2a90b6aca..e9656cf86 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Discord Channel](https://img.shields.io/discord/489522408076738561.svg)](https://discord.gg/AJSX9DCSUA) [![Open Source Helpers](https://www.codetriage.com/ocelot-social-community/ocelot-social/badges/users.svg)](https://www.codetriage.com/ocelot-social-community/ocelot-social) -[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. +[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.

@@ -261,7 +261,7 @@ We give write permissions to every developer who asks for it. Just text us on ### Deployment -Deployment methods can be found in our `deployment` folder described in the deployment [README](./deployment/README.md). +Deployment methods can be found in our `deployment` folder described in the [README](./deployment/README.md). Our branding template is our [stage.ocelot.social](https://github.com/Ocelot-Social-Community/stage.ocelot.social) repository. Place your branding repository inside `deployment/configurations`. diff --git a/SUMMARY.md b/SUMMARY.md index 453a809b4..097da9986 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -6,19 +6,17 @@ * [Backend](backend/README.md) * [GraphQL](backend/graphql.md) * [neo4j-graphql-js](backend/neo4j-graphql-js.md) -* [Webapp](webapp/README.md) +* [Webapp (Frontend)](webapp/README.md) * [Components](webapp/components.md) * [HTML](webapp/html.md) * [SCSS](webapp/scss.md) * [Vue](webapp/vue.md) * [Testing Guide](testing.md) - * [End-to-end tests](cypress/README.md) - * [Frontend tests](webapp/testing.md) - * [Backend tests](backend/testing.md) -* [Docker More Closely](DOCKER_MORE_CLOSELY.md) + * [End-to-end Tests](cypress/README.md) + * [Webapp (Frontend) Tests](webapp/testing.md) + * [Backend Tests](backend/testing.md) * [Deployment](deployment/README.md) * [Contributing](CONTRIBUTING.md) * [Feature Specification](cypress/features.md) -* [Code of conduct](CODE_OF_CONDUCT.md) +* [Code of Conduct](CODE_OF_CONDUCT.md) * [License](LICENSE.md) - diff --git a/backend/graphql.md b/backend/graphql.md index 12cc59e57..f49edb3b8 100644 --- a/backend/graphql.md +++ b/backend/graphql.md @@ -2,12 +2,13 @@ GraphQL is a data query language which provides an alternative to REST and ad-hoc web service architectures. It allows clients to define the structure of the data required, and exactly the same structure of the data is returned from the server. -![GraphQL Playground](../../../.gitbook/assets/graphql-playground%20%281%29.png) +We have a closer description for the [GraphQL Playground](./src/graphql/GraphQL-Playground.md). + +![GraphQL Playground](../.gitbook/assets/graphql-playground%20%281%29.png) ## Middleware keeps resolvers clean -![](../.gitbook/assets/grafik-4.png) - +![Middleware schema](../.gitbook/assets/grafik-4.png) A well-organized codebase is key for the ability to maintain and easily introduce changes into an app. Figuring out the right structure for your code remains a continuous challenge - especially as an application grows and more developers are joining a project. diff --git a/backend/src/graphql/GraphQL-Playground.md b/backend/src/graphql/GraphQL-Playground.md index 33e371eb5..e914ea993 100644 --- a/backend/src/graphql/GraphQL-Playground.md +++ b/backend/src/graphql/GraphQL-Playground.md @@ -1,5 +1,7 @@ # GraphQL Playground +![GraphQL Playground](../../../.gitbook/assets/graphql-playground%20%281%29.png) + ***Attention:** For using the GraphQL Playground set `DEBUG=true` in your backend `.env`, see `.env.template`!* To use GraphQL Playground, we need to know some basics: diff --git a/backend/testing.md b/backend/testing.md index 600973450..a246569e5 100644 --- a/backend/testing.md +++ b/backend/testing.md @@ -1,2 +1,3 @@ # Unit Testing +***TODO:** To be filled in* diff --git a/edit-this-documentation.md b/edit-this-documentation.md index c841b09ca..5353688bd 100644 --- a/edit-this-documentation.md +++ b/edit-this-documentation.md @@ -2,13 +2,13 @@ Find the [**table of contents** for this documentation on GitHub](https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/SUMMARY.md) and navigate to the file you need to update. -Click on the **edit pencil** on the right side directly above the text to edit this file on your fork of Human Connection \(HC\). +Click on the **edit pencil** on the right side directly above the text to edit this file in our repository. You can see a preview of your changes by clicking the **Preview changes** tab aside the **Edit file** tab. If you are ready, fill in the **Propose file change** at the end of the webpage. -After that you have to send your change to the HC basis with a pull request. Here make a comment which issue you have fixed. (If you are working on one of our [open issues](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues) please include the number.) +After that you have to compare your change branch to our `master` branch with a pull request. Here make a comment which issue you have fixed. (If you are working on one of our [open issues](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues) please include the number.) ## Markdown your documentation @@ -21,9 +21,9 @@ To design your documentation see the syntax description at GitBook: #### Headlines ```markdown -# Main headline -## Smaller headlines -### Small headlines +# Main Headline +## Smaller Headlines +### Small Headlines ``` #### Tabs @@ -60,15 +60,15 @@ XXX ![XXX](https://XXX) ``` -#### Hints For ToDos +#### Hints for ToDos ```markdown {% hint style="info" %} TODO: XXX {% endhint %} ``` -## Host The Screenshots +## Host the Screenshots -### Host On Ocelot-Social \(GitHub\) repository +### Host on Ocelot-Social \(GitHub\) Repository {% hint style="info" %} TODO: How to host on Ocelot-Social \(GitHub\) repository ... @@ -88,12 +88,13 @@ Right click on it and choose kind of **Open link in new tab**. Copy the URL and paste it were you need it. -## Screenshot modification +## Screenshot Modification -### Add an arrow or some other marking stuff +### Add an Arrow or some other Marking Stuff {% tabs %} {% tab title="macOS" %} + #### In the Preview App Got to: **Menu** + **Tools** \(GER: Werkzeuge\) + **Annotate** \(GER: Anmerkungen\) + etc. From 34ac7b97bd22a888529e4c803f74a3aa53a7cdcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 30 Oct 2023 15:57:30 +0100 Subject: [PATCH 26/30] Make filter menu visible if categories are inactive --- .../FilterMenu/FilterMenuComponent.vue | 28 ++++++++++--------- webapp/pages/index.vue | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/webapp/components/FilterMenu/FilterMenuComponent.vue b/webapp/components/FilterMenu/FilterMenuComponent.vue index e362e758f..7897a285d 100644 --- a/webapp/components/FilterMenu/FilterMenuComponent.vue +++ b/webapp/components/FilterMenu/FilterMenuComponent.vue @@ -3,7 +3,7 @@

{{ $t('filter-menu.filter-by') }}

-
+
{ - this.$emit('showFilterMenu') - this.$toast.success(this.$t('filter-menu.save.success')) - }) - .catch(() => { - this.$toast.error(this.$t('filter-menu.save.error')) - }) + if (this.categoriesActive) { + this.$apollo + .mutate({ + mutation: SaveCategories(), + variables: { activeCategories: this.filteredCategoryIds }, + }) + .then(() => { + this.$emit('showFilterMenu') + this.$toast.success(this.$t('filter-menu.save.success')) + }) + .catch(() => { + this.$toast.error(this.$t('filter-menu.save.error')) + }) + } }, }, } diff --git a/webapp/pages/index.vue b/webapp/pages/index.vue index 7b5c4a903..6067119e1 100644 --- a/webapp/pages/index.vue +++ b/webapp/pages/index.vue @@ -19,7 +19,7 @@
-
+
Date: Tue, 31 Oct 2023 11:10:38 +0100 Subject: [PATCH 27/30] replace deprecated jest methods in webapp unit tests --- .../components/DonationInfo/DonationInfo.spec.js | 4 ++-- webapp/components/Group/GroupMember.spec.js | 12 ++++++------ webapp/components/LoginForm/LoginForm.spec.js | 14 +++++++------- webapp/components/PostTeaser/PostTeaser.spec.js | 2 +- webapp/pages/index.spec.js | 4 ++-- webapp/pages/login.spec.js | 2 +- webapp/pages/logout.spec.js | 4 ++-- webapp/pages/map.spec.js | 10 +++++----- webapp/pages/password-reset.spec.js | 2 +- webapp/pages/post/edit/_id.spec.js | 2 +- webapp/pages/registration.spec.js | 2 +- webapp/pages/terms-and-conditions-confirm.spec.js | 2 +- 12 files changed, 30 insertions(+), 30 deletions(-) diff --git a/webapp/components/DonationInfo/DonationInfo.spec.js b/webapp/components/DonationInfo/DonationInfo.spec.js index 76aef9444..ac537be5b 100644 --- a/webapp/components/DonationInfo/DonationInfo.spec.js +++ b/webapp/components/DonationInfo/DonationInfo.spec.js @@ -46,7 +46,7 @@ describe('DonationInfo.vue', () => { // it looks to me that toLocaleString for some reason is not working as expected it.skip('creates a label from the given amounts and a translation string', () => { - expect(mocks.$t).nthCalledWith(1, 'donations.amount-of-total', { + expect(mocks.$t).toHaveBeenNthCalledWith(1, 'donations.amount-of-total', { amount: '10.000', total: '50.000', }) @@ -55,7 +55,7 @@ describe('DonationInfo.vue', () => { describe('given english locale', () => { it('creates a label from the given amounts and a translation string', () => { - expect(mocks.$t).toBeCalledWith( + expect(mocks.$t).toHaveBeenCalledWith( 'donations.amount-of-total', expect.objectContaining({ amount: '10,000', diff --git a/webapp/components/Group/GroupMember.spec.js b/webapp/components/Group/GroupMember.spec.js index ef8b96568..8efc754ad 100644 --- a/webapp/components/Group/GroupMember.spec.js +++ b/webapp/components/Group/GroupMember.spec.js @@ -94,20 +94,20 @@ describe('GroupMember', () => { describe('with server error', () => { it('toasts an error message', () => { - expect(toastErrorMock).toBeCalledWith('Oh no!') + expect(toastErrorMock).toHaveBeenCalledWith('Oh no!') }) }) describe('with server success', () => { it('calls the API', () => { - expect(apolloMock).toBeCalledWith({ + expect(apolloMock).toHaveBeenCalledWith({ mutation: changeGroupMemberRoleMutation(), variables: { groupId: 'group-id', userId: 'user', roleInGroup: 'admin' }, }) }) it('toasts a success message', () => { - expect(toastSuccessMock).toBeCalledWith('group.changeMemberRole') + expect(toastSuccessMock).toHaveBeenCalledWith('group.changeMemberRole') }) }) }) @@ -150,7 +150,7 @@ describe('GroupMember', () => { }) it('toasts an error message', () => { - expect(toastErrorMock).toBeCalledWith('Oh no!!') + expect(toastErrorMock).toHaveBeenCalledWith('Oh no!!') }) it('closes the modal', () => { @@ -165,7 +165,7 @@ describe('GroupMember', () => { }) it('calls the API', () => { - expect(apolloMock).toBeCalledWith({ + expect(apolloMock).toHaveBeenCalledWith({ mutation: removeUserFromGroupMutation(), variables: { groupId: 'group-id', userId: 'user' }, }) @@ -176,7 +176,7 @@ describe('GroupMember', () => { }) it('toasts a success message', () => { - expect(toastSuccessMock).toBeCalledWith('group.memberRemoved') + expect(toastSuccessMock).toHaveBeenCalledWith('group.memberRemoved') }) it('closes the modal', () => { diff --git a/webapp/components/LoginForm/LoginForm.spec.js b/webapp/components/LoginForm/LoginForm.spec.js index e0972b453..2004656a5 100644 --- a/webapp/components/LoginForm/LoginForm.spec.js +++ b/webapp/components/LoginForm/LoginForm.spec.js @@ -75,8 +75,8 @@ describe('LoginForm', () => { describe('no categories saved', () => { it('resets the categories', async () => { await fillIn(Wrapper()) - expect(storeMocks.mutations['posts/RESET_CATEGORIES']).toBeCalled() - expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).not.toBeCalled() + expect(storeMocks.mutations['posts/RESET_CATEGORIES']).toHaveBeenCalled() + expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).not.toHaveBeenCalled() }) }) @@ -84,11 +84,11 @@ describe('LoginForm', () => { it('sets the categories', async () => { authUserMock.mockReturnValue({ activeCategories: ['cat1', 'cat9', 'cat12'] }) await fillIn(Wrapper()) - expect(storeMocks.mutations['posts/RESET_CATEGORIES']).toBeCalled() - expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toBeCalledTimes(3) - expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toBeCalledWith({}, 'cat1') - expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toBeCalledWith({}, 'cat9') - expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toBeCalledWith({}, 'cat12') + expect(storeMocks.mutations['posts/RESET_CATEGORIES']).toHaveBeenCalled() + expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toHaveBeenCalledTimes(3) + expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toHaveBeenCalledWith({}, 'cat1') + expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toHaveBeenCalledWith({}, 'cat9') + expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toHaveBeenCalledWith({}, 'cat12') }) }) }) diff --git a/webapp/components/PostTeaser/PostTeaser.spec.js b/webapp/components/PostTeaser/PostTeaser.spec.js index 0d48729d3..315f922cd 100644 --- a/webapp/components/PostTeaser/PostTeaser.spec.js +++ b/webapp/components/PostTeaser/PostTeaser.spec.js @@ -73,7 +73,7 @@ describe('PostTeaser', () => { it('has no validation errors', () => { const spy = jest.spyOn(global.console, 'error') Wrapper() - expect(spy).not.toBeCalled() + expect(spy).not.toHaveBeenCalled() spy.mockReset() }) diff --git a/webapp/pages/index.spec.js b/webapp/pages/index.spec.js index c16560a84..86a852a83 100644 --- a/webapp/pages/index.spec.js +++ b/webapp/pages/index.spec.js @@ -114,11 +114,11 @@ describe('PostIndex', () => { }) it('resets the category filter', () => { - expect(mutations['posts/RESET_CATEGORIES']).toBeCalled() + expect(mutations['posts/RESET_CATEGORIES']).toHaveBeenCalled() }) it('sets the category', () => { - expect(mutations['posts/TOGGLE_CATEGORY']).toBeCalledWith({}, 'cat3') + expect(mutations['posts/TOGGLE_CATEGORY']).toHaveBeenCalledWith({}, 'cat3') }) }) }) diff --git a/webapp/pages/login.spec.js b/webapp/pages/login.spec.js index a65fc79a0..31ff2b489 100644 --- a/webapp/pages/login.spec.js +++ b/webapp/pages/login.spec.js @@ -71,7 +71,7 @@ describe('Login.vue', () => { asyncData = true tosVersion = '0.0.4' wrapper = await Wrapper() - expect(redirect).toBeCalledWith('/') + expect(redirect).toHaveBeenCalledWith('/') }) }) }) diff --git a/webapp/pages/logout.spec.js b/webapp/pages/logout.spec.js index 460d321aa..c0edd1c4b 100644 --- a/webapp/pages/logout.spec.js +++ b/webapp/pages/logout.spec.js @@ -36,8 +36,8 @@ describe('logout.vue', () => { }) it('logs out and redirects to login', () => { - expect(mocks.$store.dispatch).toBeCalledWith('auth/logout') - expect(mocks.$router.replace).toBeCalledWith('/login') + expect(mocks.$store.dispatch).toHaveBeenCalledWith('auth/logout') + expect(mocks.$router.replace).toHaveBeenCalledWith('/login') }) }) }) diff --git a/webapp/pages/map.spec.js b/webapp/pages/map.spec.js index a9e21c876..a0ad95605 100644 --- a/webapp/pages/map.spec.js +++ b/webapp/pages/map.spec.js @@ -114,19 +114,19 @@ describe('map', () => { }) it('initializes on style load', () => { - expect(mapOnMock).toBeCalledWith('style.load', expect.any(Function)) + expect(mapOnMock).toHaveBeenCalledWith('style.load', expect.any(Function)) }) it('initializes on mouseenter', () => { - expect(mapOnMock).toBeCalledWith('mouseenter', 'markers', expect.any(Function)) + expect(mapOnMock).toHaveBeenCalledWith('mouseenter', 'markers', expect.any(Function)) }) it('initializes on mouseleave', () => { - expect(mapOnMock).toBeCalledWith('mouseleave', 'markers', expect.any(Function)) + expect(mapOnMock).toHaveBeenCalledWith('mouseleave', 'markers', expect.any(Function)) }) it('calls add map control', () => { - expect(mapAddControlMock).toBeCalled() + expect(mapAddControlMock).toHaveBeenCalled() }) describe('trigger style load event', () => { @@ -137,7 +137,7 @@ describe('map', () => { }) it('calls loadMarkersIconsAndAddMarkers', () => { - expect(spy).toBeCalled() + expect(spy).toHaveBeenCalled() }) }) diff --git a/webapp/pages/password-reset.spec.js b/webapp/pages/password-reset.spec.js index 9337d1d59..328f04606 100644 --- a/webapp/pages/password-reset.spec.js +++ b/webapp/pages/password-reset.spec.js @@ -68,7 +68,7 @@ describe('password-reset.vue', () => { asyncData = true isLoggedIn = true wrapper = await Wrapper() - expect(redirect).toBeCalledWith('/') + expect(redirect).toHaveBeenCalledWith('/') }) }) }) diff --git a/webapp/pages/post/edit/_id.spec.js b/webapp/pages/post/edit/_id.spec.js index 2773483a4..8a30d7ac5 100644 --- a/webapp/pages/post/edit/_id.spec.js +++ b/webapp/pages/post/edit/_id.spec.js @@ -76,7 +76,7 @@ describe('post/_id.vue', () => { authorId = 'some-author' userId = 'some-user' wrapper = await Wrapper() - expect(error).toBeCalledWith({ message: 'error-pages.cannot-edit-post', statusCode: 403 }) + expect(error).toHaveBeenCalledWith({ message: 'error-pages.cannot-edit-post', statusCode: 403 }) }) it('renders with asyncData of same user', async () => { diff --git a/webapp/pages/registration.spec.js b/webapp/pages/registration.spec.js index a276c2b8b..b34ba3ba7 100644 --- a/webapp/pages/registration.spec.js +++ b/webapp/pages/registration.spec.js @@ -327,7 +327,7 @@ describe('Registration', () => { asyncData = true isLoggedIn = true wrapper = await Wrapper() - expect(redirect).toBeCalledWith('/') + expect(redirect).toHaveBeenCalledWith('/') }) // copied from webapp/components/Registration/Signup.spec.js as testing template diff --git a/webapp/pages/terms-and-conditions-confirm.spec.js b/webapp/pages/terms-and-conditions-confirm.spec.js index c8faeb6f1..268eb83ed 100644 --- a/webapp/pages/terms-and-conditions-confirm.spec.js +++ b/webapp/pages/terms-and-conditions-confirm.spec.js @@ -71,7 +71,7 @@ describe('terms-and-conditions-confirm.vue', () => { asyncData = true tosAgree = true wrapper = await Wrapper() - expect(redirect).toBeCalledWith('/') + expect(redirect).toHaveBeenCalledWith('/') }) }) }) From 57b6b81a5fc616645ffe6a374c1ebb98e9395921 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 31 Oct 2023 11:24:27 +0100 Subject: [PATCH 28/30] linting --- webapp/pages/post/edit/_id.spec.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/pages/post/edit/_id.spec.js b/webapp/pages/post/edit/_id.spec.js index 8a30d7ac5..205a7c4fe 100644 --- a/webapp/pages/post/edit/_id.spec.js +++ b/webapp/pages/post/edit/_id.spec.js @@ -76,7 +76,10 @@ describe('post/_id.vue', () => { authorId = 'some-author' userId = 'some-user' wrapper = await Wrapper() - expect(error).toHaveBeenCalledWith({ message: 'error-pages.cannot-edit-post', statusCode: 403 }) + expect(error).toHaveBeenCalledWith({ + message: 'error-pages.cannot-edit-post', + statusCode: 403, + }) }) it('renders with asyncData of same user', async () => { From 21fd669a601d95e6741d0d28c59c449fcf511b26 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 31 Oct 2023 14:25:12 +0100 Subject: [PATCH 29/30] increase cypress page load timeout --- cypress/cypress.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/cypress.config.js b/cypress/cypress.config.js index b1d80575e..b9862613b 100644 --- a/cypress/cypress.config.js +++ b/cypress/cypress.config.js @@ -32,6 +32,7 @@ module.exports = defineConfig({ e2e: { projectId: "qa7fe2", defaultCommandTimeout: 10000, + pageLoadTimeout:180000, chromeWebSecurity: false, baseUrl: "http://localhost:3000", specPattern: "cypress/e2e/**/*.feature", From 2049ce183f90eb13fe985a516478496fc00c008d Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 31 Oct 2023 15:35:27 +0100 Subject: [PATCH 30/30] increase cypress default command timeout --- cypress/cypress.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/cypress.config.js b/cypress/cypress.config.js index b9862613b..db8308557 100644 --- a/cypress/cypress.config.js +++ b/cypress/cypress.config.js @@ -31,7 +31,7 @@ const { parsed } = dotenv.config({ path: '../backend/.env' }) module.exports = defineConfig({ e2e: { projectId: "qa7fe2", - defaultCommandTimeout: 10000, + defaultCommandTimeout: 60000, pageLoadTimeout:180000, chromeWebSecurity: false, baseUrl: "http://localhost:3000",