]> Untitled Git - lemmy.git/commitdiff
Add iframely_url setting
authorKenneth Koski <kenneth.koski@canonical.com>
Sat, 31 Oct 2020 22:08:03 +0000 (17:08 -0500)
committerKenneth Koski <kenneth.koski@canonical.com>
Sat, 31 Oct 2020 22:08:03 +0000 (17:08 -0500)
config/defaults.hjson
lemmy_utils/src/request.rs
lemmy_utils/src/settings.rs

index 0368500b534381df405cc6fd318813b694701cac..42222550273a1aceec2b28d1d78df93e6e422f2c 100644 (file)
@@ -37,6 +37,8 @@
   jwt_secret: "changeme"
   # address where pictrs is available
   pictrs_url: "http://pictrs:8080"
+  # address where iframely is available
+  iframely_url: "http://iframely"
   # rate limits for various user actions, by user ip
   rate_limit: {
     # maximum number of messages created in interval
index cbd778c6ea8065d0da103dd3e3e72af07d641e33..6b282c47a05e2309b69516a28bfe79b2fa93d678 100644 (file)
@@ -58,7 +58,7 @@ pub(crate) async fn fetch_iframely(
   client: &Client,
   url: &str,
 ) -> Result<IframelyResponse, LemmyError> {
-  let fetch_url = format!("http://iframely/oembed?url={}", url);
+  let fetch_url = format!("{}/oembed?url={}", Settings::get().iframely_url, url);
 
   let response = retry(|| client.get(&fetch_url).send()).await?;
 
index 797c6fba1116c744b10f445f66096d8bb9b80e1f..3add60b39ab72d21dc68212b3360829bdc7fc2af 100644 (file)
@@ -15,6 +15,7 @@ pub struct Settings {
   pub tls_enabled: bool,
   pub jwt_secret: String,
   pub pictrs_url: String,
+  pub iframely_url: String,
   pub rate_limit: RateLimitConfig,
   pub email: Option<EmailConfig>,
   pub federation: FederationConfig,