Default setting with consts
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
bdc68b6149
commit
40c5eebb47
|
@ -35,45 +35,46 @@ const (
|
|||
ServiceInterface Key = `service.interface`
|
||||
ServiceFrontendurl Key = `service.frontendurl`
|
||||
ServiceEnableCaldav Key = `service.enablecaldav`
|
||||
ServiceRootpath Key = ``
|
||||
ServicePageCount Key = ``
|
||||
ServiceEnableMetrics Key = ``
|
||||
ServiceRootpath Key = `service.rootpath`
|
||||
ServicePageCount Key = `service.pagecount`
|
||||
ServiceEnableMetrics Key = `service.enablemetrics`
|
||||
|
||||
DatabaseType Key = ``
|
||||
DatabaseHost Key = ``
|
||||
DatabaseUser Key = ``
|
||||
DatabasePassword Key = ``
|
||||
DatabaseDatabase Key = ``
|
||||
DatabasePath Key = ``
|
||||
DatabaseMaxOpenConnections Key = ``
|
||||
DatabaseMaxIdleConnections Key = ``
|
||||
DatabaseMaxConnectionLifetime Key = ``
|
||||
DatabaseType Key = `database.type`
|
||||
DatabaseHost Key = `database.host`
|
||||
DatabaseUser Key = `database.user`
|
||||
DatabasePassword Key = `database.password`
|
||||
DatabaseDatabase Key = `database.database`
|
||||
DatabasePath Key = `database.path`
|
||||
DatabaseMaxOpenConnections Key = `database.maxopenconnections`
|
||||
DatabaseMaxIdleConnections Key = `database.maxidleconnections`
|
||||
DatabaseMaxConnectionLifetime Key = `database.maxconnectionlifetime`
|
||||
|
||||
CacheEnabled Key = ``
|
||||
CacheType Key = ``
|
||||
CacheMaxElementSize Key = ``
|
||||
CacheEnabled Key = `cache.enabled`
|
||||
CacheType Key = `cache.type`
|
||||
CacheMaxElementSize Key = `cache.maxelementsize`
|
||||
|
||||
MailerEnabled Key = ``
|
||||
MailerHost Key = ``
|
||||
MailerPort Key = ``
|
||||
MailerUser Key = ``
|
||||
MailerPassword Key = ``
|
||||
MailerSkipTLSVerify Key = ``
|
||||
MailerFromEmail Key = ``
|
||||
MailerQueuelength Key = ``
|
||||
MailerQueueTimeout Key = ``
|
||||
MailerEnabled Key = `mailer.enabled`
|
||||
MailerHost Key = `mailer.host`
|
||||
MailerPort Key = `mailer.port`
|
||||
MailerUser Key = `mailer.user`
|
||||
MailerPassword Key = `mailer.password`
|
||||
MailerSkipTLSVerify Key = `mailer.skiptlsverify`
|
||||
MailerFromEmail Key = `mailer.fromemail`
|
||||
MailerQueuelength Key = `mailer.queuelength`
|
||||
MailerQueueTimeout Key = `mailer.queuetimeout`
|
||||
|
||||
RedisEnabled Key = ``
|
||||
RedisHost Key = ``
|
||||
RedisPassword Key = ``
|
||||
RedisDB Key = ``
|
||||
RedisEnabled Key = `redis.enabled`
|
||||
RedisHost Key = `redis.host`
|
||||
RedisPassword Key = `redis.password`
|
||||
RedisDB Key = `redis.db`
|
||||
|
||||
LogEnabled Key = ``
|
||||
LogErrors Key = ``
|
||||
LogStandard Key = ``
|
||||
LogHttp Key = ``
|
||||
LogEcho Key = ``
|
||||
LogPath Key = ``
|
||||
LogEnabled Key = `log.enabled`
|
||||
LogErrors Key = `log.errors`
|
||||
LogStandard Key = `log.standard`
|
||||
LogDatabase Key = `log.database`
|
||||
LogHttp Key = `log.echo`
|
||||
LogEcho Key = `log.echo`
|
||||
LogPath Key = `log.path`
|
||||
)
|
||||
|
||||
// GetString returns a string config value
|
||||
|
@ -117,47 +118,47 @@ func InitConfig() {
|
|||
panic(err)
|
||||
}
|
||||
exPath := filepath.Dir(ex)
|
||||
viper.SetDefault("service.rootpath", exPath)
|
||||
viper.SetDefault("service.pagecount", 50)
|
||||
viper.SetDefault("service.enablemetrics", false)
|
||||
ServiceRootpath.setDefault(exPath)
|
||||
ServicePageCount.setDefault(50)
|
||||
ServiceEnableMetrics.setDefault(false)
|
||||
// Database
|
||||
viper.SetDefault("database.type", "sqlite")
|
||||
viper.SetDefault("database.host", "localhost")
|
||||
viper.SetDefault("database.user", "vikunja")
|
||||
viper.SetDefault("database.password", "")
|
||||
viper.SetDefault("database.database", "vikunja")
|
||||
viper.SetDefault("database.path", "./vikunja.db")
|
||||
viper.SetDefault("database.maxopenconnections", 100)
|
||||
viper.SetDefault("database.maxidleconnections", 50)
|
||||
viper.SetDefault("database.maxconnectionlifetime", 10000)
|
||||
DatabaseType.setDefault("sqlite")
|
||||
DatabaseHost.setDefault("localhost")
|
||||
DatabaseUser.setDefault("vikunja")
|
||||
DatabasePassword.setDefault("")
|
||||
DatabaseDatabase.setDefault("vikunja")
|
||||
DatabasePath.setDefault("./vikunja.db")
|
||||
DatabaseMaxOpenConnections.setDefault(100)
|
||||
DatabaseMaxIdleConnections.setDefault(50)
|
||||
DatabaseMaxConnectionLifetime.setDefault(10000)
|
||||
|
||||
// Cacher
|
||||
viper.SetDefault("cache.enabled", false)
|
||||
viper.SetDefault("cache.type", "memory")
|
||||
viper.SetDefault("cache.maxelementsize", 1000)
|
||||
CacheEnabled.setDefault(false)
|
||||
CacheType.setDefault("memory")
|
||||
CacheMaxElementSize.setDefault(1000)
|
||||
// Mailer
|
||||
viper.SetDefault("mailer.enabled", false)
|
||||
viper.SetDefault("mailer.host", "")
|
||||
viper.SetDefault("mailer.port", "587")
|
||||
viper.SetDefault("mailer.user", "user")
|
||||
viper.SetDefault("mailer.password", "")
|
||||
viper.SetDefault("mailer.skiptlsverify", false)
|
||||
viper.SetDefault("mailer.fromemail", "mail@vikunja")
|
||||
viper.SetDefault("mailer.queuelength", 100)
|
||||
viper.SetDefault("mailer.queuetimeout", 30)
|
||||
MailerEnabled.setDefault(false)
|
||||
MailerHost.setDefault("")
|
||||
MailerPort.setDefault("587")
|
||||
MailerUser.setDefault("user")
|
||||
MailerPassword.setDefault("")
|
||||
MailerSkipTLSVerify.setDefault(false)
|
||||
MailerFromEmail.setDefault("mail@vikunja")
|
||||
MailerQueuelength.setDefault(100)
|
||||
MailerQueueTimeout.setDefault(30)
|
||||
// Redis
|
||||
viper.SetDefault("redis.enabled", false)
|
||||
viper.SetDefault("redis.host", "localhost:6379")
|
||||
viper.SetDefault("redis.password", "")
|
||||
viper.SetDefault("redis.db", 0)
|
||||
RedisEnabled.setDefault(false)
|
||||
RedisHost.setDefault("localhost:6379")
|
||||
RedisPassword.setDefault("")
|
||||
RedisDB.setDefault(0)
|
||||
// Logger
|
||||
viper.SetDefault("log.enabled", true)
|
||||
viper.SetDefault("log.errors", "stdout")
|
||||
viper.SetDefault("log.standard", "stdout")
|
||||
viper.SetDefault("log.database", "off")
|
||||
viper.SetDefault("log.http", "stdout")
|
||||
viper.SetDefault("log.echo", "off")
|
||||
viper.SetDefault("log.path", viper.GetString("service.rootpath")+"/logs")
|
||||
LogEnabled.setDefault(true)
|
||||
LogErrors.setDefault("stdout")
|
||||
LogStandard.setDefault("stdout")
|
||||
LogDatabase.setDefault(false)
|
||||
LogHttp.setDefault("stdout")
|
||||
LogEcho.setDefault("off")
|
||||
LogPath.setDefault(ServiceRootpath.GetString() + "/logs")
|
||||
|
||||
// Init checking for environment variables
|
||||
viper.SetEnvPrefix("vikunja")
|
||||
|
@ -165,7 +166,7 @@ func InitConfig() {
|
|||
viper.AutomaticEnv()
|
||||
|
||||
// Load the config file
|
||||
viper.AddConfigPath(viper.GetString("service.rootpath"))
|
||||
viper.AddConfigPath(ServiceRootpath.GetString())
|
||||
viper.AddConfigPath("/etc/vikunja/")
|
||||
viper.AddConfigPath("~/.config/vikunja")
|
||||
viper.AddConfigPath(".")
|
||||
|
|
Loading…
Reference in New Issue