25 Commits

Author SHA256 Message Date
ec1a37d18f Fix env_check_apply_fixes under partial fix needs
The function used a chain of `(( NEED_X == 1 )) && { ... }` statements.
When the last flag is 0 the trailing arithmetic evaluates to false and
bash returns 1 from the function. Under the main script's `set -e` that
propagates up to bootstrap which exits with the misleading "line 60"
ERR trap right after the installer announces it is going to create the
state directory.

Rewrite the body as plain `if` blocks and return 0 explicitly. Add two
regression assertions that exercise the "only some flags set" and
"nothing to do" paths so the class of bug is caught in CI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
v2026.04.23-ec1a37d
2026-04-17 14:11:53 +08:00
26fbcf3584 Mark runnable scripts executable in git
The repo was committed from WSL with core.filemode=false, so the exec
bit was never recorded. After actions/checkout the entry script comes
down as 100644 and tests/test_cli.sh fails with Permission denied.

Set mode 100755 on every script that is invoked directly (entry,
installer, test suite, mock binaries). Sourced helpers under lib/
keep 100644 per convention.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
v2026.04.17-26fbcf3
2026-04-17 13:58:42 +08:00
e4ef47c901 Drop apt, pull shellcheck from GitHub releases
act_runner's job containers live on a temporary bridge network that
does not inherit the runner's own egress path, so apt-get against
Canonical mirrors can time out even on a US host. Remove the apt step,
rely on the tools baked into gitea/runner-images, and fetch the
shellcheck static binary over HTTPS when it is missing.

Also add a short network diagnostics step to make future egress
issues obvious at a glance.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 13:54:15 +08:00
a741fa1e16 Make toolchain install resilient to apt outages
Only install tools that are actually missing (gitea/runner-images
already ships curl/jq/tar), and point apt at mirrors.aliyun.com when
we do need to install something so archive.ubuntu.com timeouts stop
blocking the build. Handles both Noble's DEB822 ubuntu.sources and
the legacy sources.list.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 13:51:08 +08:00
0068e787fb Set GIT_DEFAULT_HASH for SHA-256 repo
The repository is initialized with the SHA-256 object format, but
actions/checkout runs `git init` in the workspace before fetching.
Without GIT_DEFAULT_HASH=sha256 that init defaults to SHA-1 and fetch
fails with `mismatched algorithms: client sha1; server sha256`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 13:35:10 +08:00
7c92c6daf4 Use ubuntu-latest runner label
Align runs-on with the standard Gitea/GitHub-compatible label so
workflows stay portable. The Main label has been replaced by
ubuntu-latest on the registered runner.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 13:31:25 +08:00
589dca3bb1 Target Gitea runner label Main
Change runs-on to the "Main" label used by Act Runner 1, and make the
toolchain install step work both as root (default in act_runner
containers) and on hosts where sudo is required.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 13:18:44 +08:00
5167278b06 Add Gitea release workflow
Introduce .gitea/workflows/release.yml driven by workflow_dispatch.
The pipeline runs shellcheck and unit tests, builds a tar.gz + sha256,
generates release notes from git history, and publishes a Gitea Release
via the API. Version defaults to v<YYYY.MM.DD>-<short-sha>.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 13:15:03 +08:00
8813cffd12 Surface runtime health in menu 2026-04-17 12:27:17 +08:00
818c52c10d Align rule table display widths 2026-04-17 12:17:00 +08:00
87ee5283c8 Fix FORWARD-drop reply handling 2026-04-17 12:10:11 +08:00
479c416b2f Protect install target and add tests 2026-04-17 11:58:18 +08:00
bd6dc0279e Add end-to-end forwarding integration test 2026-04-17 11:51:59 +08:00
af871a67a3 Simplify helpers under line cap 2026-04-17 11:33:45 +08:00
4c431584eb Harden rule health checks 2026-04-17 11:21:54 +08:00
7b854c7a96 Add interactive menu regression 2026-04-17 11:09:25 +08:00
b5ae4a5668 Harden IPv6 validation 2026-04-17 10:38:23 +08:00
014dc88a33 Sync CLI help and README 2026-04-17 10:26:27 +08:00
eb8c76492c Serialize rule writes and add tests 2026-04-17 10:21:37 +08:00
66c25b06a7 test persist rollback recovery 2026-04-17 10:05:52 +08:00
6aecbe41cc test persist reload integration 2026-04-17 10:02:15 +08:00
67a743a02b Polish CLI help behavior 2026-04-17 09:41:45 +08:00
75ecf7e624 Document installation and validate shell scripts 2026-04-17 09:39:59 +08:00
28960eee03 Implement iptables forward manager core 2026-04-17 09:36:40 +08:00
d1a5392476 Initial commit 2026-04-17 00:34:01 +00:00