No description
Find a file
m 67b9bc5261
Some checks failed
Run Python Tests / test (push) Failing after 19s
/ build-docker (push) Successful in 1m57s
Reimplement my own request_registration
Fixes #1

Changes the semantics slightly since I can't set device-id on initial
access token anymore, sets it in the resulting secret rather than the spec

see: https://github.com/element-hq/synapse/issues/18678

Also the user set in the secret now has the domain embedded in it as
well.

still depend on synapse due to a kind of stupid dependency on synapse.api.errors.Codes
2025-07-14 18:10:55 -04:00
.forgejo/workflows Add tests 2025-07-08 14:26:54 -04:00
bots-crd.yaml Reimplement my own request_registration 2025-07-14 18:10:55 -04:00
deploy.yaml Set the deploy image to be the generated docker image 2025-06-30 17:48:42 -04:00
Dockerfile Store an access token as well 2025-07-10 18:12:59 -04:00
example.yaml SharedSecret -> SharedSecretRef 2025-07-07 18:13:21 -04:00
matrix_api.py Reimplement my own request_registration 2025-07-14 18:10:55 -04:00
matrixbots_operator.py Reimplement my own request_registration 2025-07-14 18:10:55 -04:00
pyproject.toml Store an access token as well 2025-07-10 18:12:59 -04:00
rbac.yaml SharedSecret -> SharedSecretRef 2025-07-07 18:13:21 -04:00
README.md Add some docs & example 2025-07-07 18:12:36 -04:00
test_matrixbots_operator.py Add tests 2025-07-08 14:26:54 -04:00

matrixbot-operator

Declaratively deploy your synapse matrix bots & keep track of their creds!

You use kubernetes, know how to use kubernetes and understand the benefits of declarative deployments? Don't run register_new_matrix_user in a pod & then forget the password / store the password in bao somewhere, just let this operator do it for you!

Deploy

oh, you want to use this. Here's a kustomization.yaml that will get you in the right direction:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: matrixbots
resources:
  - https://git.devhack.net/m/matrixbots-operator/raw/commit/master/bots-crd.yaml
  - https://git.devhack.net/m/matrixbots-operator/raw/commit/master/rbac.yaml
  - deploy.yaml

and an example deploy.yaml can be found here: deploy.yaml

prerequisites

  • a kuberenetes cluster
  • a synapse matrix server
    • an admin shared registration key for your synapse server

How to use

You can find an example resource in example.yaml, although how to share your shared secret is left to the user!

Known issues

Right now we don't really have any error handling for the hooked request_registration command, the operator might report a failure on re-creation of exisiting bots (but creds won't be overwritten!)

Also, updating existing MatrixBot resources does nothing right now and might be confusing to see/do, unsure about marking resources as unmodifiable. don't do it! Ideally, this operator would be idempotent.

Also doesn't have resource deletion hooks, doesn't derigster a bot on resource deletion. it might delete the associated credential though! since there's a lifetime association. might not be desired though, dunno.