Перейти к содержимому

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.

How you run SquadWhat to use
Docker ComposeThe first Docker command, run in the folder with compose.yaml
docker runThe second Docker command
Linux by handThe unit fluxerd
rexctl on systemdThe rexctl commands with sudo in front, or the unit fluxer
rexctl on Docker or PodmanThe 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 ps
docker exec fluxer fluxerd ps
  • fluxerd ps lists every part of Squad with its state and restarts. Under systemd it adds how often the unit running Squad restarted, fluxer.service with rexctl and fluxerd.service by hand. It ends with a line when a newer release is out, once you have turned on the daily release check.
  • fluxerd version then shows the upgrade command, and on a rexctl install rexctl status shows a New release row.
  • fluxerd health exits with 0 when every part of Squad is ready.
  • Under systemd, systemctl status fluxer with rexctl or systemctl status fluxerd by hand has a Status line. It says starting, ready, degraded, stopping or stopped, and lists the parts that are not healthy.
Окно терминала
docker compose logs fluxer
docker compose exec fluxer fluxerd logs api

With docker run, use docker logs fluxer for the whole log and docker exec fluxer fluxerd logs api for one part.

The first command shows every part and the second only one. Add -f to follow new lines.

Each of these parts has its own logs.

PartWhat it is
postgresPostgreSQL with all of Squad’s data
apiThe HTTP API and the background worker
gatewayThe WebSocket connections for live updates
media-proxyResizes and serves images and other media
rustEight smaller services in one process. An older instance shows them as separate parts
meilisearchMessage and member search
livekitThe voice and video server
valkeyCache and rate limits, on older installs that still use it
seaweedfsUploads, on older installs that still use it
Окно терминала
docker compose exec fluxer fluxerd ctl restart gateway
docker exec fluxer fluxerd ctl restart gateway
Окно терминала
docker compose stop
docker compose start

With docker run, use docker stop fluxer and docker start fluxer.

Squad 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.

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.

To make a community invite, open the community in the app, open its menu and choose “Invite members”, which gives you a link.

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.

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 alex
docker exec fluxer fluxerd users reset-link alex

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.

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 --admin
docker exec fluxer fluxerd users create alex --admin

On an instance where people sign in with an email address, add --email alex@example.com. Without --admin, you get an ordinary account.

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.

  1. A day before, lower the TTL of your domain’s DNS records, such as to 5 minutes.
  2. Take a backup and stop Squad on the old machine right away. Anything people post after the backup stays on the old machine.
  3. On the new machine, restore the backup with the same domain, and don’t start Squad until your domain’s DNS records point there.
  4. Point your domain’s DNS records at the new machine’s IP address.
  5. 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 any setting. Behind your own proxy, add your own routes and headers there.