feat(be): disable of sslmode for postgres when setup

This commit is contained in:
Denis Gukov 2022-11-20 00:22:17 +05:00
parent 385eb69588
commit cf7e5f895a
2 changed files with 11 additions and 0 deletions

View File

@ -72,6 +72,11 @@ jobs:
- run: chmod +x ./semaphore && ./semaphore migrate --config config.json
- run: "cat > config.json <<EOF\n{\n\t\"bolt\": {\n\t\t\"host\": \"/tmp/database.bolt\"\
\n\t},\n\t\"email_alert\": false\n}\nEOF\n"
- run: chmod +x ./semaphore && ./semaphore migrate --config config.json
test-integration:
runs-on: [ubuntu-latest]

View File

@ -106,6 +106,12 @@ func scanPostgres(conf *util.ConfigType) {
askValue("db User", "root", &conf.Postgres.Username)
askValue("db Password", "", &conf.Postgres.Password)
askValue("db Name", "semaphore", &conf.Postgres.DbName)
if conf.Postgres.Options == nil {
conf.Postgres.Options = make(map[string]string)
}
if _, exists := conf.Postgres.Options["sslmode"]; !exists {
conf.Postgres.Options["sslmode"] = "disable"
}
}
func scanErrorChecker(n int, err error) {