Add iframely_url setting

This commit is contained in:
Kenneth Koski 2020-10-31 17:08:03 -05:00
parent fc36ae22c9
commit 3d872b03e3
No known key found for this signature in database
GPG key ID: 0B5640605A253F72
3 changed files with 4 additions and 1 deletions

View 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

View 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?;

View 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,