Commit Graph

30 Commits

Author SHA1 Message Date
Adam Shiervani f7775a00a0 fix: skip incompatible defaults and parallelize stable DB lookups
getDefaultRelease previously picked the newest 100%-rolled-out release
without checking SKU compatibility. If that release lacked a compatible
artifact, the request 404'd downstream even though older 100%-rolled-out
releases had valid binaries for the SKU. It now filters to releases that
actually ship a compatible artifact before selecting the latest, falling
back to a 404 only when no compatible default exists.

The four DB lookups in the stable rollout-aware path are independent; run
them concurrently so background-check latency drops from ~4 round trips
to ~1.
2026-04-27 19:05:39 +02:00
Adam Shiervani 57ec20b041 refactor: drop forceUpdate query parameter from /releases
The flag is no longer sent by any client. Routine update checks now
always go through the rollout-aware default-and-latest path, which is
what forceUpdate effectively short-circuited to. Removes one query
parameter, one branch in the handler, and the corresponding axis from
the compare-releases sweep.
2026-04-27 18:45:31 +02:00
Adam Shiervani 3ab1ad6408 fix: restrict legacy OTA artifacts and make sync create-only
Pre-SKU artifacts (no skus/ folder) are jetkvm-v2 only. Marking them
compatible with jetkvm-v2-sdmmc would brick devices that received
firmware predating their hardware. Future SKUs must opt in via an
explicit skus/<sku>/ upload.

sync-releases now skips releases already in the DB instead of upserting
them. This prevents routine sync runs from rewriting Release.url/hash
or appending duplicate ReleaseArtifact rows if R2_CDN_URL ever changes.
Backfills and repairs are left to one-off scripts.
2026-04-27 18:38:46 +02:00
Adam Shiervani 9aaa9e7c48 fix: match production OTA release responses
Only expose stable signature URLs that actually exist and preserve production's version-first SKU error behavior.
2026-04-27 17:51:17 +02:00
Adam Shiervani 9cd63a1acd fix: select compatible OTA releases by SKU
Ensure stable release selection only considers releases with artifacts compatible with the requested SKU, and tighten tests around the DB-backed OTA contract.
2026-04-27 16:39:13 +02:00
Adam Shiervani c9e9f92840 feat: add SKU-aware OTA release artifacts
Persist OTA artifact URL/hash data separately from rollout state so stable release responses can choose artifacts by compatible SKU while release rollout remains version/type based.
2026-04-27 16:21:55 +02:00
Adam Shiervani edf9b177c1 feat: serve optional GPG signature URLs for OTA releases (#54)
* feat: serve optional GPG signature URLs for OTA releases

Resolve .sig file existence from S3 at response time and include
appSigUrl/systemSigUrl in the release payload when present. Works
across all code paths (prerelease, forceUpdate, rollout) and supports
backfilling signatures for older releases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix releases sig URL cache typing

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:39:21 +01:00
Nikita Sliusarev 8596c72b29 feat: implement user account allowlist (#51) 2026-02-02 12:23:01 +01:00
Nikita Sliusarev dd963739ea feat: use user-provided env for compose container creation (#52) 2026-02-02 12:22:41 +01:00
Adam Shiervani 46d56cb978 Improve DX (#50)
* feat: add seed script for development with test users, devices, and release data

* feat: add development Docker Compose configuration and update README for local setup
2026-01-30 14:07:36 +01:00
Adam Shiervani 888fd63410 chore: update Node.js engine version in package.json to 22.x 2026-01-28 11:08:54 +01:00
Adam Shiervani 1958830b27 OTA for specific SKUs (#49) 2026-01-28 10:53:23 +01:00
Adam Shiervani 3e6acb65c3 Add integration tests for releases (#48) 2026-01-27 12:24:22 +01:00
Adam Shiervani 86978b2fcc feat: return device version when listing devices (#44) 2025-11-12 17:50:24 +01:00
Aveline a73f688ce8 feat: allow to specify maxSatisfying for /releases api (#42) 2025-10-29 17:24:47 +01:00
Techno Tim 3f13242d64 feat(ci): GitHub action for pull requests (#24) 2025-10-14 09:11:55 +02:00
Noah Halstead 17d01bb7eb Upgrade to Express v5, Dockerfile, and Health Checks (#29)
Co-authored-by: Aveline <g@xswan.net>
Co-authored-by: Adam Shiervani <adam.shiervani@gmail.com>
Co-authored-by: Marc Brooks <IDisposable@gmail.com>
2025-10-13 15:29:40 +02:00
Adam Shiervani 2d20ce00e2 chore: update dev script with watch and debug options (#21)
* chore: update dev script with watch and debug options

* chore: add debug option to development script in package.json

---------

Co-authored-by: Marc Brooks <IDisposable@gmail.com>
2025-09-24 17:28:26 +02:00
Adam Shiervani 354da9a420 feat: add force update option for manual update checks (#18) 2025-09-24 12:04:21 +02:00
Adam Shiervani ad118205ce chore: update .gitignore and enhance WebSocket connection handling (#35)
* Add .env.development to .gitignore
* Improve handling of existing WebSocket connections by waiting for closure before terminating
challenge-base
2025-04-09 17:10:45 +02:00
Adam Shiervani efce3ebe7b Fix/more logging (#34)
* A tiny bit clearer logging

* Enhance WebSocket close event logging to include closure code and reason
2025-04-09 17:00:44 +02:00
Adam Shiervani 710c4d73b4 A tiny bit clearer logging (#33) 2025-04-09 12:48:16 +02:00
Adam Shiervani dc5aed27e8 Add more logging (#32)
* Add more logging

* Refactor logging in WebRTC signaling to remove "WS" prefix for consistency
2025-04-09 11:33:27 +02:00
Adam Shiervani 27755874af feat: implement Tricke ICE WebRTC signaling with dedicated WebSocket (#31)
* feat: implement Tricke ICE WebRTC signaling with dedicated WebSocket handling

* Update src/webrtc.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-08 23:25:07 +02:00
Adam Shiervani d7aa9f99f5 refactor: improve WebSocket handling in CreateSession function (#30) 2025-04-03 19:29:11 +02:00
Adam Shiervani e9191d7972 Merge pull request #16 from jetkvm/fix/increase-timeout
Increase WebSocket response timeout from 5 to 15 seconds
2025-02-11 21:10:02 +01:00
Adam Shiervani 8e29026017 chore: increase WebSocket response timeout from 5 to 15 seconds 2025-02-11 20:08:46 +01:00
Siyuan Miao 722e70f599 feat: include device ip and ICE server list in device handshake payload 2025-02-11 16:08:43 +01:00
Siyuan Miao 954303afa5 feat: allow to override CORS origins using environment variable 2025-02-11 13:45:46 +01:00
thinkafterbefore ae4bc804c2 Release 202412292129 2024-12-29 21:29:59 +01:00