From e69176e20017d3e4673b985b30f31fec958f85e0 Mon Sep 17 00:00:00 2001 From: "Orville Q. Song" Date: Thu, 24 Nov 2022 20:02:34 +0800 Subject: [PATCH] Tweak --- app.go | 4 ++-- config-example.yaml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app.go b/app.go index b8a8c9c6..69d40794 100644 --- a/app.go +++ b/app.go @@ -128,8 +128,8 @@ func NewHeadscale(cfg *Config) (*Headscale, error) { cfg.DBuser, ) - if s, err := strconv.ParseBool(cfg.DBssl); err == nil { - if !s { + if sslEnabled, err := strconv.ParseBool(cfg.DBssl); err == nil { + if !sslEnabled { dbString += " sslmode=disable" } } else { diff --git a/config-example.yaml b/config-example.yaml index d6c3863f..57866785 100644 --- a/config-example.yaml +++ b/config-example.yaml @@ -137,14 +137,15 @@ db_path: ./db.sqlite # # Postgres config # If using a Unix socket to connect to Postgres, set the socket path in the 'host' field and leave 'port' blank. -# Also if other 'sslmode' is required instead of 'require(true)' and 'disabled(false)', set the 'sslmode' you need -# in the 'db_ssl' field. Refers to https://www.postgresql.org/docs/current/libpq-ssl.html Table 34.1. # db_type: postgres # db_host: localhost # db_port: 5432 # db_name: headscale # db_user: foo # db_pass: bar + +# If other 'sslmode' is required instead of 'require(true)' and 'disabled(false)', set the 'sslmode' you need +# in the 'db_ssl' field. Refers to https://www.postgresql.org/docs/current/libpq-ssl.html Table 34.1. # db_ssl: false ### TLS configuration