mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 23:31:24 +01:00
remove config deprecation functionality
This is a hard fork, we don't need to inherit this cruft. Really, I should've noticed and removed this closer to the beginning of our history.
This commit is contained in:
parent
9a92a8047e
commit
a6087e97e1
2 changed files with 1 additions and 33 deletions
|
|
@ -1,13 +1,11 @@
|
|||
use std::{
|
||||
collections::BTreeMap,
|
||||
fmt,
|
||||
fmt::Write,
|
||||
net::{IpAddr, Ipv4Addr},
|
||||
};
|
||||
|
||||
use ruma::{OwnedServerName, RoomVersionId};
|
||||
use serde::{de::IgnoredAny, Deserialize};
|
||||
use tracing::warn;
|
||||
use serde::Deserialize;
|
||||
|
||||
mod proxy;
|
||||
|
||||
|
|
@ -82,11 +80,6 @@ pub(crate) struct Config {
|
|||
pub(crate) turn_ttl: u64,
|
||||
|
||||
pub(crate) emergency_password: Option<String>,
|
||||
|
||||
#[serde(flatten)]
|
||||
// This has special meaning to `serde`
|
||||
#[allow(clippy::zero_sized_map_values)]
|
||||
pub(crate) catchall: BTreeMap<String, IgnoredAny>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
|
@ -95,29 +88,6 @@ pub(crate) struct TlsConfig {
|
|||
pub(crate) key: String,
|
||||
}
|
||||
|
||||
const DEPRECATED_KEYS: &[&str] = &["cache_capacity"];
|
||||
|
||||
impl Config {
|
||||
pub(crate) fn warn_deprecated(&self) {
|
||||
let mut was_deprecated = false;
|
||||
for key in self
|
||||
.catchall
|
||||
.keys()
|
||||
.filter(|key| DEPRECATED_KEYS.iter().any(|s| s == key))
|
||||
{
|
||||
warn!("Config parameter {} is deprecated", key);
|
||||
was_deprecated = true;
|
||||
}
|
||||
|
||||
if was_deprecated {
|
||||
warn!(
|
||||
"Read grapevine documentation and check your configuration if \
|
||||
any new configuration parameters should be adjusted"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Config {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
// Prepare a list of config values to show
|
||||
|
|
|
|||
|
|
@ -115,8 +115,6 @@ async fn try_main() -> Result<(), error::Main> {
|
|||
|
||||
let config = raw_config.extract::<Config>()?;
|
||||
|
||||
config.warn_deprecated();
|
||||
|
||||
let _guard = observability::init(&config);
|
||||
|
||||
// This is needed for opening lots of file descriptors, which tends to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue