diff options
Diffstat (limited to 'conf')
-rw-r--r-- | conf/conf.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/conf/conf.go b/conf/conf.go index 58dafe1..6f9288e 100644 --- a/conf/conf.go +++ b/conf/conf.go @@ -22,6 +22,7 @@ import ( "log" ) +// TODO: validate config func init() { viper.SetConfigName("openbills") viper.SetConfigType("toml") @@ -38,7 +39,15 @@ func init() { viper.SetDefault("port", "8765") + viper.SetDefault("security.min_password_length", 12) + viper.SetDefault("security.max_password_length", 128) + viper.SetDefault("instance.title", "OpenBills") viper.SetDefault("instance.description", "Libre Billing Software") viper.SetDefault("instance.url", "https://openbills.vidhukant.com") + + // TODO: exit if these 3 have unallowed fields + viper.SetDefault("username.allowed_characters", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-_") + viper.SetDefault("username.min_username_length", 2) + viper.SetDefault("username.max_username_length", 20) } |