From the architecture review, "The smaller packages", under "Adding an app's exclusions to coreruleset edits about seven places": #283 (comment). Approved for building: #283 (comment). The code was read at 809d266 on next. Line numbers are that commit's.
Most of what the review found is gone since it was written: the apps' fixes now take one %s, joined in name order, and no argument is passed by position. This issue is what is left of the proposal.
What is there
internal/coreruleset/coreruleset.go has one //go:embed variable for each app's file, nine of them (lines 164 to 189), and one entry for each in the apps map (line 195).
Seven of the nine entries hold nothing but that variable: "drupal": {directives: drupalDirectives}.
The nine .conf files sit in the package's directory beside its Go files and their tests.
The comments number sww's own changes to the Core Rule Set: "The first change", "The second", "The fifth", "The third", "The fourth", in that order in directives, and "The rest of the second change" in bodyDirectives. nextcloud.conf:41 and SPEC.md:1613 refer to "the first change".
Why it matters
Adding an app means a file, a variable and a map entry, where the file alone says everything for most apps.
A number says nothing about what a change does. The reader of "the fourth" has to find the list, and the numbers are out of order in the file they are in.
What changes
The apps' files move to one directory, embedded once with embed.FS. The sketch from the review; the names are placeholders:
//go:embed apps/*.confvarappExclusionsembed.FS
An app's name is its file's name. The nine variables go. apps keeps only what a file cannot say: an app's cookies and forkOf.
Adding an app with neither is then adding its file.
Each comment names a change by what it does, not by its number. So do the two references in nextcloud.conf and SPEC.
What stays
The directives Coraza is given are the same text in the same order: the apps' fixes joined in name order, as AppNames() gives them today.
AppNames() returns the same nine names, so SWW_WAF_APPS takes the same values.
The tests of each app stay where they are.
Done when
the apps' files are one embedded directory, and no app has a variable of its own;
no comment or document refers to one of sww's changes to the Core Rule Set by a number;
every document that gives the path of an app's file gives the new one;
behaviour is unchanged: every existing test passes with no assertion changed;
make check passes;
the PR body lists every new directory and name.
If this is more than one PR can carry, say so on this issue instead of starting.
Model: fable-5-2
From the architecture review, "The smaller packages", under "Adding an app's exclusions to `coreruleset` edits about seven places": https://git.eeqj.de/sneak/smallwebwaf/issues/283#issuecomment-173847. Approved for building: https://git.eeqj.de/sneak/smallwebwaf/issues/283#issuecomment-183550. The code was read at `809d266` on `next`. Line numbers are that commit's.
Most of what the review found is gone since it was written: the apps' fixes now take one `%s`, joined in name order, and no argument is passed by position. This issue is what is left of the proposal.
### What is there
- `internal/coreruleset/coreruleset.go` has one `//go:embed` variable for each app's file, nine of them (lines 164 to 189), and one entry for each in the `apps` map (line 195).
- Seven of the nine entries hold nothing but that variable: `"drupal": {directives: drupalDirectives}`.
- The nine `.conf` files sit in the package's directory beside its Go files and their tests.
- The comments number sww's own changes to the Core Rule Set: "The first change", "The second", "The fifth", "The third", "The fourth", in that order in `directives`, and "The rest of the second change" in `bodyDirectives`. `nextcloud.conf:41` and `SPEC.md:1613` refer to "the first change".
### Why it matters
- Adding an app means a file, a variable and a map entry, where the file alone says everything for most apps.
- A number says nothing about what a change does. The reader of "the fourth" has to find the list, and the numbers are out of order in the file they are in.
### What changes
- The apps' files move to one directory, embedded once with `embed.FS`. The sketch from the review; the names are placeholders:
```go
//go:embed apps/*.conf
var appExclusions embed.FS
```
- An app's name is its file's name. The nine variables go. `apps` keeps only what a file cannot say: an app's `cookies` and `forkOf`.
- Adding an app with neither is then adding its file.
- Each comment names a change by what it does, not by its number. So do the two references in `nextcloud.conf` and SPEC.
### What stays
- The directives Coraza is given are the same text in the same order: the apps' fixes joined in name order, as `AppNames()` gives them today.
- `AppNames()` returns the same nine names, so `SWW_WAF_APPS` takes the same values.
- The tests of each app stay where they are.
### Done when
- the apps' files are one embedded directory, and no app has a variable of its own;
- no comment or document refers to one of sww's changes to the Core Rule Set by a number;
- every document that gives the path of an app's file gives the new one;
- behaviour is unchanged: every existing test passes with no assertion changed;
- `make check` passes;
- the PR body lists every new directory and name.
If this is more than one PR can carry, say so on this issue instead of starting.
Model: fable-5-2
clawbot
self-assigned this 2026-11-19 17:12:20 +01:00
The nine app files are now internal/coreruleset/apps/*.conf, embedded once as appFixes. apps keeps only forgejo and gitea. The numbered change comments, the nextcloud.conf reference and SPEC.md now name each change by what it does, and SPEC.md gives the new paths.
Model: opus-5-5
PR: https://git.eeqj.de/sneak/smallwebwaf/pulls/452, branch `issue-430-app-fixes-directory`.
The nine app files are now `internal/coreruleset/apps/*.conf`, embedded once as `appFixes`. `apps` keeps only `forgejo` and `gitea`. The numbered change comments, the `nextcloud.conf` reference and `SPEC.md` now name each change by what it does, and `SPEC.md` gives the new paths.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
From the architecture review, "The smaller packages", under "Adding an app's exclusions to
corerulesetedits about seven places": #283 (comment). Approved for building: #283 (comment). The code was read at809d266onnext. Line numbers are that commit's.Most of what the review found is gone since it was written: the apps' fixes now take one
%s, joined in name order, and no argument is passed by position. This issue is what is left of the proposal.What is there
internal/coreruleset/coreruleset.gohas one//go:embedvariable for each app's file, nine of them (lines 164 to 189), and one entry for each in theappsmap (line 195)."drupal": {directives: drupalDirectives}..conffiles sit in the package's directory beside its Go files and their tests.directives, and "The rest of the second change" inbodyDirectives.nextcloud.conf:41andSPEC.md:1613refer to "the first change".Why it matters
What changes
embed.FS. The sketch from the review; the names are placeholders:appskeeps only what a file cannot say: an app'scookiesandforkOf.nextcloud.confand SPEC.What stays
AppNames()gives them today.AppNames()returns the same nine names, soSWW_WAF_APPStakes the same values.Done when
make checkpasses;If this is more than one PR can carry, say so on this issue instead of starting.
Model: fable-5-2
PR: #452, branch
issue-430-app-fixes-directory.The nine app files are now
internal/coreruleset/apps/*.conf, embedded once asappFixes.appskeeps onlyforgejoandgitea. The numbered change comments, thenextcloud.confreference andSPEC.mdnow name each change by what it does, andSPEC.mdgives the new paths.Model: opus-5-5