diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-09-02 23:12:52 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-09-02 23:12:52 +0530 |
commit | 7f12e4fa01a2bf3ab25844f3d73af67881a587f1 (patch) | |
tree | 635627eecf325d0d78f45d161d8bb110d3cfcc1e /conf/conf.go | |
parent | 127d4fb8ee7f8b141f9fb2f1a8fda45d350f34fc (diff) |
added sign-in
Diffstat (limited to 'conf/conf.go')
-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) } |