diff --git a/conduwuit-example.toml b/conduwuit-example.toml index 95e7ad04..8b36afb4 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -452,7 +452,8 @@ # `yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse` # to true to allow open registration without any conditions. # -# YOU NEED TO EDIT THIS OR USE registration_token_file. +# If you do not want to set a static token, the `!admin token` commands may also be used +# to manage registration tokens. # # example: "o&^uCtes4HPf0Vu@F20jQeeWE7" # diff --git a/src/admin/admin.rs b/src/admin/admin.rs index f4b0b687..677810a7 100644 --- a/src/admin/admin.rs +++ b/src/admin/admin.rs @@ -28,7 +28,7 @@ pub enum AdminCommand { #[command(subcommand)] /// - Commands for managing registration tokens - Tokens(TokenCommand), + Token(TokenCommand), #[command(subcommand)] /// - Commands for managing rooms @@ -75,7 +75,7 @@ pub(super) async fn process(command: AdminCommand, context: &Context<'_>) -> Res context.bail_restricted()?; user::process(command, context).await }, - | Tokens(command) => { + | Token(command) => { // token commands are all restricted context.bail_restricted()?; token::process(command, context).await diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs index 7b9c043f..c0875b31 100644 --- a/src/core/config/mod.rs +++ b/src/core/config/mod.rs @@ -576,7 +576,8 @@ pub struct Config { /// `yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse` /// to true to allow open registration without any conditions. /// - /// YOU NEED TO EDIT THIS OR USE registration_token_file. + /// If you do not want to set a static token, the `!admin token` commands + /// may also be used to manage registration tokens. /// /// example: "o&^uCtes4HPf0Vu@F20jQeeWE7" /// @@ -2287,7 +2288,7 @@ pub struct DraupnirConfig { pub secret: String, } -const DEPRECATED_KEYS: &[&str; 9] = &[ +const DEPRECATED_KEYS: &[&str] = &[ "cache_capacity", "conduit_cache_capacity_modifier", "max_concurrent_requests", @@ -2297,6 +2298,7 @@ const DEPRECATED_KEYS: &[&str; 9] = &[ "well_known_support_role", "well_known_support_email", "well_known_support_mxid", + "registration_token_file", ]; impl Config {