act
act copied to clipboard
Limit servers to IPv4 to make them work with WSL (only for WSL environments)
Summary
Builds on the work by @stickeegreg in #5912 and responds to the comment from @ChristopherHX to making the default network stack for the artifact and cache services tcp4 if running in WSL. Also added the option to configure via CLI flags.
Changes
- Default behavior change:
-
WSL2: If environment variable
WSL_DISTRO_NAMEis set: Usestcp4(IPv4-only) when launching the artifact & cache services to avoid EHOSTUNREACH/ECONNREFUSED errors (see #2636 & #1866) -
Other environments: Uses
tcp(dual-stack IPv4/IPv6) as before.
-
WSL2: If environment variable
- Added
--artifact-server-networkand--cache-server-networkCLI flags with validation for valid stack values (tcp,tcp4,tcp6) - Updated
StartHandler()andServe()to accept network parameter
Usage
# Use defaults (tcp4 on WSL2, tcp otherwise)
act
# On WSL2 override to use standard TCP
act --artifact-server-network tcp --cache-server-network tcp
# On non-WSL2 or if `WSL_DISTRO_NAME` isn't set for some reason:
act --artifact-server-network tcp4 --cache-server-network tcp4
# Force IPv6 - I have no ability to test this as I don't have an ipv6 enabled machine to test on.
act --artifact-server-network tcp6
Related Issues
Fixes #2636 - ECONNREFUSED to artifact service on WSL2
Fixes #1866 - Cache server EHOSTUNREACH on WSL2
Based on #5912 - Initial hardcoded fix