Skip to content

Development

The tool is a Python package with no dependencies beyond the standard library. Contributor notes are in AGENTS.md in the repository.

Terminal window
python3 -m unittest discover -s tests

The tests need no network and no T4 instance. For anything that needs a live instance, t4 doctor is the tool’s own self-check, run by a person against their own CMS.

The app lives in desktop/. To build it locally:

Terminal window
cd desktop
npm ci
npm run python # fetch the pinned Python, checksum-verified
npm start # run it from source
npm run dist:mac # or dist:win (on Windows)

npm run python downloads a pinned python-build-standalone build. It checks the download against a SHA-256 recorded in scripts/fetch-python.mjs, then installs src/departuregate inside it. Run it again after changing the Python code.

Signing turns on when the workflow’s secrets are set: a Developer ID certificate and notarization credentials for the Mac, and either a .pfx or Azure Trusted Signing for Windows. The list is at the top of .github/workflows/desktop.yml. Without them the builds are unsigned.

To release a version, set it in desktop/package.json, pyproject.toml and src/departuregate/__init__.py, push main, then on a Mac run:

Terminal window
scripts/release-local.sh # build and check, publish nothing
scripts/release-local.sh --publish # then tag and release

It runs the tests, builds both Mac disk images and checks them, then tags the version and publishes a GitHub release. Then it runs the desktop workflow for the Windows installer alone, which a Mac cannot build. That run adds the installer to the release and rebuilds this site. The docs workflow copies the latest release’s installers onto the site, with the Download page and the version.json that installed apps check. To build everything on Actions instead, run the desktop workflow by hand on the tag with “all”; on a branch, it makes a test build that releases nothing, with its installers attached to the run.

The site is in site/: an Astro Starlight project. The landing page is site/src/pages/index.astro, and the docs are Markdown under site/src/content/docs/docs/. The diagrams and screenshots are drawn by docs/diagrams.py into docs/img/, which the README uses too; the build copies them in.

Terminal window
cd site
npm ci
npm run dev # http://localhost:4321/

To build it with the download page, put a release in first:

Terminal window
gh release download --dir /tmp/release --pattern '*-windows-setup.exe' --pattern '*-mac-*.dmg'
gh release view --json tagName,publishedAt,assets > /tmp/release/release.json
python3 docs/release.py /tmp/release # into site/public/download/
cd site && npm run build # into site/dist/

The built site is static files, so it can be served from any web server. To move it, say to your own server:

  1. Build it with SITE_URL and SITE_BASE set to where it will live, such as SITE_URL=https://downloads.example.com SITE_BASE=/, and publish site/dist there.
  2. Set the repository variable UPDATE_FEED to the new …/download/version.json address. App builds from then on check there.
  3. Keep the old address serving one more release, so apps installed before the move are told about the version that knows the new address.

The site can count downloads with Umami, which sets no cookies and stores no personal data. It is off unless the build is given a website id: with none, the pages carry no analytics script at all. Set these as repository variables (Settings › Secrets and variables › Actions › Variables), not secrets, since both end up in the public pages:

  • PUBLIC_UMAMI_WEBSITE_ID: the website id from Umami. Turns counting on.
  • PUBLIC_UMAMI_SRC: the address of Umami’s script, for a self-hosted instance. Defaults to https://cloud.umami.is/script.js.

The script only counts visits to the site’s own address (data-domains), so local previews are not counted. Every installer link on the Download page sends a download event with platform (windows, mac-arm64 or mac-x64) and version. In Umami they appear under Events › download, which you can break down by platform. To try it locally: PUBLIC_UMAMI_WEBSITE_ID=test-id npm run build in site/.

An independent, unofficial tool. Not produced, endorsed or supported by TERMINALFOUR Solutions Ltd, and not TERMINALFOUR software. “T4” and “TERMINALFOUR” are their trademarks, used here only to identify the software this works with. Copyright © 2026 Small Robot Corp. Source available under the PolyForm Shield License 1.0.0.