* feat(config): add support for APP_SECRET as a file * fix(tsc): ensure appSecret is set in type system * fix: pr feedback
Provisioned repositories and volumes
This example shows how to keep operator-managed repositories and volumes in a mounted JSON file instead of creating them through the UI.
At startup, Zerobyte reads the provisioning file, resolves any env://... or file://... references, encrypts the resolved secrets into the database, and syncs the resources into the normal repositories and volumes lists as managed entries.
Why this model
- Secret references stay in deployment-time config instead of the UI.
- Provisioned repositories and volumes show up in the normal UI and API.
- Secret rotation is just an env/secret update plus a restart.
What this example includes
docker-compose.ymlmounts a provisioning file and a Docker secret..env.exampleprovides the environment variables used byenv://...references.provisioning.example.jsonprovisions one S3 repository and one WebDAV volume.secrets/aws_secret_access_key.exampleshows the file consumed byfile://aws_secret_access_key.
Prerequisites
- Docker + Docker Compose
- An existing Zerobyte organization ID (found in the UI under Settings > Organization)
- An S3-compatible repository target and a WebDAV share, or your own equivalent values
If this is a brand-new Zerobyte instance, finish first-run setup first so you have a real organization ID, then enable provisioning and restart the container.
Setup
- Copy the example files:
cp .env.example .env
cp provisioning.example.json provisioning.json
cp secrets/aws_secret_access_key.example secrets/aws_secret_access_key
- Edit
.env:
- Set
APP_SECRETto a real secret, for exampleopenssl rand -hex 32, or setAPP_SECRET_FILEto a mounted secret file - Set
ZEROBYTE_AWS_ACCESS_KEY_ID - Set
ZEROBYTE_WEBDAV_PASSWORD - Adjust
BASE_URLandTZif needed
- Edit
provisioning.json:
- Replace
organizationIdwith your existing Zerobyte organization ID - Update the S3 endpoint/bucket values
- Update the WebDAV server, path, and username
-
Edit
secrets/aws_secret_access_keyand replace the placeholder value with the real secret access key. -
Start the stack:
docker compose up -d
How secret references work
env://ZEROBYTE_AWS_ACCESS_KEY_IDreads from a container environment variable.env://ZEROBYTE_WEBDAV_PASSWORDreads from a container environment variable.file://aws_secret_access_keyreads/run/secrets/aws_secret_access_keyinside the container.- The resolved values are encrypted before Zerobyte stores them in the database.
file://... references are always resolved from /run/secrets and must be a single filename, not a nested path.
Access
- UI/API:
http://<host>:4096
What you'll see in Zerobyte
AWS Production Backupsappears in the repositories list as a managed repository.Team A WebDAVappears in the volumes list as a managed volume.- Changes to
provisioning.json,.env, or mounted secret files apply on the next container restart.
Rotating or removing provisioned resources
- Rotate an env-based secret: update
.env, then restart Zerobyte. - Rotate a file-based secret: update
secrets/aws_secret_access_key, then restart Zerobyte. - Remove a resource: add
delete: true, then restart Zerobyte.
Notes
- This example keeps
SYS_ADMINand/dev/fuseenabled because the sample volume uses WebDAV. - Each provisioned entry must reference an existing
organizationId. - Each entry includes both a top-level
backendand the matchingconfig.backend.