Address Cody review round 6: executable runbook, static client install, README
CODY-011 deploy/install.sh performs the ownership-sensitive sequence: the
release is copied to app.new, that one directory is given to the
hermeven user, npm ci runs unprivileged, and the finished tree is
handed back to root:root with group/other write removed. Secrets,
state and model directories are never touched. The guide now gives
exact commands, including the C/C++ toolchain a clean host needs
(found by running it on one).
CODY-012 install.sh builds the phone page with the bridge address preset
and installs it root-owned into /opt/hermeven/www for Caddy. The
guide explains the web build versus the .ehpk package and when
each is needed.
CODY-013 README states which commit was deployed, what was checked, and
what remains unverified.
Also corrects a wrong diagnosis recorded in the previous commit: the phone
page that showed "Browser preview" had been opened in Chrome, not in the
Even app. Host detection keeps a short precautionary wait (2.5 s) and its
comments no longer claim an observed Even-app delay.
tests/deploy/runbook-proof.sh proves the guide on a disposable Ubuntu 24.04
host with systemd.
Not reviewed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
/**
|
||||
* Decide whether this page is running inside the Even app.
|
||||
*
|
||||
* The Even app's WebView provides `window.flutter_inappwebview.callHandler`, but not
|
||||
* necessarily before the page's own script starts: on a real phone it appeared after our
|
||||
* module had already run (first device test, 2026-11-21), although the simulator provides it
|
||||
* at once. So the page waits for it, and also listens for the WebView's own "platform ready"
|
||||
* event, before concluding it is in an ordinary browser.
|
||||
* The Even app's WebView provides `window.flutter_inappwebview.callHandler` (per the SDK's
|
||||
* README). The simulator provides it before the page's script runs. Whether the real Even app
|
||||
* always does is NOT known: this wait is a precaution, not a fix for an observed problem.
|
||||
* (It was written on 2026-11-21 after a wrong diagnosis: a page that showed "Browser preview"
|
||||
* on a phone had simply been opened in Chrome, not in the Even app.) The page waits briefly
|
||||
* for the host, and listens for the WebView's own "platform ready" event, before concluding
|
||||
* it is in an ordinary browser.
|
||||
*/
|
||||
export interface HostWindow {
|
||||
flutter_inappwebview?: { callHandler?: unknown };
|
||||
@@ -19,7 +21,8 @@ export interface HostDetection {
|
||||
waitedMs: number;
|
||||
}
|
||||
|
||||
export const HOST_WAIT_MS = 6000;
|
||||
/** Short, because in an ordinary browser this is pure delay before the preview appears. */
|
||||
export const HOST_WAIT_MS = 2500;
|
||||
/** The event flutter_inappwebview dispatches on `window` once its JavaScript bridge is usable. */
|
||||
export const PLATFORM_READY_EVENT = 'flutterInAppWebViewPlatformReady';
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ const RELOAD_FLAG = 'hermeven.reloadedForHost';
|
||||
|
||||
async function resolveDevice(): Promise<{ device: DevicePort; runtime: string }> {
|
||||
const host = window as unknown as HostWindow;
|
||||
// The Even app can provide its connection a moment after the page starts, so wait for it
|
||||
// rather than deciding on the first instant.
|
||||
// Wait briefly for the Even app's connection rather than deciding on the first instant
|
||||
// (a precaution; see device/hostDetect.ts).
|
||||
const detection = await waitForEvenHost(host);
|
||||
if (detection.found) {
|
||||
const bridge = await waitForEvenAppBridge();
|
||||
|
||||
Reference in New Issue
Block a user