Compare commits

...

14 Commits

Author SHA1 Message Date
Chris Thompson 1a2b3b9899 Add basic health check for db container 2023-07-28 17:43:00 -04:00
Chris Thompson cb2704731e Add FREEURL_AUTH setting 2023-07-28 17:43:00 -04:00
Chris Thompson f80b1401d2 Add SESSION_SECRET variable 2023-07-28 17:43:00 -04:00
Chris Thompson bf83995fce Clean up inside container after backup 2023-07-28 17:43:00 -04:00
Chris Thompson 5597b60ac5 Remove legacy backup configuration 2023-07-28 17:43:00 -04:00
Chris Thompson c1e90a16c6 Make backup configuration functional
pre-hook doesn't get a shell context when run by abra, so use sh -c per 3wc
2023-07-28 17:42:54 -04:00
Chris Thompson 634567dc60 Remove unnecessary mode assignment for config.json 2023-07-28 17:41:24 -04:00
Chris Thompson 1313634688 Correct location of public upload files 2023-07-28 17:41:24 -04:00
Chris Thompson 72f8932ca4 Correct README re: configuring users 2023-07-28 17:41:24 -04:00
3wc 5fd556d358 chore: publish 0.5.1+1.9.8 release 2023-07-08 19:39:01 +01:00
3wc 4c2417901e Switch to self-hosted stack-ssh-deploy image [mass update] 2023-01-21 11:49:55 -08:00
3wc 6bc2679dee Fix CI by adding networks: [mass update] 2023-01-20 11:58:41 -08:00
3wc d2d5b8ceb1 Automatically generate catalogue on release [mass update]
Re: coop-cloud/recipes-catalogue-json#4
2023-01-20 10:27:11 -08:00
3wc afd3b03b21 Update abra syntax in examples (finally) [mass update] 2023-01-19 16:02:27 -08:00
5 changed files with 37 additions and 32 deletions

View File

@ -3,10 +3,12 @@ kind: pipeline
name: deploy to swarm-test.autonomic.zone
steps:
- name: deployment
image: decentral1se/stack-ssh-deploy:latest
image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest
settings:
host: swarm-test.autonomic.zone
stack: hedgedoc
networks:
- proxy
deploy_key:
from_secret: drone_ssh_swarm_test
generate_secrets: true
@ -22,11 +24,17 @@ trigger:
- main
---
kind: pipeline
name: recipe release
name: generate recipe catalogue
steps:
- name: release a new version
image: thecoopcloud/drone-abra:latest
image: plugins/downstream
settings:
command: recipe hedgedoc release
deploy_key:
from_secret: abra_bot_deploy_key
server: https://build.coopcloud.tech
token:
from_secret: drone_abra-bot_token
fork: true
repositories:
- coop-cloud/auto-recipes-catalogue-json
trigger:
event: tag

View File

@ -6,7 +6,7 @@ DOMAIN=hedgedoc.example.com
LETS_ENCRYPT_ENV=production
SECRET_DB_PASSWORD_VERSION=v1
SECRET_CMD_SESSION_SECRET=v1
COMPOSE_FILE="compose.yml"
# OAuth, see https://docs.hedgedoc.org/guides/auth/keycloak/
@ -40,6 +40,7 @@ COMPOSE_FILE="compose.yml"
# CMD_CSP_REPORTURI=undefined
# CMD_DEFAULT_PERMISSION=editable
# CMD_EMAIL=true
# CMD_REQUIRE_FREEURL_AUTHENTICATION=false
# CMD_SESSION_LIFE=1209600000
# Only present in config.json (no equivalent env var):
# DOCUMENT_MAX_LENGTH=100000

View File

@ -20,13 +20,13 @@
1. Set up Docker Swarm and [`abra`][abra]
2. Deploy [`coop-cloud/traefik`][compose-traefik]
3. `abra app new hedegedoc`
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to
4. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to
your Docker swarm box
5. `abra app YOURAPPDOMAIN deploy`
5. `abra app deploy YOURAPPDOMAIN`
6. Create initial user:
```
abra app YOURAPPDOMAIN run app bash
. /docker-entrypoint2.sh -e
abra app run YOURAPPDOMAIN app bash
. /docker-entrypoint.sh -e
bin/manage_users
[hedegedoc]: https://github.com/hedgedoc/hedgedoc

12
abra.sh
View File

@ -1,13 +1 @@
export ENTRYPOINT_CONF_VERSION=v6
abra_backup_app() {
_abra_backup_dir "app:/home/hackmd/app/public/uploads/"
}
abra_backup_db() {
_abra_backup_postgres "db" "codimd" "codimd" "db_password"
}
abra_backup() {
abra_backup_app && abra_backup_db
}

View File

@ -1,7 +1,7 @@
version: "3.8"
services:
app:
image: quay.io/hedgedoc/hedgedoc:1.9.6
image: quay.io/hedgedoc/hedgedoc:1.9.8
environment:
- CMD_USECDN=false
- CMD_URL_ADDPORT=false
@ -25,6 +25,7 @@ services:
- CMD_CSP_REPORTURI
- CMD_DEFAULT_PERMISSION
- CMD_EMAIL
- CMD_REQUIRE_FREEURL_AUTHENTICATION
- CMD_SESSION_LIFE
- DOCUMENT_MAX_LENGTH
depends_on:
@ -33,7 +34,7 @@ services:
- proxy
- internal
volumes:
- codimd_uploads:/home/hackmd/app/public/uploads
- codimd_uploads:/hedgedoc/public/uploads
secrets:
- db_password
entrypoint: /docker-entrypoint.sh
@ -43,7 +44,6 @@ services:
mode: 0555
- source: config_json
target: /files/config.json
mode: 0555
deploy:
restart_policy:
condition: on-failure
@ -57,7 +57,9 @@ 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.5.0+1.9.6
- "backupbot.backup=true"
- "backupbot.backup.path=/hedgedoc/public/uploads"
- coop-cloud.${STACK_NAME}.version=0.5.1+1.9.8
healthcheck:
test: "nodejs -e \"http.get('http://localhost:3000', (res) => { console.log('status: ', res.statusCode); if (res.statusCode == 200) { process.exit(0); } else { process.exit(1); } });\""
interval: 30s
@ -65,7 +67,7 @@ services:
retries: 10
start_period: 1m
db:
image: postgres:11.18-alpine
image: postgres:11.20-alpine
environment:
- POSTGRES_USER=codimd
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
@ -78,10 +80,16 @@ services:
- internal
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.pre-hook: "mkdir -p /tmp/backup/ && PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /tmp/backup/backup.sql"
backupbot.backup.post-hook: "rm -rf /tmp/backup"
backupbot.backup.path: "/tmp/backup/"
- "backupbot.backup=true"
- "backupbot.backup.pre-hook=sh -c 'PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /tmp/backup.sql'"
- "backupbot.backup.post-hook=rm -f /tmp/backup.sql"
- "backupbot.backup.path=/tmp/"
healthcheck:
test: "pg_isready"
interval: 30s
timeout: 10s
retries: 5
start_period: 1m
volumes:
postgres:
codimd_uploads: