generalisation get_podman_volume_path

This commit is contained in:
Gitouche 2022-01-28 14:26:42 +01:00
parent e9b1fe260f
commit ca0f511ede
3 changed files with 15 additions and 7 deletions

View file

@ -16,4 +16,4 @@ if podman volume exists ${dbvolume} ; then
fi fi
podman volume create ${dbvolume} && \ 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}`

View file

@ -19,8 +19,8 @@ podman volume create ${confvolume} && \
podman volume create ${dbvolume} && \ 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 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 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 -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" `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" `get_podman_volume_path ${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|^#enable_registration: false$|enable_registration: false|g" `get_podman_volume_path ${confvolume}`/homeserver.yaml && \
${ABSDIR}/10_install.sh ${ABSDIR}/10_install.sh

View file

@ -1,4 +1,12 @@
#!/usr/bin/env bash #!/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 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|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 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-data
podman volume create privatebin-run podman volume create privatebin-run
podman volume create privatebin-var-lib-nginx-tmp 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 `get_podman_volume_path privatebin-data`
podman unshare chown -R 65534:82 `podman volume inspect --format '{{ .Mountpoint }}' privatebin-run` podman unshare chown -R 65534:82 `get_podman_volume_path 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-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 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