From 06a3f9c5aa442b15e994fe2d86fcf7bc531cfd34 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Tue, 20 Jun 2023 07:07:18 -0400 Subject: [PATCH] make embedded pict-rs port configurable (#3201) --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 79a813c5..039db532 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,9 +8,17 @@ pub async fn main() -> Result<(), LemmyError> { start_lemmy_server().await?; #[cfg(feature = "embed-pictrs")] { + let pictrs_port = &SETTINGS + .pictrs_config() + .unwrap_or_default() + .url + .port() + .unwrap_or(8080); + let pictrs_address = ["127.0.0.1", &pictrs_port.to_string()].join(":"); + println!("pictrs_address = {}", pictrs_address); pict_rs::ConfigSource::memory(serde_json::json!({ "server": { - "address": "127.0.0.1:8080" + "address": pictrs_address }, "old_db": { "path": "./pictrs/old" -- 2.44.1