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
The sysroot block alone is ~68 lines of volume-filtering logic with no relationship to the DoH proxy or CLI proxy blocks. The function was introduced as the extraction target of #5727 but has grown to 208 lines.
Security relevance: the iptables-init and api-proxy sidecar assembly paths are security-critical (iptables NAT rules and credential-injection configuration).
Proposed Split
Keep assembleOptionalServices as a thin coordinator (~40 lines)
Extract presetSidecarIpEnvVars(environment, config, networkConfig) — pre-sets AWF_*_IP env vars before init container construction
Extract assembleSysrootService(params, agentVolumes) — volume-filtering and sysroot-stage service wiring (~70 lines)
Extract per-sidecar helpers for iptables-init, api-proxy, doh-proxy, and cli-proxy assembly
Refactoring Opportunity
Summary
src/services/optional-services.tsassembleOptionalServices— 208 lines (lines 42–250)Evidence
assembleOptionalServiceshandles seven independent sidecar-assembly blocks, all guarded by feature flags:The sysroot block alone is ~68 lines of volume-filtering logic with no relationship to the DoH proxy or CLI proxy blocks. The function was introduced as the extraction target of #5727 but has grown to 208 lines.
Security relevance: the iptables-init and api-proxy sidecar assembly paths are security-critical (iptables NAT rules and credential-injection configuration).
Proposed Split
assembleOptionalServicesas a thin coordinator (~40 lines)presetSidecarIpEnvVars(environment, config, networkConfig)— pre-sets AWF_*_IP env vars before init container constructionassembleSysrootService(params, agentVolumes)— volume-filtering and sysroot-stage service wiring (~70 lines)Affected Callers
Output: only
src/compose-generator.ts(line 11) importsassembleOptionalServices. Internal helpers remain un-exported.Effort Estimate
Medium — the sysroot block has side effects (mutates
agentVolumesin-place via.length = 0+ push) that require careful extraction.Benefits
Detected by Refactoring Scanner workflow. Run date: 2026-07-02
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
awmgmcpgSee Network Configuration for more information.