From 38702088799e05101cd38913a345f9999f23d91e Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 24 Sep 2020 12:53:02 +0200 Subject: [PATCH] Adjust dockerfiles, fix cargo.toml and remove unused deps --- Cargo.lock | 16 ---------------- Cargo.toml | 16 ---------------- docker/dev/Dockerfile | 9 +++++++++ docker/prod/Dockerfile | 3 +++ lemmy_api/Cargo.toml | 4 ++++ lemmy_apub/Cargo.toml | 4 ++++ lemmy_utils/Cargo.toml | 2 -- lemmy_websocket/Cargo.toml | 4 ++++ src/lib.rs | 2 +- 9 files changed, 25 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57eb7ebd2..fe119382e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1926,26 +1926,16 @@ version = "0.0.1" dependencies = [ "actix", "actix-files", - "actix-rt", "actix-web", "actix-web-actors", "anyhow", - "async-trait", "awc", - "background-jobs", - "base64 0.12.3", - "bcrypt", - "captcha", "cargo-husky", "chrono", "diesel", "diesel_migrations", "env_logger", - "futures", - "http", "http-signature-normalization-actix", - "itertools", - "jsonwebtoken", "lazy_static", "lemmy_api", "lemmy_apub", @@ -1956,19 +1946,13 @@ dependencies = [ "lemmy_websocket", "log", "openssl", - "percent-encoding", - "rand 0.7.3", "reqwest", "rss", "serde 1.0.116", - "serde_json", "sha2", "strum", - "strum_macros", - "thiserror", "tokio", "url", - "uuid 0.8.1", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index abbfc01f9..d8980157e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,40 +27,24 @@ lemmy_rate_limit = { path = "./lemmy_rate_limit" } lemmy_websocket = { path = "./lemmy_websocket" } diesel = "1.4" diesel_migrations = "1.4" -bcrypt = "0.8" chrono = { version = "0.4", features = ["serde"] } -serde_json = { version = "1.0", features = ["preserve_order"]} serde = { version = "1.0", features = ["derive"] } actix = "0.10" actix-web = { version = "3.0", default-features = false, features = ["rustls"] } actix-files = { version = "0.3", default-features = false } actix-web-actors = { version = "3.0", default-features = false } -actix-rt = { version = "1.1", default-features = false } awc = { version = "2.0", default-features = false } log = "0.4" env_logger = "0.7" -rand = "0.7" strum = "0.19" -strum_macros = "0.19" -jsonwebtoken = "7.0" lazy_static = "1.3" rss = "1.9" url = { version = "2.1", features = ["serde"] } -percent-encoding = "2.1" openssl = "0.10" -http = "0.2" http-signature-normalization-actix = { version = "0.4", default-features = false, features = ["sha-2"] } -base64 = "0.12" tokio = "0.2" -futures = "0.3" -itertools = "0.9" -uuid = { version = "0.8", features = ["serde", "v4"] } sha2 = "0.9" -async-trait = "0.1" -captcha = "0.0" anyhow = "1.0" -thiserror = "1.0" -background-jobs = " 0.8" reqwest = { version = "0.10", features = ["json"] } [dev-dependencies.cargo-husky] diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile index 17e58fda4..a4341f3d0 100644 --- a/docker/dev/Dockerfile +++ b/docker/dev/Dockerfile @@ -12,6 +12,9 @@ RUN mkdir -p lemmy_db/src/ \ lemmy_utils/src/ \ lemmy_structs/src/ \ lemmy_rate_limit/src/ \ + lemmy_api/src/ \ + lemmy_apub/src/ \ + lemmy_websocket/src/ \ lemmy # Copy the cargo tomls @@ -20,6 +23,9 @@ COPY lemmy_db/Cargo.toml ./lemmy_db/ COPY lemmy_utils/Cargo.toml ./lemmy_utils/ COPY lemmy_structs/Cargo.toml ./lemmy_structs/ COPY lemmy_rate_limit/Cargo.toml ./lemmy_rate_limit/ +COPY lemmy_api/Cargo.toml ./lemmy_api/ +COPY lemmy_apub/Cargo.toml ./lemmy_apub/ +COPY lemmy_websocket/Cargo.toml ./lemmy_websocket/ # Cache the deps RUN cargo build-deps @@ -30,6 +36,9 @@ COPY lemmy_db/src ./lemmy_db/src/ COPY lemmy_utils/src/ ./lemmy_utils/src/ COPY lemmy_structs/src/ ./lemmy_structs/src/ COPY lemmy_rate_limit/src/ ./lemmy_rate_limit/src/ +COPY lemmy_api/src/ ./lemmy_api/src/ +COPY lemmy_apub/src/ ./lemmy_apub/src/ +COPY lemmy_websocket/src/ ./lemmy_websocket/src/ COPY migrations ./migrations/ # Build for debug diff --git a/docker/prod/Dockerfile b/docker/prod/Dockerfile index 20e910a42..137adc462 100644 --- a/docker/prod/Dockerfile +++ b/docker/prod/Dockerfile @@ -15,6 +15,9 @@ COPY lemmy_db ./lemmy_db COPY lemmy_utils ./lemmy_utils COPY lemmy_structs ./lemmy_structs COPY lemmy_rate_limit ./lemmy_rate_limit +COPY lemmy_api ./lemmy_api +COPY lemmy_apub ./lemmy_apub +COPY lemmy_websocket ./lemmy_websocket RUN mkdir -p ./src/bin \ && echo 'fn main() { println!("Dummy") }' > ./src/bin/main.rs RUN cargo build --release diff --git a/lemmy_api/Cargo.toml b/lemmy_api/Cargo.toml index c75abe091..b302854f1 100644 --- a/lemmy_api/Cargo.toml +++ b/lemmy_api/Cargo.toml @@ -4,6 +4,10 @@ version = "0.1.0" authors = ["Felix Ableitner "] edition = "2018" +[lib] +name = "lemmy_api" +path = "src/lib.rs" + [dependencies] lemmy_apub = { path = "../lemmy_apub" } lemmy_utils = { path = "../lemmy_utils" } diff --git a/lemmy_apub/Cargo.toml b/lemmy_apub/Cargo.toml index 5e05b1c97..66dbbe4f1 100644 --- a/lemmy_apub/Cargo.toml +++ b/lemmy_apub/Cargo.toml @@ -4,6 +4,10 @@ version = "0.1.0" authors = ["Felix Ableitner "] edition = "2018" +[lib] +name = "lemmy_apub" +path = "src/lib.rs" + [dependencies] lemmy_utils = { path = "../lemmy_utils" } lemmy_db = { path = "../lemmy_db" } diff --git a/lemmy_utils/Cargo.toml b/lemmy_utils/Cargo.toml index 50150470e..a575bb18a 100644 --- a/lemmy_utils/Cargo.toml +++ b/lemmy_utils/Cargo.toml @@ -7,8 +7,6 @@ edition = "2018" name = "lemmy_utils" path = "src/lib.rs" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] regex = "1.3" config = { version = "0.10", default-features = false, features = ["hjson"] } diff --git a/lemmy_websocket/Cargo.toml b/lemmy_websocket/Cargo.toml index d4490dc60..c61da426f 100644 --- a/lemmy_websocket/Cargo.toml +++ b/lemmy_websocket/Cargo.toml @@ -4,6 +4,10 @@ version = "0.1.0" authors = ["Felix Ableitner "] edition = "2018" +[lib] +name = "lemmy_websocket" +path = "src/lib.rs" + [dependencies] lemmy_utils = { path = "../lemmy_utils" } lemmy_structs = { path = "../lemmy_structs" } diff --git a/src/lib.rs b/src/lib.rs index 43c331a6d..7e5754d46 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ #![recursion_limit = "512"] pub mod code_migrations; -pub mod routes; \ No newline at end of file +pub mod routes;