deploy a Draupnir instance for our matrix servers #12246
Labels
No labels
announcement
anubis
authentication
aws
backlog
blocked
bodhi
ci
cloud
communishift
copr
database
day-to-day
dc-move
deprecated
dev
discourse
dns
downloads
easyfix
epel
firmitas
forgejo_migration
Gain
High
Gain
Low
Gain
Medium
gitlab
greenwave
hardware
help wanted
high-trouble
koji
koschei
lists
low-trouble
medium-trouble
mirrorlists
monitoring
Needs investigation
odcs
OpenShift
ops
outage
packager_workflow_blocker
pagure
permissions
Priority
Needs Review
Priority
Next Meeting
Priority
🔥 URGENT 🔥
Priority
Waiting on Assignee
Priority
Waiting on External
Priority
Waiting on Reporter
rabbitmq
release-monitoring
releng
request-for-resources
s390x
security
SMTP
sprint-0
sprint-1
src.fp.o
staging
unfreeze
waiverdb
websites-general
wiki
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
7 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
infra/tickets#12246
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It would be nice to have a Draupnir bot for at least our popular rooms ( #fedora at least).
https://github.com/the-draupnir-project/Draupnir
IMHO, we should deploy it in the openshift cluster and use a :fedoraproject.org userid for it.
There's a few folks interested in helping out manage and wrangle it too.
Perhaps Ryan would have some cycles for this setup and onboard interested matrix admins?
CC: @farchord @ryanlerch @jflory7
Oh yeah I would love to! IF we can but not right now, I can at least get the ball rolling/bot setup on a spare box that I have.
But like I told kevin, I only have it til february.
Btw I'm thinking of also offering other fedora matrix server channels to invite the bot once we got it setup. It would be an additional tool.
So, we have a community member that has spun up an instance for us to use at least for the main fedora channel. ;)
So, this is not urgent, but I would still like us to run our own.
Metadata Update from @kevin:
Agreed. Fairly certain that the community member doesn't mind simply copying it over once we do have a tiny corner of da web ready for it.
Metadata Update from @zlopez:
Why the blocked label was removed, #12323 is till not closed.
Well, I guess we thought we should only do this after we moved the server over to an ESS one run by us, but it really doesn't need to depend on that. We can do this anytime...
Do we want to keep this issue, or track the project in #13094? There is useful data in that issue like the existing Draupnir config provided by @rorysys. I'm currently on the go right now, otherwise I'll copy over the insights and the config from that other issue later.
Yeah, I don't care which one really, we can move information from the other one or just close this one and track there.
As long as there is only one ticket and it has all the info it. ;)
I just finished a working role for draupnir: https://gitlab.com/osci/ansible-role-openshift-apps/-/tree/main/draupnir?ref_type=heads
It can be deployed like this (that's a note for future me):
(in case you wonder why Ganon is a blocked word, I called the test bot vah_naboris and the control room was named #hyrule:example.org)
Now, we have to decide where it will run.
I can either 1) copy the code to Fedora repo and have it under Fedora control (and help maintain if needed, assuming I have enough access to debug stuff)
2) keep the bot on our openshift cluster and be responsible for it.
I will have to run something on our cluster anyway, because ansible folks want a bot too, and I guess the devconf folks as well, so it wouldn't be much effort to cut and paste and run 2 or 3 instances.
In any case, I need:
Here is a copy of the current Draupnir config, as provided by @rorysys:
Copy-pasting Emma's comment on the other issue into this one, for reference:
I expect we will not be able to do this before we migrate the
fedora.imhomeserver into our own infrastructure.Thanks misc!
I'd personally really prefer we run it in our openshift, just because it will be so visible and we have a number of folks around at various times.
Is it possible for it to use both a fedora.im account and a fedoraproject.org account?
If not, we should probibly put it on fedora.im for the reason Emma said.
I'm not sure this will need to block on server migration, I would think we could do it anytime?
Technically there is nothing that prevent having multiple instance, each on a different server, so each with specific access and/or config. I do not think it would be a great idea since it make harder to operate by moderators, but if there is specific access that requires a specific account, then this could be done.
My understanding was that the
fedoraproject.orgserver was always the easy part, since it is easy for us today to make new accounts on that homeserver.But since we don't have SSH/root access on the
fedora.imhomeserver instance, this is why I assumed we would need to wait until we get thefedora.imhomeserver running in our own infrastructure in order to get thefedora.imhomeserver-level integration with Draupnir. (FWIW, we do not even have this functionality yet today, which is why thefedoraproject.orgaccount with a "normal" username and password seems feasible right now.)We have the same access to both servers. :)
The admin web interface will let you add users to both of them, but for fedora.im I'd advise just making a fas account for the bot and logging in with it and then using the access key for the bot.
True that we can't use any of the features that require a patched homeserver, but I think all the things that currently work now should work fine with a new bot.
Do we want to still rely on the rory.gay server for the management room of the bot ? I assume that if the server disappear, it will not work correctly, and it would be better to use a alias for that (as I think this can be done on matrix). I do not have the required access to do that.
I'm not sure I understand. Federated rooms are not tied to any particular server. The room will exist on all matrix servers that have users in the room. Unless you mean for finding it/index? Yes, we can add local addresses for fedora.im/fedoraproject.org there.
Of course the management room should be invite only however, it shouldn't be in the space or anything (IMHO).
Yes, my concern is that the bot will not be able to join the room if we keep '#draupnir-fedora-mgmt:rory.gay' in the config in case the rory.gay domain disappear (or if the server is shutdown for a period long enough, I assume that there is a cache somewhere and the cache is not eternal).
We could also just use the room ID, but given there is some change (eg version 12 changed the format ), and a warning on how v 12 was not supported (cf https://marewolf.me/posts/draupnir/25/do-not-upgrade-to-v12.html ), I think a alias would be safer, clearer and likely more futureproof.
yeah, aliases seem fine to me. We can add both fedora.im and fedoraproject.org ones.
So, if we want to deploy, I need a access key. I have the rest. If people can give it to me, either on matrix, or our internal chat, I will do the deployment (likely later today, or tomorrow evening). For the sack of expdency, I will do it on our cluster, but the bot can be moved later.
cc @zlopez
ok. I have created a infra-mod-bot user, logged into chat.fedoraproject.org with it and placed it's access token in ~misc/infra-mod-bot on batcave01.
We will of course have to make it a moderator in any channels its protecting.
Let me know if you need anything more...
As this is being worked on by @misc let me remove myself as assignee.
I deployed it, but the token seems to not work. I tested with
fedora.ems.hostandfedoraproject.ems.host, same error message. If I test with curl directly, I have the same error code:If I test with a access token I get from chat.fedoraproject.org on my Fedora account, it work:
If I test on
fedoraproject.ems.hostwith my token, it returnM_UNKNOWN_TOKEN.I notice the token do not have the same prefix (mat_ for the one @kevin created, and syt_ for the ones I used for testing, both on my server and on the fedora server). I followed the instructions on https://the-draupnir-project.github.io/draupnir-documentation/bot/setup_draupnir_account but I do not remember how I got the one for the bot on my server, could this be a reason ?
Bah. Apparently the change to MAS changed things around here.
(So this would have worked before we moved to MAS I think)
So, those instructions won't seem to work here. We do not have password auth enabled at all.
I found:
https://element-hq.github.io/matrix-authentication-service/topics/access-token.html
but if I run that with asking for '"urn:matrix:client:api:*"' scope, it gives me an access token, but it's another mat_ one...
Does this need a synapse admin token? thats pretty high priv... our existing bot isn't one. Only a few folks have admin api enabled.
Open to ideas on how to get a token it likes...
We can try the token given by default OAuth scope (eg,
urn:matrix:org.matrix.msc2967.client:api:*) and test how it goes. I assume themat_prefix is a opaque identifier, so that shouldn't be blocking.ok, same file, I added the token with that scope.
So it work (for how long, I do not know as I assume the token need to be renewed). However, now it crash with:
It probibly needs to be invited? I can do that... done.
Now, it goes back to
M_UNKNOWN_TOKEN(so I guess it expired). It seems the SDK used do not support renewing the token, but the bug say also that this is not needed.So either we find the right kind of token from MAS, or we have to use a separate server (or go back to irc, as I am quite sure this problem wouldn't exist :p )
Perhaps we need to ask EMS folks what we need to do here... ytalk forever! :)
Ok so after discussing with EMS folks that directed to use https://admin-beta.element.dev/, the latest code given by @kevin seems to work, but now, the bot crash with:
and also
I guess the bot also need some privileges to post on the room.
Ok, so for the record, after discussing on Matrix, the bot is now running on a separate room on my server, and I think we will change the alias and get people to join the new room.
I spoke too soon, it fail now with
Thanks to the help of folks from Element, we found the issue is due to not having device attached to the access key (documenting to our LLM overload can claim to diagnose the issue later).
new token, hopefully with device allowed...
Ok so it finally work, the last step is to create a alias on fedora.im for the room to replace the one on my server, then I will be able to update the config and merge the MR on our repo. Then move that to Fedora repo and cluster in due time.
ok, so what are the next steps here? invite people to the control room that are in the existing one, then get it added to the lists that our current bot has and then add the bot user to all the channels we want and give it perms?
Yeah, I think someone should configure the bot. I have no idea how to use it, but I moved it to the room where it was invited earlier by someone.
I can carve out some time to help with this if I can get a step-by-step guide on what to do. Obviously I know the gist but I want to make sure I get the order of operations right and that I don't miss any steps. I haven't dug into how things are done right now but I have admin rights in most Fedora rooms, so I can help roll this out gradually.
FYI, @rorysys! I think we are on the cusp of being able to take over the hosting for the moderation bot.
I think we need to come up with a migration plan?
Something like:
I might have missed something though. We will need to coordinate to avoid both bots trying to protect the same rooms at the same time and fighting each other.
do we have SOP for the bot operations ?
Also, could the moderators be added to the room?
@misc wrote in #12246 (comment):
no, just the upstream documentation. @rorysys might have something more?
@farchord wrote in #12246 (comment):
Yeah, we need to do that.
But we need to be careful adding the new bot to rooms already managed by the old bot because they can get in fights over settings acls.
Btw: Emma did say in the Fedora Matrix WG [PRIVATE]:
currently being annoyed by not having my password on hand for the IDP lol
re #12246 - good luck :)
if you need anything from me, you know where to find me
So if you have any questions, bring it in matrix it's likely we wont get an answer here :)
If I were going to suggest a list of priorities, and mind you I only have a rudimentary knowledge of Draupnir bots:
1- Migrate the bot to Fedora infra (I'd say that's probably the most important right now)
2- Make sure our bot can alter/use the same lists as the Moderation bot (With Emma's help ofc), and reuse Emma's fedora-coc list if needed
3- Get accepted in the cme-bans group and get the bot added to alter the list (If it's not already done)
4- Get the bot added to some rooms, run it in parallel with the moderation bot, make sure everything works as expected
5- (Once #4 tests are successful) Complete the migration, kick the moderation bot offline.
One thing we can't account for is how good the bot will be under duress. I did let @jflory7 know today and we had a discussion about this, but we're working on laying the groundwork to allow to add some Matrix server-level superadmins by making the Matrix WG more official and setting up some workflows in that regard. Trying to get that done asap, because when attacks happen, being reactive really bites.
This has been completed - in so far as the bot is deployed and appears to be working. We have copied the config and policy subscription, and the bot appears to be working in a test room. I've also set some reasonable resource limits in OCP too. We also had a discussion about setting the bot to PL 100 since it's on our official homeserver, and using it for room creation for v12+.
I think we can therefore close this - the Infra side work is done, now we need to work in https://forge.fedoraproject.org/matrix to get the new account added to all the rooms and promoted appropriately. Happy to work on that with you, but this ticket is done :)