mirror of
https://gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud
synced 2024-11-24 21:26:25 +00:00
Moved sensitive data to env vars: TODO: Remove config.yml from git history
This commit is contained in:
parent
68f06ac164
commit
f388c31259
@ -9,8 +9,9 @@ before_script:
|
||||
- mkdir -p /go/src/gitlab.adphi.fr/partitio/Nextcloud-Partitio
|
||||
- cp -r $CI_PROJECT_DIR /go/src/gitlab.adphi.fr/partitio/Nextcloud-Partitio
|
||||
- cd /go/src/gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud
|
||||
- sed -i -e 's/$NEXTCLOUD_URL/'${NEXTCLOUD_URL//\//\\/}'/g' config.yml
|
||||
- sed -i -e 's/$NEXTCLOUD_PASSWORD/'${NEXTCLOUD_PASSWORD}'/g' config.yml
|
||||
#- sed -i -e 's/$NEXTCLOUD_URL/'${NEXTCLOUD_URL//\//\\/}'/g' config.yml
|
||||
#- sed -i -e 's/$NEXTCLOUD_PASSWORD/'${NEXTCLOUD_PASSWORD}'/g' config.yml
|
||||
#- sed -i -e 's/$NEXTCLOUD_EMAIL/'${NEXTCLOUD_EMAIL}'/g' config.yml
|
||||
- make dep
|
||||
|
||||
unit_tests:
|
||||
|
@ -587,7 +587,23 @@ func LoadConfig() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return yaml.Unmarshal(b, &config)
|
||||
if err := yaml.Unmarshal(b, &config); err != nil {
|
||||
return err
|
||||
}
|
||||
// Override with env variables
|
||||
u := os.Getenv("NEXTCLOUD_URL")
|
||||
if u != "" {
|
||||
config.URL = u
|
||||
}
|
||||
p := os.Getenv("NEXTCLOUD_PASSWORD")
|
||||
if p != "" {
|
||||
config.Password = p
|
||||
}
|
||||
e := os.Getenv("NEXTCLOUD_EMAIL")
|
||||
if e != "" {
|
||||
config.Email = e
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func initClient() error {
|
||||
|
Loading…
Reference in New Issue
Block a user