From 3efa08efccda5b810d5e63d4755bc54621feb805 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 16 Jun 2023 15:46:54 +0000 Subject: [PATCH] Added lines for services to clean up files after start --- lib/baserow.sh | 3 +++ lib/gitea.sh | 3 +++ lib/nextcloud.sh | 4 ++++ lib/pdns.sh | 3 +++ lib/postgresql.sh | 3 +++ 5 files changed, 16 insertions(+) diff --git a/lib/baserow.sh b/lib/baserow.sh index 57b7130..4e06d7f 100644 --- a/lib/baserow.sh +++ b/lib/baserow.sh @@ -96,6 +96,9 @@ start_baserow() { # Disable new sign ups docker exec postgresql psql -U baserow -c "update core_settings set allow_new_signups='f' where allow_new_signups='t';" + # Remove baserow create user + rm /federated/apps/baserow/data/baserow/data/createuser.sh + kill -9 $SPINPID &> /dev/null echo -ne "done." } diff --git a/lib/gitea.sh b/lib/gitea.sh index 73222fc..cb7deb5 100644 --- a/lib/gitea.sh +++ b/lib/gitea.sh @@ -180,6 +180,9 @@ start_gitea() { GITEA_TOKEN_1=`docker exec gitea curl -H "Content-Type: application/json" -d '{"name":"gitea1","scopes":["all"]}' -u gitea:$ADMINPASS http://gitea.$DOMAIN:3000/api/v1/users/gitea/tokens 2>/dev/null | awk -F: '{ print $4 }' | awk -F\" '{ print $2 }'` &> /dev/null [ $? -ne 0 ] && fail "Couldn't run gitea curl to get token inside /federated/apps/gitea container" + # Remove creategitea.sh + rm /federated/apps/gitea/data/data/creategitea.sh + kill -9 $SPINPID &> /dev/null echo -ne "done." } diff --git a/lib/nextcloud.sh b/lib/nextcloud.sh index 533e545..471b84f 100644 --- a/lib/nextcloud.sh +++ b/lib/nextcloud.sh @@ -266,6 +266,7 @@ start_nextcloud() { [ $? -ne 0 ] && fail "Couldn't run config.sh inside /federated/apps/nextcloud container" # Add admin user to group + # Have to do it this many times so it will query LDAP and populate admin user first docker exec -u 33 nextcloud /var/www/html/occ ldap:search admin docker exec -u 33 nextcloud /var/www/html/occ group:list docker exec -u 33 nextcloud /var/www/html/occ group:adduser admin admin @@ -275,6 +276,9 @@ start_nextcloud() { # Setup admin email account docker exec -u 33 nextcloud bash -c "/var/www/html/occ mail:account:create admin admin admin@$DOMAIN mail.$DOMAIN 993 ssl admin@$DOMAIN $ADMINPASS mail.$DOMAIN 465 ssl admin@$DOMAIN $ADMINPASS password" &> /dev/null + # Remove configs + rm /federated/apps/nextcloud/data/var/www/html/config.sh /federated/apps/nextcloud/data/var/www/html/configs.json + kill -9 $SPINPID &> /dev/null echo -ne "done." } diff --git a/lib/pdns.sh b/lib/pdns.sh index 4562d33..585c176 100644 --- a/lib/pdns.sh +++ b/lib/pdns.sh @@ -125,6 +125,9 @@ start_pdns() { docker exec pdns /root/createrecords.sh &> /dev/null [ $? -ne 0 ] && fail "Couldn't run createrecords.sh in /federated/apps/pdns container" + # Remove createrecords + rm /federated/apps/pdns/data/root/createrecords.sh + kill -9 $SPINPID &> /dev/null echo -ne "done." } diff --git a/lib/postgresql.sh b/lib/postgresql.sh index a315a9d..60f1291 100644 --- a/lib/postgresql.sh +++ b/lib/postgresql.sh @@ -118,6 +118,9 @@ start_postgresql() { /federated/bin/stop postgresql &> /dev/null /federated/bin/start postgresql &> /dev/null + # Remove init.sql + rm /federated/apps/postgresql/data/docker-entrypoint-initdb.d/init.sql + kill -9 $SPINPID &> /dev/null echo -ne "done." }