protonfs.commands.doctor module¶
protonfs doctor — check that this host can actually run proton-drive.
Written for the headless case, because that is where everything that “just works” on a desktop quietly stops working: no session bus, no Secret Service, or a Secret Service whose default collection is sealed with a password from a graphical login that this user will never perform. Each check reports what it found; –fix additionally bootstraps the keyring rather than only describing the problem.
Added in version 1.0.0.
- class protonfs.commands.doctor.Check(name, ok, detail, hint=None, warn=False)[source]¶
Bases:
objectOne doctor check result.
- Variables:
name – short label for the thing checked (e.g.
"session bus").ok – whether the check passed; only
ok=Falsefails doctor’s exit code.detail – the concrete finding shown after the label.
hint – optional remediation advice, printed under the result.
warn – render as
[warn]rather than[ok]– advisory only, never fails the exit code; meaningful only alongsideok=True.
- protonfs.commands.doctor.doctor(fix=False)[source]¶
Run the checks, print them, and return whether the host can run proton-drive.
- Parameters:
fix (
bool) – when true, bootstrap the keyring rather than only reporting on it.- Return type:
- Returns:
Truewhen every check passed (warnings allowed).
See also
run_doctor()(the checks) andrender()(the output).
- protonfs.commands.doctor.pass_store_drive_compat_check(drive)[source]¶
Fail when the active store is pass but the installed proton-drive predates it.
proton-drive only honours
PROTON_DRIVE_CREDENTIALS_STORE=passfromPASS_STORE_MIN_DRIVE; an older binary silently ignores it and uses its keychain store, so the managed pass store protonfs set up is never read. Only meaningful on the pass path (the caller invokes it inside that branch).- Return type:
- protonfs.commands.doctor.render(checks, console_echo=<function echo>)[source]¶
Print each check as
[ok]/[warn]/[FAIL]and return overall success.- Parameters:
checks (
list[Check]) – the results fromrun_doctor().console_echo – sink for each line (defaults to
click.echo(); overridable for tests).
- Return type:
- Returns:
Truewhen no check failed ([warn]results do not count as failures).
- protonfs.commands.doctor.repo_currency_checks(root)[source]¶
Inside a protonfs root: index schema version, pending repo-state migrations (#67 registry), and config layering sanity. Empty when root is not a protonfs root – there is nothing to check.
- protonfs.commands.doctor.run_doctor(fix=False, root=None)[source]¶
Run every doctor check and return the results (does not print anything).
Covers the runtime environment (proton-drive binary, D-Bus session bus, Secret Service keyring) and, from #73, version/state currency (support matrix, upstream advisory, index schema, pending migrations, config layering).
- protonfs.commands.doctor.shell_exports()[source]¶
VAR=value lines that make the current shell match the environment protonfs hands proton-drive (the resolved credentials store: bus for keychain, or the pass vars). Only needed to run the proton-drive binary by hand; every protonfs command sets this up for itself.
- protonfs.commands.doctor.upstream_currency_check(upstream_fetch=None)[source]¶
Advisory on upstream’s Stable release vs highest_supported() – same message contract as protonfs upgrade (#66). Fails soft offline: an unreachable manifest is an [ok] ‘unknown’, never a failure.
- Return type: