smolboid/daemon
randogoth 0e6687e944 feat: allow a host in the feed path, behind a separate slug guard
A remote author's feed needs a namespaced path or two servers' `alice` collide
on one file. valid_slug accepts `local`, `local@host` and `local@host:port`;
local authors keep their bare path, so the published feed keeps its URL and
nothing migrates.

valid_username is untouched and is now only the nick rule: a nick reaches
`# nick =` metadata that other twtxt clients parse, so widening it with the
path rule would have leaked `@` and `:` in there. A test pins the two apart.

The traversal guard changes character here. A path could not contain a dot
before, which is why `/twtxt/../etc/passwd` 404'd for free; dots are legal now,
so the rejections are explicit and path() also asserts the join stayed inside
the feed directory. username_of rejects `/` before decoding and decodes only a
literal `%40`, since some twtxt clients encode the `@`.

Incidentally fixes a legal smolmail user never being able to get a feed: the
old rule banned `.` and `_`, so `admit alice.b@smol.place` failed at create.
2026-10-14 19:01:41 +03:00
..
locales/en-US refactor: reject mail with a reason identifier, not a sentence 2026-10-14 18:57:57 +03:00
src feat: allow a host in the feed path, behind a separate slug guard 2026-10-14 19:01:41 +03:00
Cargo.toml refactor: move author-facing mail copy into a Fluent catalogue 2026-10-14 18:48:31 +03:00