The stack can be installed from a plugin URL and started from Settings, the same shape as other Unraid plugin installers.
194 lines
18 KiB
Markdown
194 lines
18 KiB
Markdown
# Working notes
|
|
|
|
Date opened: 2026-11-23.
|
|
|
|
This file is the running record of what was read, what was decided, and what is still unverified. The install steps you actually follow are in the README. When a later change disagrees with this file, update this file in the same commit.
|
|
|
|
## What was asked
|
|
|
|
Put this project on the public Gitea at `git.masengr.com` under `Michael-A-Sloan`, and make it possible to install Fluxer on the Unraid server from that repo. The source of truth given for the product was https://docs.fluxer.com/.
|
|
|
|
## What this project is
|
|
|
|
Fluxer, in these docs, is a self-hosted chat platform: HTTP API, gateway, voice, media proxy, admin API. Official self-hosting is `rexctl` on a normal Linux host, or a Helm chart on Kubernetes. For Unraid, TrueNAS, and Portainer, Fluxer publishes a Docker Compose bundle because those systems run compose for you and are a poor fit for `rexctl`.
|
|
|
|
Pages used:
|
|
|
|
- https://docs.fluxer.com/
|
|
- https://docs.fluxer.com/operator/
|
|
- https://docs.fluxer.com/operator/docker-compose/
|
|
- https://docs.fluxer.com/operator/reverse-proxy/
|
|
- https://docs.fluxer.com/operator/environment/
|
|
- https://docs.fluxer.com/operator/voice-compose/
|
|
- https://fluxer.com/selfhost
|
|
- Compose bundle downloaded 2026-11-23 from https://fluxer.dev/compose/latest
|
|
- GitHub release found while checking the bundle: `fluxerapp/fluxer` tag `fluxer-release@2026.1118.162713`, asset `fluxer-compose-2026.1118.162713.tar.gz` listed at about 49.9 KB. The tarball fetched from `fluxer.dev/compose/latest` was 51164 bytes. Treat the bundle as "whatever latest served that day", not as a pin inside this repo.
|
|
|
|
## What this project is not
|
|
|
|
`c:\Users\Michael Sloan\Desktop\Github Projects\fluxer-unraid` is already a public Gitea repo, https://git.masengr.com/Michael-A-Sloan/fluxer-unraid. Its README says it packages the Remix music bot (MySQL, Redis, NodeLink, `fluxer-bot`). It maps host port 8080. It is a different piece of software that happens to use the same word.
|
|
|
|
This repo must not grow templates for that bot, and the bot's `fluxer-net` network is not the network the official stack creates. The official compose project name is `fluxer`, so its containers are `fluxer-api-1`, `fluxer-postgres-1`, and so on. The bot uses fixed names `fluxer-mysql`, `fluxer-redis`, `fluxer-nodelink`, `fluxer-bot`. They can run on one server if port 8080 is left for the bot. This stack's proxy port is **18080** for that reason, and because Unraid's own UI is often moved to 8080.
|
|
|
|
## Why not rexctl on Unraid
|
|
|
|
`rexctl` installs Docker if it is missing, writes an instance folder (`/opt/fluxer` as root), and owns the compose lifecycle. Unraid already owns Docker. The OS root is not a durable place to keep an instance. The Docker data root is usually a vdisk. Fluxer's own compose page names Unraid as a platform that should use the bundle instead of `rexctl`.
|
|
|
|
`rexctl takeover --dir <stack>` can adopt a bundle install later, including one upgraded by hand. That is an escape hatch, not the install path.
|
|
|
|
## Bundle, as unpacked
|
|
|
|
Top-level files in the 2026-11-23 tarball:
|
|
|
|
- `docker-compose.yml` (project name `fluxer`)
|
|
- `docker-compose.proxy.yml`
|
|
- `tunnel.compose.yml`
|
|
- `external-object-store.compose.yml`
|
|
- `filesystem-object-store.compose.yml`
|
|
- `kv-postgres.compose.yml`
|
|
- `rust-server.compose.yml`
|
|
- `ipv6.compose.yml`
|
|
- `external-voice.compose.yml`
|
|
- `Caddyfile`, `caddy.d/`, `certs/`, `ca/`
|
|
- `.env.example` (large; it is the same catalog as the environment-variables doc)
|
|
- `voice/` for extra LiveKit servers
|
|
|
|
Services in `docker-compose.yml`:
|
|
|
|
| Service | Role | Host ports |
|
|
| --- | --- | --- |
|
|
| edge | Caddy | 80, 443/tcp, 443/udp, unless the proxy file replaces them |
|
|
| postgres | Postgres 16 | none |
|
|
| valkey | cache / queue data | none |
|
|
| nats | internal bus | none |
|
|
| meilisearch | search | none |
|
|
| seaweedfs + seaweedfs-init | bundled S3 | none |
|
|
| livekit | voice | TCP 7881, UDP 7882 |
|
|
| api, worker | main app | none |
|
|
| gateway | WebSocket | none (through the edge at `/gateway`) |
|
|
| media-proxy, push, static-proxy, app-proxy | media, push, static, web app | none |
|
|
| snowflakes, users, gifs, messages, unfurl, admin | smaller services | none |
|
|
|
|
Images are pinned by digest. App images are `ghcr.io/fluxerapp/...`. No GHCR login is required for a public pull. This repo does not copy those pins into git. An upgrade is "download the new bundle", which is what Fluxer documents, because the digests change every release.
|
|
|
|
Named volumes in the bundle: `edge-data`, `edge-config`, `postgres-data`, `valkey-data`, `nats-data`, `meilisearch-data`, `seaweedfs-data`, `media-proxy-tmp`.
|
|
|
|
`docker-compose.proxy.yml` is tiny and important. It replaces the edge port list with:
|
|
|
|
```yaml
|
|
ports: !override
|
|
- "${FLUXER_EDGE_BIND:-127.0.0.1:8080}:8080"
|
|
```
|
|
|
|
and sets the site address to `:8080`, clears the TLS directive, and trusts `private_ranges`. The `!override` tag is why Compose must be 2.24 or newer. Older Compose will refuse the file or mis-merge the ports and try to bind 80 and 443 as well.
|
|
|
|
Compose will not start at all unless `FLUXER_SETTINGS_LOADED=true`. That variable is the bundle's way of saying "a human filled in .env; rexctl is not in charge".
|
|
|
|
## Decisions
|
|
|
|
1. **Ship an installer, not a fork.** Vendoring `docker-compose.yml` would freeze image digests and drift from Fluxer's upgrade instructions ("unpack the new bundle over the folder, keep `.env`"). `scripts/prepare-unraid.sh` downloads `https://fluxer.dev/compose/latest` into `stack/` on the server. `stack/` is gitignored because it contains that bundle and the generated secrets.
|
|
|
|
2. **Default to a reverse proxy.** Unraid, Nginx Proxy Manager, SWAG, or Traefik almost always owns 80/443. Direct Caddy remains available with `--direct`.
|
|
|
|
3. **Publish the edge on `0.0.0.0:18080`, not `127.0.0.1:8080`.** The documented bind is correct when the proxy is a process on the same network namespace as the host. On Unraid the proxy is another container. It cannot connect to the host's `127.0.0.1`. Publishing only on loopback also hides the port from the LAN IP that NPM is told to use. Port 18080 avoids the bot repo's 8080 mapping and the usual Unraid UI port.
|
|
|
|
4. **Bind-mount data under `/mnt/user/appdata/fluxer`.** A named volume with the local driver stores bytes in Docker's data root. On Unraid that is `docker.img` until someone changes it. SeaweedFS holds uploads. A busy chat would fill the vdisk and Docker would stop. `unraid/docker-compose.unraid.yml` recreates each named volume as a bind. The directory has to exist first; the prepare script creates it. Compose will not retarget a volume that already exists. The prepare script warns if `fluxer_postgres-data` is already there.
|
|
|
|
5. **Keep the project name `fluxer`.** Volume names become `fluxer_postgres-data` and so on. Changing the project name later creates a second, empty set of volumes. `COMPOSE_PROJECT_NAME=fluxer` is written into `.env` so a different folder name cannot silently rename the project.
|
|
|
|
6. **Generate secrets once, in `.env`, mode 600.** The official `sed` loop is the list of keys. ActivityPub signing key and VAPID keys are generated too. `FLUXER_S3_ACCESS_KEY` stays `fluxer` and `LIVEKIT_API_KEY` stays `fluxer`, matching the seaweed init user and the LiveKit key the bundle expects. Re-running prepare does not rotate secrets. `--update` does not rewrite `COMPOSE_FILE` unless `--proxy` or `--direct` is passed again, so extra compose files a person added (filesystem object store, for example) survive an upgrade.
|
|
|
|
7. **Shrink the first-run memory profile.** Counted from `deploy.resources.limits.memory` defaults in the unpacked compose file, the caps add up to roughly 19 GB (Postgres 5 GB, API 2.5 GB, worker 2.5 GB, SeaweedFS 2 GB, Meilisearch 1.5 GB, plus a long tail of 256 MB services). Those limits are caps, not reservations, but two settings are real RAM even if a Compose version ignores `deploy.resources`: `shm_size` defaults to 1 GB, and Postgres is started with `shared_buffers=512MB`. The official "4 GB is enough" line is about `rexctl`, which resizes to the machine. Raw compose does not. The first `.env` sets a home profile (Postgres cap 1 GB, shm 256 MB, shared_buffers 128 MB, API and worker caps 768 MB, and smaller caps for gateway, Meilisearch, SeaweedFS, and the media proxy). Later edits to `.env` are kept. This profile is a guess for a home server, not a number Fluxer published. If a container is OOM-killed, raise that one limit.
|
|
|
|
8. **Do not build eighteen Unraid XML templates.** One template is one container. This stack is about twenty containers that must share a compose network and start in health-check order. The Docker UI would hide that. Compose is the interface Fluxer documents for Unraid.
|
|
|
|
9. **Backup is a script, not rexctl.** `rexctl backup` does not exist without rexctl. The script follows the compose doc: `pg_dump --format=custom`, then stop, then archive the data directories, then start. Because data is bind-mounted, the archive is the appdata tree rather than `docker run` against named volumes. The dump is taken before the stop so a failed dump does not take the stack down. After the stop, an EXIT trap starts it again if the tar fails.
|
|
|
|
10. **Username sign-in needs no extra key when email is off.** `FLUXER_ACCOUNT_IDENTITY` is used only on the first start. Empty means: email if delivery is configured, otherwise username. The setup wizard asks again and its answer wins. Leaving the variable empty is deliberate.
|
|
|
|
## Ports
|
|
|
|
| Port | When | Why |
|
|
| --- | --- | --- |
|
|
| 18080/tcp on the host | proxy mode | NPM / SWAG / Traefik → edge container port 8080 |
|
|
| 80, 443/tcp, 443/udp | direct mode only | Caddy and HTTP/3 |
|
|
| 7881/tcp, 7882/udp | always, if calls should work | LiveKit media. Not proxied. One UDP port, not a range, so Docker's port publish is enough. |
|
|
|
|
Proxy requirements copied from the reverse-proxy page, and turned into `unraid/npm-advanced.conf`: TLS 1.2 and 1.3, WebSockets, 512 MB body, one-hour idle timeout, no extra CSP, forward every path unchanged, `X-Forwarded-For` set from the socket address rather than appended to a client-supplied value. Health check path, if a proxy wants one, is `/_health`.
|
|
|
|
`FLUXER_EDGE_TRUSTED_PROXIES` defaults to `private_ranges` in the proxy compose file. That matches a proxy on a private LAN or a Docker bridge. A proxy that connects from a public IP would need that setting changed or every user would share the proxy's rate limit.
|
|
|
|
## Secrets that must not change after first start
|
|
|
|
From the environment doc and `.env.example`:
|
|
|
|
- `POSTGRES_PASSWORD` (Postgres applies it only on an empty data directory)
|
|
- `MEILI_MASTER_KEY`
|
|
- `FLUXER_VAPID_PUBLIC_KEY` and `FLUXER_VAPID_PRIVATE_KEY`
|
|
|
|
Other secrets can be rotated only with the side effects the environment page describes (kicking admin sessions, invalidating in-flight links, and so on). The safe habit is to treat the whole `.env` as permanent and back it up with the database.
|
|
|
|
## Unraid hazards written down so they are not rediscovered
|
|
|
|
- **docker.img still fills with images.** Bind mounts move Postgres and SeaweedFS out of the vdisk. They do not move the image layers. Expand the vdisk or use a directory data-root before the first pull.
|
|
- **Postgres on `/mnt/user` across multiple disks.** Prefer a cache-only appdata path. The script refuses `/boot` because the USB flash drive is not a database disk. It cannot see whether the share is cache-only.
|
|
- **Existing named volumes ignore the new bind options.** Symptom: `docker volume inspect fluxer_postgres-data` has an empty device, while `/mnt/user/appdata/fluxer/postgres` stays empty and the real data is in the vdisk.
|
|
- **Meilisearch and Postgres file ownership.** Official images chown their data directory on an empty start when the container starts as root, which is the Unraid default. If a bind is created with odd permissions and a service boot-loops, that is the first place to look. Not reproduced here.
|
|
- **CGNAT.** No inbound 7881/7882 means no calls unless TURN is added. The web app can still work through a tunnel or a public proxy.
|
|
- **Cloudflare orange-cloud.** The reverse-proxy page says turn Rocket Loader off, do not cache HTML, turn Bot Fight Mode off for `/api/`, `/gateway`, and `/livekit/`, and use Full (strict). A tunnel still cannot carry voice.
|
|
- **First start is slow.** The edge waits until the API and gateway are healthy. `docker compose ps` during the pull looks broken. It is not done until those health checks pass.
|
|
- **Compose path separator is set to `:`.** Unraid is Linux, where that is the default. Writing it down keeps a copied `.env` from being re-read with Windows' semicolon rule. A Windows `docker compose` still needs the variable visible early enough to split `COMPOSE_FILE`; the prepare script's own check runs on the server.
|
|
- **Upgrade deletes nothing we add, and overwrites everything in the tarball.** `.env` is not in the tarball, so it survives. `docker-compose.unraid.yml` is copied back from this repo after each download. Hand edits to `Caddyfile` inside `stack/` are wiped by `--update`. Put lasting edge changes in a way that survives, or re-apply them after an update. Not automated.
|
|
|
|
## Thought sequence
|
|
|
|
The first reading of "Fluxer on Unraid" collided with the music-bot repo. The docs URL settled that: this is the chat server, and Fluxer already tells Unraid users to use compose.
|
|
|
|
The next trap was following the compose page literally (`127.0.0.1:8080`, named volumes, the `sed` secret loop, `docker compose up -d`). Each of those is right on a single-purpose Linux VM and wrong, or incomplete, on Unraid. The bind file, the port, and the memory profile are the parts that exist only because the host is Unraid.
|
|
|
|
rexctl was rejected after reading where it stores the instance and that the compose page lists Unraid by name. XML templates were rejected because the stack is one compose project, not four independent containers like the music bot.
|
|
|
|
The bundle was downloaded and read before the override was written, so the volume names and the proxy port merge match this release's files. Those names are stable in the docs (the backup section lists `seaweedfs-data`, `meilisearch-data`, `valkey-data`, `nats-data`). If a future bundle renames a volume, `docker compose config` in the prepare script should fail or the new volume will fall back to the vdisk. Check `docker volume ls` after the first up of a new release.
|
|
|
|
## Checked on this workstation
|
|
|
|
2026-11-23, after the scripts were written:
|
|
|
|
- `scripts/prepare-unraid.sh chat.example.com` was run with the stack and data paths pointed at a temp directory. It downloaded the live bundle, wrote one assignment per setting, generated a 64-character hex setup token and database password, an 87-character VAPID public key, a 43-character VAPID private key, and left `FLUXER_S3_ACCESS_KEY` and `LIVEKIT_API_KEY` at `fluxer`. A second run did not change `.env`. A hand-added compose file on `COMPOSE_FILE` survived a later run that did not pass `--proxy` or `--direct`. `--direct` wrote `docker-compose.yml:docker-compose.unraid.yml` and did not publish an edge bind.
|
|
- Docker Compose 5.1.4 rendered that stack. The edge publishes `18080 -> 8080` and does not publish 80 or 443. LiveKit publishes 7881 and 7882. The bundle maps 7882 as UDP; the render confirmed the host and container port numbers. All eight data volumes are binds under the appdata path. The containers were not started, and this was not the Unraid machine. Compose on Windows only split `COMPOSE_FILE` after `COMPOSE_PATH_SEPARATOR=:` was set in the environment; Unraid's default separator is already `:`.
|
|
|
|
## Not done, on purpose
|
|
|
|
- The stack was not started, here or on Unraid. Rendering the compose file is not the same as a healthy API.
|
|
- No domain, LAN IP, proxy brand, RAM size, or CGNAT fact was supplied. The script takes the domain as an argument. Proxy mode is the default. Nothing was invented for DNS.
|
|
- Email, Stripe, ClamAV, Cloudflare cache purge, extra voice regions, and an external S3 bucket are in the environment page and were left at the bundle defaults (off or empty).
|
|
- `rust-server.compose.yml` collapses the Rust services into one container and might use less RAM. It was not turned on. Combining it with the Unraid volume file needs a `docker compose config` against that exact release before it is the default.
|
|
- No `rexctl` install, and no copy of Fluxer's images into a private registry. The Community Apps entry uses the public `docker:28-cli` image only as a supervisor.
|
|
|
|
## How to extend this without making a mess
|
|
|
|
- A new durable setting belongs in the "create `.env`" branch of `scripts/prepare-unraid.sh`, not in a second env file. Compose reads `stack/.env`.
|
|
- A new volume in an upstream bundle needs a bind in `unraid/docker-compose.unraid.yml` and a `mkdir` in the prepare script, or its data goes into `docker.img`.
|
|
- Do not commit `stack/.env`, `stack/`, or `backups/`. They hold the database keys and the admin setup token.
|
|
- If the install is later handed to `rexctl`, point `rexctl takeover` at `stack/` and keep the same project name.
|
|
|
|
## Community Apps and the plugin
|
|
|
|
`https://github.com/mvandenbulcke/fluxer-unraid` is an Unraid plugin. Its `.plg` is installed from **Plugins → Install Plugin**, and the package adds **Settings → Fluxer**. Community Applications submission for that project was still pending review. A GitHub release does not by itself create an Apps search hit.
|
|
|
|
This repository now has the same install shape, aimed at the proxy setup already documented here:
|
|
|
|
- `fluxer.plg` is the package URL.
|
|
- `plugin/Fluxer.page` is the Settings page.
|
|
- `templates/fluxer.xml` and `ca_profile.xml` are the catalog files a Community Applications scan expects. The public catalog indexes GitHub. This project is on Gitea, so those files do not put it in the worldwide Apps list by themselves.
|
|
- Start and Stop call `scripts/prepare-unraid.sh` on the Unraid host. There is no Docker socket container in this path.
|
|
- The older `unraid/fluxer.xml` Docker template remains a Private Apps option.
|
|
|
|
The plugin does not copy that other project's Cloudflare Tunnel or Traefik setup. Proxy mode still binds port 18080 for the reverse proxy already running on the server.
|
|
|
|
## Publishing
|
|
|
|
Target remote: `https://git.masengr.com/Michael-A-Sloan/Fluxer-selfhost-unraid` public.
|
|
|
|
On 2026-11-23 the site first returned HTTP 502, so the first push did not run. A later check returned HTTP 200 for the site. The repository URL was still 404 because nothing had been pushed.
|