diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb33af9c89b8e50d7b8564dfdfb9036543939cbc..2571797372a0b8e9373f201fc89a0a5b1244c79d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,7 +28,7 @@ lint: - cd /go/src/gitlab.com/${CI_PROJECT_PATH} unit tests: - image: golang:1.19.4 + image: golang:1.20.5 extends: .gotest stage: test tags: @@ -37,7 +37,7 @@ unit tests: coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/' govulncheck: - image: golang:1.19.4 + image: golang:1.20.5 stage: test tags: - amd64-docker diff --git a/cmd/infohub/main.go b/cmd/infohub/main.go index baaba9a00b005ca81cd423c1be81bf2e7a420c90..657a116e0472bcfcfd1026183bde016e7c91c22c 100644 --- a/cmd/infohub/main.go +++ b/cmd/infohub/main.go @@ -63,8 +63,9 @@ func main() { db, err := mongo.Connect( context.Background(), options.Client().ApplyURI(cfg.Mongo.Addr).SetAuth(options.Credential{ - Username: cfg.Mongo.User, - Password: cfg.Mongo.Pass, + AuthMechanism: cfg.Mongo.AuthMechanism, + Username: cfg.Mongo.User, + Password: cfg.Mongo.Pass, }), ) if err != nil { diff --git a/deployment/ci/Dockerfile b/deployment/ci/Dockerfile index bbc72a09370de206b7c09b2a1ff5703069a09827..34dce13d8399c7456f97aa3712336b318feaa658 100644 --- a/deployment/ci/Dockerfile +++ b/deployment/ci/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.19.4-alpine3.17 as builder +FROM golang:1.20.5-alpine3.17 as builder RUN apk add git diff --git a/deployment/compose/Dockerfile b/deployment/compose/Dockerfile index d033fbdbe212ea07f9ba1ccc38cf6f7bc85e53a5..2dde0100abef1eb3aa20d6bd254e204f455dbfe7 100644 --- a/deployment/compose/Dockerfile +++ b/deployment/compose/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.19.4 +FROM golang:1.20.5 ENV GO111MODULE=on diff --git a/internal/config/config.go b/internal/config/config.go index 28aa1fa5a3f4778e11365917f3e3b8e4acd00ebb..b0187ac40a08853c9eee81c4728f52f2f1a30583 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -25,11 +25,12 @@ type httpConfig struct { } type mongoConfig struct { - Addr string `envconfig:"MONGO_ADDR" required:"true"` - User string `envconfig:"MONGO_USER" required:"true"` - Pass string `envconfig:"MONGO_PASS" required:"true"` - DB string `envconfig:"MONGO_DBNAME" default:"infohub"` - Collection string `envconfig:"MONGO_COLLECTION" default:"exports"` + Addr string `envconfig:"MONGO_ADDR" required:"true"` + User string `envconfig:"MONGO_USER" required:"true"` + Pass string `envconfig:"MONGO_PASS" required:"true"` + DB string `envconfig:"MONGO_DBNAME" default:"infohub"` + Collection string `envconfig:"MONGO_COLLECTION" default:"exports"` + AuthMechanism string `envconfig:"MONGO_AUTH_MECHANISM" default:"SCRAM-SHA-1"` } type credentialConfig struct {