From 7719c65320a8a2630b03ed6c93be3fdf92c64635 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Fri, 13 Mar 2026 18:24:40 +0100 Subject: [PATCH] Add example to reproduce issue #8854: env var fallback in volume paths (#66) Demonstrates that array/long syntax volumes with ${VAR:-default} fallback values cause "Convert to file" to fail with a command injection error. Co-authored-by: Claude Opus 4.6 --- docker-compose-env-var-fallback-volume/README.md | 11 +++++++++++ .../default-config.yaml | 9 +++++++++ .../docker-compose.yaml | 8 ++++++++ 3 files changed, 28 insertions(+) create mode 100644 docker-compose-env-var-fallback-volume/README.md create mode 100644 docker-compose-env-var-fallback-volume/default-config.yaml create mode 100644 docker-compose-env-var-fallback-volume/docker-compose.yaml diff --git a/docker-compose-env-var-fallback-volume/README.md b/docker-compose-env-var-fallback-volume/README.md new file mode 100644 index 0000000..326df9b --- /dev/null +++ b/docker-compose-env-var-fallback-volume/README.md @@ -0,0 +1,11 @@ +# Docker Compose - Environment Variable Fallback Volume + +Reproduces [issue #8854](https://github.com/coollabsio/coolify/issues/8854): the "Convert to file" button in Persistent Storage UI fails for volume paths using variables with fallback values (`${VAR:-./path}`). + +## How to reproduce + +1. Deploy this as a **Docker Compose** application from this Git repository. +2. Go to the **Persistent Storage** tab. +3. The `${CONFIG_FILE:-./default-config.yaml}` mount is listed as a directory. +4. Click **"Convert to file"** on that mount. +5. Expected: converts to file. Actual: throws `Invalid storage path: contains forbidden character '${' (variable substitution with potential command injection)`. diff --git a/docker-compose-env-var-fallback-volume/default-config.yaml b/docker-compose-env-var-fallback-volume/default-config.yaml new file mode 100644 index 0000000..103ab73 --- /dev/null +++ b/docker-compose-env-var-fallback-volume/default-config.yaml @@ -0,0 +1,9 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html; + } +} diff --git a/docker-compose-env-var-fallback-volume/docker-compose.yaml b/docker-compose-env-var-fallback-volume/docker-compose.yaml new file mode 100644 index 0000000..60295f2 --- /dev/null +++ b/docker-compose-env-var-fallback-volume/docker-compose.yaml @@ -0,0 +1,8 @@ +services: + web: + image: nginx:alpine + volumes: + - type: bind + source: '${CONFIG_FILE:-./default-config.yaml}' + target: /etc/nginx/conf.d/custom.conf + read_only: true