fix: update SSL mode configuration in debug.yaml and NewDB function

This commit is contained in:
Ardeman 2025-04-23 13:11:57 +08:00
parent 6f1ac37915
commit a7ef3f8ca2
2 changed files with 3 additions and 2 deletions

View File

@ -15,12 +15,13 @@ type DB struct {
func NewDB(cfg *config.Config) (*DB, error) {
dsn := fmt.Sprintf(
"host=%s user=%s password=%s dbname=%s port=%v sslmode=disable",
"host=%s user=%s password=%s dbname=%s port=%v sslmode=%s",
cfg.Database.Host,
cfg.Database.Username,
cfg.Database.Password,
cfg.Database.DB,
cfg.Database.Port,
cfg.Database.SslMode,
)
if dsn == "" {

2
env/debug.yaml vendored
View File

@ -15,7 +15,7 @@ postgresql:
db: legalgonews_prod
username: legalgo_admin
password: "656ogwc0JlLEVQyHnT5RrrYa7762iBQQ"
ssl-mode: disable
ssl-mode: require
max-idle-connections-in-second: 600
max-open-connections-in-second: 600
connection-max-life-time-in-second: 600