Updating and backups
How an instance stays current, and what to keep so it can be restored or handed over.
What to back up
| What | Where | Why |
|---|---|---|
| The database | Postgres | Everything SHADE keeps: content, versions, accounts, settings, the audit log, private files, installed modules' tables |
APP_SECRET | the API's environment; with the deployment template, the secrets volume | Stored secrets (payment and email keys, a module's secret settings) are encrypted with it: without it they cannot be read and must be entered again. After rotating it, keep the old one too, for the backups made before |
| The backup key | SHADE_BACKUP_KEY, with the deployment template the secrets-backup volume | Opens the built-in backups' files. Keep a copy apart from the server and never in the bucket: without it a backup cannot be opened |
| The data volume | /app/data in the API's container | Uploaded media (with STORAGE_DRIVER=local) and the installed module packages. With S3, the media are in the bucket instead |
Redis needs no backup: it holds only work in flight (leases, the queue, messages between containers, rate-limit counters, the cache), and everything in it is rebuilt after a restart.
- On Coolify: set the built-in backups' target with
node console/backup-target.mjs setin the admin container, to storage the client owns (Setting the target), and keep copies ofAPP_SECRETand the backup key apart from the server (Setting up an instance). - On your own server: switch on the built-in backups below, and back up
/etc/shadewhole:shade.envwithAPP_SECRET, the passwords, and Caddy's certificates incaddy-data/(Self-hosting without Coolify). Set up by hand: the database withpg_dump, the data volume, and the environment file withAPP_SECRET(Self-hosting by hand). - Keep the backups and
APP_SECRETwhere the client and the operator can reach them, and nowhere else (Hardening a production instance).
Built-in backups
SHADE can take backups itself, and send them to a bucket you own. They are off until you give a target. On any server
they are the first choice; your own backups (pg_dump, or Coolify's scheduled Postgres backups for a Postgres you added
yourself) stay a good second line.
Once SHADE_BACKUP_URL is set, the worker takes a backup every night at 03:00 (in the site's time zone), one at a time across
workers. Each backup is a folder in the bucket with these files:
- the database, from
pg_dump(its custom format), so private files, module data and modules' tables come with it; - the uploaded media, as a tar, when
STORAGE_DRIVER=local; - with
STORAGE_DRIVER=s3, the list of media keys the database points at (every original and its variants, one a line). The media bucket is yours and is not copied: switch on its versioning. The list lets a restore say which of those keys the bucket lacks now; - a manifest: when it was taken, SHADE's version, the migrations applied, the number of rows of each table and a SHA-256 of each file.
Everything is encrypted on the worker before it leaves, with SHADE_BACKUP_KEY, and sent as it is made: nothing is written to the disk,
and the worker never holds a whole dump in memory. A bucket's owner or a thief of its keys sees sizes and times, nothing else.
APP_SECRET and the environment are never in a backup.
| Setting | What it does |
|---|---|
SHADE_BACKUP_URL | s3://<bucket> or s3://<bucket>/<prefix>. Empty: no built-in backups |
SHADE_BACKUP_KEY | 32 random bytes in base64 (openssl rand -base64 32). The deployment template generates it on the first start when it is not set. Keep a copy with APP_SECRET, apart from the server and never in the bucket: without the key a backup cannot be opened, and without APP_SECRET its stored secrets cannot. An admin confirms the copy, signed in themselves (POST /api/backups/kept-copy); until then the doctor's kept-copy check warns |
SHADE_BACKUP_S3_ACCESS_KEY_ID, SHADE_BACKUP_S3_SECRET_ACCESS_KEY | A key of its own for the bucket, apart from the media's |
SHADE_BACKUP_S3_REGION, SHADE_BACKUP_S3_ENDPOINT, SHADE_BACKUP_S3_FORCE_PATH_STYLE | As STORAGE_S3_*: the endpoint for Scaleway, Hetzner, R2 or RustFS; AWS needs only the region |
SHADE_BACKUP_CRON, SHADE_BACKUP_TIME_ZONE | When to run, as a five-field cron expression (default 0 3 * * *), in the site's time zone unless one is given |
SHADE_BACKUP_KEEP_DAILY, _WEEKLY, _MONTHLY | How many are kept: the newest of each of the last 7 days, 4 weeks and 6 months (the defaults). Older ones are deleted, only after a newer good one exists |
The bucket should be in the EU and have object lock switched on where the host offers it, so a stolen key cannot delete the backups.
Setting the target
In the deployment template, set the bucket and its keys once
with a console command in the admin container. On Coolify, open the admin service's Terminal; on a server of your
own, docker compose exec admin sh:
node console/backup-target.mjs set --url s3://voorbeeld-backups/shade --access-key-id <key id> \
--endpoint https://s3.nl-ams.scw.cloud --region nl-ams
It asks for the secret access key without showing it (or reads it from the first line of stdin with --secret-stdin,
never from a flag), checks the settings as the API does, asks the bucket for its backups, and only then saves them.
Add --path-style for a service that needs path-style addresses (MinIO, RustFS). Then restart the admin and the
worker: they read the target when they start.
The command writes one file, backup-target.json, into the secrets-backup volume, beside the generated backup key.
Only the admin and the worker mount that volume, so the public container never holds the bucket's keys, not even on
Coolify, which gives every container every variable. The file is replaced whole, readable only by the image's user,
and the change is in the audit log as made from the console, with the bucket's address and never a key.
node console/backup-target.mjs show says where each setting comes from, and clear removes the file (backups stop at
the next restart).
The variables in the table still work, and a variable you set wins over its line in the file, as a set secret wins
over a generated one. Without the template (separate containers, or your own setup), set them on the worker and the
admin container. The doctor's backup-target check and the Backups card say whether the target comes from the file,
the environment or both. The public container ignores every SHADE_BACKUP_* variable: it takes no backups, so a target
given to it changes nothing.
Telling you when it stops. If no good backup is younger than 26 hours, SHADE raises a security alert, Backups are not running:
listed under Errors and emailed to the admins like the other alerts (Settings switches it off). A failed run is in the error log with its
reason. GET /api/health/backups (admins) gives when the last backup and the last good one were.
Rehearsing a restore. A backup nobody has restored is a hope, so once a week the worker restores the latest one into a scratch
database and checks it: every part is read against its hash and every encrypted frame, the migrations it lists, the rows of every table,
and a sample of private files read back with the hash they had. Then it empties the scratch database. Nothing in it is served. The
deployment template ships a small second Postgres for it (postgres-rehearsal) and sets SHADE_BACKUP_REHEARSAL_DATABASE_URL; on
your own setup give it an empty database of its own, on this server or another. The small
profile has none, so it never rehearses on its own: restore a backup by hand now and then. SHADE refuses the instance's own database, and
never empties a scratch database that held something when the rehearsal began, unless a rehearsal of its own filled it: each one
marks the scratch database first (an empty schema shade_rehearsal), so the copy left by a rehearsal that was cut off (the
worker stopped while it restored) is emptied by the next one rather than kept. Until then that copy of your data sits in the
scratch database. A rehearsal that fails raises the same alert.
Before an update's migrations. The admin container (it applies migrations) takes a backup first, named after the last migration
the database held (backup-<time>-from-0038). When only a module's migrations are new (a module updated), it takes one before
those (backup-<time>-plugins). It takes one backup per start at most. If that backup fails, the migrations are not applied and the
container stops with the reason; SHADE_BACKUP_BEFORE_MIGRATE=false migrates without one. A new instance, or a module installed for
the first time, has nothing to back up and skips it. Give the admin container the same SHADE_BACKUP_* settings as the worker (in the
deployment template both read the same file).
In the admin. Settings has a Backups card for admins: when the last good backup and rehearsal were, the recent runs and how each
ended, and the two things you can change there, when backups run and how many are kept. What you save replaces the environment's
values (SHADE_BACKUP_CRON, SHADE_BACKUP_KEEP_*). The target and the keys stay on the server: the card shows the bucket's
address and whether it was set with the command or in the environment, never a key.
Back up now. The same card has a Back up now button for admins. The admin container has no worker, so the button queues a job;
the worker takes the backup as the system, under the same lock as the nightly one, so the two never run at once. The backup is named
backup-<time>-manual, is marked in the runs list and is audited (who asked, and the backup itself). The button waits while a backup
is running or already asked for.
Downloading a backup. Admins can take a copy of their own from the same card (decision 0007 point 10): Download beside each good backup
still in the bucket. It asks them to sign in again with their password and a two-factor code or a passkey, then the browser saves one
.tar file: a README on restoring it, the manifest and every part exactly as they are in the bucket, still encrypted. SHADE streams it
from the bucket and checks each part's size and hash on the way; a part that does not match ends the download as failed. The bucket's
keys never leave the server, and the backup key is never in the admin: without SHADE_BACKUP_KEY the file cannot be opened, so hand
the key over yourself, apart from the file. Every download is in the audit log as data.taken (who, which backup, its size, the address as a keyed
hash) and emailed to every admin, so email must be set up first: until then a download is refused. One download runs at a time, and at most five a day; one that stops part way counts. Only admins
have the permission (backups.download); a custom role can never be given it.
Client programs. A backup holds SHADE's own data only: the database and the media. The client's programs keep their data in volumes of their own, and the built-in backup does not copy them. Cover those volumes with your own backups (Coolify's volume backups, or a copy of the Docker volume). A service's personal data is still covered by erasures: when you do the erasures again after a restore, SHADE asks the services too.
The database's roles. SHADE connects as three roles, none a superuser (The database's
roles). The worker's pg_dump and the backup's snapshot run as shade_backup
(DATABASE_BACKUP_URL), which reads every row and cannot write; the console's migrate and restore run as the owner,
shade (DATABASE_OWNER_URL); everything else runs as shade_app (DATABASE_URL). The deployment template generates their
passwords on the first start (SHADE_DB_PASSWORD, SHADE_DB_OWNER_PASSWORD, SHADE_DB_BACKUP_PASSWORD). A database made before
the three roles cannot be converted: set the instance up again with a fresh database, and restore a backup into it.
Restoring
From a built-in backup, with the restore command (list, check <backup>, restore <backup> [--replace]). Run it where the API runs (node console/restore.mjs <command> in the image, or
pnpm --filter @shadestack/api restore in a checkout), with the worker's settings (SHADE_BACKUP_URL, SHADE_BACKUP_KEY,
the bucket's keys, DATABASE_OWNER_URL, DATABASE_URL, REDIS_URL, STORAGE_LOCAL_ROOT). The restore changes the schema, so it
runs as the owner. In the deployment template, run it in the admin container: it reads the owner's address, the backup key and the
target from its secrets-owner and secrets-backup volumes. On a new server, set the target there first
with node console/backup-target.mjs set (see Setting the target); add --no-audit while the
database is still empty, as it has no audit log to record the change in yet. Give it the old backup key as
SHADE_BACKUP_KEY. Run it with the instance closed: set SHADE_MAINTENANCE=true on the admin and public
containers and start them again (visitors get SHADE's "back soon" answer, see Maintenance mode), and stop the worker. --replace
refuses while a worker wrote its heartbeat in the last two minutes, and when Redis can't be asked about it: if Redis is down and you
stopped every worker yourself, add --worker-stopped.
listshows the backups in the bucket, newest first, with their time, SHADE's version and size.check <backup>reads one through: every part's size and SHA-256 against the manifest, and every encrypted frame. It changes nothing.restore <backup>restores intoDATABASE_OWNER_URL's database, which must be an empty database (a new Postgres, or one you emptied). It checks the backup first, so a damaged or changed one is refused before anything is written; restores the database withpg_restore; restores the uploads into the data volume when the backup holds media and the instance stores them locally; and compares what came back with the manifest: the migrations, the rows of every table and a sample of private files. It saysRestored …when they all match; a difference ends it with exit code 2 and lists what differs.- A database that is not empty is refused.
--replaceempties it first, after you type the instance's address (the host ofSHADE_API_URL) back; the backup is checked before that, so a bad backup never costs you the database you have. - Do the erasures again. A backup does not hold what happened after it. With
--replacethe command lists the erasures of personal data (privacy.erase) the old database recorded after the backup was taken; into an empty database it cannot know them, so check your own records. Do them again before the instance is used: a restore must not bring back someone who asked to be forgotten. - The restore leaves maintenance mode on in the restored database, and says so. Remove
SHADE_MAINTENANCEand start every container with the sameAPP_SECRETand the same addresses (a new template instance generates its own secret: put the old one in place first, as step 1 of "From your own backups" below says). The admin applies any newer migrations on start (and, where backups are set up, takes a backup first). The instance starts closed: sign in as an admin, do the erasures again, check, and switch maintenance mode off (Settings, ornode console/maintenance.mjs off). It also clears what modules keep in their cache in Redis (the website's navigation, footer and links, for example), so nothing read from the old data comes back. When Redis can't be reached it says so: empty Redis before you start the containers, or those values may show the old data for up to a day. - From a downloaded file (the admin's Download), use
--from <file>instead of the backup's name:check --from <file>andrestore --from <file> [--replace]. The command then needsSHADE_BACKUP_KEYand none of the bucket's settings, so a client who leaves can restore on a server of their own. Every part's hash and encrypted frame are checked as from the bucket; a file that is not a backup, or one that was cut short, is refused before anything is changed. The file's README says the same. - With S3 media, point the API at the same bucket: a backup does not copy it (the bucket's versioning keeps older versions). The command looks in the bucket (a read-only listing, nothing is written or deleted) and says which of the media keys the backup recorded are missing from it now. Rebuild the site once, from the admin's Builds screen or the build hook.
The key is the one the backups were made with: keep SHADE_BACKUP_KEY with APP_SECRET, in a place the bucket is not. Without it a backup cannot be opened.
From your own backups (Coolify's scheduled Postgres backups, or pg_dump). The order matters: the secret comes
first, then the database, and nothing of the API starts until the instance is closed. With the template, run the
docker compose commands from its folder (on Coolify, /data/coolify/services/<resource uuid>/, where the pg_dump
below works as written too).
- Put
APP_SECRETin place. The sealed values in the backup (providers' keys, two-factor secrets) open only with theAPP_SECRETthey were sealed with. A new template instance generates a secret of its own on its first start, which opens nothing the old one sealed, and Postgres in the template starts thesecretsservice first, so this step comes before anything starts. Read the old value on the old server without printing it into a log or a chat:docker exec <the admin container> cat /app/secrets/app/APP_SECRET. Then use one of two routes:- The environment. Set the old value as
APP_SECRETin the new resource's environment. This works at any time, and a value set there wins over any generated file. Keep it set: removing it later brings back a generated one. - The secrets file, only before the new instance's first start. On Coolify the volume does not exist before the
first deploy, so make it, and give the file the owner the containers read it as:
docker volume create <project>_secrets cd /var/lib/docker/volumes/<project>_secrets/_data # write the old value into APP_SECRET here, then: chown 1000:1000 . APP_SECRET && chmod 750 . && chmod 400 APP_SECRET
Thesecretsservice then reuses the file. Compose warns that the volume "already exists but was not created by Docker Compose"; that is harmless. Without thechownthesecretsservice stops withAPP_SECRET in SHADE_SECRETS_DIR cannot be read: EACCES, and nothing else starts.
A backup made beforeAPP_SECRETwas rotated needs the old one inAPP_SECRET_PREVIOUStoo, as step 5 says. - The environment. Set the old value as
- Restore the database into an empty Postgres. On a new template instance, start only Postgres (it runs
secretsfirst), then restore:docker compose up -d postgres docker compose exec -T postgres pg_restore --no-owner --no-privileges --exit-on-error -U shade -d shade < shade-<date>.dump
On an instance that has already started (any deployed Coolify resource), the database is not empty: the restore would fail withschema "drizzle" already exists. Stop the API containers and drop the database:docker compose stop admin public worker docker compose exec -T postgres psql -U postgres -d postgres -c 'DROP DATABASE shade'
Then make it again, empty and with the owner's default privileges, as An empty database shows withshadeas the name, and restore into it:docker compose exec -T postgres pg_restore --no-owner --no-privileges --exit-on-error -U shade -d shade < shade-<date>.dump-Tmatters: without itdocker compose execallocates a terminal and the dump on standard input is lost. - Close the instance before the API starts. A restore by hand does not switch maintenance mode on, and a copy that
keeps the same addresses runs at once: its worker runs the schedules and build hooks, and sends whatever email was
queued when the dump was taken. Switch maintenance on in the restored database first. It needs only
DATABASE_URL, asshade_app:node console/maintenance.mjs on
Run it in a container of the image (docker compose run --rm --no-deps admin node console/maintenance.mjs onwith the template). Switch maintenance off again once you have checked the copy. - Restore the data volume, or point the API at the same bucket. Only
uploads/in the volume matters: the packages of installed modules are in the database and unpack again at every start. With the volume on the old server, and its name fromdocker volume ls:tar --numeric-owner -C /var/lib/docker/volumes/<old volume>/_data -cf data.tar .
Copydata.tarto the new server, then unpack it there as root; the folder belongs to uid 1000:tar --numeric-owner -xpf data.tar -C /var/lib/docker/volumes/<new volume>/_data - Start the API containers with the same
APP_SECRETand the same addresses. They apply any newer migrations on start. On Coolify, start them with Redeploy, so they take the environment as it is now;docker compose startkeeps the environment the containers were created with. For a drill, stop the worker again after the redeploy (on a new template instance, leave it out). A backup made beforeAPP_SECRETwas rotated needs the old secret inAPP_SECRET_PREVIOUS, thennode console/rotate-secrets.mjs. - Rebuild the site once, from the admin's Builds screen or the build hook.
An empty database
A restore by hand, and the restore drill, need an empty database for SHADE. The owner shade may not create databases,
so the bootstrap user postgres makes it, owned by shade, and gives it the owner's default privileges, as the init
script does for the instance's first database. Default privileges belong to one database: without them shade_app
could not read or write the tables the restore makes. With the template, and <name> the database's name (shade for
the instance's own, shade_drill for a drill):
docker compose exec -T postgres psql -U postgres -d postgres -c 'CREATE DATABASE <name> OWNER shade'
docker compose exec -T postgres psql -U postgres -d <name> -c "
ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT USAGE ON SCHEMAS TO shade_app, shade_backup;
ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO shade_app;
ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT USAGE, SELECT ON SEQUENCES TO shade_app;
ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT SELECT ON TABLES TO shade_backup;
ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT SELECT ON SEQUENCES TO shade_backup;"
These are the lines databaseRolesSql writes after \connect (SHADE's shade/kernel/db/roles.ts); the deployment
template's init script holds the same.
Restore drill
The weekly rehearsal restores the database part and compares rows. A drill goes further: it brings a whole copy of the instance back on the side, starts SHADE on it and looks at it as a person would, while the instance keeps running. Do one when you set an instance up, after a major update of SHADE or Postgres, and at least once a year. It takes about half an hour.
- Take a backup. On the Backups card, press Back up now and wait until the run says it ended well. Without built-in backups, make a dump yourself (see the last step).
- Make an empty database for the copy, on the same Postgres or another one, as An empty database
shows with
shade_drillas the name. - Restore into it, never into the instance's own database. Run the restore command in a container of the image with the
admin's environment, but with
DATABASE_OWNER_URLandDATABASE_URLpointing atshade_drillandSTORAGE_LOCAL_ROOTat an empty folder of its own:node console/restore.mjs check <backup> node console/restore.mjs restore <backup>
It must end withRestored <backup>: … tables, the migrations and the sample of private files match the backup.and exit code 0. It leaves maintenance mode on in the copy. - Start SHADE on the copy: one container with
SHADE_API_ROLE=all, the instance's ownAPP_SECRET(a template instance keeps it in itssecretsvolume: read it as step 1 of "From your own backups" under Restoring says) andSHADE_TRUSTED_MODULE_KEYSas the instance,DATABASE_URL(asshade_app) andSTORAGE_LOCAL_ROOTof the copy, its ownREDIS_PREFIX, an empty folder forMODULE_PACKAGES_DIR(the installed module packages are in the database and unpack again), and an address only you reach. LeaveSHADE_BACKUP_URLout and don't mount thesecrets-backupvolume, which holds the target, so the copy takes no backups into the instance's bucket. - Check it:
- an admin signs in, and the admin says maintenance mode is on, switched on by
system: restore. Switch it off; - the Modules page lists every module as on and running;
- the site's pages come back:
GET /api/v1/content/website/pageswith the site's read token lists them, or build the site against the copy; - module data is there: an order under Orders, a booking, a form submission in the form's inbox;
- an uploaded image opens at its
/uploads/…address; - the Email page shows the settings as set up. If it asks to enter the secret again, the copy runs with another
APP_SECRET; - a visitor with an account signs in on the site.
- an admin signs in, and the admin says maintenance mode is on, switched on by
- Clean up. Stop the container, drop
shade_drilland delete the media folder: the copy holds the instance's personal data. Write down the date, the backup's name and what you checked.
The database by hand. Where the host's own backups or a pg_dump are the main line, the drill is the same with your own dump.
Make it as the owner shade, in the custom format, and keep the file off the server:
docker compose exec -T postgres pg_dump -U shade -d shade --format=custom > shade-$(date +%F).dump
Restore it into the empty database with
docker compose exec -T postgres pg_restore --no-owner --no-privileges --exit-on-error -U shade -d shade_drill < shade-<date>.dump
and copy the data volume's uploads/ folder into the copy's media folder: nothing else in the volume matters, as the
module packages unpack again from the database (the commands). A restore by hand does not switch
maintenance mode on. Switch it on against shade_drill before the copy starts with docker compose run --rm --no-deps -e DATABASE_URL=postgres://shade_app@postgres:5432/shade_drill -e DATABASE_OWNER_URL=postgres://shade@postgres:5432/shade_drill admin node console/maintenance.mjs on, and leave the
worker out, or it runs schedules and sends queued email from the copy. Then go on from step 4.
Updating SHADE
- On Coolify: push to the tracked branch, or press Redeploy. The API container with the admin role applies new
migrations when it starts (
MIGRATE_ON_START=true), SHADE's and then its modules'; the public and worker containers never migrate: they wait, not ready, until the database holds both. - On your own server:
sudo shade update --version <version>pulls the image and the versions it pins, and restarts the admin, then public, then the worker, each healthy before the next (Self-hosting without Coolify). Set up by hand: update the checkout or the image, then restart the admin role first, or run themigrateconsole command (Console commands), before the other roles. - On Coolify, the gap: a redeploy of the compose template recreates every changed container at once, and Coolify does
not roll a compose resource. Expect 10 to 60 seconds, longer when a migration is slow, in which visitors and the team get
the proxy's own "not found" page rather than SHADE's. Plan it for a quiet hour.
publicandworkerwait for the new admin's health, so they come back after it. For updates without a gap you need the server of your own (Self-hosting without Coolify). - On Coolify, a release that needs maintenance: the changelog marks it. Take a backup, switch
maintenance mode on (Settings, or
node console/maintenance.mjs onin the admin container) before you redeploy, and off again once the admin's/healthanswers and the Modules screen shows what it should.shade update --maintenancedoes this only on a server of your own, and nothing does it for you on Coolify. The other releases only add to the database (Migrations only add), so the redeploy needs no maintenance beyond the restart itself. - The site: after an update that changes SHADE's version or a module's, the admin container asks for one rebuild of the site and every other frontend with a build hook when it starts, as publishing does (held while the instance is in maintenance). A site that builds on its own server and not from a build hook still needs a redeploy.
- Modules: an installed module package keeps working as long as it was made for the instance's SHADE version. One made for another version is left out when the API starts: the Modules screen shows it as Not running, with why. Install its new build there.
Each start of the admin container that applied a migration, or runs another SHADE or module version than before,
is written down in the database's upgrade_history table: the versions before and after, the migrations applied,
which container ran it, the backup taken before its migrations, and when. It is part of every backup. Admins see it
under Settings → Updates: each update with its versions, the modules that changed, how many database changes it
made and the backup taken before them.
Read the changelog before updating: it says which changes need something of the operator, before or after.
Previewing an update
Each release has a release file, shade-<version>.release.json, attached to it on GitHub: the release's database
changes, each with a line saying what it does, and the steps an operator takes for each release. Preview what
updating means for this instance before you update:
- In the admin: under Settings → Updates, choose Choose a release file and pick the file. Only admins can.
- On the server:
pnpm --filter @shadestack/api update-preview shade-<version>.release.json(in the image:node console/update-preview.mjs <file>). Add--jsonfor the preview as JSON. Without a file it previews this image's own release against the database, which is how to check after pulling an image and before restarting. It exits with 0 when the update is ready, 2 when it isn't.
The preview lists:
- the steps for every release between the version running and the file's, oldest first; a step for a module only shows when that module is installed;
- the database changes it will make, those this database doesn't have yet;
- the installed modules that won't run after it, and why: made for other SHADE versions, or built on one that is left out; a module with an update staged for that SHADE (Modules) counts as that update;
- the background tasks not done yet, which an update may need first (below).
It says Ready when no module is left out and nothing blocks. The preview changes nothing and runs
nothing. The file is checked before it is read, and anything that isn't a release file, or is larger than 512 KB,
is refused. An admin's preview is in the audit log (upgrades.preview).
Knowing when there is a new version
SHADE asks nobody about newer versions unless you set an update feed: off by default, with no default address.
Set SHADE_UPDATE_FEED_URL on the admin container to the https address of a feed you choose, and Settings →
Updates says when it lists a version newer than the one running, with a link to its release notes. It only tells:
nothing is downloaded or installed, and updating stays your step.
The feed is a small JSON file:
{ "format": 1, "releases": [{ "version": "0.2.0", "date": "2026-12-01", "notes": "https://example.org/releases/0.2.0" }] }
date and notes are optional, and pre-releases are left out. SHADE asks the feed with a plain GET at most every six
hours per container, when an admin opens Settings, sending nothing about the instance. The host of the feed still sees
the instance's address and when it asked. Only https and public addresses are called, the answer waits 5 seconds at
most and may be 64 KB at most, and one that isn't the format is refused: the card then says the feed could not be read.
A feed that keeps failing shows under Outside services on the Modules page.
Background tasks
An update that changes how data is stored does it in two steps, so the instance stays available: it adds the new column or table, and copies the data in the background while it keeps working. A later update removes what is no longer used. The copy is a background task, and modules can have them too.
- The worker starts a new task, or a new version of one, when it starts after the update. It does the work in small batches, with a short pause between them, and goes on where it stopped after a restart.
- Admins see each task under Settings → Background tasks: whether it is waiting, running, done, failed or paused, how many rows it did of how many, and the last error. Pause stops it after the batch it is doing, Resume goes on from there, and Retry tries a failed task again from where it stopped. Each is in the audit log.
- A task that fails tries again a few times on its own first. Once it has failed it also shows on the Modules screen among the parts of SHADE that need attention.
- Before an update whose changelog says it removes what a background task copied, check under Settings → Background tasks that the tasks it names are Done. If one is not, wait, or retry it and fix what its error says, before you update.
- A module update does this check itself. A module version that removes what one of its background tasks copied names that task, and installing it is refused until the task is done; the version you have keeps running. If a module is still left out for it at start, the Modules screen says so (Not running): wait for the task, or install the version you had before.
Handing an instance over
A developer who takes an instance over needs the repository access, the server (or the Coolify project), APP_SECRET
and the backups. Nothing else is needed: SHADE has no licence keys and calls no outside service of its own.
A client who leaves can be handed the latest built-in backup with one command, run where the API runs:
node console/restore.mjs handover ./handover
It copies the latest backup that opens into the new or empty folder, byte for byte and still encrypted (each file is checked against the
manifest's size and hash as it is written), and writes a README.md that says how to restore it. It prints where the key is
(SHADE_BACKUP_KEY of the admin and the worker, set in their environment or generated in their secrets-backup volume,
with APP_SECRET beside it) and never the key itself: only
--show-secrets prints SHADE_BACKUP_KEY and APP_SECRET, and APP_SECRET_PREVIOUS while it is set (backups taken
before rotating APP_SECRET need it). Hand the key and APP_SECRET over apart from the folder, by another route
(a password manager, not the same message): the folder with the key opens everything in it.
The client's admins can also download a backup themselves from the Backups card (see Downloading a backup) and
restore it on a server of their own with restore --from <file>; you still hand over the key.
A backup brings the instance back, but only SHADE can open it. For the client's next system, an admin also exports the
instance from Settings: one readable .tar of JSON and NDJSON with every entry, the media originals,
the team, users and the settings, which needs no SHADE and no key (see Exporting an instance).