All help articles

Install on a server (bare metal)

Zappocity is one Go binary, corpsuited, plus PostgreSQL 16. It runs directly on the host under systemd; no containers are involved. This guide is for the platform administrator.

What you need

Install

From a checkout of the repository:

make                        # as your own user: compresses the web assets, builds bin/corpsuited
sudo make install
sudo make db
sudoedit /etc/corpsuite/corpsuite.env
sudo make enable

What each step does:

StepEffect
makeBuilds a static binary (CGO_ENABLED=0, -trimpath) at bin/corpsuited.
sudo make installCreates the corpsuite system user if missing, installs /usr/local/bin/corpsuited, writes /etc/corpsuite/corpsuite.env from the template only if it does not exist (mode 0640, group corpsuite), and installs /etc/systemd/system/corpsuited.service.
sudo make dbCreates the Postgres role corpsuite and the database corpsuite it owns. The service connects over the local Unix socket with peer authentication, so no database password exists anywhere.
sudoedit …/corpsuite.envSet at least CORPSUITE_HOSTNAME, the ACME settings (or CORPSUITE_TLS_CERT and CORPSUITE_TLS_KEY) and CORPSUITE_PLATFORM_API_KEY_SHA256. The README lists every setting.
sudo make enableStarts the service now and at boot. Database migrations run on every start.

Create the platform key with make platform-key: give the key to VaultDrop and put only its SHA-256 in the env file.

Once the service runs, create the first administrator for the SaaS admin panel at https://<hostname>/admin:

sudo make admin EMAIL=you@example.com

It runs corpsuited set-admin as the service user with the service's settings and asks for the password. Run it again to reset a password. See the admin panel.

PREFIX, BINDIR, CONFDIR, UNITDIR, SVC_USER and DB_NAME can be overridden on the make command line, and DESTDIR stages an install for packaging.

How the service runs

Upgrade

git pull
make
sudo make install           # keeps your env file
sudo systemctl restart corpsuited

Back up

Back up the corpsuite database (sudo -u postgres pg_dump corpsuite), /var/lib/corpsuite and /etc/corpsuite/corpsuite.env. /var/lib/corpsuite/master.key decrypts the DKIM keys in the database: keep it with the database backup, but store the two apart if you can. The env file holds only a hash of the platform key, but treat it as sensitive.

Uninstall

sudo make uninstall stops the service and removes the binary and the unit. It keeps the env file, the data directory, the database and the user, so nothing is lost by accident; remove those by hand if you mean to.

Troubleshooting

Local development

make dev-db creates a corpsuite_dev role with the password from DEV_DB_PASSWORD in .env, and the corpsuite_dev and corpsuite_test databases. Then make seed, make dev and make check. See the README.