Mercurial > gemma
diff pkg/config/config.go @ 517:7e45aaec7081
Consolidate configuration parameters.
metamorph-db-user -> db-user
metamorph-db-password -> db-password
dbhost -> db-host
dbname -> db-name
dbport -> db-port
dbssl -> db-ssl
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 27 Aug 2018 15:27:26 +0200 |
parents | a0371bbb73d7 |
children | da526b58c9c4 |
line wrap: on
line diff
--- a/pkg/config/config.go Mon Aug 27 12:44:07 2018 +0200 +++ b/pkg/config/config.go Mon Aug 27 15:27:26 2018 +0200 @@ -18,17 +18,18 @@ func ConfigFile() string { return configFile } -func DBHost() string { return viper.GetString("dbhost") } -func DBPort() uint { return uint(viper.GetInt32("dbport")) } -func DBName() string { return viper.GetString("dbname") } -func DBSSLMode() string { return viper.GetString("dbssl") } +func DBHost() string { return viper.GetString("db-host") } +func DBPort() uint { return uint(viper.GetInt32("db-port")) } +func DBName() string { return viper.GetString("db-name") } +func DBUser() string { return viper.GetString("db-user") } +func DBPassword() string { return viper.GetString("db-password") } +func DBSSLMode() string { return viper.GetString("db-ssl") } + func SessionStore() string { return viper.GetString("sessions") } -func Web() string { return viper.GetString("web") } -func WebHost() string { return viper.GetString("host") } -func WebPort() uint { return uint(viper.GetInt32("port")) } -func MetamorphDBUser() string { return viper.GetString("metamorph-db-user") } -func MetamorhpDBPassword() string { return viper.GetString("metamorph-db-password") } +func Web() string { return viper.GetString("web") } +func WebHost() string { return viper.GetString("host") } +func WebPort() uint { return uint(viper.GetInt32("port")) } func MailHost() string { return viper.GetString("mail-host") } func MailPort() uint { return uint(viper.GetInt32("mail-port")) } @@ -116,10 +117,12 @@ vbind(name) } - strP("dbhost", "H", "localhost", "host of the database") - uiP("dbport", "P", 5432, "port of the database") - strP("dbname", "d", "gemma", "name of the database") - strP("dbssl", "S", "prefer", "SSL mode of the database") + strP("db-host", "H", "localhost", "host of the database") + uiP("db-port", "P", 5432, "port of the database") + strP("db-name", "d", "gemma", "name of the database") + str("db-user", "meta_login", "Metamorphic database user") + str("db-password", "", "Metamorphic database user password") + strP("db-ssl", "S", "prefer", "SSL mode of the database") strP("sessions", "s", "", "path to the sessions file") @@ -129,7 +132,8 @@ str("mail-host", "localhost", "server to send mail with") ui("mail-port", 465, "port of server to send mail with") - str("mail-user", "gemma", "user to authenticate against mail-host. Leave empty for trying to send without auth.") + str("mail-user", "gemma", "user to authenticate against mail-host.\n"+ + "Leave empty for trying to send without auth.") str("mail-password", "", "password of user to send mail with") str("mail-from", "noreply@localhost", "from line of mails") str("mail-helo", "localhost", "name of server to send mail from.") @@ -140,9 +144,6 @@ str("geoserver-user", "admin", "GeoServer user") str("geoserver-password", "geoserver", "GeoServer password") - str("metamorph-db-user", "", "Metamorphic database user") - str("metamorph-db-password", "", "Metamorphic database user password") - str("proxy-key", "", `signing key for proxy URLs. Defaults to random key.`) str("proxy-prefix", "", `URL prefix of proxy. Defaults to "http://${web-host}:${web-port}"`)