self-service matrix account portal for continuwuity + kanidm
  • Rust 91.3%
  • HTML 5.8%
  • Nix 1.9%
  • Dockerfile 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
scclie d1f8d73968
All checks were successful
deploy / deploy (push) Successful in 31s
logout, after POST redirect, csrf conflicts fix
2026-09-23 03:09:52 +03:00
.forgejo/workflows docker cargo build stage 2026-09-23 00:50:32 +03:00
img logout, after POST redirect, csrf conflicts fix 2026-09-23 03:09:52 +03:00
src logout, after POST redirect, csrf conflicts fix 2026-09-23 03:09:52 +03:00
www logout, after POST redirect, csrf conflicts fix 2026-09-23 03:09:52 +03:00
.dockerignore docker cargo build stage 2026-09-23 00:50:32 +03:00
.gitignore init 2026-09-23 00:12:59 +03:00
Cargo.lock init 2026-09-23 00:12:59 +03:00
Cargo.toml init 2026-09-23 00:12:59 +03:00
Dockerfile docker cargo build stage 2026-09-23 00:50:32 +03:00
flake.nix init 2026-09-23 00:12:59 +03:00
README.md logout, after POST redirect, csrf conflicts fix 2026-09-23 03:09:52 +03:00

macc

self-service matrix account portal. user proves who they are via oidc and creates their matrix account or resets its password. preview_passgen

why

matrix auth is stuck between msc3861 (oidc) and msc3824 (password upgrade). homeservers pick sides, clients defer. continuwuity went oidc-only, dropped sso, has no admin http api. so this is a crutch: the login side is your oidc provider (kanidm, via oauth2-proxy in front of macc), the account side is the admin room with !admin users create (continuwuity).

macc itself never speaks oidc, it only reads the proxy headers (X-Auth-Request-Preferred-Username). matrix never sees oidc either, it gets a plain password through the admin room.

how

oidc user -> oauth2-proxy -> macc(127.0.0.1) -> homeserver c-s api -> !admin users create/reset-password in #admins -> poll the room for the reply

identity comes from proxy headers, never from the client. no db, the homeserver is the state. passwords are generated by the homeserver (not user-provided), shown to the user once, and should be changed in the matrix client after first login.

run

cargo build --release   # or nix build, or the docker image from the CI

HS=http://10.0.0.19:6167 \
HS_DOMAIN=example.org \
ADMIN_TOKEN=... \
ADMIN_USER=@maccbot:example.org \
ADMIN_ROOM=#admins:example.org \
./target/release/macc

only binds 127.0.0.1. put nginx + oauth2-proxy in front, the whole auth is them:

X-Auth-Request-Preferred-Username: bob

optional env: WEB_URL (element/cinny link on the page), PORT (8787).

homeserver pre-req (once) (continuwuity)

  • !admin users create maccbot <password>, invite it to the admin room
  • !admin users issue-token maccbot <password> -> that's ADMIN_TOKEN

limitations

  • waits for the bot's reply and greps for "successfully"
  • no token issuance flow, password is enough for cinny/element
  • supports transfer-encoding: chunked responses from homeserver

license

MIT