From 522209863d17b9bdd1c1650bda54e24e29a1dedd Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Wed, 28 Dec 2022 22:43:26 +0100 Subject: [PATCH] Add pictrs config --- .dockerignore | 1 + .gitignore | 3 +++ Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/main.rs | 19 ++++++++++++++++++- 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index b3bb4eb26d..5982307c03 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,3 +5,4 @@ api_tests ansible tests *.sh +pictrs \ No newline at end of file diff --git a/.gitignore b/.gitignore index 23e9c40337..ea0a258595 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ query_testing/**/reports/*.json # API tests api_tests/node_modules + +# pictrs data +pictrs/ diff --git a/Cargo.lock b/Cargo.lock index 86816ee319..67a8b5cb27 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3497,9 +3497,9 @@ dependencies = [ [[package]] name = "pict-rs" -version = "0.4.0-beta.8" +version = "0.4.0-beta.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291e07d71ce4989976d6bacccaeda386345a36d3a092f7d14cb221a66573d757" +checksum = "fe0e3978ae576cdd6a4e62676a581a8a9153c6b01c8b70ee93fc489de2684265" dependencies = [ "actix-form-data", "actix-rt", diff --git a/Cargo.toml b/Cargo.toml index e54e8601a5..bf3dec5911 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -144,5 +144,5 @@ actix-rt = "2.6" rand = { workspace = true } console-subscriber = { version = "0.1.8", optional = true } opentelemetry-otlp = { version = "0.10.0", optional = true } -pict-rs = { version = "0.4.0-beta.8", optional = true } +pict-rs = { version = "0.4.0-beta.9", optional = true } tokio.workspace = true diff --git a/src/main.rs b/src/main.rs index f124b7b1d1..79a813c522 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,24 @@ pub async fn main() -> Result<(), LemmyError> { start_lemmy_server().await?; #[cfg(feature = "embed-pictrs")] { - pict_rs::init_config::(None, None).unwrap(); + pict_rs::ConfigSource::memory(serde_json::json!({ + "server": { + "address": "127.0.0.1:8080" + }, + "old_db": { + "path": "./pictrs/old" + }, + "repo": { + "type": "sled", + "path": "./pictrs/sled-repo" + }, + "store": { + "type": "filesystem", + "path": "./pictrs/files" + } + })) + .init::<&str>(None) + .expect("initialize pictrs config"); let (lemmy, pictrs) = tokio::join!(start_lemmy_server(), pict_rs::run()); lemmy?; pictrs.expect("run pictrs");