Changing settings
Settings control how Squad runs, like its domain, email server and storage. Most of the rest, such as its name, sign-up rules and limits, are in the admin panel.
Where settings go
Заголовок раздела «Where settings go»Every Squad setting is spelled the same on every way of running it, like FLUXER_DOMAIN.
| How you run Squad | Where settings go |
|---|---|
| Docker without rexctl | fluxer.env |
| systemd without rexctl | /etc/fluxer/fluxer.env |
| Kubernetes | Under config in the Helm chart |
| rexctl, on Docker, Podman or systemd | rexctl config set |
Change a setting
Заголовок раздела «Change a setting»Edit fluxer.env, then apply it.
docker compose up -dCompose recreates the container with the new settings, which restarts Squad. With docker run, run docker stop fluxer && docker rm fluxer, then the same docker run line again. The volume keeps your data.
Edit /etc/fluxer/fluxer.env, then reload.
systemctl reload fluxerdSquad restarts only the changed parts.
Set the value under config and upgrade the release. The first line looks up the chart version you run, so Helm keeps that version.
Для Squad скачайте исходники и конфигурацию сборки. Команда получения готового пакета для этой платформы отсутствует.
A change to config restarts the pod.
Passwords go in the Secret that existingSecret points to, and after a change to it run kubectl -n fluxer rollout restart statefulset/fluxer.
rexctl config set FLUXER_SEARCH_ENGINE nonerexctl checks the value, shows what restarts and for about how long, and asks first. rexctl config get shows one setting, and rexctl config list --all every setting.
To check a settings file without starting anything, run fluxerd check-config, for example docker compose exec fluxer fluxerd check-config with the compose file or docker exec fluxer fluxerd check-config with docker run.
Secrets in files
Заголовок раздела «Secrets in files»Every setting also takes its value from a file. Add _FILE to the setting’s name, set it to the path of a file with the value, and leave the plain name unset. This keeps passwords out of fluxer.env and works with Docker and Kubernetes secrets.
FLUXER_EMAIL_SMTP_PASSWORD_FILE=/run/secrets/smtp-passwordWith the compose file, add the file as a Compose secret, which Docker puts at /run/secrets/smtp-password in the container.
services: fluxer: secrets: [smtp-password]
secrets: smtp-password: file: ./smtp-password.txtWith docker run, add -v ./smtp-password.txt:/run/secrets/smtp-password:ro to the line, which mounts the file at the same path.
The file has to be readable by the account Squad runs as, which is user ID 65532 in the container. Docker keeps the file’s owner and mode, so give that account the file.
sudo chown 65532 smtp-password.txt && sudo chmod 400 smtp-password.txtCompose treats $ in fluxer.env as the start of a variable. Keep any password that has a $ in it in a file like this one, never in fluxer.env itself.
GeoIP database
Заголовок раздела «GeoIP database»With a MaxMind GeoLite2 or GeoIP2 City or Country database, Squad can look up which country an IP address is in. With rexctl, pass the .mmdb file.
rexctl config set geoip.database=/root/GeoLite2-City.mmdbrexctl checks that the file is a MaxMind database, copies it into the geoip folder of the instance and sets FLUXER_GEOIP_DB_PATH for the api and worker. The copy is in every backup and stays through upgrades. For a newer database, run the same command with the new file. rexctl copies the file only when it changed, and removes the copy it no longer uses.
To stop using a GeoIP database, run rexctl config unset geoip.database. That also clears a FLUXER_GEOIP_DB_PATH you set by hand.
On the older layout with Docker Compose, rexctl doesn’t copy the file. Mount its folder into the api and worker with rexctl config edit --compose, then set geoip.database to the path inside the containers.
Without rexctl, put the file where Squad can read it and set FLUXER_GEOIP_DB_PATH to its path.
Keep data on another disk
Заголовок раздела «Keep data on another disk»Squad keeps its database, uploads and search index in one data folder. To keep them on a second disk, a RAID or a ZFS dataset, give Squad a folder there. Use a local disk with a Linux file system like ext4, XFS, Btrfs or ZFS. On NTFS, a FUSE file system like mergerfs, or a network share over NFS or SMB, PostgreSQL can lose data or fail to lock its files, and rexctl refuses a folder there. If you accept that risk, pass --force with the folder, and rexctl doctor then warns about it instead of failing. rexctl always refuses a RAM disk, FAT and exFAT.
A dataset or subvolume root can have a snapshot folder, such as .zfs with ZFS snapdir=visible, .snapshots from Snapper, #snapshot on Synology or .snapshot on a NetApp share. rexctl and Squad leave these folders alone when they check, copy, back up, restore or delete the data. A folder with only a snapshot folder in it counts as empty.
Add the disk to /etc/fstab, which mounts it before Docker, Podman or Squad starts when the machine boots.
To keep only the uploads somewhere else, put them in an S3-compatible store with the file storage settings instead. The database and search index then stay on this machine. For an instance that already has uploads, see Move uploads to S3 and back.
Create the folder and give it to the user Squad runs as, which is user ID 65532 in the container.
sudo mkdir -p /mnt/disk/fluxer && sudo chown 65532:65532 /mnt/disk/fluxer && sudo chmod 700 /mnt/disk/fluxerIn compose.yaml, mount the folder in place of the volume, and remove fluxer-data from the volumes list at the end of the file. On a machine with SELinux, such as Fedora or RHEL, add :z to the end of the line.
services: fluxer: volumes: - /mnt/disk/fluxer:/var/lib/fluxerWith docker run, pass -v /mnt/disk/fluxer:/var/lib/fluxer in place of -v fluxer-data:/var/lib/fluxer. For an instance that already runs, make a backup first, change the mount, then restore the backup into the empty folder.
Squad keeps its data in /var/lib/fluxer. Mount the disk there before you create that folder in the install steps. The folder on the disk then belongs to the fluxer account.
In one container on Docker or Podman, pass the folder when you install, or set it later.
rexctl install --data-folder /mnt/disk/fluxerrexctl config set data.folder=/mnt/disk/fluxerThe folder has to be empty or new. On an instance that already runs, rexctl stops Squad, copies its data into the folder and checks that the copy has the same number of files and bytes. It then starts Squad from the folder, and goes back to the old place if Squad doesn’t start. The old copy stays until you delete it, and rexctl prints the command for that. rexctl config unset data.folder moves the data back into a volume.
Backups, restores, upgrades and rexctl detach use the folder too. When the folder is empty, such as when its disk isn’t mounted, rexctl doesn’t start Squad there and rexctl doctor reports it.
Under systemd, Squad keeps its data in /var/lib/fluxer. Mount the disk there before you install.
Move uploads to S3 and back
Заголовок раздела «Move uploads to S3 and back»On one container that rexctl runs, rexctl migrate moves the uploads an instance already has from plain files in its data folder to an S3-compatible store, such as MinIO, SeaweedFS, Garage, Backblaze B2 or Amazon S3, and back again. Under systemd, rexctl can’t make this move yet.
Create the buckets in the store first and leave them empty. Squad uses four of them, for processed media, raw uploads, abuse report evidence and data exports. They are fluxer, fluxer-uploads, fluxer-reports and fluxer-harvests, or the buckets you set with --set. On Amazon S3, no two accounts can have a bucket with the same name, and there you usually need your own. Then run the move with the address and keys of the store. With - as the value, rexctl asks for the secret key on a terminal or takes it from stdin, which keeps it out of your shell history.
rexctl migrate --migrate s3 --dry-run \ --set storage.endpoint=https://s3.eu-central-1.amazonaws.com \ --set storage.region=eu-central-1 \ --set storage.path_style=false \ --set storage.access_key=AKIAIOSFODNN7EXAMPLE \ --set storage.secret_key=- \ --set FLUXER_S3_BUCKET_CDN=example-fluxer \ --set FLUXER_S3_BUCKET_UPLOADS=example-fluxer-uploads \ --set FLUXER_S3_BUCKET_REPORTS=example-fluxer-reports \ --set FLUXER_S3_BUCKET_HARVESTS=example-fluxer-harvests--set takes storage.endpoint, storage.public_endpoint, storage.region, storage.path_style, storage.access_key, storage.secret_key and the four FLUXER_S3_BUCKET_* settings. The dry run signs in to the store, checks that each bucket exists, is empty and takes a test write, counts the files and shows the plan. Some stores refuse a key with a part longer than 255 bytes, such as SeaweedFS unless max_file_name_length in its filer.toml is higher. When some of your files have such a name, the dry run tests that too. Without --dry-run, rexctl then does this:
- Backs up your instance.
- Stops the api, worker, media proxy and gateway while the files move.
- Copies every file to its bucket with its full key and content type.
- Checks that the store has every file with the same size, and compares the SHA-256 checksums of a sample that includes every file with a long name.
- Switches Squad to the store and starts it.
- Loads a sample of attachments through the media proxy, with signed links when signed attachments are on.
If a step fails, rexctl deletes what it copied, switches Squad back to the plain files and starts it again. When Squad had already started on the store, rexctl first copies the files people uploaded since then back into the folder.
The plain files stay in the data folder after the move. rexctl migrate --undo s3 copies the files people uploaded after the move into the folder, switches Squad back to the plain files and deletes the objects in the buckets. Once uploads look right, rexctl migrate --clean-up deletes the plain files. Backups of an instance on S3 leave out the uploads, and the store needs a backup of its own.
To move the uploads from the store to plain files, run rexctl migrate --migrate files. rexctl checks that the data folder is empty and has room for the files, copies them into the folder in the layout Squad writes and checks them the same way. rexctl migrate --undo files copies the files people uploaded after the move into the buckets and switches Squad back to the store. rexctl migrate --clean-up finishes the move and forgets the keys of the store. rexctl never deletes objects in your own store after this move. Delete the buckets yourself once you no longer need them.
Don’t copy the objects folder to the buckets by hand, or the buckets to the folder, with tools such as aws s3 sync, rclone or mc mirror. In the folder, Squad shortens file names longer than 255 bytes and keeps the full key and the content type of a file in the .meta folder. A copy by hand gives those files the wrong keys and many files the wrong content type. Squad then can’t find them, or serves them as the wrong kind of file.
Put the container on your own network
Заголовок раздела «Put the container on your own network»Squad’s container can join a Docker or Podman network you already made, such as a macvlan or ipvlan network that gives it its own address on your LAN, or a bridge network that your reverse proxy is on.
On a macvlan or ipvlan network, Docker doesn’t publish ports. Squad then listens on its own address on that network: ports 80 and 443 for HTTP and HTTPS, or 8080 behind a proxy, and 7881 on TCP and 7882 on UDP for voice. Forward the voice ports from your router to that address, not to the machine. The machine itself can’t connect to a macvlan container unless you add a macvlan shim on the machine.
In compose.yaml, add the network to the service, with a fixed address if you want one, and mark the network as external. Leave out the ports list.
services: fluxer: networks: br0: ipv4_address: 192.168.1.50
networks: br0: external: trueIn one container on Docker or Podman, pass the network when you install, or set it later.
rexctl install --network br0 --network-address 192.168.1.50rexctl config set network.attach=br0 network.address=192.168.1.50rexctl checks that the network exists and that the address is in its subnet and free. It then creates the container again on that network on every install, upgrade, restore and start, and rexctl detach writes the network into compose.yaml. rexctl doctor checks the network and the address too.
With network.attach set, rexctl publishes no ports on this machine. Squad listens on the container’s own address with its HTTP, HTTPS and voice ports, and behind a proxy on the port in edge.bind. To keep the ports published on this machine as well, set network.keep_default=true, and the container stays on the engine’s default network next to yours. rexctl config unset network.attach network.address puts the container back on the default network.
Passwords and keys Squad makes
Заголовок раздела «Passwords and keys Squad makes»On its first start, Squad creates its own passwords and keys and keeps them in secrets.env in its data folder. You never need to set them. Every backup includes them.
Set one only to replace the value Squad made, and check what each one changes first.