Orafila Documentation Book a demo

Document 9 of 13

Operations and maintenance

Checks, updates, backup and restore, incidents, user support.

For whom: IT, platform operator

This document is for whoever manages an Orafila installation: checks, updates, backup and restore, incidents, and supporting users. The deploy/... commands are typed on the server, from the orafila folder.

Who does what

Activity Managed service Dedicated installation
Server, operating system, Docker, HTTPS certificates Provider Whoever manages the server
Orafila updates Provider Whoever manages the server (deploy/nova.sh update)
Backups, restore test, safekeeping of the keys Provider Whoever manages the server
External monitoring of the site and the backups Provider Whoever manages the server
Activating new companies, queue addresses for the gateway Provider (platform operator) Whoever manages the server
AI provider keys As set out in the contract Whoever manages the server, with the company's keys
Users, roles, settings, mailboxes, Fatture in Cloud, AI budget The company's administrators, from the application The company's administrators, from the application
Unlocking sign-in, resetting two-step verification, new invitations The company's administrators The company's administrators

Checks

What How
Overall status deploy/nova.sh status: services, external database, disk space, memory, last backup, outgoing e-mail (SMTP ports reachable or blocked)
Service messages deploy/nova.sh logs app, logs worker (mail), logs caddy (HTTPS), logs db, logs migrate; with -f in real time
Availability from outside HTTPS check on /api/health every 5 minutes from an uptime service: it answers {"status":"ok"} if the app and the database are working
Nightly backups Healthchecks.io (or similar) with BACKUP_PING_URL; history with journalctl -u nova-backup -n 50
Inside the application Assistant › Health check and the numbers in the menu: mailboxes that do not read or send, mail worker stopped, e-mails not sent, AI not answering or out of budget

Docker restarts a service that stops by itself; the health checks of the app (every 30 seconds) and of the mail worker (a signal every 15 seconds) mark it as "unhealthy" if it does not respond.

Updates

Orafila:

deploy/nova.sh update

The command checks the memory, downloads the new version from the release server and verifies its digital signature, takes a safety backup, replaces Orafila's files, rebuilds the image and restarts; the database migrations are applied automatically at start-up. deploy/.env, keys and backups are not touched. It refuses to start if someone has edited Orafila's files on the server by hand (it lists them) and never goes back to an earlier version by itself. deploy/nova.sh version tells which version is installed and whether there is a new one. The service is interrupted for a few moments while the containers restart.

Operating system and Docker: security updates are installed automatically every day. If *** System restart required *** appears when you log in, restart (sudo reboot): after a couple of minutes everything starts again by itself; check with deploy/nova.sh status.

Once a month, the base images (database, Caddy, Node.js), which contain security fixes:

cd deploy && docker compose pull db caddy && docker compose build --pull && cd ..
deploy/nova.sh up

Disk space: up (and therefore update) deletes the previous version of the image every time, and the build cache when less than 4 GB is left free. To free space sooner: docker builder prune -af.

Never use docker compose down -v, docker volume rm or docker system prune --volumes: they delete the database.

Backups

  • Automatic every night at 02:30 (Italian time, plus up to 15 random minutes), after deploy/nova.sh install-timer; if the server was off, it runs when the server is switched back on.
  • By hand at any time: deploy/nova.sh backup. List: deploy/nova.sh backups.
  • Each backup is the complete database (all companies), encrypted with age, verified and then copied to the bucket if one is configured. The last 7 are kept on the server and 30 days in the bucket (values can be changed).
  • The names are the UTC date and time: nova-20261020T013000Z.dump.age.
  • Backups contain the data; not the database users: after a restore on a new server, the database passwords can be new ones.

Safekeeping of the keys (in the password manager, off the server):

  1. the backups' private key (deploy/secrets/backup.agekey);
  2. APP_ENCRYPTION_KEY;
  3. recommended: the whole deploy/.env, updated after every change.

Restore

On the same server (for example to go back to an earlier state):

deploy/nova.sh restore nova-YYYYMMDDTHHMMSSZ.dump.age --yes [--key ~/saved-key.txt]

The restore first takes a safety backup of the current state, stops the app and the mail worker, and loads the backup into a temporary database that replaces the current one only if loading succeeds (with an external database, in a single transaction); it then applies the migrations newer than the backup, restarts and waits for the services to be healthy. If the key does not open the backup, it stops before changing anything. All the companies in the installation go back to the state of the backup.

On a new server (server lost or broken):

  1. new server, DNS record updated to the new IP, package downloaded, sudo deploy/setup-host.sh;
  2. the backups' private key put back in deploy/secrets/backup.agekey and deploy/.env recreated from the password manager (at least APP_ENCRYPTION_KEY and the bucket details);
  3. deploy/nova.sh init --domain ... --email ... to fill in the missing values, then deploy/nova.sh up;
  4. deploy/nova.sh backups and deploy/nova.sh restore <latest file in the bucket> --yes: the file is downloaded from the bucket, checked and restored;
  5. deploy/nova.sh install-timer.

Users sign in with their password and their verification code, as before. If nobody can complete two-step verification, APP_ENCRYPTION_KEY is not the one from the original server. The detailed steps are in the guides for Oracle (in Italian) and DigitalOcean (in Italian).

Test the restore when the service starts, with the copy of the key kept in the password manager: a backup that has never been restored guarantees nothing.

If you suspect an intrusion into the server

Consider everything that was on the server compromised: deploy/.env (database passwords, bucket and AI keys, APP_ENCRYPTION_KEY) and the backup key.

  1. Stop the server from the provider's console, without deleting it.
  2. Revoke the bucket access key, the AI providers' keys and, if the server had them, the release access credentials (the Orafila provider revokes them); create new ones.
  3. Rebuild on a new server with new database passwords, gateway secret and backup key (keeping APP_ENCRYPTION_KEY, which is needed to read the data) and restore the last backup from before the intrusion, opened with the old backup key.
  4. In the application: change the mailbox passwords (first at the mail provider, then in Queues and mail) and have two-step verification reset for all users (Settings › Users), and their access too if appropriate.
  5. Assess with your privacy adviser whether the breach must be notified (GDPR Articles 33-34).

Platform operator tasks

What Command
Activate a company deploy/nova.sh tenant-create --name "..." --slug code --admin-email ... --admin-name "..." [--lingua en]
New invitation for the first administrator deploy/nova.sh tenant-create --reinvite --slug code [--admin-email ...]
A queue's address for the forwarding gateway deploy/nova.sh queue-address --company code --queue Support --address support@customer.com (--clear to remove it)
Sample data deploy/nova.sh sample-data --slug code / --remove

These operations appear in the company's activity log with “System” as the author.

Supporting users (company administrators)

Situation What the administrator does in Settings › Users
Locked out after 5 attempts “Unlock sign-in” (or it unlocks by itself after 15 minutes)
Phone changed or lost “Reset two-step verification”: the person sets it up again at their next sign-in
Forgotten password “Reset access”, then “Create a new invitation link”
Invitation expired or lost “Create a new invitation link” (the previous one stops working)
Person leaving the company “Suspend the user” (their sessions are closed), then reassign their tickets
Only administrator cannot be reached The operator's tenant-create --reinvite works only as long as the company has no active administrator; after that, invitations are created from the application. That is why it is best to have at least two administrators; otherwise the operator has to step in technically

Common problems

Symptom Likely cause What to do
The site does not open or the certificate is not valid DNS not propagated, ports 80/443 closed Check DNS and firewall, deploy/nova.sh logs caddy, then deploy/nova.sh up
"502" or "Bad Gateway" The app has not started or is restarting deploy/nova.sh status, deploy/nova.sh logs app migrate
app or worker "unhealthy" Database stopped, error in the migrations or wrong configuration deploy/nova.sh logs app worker db migrate; once the error is fixed, deploy/nova.sh up
up says a value is missing in deploy/.env Incomplete configuration First installation: deploy/nova.sh init; server already running: put the value back from the password manager (never regenerate APP_ENCRYPTION_KEY)
Customers' e-mails do not become tickets Mailbox not connected, wrong password, mail provider that requires OAuth, sender not recognised Queues and mail › “Test the connection”; Inbox; deploy/nova.sh logs worker
Replies are not going out SMTP details, ports blocked by the server provider Queues and mail › E-mails not sent; deploy/nova.sh status (outgoing e-mail section); port 2525 with a sending service
The backup does not reach the bucket Wrong bucket details in deploy/.env Check endpoint, region, keys and name again; deploy/nova.sh backup
After a restore, two-step verification does not work Different APP_ENCRYPTION_KEY Put the saved key back, deploy/nova.sh up
update refuses to start Orafila files edited by hand (it lists them) Save the useful changes elsewhere, delete the listed files (the update puts them back as in the package) and try again
The installer or update report that the signature does not match Package not from the provider, or altered Install nothing and tell the Orafila provider
Disk almost full Build cache, old images, too many local backups docker builder prune -af, docker image prune -f, reduce BACKUP_KEEP_LOCAL
The build stops because of memory Server with little RAM sudo deploy/setup-host.sh --swap-only, or a bigger server