make embedded pict-rs port configurable (#3201)

pull/3215/head
Joel Beckmeyer 2023-06-20 07:07:18 -04:00 committed by GitHub
parent 981c111567
commit 06a3f9c5aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

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