Skip to content

Commit 690a572

Browse files
committed
fix(docker): stop the container entrypoint printing database connection strings in logs
The entrypoint runs under set -x, which echoes each command with variables expanded. The RUN_OPS_DATABASE_URL and RUN_OPS_LEGACY_DIRECT_URL guards and the ClickHouse block referenced full connection strings, so the DSN (with password) was printed to the container logs on every boot. Turn tracing off around those regions and restore it after, leaving migration behavior unchanged.
1 parent 3c82248 commit 690a572

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
Container startup no longer prints database and ClickHouse connection strings (with credentials) to the logs.

docker/scripts/entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ fi
1515

1616
# Run-ops split: migrate the dedicated NEW run-ops database only when it is configured. Single-DB
1717
# installs never set the URL, so this is a no-op there.
18+
{ set +x; } 2>/dev/null
1819
if [ -n "$RUN_OPS_DATABASE_URL" ]; then
20+
set -x
1921
if [ "$SKIP_RUN_OPS_MIGRATIONS" != "1" ]; then
2022
echo "Running run-ops migrations"
2123
pnpm --filter @internal/run-ops-database db:migrate:deploy
@@ -24,13 +26,16 @@ if [ -n "$RUN_OPS_DATABASE_URL" ]; then
2426
echo "SKIP_RUN_OPS_MIGRATIONS=1, skipping run-ops migrations."
2527
fi
2628
else
29+
set -x
2730
echo "RUN_OPS_DATABASE_URL not set, skipping run-ops migrations."
2831
fi
2932

3033
# Run-ops split: keep the legacy runs DB's schema current by applying the full @trigger.dev/database
3134
# migrations to it too, pointed at its direct (non-pooled) URL. Only runs when that URL is configured;
3235
# installs that never set it skip this entirely.
36+
{ set +x; } 2>/dev/null
3337
if [ -n "$RUN_OPS_LEGACY_DIRECT_URL" ]; then
38+
set -x
3439
if [ "$SKIP_RUN_OPS_LEGACY_MIGRATIONS" != "1" ]; then
3540
echo "Running legacy run-ops migrations"
3641
# Subshell with tracing off so `set -x` does not print the DSN (with credentials) to the logs.
@@ -40,6 +45,7 @@ if [ -n "$RUN_OPS_LEGACY_DIRECT_URL" ]; then
4045
echo "SKIP_RUN_OPS_LEGACY_MIGRATIONS=1, skipping legacy run-ops migrations."
4146
fi
4247
else
48+
set -x
4349
echo "RUN_OPS_LEGACY_DIRECT_URL not set, skipping legacy run-ops migrations."
4450
fi
4551

@@ -51,6 +57,7 @@ else
5157
echo "SKIP_DASHBOARD_AGENT_MIGRATIONS=1, skipping dashboard agent migrations."
5258
fi
5359

60+
{ set +x; } 2>/dev/null
5461
if [ -n "$CLICKHOUSE_URL" ] && [ "$SKIP_CLICKHOUSE_MIGRATIONS" != "1" ]; then
5562
# Run ClickHouse migrations
5663
echo "Running ClickHouse migrations..."
@@ -76,6 +83,7 @@ elif [ "$SKIP_CLICKHOUSE_MIGRATIONS" = "1" ]; then
7683
else
7784
echo "CLICKHOUSE_URL not set, skipping ClickHouse migrations."
7885
fi
86+
set -x
7987

8088
# Copy over required prisma files
8189
cp internal-packages/database/prisma/schema.prisma apps/webapp/prisma/

0 commit comments

Comments
 (0)