From 83d3e45c05c096506430fd9e2568787c8a793a25 Mon Sep 17 00:00:00 2001 From: Laur Ivan Date: Sun, 11 Dec 2022 02:18:36 +0100 Subject: [PATCH] fix: Fix template and rights. --- defaults/main.yml | 3 ++- tasks/main.yml | 12 +++++++++++- templates/docker-compose.yml.j2 | 5 ++--- templates/env.outline.conf.j2 | 11 +++++++---- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 71b0c1b..a8776bf 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -7,7 +7,8 @@ outline_utils_secret: 'changeme' outline_deployment: '' outline_port: 3000 -outline_url: "http://localhost:{{ outline_port }}" +outline_public_port: "{{ outline_port }}" +outline_url: "http://localhost:{{ outline_public_port }}" outline_force_https: "false" outline_enable_updates: "false" outline_cdn_url: diff --git a/tasks/main.yml b/tasks/main.yml index f146233..02aecc3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -23,9 +23,19 @@ with_items: - "{{ outline_setup_path | expanduser | realpath }}" - "{{ outline_volume_redis | expanduser | realpath }}" - - "{{ outline_volume_db | expanduser | realpath }}" - "{{ outline_volume_s3 | expanduser | realpath }}" + tags: + - configuration + become: true +- name: Set up the database directory. + ansible.builtin.file: + state: directory + path: "{{ item }}" + mode: "0755" + owner: 70 + with_items: + - "{{ outline_volume_db | expanduser | realpath }}" tags: - configuration become: true diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index bb0113d..3a51f3f 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -58,8 +58,8 @@ services: outline: image: outlinewiki/outline:latest - command: sh -c "yarn start" - # command: sh -c "yarn sequelize:migrate --env production-ssl-disabled && yarn start" + #command: sh -c "yarn start" + command: sh -c "yarn sequelize:migrate --env production-ssl-disabled && yarn start" env_file: - "{{ outline_setup_path | expanduser | realpath }}/env.outline.conf" - "{{ outline_setup_path | expanduser | realpath }}/env.oidc.conf" @@ -79,4 +79,3 @@ services: networks: outline: {} - diff --git a/templates/env.outline.conf.j2 b/templates/env.outline.conf.j2 index 323d7ae..13c9eef 100644 --- a/templates/env.outline.conf.j2 +++ b/templates/env.outline.conf.j2 @@ -8,13 +8,19 @@ UTILS_SECRET={{ outline_utils_secret }} DEPLOYMENT={{ outline_deployment }} +{% if outline_db_schema == 'postgres' and outline_db_host == 'postgres' %} +DATABASE_URL=postgres://{{ outline_db_user }}:{{ outline_db_password }}@postgres:5432/{{ outline_db }} +{% else %} DATABASE_URL={{ outline_db_schema }}://{{ outline_db_user }}:{{ outline_db_password }}@{{outline_db_host}}:{{ outline_db_port }}/{{ outline_db }} +{% endif %} DATABASE_URL_TEST={{ outline_db_schema }}://{{ outline_db_user }}:{{ outline_db_password }}@{{outline_db_host}}:{{ outline_db_port }}/{{ outline_db }}_test REDIS_URL=redis://redis:6379 # Must point to the publicly accessible URL for the installation URL={{ outline_url }} -PORT=3000 +{% if outline_public_port %} +PORT={{ outline_public_port }} +{% endif %} # Optional. If using a Cloudfront distribution or similar the origin server # should be set to the same as URL. @@ -89,6 +95,3 @@ DEFAULT_LANGUAGE={{ outline_language }} {% if outline_db_ssl %} PGSSLMODE={{ outline_db_ssl }} {% endif %} - - -