feat(gandalf): declare the not-found page in bunny.toml
All checks were successful
Test / test (push) Successful in 6s

How a site answers missing paths now belongs to its repository like its
edge rules: bunny.toml declares [site] not_found as "default", "spa" or
a page from the build such as "/404.html". The action reads and sends
the table on start and finalize; the gateway validates it before the
upload and applies it to the Storage Zone at finalization, recording
and purging only when it changed. A deployment without [site] resets
the default; older action versions leave the setting alone.

The console's Settings tab only shows the applied value, and the admin
API no longer sets it. The maintainer guide and llms.txt describe the
setting under Configuration.
This commit is contained in:
Eric Wendland 2026-10-02 23:57:33 +02:00
commit ffb46edc65
4 changed files with 72 additions and 28 deletions

View file

@ -106,7 +106,8 @@ deployed files needs the password.
Bunny Storage has no `_headers` or `_redirects` file and picks a file's
`Content-Type` from its extension. With the gateway, a site declares Bunny edge
rules in a TOML file kept in its repository, outside the build directory:
rules and site settings in a TOML file kept in its repository, outside the build
directory:
```yaml
with:
@ -179,6 +180,20 @@ Pull Zones, removes rules dropped from the file, and purges the cache when a
rule changed. A deployment through the gateway without `edge-rules` removes the
rules of earlier deployments; rules set up by other means are never touched.
### Site settings
The same file may hold a `[site]` table:
```toml
[site]
not_found = "/404.html" # or "spa", or "default" (also when left out)
```
`not_found` decides how a missing path is answered: Bunny's 404 page, a page
from the build with status 404, or the build's `/index.html` with status 200 for
single-page apps. Each deployment applies it to the Storage Zone and purges the
cache when it changed.
## Command line
The script can also be used directly with Python 3.11 or newer: