This commit is contained in:
2026-08-23 14:13:18 -05:00
parent 789bf91eed
commit 866f243f1b
37 changed files with 1761 additions and 58 deletions
+14
View File
@@ -25,6 +25,9 @@ func TestLoadDefaults(t *testing.T) {
if cfg.DBPath != "/var/lib/vibesonic/vibesonic.db" {
t.Errorf("DBPath = %q, want default under DataDir", cfg.DBPath)
}
if cfg.CookieSecure {
t.Error("CookieSecure = true, want false for the default plain-HTTP server")
}
if cfg.ExtAuth.Enabled {
t.Errorf("ExtAuth.Enabled = true, want false by default")
}
@@ -33,6 +36,17 @@ func TestLoadDefaults(t *testing.T) {
}
}
func TestLoadSecureCookiesOptIn(t *testing.T) {
t.Setenv("VIBESONIC_COOKIE_SECURE", "true")
cfg, err := Load()
if err != nil {
t.Fatalf("Load: %v", err)
}
if !cfg.CookieSecure {
t.Error("CookieSecure = false, want true when explicitly enabled")
}
}
func TestLoadMusicDirs(t *testing.T) {
withEnv(t, map[string]string{"VIBESONIC_MUSIC_DIRS": "/music:/music-lossless: /audiobooks "})
cfg, err := Load()