Sync: stop reading screen-locker's sync_token (screen-locker is Firebase-only now)

screen-locker's PC sync went Firebase-only on 2026-10-09 and nothing
maintains ~/.config/screen_locker/sync_token any more. The GitHub-fallback
token list now holds only diet_guard's repo-scoped PAT. Drop the stale
note about shutdown-wrapper.sh mirroring the list (the wrapper was removed
on 2026-08-30).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018RHwVPyiiQMPh4M3JQwQku
This commit is contained in:
Krzysztof Rudnicki 2026-10-09 19:11:50 +02:00
parent 57a6c6ba0e
commit a0731c496c
3 changed files with 8 additions and 8 deletions

View File

@ -121,7 +121,8 @@ systemd-sleep hook: a suspended or just-booted machine still fires.
is checked **before** anything is constructed, so an unconfigured machine
never touches the network.
- GitHub token (fallback only): `~/.config/wake_alarm/sync.json` key `token`,
else a sibling app's raw `~/.config/{diet_guard,screen_locker}/sync_token`.
else diet_guard's raw `~/.config/diet_guard/sync_token` (screen-locker is
Firebase-only since 2026-10-09; its `sync_token` is no longer read).
Needs `repo` scope — the repo is private, so a token without access returns
**404, not 403**.
- `crdt_sync` is imported at module scope but **guarded by

View File

@ -38,13 +38,12 @@ WAKE_STATE_FILE: Path = Path(__file__).resolve().parent / "wake_state.json"
SYNC_CONFIG_FILE: Path = Path.home() / ".config" / "wake_alarm" / "sync.json"
# Fallback token locations, tried in order when SYNC_CONFIG_FILE is absent.
# The sibling companion apps already store a repo-scoped PAT for this same
# kuhyx/syncs repo as a raw single-line file, so reusing one means a single
# token to rotate instead of three copies drifting out of sync.
# shutdown-wrapper.sh reads the same list — keep the two in step.
# diet_guard already stores a repo-scoped PAT for this same kuhyx/syncs repo as
# a raw single-line file; reusing it means one token to rotate, not two.
# screen-locker's sync_token is gone: its PC sync is Firebase-only since
# 2026-10-09 and nothing maintains that file any more.
SYNC_TOKEN_FALLBACK_FILES: tuple[Path, ...] = (
Path.home() / ".config" / "diet_guard" / "sync_token",
Path.home() / ".config" / "screen_locker" / "sync_token",
)
# Where a successful read is cached, so a network blip can't cost a wake-up.

View File

@ -92,8 +92,8 @@ def _read_token_fallback() -> str | None:
def _read_token() -> str | None:
"""Read the GitHub token, preferring this package's own config.
Falls back to the sibling companion apps' token files so one repo-scoped
PAT covers every app syncing through ``kuhyx/syncs``.
Falls back to diet_guard's token file so one repo-scoped PAT covers
every app syncing through ``kuhyx/syncs``.
Returns:
The token, or None if no configured source holds one.