Compare commits

..

No commits in common. "6d3db31b11f0575a0c960bc8873bb99d9add7696" and "60c0d63583379d10ac1ade479d99644e4c2e3a45" have entirely different histories.

123
README.md
View File

@ -1,45 +1,37 @@
<img align="left" width="128" height="128" src="https://git.stardust.wtf/attachments/842086e3-b718-4379-b718-c3a542842152" alt="logo"> <img align="left" width="128" height="128" src="https://git.stardust.wtf/attachments/842086e3-b718-4379-b718-c3a542842152" alt="logo">
# Redsunlib # Redsunlib
> An alternative private front-end to Reddit, a fork of [Redlib](https://github.com/redlib-org/redlib) with some <sup><sub>(minor)</sub></sup> function and cosmetic changes. > An alternative private front-end to Reddit, a fork of [Redlib](https://github.com/redlib-org/redlib) with some function and cosmetic changes.
<br> <br>
![screenshot](https://git.stardust.wtf/attachments/7667e4e2-a32c-4269-9b5f-1d29cb3baf20) ![screenshot](https://git.stardust.wtf/attachments/7667e4e2-a32c-4269-9b5f-1d29cb3baf20)
### Disclaimer
There are rapid changes/features in this fork that can<sup>(will)</sup> change without notice. If you want to host this version, be aware that it's likely to break at some point. I still wouldn't recommend it in a production environment unless you know what you're doing. Or like living on the edge.......
> I would also like to thank the maintainers and contributors of both [Redlib](https://github.com/redlib-org/redlib) and [Libreddit](https://github.com/libreddit/libreddit) for all the work they did while I just added some low quality tacky features. ❤️
---
## Table of Contents ## Table of Contents
1. [Redsunlib](#redsunlib)
- [Disclaimer](#disclaimer) 1. [Redlib](#redlib)
2. [Table of Contents](#table-of-contents) 2. [Instances](#instances)
3. [Instances](#instances) 3. [About](#about)
4. [About](#about)
- [The Name](#the-name)
- [Built with](#built-with) - [Built with](#built-with)
- [How is it different from other Reddit front ends?](#how-is-it-different-from-other-reddit-front-ends) - [How is it different from other Reddit front ends?](#how-is-it-different-from-other-reddit-front-ends)
- [Teddit](#teddit) - [Teddit](#teddit)
- [Libreddit](#libreddit) - [Libreddit](#libreddit)
5. [Comparison](#comparison) 4. [Comparison](#comparison)
- [Speed](#speed) - [Speed](#speed)
- [Privacy](#privacy) - [Privacy](#privacy)
- [Reddit](#reddit) - [Reddit](#reddit)
- [Redlib](#redlib-1) - [Redlib](#redlib-1)
- [Server](#server) - [Server](#server)
6. [Deployment](#deployment) 5. [Deployment](#deployment)
- [Docker](#docker) - [Docker](#docker)
- [Docker Compose](#docker-compose) - [Docker Compose](#docker-compose)
- [Docker CLI](#docker-cli) - [Docker CLI](#docker-cli)
- [Binary](#binary) - [Binary](#binary)
- [Running as a systemd service](#running-as-a-systemd-service) - [Running as a systemd service](#running-as-a-systemd-service)
- [Building from source](#building-from-source) - [Building from source](#building-from-source)
7. [Configuration](#configuration) - [Replit/Heroku/Glitch](#replit-heroku-glitch)
- [launchd (macOS)](#launchd-macos)
6. [Configuration](#configuration)
- [Instance settings](#instance-settings) - [Instance settings](#instance-settings)
- [Default user settings](#default-user-settings) - [Default user settings](#default-user-settings)
@ -47,10 +39,14 @@ There are rapid changes/features in this fork that can<sup>(will)</sup> change w
# Instances # Instances
> [!WARNING] > [!TIP]
> 🔗 **Currently public Redsunlib instance are not available, consider using a [redlib](https://github.com/redlib-org/redlib-instances/blob/main/instances.md) instance if you are not comfortable running your own** > 🔗 **Want to automatically redirect Reddit links to Redlib? Use [LibRedirect](https://github.com/libredirect/libredirect) or [Privacy Redirect](https://github.com/SimonBrazell/privacy-redirect)!**
You are more than welcome to host an instance and submit an issue if you want it added. That is, if you've read the [Disclaimer](#disclaimer) and it's within your "personal risk tolerance." ;) An up-to-date table of instances is available in [Markdown](https://github.com/redlib-org/redlib-instances/blob/main/instances.md) and [machine-readable JSON](https://github.com/redlib-org/redlib-instances/blob/main/instances.json).
Both files are part of the [redlib-instances](https://github.com/redlib-org/redlib-instances) repository. To contribute your [self-hosted instance](#deployment) to the list, see the [redlib-instances README](https://github.com/redlib-org/redlib-instances/blob/main/README.md).
For information on instance uptime, see the [Uptime Robot status page](https://stats.uptimerobot.com/mpmqAs1G2Q).
--- ---
@ -60,13 +56,6 @@ Redlib hopes to provide an easier way to browse Reddit, without the ads, tracker
Redlib currently implements most of Reddit's (signed-out) functionalities but still lacks [a few features](https://github.com/redlib-org/redlib/issues). Redlib currently implements most of Reddit's (signed-out) functionalities but still lacks [a few features](https://github.com/redlib-org/redlib/issues).
## The Name
**Red sun** in the sky + Red**lib** = Redsunlib
And at the time, I was reading an excerpt from Mao Zedong, so the name seemed appropriate. But paradoxically named since Reddit is basically the sinophobia capital of the internet :/
## Built with ## Built with
- [Rust](https://www.rust-lang.org/) - Programming language - [Rust](https://www.rust-lang.org/) - Programming language
@ -169,7 +158,7 @@ For configuration options, see the [Configuration section](#Configuration).
[Docker](https://www.docker.com) lets you run containerized applications. Containers are loosely isolated environments that are lightweight and contain everything needed to run the application, so there's no need to rely on what's installed on the host. [Docker](https://www.docker.com) lets you run containerized applications. Containers are loosely isolated environments that are lightweight and contain everything needed to run the application, so there's no need to rely on what's installed on the host.
Docker images for Redsunlib are available at our [Gitea container registry](https://git.stardust.wtf/iridium/-/packages/container/redsunlib/latest), currently only with support for `amd64`, if you need `arm64`, or `armv7` platforms you can either build Redsunlib yourself or open an [issue](https://git.stardust.wtf/iridium/redsunlib/issues) :) Docker images for Redlib are available at [quay.io](https://quay.io/repository/redlib/redlib), with support for `amd64`, `arm64`, and `armv7` platforms.
### Docker Compose ### Docker Compose
@ -195,15 +184,15 @@ docker logs -f redlib
Deploy Redlib: Deploy Redlib:
```bash ```bash
docker pull git.stardust.wtf/iridium/redsunlib:latest docker pull quay.io/redlib/redlib:latest
docker run -d --name redlib -p 8080:8080 git.stardust.wtf/iridium/redsunlib:latest docker run -d --name redlib -p 8080:8080 quay.io/redlib/redlib:latest
``` ```
Deploy using a different port on the host (in this case, port 80): Deploy using a different port on the host (in this case, port 80):
```bash ```bash
docker pull git.stardust.wtf/iridium/redsunlib:latest docker pull quay.io/redlib/redlib:latest
docker run -d --name redlib -p 80:8080 git.stardust.wtf/iridium/redsunlib:latest docker run -d --name redlib -p 80:8080 quay.io/redlib/redlib:latest
``` ```
If you're using a reverse proxy in front of Redlib, prefix the port numbers with `127.0.0.1` so that Redlib only listens on the host port **locally**. For example, if the host port for Redlib is `8080`, specify `127.0.0.1:8080:8080`. If you're using a reverse proxy in front of Redlib, prefix the port numbers with `127.0.0.1` so that Redlib only listens on the host port **locally**. For example, if the host port for Redlib is `8080`, specify `127.0.0.1:8080:8080`.
@ -216,7 +205,19 @@ docker logs -f redlib
## Binary ## Binary
Currently binaries are not supplied at this moment but will be at some point in the future but can be [built from source](#building-from-source) If you're on Linux, you can grab a binary from [the newest release](https://github.com/redlib-org/redlib/releases/latest) from GitHub.
Download the binary using [Wget](https://www.gnu.org/software/wget/):
```bash
wget https://github.com/redlib-org/redlib/releases/download/v0.31.0/redlib
```
Make the binary executable and change its ownership to `root`:
```bash
sudo chmod +x redlib && sudo chown root:root redlib
```
Copy the binary to `/usr/bin`: Copy the binary to `/usr/bin`:
@ -260,13 +261,59 @@ Before=nginx.service
## Building from source ## Building from source
To deploy Redsunlib with changes not yet included in the latest release, you can build the application from source. To deploy Redlib with changes not yet included in the latest release, you can build the application from source.
```bash ```bash
git clone https://git.stardust.wtf/iridium/redsunlib && cd redsunlib git clone https://github.com/redlib-org/redlib && cd redlib
cargo run cargo run
``` ```
## 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.
<a href="https://repl.it/github/redlib-org/redlib"><img src="https://repl.it/badge/github/redlib-org/redlib" alt="Run on Repl.it" height="32" /></a>
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/redlib-org/redlib)
## launchd (macOS)
If you are on macOS, you can use the [launchd](https://en.wikipedia.org/wiki/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`.
<!-- ## Cargo
Make sure Rust stable is installed along with `cargo`, Rust's package manager.
```bash
cargo install libreddit
``` -->
<!-- ## AUR
For ArchLinux users, Redlib is available from the AUR as [`libreddit-git`](https://aur.archlinux.org/packages/libreddit-git).
```bash
yay -S libreddit-git
```
## NetBSD/pkgsrc
For NetBSD users, Redlib is available from the official repositories.
```bash
pkgin install libreddit
```
Or, if you prefer to build from source
```bash
cd /usr/pkgsrc/libreddit
make install
``` -->
--- ---
# Configuration # Configuration
@ -296,7 +343,7 @@ REDLIB_DEFAULT_USE_HLS = "on"
> If using the Docker CLI, add ` --env-file .env` to the command that runs Redlib. For example: > If using the Docker CLI, add ` --env-file .env` to the command that runs Redlib. For example:
> >
> ```bash > ```bash
> docker run -d --name redlib -p 8080:8080 --env-file .env git.stardust.wtf/iridium/redsunlib:latest > docker run -d --name redlib -p 8080:8080 --env-file .env quay.io/redlib/redlib:latest
> ``` > ```
> >
> If using Docker Compose, no changes are needed as the `.env` file is already referenced in `compose.yaml` via the `env_file: .env` line. > If using Docker Compose, no changes are needed as the `.env` file is already referenced in `compose.yaml` via the `env_file: .env` line.
@ -320,7 +367,6 @@ Assign a default value for each user-modifiable setting by passing environment v
| Name | Possible values | Default value | | Name | Possible values | Default value |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------- | | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| `THEME` | `["system", "light", "dark", "black", "dracula", "nord", "laserwave", "violet", "gold", "rosebox", "gruvboxdark", "gruvboxlight", "tokyoNight", "icebergDark"]` | `system` | | `THEME` | `["system", "light", "dark", "black", "dracula", "nord", "laserwave", "violet", "gold", "rosebox", "gruvboxdark", "gruvboxlight", "tokyoNight", "icebergDark"]` | `system` |
| `MASCOT` | `["BoymoderBlahaj", "redsunlib" ... Add more at ./static/mascots] ` | _(none)_ |
| `FRONT_PAGE` | `["default", "popular", "all"]` | `default` | | `FRONT_PAGE` | `["default", "popular", "all"]` | `default` |
| `LAYOUT` | `["card", "clean", "compact"]` | `card` | | `LAYOUT` | `["card", "clean", "compact"]` | `card` |
| `WIDE` | `["on", "off"]` | `off` | | `WIDE` | `["on", "off"]` | `off` |
@ -329,7 +375,6 @@ Assign a default value for each user-modifiable setting by passing environment v
| `SHOW_NSFW` | `["on", "off"]` | `off` | | `SHOW_NSFW` | `["on", "off"]` | `off` |
| `BLUR_NSFW` | `["on", "off"]` | `off` | | `BLUR_NSFW` | `["on", "off"]` | `off` |
| `USE_HLS` | `["on", "off"]` | `off` | | `USE_HLS` | `["on", "off"]` | `off` |
| `FFMPEG_VIDEO_DOWNLOADS` | `["on", "off"]` | `off` |
| `HIDE_HLS_NOTIFICATION` | `["on", "off"]` | `off` | | `HIDE_HLS_NOTIFICATION` | `["on", "off"]` | `off` |
| `AUTOPLAY_VIDEOS` | `["on", "off"]` | `off` | | `AUTOPLAY_VIDEOS` | `["on", "off"]` | `off` |
| `SUBSCRIPTIONS` | `+`-delimited list of subreddits (`sub1+sub2+sub3+...`) | _(none)_ | | `SUBSCRIPTIONS` | `+`-delimited list of subreddits (`sub1+sub2+sub3+...`) | _(none)_ |