Commit Graph

476 Commits

Author SHA1 Message Date
Matthew Esposito
6d97f4c8dd
Change Tokio tests - fix GHA runner (again) 2023-12-30 21:33:27 -05:00
Matthew Esposito
cd836308db
Update oauth.rs to use Android client only (fixes #8) 2023-12-30 17:32:54 -05:00
Matthew Esposito
d327ab2c95
Small changes to params generation in subreddit.rs 2023-12-30 17:10:46 -05:00
Matthew Esposito
53e8811f32
Remove all stats tracking (fixes #7) 2023-12-30 10:22:49 -05:00
Matthew Esposito
d86b77ab56
Reset test threads to 1 (should fix test issues in GHA) 2023-12-29 20:33:43 -05:00
Matthew Esposito
90a800ff44
Remove share parameters at canonical_path 2023-12-29 19:34:57 -05:00
Matthew Esposito
45d8f1bbc8
Better handle redirects with new OAuth endpoints 2023-12-29 19:28:41 -05:00
Matthew Esposito
3a4a39f577
Add config tests 2023-12-28 19:15:00 -05:00
Matthew Esposito
ce0c6eca8a
Fix obfuscated link handling 2023-12-28 18:21:07 -05:00
Matthew Esposito
878ef8e95e
Change formatting of autogenerated script 2023-12-28 17:36:45 -05:00
Matthew Esposito
0955f902f8
Fix update_oauth_resources.sh 2023-12-28 15:49:29 -05:00
Matthew Esposito
9f41af6eee
Improve spoofing - match headers more closely, pull in real versions/builds 2023-12-28 15:37:02 -05:00
Matthew Esposito
9850109326
Minor stylistic changes 2023-12-28 12:42:06 -05:00
Matthew Esposito
28f39329ad
Add package name to instance_info in order to identify redlib instances 2023-12-28 11:21:56 -05:00
Matthew Esposito
42902cc8d0
Add test for popular globalization 2023-12-28 10:40:17 -05:00
Matthew Esposito
b43ed01958
Fix /r/popular localization - set geo filter to global 2023-12-28 10:30:42 -05:00
Matthew Esposito
5e68a66e40
Accept legacy config files 2023-12-27 00:11:06 -05:00
Matthew Esposito
457b0bd57e
Accept legacy environment variables 2023-12-26 23:16:36 -05:00
Matthew Esposito
47822d8d6c
Fix clippy warning 2023-12-26 23:15:06 -05:00
Matthew Esposito
e452b8d6b5
Update oauth::choose to use new fastrand::choose_multiple 2023-12-26 20:00:36 -05:00
Matthew Esposito
c5d11f220e
Fix clippy warnings 2023-12-26 18:27:25 -05:00
Matthew Esposito
b0f985c687
Libreddit -> Redlib 2023-12-26 18:25:52 -05:00
Matthew Esposito
3e3c30d7f1
Update cookie + changes 2023-12-26 16:24:53 -05:00
Matthew Esposito
b7bf9c74be
Fix import error 2023-12-26 15:54:43 -05:00
Matthew Esposito
d76051302e
Merge remote-tracking branch 'origin/pull/738' 2023-12-26 15:51:15 -05:00
Matthew Esposito
90d1831352
Merge remote-tracking branch 'origin/pull/819' 2023-12-26 15:48:27 -05:00
Matthew Esposito
3ac2048247
Merge remote-tracking branch 'origin/pull/861' 2023-12-26 15:47:33 -05:00
Matthew Esposito
de268314f3
Fix tests 2023-12-26 15:42:41 -05:00
Matthew Esposito
0eb5e18cef
Merge remote-tracking branch 'origin/pull/536' 2023-12-26 15:20:21 -05:00
Matthew Esposito
fc4b686607
Merge remote-tracking branch 'origin/pull/746' 2023-12-26 15:18:49 -05:00
Matthew Esposito
82fdcf7443
Merge remote-tracking branch 'origin/pull/768' 2023-12-26 15:15:06 -05:00
Matthew Esposito
cc9023dc64
Merge remote-tracking branch 'origin/pull/865' 2023-12-26 15:12:36 -05:00
Matthew Esposito
f5b54197c4
Merge remote-tracking branch 'origin/pull/808' 2023-12-26 15:11:44 -05:00
Matthew Esposito
9b71822be6
Match on both http and https in format_url (414) 2023-12-26 15:11:16 -05:00
Peter Sawyer
2d64c092ea Fix short links again. Just using a split 2023-11-21 21:34:13 -08:00
hinto.janai
3e236e7ab5
client.rs: remove some String allocations 2023-10-27 09:05:22 -04:00
Peter Sawyer
469aff0689 Handle obfuscated share links 2023-10-04 09:55:33 -07:00
Ben Sherman
7a14975fb8 Remove 'Nel' and 'Report-To' response headers 2023-07-08 19:20:58 -07:00
Matthew Esposito
136aa0aa7d
Format 2023-06-09 17:32:21 -04:00
Matthew Esposito
a39bb9d502
Merge branch 'master' into reddit-stats 2023-06-09 17:31:12 -04:00
Matthew Esposito
5f562876f4
Make stats collection opt-out 2023-06-09 17:26:23 -04:00
Matthew Esposito
f7f1aa4bde
Abstract out random choosing 2023-06-08 16:27:36 -04:00
Matthew Esposito
c00beaa5d8
Improve OAuth refresh, logging 2023-06-08 14:33:54 -04:00
Matthew Esposito
49dde7ad72
Improve subreddit test 2023-06-08 14:06:58 -04:00
Matthew Esposito
0ca0eefaa4
Add tests to check fetching sub/user/oauth 2023-06-06 15:28:36 -04:00
Matthew Esposito
6cd53abd42
Documentation 2023-06-06 15:26:31 -04:00
Matthew Esposito
dc7601375e
Ignore dotenv failure 2023-06-06 15:07:11 -04:00
Matthew Esposito
659a82bf63
Improve spoofing of devices, handle token refreshes 2023-06-06 15:05:20 -04:00
Matthew Esposito
8a23616920
Stray space 2023-06-05 20:57:34 -04:00
Matthew Esposito
00355de727
Set proper headers 2023-06-05 20:39:56 -04:00
Matthew Esposito
383d2789ce
Initial PoC of spoofing Android OAuth 2023-06-05 20:31:25 -04:00
Nazar
97f0f69059
Rebase #811 (#812)
Co-authored-by: Matthew Esposito <matt@matthew.science>
2023-06-03 17:32:46 +00:00
Matthew Esposito
255307a4f7
Add request stats to instance info HTML 2023-05-31 20:02:00 -04:00
Matthew Esposito
de68409610
Add request stats to instance info page 2023-05-31 19:39:44 -04:00
Matthew Esposito
ca7ad9f812
Merge pull request #796 from StuffNoOneCaresAbout/lazy-init-regex 2023-05-01 10:09:59 -04:00
Kavin
4d5c52b83b
Rename variables to more descriptive names. 2023-05-01 05:00:49 +01:00
Kavin
6c47ea921b
performance: compile regex only once 2023-05-01 04:22:10 +01:00
Kavin
0c591149d5
Add option to disable all indexing. 2023-04-26 12:52:12 +01:00
Matthew Esposito
af8fe176ea
Fix clippy warnings 2023-04-19 10:37:47 -04:00
Matthew Esposito
4a1b448abb
Merge pull request #776 from iTzBoboCz/polls 2023-04-17 18:12:02 -04:00
Matthew Esposito
991677cd1e
Add variable for now_utc, format 2023-04-17 18:00:41 -04:00
Matthew Esposito
3b8a13d050
Merge pull request #773 from libreddit/fmt_clippy 2023-04-15 11:01:19 -04:00
Matthew Esposito
5f87875b8e
Merge branch 'master' into bypass-gate 2023-04-15 10:56:28 -04:00
Ondřej Pešek
ec226e0cab fix(polls): apply clippy suggestions 2023-04-08 10:41:12 +02:00
Ondřej Pešek
75af984154 fix(polls): apply suggestions and fix id parsing 2023-04-01 14:26:04 +02:00
Ondřej Pešek
8bed342a6d fix: print time suffix only for relative dates 2023-04-01 13:21:15 +02:00
gmnsii
de5d8d5f86 Requested code style changes 2023-03-26 11:52:02 -07:00
Matthew Esposito
f465394f93
Address fmt + clippy 2023-03-25 16:32:42 -04:00
gmnsii
1e418619f1 Feat: search for comments within posts
Add the ability to search for specific comments within posts.
Known issues:
  - Just like on reddit, this does not work with comment sorting. The
    sorting order is ignored during the search and changing the sorting
    order after the search does not change anything. I do not think we
    can fix this before reddit does, since in my understanding we rely
    on them for the sorting. However we could implement a default
    sorting method ourselves by taking the vector of comments returned
    from the search and sorting it manually.
  - The UI could be improved on mobile. On screens with a max width
    inferior to 480 pixels, the comment search bar is displayed below
    the comment sorting form. It would be great if we could make the
    search bar have the same width as the whole comment sorting form
    but I do not have the willpower to write any more css.
2023-03-24 17:41:26 -07:00
gmnsii
8be69f6fe5 Checks if the link contains the parameter instead of ends with it
To know if the gate should be bypassed, we check if the link contains
the pasameter instead of checking if the link ends with it. This is
impostant, for example if we were to implement searching for comments
within a post. If we wanted to search for comments within a post that we
have bypassed the gate to view: the link will look like
https://libreddit-instance/r/somesub/comments/post-id/post-title&bypass_nsfw_landing/?q=some-query&type=comment
2023-03-23 12:36:04 -07:00
gmnsii
e3b1c5b587 Use a bullet instead of empty margin when score is hidden
This is prettier and keeps consistency across the app.
2023-03-23 11:29:28 -07:00
gmnsii
a0726c5903 Change the bypass message and format code
The bypass message now indicates that the bypass is only temporary.
2023-03-23 11:09:33 -07:00
Ondřej Pešek
c1c867a5ff feat: add polls 2023-03-23 13:21:09 +01:00
Ondřej Pešek
5dc3279ac3 fix: make time work with future dates 2023-03-23 13:18:48 +01:00
gmnsii
e046144bf3 Allow bypassing nsfw gate for posts
On instances that are not sfw-only, the nsfw gate for posts can now be
bypassed.
2023-03-22 23:18:35 -07:00
gmnsii
df3d894947 Add option to hide score
Add the option to hide score for posts and comments in preferences.
There is still however a blank margin where the score is supposed to be.
2023-03-22 20:08:20 -07:00
Yaroslav Chvanov
741613e27f
Ignore errors while fetching subreddit names in subscriptions_filters()
If we can't retrieve subreddit name, just use the user-supplied name.
This fixes banned subreddits being impossible to to unfilter or
unsubscribe from.
A drawback of such approach is that it might be possible to subscribe to
a subreddit twice with different casing, however the chance of this is
extremely low.
2023-03-09 15:18:03 +03:00
Matthew Esposito
412ce8f1f3
Fix default subscriptions (#732)
Co-authored-by: Daniel Valentine <daniel@vielle.ws>
2023-03-08 21:53:23 -07:00
mikupls
01f9907aaf
show the count of 'more replies'. (#740)
Co-authored-by: Daniel Valentine <daniel@vielle.ws>
Co-authored-by: Matthew Esposito <matt@matthew.science>
2023-03-08 21:30:41 -07:00
mikupls
bf19ff513f
add support for gifs in galleries. (#744) 2023-03-08 21:04:26 -07:00
mikupls
ffc9ca2e98
use the documented LIBREDDIT_DEFAULT_DISABLE_VISIT_REDDIT_CONFIRMATION config option. (#737) 2023-03-04 13:04:40 -07:00
mikupls
a7f59ccac1 Display previews and inline images for reddit-hosted images.
This version does not change the svg behaviour in the other cases in an attempt to reduce breakage.
2023-03-03 13:50:05 +01:00
domve
eb07a2ce7c
Make gated subreddits accessible by treating them as quarantined (#722)
* Fix gated communities being unviewable by treating them as quarantined

* Show restriction reason in quarantine template

* Add `gated` checks for other requests
2023-02-26 00:40:32 -07:00
wsy2220
58fa213be8
Reuse hyper client. (#727)
Making a new connection on every request is very slow and wasteful, espectially on slower network.

Fix this by reuse a hyper client which shares a connection pool.

I'm able to lower /r/popular loading time from 5s to 1.5s on my machine.
2023-02-26 00:33:55 -07:00
potatoesAreGod
fa68bf561b
added leaving reddit dialog (#643) 2023-02-08 00:24:06 -07:00
Matthew Esposito
8be5fdee2d
Implement instance info endpoint (JSON, YAML, TXT) (#685)
Co-authored-by: Daniel Valentine <daniel@vielle.ws>
Co-authored-by: spikecodes <19519553+spikecodes@users.noreply.github.com>
2023-01-30 02:02:43 -07:00
Spike
bb5f2674d1
Merge branch 'master' into feature/fixed-navbar 2023-01-16 19:43:54 -08:00
potatoesAreGod
eb9ef9f6d9
added leaving reddit dialog (#643) 2023-01-12 01:46:56 -07:00
Spenser Black
2a54043afc
Simplify listener definition (#681)
This simplifies the logic to build the listener by using more clap
features instead of manually accessing the PORT environment variable.
This also removes unnecessary `unwrap_or` calls that set defaults that
are already set by clap.
2023-01-12 01:41:59 -07:00
Johannes Schleifenbaum
dff91da877
config: fix SFW test 2023-01-04 11:12:19 +01:00
Daniel Valentine
9a7b3b29f5
Merge remote-tracking branch 'origin/master' into hide_awards 2023-01-03 11:12:27 -07:00
Matthew E
5b06a3fc64
Add config system to read from file (#664)
Co-authored-by: Daniel Valentine <daniel@vielle.ws>
2023-01-03 02:55:22 -07:00
Daniel Valentine
c83a4e0cc8
Landing page for NSFW content, SFW-only mode (#656)
Co-authored-by: Matt <matt@matthew.science>
Co-authored-by: Spike <19519553+spikecodes@users.noreply.github.com>
2023-01-03 02:39:45 -07:00
Matthew Esposito
6a785baa2c Add hide_awards config 2023-01-01 21:39:38 -05:00
elliot
6cf3748642
Fix for #675
/:id route now accepts 7 character post IDs.
2023-01-01 17:06:58 -06:00
gmnsii
9e434e7db6
Search - add support for raw reddit links (#663)
* Search - add support for raw reddit links

If a search query starts with 'https://www.reddit.com/' or 'https://old.reddit.com/',
this prefix will be truncated and the query will be processed normally.
For example, a search query 'https://www.reddit.com/r/rust' will redirect to
r/rust.

* Search - support a wider variety of reddit links.

Add once cell dependency for static regex support (avoid compiling the
same regex multiple times).
All search queries are now matched against a regex (provided by @Daniel-Valentine)
that determines if it is a reddit link. If it is, the prefix specifying
the reddit instance will be truncated from the query that will then be
processed normally.
For example, the query 'https://www.reddit.com/r/rust' will be treated
the same way as the query 'r/rust'.
2022-12-31 20:57:42 -07:00
gmnsii
ab30b8bbec
Bugfix: 'all posts are hidden because NSFW' when no posts where found (#666)
* Fix 'all_posts_hidden_nsfw' when there are no posts.

If a search query yielded no results and the user set nsfw posts to be
hidden, libreddit would show 'All posts are hidden because they are NSFW.
Enable "Show NSFW posts" in settings to view'. This is fixed by
verifying tnat posts.len > 0 before setting 'all_posts_hidden_nsfw' to
true.

* Add a message when no posts were found.

* Delete 2
2022-12-31 19:11:59 -07:00
Daniel Valentine
5d518cfc18
Cache result of server::determine_compressor. 2022-12-04 17:56:02 -07:00
Daniel Valentine
e579b97442
List post duplicates (resolves #574). 2022-12-03 01:08:36 -07:00
Daniel Valentine
88bed73e5e
Extract Location URL path correctly in client::request. (fixes #645) (#646) 2022-11-21 08:58:40 -07:00