diff options
author | derek <wwsage@gmail.com> | 2020-07-13 20:09:39 -0400 |
---|---|---|
committer | derek <wwsage@gmail.com> | 2020-07-13 20:09:39 -0400 |
commit | d71897620ceea58b2d314242ea2f646a466d338e (patch) | |
tree | 8b32a1e5f3e06e7c2a6be03827730bb8fdb0679e | |
parent | e7b9ab1b3a4926d5d32ed9e87792cc9d39d4ede5 (diff) | |
parent | 52983907c4d1b7fda1182316cb631f9b5e913f5b (diff) |
Merge remote-tracking branch 'LemmyNet/master'
103 files changed, 3388 insertions, 1742 deletions
diff --git a/.travis.yml b/.travis.yml index 602a8613..9541afaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,10 +24,11 @@ script: - cargo clippy -- -D clippy::style -D clippy::correctness -D clippy::complexity -D clippy::perf - cargo install diesel_cli --no-default-features --features postgres --force - diesel migration run - - cargo test + - cargo test --workspace env: global: - DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy + - LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy - RUST_TEST_THREADS=1 addons: diff --git a/ansible/VERSION b/ansible/VERSION index 3a952db0..e72bb64f 100644 --- a/ansible/VERSION +++ b/ansible/VERSION @@ -1 +1 @@ -v0.7.13 +v0.7.19 diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile index 82a03f3c..b86618d8 100644 --- a/docker/dev/Dockerfile +++ b/docker/dev/Dockerfile @@ -18,11 +18,12 @@ RUN sudo chown -R rust:rust . RUN USER=root cargo new server WORKDIR /app/server COPY server/Cargo.toml server/Cargo.lock ./ -RUN sudo chown -R rust:rust . +COPY server/lemmy_db ./lemmy_db +COPY server/lemmy_utils ./lemmy_utils RUN mkdir -p ./src/bin \ - && echo 'fn main() { println!("Dummy") }' > ./src/bin/main.rs + && echo 'fn main() { println!("Dummy") }' > ./src/bin/main.rs RUN cargo build -RUN rm -f ./target/x86_64-unknown-linux-musl/release/deps/lemmy_server* +RUN find target/debug -type f -name "$(echo "lemmy_server" | tr '-' '_')*" -exec touch -t 200001010000 {} + COPY server/src ./src/ COPY server/migrations ./migrations/ diff --git a/docker/prod/Dockerfile b/docker/prod/Dockerfile index 54485a37..77438740 100644 --- a/docker/prod/Dockerfile +++ b/docker/prod/Dockerfile @@ -10,14 +10,15 @@ WORKDIR /app RUN sudo chown -R rust:rust . RUN USER=root cargo new server WORKDIR /app/server -COPY --chown=rust:rust server/Cargo.toml server/Cargo.lock ./ -#RUN sudo chown -R rust:rust . +COPY server/Cargo.toml server/Cargo.lock ./ +COPY server/lemmy_db ./lemmy_db +COPY server/lemmy_utils ./lemmy_utils RUN mkdir -p ./src/bin \ && echo 'fn main() { println!("Dummy") }' > ./src/bin/main.rs RUN cargo build --release -RUN rm -f ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/deps/lemmy_server* -COPY --chown=rust:rust server/src ./src/ -COPY --chown=rust:rust server/migrations ./migrations/ +RUN find target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR -type f -name "$(echo "lemmy_server" | tr '-' '_')*" -exec touch -t 200001010000 {} + +COPY server/src ./src/ +COPY server/migrations ./migrations/ # build for release # workaround for https://github.com/rust-lang/rust/issues/62896 diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml index f05a9b38..ad00d641 100644 --- a/docker/prod/docker-compose.yml +++ b/docker/prod/docker-compose.yml @@ -12,7 +12,7 @@ services: restart: always lemmy: - image: dessalines/lemmy:v0.7.13 + image: dessalines/lemmy:v0.7.19 ports: - "127.0.0.1:8536:8536" restart: always diff --git a/docs/src/administration_configuration.md b/docs/src/administration_configuration.md index 56448de4..cc4c5689 100644 --- a/docs/src/administration_configuration.md +++ b/docs/src/administration_configuration.md @@ -5,6 +5,8 @@ The configuration is based on the file This file also contains documentation for all the available options. To override the defaults, you can copy the options you want to change into your local `config.hjson` file. +To use a different `config.hjson` location than the current directory, set the environment variable `LEMMY_CONFIG_LOCATION`. + Additionally, you can override any config files with environment variables. These have the same name as the config options, and are prefixed with `LEMMY_`. For example, you can override the `database.password` with `LEMMY_DATABASE__POOL_SIZE=10`. diff --git a/docs/src/contributing_tests.md b/docs/src/contributing_tests.md index 13e5d122..d4168e19 100644 --- a/docs/src/contributing_tests.md +++ b/docs/src/contributing_tests.md @@ -7,9 +7,7 @@ following commands in the `server` subfolder: ```bash psql -U lemmy -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public;" -export DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy -diesel migration run -RUST_TEST_THREADS=1 cargo test +./test.sh ``` ### Federation diff --git a/docs/src/contributing_websocket_http_api.md b/docs/src/contributing_websocket_http_api.md index 567f674c..6ed25b98 100644 --- a/docs/src/contributing_websocket_http_api.md +++ b/docs/src/contributing_websocket_http_api.md @@ -1149,6 +1149,7 @@ Post listing types are `All, Subscribed, Community` page: Option<i64>, limit: Option<i64>, community_id: Option<i32>, + community_name: Option<String>, auth: Option<String> } } @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e # Set the database variable to the default first. diff --git a/server/Cargo.lock b/server/Cargo.lock index 6d6364d4..d90b9679 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -1400,12 +1400,6 @@ dependencies = [ ] [[package]] -name = "htmlescape" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" - -[[package]] name = "http" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1428,9 +1422,9 @@ dependencies = [ [[package]] name = "http-signature-normalization-actix" -version = "0.4.0-alpha.0" +version = "0.4.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09afff6987c7edbed101d1cddd2185786fb0af0dd9c06b654aca73a0a763680f" +checksum = "131fc982391a6b37847888b568cbe0e9cd302f1b0015f4f6f4a50234bebd049c" dependencies = [ "actix-http", "actix-web", @@ -1573,6 +1567,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] +name = "lemmy_db" +version = "0.1.0" +dependencies = [ + "bcrypt", + "chrono", + "diesel", + "log", + "serde 1.0.114", + "serde_json", + "sha2", + "strum", + "strum_macros", +] + +[[package]] name = "lemmy_server" version = "0.0.1" dependencies = [ @@ -1589,27 +1598,23 @@ dependencies = [ "base64 0.12.3", "bcrypt", "chrono", - "comrak", - "config", "diesel", "diesel_migrations", "dotenv", "env_logger", "failure", "futures", - "htmlescape", "http", "http-signature-normalization-actix", "itertools", "jsonwebtoken", "lazy_static", - "lettre", - "lettre_email", + "lemmy_db", + "lemmy_utils", "log", "openssl", "percent-encoding", "rand 0.7.3", - "regex", "rss", "serde 1.0.114", "serde_json", @@ -1622,6 +1627,26 @@ dependencies = [ ] [[package]] +name = "lemmy_utils" +version = "0.1.0" +dependencies = [ + "chrono", + "comrak", + "config", + "itertools", + "lazy_static", + "lettre", + "lettre_email", + "log", + "openssl", + "rand 0.7.3", + "regex", + "serde 1.0.114", + "serde_json", + "url", +] + +[[package]] name = "lettre" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" diff --git a/server/Cargo.toml b/server/Cargo.toml index 8daf72c4..2aa3c139 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,14 +1,21 @@ [package] name = "lemmy_server" version = "0.0.1" -authors = ["Dessalines <tyhou13@gmx.com>"] edition = "2018" [profile.release] lto = true +[workspace] +members = [ + "lemmy_utils", + "lemmy_db" +] + [dependencies] -diesel = { version = "1.4.4", features = ["postgres","chrono","r2d2","64-column-tables","serde_json"] } +lemmy_utils = { path = "./lemmy_utils" } +lemmy_db = { path = "./lemmy_db" } +diesel = "1.4.4" diesel_migrations = "1.4.0" dotenv = "0.15.0" activitystreams = "0.6.2" @@ -31,19 +38,13 @@ rand = "0.7.3" strum = "0.18.0" strum_macros = "0.18.0" jsonwebtoken = "7.0.1" -regex = "1.3.5" lazy_static = "1.3.0" -lettre = "0.9.3" -lettre_email = "0.9.4" rss = "1.9.0" -htmlescape = "0.3.1" url = { version = "2.1.1", features = ["serde"] } -config = {v |