From 8d8a037e3fe9b1d2ccbc4169ce59b13000b59cb0 Mon Sep 17 00:00:00 2001 From: Jelle Besseling Date: Tue, 12 Oct 2021 13:33:44 +0200 Subject: Allow configuration to be static/readonly (#4315) * Allow configuration to be static/readonly * Make all components disableable * Improve disabled component styling * Rename edits allowed field in configuration * Fix CI --- support/docker/production/Dockerfile.buster | 3 ++- .../docker/production/config/custom-environment-variables.yaml | 7 +++++++ support/docker/production/entrypoint.sh | 9 +-------- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'support/docker/production') diff --git a/support/docker/production/Dockerfile.buster b/support/docker/production/Dockerfile.buster index 2ff0591f9..163c514f5 100644 --- a/support/docker/production/Dockerfile.buster +++ b/support/docker/production/Dockerfile.buster @@ -33,7 +33,8 @@ RUN mkdir /data /config RUN chown -R peertube:peertube /data /config ENV NODE_ENV production -ENV NODE_CONFIG_DIR /config +ENV NODE_CONFIG_DIR /app/config:/app/support/docker/production/config:/config +ENV PEERTUBE_LOCAL_CONFIG /config VOLUME /data VOLUME /config diff --git a/support/docker/production/config/custom-environment-variables.yaml b/support/docker/production/config/custom-environment-variables.yaml index 1b474582a..7c430a995 100644 --- a/support/docker/production/config/custom-environment-variables.yaml +++ b/support/docker/production/config/custom-environment-variables.yaml @@ -68,6 +68,13 @@ object_storage: prefix: "PEERTUBE_OBJECT_STORAGE_VIDEOS_PREFIX" base_url: "PEERTUBE_OBJECT_STORAGE_VIDEOS_BASE_URL" +webadmin: + configuration: + edit: + allowed: + __name: "PEERTUBE_ALLOW_WEBADMIN_CONFIG" + __format: "json" + log: level: "PEERTUBE_LOG_LEVEL" log_ping_requests: diff --git a/support/docker/production/entrypoint.sh b/support/docker/production/entrypoint.sh index 7dd626b9f..261055e84 100755 --- a/support/docker/production/entrypoint.sh +++ b/support/docker/production/entrypoint.sh @@ -1,15 +1,8 @@ #!/bin/sh set -e -# Populate config directory -if [ -z "$(ls -A /config)" ]; then - cp /app/support/docker/production/config/* /config -fi -# Always copy default and custom env configuration file, in cases where new keys were added -cp /app/config/default.yaml /config -cp /app/support/docker/production/config/custom-environment-variables.yaml /config -find /config ! -user peertube -exec chown peertube:peertube {} \; +find /config ! -user peertube -exec chown peertube:peertube {} \; || true # first arg is `-f` or `--some-option` # or first arg is `something.conf` -- cgit v1.2.3