Administration
Running an instance means looking after accounts, storage and updates. Everything here is available in the workspace's admin area and in the API.
First-run setup
- Open the site in a browser.
- You will be asked to create the administrator account. This prompt is only offered while the instance has no users.
- Sign in, then add accounts for your team, or let them self-register.
Only offered once
As soon as an account exists, the setup endpoint refuses to create another administrator. If you lose the administrator account on an instance that already has users, you will need to recover from your data backup.
Roles
| Role | Can do |
|---|---|
| User | Everything in their own workspace: presentations, songs, service plans, media, settings and their own account. |
| Admin | Everything a user can do, plus instance-wide tasks: the default quota, user management, the maintenance panel, backups and updates. |
All accounts are isolated from each other at the data layer, and every protected request is authorised server-side and scoped to the account.
User management
- List accounts with name, email, role, quota and current usage.
- Create accounts that can sign in immediately, with an optional per-account quota and role.
- Edit accounts: change names, change quotas, promote or demote between User and Admin.
- Delete accounts along with all of their presentations, service plans, songs and media, freeing the storage.
Guard rails
- A quota cannot be set below the storage the account already uses.
- An administrator cannot remove their own
adminrole. - An administrator cannot delete their own account from the admin area.
Quotas and storage
Storage is measured for everything an account stores — presentations, songs, service plans and uploads all count, not just files.
- Usage is recomputed from what is actually stored, so it cannot drift when content is edited.
- Settings shows a breakdown: media, presentations, songs and plans.
- Uploads over the account quota or the configured maximum return
413. - The instance default quota is set in the admin panel; it applies to accounts created afterwards.
The maintenance panel
The instance panel reports the current version, Node version, schema version, uptime and the data directory, whether update checking and self-update are configured, and the results of the last check and run. It also provides:
- Database backup — download the data file as a dated JSON attachment.
- Update check — compare the installed version with the configured release feed.
- Run update — run the configured update command and see its full output.
Backup and restore
Everything that matters lives in DATA_DIR. Back it up on a schedule:
# back up everything
tar -czf swp-backup-$(date +%F).tar.gz "$DATA_DIR"
# restore
tar -xzf swp-backup-YYYY-MM-DD.tar.gz
- Stopping the process before copying gives the most consistent snapshot, because the database is a single JSON document rewritten atomically on save.
- Copying live works too, with a small window of risk.
- Uploading media lives in
DATA_DIR/uploads— a backup of the JSON file alone is not a complete backup. - Hosted-service users can download their own content from the admin area or the API.
Upgrades
- Back up DATA_DIR Always the first step. See above.
-
Fetch the new release
git pull, or the new release archive for copied deployments. -
Install dependencies
npm ci(ornpm ci --omit=devon a production host). -
Restart the process
pm2 restart simple-worship-presenter, or restart in CloudPanel.
Database schema changes run automatically as numbered migrations on startup. Migrations are additive and never delete existing user data. If a data file cannot be read, the instance preserves a copy named *.corrupt-<timestamp> rather than overwriting it — restore from backup rather than editing it by hand.
The self-updater
Administrators can check for updates and install them from the maintenance panel. Both are used on demand only: nothing is contacted and nothing runs until someone presses the button.
- The update command comes from environment configuration (
UPDATE_COMMAND), never from the request. - The default
scripts/self-update.jsdetects the layout and usesgit pullor downloads and installs the release archive, whichever suits the deployment. - It never touches
data/,uploads/,.env,node_modulesor.git. - Failures report the exit code, signal, stderr and stdout, plus the exact command to run yourself.
/api/admin/updateshows whethergitandnpmare onPATHbefore you press anything.- Runs time out after
UPDATE_TIMEOUT_MS(10 minutes by default).
Configure the feed and command in Configuration — self-update.
Closing registration
Set ALLOW_REGISTRATION=0 to close public sign-ups on your instance. Existing accounts keep working, and an administrator can still create accounts from the admin area — the usual pattern for a church server that only hosts its own team.
Admin in the API
Everything above is available over HTTP — instance settings, user CRUD, update control and the backup download. All admin routes require the admin role and return 403 otherwise. See the admin endpoints.