Add IPv6 network support and --docker-subnets option for install/check

- Add support for IPv6 networks in firewall rule generation and validation.
- Add --docker-subnets [SUBNET1 SUBNET2 ...] option to `ufw-docker install` and `ufw-docker check`.
- When used without arguments, automatically detects and applies all Docker network subnets.
- When given subnet arguments, applies firewall rules only to specified subnets (supports multiple subnets, including non-Docker-managed networks).
- If not specified, falls back to default RFC1918 IPv4 and fd00::/8 IPv6 subnets.
- Improve help output with detailed examples and usage guidance.
This commit is contained in:
Chai Feng 2025-07-02 16:52:56 +08:00
parent e9a9f13095
commit 168fc59905
No known key found for this signature in database
GPG key ID: 2DCD9A24E523FFD2
5 changed files with 512 additions and 152 deletions

View file

@ -284,6 +284,7 @@ test-ufw-docker--service-delete-matches-assert() {
docker service update --update-parallelism=0 \
--env-add ufw_docker_agent_image="${ufw_docker_agent_image}" \
--env-add "ufw_public_abcd1234=webapp/deny" \
--env-add "DEBUG=false" \
--image "${ufw_docker_agent_image}" \
"${ufw_docker_agent}"
}