A forked version of Xander's Maven Worker with cozy styling and discord integration via discord-hono.
maven-metadata.xmlfixing: Automatically generates and fixesmaven-metadata.xmlfiles when clients race to upload differing versions of the same artifact- Waits 5 seconds after the last upload per-artifact and then regenerates the
maven-metadata.xmlfile - Uses Durable Objects
- Waits 5 seconds after the last upload per-artifact and then regenerates the
- Web UI for browsing uploaded artifacts, at
/web/- Uses HTMX, extremely minimal and fast web UI with caching
- Optionally enforceable immutability
- Uses Cloudflare Workers Cache:
- Immutable data:
public, max-age=3600, immutable, stale-while-revalidate=31536000 - Mutable data:
public, max-age=300, stale-while-revalidate=1800 - Purges cached data on successful upload
- Immutable data:
- Autogenerates checksums for uploaded artifacts
- Ignores uploaded checksums in favor of the generated ones
- Supports Range requests and conditional requests
- Supports Basic Authentication
- Stored credentials in D1 database, hashed with SHA-256 and peppered
- Fast, lower-security hashing algorithm (SHA-256) used as passwords are expected to be high entropy and randomised, not memorable
- No permissions system; a credential has full read/write access to all repositories
- Credentials are managed via discord bot
sha256(password + pepper)
- Multiple repositories; each repository is a separate Cloudflare R2 bucket
Most configuration is done via environment variables found in "vars": in the wrangler.jsonc file.
SERVER_NAME: The name of the server, displayed in the UIREPOSITORIES: A comma-separated list of repository names to use, should match the binding of the R2 bucketCHECKSUM_VALIDATION: (true/false) Whether to validate uploaded checksums if auto-generation is disabledCHECKSUM_AUTOGENERATION: (true/false) Whether to automatically generate checksums for uploaded artifactsALLOW_OVERWRITES: (true/false) Whether to allow overwriting of existing artifactsVALIDATE_PATHS: (true/false) Applies loose path validation to requests, rejecting paths that do not match the expected Maven object path format
You also need to set the PEPPER environment secret.
- Cloudflare Workers / Durable Objects
- Cloudflare D1 for storing credentials
- Cloudflare R2 for storing artifacts
- Hono for routing
- HTMX for server-side rendering
- No build steps