Skip to content
Project516Public
forked from redlib-org/redlib

About

Private front-end for Reddit

Resources

Stars

0 stars

Watchers

0 watching

Forks

Β 
Β 

Latest commit

Β 

History

2,087 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Redlib

Fork of redlib-org/redlib ghcr.io Container build Tests Lint Last commit

An alternative private front-end to Reddit, with its origins in Libreddit.

Important

This is a fork of redlib-org/redlib, built on Nachtalb/redlib. It ships multi-arch images for amd64, 386, arm64, arm/v7, arm/v6, riscv64 and mips64le, and includes many features and fixes from unmerged upstream pull requests plus its own.

Tip

Run this fork's image, ghcr.io/project516/redlib:latest, rather than upstream's quay.io/redlib/redlib.

Warning

If Reddit blocks your instance's requests, set a session in REDLIB_REDDIT_COOKIE (setup).

screenshot


10-second pitch: Redlib 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

Instances

Tip

πŸ”— Want to automatically redirect Reddit links to Redlib? Use LibRedirect or Privacy Redirect!

An up-to-date table of instances is available in Markdown and machine-readable JSON.

Both files are part of the redlib-instances repository. To contribute your self-hosted instance to the list, see the redlib-instances README.


Comparison

This section outlines how Redlib compares to Reddit in terms of speed and privacy.

Speed

PageSpeed Insights results from January 12, 2024

⚠️ Warning: these numbers are outdated. Current instances may vary, as they adjust automatically to Reddit's blocking efforts.

Results from Google PageSpeed Insights (Redlib Report, Reddit Report).

Performance metric Redlib Reddit
Speed Index 0.6s 1.9s
Performance Score 100% 64%
Time to Interactive 2.8s 12.4s

Privacy

What each side collects about you, according to Reddit's privacy policy and cookie notice, and Redlib's code.

Reddit Redlib
Logging
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
GPS (consensual) 😱
Bluetooth (consensual) 😱
Content associated with a location (consensual) 😱
Your IP address 😱
Cookies
Authentication 😱
Functionality 😱 😌 your settings, nothing personal
Analytics and performance 😱
Advertising 😱
Third-party cookies 😱
Third-party sites 😱

Redlib's server logs nothing about visitors in release builds (the binary, Docker images and public instances). Debug builds (cargo run without --release) log fetched post IDs to help with troubleshooting. Its cookies are not cross-site and only hold the settings you chose.


Deployment

This section covers multiple ways of deploying Redlib. Using Docker is recommended for production.

For configuration options, see CONFIGURATION.md.

Images are on ghcr.io for amd64, 386, arm64, arm/v7, arm/v6, riscv64 and mips64le, with these tags:

  • latest: the newest commit on master, or the newest release if one came after it.
  • <version>, like 2026.1102.1: one release; it never changes.
  • dev: the newest commit on master, between releases.
  • sha-<commit>: one commit on master; it never changes.

For amd64 and arm64 every tag also has a -mimalloc variant (latest-mimalloc, …), built with the mimalloc allocator: faster under load, but it holds more memory afterwards.

Docker Compose

Copy compose.yaml and .env.example (as .env), and adjust them, for example the port.

docker compose up -d    # start Redlib in the background
docker logs -f redlib   # follow its logs
Docker CLI
docker run -d --name redlib -p 8080:8080 ghcr.io/project516/redlib:latest             # listen on port 8080
docker run -d --name redlib -p 127.0.0.1:8080:8080 ghcr.io/project516/redlib:latest   # behind a reverse proxy: local only
docker run -d --name redlib -p 8080:8080 --env-file .env ghcr.io/project516/redlib:latest  # with settings from .env
docker logs -f redlib                                                              # follow its logs
Podman (Quadlets)

❗ Important: This assumes a systemd-based distro with Podman, and loginctl enable-linger <username> so the service starts without you logging in.

Copy redlib.container and .env.example (as .env) to ~/.config/containers/systemd/ and adjust them, then reboot or:

systemctl --user daemon-reload          # pick up the new files
systemctl --user start redlib.service   # start Redlib
systemctl --user status redlib.service  # check on it
Binary

Grab a binary from the latest release. Every release has static Linux builds for x86_64, i686, aarch64, armv7, arm (v6), riscv64 and mips64el, plus macOS, Windows and Android builds that this fork doesn't test, and SHA256SUMS. redlib-x86_64-unknown-linux-musl-mimalloc and redlib-aarch64-unknown-linux-musl-mimalloc are the mimalloc builds from the -mimalloc images.

curl -fL -o redlib https://github.com/Project516/redlib/releases/latest/download/redlib-x86_64-unknown-linux-musl  # pick your architecture
sudo chmod +x redlib && sudo chown root:root redlib  # make it executable, owned by root
sudo cp ./redlib /usr/bin/redlib                     # install it
redlib                                               # listen on 0.0.0.0:8080

❗ Important: If you're proxying Redlib through NGINX (see issue #122), add proxy_http_version 1.1; above your proxy_pass line.

Running as a systemd service

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

That service can be optionally configured in terms of environment variables by creating a file in /etc/redlib.conf. Use the contrib/redlib.conf as a template. You can also add any of the settings in CONFIGURATION.md.

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/redlib.service.d/reverse-proxy.conf:

[Unit]
Before=nginx.service
Replit/Heroku

⚠️ Warning: 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

launchd (macOS)

If you are on macOS, you can use the launchd service available in contrib/redlib.plist.

Install it with cp contrib/redlib.plist ~/Library/LaunchAgents/.

Load and start it with launchctl load ~/Library/LaunchAgents/redlib.plist.

Cloudflare WAF rule

Behind Cloudflare, a custom WAF rule with the action Managed Challenge keeps bots and scrapers off your instance, so they don't burn through its Reddit quota. Visitors solve the challenge once and keep the cf_clearance cookie; static files, the health badge, /info.json and an optional status probe with a secret header pass without one. This is the rule r.naa.gg uses, with your host and a random secret filled in:

(http.request.full_uri wildcard r"https://redlib.example.com/*"
 and not http.cookie contains "cf_clearance"
 and not ends_with(http.request.uri.path, ".css")
 and not ends_with(http.request.uri.path, ".js")
 and not ends_with(http.request.uri.path, "touch-icon-iphone.png")
 and not ends_with(http.request.uri.path, "favicon.ico")
 and not ends_with(http.request.uri.path, ".woff2")
 and not ends_with(http.request.uri.path, "manifest.json")
 and http.request.uri.path ne "/healthz/reddit.json"
 and http.request.uri.path ne "/info.json"
 and not (http.request.uri.path in {"/settings" "/healthz/reddit"}
          and http.request.headers["x-status-probe"][0] eq "<random secret>"))

Paste it under Security β†’ WAF β†’ Custom rules β†’ Edit expression. Leave out the last condition if you don't run a status page.


Configuration

Redlib is configured with environment variables, a redlib.toml file or command-line flags. All settings, the Reddit session, the backend order and proxies are described in CONFIGURATION.md.


Building from source

git clone https://github.com/Project516/redlib && cd redlib
cargo build --release              # the binary ends up in target/release/redlib
cargo build --release --features mimalloc  # optional: mimalloc allocator, faster under load, holds more memory

A build from a git checkout reports its version as dev-<commit>; with REDLIB_RELEASE=1 set during the build it reports the version in Cargo.toml, like the release builds. A build from a release's source archive, which has no git information, reports the release version on its own.

Redlib talks to Reddit through wreq, which uses BoringSSL with wreq's patches (via the btls-sys crate) so its TLS handshake looks like a real browser's. The BoringSSL source ships with the crate and is patched and compiled during the build, so you need git, cmake, a C/C++ compiler and libclang (for bindgen). Certificates are checked against Mozilla's trust store compiled into the binary.

On Debian/Ubuntu:

sudo apt install build-essential git cmake libclang-dev

On Windows (not tested by this fork), install MSVC, which you likely already have for Rust, then:

# Update your PATH afterwards; some installers don't (hence -i, interactive mode).
winget install -i Kitware.CMake
winget install -i NASM.NASM
winget install -i LLVM.LLVM

Releasing

For maintainers. Run Actions β†’ Release β†’ Run workflow on master. It picks the next version YYYY.MDD.N (like 2026.1102.1), commits and tags it on master, builds the images and binaries, and publishes the GitHub release with generated notes. If it fails after the commit, use Re-run failed jobs: a new run makes a new version. If the commit landed but the tag didn't, the next run tags that commit instead of making another.

  • Label pull requests that make users change something (settings, defaults, endpoints, the image, binary names) breaking; the notes list those first.
  • The build-image label gets a pull request a pr-<number> test image of its current commit. Read the changes first, and re-add the label after new commits.
  • One-time setup: a GitHub App with Contents read and write, installed on this repository and allowed past the rule protecting master, with its client ID and private key in the secrets RELEASE_APP_CLIENT_ID and RELEASE_APP_PRIVATE_KEY.

Sister projects

About

Private front-end for Reddit

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages