summaryrefslogtreecommitdiffstats
path: root/web/README.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--web/README.md28
1 files changed, 26 insertions, 2 deletions
diff --git a/web/README.md b/web/README.md
index 5de180d..a82c492 100644
--- a/web/README.md
+++ b/web/README.md
@@ -58,10 +58,34 @@ php -S 127.0.0.1:8899 -t web
58 58
59Then open <http://127.0.0.1:8899/>. 59Then open <http://127.0.0.1:8899/>.
60 60
61## Deploying
62
63```sh
64./scripts/publish.sh
65./scripts/deploy.sh user@host:/srv/zagan.bet https://zagan.bet/
66```
67
68`deploy.sh` rsyncs `web/` with `--delay-updates`, so a visitor never sees a
69half-written binary, then fetches the live page and every artifact it lists and
70compares the downloaded bytes with the local SHA-256. `--verify-only` skips the
71upload and only checks the live site. Old versions are left on the server;
72prune them by hand.
73
74A local directory works as a target, which is how the verification itself is
75tested:
76
77```sh
78php -S 127.0.0.1:8899 -t /srv/staging
79./scripts/deploy.sh /srv/staging http://127.0.0.1:8899/
80```
81
61## Notes 82## Notes
62 83
63- Hashes are computed per request with `hash_file()`. That is fine for a 84- Hashes are cached in a JSON file keyed on size and mtime, so a file is only
64 handful of builds; add an mtime-keyed cache if the directory grows. 85 read once until it changes. The cache lives in the system temp directory by
86 default because the web root is often not writable by the PHP user; set
87 `ZAGAN_HASH_CACHE` to put it elsewhere. If the cache cannot be written, the
88 page simply hashes every request.
65- The page lists every build it finds, newest version first, so old releases 89- The page lists every build it finds, newest version first, so old releases
66 stay downloadable until you remove them from `bin/`. 90 stay downloadable until you remove them from `bin/`.
67- The checksum block is in `sha256sum` format, so visitors can save it as 91- The checksum block is in `sha256sum` format, so visitors can save it as