Implement CORS middleware with configurable allowed origins and update config structure

This commit is contained in:
Leon Bösche
2026-01-10 01:06:37 +01:00
parent 7f6fe23219
commit 11436e93c5
3 changed files with 33 additions and 15 deletions

View File

@@ -16,6 +16,7 @@ type Config struct {
NextcloudUser string
NextcloudPass string
NextcloudBase string
AllowedOrigins string
}
func Load() *Config {
@@ -31,6 +32,7 @@ func Load() *Config {
NextcloudUser: os.Getenv("NEXTCLOUD_USER"),
NextcloudPass: os.Getenv("NEXTCLOUD_PASSWORD"),
NextcloudBase: getEnv("NEXTCLOUD_BASEPATH", "/"),
AllowedOrigins: getEnv("ALLOWED_ORIGINS", "https://b0esche.cloud,http://localhost:8080"),
}
}