Deliver launcher updates from signed CI release zips

Replace the manually set launcher version with releases uploaded from the
CI zip (exes, launcher-manifest.json and launcher-manifest.json.sig).

- New "Launcher" admin tool (renamed from Launcher Message): upload a
  release, switch the current one, delete old ones, set the launcher message
- Uploads are validated: manifest rules, size + SHA-256 of every exe, and
  the ECDSA manifest signature when LAUNCHER_UPDATE_PUBLIC_KEYS is set
- The same zip, manifest or version cannot be published twice; only the
  newest 5 releases are kept and the current one is never removed
- Serve the current release to the launcher at /launcher/{file},
  byte-for-byte and uncached, with range support for resumed downloads
- /download-launcher serves the newest framework build; the legacy
  /api/v1/launcher-version returns the current release version
- Remove the launcher version from the Versioning tool
- Fix the file input button highlighting when hovering the whole input
This commit is contained in:
Shaggy84675
2026-11-14 14:15:22 +01:00
parent b90cd6fa9f
commit 8bb72bb2b7
25 changed files with 1160 additions and 181 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Http\Controllers\Web;
use App\Http\Controllers\Controller;
use App\Models\Admin\LauncherRelease;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
/**
* Serves the current launcher release to the launcher's updater: launcher-manifest.json, its .sig and the exes the
* manifest lists. The bytes are served unchanged (the signature covers the exact manifest bytes) and never cached,
* because the exe names stay the same from one version to the next.
*/
class LauncherFileController extends Controller
{
public function show(string $fileName): BinaryFileResponse
{
$path = LauncherRelease::current()?->servableFilePath($fileName) ?? abort(404);
return response()->file($path, [
'Content-Type' => match ($fileName) {
LauncherRelease::MANIFEST_FILE_NAME => 'application/json',
LauncherRelease::SIGNATURE_FILE_NAME => 'text/plain; charset=utf-8',
default => 'application/octet-stream',
},
'Cache-Control' => 'no-cache, no-store, must-revalidate',
]);
}
}