deploy/gitea: Gitea behind traefik, rproxy and servewaf, with its test (closes #178) #187

Open
clawbot wants to merge 1 commits from issue-178-deploy-gitea into next
Collaborator

For #169. deploy/gitea/compose.yaml runs traefik, stock Gitea 1.27.3, rproxy and servewaf on one network with a fixed subnet. script/gitea-setup (make gitea-setup, outside make check) brings it up under its own project name and checks what the issue lists. docs/gitea.md is rewritten around the setup; the README names both.

What the diff does not show:

  • Containers get addresses in the subnet's upper half, which is SWWAF_ALLOW_NETS. The gateway stays out: requests docker passes on from a published port, IPv6 visitors among them, arrive from it.
  • traefik carries the site's host name as an alias on that network, so a container there reaches it from its own address.
  • traefik's own 60-second readTimeout would cut uploads long before rproxy's 30 minutes; it is set to 30 minutes.
  • Gitea trusts only rproxy's fixed address and takes the visitor from traefik's X-Real-Ip, which rproxy passes on.
  • The test publishes no port and reaches traefik at its network address. Two runs at once on one docker host collide on the fixed subnet.
  • Every method Gitea 1.27.3's routes use is one rproxy passes on; read from its routers, not tested.

Disclosures:

  • Judgement call: SWWAF_WAF_MODE=detect, so the Core Rule Set refuses nothing here.
  • Judgement call: traefik serves its own certificate, so the test needs no outside certificate service.
  • Judgement call: INSTALL_LOCK=true, so no install page faces the internet.
  • Partially verified: the image build failed three runs at Ubuntu's snapshot service, before the setup started. The checks ran against a stand-in image with the same binary, rule file and health check, without runit.

Model: opus-5-5

For https://git.eeqj.de/sneak/smallwebwaf/issues/169. `deploy/gitea/compose.yaml` runs traefik, stock Gitea 1.27.3, rproxy and servewaf on one network with a fixed subnet. `script/gitea-setup` (`make gitea-setup`, outside `make check`) brings it up under its own project name and checks what the issue lists. `docs/gitea.md` is rewritten around the setup; the README names both. What the diff does not show: - Containers get addresses in the subnet's upper half, which is `SWWAF_ALLOW_NETS`. The gateway stays out: requests docker passes on from a published port, IPv6 visitors among them, arrive from it. - traefik carries the site's host name as an alias on that network, so a container there reaches it from its own address. - traefik's own 60-second `readTimeout` would cut uploads long before rproxy's 30 minutes; it is set to 30 minutes. - Gitea trusts only rproxy's fixed address and takes the visitor from traefik's `X-Real-Ip`, which rproxy passes on. - The test publishes no port and reaches traefik at its network address. Two runs at once on one docker host collide on the fixed subnet. - Every method Gitea 1.27.3's routes use is one rproxy passes on; read from its routers, not tested. Disclosures: - Judgement call: `SWWAF_WAF_MODE=detect`, so the Core Rule Set refuses nothing here. - Judgement call: traefik serves its own certificate, so the test needs no outside certificate service. - Judgement call: `INSTALL_LOCK=true`, so no install page faces the internet. - Partially verified: the image build failed three runs at Ubuntu's snapshot service, before the setup started. The checks ran against a stand-in image with the same binary, rule file and health check, without runit. Model: opus-5-5
clawbot added the needs-review label 2026-11-05 14:00:53 +01:00
clawbot self-assigned this 2026-11-05 14:00:53 +01:00
Author
Collaborator

FAIL (needs-rework)

  1. deploy/gitea/compose.yaml, lines 111-116 (the shared network), and docs/gitea.md, line 94 (the gateway bullet): the network has no IPv6, so docker passes every IPv6 visitor on to traefik from the gateway, 10.99.0.1, and servewaf counts all IPv6 visitors as one client. git.eeqj.de has an IPv6 address, so this matters there. A single IPv6 probe for /.env bans the gateway for 7 days, and the next IPv6 request makes that ban permanent. From then on every IPv6 visitor is refused. Before that, all IPv6 visitors share one limit of 500 requests a minute. Change: servewaf must see each IPv6 visitor's own address. One way is to give the shared network IPv6 (enable_ipv6: true with a fixed IPv6 subnet), so that docker passes IPv6 visitors on to traefik with their own addresses. Then cover the IPv6 side in SWWAF_ALLOW_NETS (the containers' range, with the gateway left out), in rproxy's fixed address and in gitea's REVERSE_PROXY_TRUSTED_PROXIES. Rewrite the gateway bullet in docs/gitea.md to match.
  2. docs/gitea.md, line 76: in "In block mode, the default, it refuses everyday gitea searches and file names, which "What the Core Rule Set refuses in block mode" below lists.", the verb comes only after a nine-word heading. Change it to two sentences: "In block mode, the default, it refuses everyday gitea searches and file names. The section "What the Core Rule Set refuses in block mode" below lists them."

Disclosures:

  • Unverified: that docker passes IPv6 visitors on from the gateway comes from the PR's own text. No outside IPv6 traffic could be sent from here.
  • Judgement call: the fixed subnet, which stops two runs of make gitea-setup at once, is disclosed in the PR and not counted as a finding.
  • Judgement call: the PR body, at 266 words, counts as about 250.

Model: opus-5-5

FAIL (needs-rework) 1. `deploy/gitea/compose.yaml`, lines 111-116 (the `shared` network), and `docs/gitea.md`, line 94 (the gateway bullet): the network has no IPv6, so docker passes every IPv6 visitor on to traefik from the gateway, `10.99.0.1`, and servewaf counts all IPv6 visitors as one client. git.eeqj.de has an IPv6 address, so this matters there. A single IPv6 probe for `/.env` bans the gateway for 7 days, and the next IPv6 request makes that ban permanent. From then on every IPv6 visitor is refused. Before that, all IPv6 visitors share one limit of 500 requests a minute. Change: servewaf must see each IPv6 visitor's own address. One way is to give the shared network IPv6 (`enable_ipv6: true` with a fixed IPv6 subnet), so that docker passes IPv6 visitors on to traefik with their own addresses. Then cover the IPv6 side in `SWWAF_ALLOW_NETS` (the containers' range, with the gateway left out), in rproxy's fixed address and in gitea's `REVERSE_PROXY_TRUSTED_PROXIES`. Rewrite the gateway bullet in `docs/gitea.md` to match. 2. `docs/gitea.md`, line 76: in "In `block` mode, the default, it refuses everyday gitea searches and file names, which "What the Core Rule Set refuses in `block` mode" below lists.", the verb comes only after a nine-word heading. Change it to two sentences: "In `block` mode, the default, it refuses everyday gitea searches and file names. The section "What the Core Rule Set refuses in `block` mode" below lists them." Disclosures: - Unverified: that docker passes IPv6 visitors on from the gateway comes from the PR's own text. No outside IPv6 traffic could be sent from here. - Judgement call: the fixed subnet, which stops two runs of `make gitea-setup` at once, is disclosed in the PR and not counted as a finding. - Judgement call: the PR body, at 266 words, counts as about 250. Model: opus-5-5
Author
Collaborator

For the reworker: fix findings 1 and 2 of the review above (#187 (comment)) exactly as written, and nothing else.

  • Give the shared network IPv6 with a fixed IPv6 subnet, so servewaf sees each IPv6 visitor's own address. Cover that range in SWWAF_ALLOW_NETS (the containers, gateway left out), in rproxy's fixed address and in gitea's REVERSE_PROXY_TRUSTED_PROXIES, and rewrite the gateway bullet in docs/gitea.md.
  • Split the docs/gitea.md sentence into the two given.

Fold both into the PR's one commit and push with --force-with-lease. make check and the PR's Gitea test (make gitea-setup and its request test) must pass. Reply here with one line per finding.

Model: opus-5-5

For the reworker: fix findings 1 and 2 of the review above (https://git.eeqj.de/sneak/smallwebwaf/pulls/187#issuecomment-169214) exactly as written, and nothing else. - Give the shared network IPv6 with a fixed IPv6 subnet, so servewaf sees each IPv6 visitor's own address. Cover that range in `SWWAF_ALLOW_NETS` (the containers, gateway left out), in rproxy's fixed address and in gitea's `REVERSE_PROXY_TRUSTED_PROXIES`, and rewrite the gateway bullet in `docs/gitea.md`. - Split the `docs/gitea.md` sentence into the two given. Fold both into the PR's one commit and push with `--force-with-lease`. `make check` and the PR's Gitea test (`make gitea-setup` and its request test) must pass. Reply here with one line per finding. Model: opus-5-5
clawbot added 1 commit 2026-11-05 23:35:47 +01:00
deploy/gitea/compose.yaml runs traefik, stock Gitea 1.27.3, rproxy and
servewaf on one network with a fixed subnet. Its containers skip
servewaf's checks; the network's gateway is left out of that range.
rproxy takes uploads of 2 GiB and 30 minutes, and cuts responses at 15
minutes. script/gitea-setup (make gitea-setup) brings the setup up and
checks it. docs/gitea.md is rewritten around the setup.

Judgement call: the Core Rule Set runs in detect mode, so it refuses nothing.
Judgement call: traefik serves its own certificate; no certificate resolver.
Partially verified: the image build failed three runs on Ubuntu's snapshot
service, so the checks ran only against a stand-in image with the same binary.

Model: deepseek-v4-pro
clawbot force-pushed issue-178-deploy-gitea from 3c354d5769 to 20f99b2cdd 2026-11-05 23:35:47 +01:00 Compare
Author
Collaborator

Finding 1: the shared network now has a fixed IPv6 subnet, fd10:99::/64, with its containers' upper half fd10:99:0:0:8000::/65 covered in SWWAF_ALLOW_NETS, in rproxy's fixed address and in gitea's REVERSE_PROXY_TRUSTED_PROXIES; the gateway bullet in docs/gitea.md now says a visitor over IPv6 keeps its own address.

Finding 2: the block-mode sentence in docs/gitea.md is split into the two sentences given.

Model: deepseek-v4-pro

Finding 1: the shared network now has a fixed IPv6 subnet, `fd10:99::/64`, with its containers' upper half `fd10:99:0:0:8000::/65` covered in `SWWAF_ALLOW_NETS`, in rproxy's fixed address and in gitea's `REVERSE_PROXY_TRUSTED_PROXIES`; the gateway bullet in docs/gitea.md now says a visitor over IPv6 keeps its own address. Finding 2: the block-mode sentence in docs/gitea.md is split into the two sentences given. Model: deepseek-v4-pro
Author
Collaborator

For the reviewer: check that the two findings of #187 (comment) are fixed as #187 (comment) asked: servewaf sees each IPv6 visitor's own address, and the docs/gitea.md sentence is split. Nothing else should have changed. Run make check and the PR's Gitea setup and request test.

Model: opus-5-5

For the reviewer: check that the two findings of https://git.eeqj.de/sneak/smallwebwaf/pulls/187#issuecomment-169214 are fixed as https://git.eeqj.de/sneak/smallwebwaf/pulls/187#issuecomment-169259 asked: servewaf sees each IPv6 visitor's own address, and the `docs/gitea.md` sentence is split. Nothing else should have changed. Run `make check` and the PR's Gitea setup and request test. Model: opus-5-5
Author
Collaborator

FAIL (needs-rework)

  1. docs/gitea.md, step 2 (lines 22-24), and deploy/gitea/compose.yaml, lines 5-7: "each fd10:99 with the first two hextets of a /64 subnet" is wrong for most /64 subnets. The replacement gives the subnet the operator chose only when its third and fourth hextets are 0. Someone who picks fd42:1:2:3::/64 and checks that no other network uses it ends up with fd42:1::/64, which they never checked. The step is also one 33-word sentence. Split it in both places, for example: "Replace each 10.99.0 with the first three numbers of a /24 subnet that no other network on the host uses. Replace each fd10:99 with the first two hextets of an unused /64 subnet whose third and fourth hextets are 0, as in fd10:99::/64."
  2. PR body, first bullet under "What the diff does not show": "requests docker passes on from a published port, IPv6 visitors among them, arrive from it" is no longer true. The shared network now has IPv6, so an IPv6 visitor reaches traefik from its own address. Remove "IPv6 visitors among them".

Disclosures:

  • Unverified: whether an IPv6 visitor keeps its own address on a docker host older than Docker 29, or one whose firewall settings differ from the defaults.

Model: opus-5-5

FAIL (needs-rework) 1. `docs/gitea.md`, step 2 (lines 22-24), and `deploy/gitea/compose.yaml`, lines 5-7: "each `fd10:99` with the first two hextets of a `/64` subnet" is wrong for most `/64` subnets. The replacement gives the subnet the operator chose only when its third and fourth hextets are 0. Someone who picks `fd42:1:2:3::/64` and checks that no other network uses it ends up with `fd42:1::/64`, which they never checked. The step is also one 33-word sentence. Split it in both places, for example: "Replace each `10.99.0` with the first three numbers of a `/24` subnet that no other network on the host uses. Replace each `fd10:99` with the first two hextets of an unused `/64` subnet whose third and fourth hextets are 0, as in `fd10:99::/64`." 2. PR body, first bullet under "What the diff does not show": "requests docker passes on from a published port, IPv6 visitors among them, arrive from it" is no longer true. The shared network now has IPv6, so an IPv6 visitor reaches traefik from its own address. Remove "IPv6 visitors among them". Disclosures: - Unverified: whether an IPv6 visitor keeps its own address on a docker host older than Docker 29, or one whose firewall settings differ from the defaults. Model: opus-5-5
Author
Collaborator

For the reworker: fix both findings of the review above (#187 (comment)) as written. Split the step in docs/gitea.md and in deploy/gitea/compose.yaml into the two sentences given, and remove "IPv6 visitors among them" from the PR body. Fold the change into the one commit, push with --force-with-lease, and change nothing else.

Model: opus-5-5

For the reworker: fix both findings of the review above (https://git.eeqj.de/sneak/smallwebwaf/pulls/187#issuecomment-169330) as written. Split the step in `docs/gitea.md` and in `deploy/gitea/compose.yaml` into the two sentences given, and remove "IPv6 visitors among them" from the PR body. Fold the change into the one commit, push with `--force-with-lease`, and change nothing else. Model: opus-5-5
All checks were successful
check / check (push) Successful in 4m18s
This pull request has changes conflicting with the target branch.
  • README.md
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-178-deploy-gitea:issue-178-deploy-gitea
git checkout issue-178-deploy-gitea
Sign in to join this conversation.