diff --git a/docker/federation/docker-compose.yml b/docker/federation/docker-compose.yml index 3f986a8149d..4379eb386c6 100644 --- a/docker/federation/docker-compose.yml +++ b/docker/federation/docker-compose.yml @@ -29,7 +29,7 @@ services: - LEMMY_FRONT_END_DIR=/app/dist - LEMMY_FEDERATION__ENABLED=true - LEMMY_FEDERATION__TLS_ENABLED=false - - LEMMY_FEDERATION__INSTANCE_WHITELIST=lemmy_beta,lemmy_gamma + - LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy_beta,lemmy_gamma - LEMMY_PORT=8540 - LEMMY_SETUP__ADMIN_USERNAME=lemmy_alpha - LEMMY_SETUP__ADMIN_PASSWORD=lemmy @@ -63,7 +63,7 @@ services: - LEMMY_FRONT_END_DIR=/app/dist - LEMMY_FEDERATION__ENABLED=true - LEMMY_FEDERATION__TLS_ENABLED=false - - LEMMY_FEDERATION__INSTANCE_WHITELIST=lemmy_alpha,lemmy_gamma + - LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy_alpha,lemmy_gamma - LEMMY_PORT=8550 - LEMMY_SETUP__ADMIN_USERNAME=lemmy_beta - LEMMY_SETUP__ADMIN_PASSWORD=lemmy @@ -97,7 +97,7 @@ services: - LEMMY_FRONT_END_DIR=/app/dist - LEMMY_FEDERATION__ENABLED=true - LEMMY_FEDERATION__TLS_ENABLED=false - - LEMMY_FEDERATION__INSTANCE_WHITELIST=lemmy_alpha,lemmy_beta + - LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy_alpha,lemmy_beta - LEMMY_PORT=8560 - LEMMY_SETUP__ADMIN_USERNAME=lemmy_gamma - LEMMY_SETUP__ADMIN_PASSWORD=lemmy diff --git a/docs/src/contributing_federation_development.md b/docs/src/contributing_federation_development.md index 80567e60f0d..520a61275ff 100644 --- a/docs/src/contributing_federation_development.md +++ b/docs/src/contributing_federation_development.md @@ -47,7 +47,7 @@ Follow the normal installation instructions, either with [Ansible](administratio ``` federation: { enabled: true - instance_whitelist: example.com + allowed_instances: example.com } ``` diff --git a/server/config/defaults.hjson b/server/config/defaults.hjson index 09db4c020a7..61951321e06 100644 --- a/server/config/defaults.hjson +++ b/server/config/defaults.hjson @@ -57,7 +57,7 @@ # whether tls is required for activitypub. only disable this for debugging, never for producion. tls_enabled: true # comma seperated list of instances with which federation is allowed - instance_whitelist: "" + allowed_instances: "" } # # email sending configuration # email: { diff --git a/server/src/apub/mod.rs b/server/src/apub/mod.rs index 93f50754fd8..6a2d6cffb38 100644 --- a/server/src/apub/mod.rs +++ b/server/src/apub/mod.rs @@ -99,20 +99,20 @@ pub fn get_apub_protocol_string() -> &'static str { } } -// Checks if the ID has a valid format, correct scheme, and is in the whitelist. +// Checks if the ID has a valid format, correct scheme, and is in the allowed instance list. fn is_apub_id_valid(apub_id: &Url) -> bool { if apub_id.scheme() != get_apub_protocol_string() { return false; } - let whitelist: Vec = Settings::get() + let allowed_instances: Vec = Settings::get() .federation - .instance_whitelist + .allowed_instances .split(',') .map(|d| d.to_string()) .collect(); match apub_id.domain() { - Some(d) => whitelist.contains(&d.to_owned()), + Some(d) => allowed_instances.contains(&d.to_owned()), None => false, } } diff --git a/server/src/settings.rs b/server/src/settings.rs index e1ac759c555..b3173457f21 100644 --- a/server/src/settings.rs +++ b/server/src/settings.rs @@ -61,7 +61,7 @@ pub struct Database { pub struct Federation { pub enabled: bool, pub tls_enabled: bool, - pub instance_whitelist: String, + pub allowed_instances: String, } lazy_static! {