mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-12 15:34:00 +00:00
Merge pull request #1247 from knkski/iframely-url-setting
Add iframely_url setting
This commit is contained in:
commit
cca0b4c0f9
3 changed files with 4 additions and 1 deletions
|
@ -39,6 +39,8 @@
|
||||||
docs_dir: "/app/documentation"
|
docs_dir: "/app/documentation"
|
||||||
# address where pictrs is available
|
# address where pictrs is available
|
||||||
pictrs_url: "http://pictrs:8080"
|
pictrs_url: "http://pictrs:8080"
|
||||||
|
# address where iframely is available
|
||||||
|
iframely_url: "http://iframely"
|
||||||
# rate limits for various user actions, by user ip
|
# rate limits for various user actions, by user ip
|
||||||
rate_limit: {
|
rate_limit: {
|
||||||
# maximum number of messages created in interval
|
# maximum number of messages created in interval
|
||||||
|
|
|
@ -58,7 +58,7 @@ pub(crate) async fn fetch_iframely(
|
||||||
client: &Client,
|
client: &Client,
|
||||||
url: &str,
|
url: &str,
|
||||||
) -> Result<IframelyResponse, LemmyError> {
|
) -> 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?;
|
let response = retry(|| client.get(&fetch_url).send()).await?;
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ pub struct Settings {
|
||||||
pub docs_dir: PathBuf,
|
pub docs_dir: PathBuf,
|
||||||
pub jwt_secret: String,
|
pub jwt_secret: String,
|
||||||
pub pictrs_url: String,
|
pub pictrs_url: String,
|
||||||
|
pub iframely_url: String,
|
||||||
pub rate_limit: RateLimitConfig,
|
pub rate_limit: RateLimitConfig,
|
||||||
pub email: Option<EmailConfig>,
|
pub email: Option<EmailConfig>,
|
||||||
pub federation: FederationConfig,
|
pub federation: FederationConfig,
|
||||||
|
|
Loading…
Reference in a new issue