Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3fc1096500
|
@@ -1,21 +1,21 @@
|
|||||||
[target.wasm32-unknown-unknown]
|
[target.wasm32-unknown-unknown]
|
||||||
rustflags = [
|
rustflags = [
|
||||||
"-C",
|
"-C",
|
||||||
"link-arg=--import-undefined",
|
"link-arg=--import-undefined",
|
||||||
"-C",
|
"-C",
|
||||||
"link-arg=--export=tdkpin_storage_crate_version",
|
"link-arg=--export=tdkpin_storage_crate_version",
|
||||||
"-C",
|
"-C",
|
||||||
"link-arg=--export=tdkpin_browser_storage_clear",
|
"link-arg=--export=tdkpin_browser_storage_clear",
|
||||||
"-C",
|
"-C",
|
||||||
"link-arg=--export=tdkpin_browser_storage_push",
|
"link-arg=--export=tdkpin_browser_storage_push",
|
||||||
"-C",
|
"-C",
|
||||||
"link-arg=--export=tdkpin_browser_storage_finish",
|
"link-arg=--export=tdkpin_browser_storage_finish",
|
||||||
"-C",
|
"-C",
|
||||||
"link-arg=--export=tdkpin_browser_storage_save_revision",
|
"link-arg=--export=tdkpin_browser_storage_save_revision",
|
||||||
"-C",
|
"-C",
|
||||||
"link-arg=--export=tdkpin_browser_storage_save_length",
|
"link-arg=--export=tdkpin_browser_storage_save_length",
|
||||||
"-C",
|
"-C",
|
||||||
"link-arg=--export=tdkpin_browser_storage_save_byte",
|
"link-arg=--export=tdkpin_browser_storage_save_byte",
|
||||||
"-C",
|
"-C",
|
||||||
"link-arg=--export=tdkpin_browser_storage_save_ack",
|
"link-arg=--export=tdkpin_browser_storage_save_ack",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ response is the canonical top-ten JSON array.
|
|||||||
A newly created database starts with the original distributed demo table. An
|
A newly created database starts with the original distributed demo table. An
|
||||||
existing database, including an existing empty database, is left unchanged.
|
existing database, including an existing empty database, is left unchanged.
|
||||||
|
|
||||||
Submissions are anonymous and intentionally trust the browser's score. Add
|
Submissions are anonymous and intentionally trust the browser's score. Add rate
|
||||||
rate limiting, moderation, or server-side run verification if the table needs
|
limiting, moderation, or server-side run verification if the table needs to
|
||||||
to resist forged scores.
|
resist forged scores.
|
||||||
|
|
||||||
Run it from `tdkpin-rs` with:
|
Run it from `tdkpin-rs` with:
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ cargo run --manifest-path highscore-server/Cargo.toml
|
|||||||
```
|
```
|
||||||
|
|
||||||
Copy the rate and connection zone declarations from
|
Copy the rate and connection zone declarations from
|
||||||
[nginx.conf.example](nginx.conf.example) into the existing `http` block, then
|
[nginx.conf.example](./nginx.conf.example) into the existing `http` block, then
|
||||||
place its two `location` blocks inside the public site's `server` block. The
|
place its two `location` blocks inside the public site's `server` block. The
|
||||||
example bounds per-client and aggregate API traffic, request bodies, and proxy
|
example bounds per-client and aggregate API traffic, request bodies, and proxy
|
||||||
waits. The browser client expects the API at `/api/highscores` on the same
|
waits. The browser client expects the API at `/api/highscores` on the same
|
||||||
|
|||||||
@@ -16,9 +16,10 @@ bootstrap is local as well, so the page does not require inline or third-party
|
|||||||
JavaScript. The web page must be served over HTTP rather than opened directly
|
JavaScript. The web page must be served over HTTP rather than opened directly
|
||||||
from a `file:` URL.
|
from a `file:` URL.
|
||||||
|
|
||||||
For a strict Content Security Policy, allow `script-src 'self'
|
For a strict Content Security Policy, allow
|
||||||
'wasm-unsafe-eval'` for the browser's WebAssembly compilation and
|
`script-src 'self' 'wasm-unsafe-eval'` for the browser's WebAssembly compilation
|
||||||
`connect-src 'self'` for the local WASM and optional high-score API requests.
|
and `connect-src 'self'` for the local WASM and optional high-score API
|
||||||
|
requests.
|
||||||
|
|
||||||
When the same-origin `/api/highscores` endpoint is available, the browser loads
|
When the same-origin `/api/highscores` endpoint is available, the browser loads
|
||||||
and submits the shared top-ten table there. The small Axum service and an nginx
|
and submits the shared top-ten table there. The small Axum service and an nginx
|
||||||
|
|||||||
Reference in New Issue
Block a user