feat(proxy): Add reverse proxy feature

This commit is contained in:
Björn Benouarets
2026-02-05 23:58:47 +01:00
parent 07474afae9
commit 30adf0c701
20 changed files with 514 additions and 323 deletions

35
app/utils/env.go Normal file
View File

@@ -0,0 +1,35 @@
package utils
import (
"os"
"strconv"
"strings"
)
func GetEnv(key string, defaultValue string) string {
value := os.Getenv(key)
if value == "" {
return defaultValue
}
return value
}
func GetEnvInt(key string, defaultValue int) int {
value := os.Getenv(key)
if value == "" {
return defaultValue
}
intValue, err := strconv.Atoi(value)
if err != nil {
return defaultValue
}
return intValue
}
func GetEnvBool(key string, defaultValue bool) bool {
value := strings.ToLower(os.Getenv(key))
if value == "" {
return defaultValue
}
return value == "true" || value == "1" || value == "yes" || value == "y" || value == "on" || value == "enabled"
}