From 44cf284534eddd6e4e66a16b6c624746a4ed5afb Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Mon, 13 Nov 2023 22:08:50 +0000 Subject: [PATCH] Fix configuration par variables d'environnement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Autres changements: - [DOCKER-COMPOSE] Passer valeurs de MINIO_ROOT_USER et MINIO_ROOT_PASSWORD à `services.server` --- cmd/root.go | 3 +++ docker-compose.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cmd/root.go b/cmd/root.go index d7e86f4..94917bf 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -6,6 +6,7 @@ package cmd import ( "fmt" "os" + "strings" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -51,6 +52,8 @@ func initConfig() { viper.SetConfigName(".agecem-org") } + viper.SetEnvPrefix("AGECEM_ORG") + viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) viper.AutomaticEnv() // read in environment variables that match // If a config file is found, read it in. diff --git a/docker-compose.yaml b/docker-compose.yaml index fb05494..467dd46 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -14,6 +14,9 @@ services: restart: 'unless-stopped' build: . image: 'git.agecem.com/agecem/agecem-org:latest' + environment: + AGECEM_ORG_SERVER_DOCUMENTS_ACCESS_KEY_ID: "${MINIO_ROOT_USER}" + AGECEM_ORG_SERVER_DOCUMENTS_SECRET_ACCESS_KEY: "${MINIO_ROOT_PASSWORD}" ports: - '8080:8080' volumes: -- 2.45.2