feat: initpage com sync Go + auth + frontend em web/

This commit is contained in:
2026-10-21 18:06:25 -03:00
commit 17b81a808a
24 changed files with 4807 additions and 0 deletions

34
internal/config/config.go Normal file
View File

@@ -0,0 +1,34 @@
package config
import (
"os"
)
type Config struct {
Port string
BasePath string
AppOrigin string
SessionSecret string
TurnstileSecret string
TurnstileSiteKey string
DBPath string
}
func Load() *Config {
return &Config{
Port: getEnv("PORT", "8080"),
BasePath: getEnv("BASE_PATH", "/initpage"),
AppOrigin: getEnv("APP_ORIGIN", "https://apps.weltonmoura.com.br"),
SessionSecret: getEnv("SESSION_SECRET", "dev-secret-change-me"),
TurnstileSecret: getEnv("TURNSTILE_SECRET", ""),
TurnstileSiteKey: getEnv("TURNSTILE_SITEKEY", ""),
DBPath: getEnv("DB_PATH", "./data/initpage.db"),
}
}
func getEnv(key, def string) string {
if v := os.Getenv(key); v != "" {
return v
}
return def
}