mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
require client base_url, rename from authority
The previous code used `server_name` as a fallback but in reality there is no real relationship between `server_name` and the location clients are supposed to make requests to. Additionally, the `insecure` option is gone, because we now allow users to control the entire URL, so they're free to choose the scheme.
This commit is contained in:
parent
48850605b0
commit
b9ee898920
3 changed files with 13 additions and 29 deletions
|
|
@ -7,6 +7,7 @@ use std::{
|
|||
};
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use reqwest::Url;
|
||||
use ruma::{
|
||||
api::federation::discovery::OldVerifyKey, OwnedServerName,
|
||||
OwnedServerSigningKeyId, RoomVersionId,
|
||||
|
|
@ -39,7 +40,6 @@ pub(crate) struct Config {
|
|||
/// This is the value that will appear e.g. in user IDs and room aliases.
|
||||
pub(crate) server_name: OwnedServerName,
|
||||
|
||||
#[serde(default)]
|
||||
pub(crate) server_discovery: ServerDiscovery,
|
||||
pub(crate) database: DatabaseConfig,
|
||||
#[serde(default)]
|
||||
|
|
@ -73,14 +73,13 @@ pub(crate) struct Config {
|
|||
pub(crate) emergency_password: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Deserialize)]
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub(crate) struct ServerDiscovery {
|
||||
/// Server-server discovery configuration
|
||||
#[serde(default)]
|
||||
pub(crate) server: ServerServerDiscovery,
|
||||
|
||||
/// Client-server discovery configuration
|
||||
#[serde(default)]
|
||||
pub(crate) client: ClientServerDiscovery,
|
||||
}
|
||||
|
||||
|
|
@ -92,14 +91,10 @@ pub(crate) struct ServerServerDiscovery {
|
|||
}
|
||||
|
||||
/// Client-server discovery configuration
|
||||
#[derive(Debug, Default, Deserialize)]
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub(crate) struct ClientServerDiscovery {
|
||||
/// The alternative authority to make client-server API requests to
|
||||
pub(crate) authority: Option<OwnedServerName>,
|
||||
|
||||
/// Controls whether HTTPS is used
|
||||
#[serde(default)]
|
||||
pub(crate) insecure: bool,
|
||||
/// The base URL to make client-server API requests to
|
||||
pub(crate) base_url: Url,
|
||||
|
||||
#[serde(default, rename = "advertise_buggy_sliding_sync")]
|
||||
pub(crate) advertise_sliding_sync: bool,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue