The MediaWiki behind xboxdevwiki.net, built with Nix into a container for Cloud Run. Everything in the image is compiled with Fil-C; the build fails if something is not.
nix run -f . deploy # build, push, release on Cloud Run
$(nix-build -A image) | docker load # just build the imageUse the binary cache, or Nix will build the Fil-C compiler from source:
extra-substituters = https://filc.cachix.org
extra-trusted-public-keys = filc.cachix.org-1:8rA7kXyu1HaJuMTsAKfA9fU/+r8YtLv5KiZ5hfDNZMk=docker run --rm -p 8080:8080 \
-e WG_DB_SERVER=host:3306 -e WG_DB_PASSWORD=... -e WG_SECRET_KEY=... \
-e GCS_ACCESS_KEY=... -e GCS_SECRET_KEY=... \
us-central1-docker.pkg.dev/xqemu-154113/xboxdevwiki/xboxdevwiki:$(nix-instantiate --eval --raw -A image.imageTag)WG_DB_SERVER is needed: the live database takes no connections from outside
Cloud Run.
nix/secrets.nix holds them encrypted with Cloud KMS. The container decrypts
them when it starts, as the xboxdevwiki service account, which has
roles/cloudkms.cryptoKeyDecrypter on the xboxdevwiki-secrets key and
roles/cloudsql.client, and nothing else.
- PHP is 7.4.33, the newest that runs MediaWiki 1.28. Neither is supported upstream any more.
- Cloud Run must use the gen2 environment: Fil-C programs crash under gVisor.
nix/pins.nixpins filnix and the nixpkgs itsflake.locknames. Move them together, or nothing will be in the binary cache.