Libreddit - An alternative private front-end to Reddit

Overview

Libreddit

An alternative private front-end to Reddit

screenshot


10 second pitch: Libreddit is a portmanteau of "libre" (meaning freedom) and "Reddit". It is a private front-end like Invidious but for Reddit. Browse the coldest takes of r/unpopularopinion without being tracked.

  • ๐Ÿš€ Fast: written in Rust for blazing fast speeds and memory safety
  • โ˜๏ธ Light: no JavaScript, no ads, no tracking, no bloat
  • ๐Ÿ•ต Private: all requests are proxied through the server, including media
  • ๐Ÿ”’ Secure: strong Content Security Policy prevents browser requests to Reddit

BTC: bc1qwyxjnafpu3gypcpgs025cw9wa7ryudtecmwa6y

XMR: 45FJrEuFPtG2o7QZz2Nps77TbHD4sPqxViwbdyV9A6ktfHiWs47UngG5zXPcLoDXAc8taeuBgeNjfeprwgeXYXhN3C9tVSR


Instances

Feel free to open an issue to have your selfhosted instance listed here!

Website Country Cloudflare
libredd.it (official) ๐Ÿ‡บ๐Ÿ‡ธ US
libreddit.spike.codes (official) ๐Ÿ‡บ๐Ÿ‡ธ US
libreddit.dothq.co ๐Ÿ‡บ๐Ÿ‡ธ US
libreddit.kavin.rocks ๐Ÿ‡ฎ๐Ÿ‡ณ IN โœ…
libreddit.bcow.xyz ๐Ÿ‡บ๐Ÿ‡ธ US
libreddit.40two.app ๐Ÿ‡ณ๐Ÿ‡ฑ NL
reddit.invak.id ๐Ÿ‡ง๐Ÿ‡ฌ BG
reddit.phii.me ๐Ÿ‡บ๐Ÿ‡ธ US
lr.riverside.rocks ๐Ÿ‡บ๐Ÿ‡ธ US
libreddit.silkky.cloud ๐Ÿ‡ซ๐Ÿ‡ฎ FI
libreddit.database.red ๐Ÿ‡บ๐Ÿ‡ธ US โœ…
libreddit.exonip.de ๐Ÿ‡ฉ๐Ÿ‡ช DE
libreddit.domain.glass ๐Ÿ‡บ๐Ÿ‡ธ US โœ…
libreddit.sugoma.tk ๐Ÿ‡บ๐Ÿ‡ธ US
libreddit.trevorthalacker.com ๐Ÿ‡บ๐Ÿ‡ธ US โœ…
reddit.artemislena.eu ๐Ÿ‡ฉ๐Ÿ‡ช DE
r.nf ๐Ÿ‡ฉ๐Ÿ‡ช DE โœ…
libreddit.awesomehub.io ๐Ÿ‡ซ๐Ÿ‡ฎ FI
libreddit.some-things.org ๐Ÿ‡จ๐Ÿ‡ญ CH
reddit.stuehieyr.com ๐Ÿ‡ฉ๐Ÿ‡ช DE
lr.mint.lgbt ๐Ÿ‡จ๐Ÿ‡ฆ CA
spjmllawtheisznfs7uryhxumin26ssv2draj7oope3ok3wuhy43eoyd.onion ๐Ÿ‡ฎ๐Ÿ‡ณ IN
fwhhsbrbltmrct5hshrnqlqygqvcgmnek3cnka55zj4y7nuus5muwyyd.onion ๐Ÿ‡ฉ๐Ÿ‡ช DE
dflv6yjt7il3n3tggf4qhcmkzbti2ppytqx3o7pjrzwgntutpewscyid.onion ๐Ÿ‡บ๐Ÿ‡ธ US
kphht2jcflojtqte4b4kyx7p2ahagv4debjj32nre67dxz7y57seqwyd.onion ๐Ÿ‡ณ๐Ÿ‡ฑ NL
inytumdgnri7xsqtvpntjevaelxtgbjqkuqhtf6txxhwbll2fwqtakqd.onion ๐Ÿ‡จ๐Ÿ‡ญ CH

A checkmark in the "Cloudflare" category here refers to the use of the reverse proxy, 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.


About

Find Libreddit on ๐Ÿ’ฌ Matrix, ๐Ÿ‹ Docker, :octocat: GitHub, and ๐ŸฆŠ GitLab.

Built with

  • Rust - Programming language
  • Hyper - HTTP server and client
  • Askama - Templating engine
  • Rustls - TLS library

Info

Libreddit hopes to provide an easier way to browse Reddit, without the ads, trackers, and bloat. Libreddit was inspired by other alternative front-ends to popular services such as Invidious for YouTube, Nitter for Twitter, and Bibliogram for Instagram.

Libreddit currently implements most of Reddit's (signed-out) functionalities but still lacks a few features.

How does it compare to Teddit?

Teddit is another awesome open source project designed to provide an alternative frontend to Reddit. There is no connection between the two and you're welcome to use whichever one you favor. Competition fosters innovation and Teddit's release has motivated me to build Libreddit into an even more polished product.

If you are looking to compare, the biggest differences I have noticed are:

  • Libreddit is themed around Reddit's redesign whereas Teddit appears to stick much closer to Reddit's old design. This may suit some users better as design is always subjective.
  • Libreddit is written in Rust for speed and memory safety. It uses Hyper, a speedy and lightweight HTTP server/client implementation.

Comparison

This section outlines how Libreddit compares to Reddit.

Speed

Lasted tested Jan 17, 2021.

Results from Google Lighthouse (Libreddit Report, Reddit Report).

Libreddit Reddit
Requests 20 70
Resource Size (card ui) 1,224 KiB 1,690 KiB
Time to Interactive 1.5 s 11.2 s

Privacy

Reddit

Logging: According to Reddit's privacy policy, they "may [automatically] log information" including:

  • IP address
  • User-agent string
  • Browser type
  • Operating system
  • Referral URLs
  • Device information (e.g., device IDs)
  • Device settings
  • Pages visited
  • Links clicked
  • The requested URL
  • Search terms

Location: The same privacy policy goes on to describe location data may be collected through the use of:

  • GPS (consensual)
  • Bluetooth (consensual)
  • Content associated with a location (consensual)
  • Your IP Address

Cookies: Reddit's cookie notice documents the array of cookies used by Reddit including/regarding:

  • Authentication
  • Functionality
  • Analytics and Performance
  • Advertising
  • Third-Party Cookies
  • Third-Party Site

Libreddit

For transparency, I hope to describe all the ways Libreddit handles user privacy.

Logging: In production (when running the binary, hosting with docker, or using the official instances), Libreddit logs when Reddit is ratelimiting Libreddit and when Reddit's JSON responses can't be parsed. When debugging (running from source without --release), Libreddit logs post IDs and URL paths fetched to aid with troubleshooting.

DNS: Both official domains (libredd.it and libreddit.spike.codes) use Cloudflare as the DNS resolver. Though, the sites are not proxied through Cloudflare meaning Cloudflare doesn't have access to user traffic.

Cookies: Libreddit uses optional cookies to store any configured settings in the settings menu. This is not a cross-site cookie and the cookie holds no personal data, only a value of the possible layout.

Hosting: The official instances are hosted on Replit which monitors usage to prevent abuse. I can understand if this invalidates certain users' threat models and therefore, selfhosting and browsing through Tor are welcomed.


Installation

1) Cargo

Make sure Rust stable is installed along with cargo, Rust's package manager.

cargo install libreddit

2) Docker

Deploy the Docker image of Libreddit:

docker pull spikecodes/libreddit
docker run -d --name libreddit -p 8080:8080 spikecodes/libreddit

Deploy using a different port (in this case, port 80):

docker pull spikecodes/libreddit
docker run -d --name libreddit -p 80:8080 spikecodes/libreddit

To deploy on arm64 platforms, simply replace spikecodes/libreddit in the commands above with spikecodes/libreddit:arm.

To deploy on armv7 platforms, simply replace spikecodes/libreddit in the commands above with spikecodes/libreddit:armv7.

3) AUR

For ArchLinux users, Libreddit is available from the AUR as libreddit-git.

yay -S libreddit-git

4) GitHub Releases

If you're on Linux and none of these methods work for you, you can grab a Linux binary from the newest release.

5) Replit

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 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.


Deployment

Once installed, deploy Libreddit to 0.0.0.0:8080 by running:

libreddit

Change Default Settings

Assign a default value for each setting by passing environment variables to Libreddit in the format LIBREDDIT_DEFAULT_{X}. Replace {X} with the setting name (see list below) in capital letters.

Name Possible values Default value
THEME ["system", "light", "dark", "black", "dracula", "nord", "laserwave", "violet", "gold"] system
FRONT_PAGE ["default", "popular", "all"] default
LAYOUT ["card", "clean", "compact"] card
WIDE ["on", "off"] off
COMMENT_SORT ["hot", "new", "top", "rising", "controversial"] hot
POST_SORT ["confidence", "top", "new", "controversial", "old"] confidence
SHOW_NSFW ["on", "off"] off
USE_HLS ["on", "off"] off
HIDE_HLS_NOTIFICATION ["on", "off"] off

Examples

LIBREDDIT_DEFAULT_SHOW_NSFW=on libreddit
LIBREDDIT_DEFAULT_WIDE=on LIBREDDIT_DEFAULT_THEME=dark libreddit -r

Proxying using NGINX

NOTE If you're proxying Libreddit through a NGINX Reverse Proxy, add

proxy_http_version 1.1;

to your NGINX configuration file above your proxy_pass line.

SystemD

You can use the SystemD service available in contrib/libreddit.service (install it on /etc/systemd/system/libreddit.service).

That service can be optionally configured in terms of environment variables by creating a file in /etc/libreddit.conf. Use the contrib/libreddit.conf as a template. You can also add the LIBREDDIT_DEFAULT__{X} settings explained above.

When "Proxying using NGINX" where the proxy is on the same machine, you should guarantee nginx waits for this service to start. Edit /etc/systemd/system/libreddit.service.d/reverse-proxy.conf:

[Unit]
Before=nginx.service

Building

git clone https://github.com/spikecodes/libreddit
cd libreddit
cargo run
Comments
  • Bug Report | Proxied media issues

    Bug Report | Proxied media issues

    Describe the bug

    Libreddit proxies videos synchronously. This causes videos on some devices to buffer for a long time (while Libreddit downloads the videos to the stack) and makes videos on other devices (such as iOS and MacOS devices) no longer compliant with the playback formats.

    Problems

    ~~1. Video playback is slow in Vivaldi~~

    I assume this issue happens in other browsers as well, though I've only tested this issue in Firefox, Vivaldi and Brave. Each rendering engine handles media differently. The video buffers for a long time (I measured 30 seconds for one video) before playing.

    2. Video playback is broken in WebKit-based browsers

    I haven't found this to be an issue in Firefox or Brave but it appears WebKit handles media differently than Gecko and Chromium do. Based on my research, it appears the slashed grey play button shows that the proxied MP4s aren't "compliant" with WebKit video guidelines.

    ~~3. Videos have no audio~~

    This is less of a bug and more of a missing feature as Reddit stores the audio and video separately. Below, I proposed different solutions that could "mux" (combine) the audio and video clips before the users play them. image


    Proposed video solutions

    :heavy_check_mark: 1. Stream both Reddit headers and the media body through Tide

    Currently, Tide supports streaming a Body from a reader but I don't believe the same applies for headers (we will see). This solution would be ideal as it would require the least major changes to the codebase.

    2. Download the media to the instance's storage for faster fetching

    This solution would require quite a lot of storage on the hosted instance which may make it unsuitable for Repl.it (which has a size limit for REPLs). Storing the media would allow the video to be merged with the audio which would fix #14. This is the method used by Teddit for proxied media.

    3. Stream the request through an alternative HTTP server that supports it


    Proposed audio solutions

    1. Combine the audio and video server-side

    The only video solution that I could see working with this is downloading the entire media offline before muxing and serving them again.

    :heavy_check_mark: 2. Use JavaScript to combine the Reddit-proxied audio and video client side

    Ideally, Libreddit would work entirely without JavaScript but if the other solutions are not possible, then it may be required. Reddit serves a HLS url for posts which is likely what Libreddit would use in this scenario. This approach is also taken by Nitter.

    The HLS url stream can be parsed from Reddit's API:

    post["data"]["secure_media"]["reddit_video"]["hls_url"]
    

    Additional context

    I have concluded that #145, #76, and #14 all stem from the method Libreddit uses to proxy content so I have unified these issues under a single bug report.

    bug 
    opened by spikecodes 35
  • Support displaying awards

    Support displaying awards

    Implements the feature request: https://github.com/spikecodes/libreddit/issues/24

    TODO:

    • [x] Parse awards
    • [x] Make awards a property of posts
    • [x] Display awards for comments
    • [x] Display awards for posts
    • [x] Clean up the code

    I am keeping this pull request open to track the changes, and so the creation of the project is aware this issue is being worked on.

    opened by DiegoMagdaleno 21
  • Bug Report | Media unplayable on WebKit-based browsers

    Bug Report | Media unplayable on WebKit-based browsers

    Describe the bug Reddit GIFs + videos on Libreddit are unplayable.

    To reproduce Steps to reproduce the behavior:

    1. Go to this video. Another video example. GIF example.
    2. A play button with a line through it appears

    Expected behavior GIFs/videos should be playable. Iโ€™m not sure why Safari on iOS isnโ€™t able to play them on Libreddit. Those very same GIFs and videos play well on Reddit.

    Additional context Reproduced on all of Libredditโ€™s working instances.

    405634D4-A994-4AEE-AABC-8450AA0DC310

    bug 
    opened by Mennaruuk 19
  • Subscribing to subreddits (favorites)

    Subscribing to subreddits (favorites)

    Implements basic subreddit subscriptions/favourites (#23), managed through each sub's sidebar.

    I've never written in Rust before so the code is pretty rough.

    Changes in code/Implementation details

    • Subscription list is a comma-separated list of subreddit names, saved under the subscriptions cookie.
    • Adding a sub to the list requires clicking the "subscribe" button in the sidebar
      • Subscribe is a GET request to /r/{{ subreddit }}/subscribe/, which will add that sub to the cookie
    • Removing a sub requires clicking "unsubscribe" in the sidebar or in settings
      • Unsubscribe is a GET request to /r/{{ subreddit }}/unsubscribe/ which will remove that sub from the subscriptions cookie or delete the cookie if it's the last one
      • GET is used instead of POST because I ran into strange behaviour when trying to loop over the unsubscribe forms in settings. It seems looping with forms results in the first form tag being ignored.

    Visual changes

    • A new subscriptions dropdown (uses details now but I might test hover in the future)
      • If you've subscribed to a subreddit, it will appear
      • It's a vertical list similar in appearance to the sort bar
      • The active subreddit is highlighted in the accent colour
    • Margins in the main element have been reduced to allow for an element to fit in above. The navbar padding has become body padding.
    • Other elements near the subscriptions dropdown have had their styles tweaked.

    Sub list considerations

    ~~The sub list currently appears as an extra horizontal bar (in the style of the sort bar) under the navbar.~~

    The sub list was previously a horizontal bar. Now it's a drop-down button that should stay at the top left of the main content or be centred under the nav bar on mobile.

    If we place it inside the navbar, it makes it way too tall, especially on mobile. Other sub lists like on RES or teddit are part of the navbar but those bars aren't fixed.

    ~~Another idea is to use a dropdown menu for a vertical list like new Reddit.~~

    Reddit has a drop-down button in the navbar, but it was a bit messy trying to fit the button (& a smaller symbol variant) with everything else in the mobile navbar.

    opened by mcrossman 18
  • Bug Report | No audio for proxied videos

    Bug Report | No audio for proxied videos

    Steps to reproduce:

    1. Find a post consisting of a single video hosted by Reddit,
    2. Visit it on libreddit using Firefox. (Have not tested to see if this bug exists for other browsers.)

    Result: the video is proxied and playable by the browser's native player (yeay!) but loses the audio track (boo!).

    Example URL: https://libredd.it/r/valkyrae/comments/klhie9/rock_mannn/.

    Expected: head audio when playing the video.

    bug 
    opened by Zegnat 18
  • Bug Report | Video problems on Vivaldi

    Bug Report | Video problems on Vivaldi

    Describe the bug When browsing libreddit on the Vivaldi Browser, there are many issues with video. The video has no audio, it just buffers endlessly most of the time, when you press play the videos get smaller and are forced into a wider aspect ratio, while still buffering, although they return to normal if they do eventually play. Sometimes you press play and it appears to cause an error in the browser, as the whole window goes gray like it does when you first open the browser. Sometimes videos are just black and don't even buffer. Finally, long videos will only play the first few seconds, and will only appear to be a few seconds long.

    To reproduce Steps to reproduce the behavior:

    1. Open the Vivaldi browser
    2. Go to libredd.it
    3. Look for videos in the feed
    4. Try to play them
    5. See issue

    Expected behavior The video will play on click (or even automatically), with audio, and will play the entirety of the video Additional context N/A

    bug 
    opened by iam-cult 14
  • Bug Report | www.

    Bug Report | www.

    Describe the bug I have to manually remove www. from URL to access Libreddit's official instances.

    To reproduce Steps to reproduce the behavior:

    1. Go to https://www.libreddit.spike.codes

    Expected behavior I think www. should redirect to the site without www. That way, people won't have to face an error. This isn't a huge issue for computer users (if users want to not touch Reddit.com, they can use Privacy Redirect), but it's a problem when I'm on Safari and I find a Reddit search. Unfortunately, iOS doesn't allow custom redirecting, so I'm left with manually selecting all of www.reddit.com, deleting it, and instead typing libredd.it.

    Additional context Is there a way to do something like this for libredd.it and libreddit.spikes.codes? image

    bug 
    opened by Mennaruuk 14
  • Bug Report | Empty flairs showing

    Bug Report | Empty flairs showing

    Describe the bug There is a small post flair that shows up on some posts randomly and for no apparent reason. When I go down posts in a subreddit and find a culprit post, this flair is at the start of the title. When I click the post, the flair moves to the end of the title.

    To reproduce Steps to reproduce the behavior:

    1. I archived r/askhistorians on Libreddit in case this slips away. Check out the first two unstickied posts.
    2. Go to this post on r/askhistorians
    3. Check for the small post flair

    Expected behavior I checked the Reddit post, and it didn't seem to have any flair, so theoretically there shouldn't be a flair on Libreddit.

    Additional context Here's a comparison screenshot: libreddit Also how the flair ends up trailing the title when you click the post: atend



    (I have one more question: I see there's whitespace after text in the flair. Is this a bug or a feature?) image

    bug 
    opened by Mennaruuk 13
  • Container image

    Container image

    L: We could start hosting libbacon (we wanted to host Libreddit again alongside Teddit, which we switched to after uh, the maintenance situation there became unclear), but we'd need a container (i.e. Docker) image for that, and couldn't find one on Quay or Docker Hub yet. https://github.com/libbacon/libbacon/issues/2 would also be relevant here, I mean, you would probably like to put that in the documentation, too. Ideally, you could build this via CI โ€’ we don't know too much about GH Actions, or any CI really, but I think it's not too hard to make it build things and push them on, say, Quay, or GHCR, or using another CI for that, or perhaps just your own build machine.

    opened by artemislena 12
  • Question: Use reddit account subscriptions?

    Question: Use reddit account subscriptions?

    libreddit can't login with Reddit account for subscriptions, right? So, Is there anyway to use my account subscriptions data? For Indvidious, had an option for upload YouTube subscription.json which exported form YouTube itself

    question 
    opened by mizzunet 12
  • nginx reverse proxying

    nginx reverse proxying

    I saw some of the alternative instances are hosted behind Apache or nginx. I have had absolutely no success getting libreddit to work with nginx. I've been trying the following configuration to no avail:

    server {
        listen 443 ssl http2;
        server_name libreddit.${NGINX_HOST};
    
        location / {
            set $libreddit http://libreddit:8080;
            proxy_pass $libreddit;
        }
    }
    

    I get a bad gateway on each index hit: [error] 34#34: *93 upstream prematurely closed connection while reading response header from upstream

    I'm running my instance from Docker and building the image off the latest master commit. The instance is accessible from both containers:

    root@nginx:/# curl -I libreddit:8080
    HTTP/1.1 200 OK
    content-length: 36365
    content-security-policy: default-src 'none'; manifest-src 'self'; media-src 'self'; style-src 'self' 'unsafe-inline'; base-uri 'none'; img-src 'self' data:; form-action 'self'; frame-ancestors 'none';
    content-type: text/html
    date: Tue, 16 Feb 2021 20:09:31 GMT
    referrer-policy: no-referrer
    x-content-type-options: nosniff
    x-frame-options: DENY
    
    root@libreddit:/usr/src/libreddit# curl -I localhost:8080
    HTTP/1.1 200 OK
    content-length: 36365
    content-security-policy: default-src 'none'; manifest-src 'self'; media-src 'self'; style-src 'self' 'unsafe-inline'; base-uri 'none'; img-src 'self' data:; form-action 'self'; frame-ancestors 'none';
    content-type: text/html
    date: Tue, 16 Feb 2021 20:11:40 GMT
    referrer-policy: no-referrer
    x-content-type-options: nosniff
    x-frame-options: DENY
    

    Any help getting this configuration to work would much appreciated.

    question 
    opened by h1nk 12
  • Bump tokio from 1.23.0 to 1.23.1

    Bump tokio from 1.23.0 to 1.23.1

    Bumps tokio from 1.23.0 to 1.23.1.

    Release notes

    Sourced from tokio's releases.

    Tokio v1.23.1

    This release forward ports changes from 1.18.4.

    Fixed

    • net: fix Windows named pipe server builder to maintain option when toggling pipe mode (#5336).

    #5336: tokio-rs/tokio#5336

    Commits
    • 1a997ff chore: prepare Tokio v1.23.1 release
    • a8fe333 Merge branch 'tokio-1.20.x' into tokio-1.23.x
    • ba81945 chore: prepare Tokio 1.20.3 release
    • 763bdc9 ci: run WASI tasks using latest Rust
    • 9f98535 Merge remote-tracking branch 'origin/tokio-1.18.x' into fix-named-pipes-1.20
    • 9241c3e chore: prepare Tokio v1.18.4 release
    • 699573d net: fix named pipes server configuration builder
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • LIBREDDIT_DEFAULT_SUBSCRIPTIONS setting is no longer read

    LIBREDDIT_DEFAULT_SUBSCRIPTIONS setting is no longer read

    Since upgrading to v0.27.0, the $LIBREDDIT_DEFAULT_SUBSCRIPTIONS setting is not honoured as it was in previous versions. The result is that I see the a feed of random posts rather than the feeds that I am interested in. I think this was caused by the changes introduced by pull request #664.

    Thanks Keith

    bug 
    opened by lleddewk 2
  • ๐Ÿ’ก Feature request: use RUSTFLAGS=

    ๐Ÿ’ก Feature request: use RUSTFLAGS="-C target-cpu=native" when compiling

    Is your feature request related to a problem? Please describe.

    I'm obsessed with speed, so I always compile my Rust programs with RUSTFLAGS="-C target-cpu=native". Here you can find a discussion on Reddit.

    I thought it might also benefit Libreddit.

    Describe the feature you would like to be implemented

    Documentation should suggest the use of this env variable.

    Describe alternatives you've considered

    The alternative is to not use it, however I have been using it for one year without issues.

    enhancement 
    opened by user451421541757324 2
  • Implement instance info endpoint (JSON, YAML, TXT)

    Implement instance info endpoint (JSON, YAML, TXT)

    Fixes #624

    I added a feature to the time crate to allow for local timezone loading. I also added serde_yaml so we could return it in YAML form, as well as JSON and regular text. Here's what they look like:

    JSON (Default with /instance-info)

    image

    YAML

    image

    TXT

    image

    The build.rs is required and standard practice to set a variable - AFAIK it's the easiest way to embed the latest commit hash.

    Within instance_info.rs, I made some choices - the InstanceInfo struct will be held in a Lazy. Currently nothing in the struct should change so it's okay to cache it. However, from #624:

    • Maybe some kind of latency statistics? Average latency to reddit, average response latency, etc.
    • Number of responses served

    If we add either of these, it will change on the fly, so we need to revisit the use of a Lazy<InstanceInfo>.

    Within the instance_info function, I choose json as the default - /instance-info//instance-info.json. /instance-info.yaml and /instance-info.txt convert to their respective formats.

    In main.rs, I forced evaluation of the two relevant statics (config and instance info) to ensure deploy timestamp is accurate, and to avoid paying the penalty of parsing the config at the first request.

    In conclusion, this PR will allow us to implement a system where we can easily check if an instance is actually online and lets us measure versions across the instance ecosystem. If we add metrics like average Reddit latency or number of responses served, we can more accurately predict the performance of certain servers and bias a redirect server (going to work on this in the coming days :wink:) towards those.

    PS: InstanceInfo is subject to change, I suspect I'm going to remove the deploy date string and just have a unix timestamp + maybe a ISO8601 string.

    opened by sigaloid 0
  • ๐Ÿ’ก Feature request: Option for automatic updates

    ๐Ÿ’ก Feature request: Option for automatic updates

    As Libreddit is a single-binary webserver with little to no state, I'm curious what the community's thoughts are on an option that would automatically update to the latest release. We would need to set up some GH Actions infrastructure to actually compile and publish a release but the code would be as simple as downloading a new binary in place and starting it - all configs would automatically be moved over as environment variables and config files would stay intact.

    This is how AdGuard Home manages updates - one click in the management UI will automatically perform the update. However since LibReddit doesn't have a management page page (yet? :smirk:) it would simply be checked by a background task of some sort.

    AGH has a great technical document that describes how they perform updates, that looks like very good "best practice" steps.

    https://github.com/AdguardTeam/AdGuardHome/blob/bbdcc673a2ccdf5adcfe1d9b26450efbf5a29f96/AGHTechDoc.md#Updating

    enhancement 
    opened by sigaloid 0
Releases(v0.27.0)
  • v0.27.0(Jan 3, 2023)

    • v0.27.0 0ff92cbfe33e9c6b9bdfcc94773eb6d1c6e8d0ca

    What's Changed

    • Add config system to read from file by @sigaloid in https://github.com/libreddit/libreddit/pull/664
    • Remove unused dep "async-recursion" by @Tokarak in https://github.com/libreddit/libreddit/pull/683
    • Add hide_awards config option by @sigaloid in https://github.com/libreddit/libreddit/pull/678

    New Contributors

    • @Tokarak made their first contribution in https://github.com/libreddit/libreddit/pull/683

    Full Changelog: https://github.com/libreddit/libreddit/compare/v0.26.0...v0.27.0

    Source code(tar.gz)
    Source code(zip)
    libreddit(6.72 MB)
    libreddit.sha512(155 bytes)
  • v0.26.0(Jan 3, 2023)

  • v0.25.3(Jan 2, 2023)

    • v0.25.3 c15f305be0c97730f91694146c493fdccdc3371e

    What's Changed

    • fix a11y and HTML issues on settings page by @rangermeier in https://github.com/libreddit/libreddit/pull/662
    • build: enable LTO and strip the binary by @tirz in https://github.com/libreddit/libreddit/pull/467
    • Fix for #675 by @ellieeet123 in https://github.com/libreddit/libreddit/pull/676
    • Link to libreddit/libreddit and open in new tab by @spenserblack in https://github.com/libreddit/libreddit/pull/673

    New Contributors

    • @rangermeier made their first contribution in https://github.com/libreddit/libreddit/pull/662
    • @ellieeet123 made their first contribution in https://github.com/libreddit/libreddit/pull/676
    • @spenserblack made their first contribution in https://github.com/libreddit/libreddit/pull/673

    Full Changelog: https://github.com/libreddit/libreddit/compare/v0.25.2...v0.25.3

    Source code(tar.gz)
    Source code(zip)
    libreddit(6.60 MB)
    libreddit.sha512(155 bytes)
  • v0.25.2(Jan 1, 2023)

    • v0.25.2 b5d04f1a50681cc78fc387d04e2f4c59f363d7a0

    What's Changed

    • Bugfix: 'all posts are hidden because NSFW' when no posts where found by @gmnsii in https://github.com/libreddit/libreddit/pull/666
    • Search - add support for raw reddit links by @gmnsii in https://github.com/libreddit/libreddit/pull/663

    New Contributors

    • @gmnsii made their first contribution in https://github.com/libreddit/libreddit/pull/666

    Full Changelog: https://github.com/libreddit/libreddit/compare/v0.25.1...v0.25.2

    Source code(tar.gz)
    Source code(zip)
    libreddit(6.59 MB)
    libreddit.sha512(155 bytes)
  • v0.25.1(Dec 14, 2022)

  • v0.25.0(Dec 3, 2022)

  • v0.24.3(Dec 1, 2022)

  • v0.24.2(Dec 1, 2022)

    What's Changed

    • Fix embeds by @Macic-Dev in https://github.com/libreddit/libreddit/pull/648
    • Make the column size in posts consistent in 92f5286.

    New Contributors

    • @Macic-Dev made their first contribution in https://github.com/libreddit/libreddit/pull/648
    • @laazyCmd made their first contribution in 92f5286.

    Full Changelog: https://github.com/libreddit/libreddit/compare/v0.24.1...v0.24.2

    Source code(tar.gz)
    Source code(zip)
    libreddit(15.71 MB)
    libreddit.sha512(155 bytes)
  • v0.24.1(Nov 22, 2022)

    What's Changed

    • Added gruvbox-dark and gruvbox-light themes by @MarshDeer in https://github.com/libreddit/libreddit/pull/490
    • Extract Location URL path correctly in client::request. (fixes #645) by @Daniel-Valentine in https://github.com/libreddit/libreddit/pull/646

    New Contributors

    • @MarshDeer made their first contribution in https://github.com/libreddit/libreddit/pull/490

    Full Changelog: https://github.com/libreddit/libreddit/compare/v0.24.0...v0.24.1

    Source code(tar.gz)
    Source code(zip)
    libreddit(15.71 MB)
    libreddit.sha512(155 bytes)
  • v0.24.0(Nov 15, 2022)

    What's Changed

    • Indicate pinned posts on user profiles (close #606) 3f3d9e9c3b073c1da696b3019f95e7008d3b3693
    • Fix Replit deployment failure 1b5e9a4279029cd444a3079a93b42843af0c9da2
    • Fix links visible through markdown spoilers c0e37443ae0022284c5af80cc88898597d527d13
    • HTTP compression (Reddit -> Libreddit -> client) by @Daniel-Valentine in https://github.com/libreddit/libreddit/pull/612
    • Use permalink offered by Reddit (fixes #613). by @Daniel-Valentine in https://github.com/libreddit/libreddit/pull/614
    • Add DoomOne theme, c/o Tildemaster [email protected] by @Daniel-Valentine in https://github.com/libreddit/libreddit/pull/611
    • Add support for /comments endpoint 170ea384fbb6490494ef85d7279da9ce44d560a4
    • Redirect /:id to canonical URL for post. by @Daniel-Valentine in https://github.com/libreddit/libreddit/pull/617
    • Add format_url tests by @sigaloid in https://github.com/libreddit/libreddit/pull/615
    • Implement 'posts hidden because of NSFW'. (Resolves #159) by @Daniel-Valentine in https://github.com/libreddit/libreddit/pull/619
    • Blur NSFW posts. by @Daniel-Valentine in https://github.com/libreddit/libreddit/pull/636
    • T.: Docs update by @artemislena in https://github.com/libreddit/libreddit/pull/639

    New Contributors

    • @Daniel-Valentine made their first contribution in https://github.com/libreddit/libreddit/pull/612
    • @sigaloid made their first contribution in https://github.com/libreddit/libreddit/pull/615

    Full Changelog: https://github.com/libreddit/libreddit/compare/v0.23.1...v0.24.0

    Source code(tar.gz)
    Source code(zip)
    libreddit(15.72 MB)
    libreddit.sha512(155 bytes)
  • v0.23.1(Nov 1, 2022)

  • v0.23.0(Nov 1, 2022)

    Hey all! :wave:

    I've been absent for a while but am back now. I moved this project to a dedicated organization so there will be a (or possibly multiple) new project maintainers. My goal is to make Libreddit fully community-run so any absences of mine in the future won't stall the project's development.

    I want to give a thanks to @Daniel-Valentine for his efforts to keep the project alive at the fork Ferrit and look forward to synchronizing Ferrit's changes into Libreddit.

    Thank you to everyone for the continued support for this project. :heart:

    Best,

    Spike

    What's Changed

    • L: Fixed two swapped config variables in the documentation. by @artemislena in https://github.com/libreddit/libreddit/pull/524
    • change lr.vern.cc hosting location as we moved vps by @gi-yt in https://github.com/libreddit/libreddit/pull/526
    • Added Instances by @IkelAtomig in https://github.com/libreddit/libreddit/pull/519
    • Remove libreddit.awesomehub.io by @Dyras in https://github.com/libreddit/libreddit/pull/535
    • Added Instances by @IkelAtomig in https://github.com/libreddit/libreddit/pull/531
    • Add ~vern onion instance by @gi-yt in https://github.com/libreddit/libreddit/pull/537
    • Updated my onion link by @EsmailELBoBDev2 in https://github.com/libreddit/libreddit/pull/593
    • Remove reddit.artemislena.eu (uses Teddit, not Libreddit now) by @artemislena in https://github.com/libreddit/libreddit/pull/586
    • Add new instance (libreddit.oxymagnesium.com) by @OxyMagnesium in https://github.com/libreddit/libreddit/pull/591
    • Add libreddit.cachyos.org instance by @vnepogodin in https://github.com/libreddit/libreddit/pull/571
    • Removed 9 dead links from instance list by @guaddy in https://github.com/libreddit/libreddit/pull/545
    • update instance (igna.rocks => intent.cool) by @ilyigna in https://github.com/libreddit/libreddit/pull/603
    • Use singular form of "comment" for posts with 1 comment by @arthomnix in https://github.com/libreddit/libreddit/pull/567

    New Contributors

    • @artemislena made their first contribution in https://github.com/libreddit/libreddit/pull/524
    • @IkelAtomig made their first contribution in https://github.com/libreddit/libreddit/pull/519
    • @Dyras made their first contribution in https://github.com/libreddit/libreddit/pull/535
    • @OxyMagnesium made their first contribution in https://github.com/libreddit/libreddit/pull/591
    • @vnepogodin made their first contribution in https://github.com/libreddit/libreddit/pull/571
    • @ilyigna made their first contribution in https://github.com/libreddit/libreddit/pull/603
    • @arthomnix made their first contribution in https://github.com/libreddit/libreddit/pull/567

    Full Changelog: https://github.com/libreddit/libreddit/compare/v0.22.9...v0.23.0

    Source code(tar.gz)
    Source code(zip)
    libreddit(14.27 MB)
    libreddit.sha512(155 bytes)
  • v0.22.9(May 29, 2022)

    What's Changed

    • Fix dark theme hidden in settings 5f20e8ee2700180fa99ce22feb9202373fe0710c
    • Fix HTML encoding in templating by @ClockVapor in https://github.com/spikecodes/libreddit/pull/404
    • Fix "Post url contains non-ASCII characters" error. by @Midblyte in https://github.com/spikecodes/libreddit/pull/479
    • Change localhost to 0.0.0.0 in contrib/libreddit.conf so that it doesnt complain about localhost not being a valid addr by @gi-yt in https://github.com/spikecodes/libreddit/pull/498
    • remove 40two.app - dead/serves ads by @sybenx in https://github.com/spikecodes/libreddit/pull/517
    • Removed libreddit.alefvanoon.xyz instance by @guaddy in https://github.com/spikecodes/libreddit/pull/516

    New Contributors

    • @Midblyte made their first contribution in https://github.com/spikecodes/libreddit/pull/479
    • @sybenx made their first contribution in https://github.com/spikecodes/libreddit/pull/517
    • @guaddy made their first contribution in https://github.com/spikecodes/libreddit/pull/516

    Full Changelog: https://github.com/spikecodes/libreddit/compare/v0.22.8...v0.22.9

    Source code(tar.gz)
    Source code(zip)
    libreddit(14.26 MB)
    libreddit.sha512(155 bytes)
  • v0.22.8(May 21, 2022)

    What's Changed

    • CI: Add docker build caching by @HarshCasper in https://github.com/spikecodes/libreddit/pull/493
    • Add reddit.dr460nf1r3.org instance by @dr460nf1r3 in https://github.com/spikecodes/libreddit/pull/504
    • Restore post sorting preference by link by @ClockVapor in https://github.com/spikecodes/libreddit/pull/406
    • Remove silkky.cloud instance. https://github.com/spikecodes/libreddit/issues/510
    • Made instance url consistant by @BobIsMyManager in https://github.com/spikecodes/libreddit/pull/511
    • Embed css themes to simplify adding and testing new themes. by @mikupls in https://github.com/spikecodes/libreddit/pull/489
    • Harden Systemd configuration by @erdnaxe in https://github.com/spikecodes/libreddit/pull/453

    New Contributors

    • @HarshCasper made their first contribution in https://github.com/spikecodes/libreddit/pull/493
    • @dr460nf1r3 made their first contribution in https://github.com/spikecodes/libreddit/pull/504
    • @BobIsMyManager made their first contribution in https://github.com/spikecodes/libreddit/pull/511
    • @erdnaxe made their first contribution in https://github.com/spikecodes/libreddit/pull/453

    Full Changelog: https://github.com/spikecodes/libreddit/compare/v0.22.7...v0.22.8

    Source code(tar.gz)
    Source code(zip)
    libreddit(14.80 MB)
    libreddit.sha512(155 bytes)
  • v0.22.7(May 15, 2022)

    What's Changed

    • โœ๏ธfix: Tries to add better readability - โžก๏ธ fix: Moves funding links to correct file by @walkxcode in https://github.com/spikecodes/libreddit/pull/477
    • Add new instance to list of public instances by @5trongthany in https://github.com/spikecodes/libreddit/pull/478
    • Let native elements use theme accent colour by @EnderDev in https://github.com/spikecodes/libreddit/pull/509
    • Add lr.vern.cc to instance list by @gi-yt in https://github.com/spikecodes/libreddit/pull/505
    • โœ๏ธ Fix link to Cloudflare in README.md by @nchristopher in https://github.com/spikecodes/libreddit/pull/506
    • Fix multireddit subscription redirect url bb7fb1313d1fb05644a8feb7fa93a3b2d261b23a
    • Update instances https://github.com/spikecodes/libreddit/commit/1c50c8f30dfc19e5f43073b8b31d17d2d77943df

    New Contributors

    • @walkxcode made their first contribution in https://github.com/spikecodes/libreddit/pull/477
    • @5trongthany made their first contribution in https://github.com/spikecodes/libreddit/pull/478
    • @gi-yt made their first contribution in https://github.com/spikecodes/libreddit/pull/505
    • @nchristopher made their first contribution in https://github.com/spikecodes/libreddit/pull/506

    Full Changelog: https://github.com/spikecodes/libreddit/compare/v0.22.6...v0.22.7

    Source code(tar.gz)
    Source code(zip)
    libreddit(14.81 MB)
    libreddit.sha512(155 bytes)
  • v0.22.6(Apr 3, 2022)

  • v0.22.5(Mar 26, 2022)

  • v0.22.4(Mar 26, 2022)

  • v0.22.3(Mar 26, 2022)

  • v0.22.2(Mar 16, 2022)

  • v0.22.1(Mar 14, 2022)

  • v0.22.0(Mar 13, 2022)

    What's Changed

    • leddit.xyz instance location change by @kzshantonu in https://github.com/spikecodes/libreddit/pull/387
    • Fix and improve admin/mod distinguishers by @674Y3r in https://github.com/spikecodes/libreddit/pull/386
    • Add libreddit.bus-hit.me to instances by @austinhuang0131 in https://github.com/spikecodes/libreddit/pull/398
    • Remove Cloudflare Proxy from libreddit.drivet.xyz by @GhostSlayer in https://github.com/spikecodes/libreddit/pull/360
    • Changed location of my VPS :) by @EsmailELBoBDev2 in https://github.com/spikecodes/libreddit/pull/415
    • add my instances by @kylrth in https://github.com/spikecodes/libreddit/pull/446
    • new DE instance by @kzshantonu in https://github.com/spikecodes/libreddit/pull/429
    • Update instances by @austinhuang0131 in https://github.com/spikecodes/libreddit/pull/421
    • Add user listing buttons by @ClockVapor in https://github.com/spikecodes/libreddit/pull/400

    New Contributors

    • @kzshantonu made their first contribution in https://github.com/spikecodes/libreddit/pull/387
    • @674Y3r made their first contribution in https://github.com/spikecodes/libreddit/pull/386
    • @austinhuang0131 made their first contribution in https://github.com/spikecodes/libreddit/pull/398
    • @GhostSlayer made their first contribution in https://github.com/spikecodes/libreddit/pull/360
    • @kylrth made their first contribution in https://github.com/spikecodes/libreddit/pull/446

    Full Changelog: https://github.com/spikecodes/libreddit/compare/v0.21.6...v0.22.0

    Source code(tar.gz)
    Source code(zip)
    libreddit(13.74 MB)
    libreddit.sha512(155 bytes)
  • v0.21.7(Jan 6, 2022)

  • v0.21.6(Jan 6, 2022)

  • v0.21.5(Jan 6, 2022)

    What's Changed

    • Fix sort button scrollbars 8b8f55e09aeafdeaaa81404f83a09c58c9d65bac
    • Search fixes by @andrew-kaufman in https://github.com/spikecodes/libreddit/pull/384

    New Contributors

    • @andrew-kaufman made their first contribution in https://github.com/spikecodes/libreddit/pull/384

    Full Changelog: https://github.com/spikecodes/libreddit/compare/v0.21.4...v0.21.5

    Source code(tar.gz)
    Source code(zip)
    libreddit(14.36 MB)
    libreddit.sha512(155 bytes)
  • v0.21.4(Dec 29, 2021)

  • v0.21.3(Dec 29, 2021)

  • v0.21.2(Dec 28, 2021)

  • v0.21.1(Dec 28, 2021)

  • v0.21.0(Dec 28, 2021)

Owner
Spike
Privacy advocate building open source software
Spike
Private swaps for Secret Network using a private entropy pool & differential privacy.

WIP SecretSwap: Anon Edition Private swaps for Secret Network! Uses private entropy pool for differential privacy when reporting pools sizes. Swap amo

Enigma 5 Apr 5, 2022
Programming language from down under, inspired by this Reddit post.

aussie++ Programming language from down under, inspired by this Reddit post. View live demo here. Special thanks to MarkWhyBird, louis100, and others

Zack Radisic 562 Dec 27, 2022
Uradhura is a telegram bot that fetches information and media from reddit

Pathetic little Telegram bot that fetches information from Reddit posts(with gif, image(post with single image) and video)

The Penguins Org 3 May 28, 2022
A simple clone of reddit r/place

Run First install rustup with instructions on Rustup. Then run it: cargo run Endpoints There is two endpoints, one for getting canvas and the other fo

Kaveh 1 Sep 12, 2022
Blueboat is an open-source alternative to Cloudflare Workers. The monolithic engine for serverless web apps.

Blueboat Blueboat is an open-source alternative to Cloudflare Workers. Blueboat aims to be a developer-friendly, multi-tenant platform for serverless

Heyang Zhou 1.8k Jan 9, 2023
Alternative basic focus movement for the sway and i3 window managers.

sway-overfocus Alternative basic focus movement for the sway and i3 window managers. The primary goal of this program is to create one set of keybinds

null 42 Oct 23, 2022
Polydrive an experimental open source alternative to Google Drive

Polydrive is an experimental open source alternative to Google Drive. It allows users to synchronize their files on multiple devices.

null 3 Apr 20, 2022
Rust macro to use a match-like syntax as a elegant alternative to nesting if-else statement

cond Rust macro to use a match-like syntax as an elegant alternative to many if-else statements. I got the idea from empty Go switch statements. I tho

CheckM4te 3 Nov 23, 2023
Swayidle alternative to handle wayland idle notifications, sleep and lock events in Rust with Lua scripting based configuration language

swayidle-rs This is intended as a replacement of sway's idle management daemon. I use it as a tool to understand rust message passing and state manage

Reza Jelveh 8 Nov 27, 2023
Reddit - Liberate your Reddit Chats. This tool will export your reddit chats into a plethora of formats

Rexit Rexit - Liberate your Reddit Chats. This tool will export your Reddit chats into a plethora of formats Tool to export Reddit chats into a variet

Maximilian Pult 6 May 3, 2023
An open source artifact manager. Written in Rust back end and an Vue front end to create a fast and modern experience

nitro_repo Nitro Repo is an open source free artifact manager. Written with a Rust back end and a Vue front end to create a fast and modern experience

Wyatt Jacob Herkamp 30 Dec 14, 2022
Seed is a Rust front-end framework for creating fast and reliable web apps with an Elm-like architecture.

Seed is a Rust front-end framework for creating fast and reliable web apps with an Elm-like architecture.

null 3.6k Jan 6, 2023
This is a simple lnd poller and web front-end to see and read boosts and boostagrams.

Helipad This package will poll a Lightning LND node for invoices related to Podcasting 2.0 and display them in a web interface. It's intended for use

Podcastindex.org 26 Dec 29, 2022
A TUI front-end for the Debug Adapter Protocol.

Pesticide A TUI front-end for the Debug Adapter Protocol. Motivation I am an avid kakoune user. Kak is a very niche text editor with few users. As suc

raiguard 6 Jun 17, 2022
A run-codes cli front end with some extra features

run-cli Run-cli A run-codes cli front end with some extra features Report Bug ยท Request Feature Table of Contents About The Project Built With Getting

Matheus Vieira 13 Nov 16, 2022
Compiler front-end foundation technology.

Lady Deirdre. Compiler front-end foundation technology. If you want to create your own programming language with IDE support from day one, or if you a

Ilya Lakhin 45 Jan 5, 2023
GTK 4 front-end to ChatGPT completions written in Rust

ChatGPT GUI Building git clone [email protected]:teunissenstefan/chatgpt-gui.git cd chatgpt-gui cargo build --release Todo Connect insert_text to only al

Stefan Teunissen 6 Mar 12, 2023
HTTP client/libcurl TUI front end in Rust, with request + key storage

Rust TUI HTTP Client with API Key Management This project is still in active development and although it is useable, there may still be bugs and signi

Preston Thorpe 23 Nov 9, 2023
๐Ÿ€ Building a federated alternative to reddit in rust

Lemmy A link aggregator / Reddit clone for the fediverse. Join Lemmy ยท Documentation ยท Report Bug ยท Request Feature ยท Releases ยท Code of Conduct About

LemmyNet 7.2k Jan 3, 2023
An end-to-end encrypted, anonymous IP-hiding, decentralized, audio/video/file sharing/offline messaging multi-device platform built for both communications and application security and performance.

An end-to-end encrypted, anonymous IP-hiding, decentralized, audio/video/file sharing/offline messaging multi-device platform built for both communications and application security and performance.

null 2 Apr 27, 2022