summaryrefslogtreecommitdiffstats
path: root/web/README.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-30 00:04:50 +0100
committersalmonik <salmonik@tuta.io>2026-10-30 00:04:50 +0100
commit4c1cc1175fd3bb030fe90ec734116e63f24f793e (patch)
tree70bcb27f41f95bd924fa027c0c629e01b7585a25 /web/README.md
parentadd static download page for client and server builds (diff)
downloadzagan-bet-4c1cc1175fd3bb030fe90ec734116e63f24f793e.tar.gz
zagan-bet-4c1cc1175fd3bb030fe90ec734116e63f24f793e.zip
make the download page dynamic: scan builds, show versions and SHA-256
Diffstat (limited to '')
-rw-r--r--web/README.md64
1 files changed, 64 insertions, 0 deletions
diff --git a/web/README.md b/web/README.md
new file mode 100644
index 0000000..3c6ee08
--- /dev/null
+++ b/web/README.md
@@ -0,0 +1,64 @@
1# Download page
2
3`index.php` scans `bin/client` and `bin/server` on every request and renders
4whatever builds it finds, with version, size and SHA-256. No database, no
5JavaScript, no dependencies. PHP 8.0+.
6
7## Layout
8
9```
10web/
11 index.php
12 bin/client/ served at /bin/client/...
13 bin/server/ served at /bin/server/...
14```
15
16Serve `web/` as the document root. Binaries in `bin/` are gitignored.
17
18## Naming
19
20The page only lists files that match the release pattern; anything else in
21those directories is ignored.
22
23```
24zagan-bet-client-<version>-<platform>-<arch>[.exe]
25zagan-bet-server-<version>-<platform>-<arch>
26```
27
28`<version>` is `MAJOR.MINOR.PATCH`, `<platform>` is `linux`, `windows` or
29`macos`, `<arch>` is `x86_64`, `i686` or `aarch64`.
30
31## Publishing a build
32
33From the repository root, with the version taken from `Cargo.toml`:
34
35```sh
36V=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
37
38cargo build --release --target x86_64-unknown-linux-gnu
39cargo build --release --bin client --no-default-features --target i686-unknown-linux-gnu
40cargo build --release --bin client --target x86_64-pc-windows-gnu
41
42cp "target/x86_64-unknown-linux-gnu/release/server" "web/bin/server/zagan-bet-server-$V-linux-x86_64"
43cp "target/x86_64-unknown-linux-gnu/release/client" "web/bin/client/zagan-bet-client-$V-linux-x86_64"
44cp "target/i686-unknown-linux-gnu/release/client" "web/bin/client/zagan-bet-client-$V-linux-i686"
45cp "target/x86_64-pc-windows-gnu/release/client.exe" "web/bin/client/zagan-bet-client-$V-windows-x86_64.exe"
46```
47
48`--no-default-features` drops the server's OpenSSL dependency, which is what
49the 32-bit client build would otherwise fail on.
50
51## Preview locally
52
53```sh
54php -S 127.0.0.1:8899 -t web
55```
56
57Then open <http://127.0.0.1:8899/>.
58
59## Notes
60
61- Hashes are computed per request with `hash_file()`. That is fine for a
62 handful of builds; add an mtime-keyed cache if the directory grows.
63- The page lists every build it finds, newest version first, so old releases
64 stay downloadable until you remove them from `bin/`.