summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderek <wwsage@gmail.com>2020-07-13 20:09:39 -0400
committerderek <wwsage@gmail.com>2020-07-13 20:09:39 -0400
commitd71897620ceea58b2d314242ea2f646a466d338e (patch)
tree8b32a1e5f3e06e7c2a6be03827730bb8fdb0679e
parente7b9ab1b3a4926d5d32ed9e87792cc9d39d4ede5 (diff)
parent52983907c4d1b7fda1182316cb631f9b5e913f5b (diff)
Merge remote-tracking branch 'LemmyNet/master'
-rw-r--r--.travis.yml3
-rw-r--r--ansible/VERSION2
-rw-r--r--docker/dev/Dockerfile7
-rw-r--r--docker/prod/Dockerfile11
-rw-r--r--docker/prod/docker-compose.yml2
-rw-r--r--docs/src/administration_configuration.md2
-rw-r--r--docs/src/contributing_tests.md4
-rw-r--r--docs/src/contributing_websocket_http_api.md1
-rwxr-xr-xinstall.sh2
-rw-r--r--server/Cargo.lock53
-rw-r--r--server/Cargo.toml19
-rwxr-xr-xserver/db-init.sh3
-rw-r--r--server/diesel.toml2
-rw-r--r--server/lemmy_db/Cargo.toml15
-rw-r--r--server/lemmy_db/src/activity.rs (renamed from server/src/db/activity.rs)50
-rw-r--r--server/lemmy_db/src/category.rs (renamed from server/src/db/category.rs)5
-rw-r--r--server/lemmy_db/src/comment.rs (renamed from server/src/db/comment.rs)21
-rw-r--r--server/lemmy_db/src/comment_view.rs (renamed from server/src/db/comment_view.rs)28
-rw-r--r--server/lemmy_db/src/community.rs (renamed from server/src/db/community.rs)8
-rw-r--r--server/lemmy_db/src/community_view.rs (renamed from server/src/db/community_view.rs)4
-rw-r--r--server/lemmy_db/src/lib.rs (renamed from server/src/db/mod.rs)38
-rw-r--r--server/lemmy_db/src/moderator.rs (renamed from server/src/db/moderator.rs)15
-rw-r--r--server/lemmy_db/src/moderator_views.rs (renamed from server/src/db/moderator_views.rs)2
-rw-r--r--server/lemmy_db/src/password_reset_request.rs (renamed from server/src/db/password_reset_request.rs)4
-rw-r--r--server/lemmy_db/src/post.rs (renamed from server/src/db/post.rs)22
-rw-r--r--server/lemmy_db/src/post_view.rs (renamed from server/src/db/post_view.rs)30
-rw-r--r--server/lemmy_db/src/private_message.rs (renamed from server/src/db/private_message.rs)28
-rw-r--r--server/lemmy_db/src/private_message_view.rs (renamed from server/src/db/private_message_view.rs)2
-rw-r--r--server/lemmy_db/src/schema.rs (renamed from server/src/schema.rs)3
-rw-r--r--server/lemmy_db/src/site.rs (renamed from server/src/db/site.rs)2
-rw-r--r--server/lemmy_db/src/site_view.rs (renamed from server/src/db/site_view.rs)0
-rw-r--r--server/lemmy_db/src/user.rs (renamed from server/src/db/user.rs)83
-rw-r--r--server/lemmy_db/src/user_mention.rs (renamed from server/src/db/user_mention.rs)15
-rw-r--r--server/lemmy_db/src/user_mention_view.rs (renamed from server/src/db/user_mention_view.rs)5
-rw-r--r--server/lemmy_db/src/user_view.rs (renamed from server/src/db/user_view.rs)7
-rw-r--r--server/lemmy_utils/Cargo.toml22
-rw-r--r--server/lemmy_utils/src/lib.rs337
-rw-r--r--server/lemmy_utils/src/settings.rs (renamed from server/src/settings.rs)42
-rw-r--r--server/migrations/2020-07-08-202609_add_creator_published/down.sql388
-rw-r--r--server/migrations/2020-07-08-202609_add_creator_published/up.sql390
-rw-r--r--server/migrations/2020-07-12-100442_add_post_title_to_comments_view/down.sql249
-rw-r--r--server/migrations/2020-07-12-100442_add_post_title_to_comments_view/up.sql254
-rw-r--r--server/src/api/claims.rs73
-rw-r--r--server/src/api/comment.rs52
-rw-r--r--server/src/api/community.rs26
-rw-r--r--server/src/api/mod.rs9
-rw-r--r--server/src/api/post.rs75
-rw-r--r--server/src/api/site.rs37
-rw-r--r--server/src/api/user.rs102
-rw-r--r--server/src/apub/activities.rs12
-rw-r--r--server/src/apub/comment.rs37
-rw-r--r--server/src/apub/community.rs126
-rw-r--r--server/src/apub/community_inbox.rs12
-rw-r--r--server/src/apub/extensions/group_extensions.rs6
-rw-r--r--server/src/apub/extensions/signatures.rs18
-rw-r--r--server/src/apub/fetcher.rs78
-rw-r--r--server/src/apub/mod.rs65
-rw-r--r--server/src/apub/post.rs32
-rw-r--r--server/src/apub/private_message.rs27
-rw-r--r--server/src/apub/shared_inbox.rs132
-rw-r--r--server/src/apub/user.rs34
-rw-r--r--server/src/apub/user_inbox.rs39
-rw-r--r--server/src/code_migrations.rs (renamed from server/src/db/code_migrations.rs)33
-rw-r--r--server/src/lib.rs331
-rw-r--r--server/src/main.rs16
-rw-r--r--server/src/rate_limit/mod.rs5
-rw-r--r--server/src/routes/federation.rs44
-rw-r--r--server/src/routes/feeds.rs31
-rw-r--r--server/src/routes/index.rs2
-rw-r--r--server/src/routes/nodeinfo.rs12
-rw-r--r--server/src/routes/webfinger.rs24
-rw-r--r--server/src/version.rs2
-rwxr-xr-xserver/test.sh5
-rw-r--r--ui/assets/css/choices.min.css1
-rw-r--r--ui/assets/css/main.css7
-rw-r--r--ui/assets/css/selectr.min.css7
-rw-r--r--ui/fuse.js8
-rw-r--r--ui/package.json6
-rw-r--r--ui/src/components/cake-day.tsx25
-rw-r--r--ui/src/components/comment-form.tsx259
-rw-r--r--ui/src/components/comment-node.tsx32
-rw-r--r--ui/src/components/communities.tsx2
-rw-r--r--ui/src/components/community.tsx2
-rw-r--r--ui/src/components/create-community.tsx7
-rw-r--r--ui/src/components/create-post.tsx7
-rw-r--r--ui/src/components/create-private-message.tsx7
-rw-r--r--ui/src/components/inbox.tsx33
-rw-r--r--ui/src/components/main.tsx12
-rw-r--r--ui/src/components/post-form.tsx85
-rw-r--r--ui/src/components/post-listing.tsx11
-rw-r--r--ui/src/components/post.tsx173
-rw-r--r--ui/src/components/search.tsx52
-rw-r--r--ui/src/components/symbols.tsx3
-rw-r--r--ui/src/components/user-listing.tsx35
-rw-r--r--ui/src/components/user.tsx57
-rw-r--r--ui/src/index.html2
-rw-r--r--ui/src/interfaces.ts8
-rw-r--r--ui/src/utils.ts40
-rw-r--r--ui/src/version.ts2
-rw-r--r--ui/translations/en.json8
-rw-r--r--ui/translations/eu.json347
-rw-r--r--ui/translations/sr_Latn.json74
-rw-r--r--ui/yarn.lock141
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>
}
}
diff --git a/install.sh b/install.sh
index fb42b26d..19b847b1 100755
--- a/install.sh
+++ b/install.sh
@@ -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