forked from coop-cloud/authentik
Compare commits
5 Commits
custom_the
...
4.0.0+2023
Author | SHA1 | Date | |
---|---|---|---|
b311cadc4c | |||
d01c539c4f | |||
427644df38 | |||
f4172f2a64 | |||
126b50d4bd |
@ -1,5 +1,5 @@
|
|||||||
TYPE=authentik
|
TYPE=authentik
|
||||||
TIMEOUT=300
|
TIMEOUT=900
|
||||||
ENABLE_AUTO_UPDATE=true
|
ENABLE_AUTO_UPDATE=true
|
||||||
# POST_DEPLOY_CMDS="worker set_admin_pass|worker apply_blueprints|worker add_applications"
|
# POST_DEPLOY_CMDS="worker set_admin_pass|worker apply_blueprints|worker add_applications"
|
||||||
LETS_ENCRYPT_ENV=production
|
LETS_ENCRYPT_ENV=production
|
||||||
|
1
abra.sh
1
abra.sh
@ -11,6 +11,7 @@ export MATRIX_CONFIG_VERSION=v1
|
|||||||
export WEKAN_CONFIG_VERSION=v3
|
export WEKAN_CONFIG_VERSION=v3
|
||||||
export VIKUNJA_CONFIG_VERSION=v1
|
export VIKUNJA_CONFIG_VERSION=v1
|
||||||
export MONITORING_CONFIG_VERSION=v1
|
export MONITORING_CONFIG_VERSION=v1
|
||||||
|
export DB_ENTRYPOINT_VERSION=v1
|
||||||
|
|
||||||
customize() {
|
customize() {
|
||||||
if [ -z "$1" ]
|
if [ -z "$1" ]
|
||||||
|
28
compose.yml
28
compose.yml
@ -32,8 +32,11 @@ x-env: &env
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: ghcr.io/goauthentik/server:2023.6.1
|
image: ghcr.io/goauthentik/server:2023.10.5
|
||||||
command: server
|
command: server
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
- redis
|
||||||
secrets:
|
secrets:
|
||||||
- db_password
|
- db_password
|
||||||
- admin_pass
|
- admin_pass
|
||||||
@ -73,12 +76,15 @@ services:
|
|||||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
||||||
- "traefik.http.middlewares.${STACK_NAME}-frameOptions.headers.customFrameOptionsValue=SAMEORIGIN"
|
- "traefik.http.middlewares.${STACK_NAME}-frameOptions.headers.customFrameOptionsValue=SAMEORIGIN"
|
||||||
- "traefik.http.middlewares.${STACK_NAME}-frameOptions.headers.contentSecurityPolicy=frame-ancestors ${X_FRAME_OPTIONS_ALLOW_FROM}"
|
- "traefik.http.middlewares.${STACK_NAME}-frameOptions.headers.contentSecurityPolicy=frame-ancestors ${X_FRAME_OPTIONS_ALLOW_FROM}"
|
||||||
- "coop-cloud.${STACK_NAME}.version=3.2.4+2023.6.1"
|
- "coop-cloud.${STACK_NAME}.version=4.0.0+2023.10.5"
|
||||||
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
|
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
image: ghcr.io/goauthentik/server:2023.6.1
|
image: ghcr.io/goauthentik/server:2023.10.5
|
||||||
command: worker
|
command: worker
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
- redis
|
||||||
secrets:
|
secrets:
|
||||||
- db_password
|
- db_password
|
||||||
- admin_pass
|
- admin_pass
|
||||||
@ -109,9 +115,15 @@ services:
|
|||||||
environment: *env
|
environment: *env
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:12.15-alpine
|
image: postgres:15.5
|
||||||
secrets:
|
secrets:
|
||||||
- db_password
|
- db_password
|
||||||
|
configs:
|
||||||
|
- source: db_entrypoint
|
||||||
|
target: /docker-entrypoint.sh
|
||||||
|
mode: 0555
|
||||||
|
entrypoint:
|
||||||
|
/docker-entrypoint.sh
|
||||||
volumes:
|
volumes:
|
||||||
- database:/var/lib/postgresql/data
|
- database:/var/lib/postgresql/data
|
||||||
networks:
|
networks:
|
||||||
@ -134,11 +146,11 @@ services:
|
|||||||
backupbot.backup.path: "/var/lib/postgresql/data"
|
backupbot.backup.path: "/var/lib/postgresql/data"
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7.0.12-alpine
|
image: redis:7.2.3-alpine
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "redis-cli","ping"]
|
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 10
|
retries: 10
|
||||||
@ -202,3 +214,7 @@ configs:
|
|||||||
name: ${STACK_NAME}_system_tenant_${SYSTEM_TENANT_VERSION}
|
name: ${STACK_NAME}_system_tenant_${SYSTEM_TENANT_VERSION}
|
||||||
file: system_tenant.yaml.tmpl
|
file: system_tenant.yaml.tmpl
|
||||||
template_driver: golang
|
template_driver: golang
|
||||||
|
db_entrypoint:
|
||||||
|
name: ${STACK_NAME}_db_entrypoint_${DB_ENTRYPOINT_VERSION}
|
||||||
|
file: entrypoint.postgres.sh.tmpl
|
||||||
|
template_driver: golang
|
||||||
|
45
entrypoint.postgres.sh.tmpl
Normal file
45
entrypoint.postgres.sh.tmpl
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
MIGRATION_MARKER=$PGDATA/migration_in_progress
|
||||||
|
OLDDATA=$PGDATA/old_data
|
||||||
|
NEWDATA=$PGDATA/new_data
|
||||||
|
|
||||||
|
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"
|
||||||
|
chown -R postgres:postgres $PGDATA
|
||||||
|
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
|
1
release/4.0.0+2023.10.5
Normal file
1
release/4.0.0+2023.10.5
Normal file
@ -0,0 +1 @@
|
|||||||
|
It is only possible to upgrade to 2023.10 from 2023.8, you need to update to 2023.8.x before applying this update
|
Reference in New Issue
Block a user