Add avatar caching functionality and update config for cache directory

This commit is contained in:
Leon Bösche
2026-01-29 23:00:59 +01:00
parent 00a585e2c1
commit a2884a9891
2 changed files with 87 additions and 8 deletions

View File

@@ -18,6 +18,7 @@ type Config struct {
NextcloudPass string
NextcloudBase string
AllowedOrigins string
AvatarCacheDir string
}
func Load() *Config {
@@ -34,8 +35,9 @@ func Load() *Config {
NextcloudPass: os.Getenv("NEXTCLOUD_PASSWORD"),
NextcloudBase: getEnv("NEXTCLOUD_BASEPATH", "/"),
AllowedOrigins: getEnv("ALLOWED_ORIGINS", "https://b0esche.cloud,https://www.b0esche.cloud,https://*.b0esche.cloud,http://localhost:8080"),
AvatarCacheDir: getEnv("AVATAR_CACHE_DIR", "/var/cache/b0esche/avatars"),
}
log.Printf("[CONFIG] Nextcloud URL: %q, User: %q, BasePath: %q\n", cfg.NextcloudURL, cfg.NextcloudUser, cfg.NextcloudBase)
log.Printf("[CONFIG] Nextcloud URL: %q, User: %q, BasePath: %q, AvatarCacheDir: %q\n", cfg.NextcloudURL, cfg.NextcloudUser, cfg.NextcloudBase, cfg.AvatarCacheDir)
return cfg
}