From df8bd654d2b22d20af4681a0fc0bf64802267321 Mon Sep 17 00:00:00 2001 From: KsmoinO <99479-KsmoinO@users.noreply.framagit.org> Date: Sat, 19 Nov 2022 18:57:17 +0100 Subject: [PATCH] HedgeDoc - Fix 10/x --- podman-hedgedoc/.gitlab-ci.yml | 2 +- podman-hedgedoc/05_freshinstall.sh | 14 +++++++------- podman-hedgedoc/10_install.sh | 10 ++++++---- podman-hedgedoc/docker-compose.yml | 12 +++++------- podman-hedgedoc/vars.sh | 9 ++++----- 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/podman-hedgedoc/.gitlab-ci.yml b/podman-hedgedoc/.gitlab-ci.yml index 8d292dc..17a316b 100644 --- a/podman-hedgedoc/.gitlab-ci.yml +++ b/podman-hedgedoc/.gitlab-ci.yml @@ -12,7 +12,7 @@ hedgedoc: script: - cd podman-hedgedoc #- ./ci_build-images.sh - - GARBAYE_HEDGEDOC_DATABASE_PASSWORD=ChohNiephuD1nec6 GARBAYE_HEDGEDOC_ENV_DOMAIN=localhost ./05_freshinstall.sh + - GARBAYE_HEDGEDOC_DATABASE_PASSWORD=ChohNiephuD1nec6 GARBAYE_HEDGEDOC_ENV_DOMAIN=qlf-hedgdoc.garbaye.fr ./05_freshinstall.sh - ./20_enable.sh - ./30_start.sh && sleep 10 - ./40_stop.sh diff --git a/podman-hedgedoc/05_freshinstall.sh b/podman-hedgedoc/05_freshinstall.sh index 34744bd..96954b4 100755 --- a/podman-hedgedoc/05_freshinstall.sh +++ b/podman-hedgedoc/05_freshinstall.sh @@ -21,14 +21,14 @@ if podman volume exists ${datavolume} ; then exit 1 fi -if podman volume exists ${uploadsvolume} ; then - echo "Error : UPLOADS volume ${uploadsvolume} already exists." - echo "Please remove it before a freshinstall, or continue with a standard installation." - exit 1 -fi +#if podman volume exists ${uploadsvolume} ; then +# echo "Error : UPLOADS volume ${uploadsvolume} already exists." +# echo "Please remove it before a freshinstall, or continue with a standard installation." +# exit 1 +#fi podman volume create ${dbvolume} -podman volume create ${datavolume} && podman unshare chmod 0777 `get_podman_volume_path ${datavolume}` -podman volume create ${uploadsvolume} && podman unshare chmod 0777 `get_podman_volume_path ${uploadsvolume}` +podman volume create ${datavolume} #&& podman unshare chmod 0777 `get_podman_volume_path ${datavolume}` +#podman volume create ${uploadsvolume} && podman unshare chmod 0777 `get_podman_volume_path ${uploadsvolume}` ${ABSDIR}/10_install.sh diff --git a/podman-hedgedoc/10_install.sh b/podman-hedgedoc/10_install.sh index 6fd1129..cff598e 100755 --- a/podman-hedgedoc/10_install.sh +++ b/podman-hedgedoc/10_install.sh @@ -20,10 +20,10 @@ if ! podman volume exists ${datavolume} ; then exit 1 fi -if ! podman volume exists ${uploadsvolume} ; then - echo "Error : UPLOADS volume ${uploasvolume} does not exists. Consider running 05_freshinstall.sh if this is the first install." - exit 1 -fi +#if ! podman volume exists ${uploadsvolume} ; then +# echo "Error : UPLOADS volume ${uploasvolume} does not exists. Consider running 05_freshinstall.sh if this is the first install." +# exit 1 +#fi cat <> .env # HedgeDoc https://docs.hedgedoc.org/configuration/ @@ -64,6 +64,8 @@ export hedgedoc_image export hedgedoc_version export database_image export database_version +export dbvolume +export datavolume if ! podman image exists ${hedgedoc_image}:${hedgedoc_version}; then podman image pull ${hedgedoc_image}:${hedgedoc_version} || exit 1 diff --git a/podman-hedgedoc/docker-compose.yml b/podman-hedgedoc/docker-compose.yml index eddf110..c0f36f9 100644 --- a/podman-hedgedoc/docker-compose.yml +++ b/podman-hedgedoc/docker-compose.yml @@ -19,7 +19,7 @@ services: # - POSTGRES_PASSWORD= # - POSTGRES_DB=hedgedoc volumes: - - database:/var/lib/postgresql/data + - ${dbvolume}:/var/lib/postgresql/data networks: backend: restart: always @@ -84,9 +84,8 @@ services: # # **URL_ADDPORT** defines if generated links should contain the port. # # Set this to false if your reverse uses the default ports (443 for HTTPS or 80 for HTTP). # - CMD_URL_ADDPORT=true - #volumes: - # - uploads:/hedgedoc/public/uploads - # - data:/data + volumes: + - ${datavolume}:/hedgedoc/public/uploads ports: # Ports that are published to the outside. # The latter port is the port inside the container. It should always stay on 3000 @@ -109,6 +108,5 @@ networks: # Define named volumes so data stays in place volumes: # Volume for PostgreSQL/MySQL database - database: - #uploads: - #data: + ${dbvolume} + ${datavolume} diff --git a/podman-hedgedoc/vars.sh b/podman-hedgedoc/vars.sh index 14b9157..0b854d9 100644 --- a/podman-hedgedoc/vars.sh +++ b/podman-hedgedoc/vars.sh @@ -11,8 +11,7 @@ project_name=${PWD##*/} pod_name="pod_${project_name}" service_name="pod-${pod_name}.service" upstream_images="${hedgedoc_image} ${postgres_image}" -datavolume='podman-hedgedoc_data' -dbvolume='podman-hedgedoc_database' -uploadsvolume='podman-hedgedoc_uploads' -container_name='app' -db_container_name='database' +datavolume="${project_name}_data" +dbvolume="${project_name}_database" +container_name="${project_name}_app" +db_container_name="${project_name}_database"