Skip to content
Snippets Groups Projects
Commit 490db53c authored by Gabriel Zachmann's avatar Gabriel Zachmann
Browse files

fix db password not read from file

parent 1afbe2c9
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,6 @@ version: "3.9"
services:
mytoken:
hostname: 'mytoken_{{.Task.Slot}}'
# depends_on:
# - db
image: oidcmytoken/mytoken-server
working_dir: /root/mytoken
volumes:
......@@ -24,7 +22,7 @@ services:
# placement:
# max_replicas_per_node: 1
restart_policy:
condition: on-failure
condition: any
delay: 120s
window: 60s
rollback_config:
......
......@@ -28,9 +28,10 @@ var defaultConfig = Config{
Secure: true,
},
DB: DBConf{
Hosts: []string{"localhost"},
User: "mytoken",
Password: "mytoken",
Hosts: []string{"localhost"},
User: "mytoken",
// The default value for Password is "mytoken", but it is not set here, but returned in the GetPassword function,
// because the default value is only used if no password and no password file are provided
DB: "mytoken",
ReconnectInterval: 60,
},
......@@ -206,7 +207,7 @@ func (conf *DBConf) GetPassword() string {
return conf.Password
}
if conf.PasswordFile == "" {
return ""
return "mytoken"
}
content, err := ioutil.ReadFile(conf.PasswordFile)
if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment