Compare commits

...

2 Commits

Author SHA1 Message Date
Peter Steinberger
c6a1200d82 fix: refresh changelog for PR #9 (thanks @RonanCodes)
Some checks failed
CI / build (push) Has been cancelled
2026-03-08 04:00:24 +00:00
Bender
c53dccaea1 fix: auto-detect cookies at default path for headless servers
When cookies are copied manually to a headless server (e.g., via scp),
spogo would fail with 'no cookies found' because it only checks the
cookie file path if explicitly set in config.

This change makes cookieSource() check for cookies at the default path
even without config, enabling a simpler setup workflow:

1. Run 'spogo auth import' on a machine with browser
2. Copy cookies file to headless server
3. It just works (no config needed)

This is particularly useful for:
- AI assistants running on VPS/cloud servers
- Raspberry Pi and home server setups
- Any headless Linux environment
2026-03-08 04:00:07 +00:00
2 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## Unreleased
- Fix headless cookie detection by checking the default cookie path without explicit config (`#9`, thanks @RonanCodes)
## 0.3.0 - 2026-03-08
- Release prep: bump CLI/spec version to `0.3.0`

View File

@ -164,9 +164,19 @@ func (c *Context) SetSpotify(client spotify.API) {
}
func (c *Context) cookieSource() (cookies.Source, error) {
// Use explicit cookie path from config if set
if c.Profile.CookiePath != "" {
return cookies.FileSource{Path: c.Profile.CookiePath}, nil
}
// Check if cookies exist at the default path (supports headless servers
// where cookies were copied manually without running auth import)
defaultPath := c.ResolveCookiePath()
if defaultPath != "" {
if _, err := os.Stat(defaultPath); err == nil {
return cookies.FileSource{Path: defaultPath}, nil
}
}
// Fall back to reading from browser
browser := c.Profile.Browser
if strings.TrimSpace(browser) == "" {
browser = "chrome"