feat(!1246): Config defined admin list #1253
No reviewers
Labels
No labels
Blocked
Bug
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
To-Merge
Wont fix
old/ci/cd
old/rust
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity!1253
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Terryiscool160/continuwuity:terry/admin-config"
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?
i have done testing to ensure that both the .well-known support endpoint & admin commands work with the new configuration values. however, i have not yet ensured that users joining the admin room after startup are marked as admins without requiring a restart
Closes: #1246
Pull request checklist:
mainbranch, and the branch is named something other thanmain.myself, if applicable. This includes ensuring code compiles.
5f08680cb9b9d338f8eb@ -86,3 +75,1 @@matrix_id: Some(user_id.to_owned()),});}for user_id in admin_users.iter() {The admin bot ought to count as an admin pretty much everywhere but here, because it can be logged into using the emergency password
@ -22,0 +23,4 @@// that status independently of their presence admin room if notif !self.user_is_admin(user_id).await {let mut admin_list = self.admin_list.write().await;admin_list.insert(user_id.to_owned());this might kind of give a false sense of security, given it gets wiped on restart
just wondering - should i basically just make a warning alerting the user that it isnt persistent if they're added here?
If joining them to the room fails, is the issue - this will make them admin for a bit but not persistently
basically what should happen is it shouldn't try add to the admin list at first here. If it succeds, they're ad amin already successfully. If it fails, then they're not an admin
If you really want to make sure it succeeds anyway, you can add a thing that happends if it fails to join the admin room that adds it to the config list and warns that the user may no longer be admin if the config is reloaded or the server restarts
@ -177,2 +184,4 @@use MembershipState::{Invite, Join, Knock, Leave};if self.user_is_admin(user_id).await {let mut admin_list = self.admin_list.write().await;same here - it should warn if the user is in the config admin list
@ -115,6 +118,7 @@ impl crate::Service for Service {let mut signals = self.services.server.signal.subscribe();let receiver = self.channel.1.clone();self.setup_admins().await;this needs to be called on reload if you're doing it this way i think.
@ -352,0 +356,4 @@/// Creates the list of admins for this server. First loads/// the admin_list from the configuration, then adds users from/// the admin room if applicable.pub async fn setup_admins(&self) {Rather than writing to the state, only to have it overwritten, this should be calculate_admins, return the list of admins and then be called directly by the two functions below it. Alternatively merge it with the get admins function, because it might be doing the exact same thing.
@ -179,0 +186,4 @@.contains(&user_id.to_owned()){warn!("Revoking the admin status of {user_id} will not be persistent as they are within \will not work* with the most recent change haha
Yay! will merge tommorow with that last message fixed. Thank you!
WIP: feat(!1246): Config defined admin listto feat(!1246): Config defined admin listad46df0531442f887c98