mirror of
https://gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud
synced 2024-11-22 01:16:24 +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
|
- mkdir -p /go/src/gitlab.adphi.fr/partitio/Nextcloud-Partitio
|
||||||
- cp -r $CI_PROJECT_DIR /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
|
- 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_URL/'${NEXTCLOUD_URL//\//\\/}'/g' config.yml
|
||||||
- sed -i -e 's/$NEXTCLOUD_PASSWORD/'${NEXTCLOUD_PASSWORD}'/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
|
- make dep
|
||||||
|
|
||||||
unit_tests:
|
unit_tests:
|
||||||
|
@ -587,7 +587,23 @@ func LoadConfig() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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 {
|
func initClient() error {
|
||||||
|
Loading…
Reference in New Issue
Block a user