]> Untitled Git - lemmy.git/commitdiff
make embedded pict-rs port configurable (#3201)
authorJoel Beckmeyer <joel@beckmeyer.us>
Tue, 20 Jun 2023 11:07:18 +0000 (07:07 -0400)
committerGitHub <noreply@github.com>
Tue, 20 Jun 2023 11:07:18 +0000 (13:07 +0200)
src/main.rs

index 79a813c522ac9449dbba719ba5ceb6f31641fbff..039db5320ebe70d4b398a50caabc47308e79dd73 100644 (file)
@@ -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"