summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-08 03:38:48 +0100
committersalmonik <salmonik@tuta.io>2026-11-08 03:38:48 +0100
commit10bd35e6b6d34d58b93700b498609926aa5d90ba (patch)
tree3b3978a5a41f81c1750cc9ee3255a1fbd0a19a49 /web
parentweb: show the account number and stop reel spin on an error (diff)
downloadzagan-bet-10bd35e6b6d34d58b93700b498609926aa5d90ba.tar.gz
zagan-bet-10bd35e6b6d34d58b93700b498609926aa5d90ba.zip
web: link the GPL source from the play page; normalise gateway config
The browser footer links the public repository. ZAGAN_WEB_ORIGIN is lowercased for origin matching, and the pinned fingerprint accepts the colon-separated form operators often copy.
Diffstat (limited to '')
-rw-r--r--web/play/index.html3
-rw-r--r--web/play/style.css10
-rw-r--r--webd/src/config.rs7
3 files changed, 18 insertions, 2 deletions
diff --git a/web/play/index.html b/web/play/index.html
index 7cb902f..59a302b 100644
--- a/web/play/index.html
+++ b/web/play/index.html
@@ -88,6 +88,9 @@
88 <div id="history-body"></div> 88 <div id="history-body"></div>
89 </section> 89 </section>
90 </main> 90 </main>
91 <footer class="site-foot">
92 Play-money only ยท built from <a href="https://git.2137697.xyz/zagan-bet.git">the GPL source</a>
93 </footer>
91</div> 94</div>
92 95
93<div id="toasts" aria-live="polite"></div> 96<div id="toasts" aria-live="polite"></div>
diff --git a/web/play/style.css b/web/play/style.css
index 20842d2..e05f551 100644
--- a/web/play/style.css
+++ b/web/play/style.css
@@ -356,6 +356,16 @@ td.pos { color: var(--win); }
356td.neg { color: var(--loss); } 356td.neg { color: var(--loss); }
357 357
358/* Toasts and overlays */ 358/* Toasts and overlays */
359.site-foot {
360 width: min(1240px, 100%);
361 margin: 0 auto;
362 padding: 0 24px 28px;
363 color: var(--faint);
364 font-family: var(--mono);
365 font-size: 11px;
366}
367.site-foot a { color: var(--dim); }
368
359#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 50; width: min(380px, calc(100vw - 36px)); } 369#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 50; width: min(380px, calc(100vw - 36px)); }
360.toast { 370.toast {
361 background: var(--surface); 371 background: var(--surface);
diff --git a/webd/src/config.rs b/webd/src/config.rs
index d3ada8f..44ce4ec 100644
--- a/webd/src/config.rs
+++ b/webd/src/config.rs
@@ -34,11 +34,14 @@ impl Config {
34 if !origin.starts_with("http://") && !origin.starts_with("https://") { 34 if !origin.starts_with("http://") && !origin.starts_with("https://") {
35 return Err("ZAGAN_WEB_ORIGIN must start with http:// or https://".to_string()); 35 return Err("ZAGAN_WEB_ORIGIN must start with http:// or https://".to_string());
36 } 36 }
37 let origin = origin.trim_end_matches('/').to_string(); 37 let origin = origin.trim_end_matches('/').to_ascii_lowercase();
38 38
39 let upstream = value("ZAGAN_UPSTREAM", DEFAULT_UPSTREAM); 39 let upstream = value("ZAGAN_UPSTREAM", DEFAULT_UPSTREAM);
40 let fingerprint = required("ZAGAN_UPSTREAM_FINGERPRINT")?; 40 let fingerprint = required("ZAGAN_UPSTREAM_FINGERPRINT")?;
41 let fingerprint = fingerprint.trim().to_ascii_lowercase(); 41 let fingerprint = fingerprint
42 .trim()
43 .replace([':', ' ', '-'], "")
44 .to_ascii_lowercase();
42 if fingerprint.len() != 64 || !fingerprint.bytes().all(|byte| byte.is_ascii_hexdigit()) { 45 if fingerprint.len() != 64 || !fingerprint.bytes().all(|byte| byte.is_ascii_hexdigit()) {
43 return Err( 46 return Err(
44 "ZAGAN_UPSTREAM_FINGERPRINT must be the 64-character SHA-256 of the upstream SPKI" 47 "ZAGAN_UPSTREAM_FINGERPRINT must be the 64-character SHA-256 of the upstream SPKI"