From 7f12e4fa01a2bf3ab25844f3d73af67881a587f1 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sat, 2 Sep 2023 23:12:52 +0530 Subject: added sign-in --- conf/conf.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'conf/conf.go') 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) } -- cgit v1.2.3