WireGuard conf knowledge consolidates into the wireguard module #187
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WireGuard conf-format knowledge is currently spread over four files:
providers/custom.pymini-parsesEndpoint =during import to build the server listproviders/mullvad.pygenerates the template conf by handtunnel.pycompletes it withconf.insert(8/9, ...)line-index surgery (currently lands past the list end and appends — correct by accident)aqomui/wireguard.py(#186) parses the result at bring-up and teardownDecision (from the #152 design discussion): the wireguard module owns the format end to end, as module-level codec functions —
parse_conf(exists) plus agenerate_conf(fields)that builds[Interface]/[Peer]sections from data. Module functions, not protocol-class methods: providers need the codec at import time with no tunnel in existence. The protocol class (planned after #186) owns lifecycle only and calls the same codec.Explicitly ruled out:
config.py— it is the app-settings leaf that imports nothing and knows no protocols;.ovpnhandling never lived there either. The conf format itself stays the wg(8)-plus-wg-quick-extensions interchange format every provider exports; aqomui treats it as data describing a tunnel, never as instructions (Table and the PreUp/PostUp hook keys stay stripped and inert — #186 closed the root-execution hazard of passing imported confs to wg-quick).Work items:
wireguard.generate_conf(fields); Mullvad path builds its conf through it (index surgery retired)custom.pyendpoint extraction callswireguard.parse_confinstead of its own regexRides on the protocol-seam branch rather than standing alone — the class extraction touches the same call sites.
🤖 Generated with Claude Code
Implemented in PR #189 (second commit) alongside the protocol seam: parse_conf/generate_conf as inverses, setconf input always generated, Mullvad completion anchored to the [Peer] section, custom.py endpoint split through the codec helper. Close when #189 merges.