From a3baf43f75f11801760b08048e5243b64fca0cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= Date: Sun, 4 Jul 2021 14:28:32 +0200 Subject: [PATCH] =?UTF-8?q?Conservation=20des=20volumes=20entre=20les=20in?= =?UTF-8?q?stallations=20et=20ajout=20de=20v=C3=A9rification=20de=20l'exis?= =?UTF-8?q?tance=20du=20homeserver.yaml=20avant=20cr=C3=A9ationwq?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- podman-matrix/05_freshinstall.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/podman-matrix/05_freshinstall.sh b/podman-matrix/05_freshinstall.sh index b9885e2..e9d3d4f 100755 --- a/podman-matrix/05_freshinstall.sh +++ b/podman-matrix/05_freshinstall.sh @@ -16,10 +16,12 @@ fi if [[ ! -d ~/.local/share/containers/storage/volumes/${dbvolume} ]]; then podman volume create matrixdotorg_synapse-pgsql fi -podman run -it --name ${container_name}-generate --mount type=volume,src=matrixdotorg_synapse-data,dst=/data -e SYNAPSE_SERVER_NAME=garbaye.fr -e SYNAPSE_REPORT_STATS=no ${synapse_image}:${synapse_version} generate && \ -podman rm ${container_name}-generate && \ +if [[ ! -d `podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data`/homeserver.yam ]]; then + podman run -it --name ${container_name}-generate --mount type=volume,src=matrixdotorg_synapse-data,dst=/data -e SYNAPSE_SERVER_NAME=garbaye.fr -e SYNAPSE_REPORT_STATS=no ${synapse_image}:${synapse_version} generate && \ +podman rm ${container_name}-generate +fi podman unshare sed -i -e 's|^#public_baseurl: https://example.com/$|public_baseurl: ${GARBAYE_MATRIX_URL}|g' `podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data`/homeserver.yaml && \ -podman unshare sed -z -i -e 's|database:\n name: sqlite3\n args:\n database: /data/homeserver.db|database:\n name: psycopg2\n args:\n user: synapse\n password: ${GARBAYE_MATRIX_POSTGRES_PASSWORD}\n database: synapse\n host: synapse-db\n port: 5432\n cp_min: 5\n cp_max: 10|g' `podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data`homeserver.yaml && \ -podman unshare sed -i -e 's|^#enable_registration: false$|enable_registration: false|g' `podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data`homeserver.yaml" && \ +podman unshare sed -z -i -e 's|database:\n name: sqlite3\n args:\n database: /data/homeserver.db|database:\n name: psycopg2\n args:\n user: synapse\n password: ${GARBAYE_MATRIX_POSTGRES_PASSWORD}\n database: synapse\n host: synapse-db\n port: 5432\n cp_min: 5\n cp_max: 10|g' `podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data`/homeserver.yaml && \ +podman unshare sed -i -e 's|^#enable_registration: false$|enable_registration: false|g' `podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data`/homeserver.yaml" && \ ${ABSDIR}/10_install.sh