feat: add cookie secure option in the cli

This commit is contained in:
Stavros
2025-01-22 21:37:59 +02:00
parent b901744e03
commit 4457d6f525

View File

@@ -106,11 +106,13 @@ func init() {
rootCmd.Flags().String("app-url", "", "The tinyauth URL.") rootCmd.Flags().String("app-url", "", "The tinyauth URL.")
rootCmd.Flags().String("users", "", "Comma separated list of users in the format username:bcrypt-hashed-password.") rootCmd.Flags().String("users", "", "Comma separated list of users in the format username:bcrypt-hashed-password.")
rootCmd.Flags().String("users-file", "", "Path to a file containing users in the format username:bcrypt-hashed-password.") rootCmd.Flags().String("users-file", "", "Path to a file containing users in the format username:bcrypt-hashed-password.")
rootCmd.Flags().Bool("cookie-secure", false, "Send cookie over secure connection only.")
viper.BindEnv("port", "PORT") viper.BindEnv("port", "PORT")
viper.BindEnv("address", "ADDRESS") viper.BindEnv("address", "ADDRESS")
viper.BindEnv("secret", "SECRET") viper.BindEnv("secret", "SECRET")
viper.BindEnv("app-url", "APP_URL") viper.BindEnv("app-url", "APP_URL")
viper.BindEnv("users", "USERS") viper.BindEnv("users", "USERS")
viper.BindEnv("users-file", "USERS_FILE") viper.BindEnv("users-file", "USERS_FILE")
viper.BindEnv("cookie-secure", "COOKIE_SECURE")
viper.BindPFlags(rootCmd.Flags()) viper.BindPFlags(rootCmd.Flags())
} }