Day-to-day tasks
A few commands check on Squad, read its logs, restart parts of it and help people back into their accounts. Pick the tab for the way you run Squad.
Where the commands run
Заголовок раздела «Where the commands run»| How you run Squad | What to use |
|---|---|
| Docker Compose | The first Docker command, run in the folder with compose.yaml |
docker run | The second Docker command |
| Linux by hand | The unit fluxerd |
| rexctl on systemd | The rexctl commands with sudo in front, or the unit fluxer |
| rexctl on Docker or Podman | The rexctl commands, as the account that installed Squad |
Root manages a rexctl install on systemd, so its rexctl commands need sudo. With Podman without root, the instance belongs to your account, so leave out sudo. With rexctl on systemd, you can also use the plain systemd commands systemctl status fluxer and journalctl -u fluxer.
docker compose exec fluxer fluxerd psdocker exec fluxer fluxerd pssystemctl status fluxerdrunuser -u fluxer -- /opt/fluxer/current/bin/fluxerd pskubectl -n fluxer exec fluxer-0 -- fluxerd psrexctl statusfluxerd pslists every part of Squad with its state and restarts. Under systemd it adds how often the unit running Squad restarted,fluxer.servicewith rexctl andfluxerd.serviceby hand. It ends with a line when a newer release is out, once you have turned on the daily release check.fluxerd versionthen shows the upgrade command, and on a rexctl installrexctl statusshows a New release row.fluxerd healthexits with 0 when every part of Squad is ready.- Under systemd,
systemctl status fluxerwith rexctl orsystemctl status fluxerdby hand has aStatusline. It saysstarting,ready,degraded,stoppingorstopped, and lists the parts that are not healthy.
docker compose logs fluxerdocker compose exec fluxer fluxerd logs apiWith docker run, use docker logs fluxer for the whole log and docker exec fluxer fluxerd logs api for one part.
journalctl --user -u fluxerpodman exec fluxer fluxerd logs apiThese commands are for the Quadlet file. As root, leave out --user. With podman run, podman logs fluxer shows the whole log.
journalctl -u fluxerdrunuser -u fluxer -- /opt/fluxer/current/bin/fluxerd logs apikubectl -n fluxer logs fluxer-0kubectl -n fluxer exec fluxer-0 -- fluxerd logs apirexctl logsrexctl logs apiThe first command shows every part and the second only one. Add -f to follow new lines.
Each of these parts has its own logs.
| Part | What it is |
|---|---|
postgres | PostgreSQL with all of Squad’s data |
api | The HTTP API and the background worker |
gateway | The WebSocket connections for live updates |
media-proxy | Resizes and serves images and other media |
rust | Eight smaller services in one process. An older instance shows them as separate parts |
meilisearch | Message and member search |
livekit | The voice and video server |
valkey | Cache and rate limits, on older installs that still use it |
seaweedfs | Uploads, on older installs that still use it |
Restart one part
Заголовок раздела «Restart one part»docker compose exec fluxer fluxerd ctl restart gatewaydocker exec fluxer fluxerd ctl restart gatewayrunuser -u fluxer -- /opt/fluxer/current/bin/fluxerd ctl restart gatewaykubectl -n fluxer exec fluxer-0 -- fluxerd ctl restart gatewayrexctl restart gatewayStop and start
Заголовок раздела «Stop and start»docker compose stopdocker compose startWith docker run, use docker stop fluxer and docker start fluxer.
systemctl stop fluxerdsystemctl start fluxerdkubectl -n fluxer scale statefulset/fluxer --replicas 0kubectl -n fluxer scale statefulset/fluxer --replicas 1rexctl stoprexctl startSquad stops every part and PostgreSQL last, which can take up to 130 seconds. Give it that long, and never stop it with docker rm -f or kill -9.
Invite people
Заголовок раздела «Invite people»A new instance lets only people with an invite link create an account. There are two kinds of invite link, and new people usually need both.
- An account invite lets someone create an account. Only admins can make one.
- A community invite lets someone who already has an account join one community. Anyone allowed to invite in that community can make one, as on fluxer.com.
Open the admin panel at https://chat.example.com/admin with your domain, and sign in with your admin account. Under Configuration, open “Instance Config”.
In the “Registration Controls” card, use “Create Admin-Issued Registration URL”, with a label, how many days it works and how many people can use it. You can also pick a community that people join right after they sign up.
The new link appears under “Existing Registration URLs”, where “Copy URL” copies it and “Revoke” stops it working. “Registration Policy” in the same card changes who can sign up.
rexctl invites create --uses 10 --expires 7drexctl registration set approvalrexctl invites create prints the link. rexctl registration set sets who can sign up, to open, approval, invite or closed.
To make a community invite, open the community in the app, open its menu and choose “Invite members”, which gives you a link.
How people join
Заголовок раздела «How people join»Send each person the account invite link. It opens your instance in their browser, where they create an account and can use Squad right away.
In the apps, people choose your instance on the sign-in screen and enter your domain, such as chat.example.com, as the instance address. Notifications on the mobile apps need the push relay, which the setup wizard asks about. Your instance encrypts these notifications so that only your instance and the device they’re for can read them. Squad, Apple and Google pass them on without being able to read them, but they can still see that a notification was sent, when it was sent and the device it’s for.
Help someone back into their account
Заголовок раздела «Help someone back into their account»When someone can’t reset their own password, create a reset link for them. It works once for an hour, so send it over a channel you trust. It also works for your own admin account.
Squad records the link in the audit log under the account, without the link itself.
docker compose exec fluxer fluxerd users reset-link alexdocker exec fluxer fluxerd users reset-link alexpodman exec fluxer fluxerd users reset-link alexrunuser -u fluxer -- /opt/fluxer/current/bin/fluxerd users reset-link alexkubectl -n fluxer exec fluxer-0 -- fluxerd users reset-link alexrexctl users reset-link alexOn systemd, put sudo in front.
Pass a username, an email address or a user ID.
In the admin panel, open Users under Lookup and find the account. On its Account tab, “Create Password Reset Link” shows the same kind of link. Scripts can use Create password reset link in the admin API, with a key from “Admin API Keys” under Configuration. Lost passwords work differently on instances with email or single sign-on.
Add an admin
Заголовок раздела «Add an admin»This creates an account with full admin access and prints a link to set its password, as above. Use it when nobody can sign in to the admin panel.
docker compose exec fluxer fluxerd users create alex --admindocker exec fluxer fluxerd users create alex --adminpodman exec fluxer fluxerd users create alex --adminrunuser -u fluxer -- /opt/fluxer/current/bin/fluxerd users create alex --adminkubectl -n fluxer exec fluxer-0 -- fluxerd users create alex --adminrexctl users create alex --adminOn systemd, put sudo in front.
On an instance where people sign in with an email address, add --email alex@example.com. Without --admin, you get an ordinary account.
Move to a new machine
Заголовок раздела «Move to a new machine»Squad asks Let’s Encrypt for a certificate when it starts, and that only works once your domain points at the machine. Move in this order.
- A day before, lower the TTL of your domain’s DNS records, such as to 5 minutes.
- Take a backup and stop Squad on the old machine right away. Anything people post after the backup stays on the old machine.
- On the new machine, restore the backup with the same domain, and don’t start Squad until your domain’s DNS records point there.
- Point your domain’s DNS records at the new machine’s IP address.
- Start Squad there. It gets its certificate once the new records are out.
Don’t start the old instance again. With rexctl, run rexctl restore or the install.sh ... restore command after step 4, because it starts Squad right away.
A backup restores into any way of running Squad, so this can also move an instance between Docker, systemd and Kubernetes.
Change how Squad runs
Заголовок раздела «Change how Squad runs»Change any setting. Behind your own proxy, add your own routes and headers there.