From 21d67d011396cb7d03d8ea6f7af85c9df63fc3ae Mon Sep 17 00:00:00 2001 From: Philipp Rothmann Date: Tue, 9 Aug 2022 10:43:22 +0200 Subject: [PATCH] template db, add release note --- .env.sample | 2 ++ compose.yml | 11 ++++++++++- local.json.tmpl | 12 ++++++------ releases/0.1.0+7.1.1 | 18 ++++++++++++++++++ 4 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 releases/0.1.0+7.1.1 diff --git a/.env.sample b/.env.sample index 0d703b4..13898b4 100644 --- a/.env.sample +++ b/.env.sample @@ -2,6 +2,8 @@ TYPE=onlyoffice LETS_ENCRYPT_ENV=production DOMAIN=onlyoffice.example.com +SECRET_DB_PASSWORD_VERSION=v1 + AUTO_ASSEMBLY_ENABLED=false AUTO_ASSEMBLY_INTERVAL=5min AUTO_ASSEMBLY_STEP=1min diff --git a/compose.yml b/compose.yml index 1c40df8..1e6b7fd 100644 --- a/compose.yml +++ b/compose.yml @@ -19,6 +19,8 @@ services: AUTO_ASSEMBLY_ENABLED: AUTO_ASSEMBLY_INTERVAL: AUTO_ASSEMBLY_STEP: + secrets: + - db_password healthcheck: test: ["CMD", "curl", "-f", "http://localhost/welcome"] interval: 30s @@ -59,9 +61,11 @@ services: environment: POSTGRES_DB: onlyoffice POSTGRES_USER: onlyoffice - POSTGRES_HOST_AUTH_METHOD: trust + POSTGRES_PASSWORD_FILE: /run/secrets/db_password volumes: - db:/var/lib/postgresql/data + secrets: + - db_password networks: - internal healthcheck: @@ -79,6 +83,11 @@ networks: external: true internal: +secrets: + db_password: + external: true + name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION} + configs: local_json: name: ${STACK_NAME}_local_json_${LOCAL_JSON_VERSION} diff --git a/local.json.tmpl b/local.json.tmpl index 6621242..046baa9 100644 --- a/local.json.tmpl +++ b/local.json.tmpl @@ -2,12 +2,12 @@ "services": { "CoAuthoring": { "sql": { - "type": "postgres", - "dbHost": "db", - "dbPort": "5432", - "dbName": "onlyoffice", - "dbUser": "onlyoffice", - "dbPass": "onlyoffice" + "type": "{{ env "DB_TYPE" }}", + "dbHost": "{{ env "DB_HOST" }}", + "dbPort": "{{ env "DB_PORT" }}", + "dbName": "{{ env "DB_NAME" }}", + "dbUser": "{{ env "DB_USER" }}", + "dbPass": "{{ secret "db_password" }}" }, {{ if eq (env "JWT_ENABLED") "true" }} "token": { diff --git a/releases/0.1.0+7.1.1 b/releases/0.1.0+7.1.1 new file mode 100644 index 0000000..efd0807 --- /dev/null +++ b/releases/0.1.0+7.1.1 @@ -0,0 +1,18 @@ +This release upgrades onlyoffice to v7, adds a seperate postgresdb + rabbitmq +and adds env variables for the forcesave option. + +Please add this to your .env file: + +``` +SECRET_DB_PASSWORD_VERSION=v1 + +AUTO_ASSEMBLY_ENABLED=false +AUTO_ASSEMBLY_INTERVAL=5min +AUTO_ASSEMBLY_STEP=1min +``` + +If you like to use the forcesave option, set `AUTO_ASSEMBLY_ENABLED=true`. + +Don't forget to generate or insert a new db secret: `abra app secret generate onlyoffice.example.org db_password v1` + +@yksflip