2.1 KiB
2.1 KiB
Maubot
A plugin-based Matrix bot system.
Warning: Maubot uses deprecated
libolm.
View the synix NixOS module on Forgejo.
References
Sops
Provide the following entries to your host's secrets.yaml:
Replace
abc123with your actual secrets as well asaliceandbobwith your actual admin user names.
maubot:
admins:
alice: abc123
bob: abc123
# ...
Config
This module only works if Matrix Synapse is running on the same machine. See the module on synix.
{
imports = [
inputs.synix.nixosModules.maubot
inputs.synix.nixosModules.matrix-synapse
];
nixpkgs.config.permittedInsecurePackages = [
"olm-3.2.16"
];
services.maubot = {
enable = true;
sops = true;
admins = [
"alice"
"bob"
];
plugins = with config.services.maubot.package.plugins; [
gitlab
reminder
];
};
services.matrix-synapse = {
enable = true;
# ...
};
}
Setup
- Create a bot:
$ register_new_matrix_user - Login as your admin user:
$ mbc login - Authenticate as bot:
$ mbc auth - Take note of the access token and device ID
- Visit
https:/EXAMPLE.TLD/_matrix/maubot - Create a client (if not already preset)
- Create an instance
Bots
GitLab
See Readme on GitHub
Create a personal access token with full API access.
!gitlab server login https://git.example.com PERSONAL_ACCESS_TOKEN
!gitlab webhook add https://git.example.com user/project
Check the webhook URL for potential errors.
Tips
Upload a profile picture to Matrix
curl -X POST "https://YOUR_HOMESERVER_URL/_matrix/media/v3/upload" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: image/png" \
--data-binary "@/path/to/your/image.png"
The respond body contains a valid avatar URL (mxc://...).