- Rust 80.2%
- Nix 14.4%
- HTML 5.4%
| crates | ||
| LICENSES | ||
| migrations | ||
| nix | ||
| .envrc | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.lock.license | ||
| Cargo.toml | ||
| CHANGELOG.org | ||
| flake.lock | ||
| flake.lock.license | ||
| flake.nix | ||
| README.org | ||
KBBL
KBBL will be a Webmention implementation in Rust. It is named after the radio station in The Simpsons.
No sports, no rock, no information; for mindless chatter, we're your station!
What does it do
kbbl-cli
The kbbl-cli crate provides the kbbl command line interface. It
is a fully stateless application.
Sends web mentions
kbbl send --source https://me.example.com/mention --target https://them.example.net/mentionable
The webmention endpoint is discovered by fetching the target. If
found, a web mention is sent to that endpoint from target to
source.
Success is reflected in the exit code of the process.
Verifies web mentions
kbbl receive --source https://them.example.com/mention --target https://me.example.com/mentionable
The webmention is checked to ensure that the source does not equal
the target, and that both source and target are either http or
https URIs.
The source is then fetched and inspected for a link back to
target. Currently supported are:
a[href]img[src]video[src]audio[src]
Success is reflected in the exit code of the process.
kbbl-server
kbbl-server is a stateful, opinionated HTTP server for managing your webmentions.
SQLite storage
The server depends on a SQLite data store. Create it thusly:
cargo sqlx database setup -D sqlite:kbbl.db
To upgrade, migrations are run similarly:
cargo sqlx migrations run -D sqlite:kbbl.db
Authentication
kbbl-server supports IndieAuth. IndieAuth only authenticates. You need to specify who is allowed to administer your server. This is currently done directly against the database:
INSERT INTO admins (uri) VALUES ('https://me.example.com/');
In the debug profile, the user https://me.test is be automatically
logged in if KBBL_ENABLE_TEST_USER is set to true:
KBBL_ENABLE_TEST_USER=true cargo run -p kbbl-server
Running the server
cargo run -p kbbl-server
The server defaults to port https://localhost:21421/. You can go to
/login or /admin.
Receiving webmentions
Webmentions are received at /api/v1/webmention. To make kbbl-server
discoverable from the pages you want mentioned, add a Link header.
Assuming kbbl-server is hosted at webmention.example.com:
Link: <https://webmention.example.com/api/v1/webmention>; rel="webmention"
Alternatively, a <link> tag may be added to the <head> on your pages:
<link rel="webmention" href="https://webmention.example.com/api/v1/webmention">
Webmention states
Webmentions are stored in one of the following states:
| Abbrev | Name | Meaning | Terminal |
|---|---|---|---|
P |
Pending | Initial state. Webmention is awaiting verification. | No |
R |
Running | Automated verification is in progress. | No |
V |
Verified | Webmention source was fetched, successful, and mentions target. | No |
G |
Gone | Webmention source returned 410 Gone on verification, representing a deletion. |
Yes |
F |
Failed | Webmention source failed to mention target. | No |
E |
Error | Error fetching webmention source for validation. | No |
A |
Approved | Webmention was approved by an admin and ready to display. | Yes |
D |
Declined | Webmention was declined by an admin. | Yes |
U |
Updating | A previously approved webmention has been resubmitted but not verified. | No |
Admin
All administrative activity happens in /admin.
Pending webmentions
Each received webmention is put into the pending state. All webmentions in a non-terminal state may be approved or declined from the admin page. Approved webmentions will be made accessible for display by future endpoints. Declined webmentions are soft deleted.
Verification of the webmention is not yet performed by the server. All state changes are manual.
License
KBBL is licensed under the Mozilla Public License 2.0 (MPL-2.0).