Issue
The UI for project environment variables strongly suggests that they should be teated as secrets, and makes no mention of them only being redacted from the logs if locked. I saw this same behavior with "Use Docker Build Secrets" checked.
|
<div>Environment variables (secrets) for this resource. </div> |
Looking at the deployment debug logs, I found these lines, followed by all of the environment variables in plain text (the contents of that .env file):
2025-Nov-15 06:29:22.989297
Creating .env file with runtime variables for build phase.
2025-Nov-15 06:29:23.717754
[CMD]: docker exec o404owo8g4k40gk4k4ccc4c0 bash -c 'cat /artifacts/o404owo8g4k40gk4k4ccc4c0/.env'
This command is here:
|
$this->execute_remote_command( |
Digging into execute_remote_command -> $this->executeCommandWithProcess -> $this->redact_sensitive_info, I can see that it's only redacting $lockedVars from the command and output on $new_log_entry.
I couldn't find anything in either the UI or the docs that indicate that only locked environment variables are treated as secrets and redacted in the deployment logs. The v3 docs explicitly stated that environment variables and secrets are the same thing.
Steps to Reproduce
- Create a repository with a Dockerfile and a docker-compose.yaml file that uses some environment variables. I only saw this command get executed for the
app service below, not the db (postgres server), so I think it's important that it builds during the deployment. It shouldn't matter what application code you have in app as long as it builds.
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
depends_on:
db:
condition: service_healthy
restart: unless-stopped
networks:
- docker-network
db:
image: postgres:18.1-alpine3.22
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- docker-network
volumes:
postgres_data:
driver: local
networks:
docker-network:
driver: bridge
- Create a project on coolify, with a resouce linked to your repostory, and use "Docker Compose" as the build pack.
- Go to the environment variables tab in Configuration and add your environment variables. Make sure "Available at runtime" is checked and don't lock them. (note I did also see it print out the build-time environment variables in the debug logs)
- Deploy the application
- Hit "Show Debug Logs"
- Look for a line like:
[CMD]: docker exec <container-id> bash -c 'cat /artifacts/build-time.env'
- Right after this all of the build-time environment variables appear in plaintext
- Look for a line like
[CMD]: docker exec <container-id> bash -c 'cat /artifacts/<container-id>/.env'
- Right after this all of the runtime environment variables appear in plaintext
- Go back and lock one or more environment variables, and redeploy. Now they should be replaced by
<REDACTED> in the build debug log.
Coolify Version
v4.0.0-beta.442
Are you using Coolify Cloud?
No (self-hosted)
Operating System and Version (self-hosted)
Ubuntu 25.04 (ami-08451de661ab8fec8)
Solution Ideas
- Update the copy on this page to make a clear distinction between secrets (locked variables) and non-secrets (unlocked variables):
|
<div>Environment variables (secrets) for this resource. </div> |
- Or, update ExecuteRemoteCommand->redact_sensitive_info to redact all environment variables.
Issue
The UI for project environment variables strongly suggests that they should be teated as secrets, and makes no mention of them only being redacted from the logs if locked. I saw this same behavior with "Use Docker Build Secrets" checked.
coolify/resources/views/livewire/project/shared/environment-variable/all.blade.php
Line 15 in 5b850ba
Looking at the deployment debug logs, I found these lines, followed by all of the environment variables in plain text (the contents of that .env file):
This command is here:
coolify/app/Jobs/ApplicationDeploymentJob.php
Line 1329 in 5b850ba
Digging into execute_remote_command -> $this->executeCommandWithProcess -> $this->redact_sensitive_info, I can see that it's only redacting
$lockedVarsfrom the command and output on $new_log_entry.I couldn't find anything in either the UI or the docs that indicate that only locked environment variables are treated as secrets and redacted in the deployment logs. The v3 docs explicitly stated that environment variables and secrets are the same thing.
Steps to Reproduce
appservice below, not thedb(postgres server), so I think it's important that it builds during the deployment. It shouldn't matter what application code you have inappas long as it builds.[CMD]: docker exec <container-id> bash -c 'cat /artifacts/build-time.env'[CMD]: docker exec <container-id> bash -c 'cat /artifacts/<container-id>/.env'<REDACTED>in the build debug log.Coolify Version
v4.0.0-beta.442
Are you using Coolify Cloud?
No (self-hosted)
Operating System and Version (self-hosted)
Ubuntu 25.04 (ami-08451de661ab8fec8)
Solution Ideas
coolify/resources/views/livewire/project/shared/environment-variable/all.blade.php
Line 15 in 5b850ba