You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: pullgate doctor, read-back of modes, and no silent "asked" when a question was not delivered #28
In the first real install of v0.1.0 (#19), the kernel cleared the setgid bit of the outbox without an error, root logged result=asked, and the listener removed the unreadable question file. Nothing told the owner; the only sign was a question that never came. nodkey doctor broker shows how useful one command that checks a setup is.
Proposal
pullgate doctor [NAME] (as root): checks the setup and prints one line per check, ok or the problem with the fix, and exits non-zero on any problem:
the binary version and the units: installed, the same as contrib/systemd/ of this version (or a note when they differ), enabled where the README says so, pullgate-listen.service active;
config files: owners and modes as DESIGN.md says; each instance config valid;
the spool, state and tree directories: owners and modes as read back, not as set;
the listener user can read the outbox (try it with a test file as that user);
the bot token works (getMe), and the bot can write to the owner's chat (a silent test message, or getChat), only with --telegram;
each instance: the repo can be reached with its deploy key and pinned host key (git ls-remote), the check_user exists and is not the listener user, and each command file exists and is owned by root and not writable by others.
Read back after set: after spool.Ensure and every other place that sets an owner or a mode, read it back and fail loudly when it differs ("the kernel did not keep the mode … ; see pullgate doctor").
No silent "asked": the listener writes a small receipt for each outbox message it sent (or a failure note for one it removed). Root logs asked only after the receipt; when there is none after a few minutes, the next run logs a warning and pullgate status shows "question not delivered". (This and fix: --ask-again does not re-ask while the lost question is still open #22 fit together.)
The README "Install" ends with pullgate doctor.
Done when
pullgate doctor exists with the checks of point 1 and tests for each failing check (with fakes where root or systemd is needed).
A test: an outbox whose mode the kernel changes (simulated) makes the run fail with a clear error, not result=asked.
A test: a question whose outbox file the listener removed shows as not delivered in pullgate status, and the next run logs a warning.
Activity