mirror of
https://github.com/kuhyx/wake-alarm.git
synced 2026-11-28 20:29:16 +01:00
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:
parent
57a6c6ba0e
commit
a0731c496c
@ -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
|
is checked **before** anything is constructed, so an unconfigured machine
|
||||||
never touches the network.
|
never touches the network.
|
||||||
- GitHub token (fallback only): `~/.config/wake_alarm/sync.json` key `token`,
|
- 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
|
Needs `repo` scope — the repo is private, so a token without access returns
|
||||||
**404, not 403**.
|
**404, not 403**.
|
||||||
- `crdt_sync` is imported at module scope but **guarded by
|
- `crdt_sync` is imported at module scope but **guarded by
|
||||||
|
|||||||
@ -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"
|
SYNC_CONFIG_FILE: Path = Path.home() / ".config" / "wake_alarm" / "sync.json"
|
||||||
|
|
||||||
# Fallback token locations, tried in order when SYNC_CONFIG_FILE is absent.
|
# 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
|
# diet_guard already stores a repo-scoped PAT for this same kuhyx/syncs repo as
|
||||||
# kuhyx/syncs repo as a raw single-line file, so reusing one means a single
|
# a raw single-line file; reusing it means one token to rotate, not two.
|
||||||
# token to rotate instead of three copies drifting out of sync.
|
# screen-locker's sync_token is gone: its PC sync is Firebase-only since
|
||||||
# shutdown-wrapper.sh reads the same list — keep the two in step.
|
# 2026-10-09 and nothing maintains that file any more.
|
||||||
SYNC_TOKEN_FALLBACK_FILES: tuple[Path, ...] = (
|
SYNC_TOKEN_FALLBACK_FILES: tuple[Path, ...] = (
|
||||||
Path.home() / ".config" / "diet_guard" / "sync_token",
|
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.
|
# Where a successful read is cached, so a network blip can't cost a wake-up.
|
||||||
|
|||||||
@ -92,8 +92,8 @@ def _read_token_fallback() -> str | None:
|
|||||||
def _read_token() -> str | None:
|
def _read_token() -> str | None:
|
||||||
"""Read the GitHub token, preferring this package's own config.
|
"""Read the GitHub token, preferring this package's own config.
|
||||||
|
|
||||||
Falls back to the sibling companion apps' token files so one repo-scoped
|
Falls back to diet_guard's token file so one repo-scoped PAT covers
|
||||||
PAT covers every app syncing through ``kuhyx/syncs``.
|
every app syncing through ``kuhyx/syncs``.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The token, or None if no configured source holds one.
|
The token, or None if no configured source holds one.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user