fix: auto-detect cookies at default path for headless servers #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When cookies are copied manually to a headless server (e.g., via
scpfrom a machine wherespogo auth importwas run), spogo fails with "no cookies found".This happens because
cookieSource()only usesFileSourceifCookiePathis explicitly set in the config. On a headless server without browser access, users need to manually create a config file with the exact TOML keys — which is non-obvious.Solution
Check for cookies at the default path (
ResolveCookiePath()) even when not explicitly configured. This enables a simpler headless setup:spogo auth importon a machine with browserscp ~/Library/Application\ Support/spogo/cookies/default.json server:~/.config/spogo/cookies/Use Cases
Changes
cookieSource()ininternal/app/context.goto check default cookie path before falling back to browserTesting
Tested on Ubuntu headless server:
spogo status→ "no cookies found"spogo status→ works with copied cookies