Skip to main content

tuwunel_admin/federation/
mod.rs

1mod disable_room;
2mod enable_room;
3mod fetch_support_well_known;
4mod incoming_federation;
5mod remote_user_in_rooms;
6
7use clap::Subcommand;
8use ruma::{OwnedRoomId, OwnedServerName, OwnedUserId};
9use tuwunel_core::Result;
10
11use crate::admin_command_dispatch;
12
13#[admin_command_dispatch]
14#[derive(Debug, Subcommand)]
15pub(super) enum FederationCommand {
16	/// - List incoming events walking back to missing prev events, then other
17	///   rooms busy with federation.
18	///
19	/// An event is listed while the server fetches or processes the earlier
20	/// events it is missing. The second list names the rooms where another
21	/// federation step, such as a transaction, a join or a backfill, holds the
22	/// room's federation lock, and shows no event or time. A room with a listed
23	/// event is left out of the second list.
24	IncomingFederation,
25
26	/// - Disables incoming federation handling for a room.
27	///
28	/// The room's `m.federate` property is unaffected; it is fixed at room
29	/// creation.
30	DisableRoom {
31		room_id: OwnedRoomId,
32	},
33
34	/// - Enables incoming federation handling for a room again.
35	///
36	/// The room's `m.federate` property is unaffected; it is fixed at room
37	/// creation.
38	EnableRoom {
39		room_id: OwnedRoomId,
40	},
41
42	/// - Fetch `/.well-known/matrix/support` from the specified server
43	///
44	/// Despite the name, this is not a federation endpoint and does not go
45	/// through the federation / server resolution process as per-spec this is
46	/// supposed to be served at the server_name.
47	///
48	/// Respecting homeservers put this file here for listing administration,
49	/// moderation, and security inquiries. This command provides a way to
50	/// easily fetch that information.
51	FetchSupportWellKnown {
52		server_name: OwnedServerName,
53	},
54
55	/// - Lists all the rooms we share/track with the specified *remote* user
56	RemoteUserInRooms {
57		user_id: OwnedUserId,
58	},
59}