Documentation
¶
Overview ¶
Package wsl holds the WSL2-specific detection and config-patching logic that `lerd wsl:setup` and the doctor's WSL checks share. The file-patch helpers are pure (content in, content out) so they're unit-testable without touching real /etc/wsl.conf, ~/.config/containers/containers.conf, or %USERPROFILE%\.wslconfig.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var WSLConfigLines = []struct{ Key, Line string }{
{"networkingMode", "networkingMode=mirrored"},
{"dnsTunneling", "dnsTunneling=true"},
{"firewall", "firewall=true"},
{"autoProxy", "autoProxy=true"},
}
WSLConfigLines are the [wsl2] settings lerd recommends in %USERPROFILE%\.wslconfig: mirrored networking so Windows browsers can reach *.test / *.localhost, with the related DNS/firewall/proxy toggles. Deliberately omits localhostForwarding and pageReporting, which are a no-op under mirrored mode and an unrecognized key respectively, and so spam WSL with warnings on every terminal launch.
Functions ¶
func EnsureSectionLine ¶
EnsureSectionLine guarantees an ini/toml file's `[section]` contains a line assigning `key`, setting it to `line` (the full `key=value` text, so callers control quoting and spacing). It returns the updated content and whether anything changed: a key already set to `line` is left untouched (idempotent), a key set to something else is rewritten, a missing key is inserted under an existing section, and a missing section is appended. Good enough for the flat, hand-edited config files WSL setup touches; not a general TOML parser.
func HasEventsLoggerJournald ¶
HasEventsLoggerJournald reports whether a containers.conf already sets events_logger to journald, used by the doctor to flag the misconfiguration that breaks every `podman logs --follow` (and thus every dashboard log pane) on a systemd WSL host.
Types ¶
This section is empty.