From af0ddb5ba11eeaf8374198e253427120ba3b03a1 Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Tue, 28 Jun 2022 21:50:50 +0200 Subject: [PATCH 1/3] Fix data directory --- pottwal.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pottwal.yml b/pottwal.yml index a517bf0..cfba182 100644 --- a/pottwal.yml +++ b/pottwal.yml @@ -187,7 +187,7 @@ - name: Check if hedgedoc data dir exists ansible.builtin.stat: - path: "/srv/docker/hedgedoc" + path: "/srv/data/hedgedoc" register: hedgedoc_dir - name: Fail if hedgedoc data dir does not exist ansible.builtin.fail: @@ -199,8 +199,8 @@ path: "{{ item }}" state: directory with_items: - - "/srv/docker/hedgedoc/data/database" - - "/srv/docker/hedgedoc/data/uploads" + - "/srv/data/hedgedoc/data/database" + - "/srv/data/hedgedoc/data/uploads" - name: Setup docker network docker_network: @@ -221,7 +221,7 @@ POSTGRES_PASSWORD: "{{ hedgedoc_postgres_password }}" POSTGRES_DB: hedgedoc volumes: - - "/srv/docker/hedgedoc/data/database:/var/lib/postgresql/data" + - "/srv/data/hedgedoc/data/database:/var/lib/postgresql/data" networks: - name: hedgedocnet @@ -246,7 +246,7 @@ CMD_DB_USERNAME: hedgedoc CMD_DB_PASSWORD: "{{ hedgedoc_postgres_password }}" volumes: - - /srv/docker/hedgedoc/data/uploads:/hedgedoc/public/uploads + - /srv/data/hedgedoc/data/uploads:/hedgedoc/public/uploads networks: - name: hedgedocnet From fce7bd6f2ac006ab6c4f7f556bed68801467eebb Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Tue, 28 Jun 2022 21:51:22 +0200 Subject: [PATCH 2/3] Quote environment variables Ansible gets unhappy if there are values that could be interpreted by YAML (e.g. boolean values or numbers), so quote everything as a principle. --- pottwal.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pottwal.yml b/pottwal.yml index cfba182..9bb881d 100644 --- a/pottwal.yml +++ b/pottwal.yml @@ -217,9 +217,9 @@ restart_policy: unless-stopped detach: yes env: - POSTGRES_USER: hedgedoc + POSTGRES_USER: "hedgedoc" POSTGRES_PASSWORD: "{{ hedgedoc_postgres_password }}" - POSTGRES_DB: hedgedoc + POSTGRES_DB: "hedgedoc" volumes: - "/srv/data/hedgedoc/data/database:/var/lib/postgresql/data" networks: @@ -236,14 +236,14 @@ - "{{ hedgedoc_host_port }}:3000" restart_policy: unless-stopped env: - NODE_ENV: production - CMD_DOMAIN: pad.n39.eu - CMD_URL_ADDPORT: true - CMD_DB_HOST: hedgedocdb - CMD_DB_PORT: 5432 - CMD_DB_DIALECT: postgres - CMD_DB_DATABASE: hedgedoc - CMD_DB_USERNAME: hedgedoc + NODE_ENV: "production" + CMD_DOMAIN: "pad.n39.eu" + CMD_URL_ADDPORT: "true" + CMD_DB_HOST: "hedgedocdb" + CMD_DB_PORT: "5432" + CMD_DB_DIALECT: "postgres" + CMD_DB_DATABASE: "hedgedoc" + CMD_DB_USERNAME: "hedgedoc" CMD_DB_PASSWORD: "{{ hedgedoc_postgres_password }}" volumes: - /srv/data/hedgedoc/data/uploads:/hedgedoc/public/uploads From 3d1c2b225217fc2e5f6b8947e19cbc479a6ab079 Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Tue, 28 Jun 2022 21:43:26 +0200 Subject: [PATCH 3/3] Add HTTPS to URLs --- pottwal.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pottwal.yml b/pottwal.yml index 9bb881d..45406d7 100644 --- a/pottwal.yml +++ b/pottwal.yml @@ -237,8 +237,9 @@ restart_policy: unless-stopped env: NODE_ENV: "production" + CMD_PROTOCOL_USESSL: "true" CMD_DOMAIN: "pad.n39.eu" - CMD_URL_ADDPORT: "true" + CMD_URL_ADDPORT: "false" CMD_DB_HOST: "hedgedocdb" CMD_DB_PORT: "5432" CMD_DB_DIALECT: "postgres"