PrivateBin : grande simplification, volumes inpermanents en tmpfs, etc.

This commit is contained in:
Gitouche 2024-11-22 18:41:20 +01:00
parent 212307a5e5
commit 7f3b15e3f1
3 changed files with 4 additions and 14 deletions

View file

@ -14,5 +14,4 @@ if podman volume exists ${srvdata_volume}; then
fi fi
podman volume create ${srvdata_volume} podman volume create ${srvdata_volume}
podman unshare chown -R 65534:82 `get_podman_volume_path ${srvdata_volume}`
${ABSDIR}/10_install.sh ${ABSDIR}/10_install.sh

View file

@ -15,17 +15,12 @@ fi
if ! podman image exists "${privatebin_image}":"${privatebin_version}"; then if ! podman image exists "${privatebin_image}":"${privatebin_version}"; then
podman image pull "${privatebin_image}":"${privatebin_version}" || exit 1 podman image pull "${privatebin_image}":"${privatebin_version}" || exit 1
fi fi
podman volume create ${run_volume} &&
podman volume create ${tmp_volume} &&
podman volume create ${varlibnginxtmp_volume} &&
podman unshare chown -R 65534:82 `get_podman_volume_path ${run_volume}` &&
podman unshare chown -R 65534:82 `get_podman_volume_path ${varlibnginxtmp_volume}` &&
podman container run -d --read-only --name ${container_name} \ podman container run -d --read-only --name ${container_name} \
-p ${listen_if}:${listen_port}:8080 \ -p ${listen_if}:${listen_port}:8080 \
-v ${run_volume}:/run:Z \ --mount=type=tmpfs,destination=/run,U=true \
-v ${tmp_volume}:/tmp:Z \ --mount=type=tmpfs,destination=/tmp \
-v ${srvdata_volume}:/srv/data:Z \ --mount=type=tmpfs,destination=/var/lib/nginx/tmp,U=true \
-v ${varlibnginxtmp_volume}:/var/lib/nginx/tmp:Z \ -v ${srvdata_volume}:/srv/data:UZ \
"${privatebin_image}":"${privatebin_version}" && "${privatebin_image}":"${privatebin_version}" &&
( podman container logs -f ${container_name} 2>&1 & ) | grep -q 'NOTICE: ready to handle connections' && ( podman container logs -f ${container_name} 2>&1 & ) | grep -q 'NOTICE: ready to handle connections' &&
podman container stop ${container_name} && podman container stop ${container_name} &&

View file

@ -12,7 +12,3 @@ project_name=${PWD##*/}
container_name="${project_name}" container_name="${project_name}"
service_name="container-${container_name}.service" service_name="container-${container_name}.service"
srvdata_volume='privatebin-data' srvdata_volume='privatebin-data'
varlibnginxtmp_volume='privatebin-var-lib-nginx-tmp'
run_volume='privatebin-run'
tmp_volume='privatebin-tmp'
nonpersistent_volumes="${varlibnginxtmp_volume} ${run_volume} ${tmp_volume}"