From e75ea257e8500aa36a4b03e884098263499d92b6 Mon Sep 17 00:00:00 2001 From: Ingo Sigmund Date: Thu, 3 Mar 2022 13:47:09 +0100 Subject: [PATCH 1/3] Correct install script (stop creating unused named volumes) --- install-paperless-ngx.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install-paperless-ngx.sh b/install-paperless-ngx.sh index e8a046c40..6b1584951 100755 --- a/install-paperless-ngx.sh +++ b/install-paperless-ngx.sh @@ -329,16 +329,20 @@ sed -i "s#- \./consume:/usr/src/paperless/consume#- $CONSUME_FOLDER:/usr/src/pap if [[ -n $MEDIA_FOLDER ]] ; then sed -i "s#- media:/usr/src/paperless/media#- $MEDIA_FOLDER:/usr/src/paperless/media#g" docker-compose.yml + sed -i "/^\s*media:/d" docker-compose.yml fi if [[ -n $DATA_FOLDER ]] ; then sed -i "s#- data:/usr/src/paperless/data#- $DATA_FOLDER:/usr/src/paperless/data#g" docker-compose.yml + sed -i "/^\s*data:/d" docker-compose.yml fi if [[ -n $POSTGRES_FOLDER ]] ; then sed -i "s#- pgdata:/var/lib/postgresql/data#- $POSTGRES_FOLDER:/var/lib/postgresql/data#g" docker-compose.yml + sed -i "/^\s*pgdata:/d" docker-compose.yml fi + docker-compose pull docker-compose run --rm -e DJANGO_SUPERUSER_PASSWORD="$PASSWORD" webserver createsuperuser --noinput --username "$USERNAME" --email "$EMAIL" From 16664789d269e1efa0e64f06f23d44c013b8178c Mon Sep 17 00:00:00 2001 From: Ingo Sigmund Date: Sat, 5 Mar 2022 12:07:52 +0100 Subject: [PATCH 2/3] remove volume: if no named volumes are used --- install-paperless-ngx.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install-paperless-ngx.sh b/install-paperless-ngx.sh index 6b1584951..938598bf1 100755 --- a/install-paperless-ngx.sh +++ b/install-paperless-ngx.sh @@ -342,6 +342,15 @@ if [[ -n $POSTGRES_FOLDER ]] ; then sed -i "/^\s*pgdata:/d" docker-compose.yml fi +# remove trailing blank lines from end of file +sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' docker-compose.yml +# if last line in file contains "volumes:", remove that line since no more named volumes are left +l1=$(grep -n '^volumes:' docker-compose.yml | cut -d : -f 1) # get line number containing volume: at begin of line +l2=$(wc -l < docker-compose.yml) # get total number of lines +if [ "$l1" -eq "$l2" ] ; then + sed -i "/^volumes:/d" docker-compose.yml +fi + docker-compose pull From 08c6a21bbbe737191ed9392c8785f0adc436b44b Mon Sep 17 00:00:00 2001 From: Ingo Sigmund Date: Sun, 6 Mar 2022 18:03:19 +0100 Subject: [PATCH 3/3] Revert "remove logic to delete dangling volumes: node" This reverts commit c2da0ce5219d8d63f32e74978abac1fa934bb0b8.