Compare commits
9 Commits
Author | SHA1 | Date |
---|---|---|
Chris (wolcen) Thompson | 8407841da3 | |
Chris Thompson | d299d5461d | |
Chris Thompson | 7159b36272 | |
Chris Thompson | 317e6517a8 | |
Chris Thompson | e53e97e8d9 | |
Chris Thompson | 398c254b89 | |
Chris Thompson | 01a360cf60 | |
Chris Thompson | a3fecc1e36 | |
Chris Thompson | f543dfab04 |
|
@ -8,7 +8,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/
|
||||
|
@ -42,6 +42,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
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
authentik:
|
||||
env:
|
||||
CMD_OAUTH2_USER_PROFILE_URL: https://authentik.example.com/application/o/userinfo/
|
||||
CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR: preferred_username
|
||||
CMD_OAUTH2_USER_PROFILE_DISPLAY_NAME_ATTR: name
|
||||
CMD_OAUTH2_USER_PROFILE_EMAIL_ATTR: email
|
||||
CMD_OAUTH2_TOKEN_URL: https://authentik.example.com/application/o/token/
|
||||
CMD_OAUTH2_AUTHORIZATION_URL: https://authentik.example.com/application/o/authorize/
|
||||
CMD_OAUTH2_CLIENT_ID: hedgedoc
|
||||
CMD_OAUTH2_PROVIDERNAME: Authentik
|
||||
uncomment:
|
||||
- compose.oauth.yml
|
||||
- SECRET_OAUTH_KEY_VERSION
|
||||
shared_secrets:
|
||||
hedgedoc_secret: oauth_key
|
18
compose.yml
18
compose.yml
|
@ -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:
|
||||
|
@ -56,8 +57,10 @@ 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}.timeout=${TIMEOUT:-120}"
|
||||
- "coop-cloud.${STACK_NAME}.version=1.1.0+1.9.9"
|
||||
- "backupbot.backup=true"
|
||||
- "backupbot.backup.path=/hedgedoc/public/uploads"
|
||||
- coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}
|
||||
- coop-cloud.${STACK_NAME}.version=0.6.0+1.9.9
|
||||
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 +68,7 @@ services:
|
|||
retries: 10
|
||||
start_period: 1m
|
||||
db:
|
||||
image: postgres:16.3-alpine
|
||||
image: postgres:11.20-alpine
|
||||
environment:
|
||||
- POSTGRES_USER=codimd
|
||||
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
|
||||
|
@ -79,18 +82,17 @@ services:
|
|||
deploy:
|
||||
labels:
|
||||
backupbot.backup: "true"
|
||||
backupbot.backup.pre-hook: "PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /var/lib/postgresql/data/backup.sql"
|
||||
backupbot.backup.post-hook: "rm -f /var/lib/postgresql/data/backup.sql"
|
||||
backupbot.backup.path: "/var/lib/postgresql/data/backup.sql"
|
||||
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.restore: "true"
|
||||
backupbot.restore.post-hook: "sh -c 'psql -U $${POSTGRES_USER} -d $${POSTGRES_DB} < /var/lib/postgresql/data/backup.sql && rm -f /var/lib/postgresql/data/backup.sql'"
|
||||
backupbot.restore.post-hook: "sh -c 'psql -U $${POSTGRES_USER} -d $${POSTGRES_DB} < ./backup.sql && rm -f ./backup.sql'"
|
||||
healthcheck:
|
||||
test: "pg_isready"
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 1m
|
||||
|
||||
volumes:
|
||||
postgres:
|
||||
codimd_uploads:
|
||||
|
|
|
@ -30,16 +30,14 @@ main() {
|
|||
set -eu
|
||||
|
||||
load_vars
|
||||
mkdir -p "/hedgedoc/.npm" && \
|
||||
chown -R 10000:65534 "/hedgedoc/.npm" && \
|
||||
chmod "u+rwx" "/hedgedoc/.npm"
|
||||
mkdir "/hedgedoc/.npm" && chown -R 10000:65534 "/hedgedoc/.npm" && chmod "u+rwx" "/hedgedoc/.npm"
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
export CMD_DB_URL=postgres://$CMD_DB_USER:$CMD_DB_PASSWORD@$CMD_DB_HOST:5432/$CMD_DB_NAME
|
||||
|
||||
# 3wc: `source /docker-entrypoint.sh -e` to load CMD_DB_URL for CLI scripts
|
||||
# 3wc: `source /docker-entrypoint2.sh -e` to load CMD_DB_URL for CLI scripts
|
||||
if [ ! "${1-}" == "-e" ]; then
|
||||
# 3wc: upstream ENTRYPOINT
|
||||
# https://github.com/hedgedoc/container/blob/master/alpine/Dockerfile
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
WARNING WARNING WARNING 🚨
|
||||
|
||||
This release includes a major Postgres database upgrade, but does not yet include tools to automatically upgrade from older Postgres releases.
|
||||
|
||||
PLEASE DO NOT UPGRADE EXISTING INSTANCES TO THIS VERSION.
|
||||
|
||||
This should be fixed soon.
|
Loading…
Reference in New Issue