From 0c7847ac15ae0938c5959c938a7440992e09e521 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Thu, 9 Feb 2023 12:56:48 +0100 Subject: [PATCH 1/7] fix: sort + PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY = 0 --- compose.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/compose.yml b/compose.yml index 2d3336f..0fea0f6 100644 --- a/compose.yml +++ b/compose.yml @@ -10,17 +10,18 @@ services: # entrypoint: ['tail', '-f', '/dev/null'] environment: - ALLOW_EMPTY_PASSWORD=yes - - DISCOURSE_HOST=${DOMAIN} - DISCOURSE_DATABASE_HOST=${STACK_NAME}_db - - DISCOURSE_DATABASE_USER=discourse - DISCOURSE_DATABASE_NAME=discourse - DISCOURSE_DATABASE_PASSWORD_FILE=/run/secrets/db_password + - DISCOURSE_DATABASE_USER=discourse + - DISCOURSE_HOST=${DOMAIN} + - DISCOURSE_NOTIFICATION_EMAIL + - DISCOURSE_SMTP_AUTH - DISCOURSE_SMTP_HOST - DISCOURSE_SMTP_PORT - - DISCOURSE_SMTP_USER - DISCOURSE_SMTP_PROTOCOL - - DISCOURSE_SMTP_AUTH - - DISCOURSE_NOTIFICATION_EMAIL + - DISCOURSE_SMTP_USER + - PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 volumes: - 'discourse_data:/bitnami/discourse' secrets: @@ -90,18 +91,19 @@ services: - db_password environment: - ALLOW_EMPTY_PASSWORD=yes - - DISCOURSE_HOST=${DOMAIN} - DISCOURSE_DATABASE_HOST=db + - DISCOURSE_DATABASE_NAME=discourse + - DISCOURSE_DATABASE_PASSWORD_FILE=/run/secrets/db_password - DISCOURSE_DATABASE_PORT_NUMBER=5432 - DISCOURSE_DATABASE_USER=discourse - - DISCOURSE_DATABASE_NAME=discourse + - DISCOURSE_HOST=${DOMAIN} - DISCOURSE_REDIS_HOST=redis - DISCOURSE_REDIS_PORT_NUMBER=6379 - - DISCOURSE_DATABASE_PASSWORD_FILE=/run/secrets/db_password - DISCOURSE_SMTP_HOST - DISCOURSE_SMTP_PORT - - DISCOURSE_SMTP_USER - DISCOURSE_SMTP_PROTOCOL + - DISCOURSE_SMTP_USER + - PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 - DISCOURSE_SMTP_AUTH secrets: -- 2.47.2 From 5bef03aabd0e7a87cd4a38dc7c0ca92295cae860 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Thu, 9 Feb 2023 12:57:24 +0100 Subject: [PATCH 2/7] chore: publish 0.4.0+3.0.1 release --- compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compose.yml b/compose.yml index 0fea0f6..51b1fc7 100644 --- a/compose.yml +++ b/compose.yml @@ -3,7 +3,7 @@ version: "3.8" services: app: - image: bitnami/discourse:2.8.9 + image: bitnami/discourse:3.0.1 networks: - proxy - internal @@ -43,7 +43,7 @@ services: #- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect" #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true" #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" - - "coop-cloud.${STACK_NAME}.version=0.3.1+2.8.9" + - "coop-cloud.${STACK_NAME}.version=0.4.0+3.0.1" # healthcheck: # test: ["CMD", "curl", "-f", "http://localhost:3000"] # interval: 30s @@ -79,7 +79,7 @@ services: - 'redis_data:/data' sidekiq: - image: bitnami/discourse:2.8.9 + image: bitnami/discourse:3.0.1 networks: - internal depends_on: -- 2.47.2 From 5868b83948c0c30923a30352ccdd99e819d9ce55 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Thu, 9 Feb 2023 12:58:47 +0100 Subject: [PATCH 3/7] docs: events plugin --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6babe8d..6bed5ae 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,10 @@ A platform for community discussion 3. `git clone plugin.git` for example `https://github.com/discourse/discourse-openid-connect.git` 4. `abra app restart YOURAPPDOMAIN app` +### Events / calendar plugin + +We've had some luck running [discourse-events](https://github.com/paviliondev/discourse-events). + ## Setup Notes Until issue #1 is fixed, the default user is `user` and the default password is `bitnami123` -- 2.47.2 From 22b8f8f26558247a13756e996772e43e4168ed20 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Mon, 20 Mar 2023 13:35:04 -0400 Subject: [PATCH 4/7] Drop separate Sidekiq vol, it should use the main one --- compose.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compose.yml b/compose.yml index 51b1fc7..d750e01 100644 --- a/compose.yml +++ b/compose.yml @@ -85,7 +85,7 @@ services: depends_on: - discourse volumes: - - 'sidekiq_data:/bitnami/discourse' + - 'discourse_data:/bitnami/discourse' command: /opt/bitnami/scripts/discourse-sidekiq/run.sh secrets: - db_password @@ -115,7 +115,6 @@ volumes: postgresql_data: redis_data: discourse_data: - sidekiq_data: networks: proxy: -- 2.47.2 From 3b5d789390efaecbead4561d0d099dd683d2f719 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Mon, 21 Aug 2023 14:20:29 +0200 Subject: [PATCH 5/7] chore: publish 0.4.1+3.0.6 release --- compose.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compose.yml b/compose.yml index d750e01..40a6934 100644 --- a/compose.yml +++ b/compose.yml @@ -3,7 +3,7 @@ version: "3.8" services: app: - image: bitnami/discourse:3.0.1 + image: bitnami/discourse:3.0.6 networks: - proxy - internal @@ -43,7 +43,7 @@ services: #- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect" #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true" #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" - - "coop-cloud.${STACK_NAME}.version=0.4.0+3.0.1" + - "coop-cloud.${STACK_NAME}.version=0.4.1+3.0.6" # healthcheck: # test: ["CMD", "curl", "-f", "http://localhost:3000"] # interval: 30s @@ -72,14 +72,14 @@ services: backupbot.backup.path: "/tmp/backup.sql" redis: - image: redis:7.0-alpine + image: redis:7.2-alpine networks: - internal volumes: - 'redis_data:/data' sidekiq: - image: bitnami/discourse:3.0.1 + image: bitnami/discourse:3.0.6 networks: - internal depends_on: -- 2.47.2 From 6a5f20bc8ab884ca3ba6c8a357285f182e93331f Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Mon, 21 Aug 2023 15:56:57 +0200 Subject: [PATCH 6/7] Add postgres major version upgrade script --- abra.sh | 1 + compose.yml | 13 ++++++++++- entrypoint.postgres.sh.tmpl | 46 +++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 abra.sh create mode 100644 entrypoint.postgres.sh.tmpl diff --git a/abra.sh b/abra.sh new file mode 100644 index 0000000..1c66304 --- /dev/null +++ b/abra.sh @@ -0,0 +1 @@ +export DB_ENTRYPOINT_VERSION=v1 diff --git a/compose.yml b/compose.yml index 40a6934..4262b13 100644 --- a/compose.yml +++ b/compose.yml @@ -52,13 +52,18 @@ services: # start_period: 1m db: - image: postgres:13-alpine + image: postgres:13 networks: - internal secrets: - db_password volumes: - 'postgresql_data:/var/lib/postgresql/data' + configs: + - source: db_entrypoint + target: /docker-entrypoint.sh + mode: 0555 + entrypoint: /docker-entrypoint.sh environment: - POSTGRES_HOST_AUTH_METHOD=trust - POSTGRES_USER=discourse @@ -120,3 +125,9 @@ networks: proxy: external: true internal: + +configs: + db_entrypoint: + name: ${STACK_NAME}_db_entrypoint_${DB_ENTRYPOINT_VERSION} + file: entrypoint.postgres.sh.tmpl + template_driver: golang diff --git a/entrypoint.postgres.sh.tmpl b/entrypoint.postgres.sh.tmpl new file mode 100644 index 0000000..fc69a6e --- /dev/null +++ b/entrypoint.postgres.sh.tmpl @@ -0,0 +1,46 @@ +#!/bin/bash + +set -e + +MIGRATION_MARKER=$PGDATA/migration_in_progress +OLDDATA=$PGDATA/old_data +NEWDATA=$PGDATA/new_data + +echo "Running as $(id)" + +if [ -e $MIGRATION_MARKER ]; then + echo "FATAL: migration was started but did not complete in a previous run. manual recovery necessary" + exit 1 +fi + +if [ -f $PGDATA/PG_VERSION ]; then + DATA_VERSION=$(cat $PGDATA/PG_VERSION) + + if [ -n "$DATA_VERSION" -a "$PG_MAJOR" != "$DATA_VERSION" ]; then + echo "postgres data version $DATA_VERSION found, but need $PG_MAJOR. Starting migration" + echo "Installing postgres $DATA_VERSION" + sed -i "s/$/ $DATA_VERSION/" /etc/apt/sources.list.d/pgdg.list + apt-get update && apt-get install -y --no-install-recommends \ + postgresql-$DATA_VERSION \ + && rm -rf /var/lib/apt/lists/* + echo "shuffling around" + gosu postgres mkdir $OLDDATA $NEWDATA + chmod 700 $OLDDATA $NEWDATA + mv $PGDATA/* $OLDDATA/ || true + touch $MIGRATION_MARKER + echo "running initdb" + # abuse entrypoint script for initdb by making server error out + gosu postgres bash -c "export PGDATA=$NEWDATA ; /usr/local/bin/docker-entrypoint.sh --invalid-arg || true" + echo "running pg_upgrade" + cd /tmp + gosu postgres pg_upgrade --link -b /usr/lib/postgresql/$DATA_VERSION/bin -d $OLDDATA -D $NEWDATA -U $POSTGRES_USER + cp $OLDDATA/pg_hba.conf $NEWDATA/ + mv $NEWDATA/* $PGDATA + rm -rf $OLDDATA + rmdir $NEWDATA + rm $MIGRATION_MARKER + echo "migration complete" + fi +fi + +/usr/local/bin/docker-entrypoint.sh postgres -- 2.47.2 From ec72949bfad93f80f5ee844545b8a1fba527b3ec Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Mon, 21 Aug 2023 15:57:39 +0200 Subject: [PATCH 7/7] chore: publish 0.5.0+3.0.6 release --- compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose.yml b/compose.yml index 4262b13..80cbc39 100644 --- a/compose.yml +++ b/compose.yml @@ -43,7 +43,7 @@ services: #- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect" #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true" #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" - - "coop-cloud.${STACK_NAME}.version=0.4.1+3.0.6" + - "coop-cloud.${STACK_NAME}.version=0.5.0+3.0.6" # healthcheck: # test: ["CMD", "curl", "-f", "http://localhost:3000"] # interval: 30s -- 2.47.2