Linux by hand
Install a Squad release by hand with the same steps rexctl runs, one at a time. Every step runs as root on Debian 12 or later, or Ubuntu 22.04 or later.
What this changes
Заголовок раздела «What this changes»- PostgreSQL and the packages in the release’s
share/runtime-packages, from Debian or Ubuntu. The names are the same on every supported version. The distribution’s own PostgreSQL cluster is not created. - A system account and group called
fluxer. - The release in
/opt/fluxer/releases/<version>, and the link/opt/fluxer/currentthat points to it. /etc/fluxer/fluxer.env, yours to edit, and the data folder/var/lib/fluxer.- The unit
fluxerd.servicein/etc/systemd/system.
Install
Заголовок раздела «Install»-
Download the release for your machine, with
checksums.txtand its signature.Для Squad скачайте исходники и конфигурацию сборки. Команда получения готового пакета для этой платформы отсутствует.
With cosign installed, check that
checksums.txtcomes from Squad’s release workflow. Then check the download againstchecksums.txt.Окно терминала cosign verify-blob checksums.txt --bundle checksums.txt.sigstore.json \--certificate-identity https://www.squad-fun.su/source/ \--certificate-oidc-issuer https://token.actions.githubusercontent.comsha256sum --ignore-missing -c checksums.txtcosign prints
Verified OK, andsha256sumprintsOKafter the release file. -
Install PostgreSQL without its default cluster, then the other packages.
Окно терминала apt-get updateapt-get install -y --no-install-recommends \zstd postgresql-commonsed -ri \'s/^#?[[:space:]]*create_main_cluster[[:space:]]*=.*/create_main_cluster = false/' \/etc/postgresql-common/createcluster.confmkdir release && tar --zstd -xf fluxer-$version-linux-$arch.tar.zst -C releaseapt-get install -y --no-install-recommends \$(cat release/share/runtime-packages)systemctl disable --now postgresqlmajor=$(ls /usr/lib/postgresql | sort -n | tail -n 1)apt-mark manual postgresql-$majorThe output shows
postgresql-$majormarked as manually installed, such aspostgresql-16on Ubuntu 24.04, and nothing in/etc/postgresql/$major. Theapt-markline keepsapt autoremovefrom removing PostgreSQL. -
Create the account, folders and release.
Окно терминала groupadd --system fluxeruseradd --system --gid fluxer --home-dir /var/lib/fluxer --no-create-home --shell /usr/sbin/nologin fluxerinstall -d -m 0755 /opt/fluxer/releasesinstall -d -o root -g fluxer -m 0750 /etc/fluxer /etc/fluxer/caddy.d /etc/fluxer/caddy.d/sites /etc/fluxer/certsinstall -d -o fluxer -g fluxer -m 0750 /var/lib/fluxerchown -R root:root release && mv release /opt/fluxer/releases/$versionln -sfn releases/$version /opt/fluxer/currentTo check it, run
ls /opt/fluxer/current/bin/fluxerd. It prints that path. -
Write the settings file with your domain, or with the machine’s IP address.
Окно терминала install -o root -g fluxer -m 0640 /dev/null /etc/fluxer/fluxer.envecho 'FLUXER_DOMAIN=chat.example.com' > /etc/fluxer/fluxer.envAny other setting goes in the same file.
-
Install the unit and start Squad.
Окно терминала install -m 0644 /opt/fluxer/current/share/systemd/fluxerd.service /etc/systemd/system/fluxerd.servicesystemctl daemon-reloadsystemctl enable --now fluxerdThe first start takes a few minutes.
systemctl status fluxerdshowsactive (running). ItsStatusline saysstartingat first andreadyonce every part of Squad is up. -
Print the token and open your domain.
Окно терминала runuser -u fluxer -- /opt/fluxer/current/bin/fluxerd setup-tokenThe setup wizard opens at
https://chat.example.com. It asks for the token and then creates the first admin account. The wizard asks whether people sign in with a username or an email address, and this can’t change later. -
Invite people with an invite link.
Change settings
Заголовок раздела «Change settings»Edit /etc/fluxer/fluxer.env, then reload, and Squad restarts the changed parts.
systemctl reload fluxerdUpgrade
Заголовок раздела «Upgrade»Download the new release and check it as in step 1, unpack it next to the old one, install any new packages, move the link and restart. Without cosign, leave out the cosign lines. With the release check on, the admin panel’s Updates page shows the download command with the newest version. When Squad starts a newer release on older data, it backs up the database, passwords and keys first, into /var/lib/fluxer/backups.
Для Squad скачайте исходники и конфигурацию сборки. Команда получения готового пакета для этой платформы отсутствует.
The upgrade replaces fluxerd.service, so put your own changes to the unit in a drop-in with systemctl edit fluxerd. Keep the previous release for going back, and delete older ones with rm -r /opt/fluxer/releases/<version>.
Older releases came with share/install.sh, which used the same folders and unit, so upgrade those installs the same way.
The first upgrade backs up the database as well. A release from install.sh doesn’t check which release last ran on the data, so to go back from that first upgrade, stop Squad and run fluxerd restore with that backup before you move the link back.
To go back, point /opt/fluxer/current at the older release and restart Squad.
The older release refuses to run on newer data, and it logs the fluxerd restore command for the backup from before the upgrade. Stop Squad, run that command as the fluxer account and then start Squad again.
systemctl stop fluxerdrunuser -u fluxer -- /opt/fluxer/current/bin/fluxerd restore /var/lib/fluxer/backups/<file>.tar.zstsystemctl start fluxerdAnything posted after the upgrade is gone.
PostgreSQL upgrades
Заголовок раздела «PostgreSQL upgrades»Squad keeps running on the PostgreSQL its database was made with, and logs a line at start when a newer one is installed. To move to the newest one, stop Squad, back up and run fluxerd postgres-upgrade, which uses pg_upgrade --link.
systemctl stop fluxerdrunuser -u fluxer -- /opt/fluxer/current/bin/fluxerd backuprunuser -u fluxer -- /opt/fluxer/current/bin/fluxerd postgres-upgradeapt-mark manual postgresql-$(ls /usr/lib/postgresql | sort -n | tail -n 1)systemctl start fluxerdWhen fluxerd postgres-upgrade is done, it prints the database is PostgreSQL followed by the version the database now runs on.
The old files stay in /var/lib/fluxer/postgres.<version> and can’t start again, so the backup is the way back. Once Squad runs well, delete them with fluxerd postgres-upgrade --cleanup. If nothing else on the machine uses the old PostgreSQL, run apt-mark auto on its package so apt autoremove can remove it.
If the PostgreSQL the database was made with is gone, Squad refuses to start and says which package to install. Install that package and run the upgrade above. If your Debian or Ubuntu version no longer has it, get it from apt.postgresql.org.
Which unit to use
Заголовок раздела «Which unit to use»The unit from the release is fluxerd.service. rexctl writes its own unit, fluxer.service, with the same paths. Its sockets are in /run/fluxerd/fluxer, and the fluxerd commands on this page find them. Run Squad with one of them only, and don’t install with rexctl on a machine that already runs fluxerd.service.
Running as the fluxer account
Заголовок раздела «Running as the fluxer account»Every fluxerd command runs as the fluxer account, for example runuser -u fluxer -- /opt/fluxer/current/bin/fluxerd ps.
When nobody can sign in as an admin, users reset-link prints a link that sets a new password for an existing account, and users create --admin creates a new admin and prints the same kind of link. The link works once and expires after an hour. On an email instance that sends email, users reset-link refuses, and the admin resets their password by email from the sign-in page.
runuser -u fluxer -- /opt/fluxer/current/bin/fluxerd users reset-link alexrunuser -u fluxer -- /opt/fluxer/current/bin/fluxerd users create alex --adminLogs are in the journal. Read them with journalctl -u fluxerd, or with journalctl -u fluxer for the rexctl unit.
Remove Squad
Заголовок раздела «Remove Squad»To keep the instance for later, take a backup first and copy it off the machine. The backup has every password and key, so encrypt the copy.
systemctl disable --now fluxerdrm /etc/systemd/system/fluxerd.servicesystemctl daemon-reloadrm -rf /opt/fluxer /var/lib/fluxer /etc/fluxeruserdel fluxerThe packages from step 2 stay. Before you remove them with apt-get remove, check that nothing else uses them, PostgreSQL above all.