]> Untitled Git - lemmy.git/commitdiff
Rename "instance_whitelist" config option to "allowed_instances"
authorFelix Ableitner <me@nutomic.com>
Tue, 16 Jun 2020 10:49:51 +0000 (12:49 +0200)
committerFelix Ableitner <me@nutomic.com>
Tue, 16 Jun 2020 10:49:51 +0000 (12:49 +0200)
docker/federation/docker-compose.yml
docs/src/contributing_federation_development.md
server/config/defaults.hjson
server/src/apub/mod.rs
server/src/settings.rs

index 3f986a8149d1e6e67afecef07a77cbf812ab669d..4379eb386c6b3db44468cb89848e6661e4c8a84d 100644 (file)
@@ -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
index 80567e60f0def6e04f2f037612da5cfa32c6b5d1..520a61275ffb29972f80965f93bb7c15151f43ed 100644 (file)
@@ -47,7 +47,7 @@ Follow the normal installation instructions, either with [Ansible](administratio
 ```
     federation: {
         enabled: true
-        instance_whitelist: example.com
+        allowed_instances: example.com
     }
 ```
 
index 09db4c020a7151f9aa3910541b295543cdfdb8c1..61951321e0689e6a849a8f4cdbcd629a195a3eed 100644 (file)
@@ -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: {
index 93f50754fd8d6394e69174ee35a7fb85ac6f95f8..6a2d6cffb385b7a12a427fff7a9170a5c50125aa 100644 (file)
@@ -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<String> = Settings::get()
+  let allowed_instances: Vec<String> = 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,
   }
 }
index e1ac759c555fc96bd67e5883ac133f1476fec7c1..b3173457f216e1a52c014af53094a904ed2f86b4 100644 (file)
@@ -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! {