mirror of
https://github.com/LemmyNet/lemmy
synced 2024-11-10 06:54:12 +00:00
Removing embedded pict-rs. (#5023)
Some reasons for removing this: - Even as an optional dependency, it locks us to many specific versions of rust deps. - Pict-rs is a large app that can and should be run in on its own. - Violates the philosophy of separation of concerns.
This commit is contained in:
parent
987e3f8026
commit
ff939e04fd
3 changed files with 46 additions and 1088 deletions
1103
Cargo.lock
generated
1103
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -36,7 +36,6 @@ opt-level = "z" # Optimize for size.
|
|||
debug = 0
|
||||
|
||||
[features]
|
||||
embed-pictrs = ["pict-rs"]
|
||||
json-log = ["tracing-subscriber/json"]
|
||||
default = []
|
||||
|
||||
|
@ -182,7 +181,6 @@ reqwest-middleware = { workspace = true }
|
|||
reqwest-tracing = { workspace = true }
|
||||
clokwerk = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
pict-rs = { version = "0.5.16", optional = true }
|
||||
rustls = { workspace = true }
|
||||
tokio.workspace = true
|
||||
actix-cors = "0.7.0"
|
||||
|
|
29
src/main.rs
29
src/main.rs
|
@ -19,35 +19,6 @@ pub async fn main() -> LemmyResult<()> {
|
|||
.install_default()
|
||||
.expect("Failed to install rustls crypto provider");
|
||||
|
||||
#[cfg(not(feature = "embed-pictrs"))]
|
||||
start_lemmy_server(args).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(":");
|
||||
let pictrs_config = pict_rs::ConfigSource::memory(serde_json::json!({
|
||||
"server": {
|
||||
"address": pictrs_address
|
||||
},
|
||||
"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(args), pictrs_config.run_on_localset());
|
||||
lemmy?;
|
||||
pictrs.expect("run pictrs");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue