Expand description
Host integration for the proxy: pitchfork proxy setup, --undo, doctor.
The supervisor itself never needs privileges. Everything that does — writing
a resolver file, installing the CA, letting an unprivileged process reach
ports 80 and 443 — is collected here, printed as a plan before anything runs,
and reversed by --undo.
The plan is built from a SetupContext that carries every platform fact
the steps depend on, so the same code can be exercised in tests for a
platform the test is not running on.
Structs§
- Plan
- An ordered list of steps plus trailing advice.
- Prior
Auto Proxy - An automatic-proxy setting as it stood before setup changed it.
- Probe
- A command run for its result rather than its effect.
- RunReport
- Outcome of running a plan, for reporting.
- Setup
Context - Everything the plan depends on, gathered up front so planning is pure.
- Setup
Lock - Record a setup alongside the ones before it, for a later
--undo. - Step
- A single planned step: what it does, and how it is described.
Enums§
- Action
- One action in a plan.
- Platform
- Host platform, as far as setup is concerned.
- Probe
Expect - A condition on a probe’s output.
- Resource
- The system resource a step installs or removes.
Functions§
- apply
- Run every step, skipping those already in effect.
- clear_
record - Forget the recorded setup, once it has been undone.
- context_
from_ settings - Build the context for the current machine and settings.
- gnome_
proxy_ available - Whether the GNOME proxy schema is present.
- invoked_
through_ sudo - Whether the current process is already root, in which case
sudois unnecessary (and may not even be installed). The user who ran this process through sudo, when it is running as root on their behalf rather than as a genuine root login. - load_
records - Every recorded setup, oldest first.
- lock_
setup - Take the lock that serialises a whole
proxy setuprun. - macos_
network_ services - plan
- Build the plan for
pitchfork proxy setup. - plan_
undo - Build the plan for
pitchfork proxy setup --undo. - plan_
undo_ from - The undo plan, reversing what setup recorded and what the settings imply.
- plan_
with_ reconcile - The setup plan, preceded by removal of anything an earlier setup installed that this one supersedes.
- read_
prior_ auto_ proxy - Active macOS network services, as
networksetupnames them. Read the automatic-proxy configuration that is in place right now. - save_
record - Record what this configuration set up, for a later
--undo. - systemd_
resolved_ active - Whether systemd-resolved is the active stub resolver.
- systemd_
version - Major version of systemd, parsed from
systemctl --version. - validate_
proxy_ port - Reject a
proxy.portthe proxy itself would refuse to listen on. - validate_
tld - Reject a TLD that must not reach a privileged file path or a config file.