diff --git a/README.md b/README.md index fcae126c..a7ec6e26 100644 --- a/README.md +++ b/README.md @@ -34,13 +34,13 @@ - [Docker](#docker) - [Docker Compose](#docker-compose) - [Docker CLI](#docker-cli) - - Podman + - Podman - Quadlets - [Binary](#binary) - [Running as a systemd service](#running-as-a-systemd-service) - [Building from source](#building-from-source) - - [Replit/Heroku/Glitch](#replit-heroku-glitch) + - [Replit/Heroku/Fly.io](#replitherokuflyio) - [launchd (macOS)](#launchd-macos) 6. [Configuration](#configuration) - [Instance settings](#instance-settings) @@ -216,7 +216,7 @@ Stream logs from the Redlib container: ```bash docker logs -f redlib ``` -## Podman +## Podman [Podman](https://podman.io/) lets you run containerized applications in a rootless fashion. 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. @@ -225,8 +225,8 @@ Container images for Redlib are available at [quay.io](https://quay.io/repositor ### Quadlets > [!IMPORTANT] -> These instructions assume that you are on a systemd based distro with [podman](https://podman.io/). If not, follow these [instructions on podman's website](https://podman.io/docs/installation) for how to do so. -> It also assumes you have used `loginctl enable-linger ` to enable the service to start for your user without logging in. +> These instructions assume that you are on a systemd based distro with [podman](https://podman.io/). If not, follow these [instructions on podman's website](https://podman.io/docs/installation) for how to do so. +> It also assumes you have used `loginctl enable-linger ` to enable the service to start for your user without logging in. Copy the `redlib.container` and `.env.example` files to `.config/containers/systemd/` and modify any relevant values (for example, the ports Redlib should listen on, renaming the .env file and editing its values, etc.). @@ -244,7 +244,7 @@ systemctl --user start redlib.service ``` You can check the status of your container by using the following command: -```bash +```bash systemctl --user status redlib.service ``` @@ -313,7 +313,7 @@ git clone https://github.com/redlib-org/redlib && cd redlib cargo run ``` -## Replit/Heroku +## Replit/Heroku/Fly.io > [!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. @@ -321,6 +321,17 @@ cargo run Run on Repl.it [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/redlib-org/redlib) +### Fly.io +Fly.io lets you run an app with 512mb memory for free per month. Don't worry if you see your monthly bill going up, if it's less than $5, they will waive the cost. + +- Install flyctl by `brew install flyctl` or see other options at https://fly.io/docs/getting-started/launch/ +- Create an account with `fly auth signup` or log in with `fly auth login`. +- `git clone https://github.com/redlib-org/redlib && cd redlib` +- Edit fly.toml to configure your redlib instance +- `fly deploy` +- Go to https://replace-this-name.fly.dev and now you have your own redlib instance +- To upgrade your instance to the latest build, run `fly deploy --image quay.io/redlib/redlib:latest` + ## launchd (macOS) If you are on macOS, you can use the [launchd](https://en.wikipedia.org/wiki/Launchd) service available in `contrib/redlib.plist`. @@ -441,4 +452,4 @@ Assign a default value for each user-modifiable setting by passing environment v | `HIDE_SCORE` | `["on", "off"]` | `off` | | `HIDE_SIDEBAR_AND_SUMMARY` | `["on", "off"]` | `off` | | `FIXED_NAVBAR` | `["on", "off"]` | `on` | -| `REMOVE_DEFAULT_FEEDS` | `["on", "off"]` | `off` | \ No newline at end of file +| `REMOVE_DEFAULT_FEEDS` | `["on", "off"]` | `off` | diff --git a/fly.toml b/fly.toml new file mode 100644 index 00000000..59f85a87 --- /dev/null +++ b/fly.toml @@ -0,0 +1,20 @@ +app = "replace-this-name" # Your free redlib instance will be at https://replace-this-name.fly.dev +primary_region = "sea" # Choose a region closest to you, see https://fly.io/docs/reference/regions/ + +[build] +image = "quay.io/redlib/redlib:latest" + +[env] +REDLIB_DEFAULT_THEME = "dark" # Add more env variables here + +[http_service] +auto_start_machines = true +force_https = true +internal_port = 8_080 +min_machines_running = 0 +processes = [ "app" ] + +[[vm]] +cpu_kind = "shared" +cpus = 1 +memory = "512mb"