From c361d4eba823d56f96042a0bc0ebbde74b1ee20e Mon Sep 17 00:00:00 2001 From: Linus Gasser Date: Sat, 24 Oct 2026 01:41:10 +0200 Subject: [PATCH] Fixing access rights --- abra.sh | 3 ++- compose.sso.yml | 2 +- compose.yml | 6 ++++++ infra.js.tmpl | 32 ++++++++++++++++++++++++++++++++ release/1.0.0+v2026.10.0 | 5 +++-- sso-entrypoint.sh | 7 ++----- 6 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 infra.js.tmpl diff --git a/abra.sh b/abra.sh index 5848e46..d6da55f 100644 --- a/abra.sh +++ b/abra.sh @@ -1,7 +1,8 @@ export CONFIG_VERSION=v3 export CONFIG_JS_VERSION=v2 export NGINX_CONF_VERSION=v2 -export SSO_ENTRYPOINT_VERSION=v7 +export INFRA_JS_VERSION=v1 +export SSO_ENTRYPOINT_VERSION=v8 export SSO_JS_VERSION=v3 export APP_CONFIG_JS_VERSION=v1 export ONLYOFFICE_ENTRYPOINT_VERSION=v2 diff --git a/compose.sso.yml b/compose.sso.yml index 3a295b8..103900c 100644 --- a/compose.sso.yml +++ b/compose.sso.yml @@ -21,7 +21,7 @@ services: target: /sso-entrypoint.sh mode: 0755 - source: sso_js - target: /sso.js + target: /cryptpad/config/sso.js volumes: cryptpad_plugins: diff --git a/compose.yml b/compose.yml index 14c66a1..d01635a 100644 --- a/compose.yml +++ b/compose.yml @@ -27,6 +27,8 @@ services: configs: - source: config_js target: /cryptpad/config/config.js + - source: infra_js + target: /cryptpad/config/infra.js - source: app_config_js target: /cryptpad/customize/application_config.js @@ -85,6 +87,10 @@ configs: name: ${STACK_NAME}_config_${CONFIG_VERSION} file: config.js.tmpl template_driver: golang + infra_js: + name: ${STACK_NAME}_infra_js_${INFRA_JS_VERSION} + file: infra.js.tmpl + template_driver: golang nginx_conf: name: ${STACK_NAME}_nginx_conf_${NGINX_CONF_VERSION} file: nginx.conf.tmpl diff --git a/infra.js.tmpl b/infra.js.tmpl new file mode 100644 index 0000000..76810dc --- /dev/null +++ b/infra.js.tmpl @@ -0,0 +1,32 @@ +// CryptPad infrastructure configuration (cryptpad-server, since 2026.10.0) +// Based on config.local/infra.example.js from the image. +// +// Provided as a Docker config because /cryptpad/config is root-owned in the +// image: docker-entrypoint.sh cannot create this file itself. +// Note: lib/load-config.js additionally overrides origin/sandboxOrigin and +// binds all nodes to 0.0.0.0 when CPAD_MAIN_DOMAIN is set. + +module.exports = { + "public": { + origin: "{{ env "CPAD_MAIN_DOMAIN" }}", + sandboxOrigin: "{{ env "CPAD_SANDBOX_DOMAIN" }}", + httpHost: "0.0.0.0", + httpPort: 3000, + httpSafePort: 3001, + externalWebsocketURL: undefined, + fileHost: undefined, + httpServerId: "", + }, + "front": [ + { host: "0.0.0.0", port: 3010 }, + { host: "0.0.0.0", port: 3011 }, + ], + "core": [ + { host: "0.0.0.0", port: 3020 }, + { host: "0.0.0.0", port: 3021 }, + ], + "storage": [ + { host: "0.0.0.0", port: 3030, wsPort: 3040 }, + { host: "0.0.0.0", port: 3031, wsPort: 3041 }, + ] +}; diff --git a/release/1.0.0+v2026.10.0 b/release/1.0.0+v2026.10.0 index 659bd8e..af0107a 100644 --- a/release/1.0.0+v2026.10.0 +++ b/release/1.0.0+v2026.10.0 @@ -6,8 +6,9 @@ Recipe changes: config is updated (NGINX_CONF_VERSION=v2). - CPAD_MAIN_DOMAIN / CPAD_SANDBOX_DOMAIN now include the https:// scheme, as the new server reads them directly. Nothing to change in your .env. -- On first start the image creates config/infra.js from the example; the - origins, bind address and ports are taken from the env vars above. +- /cryptpad/config is now root-owned in the image, so nothing can be written + there at runtime. config/infra.js (new) and config/sso.js are therefore + mounted as Docker configs (INFRA_JS_VERSION=v1) instead of being copied. - Office apps are now based on Euro-Office 9.3 (install-office.sh). Existing OnlyOffice deployments keep working; new assets are downloaded on start. - SSO: the plugin must be upgraded to 1.0.0. If your .env pins diff --git a/sso-entrypoint.sh b/sso-entrypoint.sh index 872e1a3..bdbf6aa 100644 --- a/sso-entrypoint.sh +++ b/sso-entrypoint.sh @@ -15,11 +15,8 @@ PLUGIN_DIR="/cryptpad/lib/plugins/sso" VERSION_FILE="${PLUGIN_DIR}/.version" SSO_PLUGIN_VERSION="${SSO_PLUGIN_VERSION:-1.0.0}" -# Copy SSO config template into place (mounted as Docker config) -if [ -f /sso.js ]; then - cp /sso.js /cryptpad/config/sso.js - echo "[sso-entrypoint] Copied sso.js config into /cryptpad/config/sso.js" -fi +# sso.js is mounted directly at /cryptpad/config/sso.js as a Docker config: +# since CryptPad 2026.10.0, /cryptpad/config is root-owned and not writable. # Install/update the SSO plugin if [ -f "${VERSION_FILE}" ] && [ "$(cat "${VERSION_FILE}")" = "${SSO_PLUGIN_VERSION}" ]; then