Skip to content

Commit

Permalink
Add extra folder to userConfigDir to look for config
Browse files Browse the repository at this point in the history
  • Loading branch information
phwissmann committed Aug 29, 2024
1 parent 17937eb commit d47ff5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion openem-ingestor/core/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package core
import (
"fmt"
"os"
"path"

"github.com/spf13/viper"
)
Expand Down Expand Up @@ -52,8 +53,8 @@ func ReadConfig() error {
viper.SetConfigType("yaml")

userConfigDir, _ := os.UserConfigDir()
viper.AddConfigPath(userConfigDir)

viper.AddConfigPath(path.Join(userConfigDir, "openem-ingestor"))
viper.AddConfigPath("./")

err := viper.ReadInConfig()
Expand Down
4 changes: 2 additions & 2 deletions openem-ingestor/service/openem-ingestor-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Scicat:
Host: http://openem-scopem.ethz.ch:89/api/v3
Host: http://scicat:8080/api/v3
AccessToken: "asdf"
Transfer:
Method: S3
S3:
Endpoint: scopem-openem.ethz.ch:9000
Endpoint: s3-endpoint:9000
Bucket: landingzone
Checksum: true
Globus:
Expand Down

0 comments on commit d47ff5d

Please sign in to comment.