Repository navigation
Configuration Reference
config.json (path from CONFIG_FILE, default ./config.json; see config.example.json) holds the schedule and the per-world settings and is written by the Admin Page:
{
"schedule": { "frequency": "daily", "time": "04:00", "weekday": 0, "everyHours": 6 },
"github": { "repoPrefix": "foundry-world-", "createRepos": true, "releases": false },
"whenActive": "backup",
"foundry": { "url": "http://localhost:30000" },
"worlds": {
"my-campaign": { "enabled": true, "repo": "", "schedule": null, "whenActive": "" },
"test-world": { "enabled": false }
}
}-
schedule.frequency:daily(attime),weekly(onweekday, 0 = Sunday … 6 = Saturday, attime) orhourly(everyeveryHourshours counted from midnight; 1, 2, 3, 4, 6, 8, 12 or 24). - Times are the local time of the machine.
- A slot missed while the machine was off runs as soon as the service is back, so a freshly installed service backs every world up once right away.
-
github.repoPrefix: a world goes to<token owner>/<repoPrefix><world id>unless its ownrepo(owner/name) says otherwise. -
github.createRepos: create a missing repository (always private) on the first backup; off = a missing repository is an error. -
github.releases: every backup commit also carries the workflow that builds an installable release of the world (default off; see Installable World Backups).
What to do when Foundry has the world launched at backup time: backup (back it up anyway; the commit message says so) or skip (wait for the next run). Foundry's /api/status tells which world is active.
foundry.url: where Foundry answers /api/status (http or https, no user name or password); set on the admin page's Foundry page. Absent = FOUNDRY_URL from the environment; "" = never ask (no active-world check).
worlds.<id>: enabled (default true: a new world is backed up without any setup), repo, schedule (its own schedule, or null for the global one) and whenActive ("" for the global setting). Worlds that are not listed get the defaults. A world id is the folder name under Data/worlds.
See .env.example. On an installed service the env file (/etc/foundry-world-backup/env on Linux, C:\ProgramData\FoundryWorldBackup\env on Windows) holds the token; ADMIN_HOSTS and ADMIN_PUBLIC_URL are added there too (restart afterwards).
| Variable | What |
|---|---|
GITHUB_TOKEN |
the GitHub token |
FOUNDRY_DATA |
required: the Foundry user data folder, the one with Config, Data and Logs; its Data or Data/worlds folder works too |
CONFIG_FILE |
the path of config.json (default ./config.json) |
STATE_DIR |
default state next to CONFIG_FILE
|
ADMIN_FILE |
default admin.json next to CONFIG_FILE
|
ENV_FILE |
the file holding GITHUB_TOKEN, where a token changed on the admin page is saved; default env next to CONFIG_FILE
|
FOUNDRY_URL |
default http://localhost:30000; empty = never ask whether a world is active; foundry.url in config.json, set on the admin page, wins |
GIT_BIN |
the git command (default git from PATH) |
DAILY_CHECK |
off turns off the daily token check
|
ADMIN_PORT |
default 8484
|
ADMIN_HOST |
default 0.0.0.0
|
ADMIN_TLS |
off = plain HTTP, only behind a reverse proxy |
ADMIN_TLS_CERT, ADMIN_TLS_KEY
|
a real certificate and its key |
ADMIN_HOSTS |
host names the admin page accepts |
ADMIN_PUBLIC_URL |
the admin page's public address |
ADMIN_TRUST_PROXY |
1 behind a reverse proxy |
The ADMIN_* settings are explained on Admin Page on a Public Address.
Run locally: GITHUB_TOKEN=... FOUNDRY_DATA=/path/to/foundrydata CONFIG_FILE=config.example.json node src/server.js.
Tests: npm test (config and scheduler, the backup with the real git command against a local repository, admin page, mailer and updater; no network needed).
Dxcufgb's Workshop: every Foundry VTT project, video and changelog in one place · Support on Ko-fi · MIT License
Setting up
Using it
- How a Backup Works
- Restoring a World
- Installable World Backups
- Notifications and Daily Check
- Automatic Updates
Reference