From 8897924813cabb3b7b1e0e7da2530be8eb5f0029 Mon Sep 17 00:00:00 2001 From: Christian Galo Date: Mon, 16 Oct 2023 23:18:58 +0000 Subject: [PATCH] update README and Discourse version --- README.md | 76 ++++++++++------------------------------------------ compose.yaml | 2 +- 2 files changed, 15 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 6bed5ae..2855b7a 100644 --- a/README.md +++ b/README.md @@ -1,72 +1,24 @@ # Discourse -[![Build Status](https://build.coopcloud.tech/api/badges/coop-cloud/discourse/status.svg?ref=refs/heads/main)](https://build.coopcloud.tech/coop-cloud/discourse) +Wiki Cafe's configuration for a Discourse deployment. Originally slimmed down from an `abra` [recipe](https://git.coopcloud.tech/coop-cloud/discourse) by [Co-op Cloud](https://coopcloud.tech/). -A platform for community discussion - -* **Category**: Apps -* **Status**: -* **Image**: [`bitnami/discourse`](https://hub.docker.com/r/bitname/discourse) -* **Healthcheck**: yes -* **Backups**: no -* **Email**: yes -* **Tests**: no -* **SSO**: no - +## Deploying the app with Docker Swarm -## Basic usage +Set the environment variables from the .env file during the shell session. -1. Set up Docker Swarm and [`abra`] -2. Deploy [`coop-cloud/traefik`] -3. `abra app new discourse --secrets` (optionally with `--pass` if you'd like - to save secrets in `pass`) -4. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to - your Docker swarm box -5. `abra app deploy YOURAPPDOMAIN` -6. Open the configured domain in your browser to finish set-up +``` +set -a && source .env && set +a +``` -[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra -[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik +Set the secrets. -## To add a new admin user +``` +printf "SECRET_HERE" | docker secret create SECRET_NAME - +``` -1. Login to the instance `abra app run APPNAME app sh` -2. `cd /opt/bitnami/discourse` -3. `RAILS_ENV=production bundle exec rake admin:create` and follow prompts. +Deploy using the `-c` flag to specify one or multiple compose files. -## Install plugins - -1. Login to instance `abra app run APPNAME app sh` -2. `cd /bitnami/discourse/plugins/` -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` - -## Postgres major version upgrades - -Welcome to hell. - -1. `abra app run YOURAPPDOMAIN db pg_dumpall -U discourse | gzip > YOURAPPDOMAIN_db_DATE.sql.gz` -2. `abra app volume ls YOURAPPDOMAIN`, find the name of the Postgres data volume -3. `scp` the backup to your VPS -4. `abra app undeploy YOURAPPDOMAIN` -5. `abra app volume rm YOURAPPDOMAIN`, choose the Postgres data volume -6. `abra app deploy YOURAPPDOMAIN`, then `abra app undeploy YOURAPPDOMAIN` -7. `ssh` to the VPS, run (replacing `13-alpine` with the new Postgres version) - `docker run -v YOURDATAVOLUME:/var/lib/postgresql/data -e POSTGRES_HOST_AUTH_METHOD=trust -it postgres:13-alpine` -8. In another SSH session on the server, run `docker ps` to find the ID of the - new Postgres container, then `docker exec -it CONTAINERID bash` -9. In the shell you just launched, run `dropdb -U discourse discourse`, then - `createdb -U discourse discourse`, then Ctrl+D or run `exit` -10. In the second SSH session, run `zcat YOURAPPDOMAIN_db_DATE.sql.gz | docker exec -it CONTAINERID psql -U discourse` -11. Exit the second SSH session -12. Back in the first SSH session, Ctrl+C to shut down the database -13. `abra app deploy YOURAPPDOMAIN` +``` +docker stack deploy discourse -c compose.yaml -c compose.smtpauth.yaml +``` diff --git a/compose.yaml b/compose.yaml index 224da4f..6def95c 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,6 +1,6 @@ services: app: - image: bitnami/discourse:3.0.6 + image: bitnami/discourse:3.1.1 networks: - proxy - internal