From e04ac6564e471fdfb870b5c973a69daa5b686e82 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Fri, 11 Nov 2022 15:31:47 +0000 Subject: [PATCH] got config generating --- 00-create-pod.sh | 3 +-- 20-create-db.sh | 1 + 30-run-rebased.sh | 7 +++---- 35-gen-config.sh | 9 ++++++++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/00-create-pod.sh b/00-create-pod.sh index 56ead99..4abd81f 100755 --- a/00-create-pod.sh +++ b/00-create-pod.sh @@ -1,7 +1,6 @@ #!/bin/bash -mkdir ./uploads -mkdir ./static +mkdir ./uploads ./static ./config -p touch config.exs chown -R 911:911 ./uploads diff --git a/20-create-db.sh b/20-create-db.sh index 386502c..a349167 100755 --- a/20-create-db.sh +++ b/20-create-db.sh @@ -11,5 +11,6 @@ podman run -d \ -e POSTGRES_PASSWORD=$PG_PASS \ -e POSTGRES_DB=$PG_NAME \ -v ./postgres:/var/lib/postgresql/data \ + -v ./config:/config:ro \ postgres:14.6-alpine diff --git a/30-run-rebased.sh b/30-run-rebased.sh index 23c64a2..6a0cb13 100755 --- a/30-run-rebased.sh +++ b/30-run-rebased.sh @@ -2,18 +2,17 @@ source ./script_config.sh -echo Stopping old `rebased-web` container... +echo Stopping old 'rebased-web' container... podman stop rebased-web podman rm rebased-web -echo Creating new `rebased-web` container... +echo Creating new 'rebased-web' container... podman run -d \ --name rebased-web \ --pod rebased-pod \ -v ./uploads:/var/lib/pleroma/uploads:z \ -v ./static:/var/lib/pleroma/static:z \ - -v ./config:/var/lib/pleroma/config:z \ - -v ./config.exs:/etc/pleroma/config.exs:ro \ + -v ./config:/config:rw \ -e DOMAIN=social.example.com \ -e INSTANCE_NAME=rebased \ -e ADMIN_EMAIL=admin@example.com \ diff --git a/35-gen-config.sh b/35-gen-config.sh index 59b2a90..e53657a 100755 --- a/35-gen-config.sh +++ b/35-gen-config.sh @@ -2,4 +2,11 @@ source ./script_config.sh -podman exec -it rebased-web /opt/pleroma/bin/pleroma_ctl instance gen +podman exec -it --user=0 --privileged rebased-web /opt/pleroma/bin/pleroma_ctl instance gen +echo "Check files in config - if all looks good rename generated_config.exs to prod.secret.exs" + +if [ -f ./config/setup_db.sql ]; then + # run this in postgres container + echo hi +fi +