From 7df8e7b4c63478b0cb129638b67310cb53e1573b Mon Sep 17 00:00:00 2001 From: Spike <19519553+spikecodes@users.noreply.github.com> Date: Sun, 21 Nov 2021 19:27:33 +0000 Subject: [PATCH 01/27] Tweak feature request template --- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 3770798..5d21fed 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,6 +1,6 @@ --- name: 💡 Feature request -about: Suggest an idea for this project +about: Suggest a feature for Libreddit that is not found in Reddit title: '' labels: enhancement assignees: '' From 2ef7957a66ba412fb1d51d8bd8fda0575c948bfe Mon Sep 17 00:00:00 2001 From: Spike <19519553+spikecodes@users.noreply.github.com> Date: Sun, 21 Nov 2021 19:48:48 +0000 Subject: [PATCH 02/27] Create feature parity issue template --- .github/ISSUE_TEMPLATE/feature_parity.md | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/feature_parity.md diff --git a/.github/ISSUE_TEMPLATE/feature_parity.md b/.github/ISSUE_TEMPLATE/feature_parity.md new file mode 100644 index 0000000..95bc729 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_parity.md @@ -0,0 +1,28 @@ +--- +name: ✨ Feature parity +about: Suggest implementing a feature into Libreddit that is found in Reddit.com +title: '' +labels: feature parity +assignees: '' + +--- + +## How does this feature work on Reddit? + + +## Describe the implementation into Libreddit + + +## Describe alternatives you've considered + + +## Additional context + From 768820cd4c4f8c81910b4bc35c35787d824dacd1 Mon Sep 17 00:00:00 2001 From: mikupls <93015331+mikupls@users.noreply.github.com> Date: Mon, 22 Nov 2021 00:17:52 +0100 Subject: [PATCH 03/27] Render markdown correctly in text post previews by using selftext_html. (#335) * Render markdown correctly in text post previews by using selftext_html. I was mistakenly under the impression that we somehow render markdown ourselves, but turns out we just take whatever HTML reddit gives us, and we also need to do this for text previews. Use CSS to limit the size of the previews instead of truncating in the template. Fix table CSS. * Fix post_body padding and trim post_previews Co-authored-by: spikecodes <19519553+spikecodes@users.noreply.github.com> --- src/utils.rs | 7 ++----- static/style.css | 5 +++-- templates/utils.html | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index 2c74783..0bcad3c 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -251,11 +251,8 @@ impl Post { // Determine the type of media along with the media URL let (post_type, media, gallery) = Media::parse(data).await; - // selftext is set for text posts when browsing a (sub)reddit. - // Do NOT use selftext_html, because we truncate this content - // in the template code, and using selftext_html might result - // in truncated html. - let mut body = rewrite_urls(&val(post, "selftext")); + // selftext_html is set for text posts when browsing. + let mut body = rewrite_urls(&val(post, "selftext_html")); if body == "" { body = rewrite_urls(&val(post, "body_html")) } diff --git a/static/style.css b/static/style.css index 2d3bf24..67a694d 100644 --- a/static/style.css +++ b/static/style.css @@ -838,14 +838,16 @@ a.search_subreddit:hover { .post_body { opacity: 0.9; font-weight: normal; - padding: 5px 15px; + padding: 5px 15px 5px 12px; grid-area: post_body; width: calc(100% - 30px); } +/* Used only for text post preview */ .post_preview { mask-image: linear-gradient(180deg,#000 60%,transparent); opacity: 0.8; + max-height: 250px; } .post_footer { @@ -1223,7 +1225,6 @@ input[type="submit"] { .md table { margin: 5px; - display: block; overflow-x: auto; } diff --git a/templates/utils.html b/templates/utils.html index e5ba8f8..efd591e 100644 --- a/templates/utils.html +++ b/templates/utils.html @@ -132,7 +132,7 @@
{{ post.score.0 }} Upvotes
- {{ post.body|truncate(1000) }} + {{ post.body }}
{{ post.comments.0 }} comments From 722019081148a17ab329ac4244641ad2631d50b7 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Sun, 21 Nov 2021 22:30:44 -0800 Subject: [PATCH 04/27] Link subscriptions in settings to their respective feeds --- Cargo.lock | 79 ++++++++++++++++++++--------------------- Cargo.toml | 10 +++--- static/style.css | 8 +++++ templates/settings.html | 4 ++- 4 files changed, 54 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fb5199b..5eb9bb6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -125,9 +125,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" -version = "0.19.5" +version = "0.19.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8942c8d352ae1838c9dda0b0ca2ab657696ef2232a20147cf1b30ae1a9cb4321" +checksum = "55f93d0ef3363c364d5976646a38f04cf67cfe1d4c8d160cdea02cab2c116b33" dependencies = [ "funty", "radium", @@ -236,15 +236,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" -[[package]] -name = "ct-logs" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" -dependencies = [ - "sct", -] - [[package]] name = "darling" version = "0.13.0" @@ -496,15 +487,15 @@ checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" [[package]] name = "httpdate" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.14" +version = "0.14.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b" +checksum = "436ec0091e4f20e655156a30a0df3770fe2900aa301e548e08446ec794b6953c" dependencies = [ "bytes", "futures-channel", @@ -526,19 +517,17 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.22.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" +checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" dependencies = [ - "ct-logs", - "futures-util", + "http", "hyper", "log", "rustls", "rustls-native-certs", "tokio", "tokio-rustls", - "webpki", ] [[package]] @@ -613,13 +602,13 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.107" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219" +checksum = "8521a1b57e76b1ec69af7599e75e38e7b7fad6610f037db8c79b127201b5d119" [[package]] name = "libreddit" -version = "0.17.0" +version = "0.18.0" dependencies = [ "askama", "async-recursion", @@ -877,11 +866,10 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" dependencies = [ - "base64", "log", "ring", "sct", @@ -890,16 +878,25 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +checksum = "5ca9ebdfa27d3fc180e42879037b5338ab1c040c06affd00d8338598e7800943" dependencies = [ "openssl-probe", - "rustls", + "rustls-pemfile", "schannel", "security-framework", ] +[[package]] +name = "rustls-pemfile" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +dependencies = [ + "base64", +] + [[package]] name = "ryu" version = "1.0.5" @@ -924,9 +921,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ "ring", "untrusted", @@ -992,9 +989,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e277c495ac6cd1a01a58d0a0c574568b4d1ddf14f59965c6a58b8d96400b54f3" +checksum = "063bf466a64011ac24040a49009724ee60a57da1b437617ceb32e53ad61bfb19" dependencies = [ "itoa", "ryu", @@ -1195,9 +1192,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "588b2d10a336da58d877567cd8fb8a14b463e2104910f8132cd054b4b96e29ee" +checksum = "70e992e41e0d2fb9f755b37446f20900f64446ef54874f40a60c78f021ac6144" dependencies = [ "autocfg", "bytes", @@ -1215,9 +1212,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "114383b041aa6212c579467afa0075fbbdd0718de036100bc0ba7961d8cb9095" +checksum = "c9efc1aba077437943f7515666aa2b882dfabfbfdf89c819ea75a8d6e9eaba5e" dependencies = [ "proc-macro2", "quote", @@ -1226,9 +1223,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.22.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +checksum = "4baa378e417d780beff82bf54ceb0d195193ea6a00c14e22359e7f39456b5689" dependencies = [ "rustls", "tokio", @@ -1414,9 +1411,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.21.4" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ "ring", "untrusted", diff --git a/Cargo.toml b/Cargo.toml index 549a7b0..9ea4050 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "libreddit" description = " Alternative private front-end to Reddit" license = "AGPL-3.0" repository = "https://github.com/spikecodes/libreddit" -version = "0.17.0" +version = "0.18.0" authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"] edition = "2018" @@ -16,10 +16,10 @@ regex = "1.5.4" serde = { version = "1.0.130", features = ["derive"] } cookie = "0.15.1" futures-lite = "1.12.0" -hyper = { version = "0.14.14", features = ["full"] } -hyper-rustls = "0.22.1" +hyper = { version = "0.14.15", features = ["full"] } +hyper-rustls = "0.23.0" route-recognizer = "0.3.1" -serde_json = "1.0.70" -tokio = { version = "1.13.0", features = ["full"] } +serde_json = "1.0.71" +tokio = { version = "1.14.0", features = ["full"] } time = "0.2.7" url = "2.2.2" diff --git a/static/style.css b/static/style.css index 67a694d..c0801f2 100644 --- a/static/style.css +++ b/static/style.css @@ -1145,6 +1145,10 @@ summary.comment_data { margin-top: 10px; } +.prefs > p { + font-weight: 500; +} + .prefs select { border-radius: 5px; box-shadow: var(--shadow); @@ -1173,6 +1177,10 @@ input[type="submit"] { margin-left: 30px; } +#settings_subs a { + color: var(--accent); +} + /* Markdown */ .md { diff --git a/templates/settings.html b/templates/settings.html index ee9ef86..42b1045 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -77,7 +77,9 @@

Subscribed Feeds

{% for sub in prefs.subscriptions %}
- {% if sub.starts_with("u_") -%}{{ format!("u/{}", &sub[2..]) }}{% else -%}{{ format!("r/{}", sub) }}{% endif -%} + {% let feed -%} + {% if sub.starts_with("u_") -%}{% let feed = format!("u/{}", &sub[2..]) -%}{% else -%}{% let feed = format!("r/{}", sub) -%}{% endif -%} + {{ feed }}
From 4faa9d46d670eba07389c61fca9ebb0be4fca472 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Sun, 21 Nov 2021 22:44:05 -0800 Subject: [PATCH 05/27] Fix HTTPS connector --- src/client.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.rs b/src/client.rs index aa70228..8760eff 100644 --- a/src/client.rs +++ b/src/client.rs @@ -23,7 +23,7 @@ async fn stream(url: &str, req: &Request) -> Result, String let url = Uri::from_str(url).map_err(|_| "Couldn't parse URL".to_string())?; // Prepare the HTTPS connector. - let https = hyper_rustls::HttpsConnector::with_native_roots(); + let https = hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_only().enable_http1().build(); // Build the hyper client from the HTTPS connector. let client: client::Client<_, hyper::Body> = client::Client::builder().build(https); @@ -63,7 +63,7 @@ async fn stream(url: &str, req: &Request) -> Result, String fn request(url: String, quarantine: bool) -> Boxed, String>> { // Prepare the HTTPS connector. - let https = hyper_rustls::HttpsConnector::with_native_roots(); + let https = hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build(); // Construct the hyper client from the HTTPS connector. let client: client::Client<_, hyper::Body> = client::Client::builder().build(https); From 25e641e7b37937d8e76dc472790f8935088633f2 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Sun, 21 Nov 2021 22:46:01 -0800 Subject: [PATCH 06/27] Don't run GitHub Workflow when README.md changes --- .github/workflows/rust.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6c6b6da..3878454 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,9 +2,10 @@ name: Rust on: push: - branches: [master] - pull_request: - branches: [master] + paths-ignore: + - "**.md" + branches: + - master env: CARGO_TERM_COLOR: always From 9f8d36cb00746d718ef65abadb3f376f05e27a66 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Mon, 22 Nov 2021 08:40:36 -0800 Subject: [PATCH 07/27] Prevent post previews from overflowing on Chromium --- Cargo.lock | 2 +- Cargo.toml | 2 +- static/style.css | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5eb9bb6..48b7d59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -608,7 +608,7 @@ checksum = "8521a1b57e76b1ec69af7599e75e38e7b7fad6610f037db8c79b127201b5d119" [[package]] name = "libreddit" -version = "0.18.0" +version = "0.18.1" dependencies = [ "askama", "async-recursion", diff --git a/Cargo.toml b/Cargo.toml index 9ea4050..557d7ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "libreddit" description = " Alternative private front-end to Reddit" license = "AGPL-3.0" repository = "https://github.com/spikecodes/libreddit" -version = "0.18.0" +version = "0.18.1" authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"] edition = "2018" diff --git a/static/style.css b/static/style.css index c0801f2..bd132ad 100644 --- a/static/style.css +++ b/static/style.css @@ -845,9 +845,11 @@ a.search_subreddit:hover { /* Used only for text post preview */ .post_preview { + -webkit-mask-image: linear-gradient(180deg,#000 60%,transparent);; mask-image: linear-gradient(180deg,#000 60%,transparent); opacity: 0.8; max-height: 250px; + overflow: hidden; } .post_footer { From 2878d9c799f18cab42b10e2376242009e53e2c57 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Mon, 22 Nov 2021 12:19:51 -0800 Subject: [PATCH 08/27] Shrink and widen comment scores to fit better --- static/style.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/style.css b/static/style.css index bd132ad..18babad 100644 --- a/static/style.css +++ b/static/style.css @@ -971,7 +971,8 @@ a.search_subreddit:hover { min-width: 40px; border-radius: 5px; padding: 10px 0; - font-size: 16px; + font-size: 14px; + font-weight: 600; } .comment_right { From 632b64c98bfdba7ceac23d21e17f5ab572ebeaff Mon Sep 17 00:00:00 2001 From: Spike <19519553+spikecodes@users.noreply.github.com> Date: Mon, 22 Nov 2021 20:50:12 +0000 Subject: [PATCH 09/27] Add Glitch deployment option. Closes #339 --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 136fe56..026ce96 100644 --- a/README.md +++ b/README.md @@ -209,6 +209,10 @@ In the web preview (defaults to top right), you should see your instance hosted [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/spikecodes/libreddit) +## 7) Glitch + +[![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button-v2.svg)](https://glitch.com/edit/#!/remix/libreddit) + --- # Deployment From 79bb913fa68a5df7f441c945a188beb9964ca6a8 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Mon, 22 Nov 2021 13:00:39 -0800 Subject: [PATCH 10/27] Condense free hosting options into one deployment method --- README.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 026ce96..a3f0879 100644 --- a/README.md +++ b/README.md @@ -195,22 +195,12 @@ yay -S libreddit-git If you're on Linux and none of these methods work for you, you can grab a Linux binary from [the newest release](https://github.com/spikecodes/libreddit/releases/latest). -## 5) Replit +## 5) Replit/Heroku/Glitch -**Note:** Replit is a free option but they are *not* private and will monitor server usage to prevent abuse. If you need a free and easy setup, this method may work best for you. - -1. Create a Replit account (see note above) -2. Visit [the official Repl](https://replit.com/@spikethecoder/libreddit) and fork it -3. Hit the run button to download the latest Libreddit version and start it - -In the web preview (defaults to top right), you should see your instance hosted where you can assign a [custom domain](https://docs.replit.com/repls/web-hosting#custom-domains). - -## 6) Heroku +**Note:** These are free hosting options but they are *not* private and will monitor server usage to prevent abuse. If you need a free and easy setup, this method may work best for you. +Run on Repl.it [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/spikecodes/libreddit) - -## 7) Glitch - [![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button-v2.svg)](https://glitch.com/edit/#!/remix/libreddit) --- From e181e3f57d1176e607ce0de4572f8fdbf8d2772b Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Mon, 22 Nov 2021 13:01:34 -0800 Subject: [PATCH 11/27] Improve Replit deployment method --- .replit | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .replit diff --git a/.replit b/.replit new file mode 100644 index 0000000..d365864 --- /dev/null +++ b/.replit @@ -0,0 +1,2 @@ +run = "while true; do wget -O libreddit https://github.com/spikecodes/libreddit/releases/latest/download/libreddit;chmod +x libreddit;./libreddit -H 63115200;sleep 1;done" +language = "bash" \ No newline at end of file From 923ff776bd5e88245dd8c39e55fa82594a3817cb Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Mon, 22 Nov 2021 18:07:00 -0800 Subject: [PATCH 12/27] Fix HLS + autoplay from breaking videos --- Cargo.lock | 2 +- Cargo.toml | 2 +- templates/post.html | 2 +- templates/utils.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 48b7d59..65722f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -608,7 +608,7 @@ checksum = "8521a1b57e76b1ec69af7599e75e38e7b7fad6610f037db8c79b127201b5d119" [[package]] name = "libreddit" -version = "0.18.1" +version = "0.18.2" dependencies = [ "askama", "async-recursion", diff --git a/Cargo.toml b/Cargo.toml index 557d7ec..94bc79a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "libreddit" description = " Alternative private front-end to Reddit" license = "AGPL-3.0" repository = "https://github.com/spikecodes/libreddit" -version = "0.18.1" +version = "0.18.2" authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"] edition = "2018" diff --git a/templates/post.html b/templates/post.html index d368251..60d37aa 100644 --- a/templates/post.html +++ b/templates/post.html @@ -71,7 +71,7 @@ {% else if post.post_type == "video" || post.post_type == "gif" %} {% if prefs.use_hls == "on" && !post.media.alt_url.is_empty() %} -
-
+
{% if author.flair.flair_parts.len() > 0 %} @@ -25,7 +25,11 @@ {% endfor %} {% endif %} + {% if is_filtered %} +
(Filtered content)
+ {% else %}
{{ body }}
+ {% endif %}
{% for c in replies -%}{{ c.render().unwrap() }}{%- endfor %}
diff --git a/templates/search.html b/templates/search.html index b7b99c5..0218c35 100644 --- a/templates/search.html +++ b/templates/search.html @@ -30,7 +30,8 @@ - + + {% if !is_filtered %} {% if subreddits.len() > 0 || params.typed == "sr_user" %}
{% if params.typed == "sr_user" %} @@ -41,7 +42,7 @@
{% if subreddit.icon != "" %}r/{{ subreddit.name }} icon{% endif %}

- {{ subreddit.name }} + r/{{ subreddit.name }} {{ subreddit.subscribers.0 }} Members

@@ -54,10 +55,15 @@ {% endif %}
{% endif %} - {% if params.typed != "sr_user" %} + {% endif %} + {% if all_posts_filtered %} +
(All content on this page has been filtered)
+ {% else if is_filtered %} +
(Content from r/{{ sub }} has been filtered)
+ {% else if params.typed != "sr_user" %} {% for post in posts %} {% if post.flags.nsfw && prefs.show_nsfw != "on" %} - {% else if post.title != "Comment" %} + {% else if !post.title.is_empty() %} {% call utils::post_in_list(post) %} {% else %}
diff --git a/templates/settings.html b/templates/settings.html index 2538e09..2072614 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -92,10 +92,25 @@ {% endfor %}
{% endif %} + {% if !prefs.filters.is_empty() %} +
+

Filtered Feeds

+ {% for sub in prefs.filters %} +
+ {% let feed -%} + {% if sub.starts_with("u_") -%}{% let feed = format!("u/{}", &sub[2..]) -%}{% else -%}{% let feed = format!("r/{}", sub) -%}{% endif -%} + {{ feed }} +
+ +
+
+ {% endfor %} +
+ {% endif %}

Note: settings and subscriptions are saved in browser cookies. Clearing your cookies will reset them.


-

You can restore your current settings and subscriptions after clearing your cookies using this link.

+

You can restore your current settings and subscriptions after clearing your cookies using this link.

diff --git a/templates/subreddit.html b/templates/subreddit.html index 9038440..bdbc48d 100644 --- a/templates/subreddit.html +++ b/templates/subreddit.html @@ -17,6 +17,7 @@ {% block body %}
+ {% if !is_filtered %}
@@ -45,6 +46,9 @@ {% endif %} + {% if all_posts_filtered %} +
(All content on this page has been filtered)
+ {% else %}
{% for post in posts %} {% if !(post.flags.nsfw && prefs.show_nsfw != "on") %} @@ -57,6 +61,7 @@ {% endif %}
+ {% endif %}
{% if ends.0 != "" %} @@ -68,8 +73,13 @@ {% endif %}
- {% if sub.name != "" && !sub.name.contains("+") %} + {% endif %} + {% if is_filtered || (sub.name != "" && !sub.name.contains("+")) %}
+ {% endif %} {% endif %} diff --git a/templates/user.html b/templates/user.html index bfcef08..8095d06 100644 --- a/templates/user.html +++ b/templates/user.html @@ -13,11 +13,12 @@ {% block body %}
+ {% if !is_filtered %}
- {% call utils::options(sort.0, ["hot", "new", "top"], "") %} - {% if sort.0 == "top" %}{% if sort.0 == "top" %}{% endif %}
+ {% if all_posts_filtered %} +
(All content on this page has been filtered)
+ {% else %}
{% for post in posts %} {% if post.flags.nsfw && prefs.show_nsfw != "on" %} - {% else if post.title != "Comment" %} + {% else if !post.title.is_empty() %} {% call utils::post_in_list(post) %} {% else %}
@@ -55,6 +59,7 @@ {% endif %}
+ {% endif %}
{% if ends.0 != "" %} @@ -66,7 +71,11 @@ {% endif %}
+ {% endif %}
From 99a83ea11b99663080d73101a03ecb2938c6c8c6 Mon Sep 17 00:00:00 2001 From: Spike <19519553+spikecodes@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:13:15 +0000 Subject: [PATCH 21/27] Add northboot.xyz instance --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f95f857..207c488 100644 --- a/README.md +++ b/README.md @@ -56,12 +56,14 @@ Feel free to [open an issue](https://github.com/spikecodes/libreddit/issues/new) | [libreddit.de](https://libreddit.de) | 🇩🇪 DE | | | [libreddit.pussthecat.org](https://libreddit.pussthecat.org) | 🇩🇪 DE | | | [libreddit.mutahar.rocks](https://libreddit.mutahar.rocks) | 🇫🇷 FR | | +| [libreddit.northboot.xyz](https://libreddit.northboot.xyz) | 🇩🇪 DE | | | [spjmllawtheisznfs7uryhxumin26ssv2draj7oope3ok3wuhy43eoyd.onion](http://spjmllawtheisznfs7uryhxumin26ssv2draj7oope3ok3wuhy43eoyd.onion) | 🇮🇳 IN | | | [fwhhsbrbltmrct5hshrnqlqygqvcgmnek3cnka55zj4y7nuus5muwyyd.onion](http://fwhhsbrbltmrct5hshrnqlqygqvcgmnek3cnka55zj4y7nuus5muwyyd.onion) | 🇩🇪 DE | | | [kphht2jcflojtqte4b4kyx7p2ahagv4debjj32nre67dxz7y57seqwyd.onion](http://kphht2jcflojtqte4b4kyx7p2ahagv4debjj32nre67dxz7y57seqwyd.onion) | 🇳🇱 NL | | | [inytumdgnri7xsqtvpntjevaelxtgbjqkuqhtf6txxhwbll2fwqtakqd.onion](http://inytumdgnri7xsqtvpntjevaelxtgbjqkuqhtf6txxhwbll2fwqtakqd.onion) | 🇨🇭 CH | | | [liredejj74h5xjqr2dylnl5howb2bpikfowqoveub55ru27x43357iid.onion](http://liredejj74h5xjqr2dylnl5howb2bpikfowqoveub55ru27x43357iid.onion) | 🇩🇪 DE | | | [kzhfp3nvb4qp575vy23ccbrgfocezjtl5dx66uthgrhu7nscu6rcwjyd.onion](http://kzhfp3nvb4qp575vy23ccbrgfocezjtl5dx66uthgrhu7nscu6rcwjyd.onion) | 🇺🇸 US | | +| [ecue64ybzvn6vjzl37kcsnwt4ycmbsyf74nbttyg7rkc3t3qwnj7mcyd.onion](http://ecue64ybzvn6vjzl37kcsnwt4ycmbsyf74nbttyg7rkc3t3qwnj7mcyd.onion) | 🇩🇪 DE | | A checkmark in the "Cloudflare" category here refers to the use of the reverse proxy, [Cloudflare](https://cloudflare). The checkmark will not be listed for a site which uses Cloudflare DNS but rather the proxying service which grants Cloudflare the ability to monitor traffic to the website. From 401ee2ee418aa865a6da037737fce8e28528a3d9 Mon Sep 17 00:00:00 2001 From: Spike <19519553+spikecodes@users.noreply.github.com> Date: Sat, 27 Nov 2021 22:27:39 +0000 Subject: [PATCH 22/27] Create FUNDING.yml --- .github/FUNDING.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..a765c29 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: spike +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From b63000a93fc07160d91feb7313cf608f2a58182f Mon Sep 17 00:00:00 2001 From: Spike <19519553+spikecodes@users.noreply.github.com> Date: Sat, 27 Nov 2021 22:27:47 +0000 Subject: [PATCH 23/27] Create FUNDING.yml --- FUNDING.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 FUNDING.yml diff --git a/FUNDING.yml b/FUNDING.yml new file mode 100644 index 0000000..a765c29 --- /dev/null +++ b/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: spike +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From 1a1dee36b8b9c6779ccc13f7c9b6ab5c6411281d Mon Sep 17 00:00:00 2001 From: Spike <19519553+spikecodes@users.noreply.github.com> Date: Sat, 27 Nov 2021 22:55:27 +0000 Subject: [PATCH 24/27] Update FUNDING.yml --- .github/FUNDING.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index a765c29..5346ceb 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,12 +1 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: spike -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From 67e26479ae5f441964e0096334229b83013fd6aa Mon Sep 17 00:00:00 2001 From: Spike <19519553+spikecodes@users.noreply.github.com> Date: Sat, 27 Nov 2021 22:57:56 +0000 Subject: [PATCH 25/27] Add leddit.xyz instance. Closes #344 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 207c488..c37af39 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ Feel free to [open an issue](https://github.com/spikecodes/libreddit/issues/new) | [libreddit.pussthecat.org](https://libreddit.pussthecat.org) | 🇩🇪 DE | | | [libreddit.mutahar.rocks](https://libreddit.mutahar.rocks) | 🇫🇷 FR | | | [libreddit.northboot.xyz](https://libreddit.northboot.xyz) | 🇩🇪 DE | | +| [leddit.xyz](https://www.leddit.xyz) | 🇩🇪 DE | | | [spjmllawtheisznfs7uryhxumin26ssv2draj7oope3ok3wuhy43eoyd.onion](http://spjmllawtheisznfs7uryhxumin26ssv2draj7oope3ok3wuhy43eoyd.onion) | 🇮🇳 IN | | | [fwhhsbrbltmrct5hshrnqlqygqvcgmnek3cnka55zj4y7nuus5muwyyd.onion](http://fwhhsbrbltmrct5hshrnqlqygqvcgmnek3cnka55zj4y7nuus5muwyyd.onion) | 🇩🇪 DE | | | [kphht2jcflojtqte4b4kyx7p2ahagv4debjj32nre67dxz7y57seqwyd.onion](http://kphht2jcflojtqte4b4kyx7p2ahagv4debjj32nre67dxz7y57seqwyd.onion) | 🇳🇱 NL | | From 6f29d9433772e4b941216f6481d8818b9475e0c6 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Sat, 27 Nov 2021 15:07:44 -0800 Subject: [PATCH 26/27] List Liberapay as donation method --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c37af39..c6862b0 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,13 @@ --- -**BTC:** bc1qwyxjnafpu3gypcpgs025cw9wa7ryudtecmwa6y +I appreciate any donations! Your support allows me to continue developing Libreddit. -**XMR:** 45FJrEuFPtG2o7QZz2Nps77TbHD4sPqxViwbdyV9A6ktfHiWs47UngG5zXPcLoDXAc8taeuBgeNjfeprwgeXYXhN3C9tVSR +**Liberapay:** Donate using Liberapay + +**Bitcoin:** [bc1qwyxjnafpu3gypcpgs025cw9wa7ryudtecmwa6y](bitcoin:bc1qwyxjnafpu3gypcpgs025cw9wa7ryudtecmwa6y) + +**Monero:** [45FJrEuFPtG2o7QZz2Nps77TbHD4sPqxViwbdyV9A6ktfHiWs47UngG5zXPcLoDXAc8taeuBgeNjfeprwgeXYXhN3C9tVSR](monero:45FJrEuFPtG2o7QZz2Nps77TbHD4sPqxViwbdyV9A6ktfHiWs47UngG5zXPcLoDXAc8taeuBgeNjfeprwgeXYXhN3C9tVSR) --- From 91cc140091cb6994430eb8cc307e14cb9b067302 Mon Sep 17 00:00:00 2001 From: Nick Lowery Date: Sat, 27 Nov 2021 19:49:41 -0700 Subject: [PATCH 27/27] Set sub and user descriptions to `overflow-wrap: anywhere` (#345) --- static/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/static/style.css b/static/style.css index 514b642..3b6d20b 100644 --- a/static/style.css +++ b/static/style.css @@ -365,6 +365,7 @@ aside { #user_description, #sub_description { margin: 0 15px; text-align: left; + overflow-wrap: anywhere; } #user_name, #user_description:not(:empty), #user_icon,