From ca0f511ede4a6b5fcfb5773e1af861e9dbd76e8e Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Fri, 28 Jan 2022 14:26:42 +0100 Subject: [PATCH] generalisation get_podman_volume_path --- podman-framadate/05_freshinstall.sh | 2 +- podman-matrix/05_freshinstall.sh | 6 +++--- podman-privatebin/10_install.sh | 14 +++++++++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/podman-framadate/05_freshinstall.sh b/podman-framadate/05_freshinstall.sh index 498a57d..3b871c6 100755 --- a/podman-framadate/05_freshinstall.sh +++ b/podman-framadate/05_freshinstall.sh @@ -16,4 +16,4 @@ if podman volume exists ${dbvolume} ; then fi podman volume create ${dbvolume} && \ -podman unshare chown -R 999:999 `podman volume inspect --format '{{ .Mountpoint }}' ${dbvolume}` +podman unshare chown -R 999:999 `get_podman_volume_path ${dbvolume}` diff --git a/podman-matrix/05_freshinstall.sh b/podman-matrix/05_freshinstall.sh index c94e99b..ee1a351 100755 --- a/podman-matrix/05_freshinstall.sh +++ b/podman-matrix/05_freshinstall.sh @@ -19,8 +19,8 @@ podman volume create ${confvolume} && \ podman volume create ${dbvolume} && \ podman run -it --name ${container_name}-generate --mount type=volume,src=${confvolume},dst=/data -e SYNAPSE_SERVER_NAME=${GARBAYE_MATRIX_DOMAIN} -e SYNAPSE_REPORT_STATS=no ${synapse_image}:${synapse_version} generate && \ podman rm ${container_name}-generate && \ -podman unshare sed -i -e "s|^#public_baseurl: https://example.com/$|public_baseurl: ${GARBAYE_MATRIX_URL}|g" `podman volume inspect --format '{{ .Mountpoint }}' ${confvolume}`/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 }}' ${confvolume}`/homeserver.yaml && \ -podman unshare sed -i -e "s|^#enable_registration: false$|enable_registration: false|g" `podman volume inspect --format '{{ .Mountpoint }}' ${confvolume}`/homeserver.yaml && \ +podman unshare sed -i -e "s|^#public_baseurl: https://example.com/$|public_baseurl: ${GARBAYE_MATRIX_URL}|g" `get_podman_volume_path ${confvolume}`/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" `get_podman_volume_path ${confvolume}`/homeserver.yaml && \ +podman unshare sed -i -e "s|^#enable_registration: false$|enable_registration: false|g" `get_podman_volume_path ${confvolume}`/homeserver.yaml && \ ${ABSDIR}/10_install.sh diff --git a/podman-privatebin/10_install.sh b/podman-privatebin/10_install.sh index bfeab38..feb0ff1 100755 --- a/podman-privatebin/10_install.sh +++ b/podman-privatebin/10_install.sh @@ -1,4 +1,12 @@ #!/usr/bin/env bash + +ABSDIR="$( dirname "$(readlink -f -- "$0")" )" +source ${ABSDIR}/../functions.sh +source ${ABSDIR}/vars.sh + +ensure_pwd_is_scriptdir +ensure_not_root + git clone https://github.com/PrivateBin/docker-nginx-fpm-alpine sed -i 's|fastcgi_pass unix:/run/php-fpm.sock;|fastcgi_pass unix:/run/s6/php-fpm.sock;|' docker-nginx-fpm-alpine/etc/nginx/http.d/site.conf sed -i 's|pid /run/nginx.pid;|pid /run/s6/nginx.pid;|' docker-nginx-fpm-alpine/etc/nginx/nginx.conf @@ -9,7 +17,7 @@ podman build -t privatebin-nginx-fpm-alpine docker-nginx-fpm-alpine podman volume create privatebin-data podman volume create privatebin-run podman volume create privatebin-var-lib-nginx-tmp -podman unshare chown -R 65534:82 `podman volume inspect --format '{{ .Mountpoint }}' privatebin-data` -podman unshare chown -R 65534:82 `podman volume inspect --format '{{ .Mountpoint }}' privatebin-run` -podman unshare chown -R 65534:82 `podman volume inspect --format '{{ .Mountpoint }}' privatebin-var-lib-nginx-tmp` +podman unshare chown -R 65534:82 `get_podman_volume_path privatebin-data` +podman unshare chown -R 65534:82 `get_podman_volume_path privatebin-run` +podman unshare chown -R 65534:82 `get_podman_volume_path privatebin-var-lib-nginx-tmp` podman run -d --read-only --restart=always --name my-privatebin -p 8084:8080 -v privatebin-run:/run:Z -v privatebin-data:/srv/data:Z -v privatebin-var-lib-nginx-tmp:/var/lib/nginx/tmp:Z privatebin-nginx-fpm-alpine