diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-01 21:35:30 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-01 21:38:36 +0100 |
| commit | 7830b3c5e89f0339949940b8986bf4849ad7f223 (patch) | |
| tree | d4ebb4f10583cef1da3b181e093dd5d65ac8a0bb /web/README.md | |
| parent | v4.2.1: plain-language game copy and a balance fetch on login (diff) | |
| download | zagan-bet-7830b3c5e89f0339949940b8986bf4849ad7f223.tar.gz zagan-bet-7830b3c5e89f0339949940b8986bf4849ad7f223.zip | |
v4.3.0: package the desktop app with verifiable installers
publish.sh builds the GUI with the gui-release profile, names it zagan-bet-gui-<version>-<platform>-<arch>, and renders a bash and a PowerShell installer next to each app. Both embed the app's SHA-256, verify the file (or fetch it), install per-user and add a launcher: a desktop entry plus an SVG icon on Linux, a Start-menu shortcut on Windows.
The download page gains a Desktop app section with the apps and installers, keeps the terminal client and server, links the public git repository for the GPL source, and lists every file in the sha256sum block. deploy.sh verifies all four artifact kinds. Publishing refuses a dirty tree so the linked history matches the binaries.
Diffstat (limited to 'web/README.md')
| -rw-r--r-- | web/README.md | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/web/README.md b/web/README.md index e79abd4..bd87e11 100644 --- a/web/README.md +++ b/web/README.md | |||
| @@ -1,15 +1,15 @@ | |||
| 1 | # Download page | 1 | # Download page |
| 2 | 2 | ||
| 3 | `index.php` scans `bin/client` and `bin/server` on every request and renders | 3 | `index.php` scans `bin/gui`, `bin/client` and `bin/server` on every request and |
| 4 | whatever builds it finds, with version, size and SHA-256. No database, no | 4 | renders whatever builds it finds, with version, size and SHA-256. No database, no JavaScript, no CSS, no dependencies. The page is plain |
| 5 | JavaScript, no CSS, no dependencies. The page is plain browser defaults: | 5 | browser defaults: black text, blue links, monospace checksums. PHP 8.0+. |
| 6 | black text, blue links, monospace checksums. PHP 8.0+. | ||
| 7 | 6 | ||
| 8 | ## Layout | 7 | ## Layout |
| 9 | 8 | ||
| 10 | ``` | 9 | ``` |
| 11 | web/ | 10 | web/ |
| 12 | index.php | 11 | index.php |
| 12 | bin/gui/ served at /bin/gui/... (app and installers) | ||
| 13 | bin/client/ served at /bin/client/... | 13 | bin/client/ served at /bin/client/... |
| 14 | bin/server/ served at /bin/server/... | 14 | bin/server/ served at /bin/server/... |
| 15 | ``` | 15 | ``` |
| @@ -22,13 +22,22 @@ The page only lists files that match the release pattern; anything else in | |||
| 22 | those directories is ignored. | 22 | those directories is ignored. |
| 23 | 23 | ||
| 24 | ``` | 24 | ``` |
| 25 | zagan-bet-client-<version>-<platform>-<arch>[.exe] | 25 | bin/gui/zagan-bet-gui-<version>-<platform>-<arch>[.exe] |
| 26 | zagan-bet-server-<version>-<platform>-<arch> | 26 | bin/gui/zagan-bet-gui-<version>-<platform>-<arch>-install.sh |
| 27 | bin/gui/zagan-bet-gui-<version>-<platform>-<arch>-install.ps1 | ||
| 28 | bin/client/zagan-bet-client-<version>-<platform>-<arch>[.exe] | ||
| 29 | bin/server/zagan-bet-server-<version>-<platform>-<arch>[.exe] | ||
| 27 | ``` | 30 | ``` |
| 28 | 31 | ||
| 29 | `<version>` is `MAJOR.MINOR.PATCH`, `<platform>` is `linux`, `windows` or | 32 | `<version>` is `MAJOR.MINOR.PATCH`, `<platform>` is `linux`, `windows` or |
| 30 | `macos`, `<arch>` is `x86_64`, `i686` or `aarch64`. | 33 | `macos`, `<arch>` is `x86_64`, `i686` or `aarch64`. |
| 31 | 34 | ||
| 35 | The installers are generated next to their app. They embed the app's SHA-256, | ||
| 36 | check the file (or download it) and install it for the current user: Linux | ||
| 37 | writes `~/.local/bin/zagan-bet-gui` plus a `.desktop` launcher, Windows writes | ||
| 38 | `%LOCALAPPDATA%\Programs\Zagan-Bet` plus a Start-menu shortcut. The source | ||
| 39 | archives satisfy the GPL's corresponding-source requirement. | ||
| 40 | |||
| 32 | ## Publishing a build | 41 | ## Publishing a build |
| 33 | 42 | ||
| 34 | From the repository root: | 43 | From the repository root: |
| @@ -37,15 +46,21 @@ From the repository root: | |||
| 37 | ./scripts/publish.sh | 46 | ./scripts/publish.sh |
| 38 | ``` | 47 | ``` |
| 39 | 48 | ||
| 40 | It reads the version from `Cargo.toml`, builds all four artifacts and installs | 49 | It reads the version from `Cargo.toml`, builds every artifact and installs |
| 41 | them under `web/bin` with the names above. Override the destination with | 50 | them under `web/bin` with the names above. The GUI is built with the |
| 42 | `DEST=/srv/www/bin ./scripts/publish.sh`. | 51 | workspace's `gui-release` profile (LTO, stripped) and the installers are |
| 52 | rendered with Python 3 and the published SHA-256. Run it from a clean tree so | ||
| 53 | the release commit is the source the page links to. Override the destination | ||
| 54 | with `DEST=/srv/www/bin ./scripts/publish.sh`, and the download origin baked | ||
| 55 | into the installers with `URL_BASE=https://staging.example/ ./scripts/publish.sh`. | ||
| 56 | `ALLOW_DIRTY=1` skips the clean-tree check for a preview. | ||
| 43 | 57 | ||
| 44 | Builds are per target triple, so these must be installed: | 58 | Builds are per target triple, so these must be installed: |
| 45 | `x86_64-unknown-linux-gnu`, `i686-unknown-linux-gnu` and | 59 | `x86_64-unknown-linux-gnu`, `i686-unknown-linux-gnu` and |
| 46 | `x86_64-pc-windows-gnu`, plus the mingw linker for the Windows build. Client | 60 | `x86_64-pc-windows-gnu`, plus the mingw linker for the Windows build. Client |
| 47 | builds always pass `--no-default-features`, which drops the server's OpenSSL | 61 | builds always pass `--no-default-features`, which drops the server's OpenSSL |
| 48 | dependency; the client is rustls-only. | 62 | dependency; the client is rustls-only. The GUI needs Python 3 at publish time |
| 63 | for the installer templates in `scripts/installers/`. | ||
| 49 | 64 | ||
| 50 | Cargo itself cannot produce these names: it always writes | 65 | Cargo itself cannot produce these names: it always writes |
| 51 | `target/<triple>/release/<bin>`. The script renames after each build. | 66 | `target/<triple>/release/<bin>`. The script renames after each build. |
| @@ -100,8 +115,9 @@ Then open <http://127.0.0.1:8899/>. | |||
| 100 | ``` | 115 | ``` |
| 101 | 116 | ||
| 102 | `deploy.sh` rsyncs `web/` with `--delay-updates`, so a visitor never sees a | 117 | `deploy.sh` rsyncs `web/` with `--delay-updates`, so a visitor never sees a |
| 103 | half-written binary, then fetches the live page and every artifact it lists and | 118 | half-written binary, then fetches the live page and every artifact it lists — |
| 104 | compares the downloaded bytes with the local SHA-256. `--verify-only` skips the | 119 | GUI apps, installers, terminal clients and servers — and compares the |
| 120 | downloaded bytes with the local SHA-256. `--verify-only` skips the | ||
| 105 | upload and only checks the live site. Old versions are left on the server; | 121 | upload and only checks the live site. Old versions are left on the server; |
| 106 | prune them by hand. | 122 | prune them by hand. |
| 107 | 123 | ||
| @@ -124,3 +140,6 @@ php -S 127.0.0.1:8899 -t /srv/staging | |||
| 124 | stay downloadable until you remove them from `bin/`. | 140 | stay downloadable until you remove them from `bin/`. |
| 125 | - The checksum block is in `sha256sum` format, so visitors can save it as | 141 | - The checksum block is in `sha256sum` format, so visitors can save it as |
| 126 | `SHA256SUMS` and run `sha256sum -c SHA256SUMS`. | 142 | `SHA256SUMS` and run `sha256sum -c SHA256SUMS`. |
| 143 | - The page links <https://git.2137697.xyz/zagan-bet.git> for the GPL | ||
| 144 | corresponding source; publish only from a committed release so that link | ||
| 145 | contains the exact source. | ||
