Skip to content

Commit

Permalink
fix: Update ClickHouse password handling in scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Oct 17, 2024
1 parent 28e5f3f commit ac31aa4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/cannon/assert_clickhouse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SEEDING_YAML="$1"
CLICKHOUSE_HOST=${CLICKHOUSE_HOST:-"localhost"}
CLICKHOUSE_PORT=${CLICKHOUSE_PORT:-"9000"}
CLICKHOUSE_USER=${CLICKHOUSE_USER:-"default"}
CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD:-"supersecret"}
CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD}
CLICKHOUSE_DB=${CLICKHOUSE_DB:-"default"}

# Function to execute ClickHouse query
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sentry-smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
for sentry in "${all_sentries[@]}"; do
pretty_print "Checking $table table for $sentry..." "none"
while true; do
data_count=$(docker exec xatu-clickhouse-01 clickhouse-client --user=default --password=supersecret --query "SELECT COUNT(*) FROM default.$table WHERE meta_client_name = '$sentry'" || true)
data_count=$(docker exec xatu-clickhouse-01 clickhouse-client --user=default --query "SELECT COUNT(*) FROM default.$table WHERE meta_client_name = '$sentry'" || true)
if [[ $data_count -gt 0 ]]; then
pretty_print "$table has $data_count entries from $sentry" "green"
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cat <<EOT >> /etc/clickhouse-server/users.d/default.xml
<networks>
<ip>::/0</ip>
</networks>
<password>${CLICKHOUSE_PASSWORD}</password>
$([ -n "${CLICKHOUSE_PASSWORD}" ] && echo "<password>${CLICKHOUSE_PASSWORD}</password>")
<quota>default</quota>
</${CLICKHOUSE_USER}>
<readonly>
Expand All @@ -20,7 +20,7 @@ cat <<EOT >> /etc/clickhouse-server/users.d/default.xml
</yandex>
EOT

PASSWORD=${CLICKHOUSE_PASSWORD:-supersecret}
PASSWORD=${CLICKHOUSE_PASSWORD}

clickhouse client --user default --password ${PASSWORD} -n <<-EOSQL
CREATE TABLE default.schema_migrations_local ON CLUSTER '{cluster}'
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ services:
environment:
- CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1
- CLICKHOUSE_USER=default
- CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD:-supersecret}
- CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD}
- CLICKHOUSE_USER_READONLY_PASSWORD=${CLICKHOUSE_USER_READONLY_PASSWORD:-readonly}
xatu-clickhouse-02:
profiles:
Expand Down Expand Up @@ -403,7 +403,7 @@ services:
environment:
CLICKHOUSE_ENDPOINT: "xatu-clickhouse-01:8123"
CLICKHOUSE_USER: ${CLICKHOUSE_USER:-default}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-supersecret}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD}
KAFKA_BROKERS: "xatu-kafka:29092"
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:8686/health"]
Expand Down Expand Up @@ -433,7 +433,7 @@ services:
environment:
CLICKHOUSE_ENDPOINT: "xatu-clickhouse-01:8123"
CLICKHOUSE_USER: ${CLICKHOUSE_USER:-default}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-supersecret}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD}
KAFKA_BROKERS: "xatu-kafka:29092"
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:8686/health"]
Expand Down Expand Up @@ -485,7 +485,7 @@ services:
"-path",
"/migrations",
"-database",
"clickhouse://xatu-clickhouse-01:9000?username=${CLICKHOUSE_USER:-default}&password=${CLICKHOUSE_PASSWORD:-supersecret}&database=default&x-multi-statement=true",
"clickhouse://xatu-clickhouse-01:9000?username=${CLICKHOUSE_USER:-default}&password=${CLICKHOUSE_PASSWORD}&database=default&x-multi-statement=true",
"up",
]
depends_on:
Expand Down

0 comments on commit ac31aa4

Please sign in to comment.