From c5c15da71e61e7026c6b692103bedf802bee8e6a Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Sun, 13 Aug 2023 16:04:36 +0200 Subject: [PATCH] seafile 10_install : gerer les cas de freshinstall et reinstallation/upgrade --- podman-seafile/10_install.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/podman-seafile/10_install.sh b/podman-seafile/10_install.sh index 9e9273f..a8b38f0 100755 --- a/podman-seafile/10_install.sh +++ b/podman-seafile/10_install.sh @@ -47,8 +47,12 @@ while [ ! -e `get_podman_volume_path ${datavolume}`/seafile/conf/seahub_settings echo -n "." sleep 1 done && echo "OK" && -podman_unshare_sed_in_place "^FILE_SERVER_ROOT = \"http://${GARBAYE_SEAFILE_SERVER_HOSTNAME}/seafhttp\"" "FILE_SERVER_ROOT = \"https://${GARBAYE_SEAFILE_SERVER_HOSTNAME}/seafhttp\"\nEMAIL_USE_TLS = False\nEMAIL_HOST = '${GARBAYE_SEAFILE_SMTP_SERVER}'\nEMAIL_HOST_USER = ''\nEMAIL_HOST_PASSWORD = ''\nEMAIL_PORT = 25\nDEFAULT_FROM_EMAIL = 'noreply@seafile.garbaye.fr'\nSERVER_EMAIL = 'noreply@seafile.garbaye.fr'" `get_podman_volume_path ${datavolume}`/seafile/conf/seahub_settings.py && -podman_unshare_sed_in_place_multiline "\[notification\]\nenabled = false\nhost = 127.0.0.1" "[notification]\nenabled = true\nhost = 0.0.0.0" `get_podman_volume_path ${datavolume}`/seafile/conf/seafile.conf && +if ! grep -qF EMAIL_HOST `get_podman_volume_path ${datavolume}`/seafile/conf/seahub_settings.py; then + podman_unshare_sed_in_place "^FILE_SERVER_ROOT = \"http://${GARBAYE_SEAFILE_SERVER_HOSTNAME}/seafhttp\"" "FILE_SERVER_ROOT = \"https://${GARBAYE_SEAFILE_SERVER_HOSTNAME}/seafhttp\"\nEMAIL_USE_TLS = False\nEMAIL_HOST = '${GARBAYE_SEAFILE_SMTP_SERVER}'\nEMAIL_HOST_USER = ''\nEMAIL_HOST_PASSWORD = ''\nEMAIL_PORT = 25\nDEFAULT_FROM_EMAIL = 'noreply@seafile.garbaye.fr'\nSERVER_EMAIL = 'noreply@seafile.garbaye.fr'" `get_podman_volume_path ${datavolume}`/seafile/conf/seahub_settings.py +fi && +if ! grep -Pzq "\[notification\]\nenabled = true\nhost = 0.0.0.0" `get_podman_volume_path ${datavolume}`/seafile/conf/seafile.conf; then + podman_unshare_sed_in_place_multiline "\[notification\]\nenabled = false\nhost = 127.0.0.1" "[notification]\nenabled = true\nhost = 0.0.0.0" `get_podman_volume_path ${datavolume}`/seafile/conf/seafile.conf +fi && echo -n "Waiting for seahub to finish starting " && ( podman container logs -f seafile 2>&1 & ) | grep -q 'Seahub is started' && echo "OK" &&