- Rust 76.4%
- Just 16.6%
- Dockerfile 7%
|
All checks were successful
Build and push image / build (push) Successful in 1m27s
Reviewed-on: #3 |
||
|---|---|---|
| .forgejo/workflows | ||
| src | ||
| .dockerignore | ||
| .gitignore | ||
| anz.db | ||
| audit.log | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Dockerfile | ||
| justfile | ||
| README.md | ||
| rust-toolchain.toml | ||
lots-of-names-service
An HTTP service that serves reproducible, safe-for-work names for arbitrary
text input. A thin web layer over the
lots-of-names crate.
Deployed at https://names.navicore.tech (TLS terminated upstream — this
service speaks plain HTTP).
API
GET /v2/name/{text}
The current API. {text} is any url-encoded string. The response is JSON:
$ curl https://names.navicore.tech/v2/name/Edward%20John%20Sweeney
{"text":"Edward John Sweeney","name":"Sanjose Aldridge","version":"v2"}
The input is just text, not an identifier — names are not guaranteed
unique. At v2 collisions occur roughly once per ~10,000 inputs.
Any other path returns a JSON 404 whose hint field points back at /v2/.
GET /healthz
Liveness/readiness probe. Returns 200 ok.
Versioning
The /v2/ prefix is the current API and is bound to a frozen major version of
the lots-of-names crate. The same input always returns the same name under
that prefix.
There are no plans to change the algorithm. If it ever does change, a new
prefix (/v3/, …) would be added alongside /v2/ rather than replacing it:
the service depends on each frozen version simultaneously via aliased
dependencies in Cargo.toml (lots-of-names-v1, lots-of-names-v2, …), and
each /vN/ route calls its own pinned version. Older /vN/ prefixes remain
routed for existing callers.
Configuration
| Env var | Default | Meaning |
|---|---|---|
PORT |
8080 |
TCP port to bind; the service listens on 0.0.0.0:$PORT. |
RUST_LOG |
info |
Tracing filter (e.g. debug, tower_http=debug). |
No TLS — run it behind TLS-terminating infrastructure.
Development
The justfile is the single source of truth for build/test/lint;
Forgejo CI runs just ci and nothing else.
just ci # fmt-check + clippy (warnings=errors) + test + release build
just run # run locally on http://localhost:8080
just test # run the test suite
Container image
just docker-build # builds git.navicore.tech/navicore/lots-of-names-rs-service:latest
just docker-run # runs it on http://localhost:8080
just docker-run 9000 # ...or map to host port 9000
Publishing the image
Pushing a vX.Y.Z tag triggers
.forgejo/workflows/release.yml, which builds
and pushes the image to the Forgejo registry as both :X.Y.Z and :latest:
git tag v0.1.0
git push origin v0.1.0
Two repository secrets are required (Settings → Actions → Secrets):
REGISTRY_USER— Forgejo user with push access to the package registry.REGISTRY_TOKEN— that user's access token, used fordocker login git.navicore.tech.
License
MIT © Ed Sweeney