Command line
Three command line surfaces: the launcher for source installs, the on-premises binary for the portable bundle, and the update script for Docker deployments.
The launcher
Section titled “The launcher”For a source install. plugboard below means
node scripts/plugboard.mjs.
| Command | Does |
|---|---|
plugboard setup | Create .env with generated JWT_SECRET, SECRETS_MASTER_KEY and other secrets |
plugboard migrate | Apply pending database migrations |
plugboard seed | Load the fictional demo data |
plugboard start | Migrate, then start the API and web |
Flags on start
Section titled “Flags on start”| Flag | Effect |
|---|---|
--skip-migrate | Do not run migrations |
--no-build | Skip the build. Use in production, where it already happened |
--worker | Also start the Redis-backed worker |
A production service definition normally uses start --no-build, so a restart is
fast and cannot fail on a compilation error.
Shortcuts
Section titled “Shortcuts”| Platform | |
|---|---|
| Windows | Plugboard.cmd |
| macOS and Linux | ./plugboard.sh |
| Either | pnpm setup, pnpm start |
Development
Section titled “Development”| Command | Does |
|---|---|
pnpm install | Install dependencies |
pnpm infra:up | PostgreSQL, Redis and MinIO via Docker |
pnpm db:migrate | Apply migrations |
pnpm db:seed | Load demo data |
pnpm dev | API on 4000, web on 3000, worker, all with hot reload |
The on-premises binary
Section titled “The on-premises binary”For the portable bundle. ./plugboard on macOS
and Linux, plugboard.cmd on Windows.
| Command | Does |
|---|---|
plugboard install-service | Register with the platform so it starts at boot |
plugboard uninstall-service | Remove the registration. Data is left alone |
plugboard service-status | Ask the platform how it is doing |
plugboard update --check | Is there a newer release? Change nothing |
plugboard update | Download and stage it now |
Starting it
Section titled “Starting it”| Platform | |
|---|---|
| Windows | Double-click Start-Plugboard.cmd |
| macOS and Linux | ./start-plugboard.sh |
Service install flags
Section titled “Service install flags”| Flag | Effect |
|---|---|
--user someone | The account the Linux service runs as |
Requires elevation: sudo on Linux and macOS, an elevated shell on Windows.
The update script
Section titled “The update script”For Docker deployments. Also what we run on managed hosting.
./scripts/plugboard-update.sh 0.2.0| Form | Does |
|---|---|
plugboard-update.sh <version> | Update to that version, or roll back to it |
plugboard-update.sh <sha256:digest> | Update to a pinned digest |
plugboard-update.sh <version> --dry-run | Check the stack and pull the image, changing nothing |
The script prints the rollback command at the end of every successful run, so the way back is always in your scrollback.
See updating.
Docker Compose
Section titled “Docker Compose”# Startdocker compose --env-file .env -f docker-compose.prod.yml up -d
# With an ingress profiledocker compose --env-file .env -f docker-compose.prod.yml --profile caddy up -ddocker compose --env-file .env -f docker-compose.prod.yml --profile tunnel up -d
# What is runningdocker compose -f docker-compose.prod.yml ps
# Logsdocker compose -f docker-compose.prod.yml logs -f api
# A database shelldocker compose -f docker-compose.prod.yml exec postgres psql -U plugboard
# A manual dumpdocker compose -f docker-compose.prod.yml exec postgres \ pg_dump -U plugboard -Fc plugboard > backups/manual.dump
# Stop, keeping datadocker compose -f docker-compose.prod.yml down
# Stop and delete the database volume. Destructivedocker compose -f docker-compose.prod.yml down -vBuilding the bundle
Section titled “Building the bundle”pnpm installnode scripts/package-bundle.mjs # uses your Nodenode scripts/package-bundle.mjs --with-node --archive # embeds Node, makes an archiveThe release workflow runs exactly this per operating system on every v* tag.
Verifying a release
Section titled “Verifying a release”# Portable bundles, against the checksum beside the downloadsha256sum -c plugboard-linux-x64.tar.gz.sha256
# Container imagescosign verify ghcr.io/samiossoftware/plugboard@sha256:1a2b3c... \ --certificate-identity-regexp '^https://github.com/samiossoftware/plugboard/' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com
cosign download attestation ghcr.io/samiossoftware/plugboard@sha256:1a2b3c...Health checks
Section titled “Health checks”curl -s https://helpdesk.yourschool.org/api/health/versioncurl -s https://helpdesk.yourschool.org/api/health/readyBoth answer without a tenant and without a database, so they still work when nothing else does.