mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
serve well-known client and server config
This way users can have a simpler time configuring this stuff and we can worry about the spec compliance parts and specifying the same thing over and over parts.
This commit is contained in:
parent
3a55684623
commit
806cc0cb28
4 changed files with 99 additions and 1 deletions
|
|
@ -30,7 +30,13 @@ pub(crate) struct Config {
|
|||
pub(crate) listen: Vec<ListenConfig>,
|
||||
pub(crate) tls: Option<TlsConfig>,
|
||||
|
||||
/// The name of this homeserver
|
||||
///
|
||||
/// 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)]
|
||||
pub(crate) federation: FederationConfig,
|
||||
|
|
@ -63,6 +69,35 @@ pub(crate) struct Config {
|
|||
pub(crate) emergency_password: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, 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,
|
||||
}
|
||||
|
||||
/// Server-server discovery configuration
|
||||
#[derive(Debug, Default, Deserialize)]
|
||||
pub(crate) struct ServerServerDiscovery {
|
||||
/// The alternative authority to make server-server API requests to
|
||||
pub(crate) authority: Option<OwnedServerName>,
|
||||
}
|
||||
|
||||
/// Client-server discovery configuration
|
||||
#[derive(Debug, Default, 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,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub(crate) struct TlsConfig {
|
||||
pub(crate) certs: String,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue