Merge pull request 'fix' (#8) from master into dev

Reviewed-on: https://gitea.chocomarsh.com/self/monitoring/pulls/8
This commit is contained in:
emmatveev 2025-06-13 02:01:40 +03:00
commit a6a5fc14f0
3 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,8 @@ services:
networks: networks:
- common-infra-nginx-development - common-infra-nginx-development
- clickhouse-development - clickhouse-development
environment:
CLICKHOUSE_PASSWORD: $CLICKHOUSE_PASSWORD_DEV
deploy: deploy:
mode: replicated mode: replicated
restart_policy: restart_policy:

View File

@ -38,4 +38,6 @@ jobs:
with: with:
ref: dev ref: dev
- name: deploy - name: deploy
env:
CLICKHOUSE_PASSWORD_DEV: ${{ secrets.CLICKHOUSE_PASSWORD_DEV }}
run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml infra-development run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml infra-development

View File

@ -3,6 +3,7 @@ package storage
import ( import (
"context" "context"
"fmt" "fmt"
"os"
"github.com/ClickHouse/clickhouse-go/v2" "github.com/ClickHouse/clickhouse-go/v2"
"github.com/ClickHouse/clickhouse-go/v2/lib/driver" "github.com/ClickHouse/clickhouse-go/v2/lib/driver"
@ -27,6 +28,7 @@ func connect() (*driver.Conn, error) {
Auth: clickhouse.Auth{ Auth: clickhouse.Auth{
Database: "monitoring", Database: "monitoring",
Username: "default", Username: "default",
Password: os.Getenv("CLICKHOUSE_PASSWORD"),
}, },
TLS: nil, TLS: nil,
}) })