From 0c96d5a45f5f7d331c22250c431d3dedf71ad42d Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Thu, 15 Dec 2022 14:32:25 -0500 Subject: [PATCH 1/5] Add config file template for documentMaxLength setting --- .env.sample | 2 ++ compose.yml | 7 +++++++ config.json.tmpl | 5 +++++ 3 files changed, 14 insertions(+) create mode 100644 config.json.tmpl diff --git a/.env.sample b/.env.sample index 461c30b..cd08135 100644 --- a/.env.sample +++ b/.env.sample @@ -41,3 +41,5 @@ COMPOSE_FILE="compose.yml" # CMD_DEFAULT_PERMISSION=editable # CMD_EMAIL=true # CMD_SESSION_LIFE=1209600000 +# Only present in config.json (no equivalent env var): +# DOCUMENT_MAX_LENGTH=100000 diff --git a/compose.yml b/compose.yml index 7ca478f..31a36b8 100644 --- a/compose.yml +++ b/compose.yml @@ -40,6 +40,9 @@ services: - source: entrypoint_conf target: /docker-entrypoint.sh mode: 0555 + - source: config_json + target: /files/config.json + mode: 0700 deploy: restart_policy: condition: on-failure @@ -90,6 +93,10 @@ networks: external: true internal: configs: + config_json: + name: ${STACK_NAME}_config_${ENTRYPOINT_CONF_VERSION} + file: config.json.tmpl + template_driver: golang entrypoint_conf: name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_CONF_VERSION} file: entrypoint.sh.tmpl diff --git a/config.json.tmpl b/config.json.tmpl new file mode 100644 index 0000000..ddb5853 --- /dev/null +++ b/config.json.tmpl @@ -0,0 +1,5 @@ +{ +{{ if (env "DOCUMENT_MAX_LENGTH") }} + "documentMaxLength": {{ env "DOCUMENT_MAX_LENGTH" }} +{{ end }} +} -- 2.47.2 From 6139cff6265e7c26109c142c294143505e6386b0 Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Thu, 15 Dec 2022 14:38:53 -0500 Subject: [PATCH 2/5] Correct link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f1e7383..4e1db65 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,6 @@ bin/manage_users ``` -[hedegedoc]: https://github.com/hackmdio/hedegedoc +[hedegedoc]: https://github.com/hedgedoc/hedgedoc [abra]: https://git.autonomic.zone/autonomic-cooperative/abra [compose-traefik]: https://git.autonomic.zone/coop-cloud/traefik -- 2.47.2 From 9e88945b9bfcec927b8bcdf627df47975b3fad5b Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Thu, 15 Dec 2022 15:05:02 -0500 Subject: [PATCH 3/5] Corrections to get config updating and effective --- compose.yml | 3 ++- config.json.tmpl | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compose.yml b/compose.yml index 31a36b8..cbc2360 100644 --- a/compose.yml +++ b/compose.yml @@ -26,6 +26,7 @@ services: - CMD_DEFAULT_PERMISSION - CMD_EMAIL - CMD_SESSION_LIFE + - DOCUMENT_MAX_LENGTH depends_on: - db networks: @@ -42,7 +43,7 @@ services: mode: 0555 - source: config_json target: /files/config.json - mode: 0700 + mode: 0555 deploy: restart_policy: condition: on-failure diff --git a/config.json.tmpl b/config.json.tmpl index ddb5853..62a3dbd 100644 --- a/config.json.tmpl +++ b/config.json.tmpl @@ -1,5 +1,7 @@ { -{{ if (env "DOCUMENT_MAX_LENGTH") }} - "documentMaxLength": {{ env "DOCUMENT_MAX_LENGTH" }} -{{ end }} + {{ if (env "DOCUMENT_MAX_LENGTH") }} + "production": { + "documentMaxLength": {{ env "DOCUMENT_MAX_LENGTH" }} + } + {{ end }} } -- 2.47.2 From 7780eb9f1384e4f3a8d56b34255eefd7b53aed7e Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Thu, 15 Dec 2022 15:05:13 -0500 Subject: [PATCH 4/5] Bump configuration version --- abra.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abra.sh b/abra.sh index 413e4e8..9f9dbad 100644 --- a/abra.sh +++ b/abra.sh @@ -1,4 +1,4 @@ -export ENTRYPOINT_CONF_VERSION=v5 +export ENTRYPOINT_CONF_VERSION=v6 abra_backup_app() { _abra_backup_dir "app:/home/hackmd/app/public/uploads/" -- 2.47.2 From 8e973cbed1f8ff2d67176be8a9099cfec9b6acd4 Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Thu, 15 Dec 2022 20:10:29 +0000 Subject: [PATCH 5/5] Closing `'s seem not required when indented Otherwise, extra `` prints on README display. --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 4e1db65..b97e7b5 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,7 @@ abra app YOURAPPDOMAIN run app bash . /docker-entrypoint2.sh -e bin/manage_users - ``` [hedegedoc]: https://github.com/hedgedoc/hedgedoc [abra]: https://git.autonomic.zone/autonomic-cooperative/abra -[compose-traefik]: https://git.autonomic.zone/coop-cloud/traefik +[compose-traefik]: https://git.autonomic.zone/coop-cloud/traefik \ No newline at end of file -- 2.47.2