Dxcufgb's Workshop

Install a Module in Foundry

WIPWork in progress: may be very buggy and can change a lot between versions.

Setup → Add-on Modules → Install Module, paste the Manifest URL http://localhost:8787/<module-id>/module.json (e.g. .../transformations/module.json; use the Docker-specific URL from Foundry in Docker if it applies), then Install. Foundry fetches the manifest from the proxy and downloads the zip through it. Updates then appear like any other module's, so publishing a new GitHub release is all that's needed.

The Admin Page has the link ready: Copy link in the module's ⋯ menu.

Module zips and updates

Foundry checks for updates with the manifest URL of the installed module.json, the one it unpacked from the zip, not the URL you installed from. A module's own module.json usually points at its GitHub release (https://github.com/<owner>/<repo>/releases/latest/download/module.json), which Foundry cannot read for a private repository. So the proxy hands Foundry the zip with that file's manifest and download replaced by its own links:

  • It reads the zip's size from the release, then fetches only the end of the zip (its table of contents) and the module.json from GitHub's pre-signed URL (partial downloads, never with the token).
  • It streams the original bytes to Foundry unchanged and appends the patched module.json and a new table of contents that points at it. The old copy stays in the file unreferenced. The zip is never unpacked or held in memory, so this works on a Raspberry Pi for zips of hundreds of MB.
  • The module.json Foundry reads is the one at the top of the zip, or else the only one inside a single top-level folder. Every other file is untouched.
  • When anything is unexpected (no module.json there, not valid JSON, an encrypted or ZIP64 zip, GitHub refusing partial downloads), the proxy falls back to the plain 302 to GitHub and logs why (zip vX redirected to GitHub (not patched: ...)); the module still installs, only updates do not come back through the proxy. If the module's module.json already points at the proxy, nothing is patched either.
  • PATCH_ZIPS=off in env turns this off: zips are plain redirects again.

Backed-up worlds

The proxy also serves worlds backed up to a private repository (proxy versions newer than 1.7.5). The repository's releases carry world.json and world.zip instead of module.json and module.zip.

  1. Add the repository with "type": "world": on the Admin Page (Add module, Type: World) or in config.json, e.g. "my-campaign": { "repo": "owner/my-campaign-backup", "type": "world" }. Use the world's id from its world.json. Give the token access to the repository as for a module.
  2. In Foundry: Setup → Game Worlds → Install World, paste the Manifest URL http://localhost:8787/<world-id>/world.json, then Install.

Everything above applies with world.json in place of module.json: the manifest's manifest and download point at the proxy (/<world-id>/world.json, /<world-id>/<tag>/world.zip), and the world.json inside the zip is patched the same way, so updates come back through the proxy. A world answers only to world.json/world.zip, a module only to module.json/module.zip.

Modules installed before this version

Modules installed before this version still have the GitHub URL in their installed module.json, so Foundry cannot see their next update. Fix each once:

  • reinstall it from the proxy URL (Setup → Add-on Modules → Install Module), or
  • edit manifest in Data/modules/<module-id>/module.json on the Foundry server to http://localhost:8787/<module-id>/module.json (your proxy address).

From then on updates come through the proxy.

This page mirrors the Private GitHub Proxy wiki on GitHub.