euv_cli/update_server/
const.rs1pub const UPDATE_ROUTE_MANIFEST: &str = "/v1/projects/{project}/channels/{channel}/manifest";
3
4pub const UPDATE_ROUTE_BLOB: &str = "/v1/blobs/{sha256}";
6
7pub const UPDATE_ROUTE_EVENTS: &str = "/v1/projects/{project}/channels/{channel}/events";
9
10pub const UPDATE_ROUTE_HEALTHZ: &str = "/healthz";
12
13pub const DEFAULT_UPDATE_STORE_PATH: &str = ".euv-updates";
15
16pub const DEFAULT_OTA_CONFIG_FILE: &str = "euv-ota.json";
18
19pub const DEFAULT_OTA_PROJECT_NAME: &str = "euv-showcase";
21
22pub const DEFAULT_OTA_PROD_CHANNEL: &str = "prod";
24
25pub const DEFAULT_OTA_DEV_CHANNEL: &str = "dev";
27
28pub const DEFAULT_OTA_SIGNING_KEY_ENV: &str = "EUV_UPDATE_SIGNING_KEY";
30
31pub const DEFAULT_OTA_GC_KEEP_RELEASES: usize = 5;
33
34pub const DEFAULT_WRITER_LOCK_STALE_SECS: u64 = 120;
36
37pub const OTA_KEYGEN_BIT_LENGTH: usize = 256;
39
40pub const OTA_CONFIG_SCHEMA_V1: u32 = 1;
42
43pub const DEFAULT_UPDATE_SERVER_HOST: &str = "127.0.0.1";
45
46pub const DEFAULT_UPDATE_SERVER_PORT: u16 = 8787;
48
49pub const DEFAULT_UPDATE_HEARTBEAT_MS: u64 = 15_000;
51
52pub const DEFAULT_UPDATE_WATCH_POLL_MS: u64 = 100;
54
55pub const DEFAULT_UPDATE_EVENT_LOG_CAP: usize = 256;
57
58pub const STORE_DIR_STAGING: &str = "staging";
60
61pub const STORE_DIR_BLOBS: &str = "blobs";
63
64pub const STORE_DIR_SHA256: &str = "sha256";
66
67pub const STORE_DIR_RELEASES: &str = "releases";
69
70pub const STORE_DIR_CHANNELS: &str = "channels";
72
73pub const STORE_DIR_TRACKS: &str = "tracks";
75
76pub const STORE_DIR_STATE: &str = "state";
78
79pub const STORE_DIR_EVENTS: &str = "events";
81
82pub const DEFAULT_UPDATE_ROUTE: &str = "/dynamic-panel";
84
85pub const DEFAULT_UPDATE_SLOT: &str = "promo_banner";
87
88pub const DEFAULT_UPDATE_ACCENT_RGB: u32 = 0x16A34A;
90
91pub(crate) const WASM_BINARY_MAGIC: &[u8; 4] = b"\0asm";
93
94pub(crate) const SLOT_CONTAINER_MODULE_ID: &str = "slot-container";
96
97pub(crate) const SLOT_CONTAINER_MARKER_BYTES: &[u8] = b"{}";
99
100pub(crate) const PUSH_ARTIFACT_MODULE_ID: &str = "hot-update";
102
103pub(crate) const ERR_PUSH_SOURCE_REQUIRED: &str =
105 "euv update push requires either --file <path> or --title <text>";
106
107pub(crate) const ERR_PUSH_INVALID_SPEC: &str =
109 "pushed JSON artifact is not a valid DynamicNodeSpec";
110
111pub(crate) const ERR_PUSH_INVALID_WASM: &str =
113 "pushed .wasm artifact failed sandbox or host ABI verification";
114
115pub(crate) const DEFAULT_PUSH_INLINE_BODY: &str =
117 "Live hot-update delivered via euv update push + Hyperlane SSE (zero restart).";
118
119pub(crate) const STORE_WRITER_LOCK_FILE: &str = "writer.lock";
121
122pub(crate) const STORE_ACTIVE_POINTER_FILE: &str = "active.json";
124
125pub(crate) const STORE_STAGED_MANIFEST_FILE: &str = "manifest.json";
127
128#[cfg(feature = "update-server")]
130pub(crate) const QUERY_KEY_PROTOCOL: &str = "protocol";
131
132#[cfg(feature = "update-server")]
134pub(crate) const QUERY_KEY_ABI: &str = "abi";
135
136#[cfg(feature = "update-server")]
138pub(crate) const QUERY_KEY_MODE: &str = "mode";
139
140#[cfg(feature = "update-server")]
142pub(crate) const QUERY_KEY_TRACK: &str = "track";
143
144#[cfg(feature = "update-server")]
146pub(crate) const QUERY_KEY_LAST_EVENT_ID: &str = "last_event_id";
147
148#[cfg(feature = "update-server")]
150pub(crate) const ROUTE_PARAM_PROJECT: &str = "project";
151
152#[cfg(feature = "update-server")]
154pub(crate) const ROUTE_PARAM_CHANNEL: &str = "channel";
155
156#[cfg(feature = "update-server")]
158pub(crate) const ROUTE_PARAM_SHA256: &str = "sha256";
159
160#[cfg(feature = "update-server")]
162pub(crate) const MODE_TOKEN_DATA: &str = "declarative_data";
163
164#[cfg(feature = "update-server")]
166pub(crate) const UPDATE_HDR_ETAG: &str = "etag";
167
168#[cfg(feature = "update-server")]
170pub(crate) const UPDATE_HDR_ACCEPT_RANGES: &str = "accept-ranges";
171
172#[cfg(feature = "update-server")]
174pub(crate) const UPDATE_HDR_BYTES: &str = "bytes";
175
176#[cfg(feature = "update-server")]
178pub(crate) const UPDATE_HDR_CONTENT_RANGE: &str = "content-range";
179
180#[cfg(feature = "update-server")]
182pub(crate) const UPDATE_HDR_RANGE_LOWER: &str = "range";
183
184#[cfg(feature = "update-server")]
186pub(crate) const UPDATE_HDR_LAST_EVENT_ID_LOWER: &str = "last-event-id";
187
188#[cfg(feature = "update-server")]
190pub(crate) const UPDATE_CACHE_IMMUTABLE: &str = "public, max-age=31536000, immutable";
191
192#[cfg(feature = "update-server")]
194pub(crate) const UPDATE_CACHE_NO_CACHE: &str = "no-cache";
195
196#[cfg(feature = "update-server")]
198pub(crate) const UPDATE_SSE_CACHE_CONTROL: &str = "no-cache, no-transform";
199
200#[cfg(feature = "update-server")]
202pub(crate) const UPDATE_HDR_ACCEL_BUFFERING: &str = "x-accel-buffering";
203
204#[cfg(feature = "update-server")]
206pub(crate) const UPDATE_VAL_NO_BUFFER: &str = "no";
207
208#[cfg(feature = "update-server")]
210pub(crate) const UPDATE_HDR_CORS_ORIGIN: &str = "access-control-allow-origin";
211
212#[cfg(feature = "update-server")]
214pub(crate) const UPDATE_HDR_CORS_METHODS: &str = "access-control-allow-methods";
215
216#[cfg(feature = "update-server")]
218pub(crate) const UPDATE_HDR_CORS_HEADERS: &str = "access-control-allow-headers";
219
220#[cfg(feature = "update-server")]
222pub(crate) const UPDATE_HDR_CORS_EXPOSE: &str = "access-control-expose-headers";
223
224#[cfg(feature = "update-server")]
226pub(crate) const UPDATE_VAL_CORS_ANY: &str = "*";
227
228#[cfg(feature = "update-server")]
230pub(crate) const UPDATE_VAL_CORS_METHODS: &str = "GET, HEAD, OPTIONS";
231
232#[cfg(feature = "update-server")]
234pub(crate) const UPDATE_VAL_CORS_HEADERS: &str = "Range, Last-Event-ID, Authorization, Proxy-Authorization, X-Forwarded-Prefix, X-Forwarded-Host, X-Forwarded-Proto";
235
236#[cfg(feature = "update-server")]
238pub(crate) const UPDATE_VAL_CORS_EXPOSE: &str =
239 "ETag, Content-Range, Accept-Ranges, X-Euv-Proxy-Base";
240
241#[cfg(feature = "update-server")]
243pub(crate) const UPDATE_HDR_X_FWD_PREFIX: &str = "x-forwarded-prefix";
244
245#[cfg(feature = "update-server")]
247pub(crate) const UPDATE_HDR_X_FWD_HOST: &str = "x-forwarded-host";
248
249#[cfg(feature = "update-server")]
251pub(crate) const UPDATE_HDR_X_FWD_PROTO: &str = "x-forwarded-proto";
252
253#[cfg(feature = "update-server")]
255pub(crate) const UPDATE_HDR_X_PROXY_BASE: &str = "x-euv-proxy-base";
256
257#[cfg(feature = "update-server")]
259pub(crate) const UPDATE_MIME_JSON: &str = "application/json; charset=utf-8";
260
261#[cfg(feature = "update-server")]
263pub(crate) const UPDATE_MIME_OCTET: &str = "application/octet-stream";
264
265pub(crate) const RANGE_BYTES_PREFIX: &str = "bytes=";
267
268pub(crate) const EXT_JSON_DOT: &str = ".json";
270
271pub(crate) const EXT_JSONL_DOT: &str = ".jsonl";
273
274pub(crate) const ASCII_HYPHEN: u8 = b'-';
276
277pub(crate) const ASCII_UNDERSCORE: u8 = b'_';
279
280pub(crate) const ASCII_DOT: u8 = b'.';
282
283pub(crate) const ERR_INVALID_STORE_IDENT: &str =
285 "store identifier must contain only ASCII alphanumerics, '-', '_', or '.' without traversal";
286
287pub(crate) const ERR_WRITER_LOCK_TIMEOUT: &str = "timed out acquiring update store writer lock";
289
290pub(crate) const ERR_EMPTY_SIGNING_KEY: &str =
292 "signing key cannot be empty for publish or rollback";
293
294pub(crate) const ERR_STAGE_NOT_FOUND: &str = "staged release directory not found";
296
297pub(crate) const ERR_ROLLBACK_TARGET_MISSING: &str = "rollback target release manifest not found";
299
300pub(crate) const ERR_BLOB_INTEGRITY: &str = "blob missing or SHA-256 digest mismatch";
302
303pub(crate) const ERR_NO_COMPATIBLE_RELEASE: &str =
305 "no compatible release available for client protocol, ABI, or delivery mode";
306
307#[cfg(not(feature = "update-server"))]
309pub(crate) const ERR_UPDATE_SERVER_FEATURE_DISABLED: &str =
310 "euv-cli was built without the `update-server` Cargo feature";
311
312#[cfg(feature = "update-server")]
314pub(crate) const ERR_BODY_NOT_FOUND: &str = "{\"error\":\"not_found\"}";
315
316#[cfg(feature = "update-server")]
318pub(crate) const ERR_BODY_METHOD_NOT_ALLOWED: &str = "{\"error\":\"method_not_allowed\"}";
319
320#[cfg(feature = "update-server")]
322pub(crate) const ERR_BODY_BAD_REQUEST: &str = "{\"error\":\"bad_request\"}";
323
324#[cfg(feature = "update-server")]
326pub(crate) const ERR_BODY_RANGE_INVALID: &str = "{\"error\":\"range_not_satisfiable\"}";
327
328#[cfg(feature = "update-server")]
330pub(crate) const ERR_BODY_UNCONFIGURED: &str = "{\"error\":\"update_server_unconfigured\"}";
331
332#[cfg(feature = "update-server")]
334pub(crate) const UPDATE_SSE_CONNECTED_COMMENT: &str = "connected";
335
336#[cfg(feature = "update-server")]
338pub(crate) const UPDATE_SSE_HEARTBEAT_COMMENT: &str = "keep-alive";
339
340#[cfg(feature = "update-server")]
342pub(crate) const UPDATE_HDR_IF_NONE_MATCH_LOWER: &str = "if-none-match";
343
344pub(crate) const OTA_HEALTH_STATUS_OK: &str = "ok";
346
347pub(crate) const OTA_VERIFY_SEVERITY_ERROR: &str = "error";
349
350pub(crate) const OTA_VERIFY_SEVERITY_WARN: &str = "warning";
352
353pub(crate) const OTA_DIFF_ADDED: &str = "added";
355
356pub(crate) const OTA_DIFF_REMOVED: &str = "removed";
358
359pub(crate) const OTA_DIFF_CHANGED: &str = "changed";
361
362pub(crate) const OTA_DIFF_UNCHANGED: &str = "unchanged";
364
365pub(crate) const OTA_LOCK_PID_PREFIX: &str = "pid=";
367
368pub(crate) const OTA_LOCK_CREATED_PREFIX: &str = "created_unix=";
370
371#[cfg(unix)]
373pub(crate) const OTA_KILL_BIN: &str = "kill";
374
375#[cfg(unix)]
377pub(crate) const OTA_KILL_SIGNAL_ZERO: &str = "-0";
378
379#[cfg(unix)]
381pub(crate) const OTA_ERR_NO_SUCH_PROCESS: &str = "no such process";
382
383#[cfg(unix)]
385pub(crate) const OTA_PROC_DIR: &str = "/proc";
386
387#[cfg(unix)]
389pub(crate) const OTA_DEV_URANDOM: &str = "/dev/urandom";
390
391pub(crate) const OTA_WASM_TARGET_TRIPLE: &str = "wasm32-unknown-unknown";
393
394pub(crate) const OTA_BUILD_OUT_SUBDIR: &str = "dist/ota";
396
397pub(crate) const OTA_DEFAULT_WIDGET_FILENAME: &str = "widget.wasm";
399
400pub(crate) const OTA_CARGO_MANIFEST_FILE: &str = "Cargo.toml";
402
403pub(crate) const OTA_ENV_CARGO_TARGET_DIR: &str = "CARGO_TARGET_DIR";
405
406pub(crate) const OTA_DIR_TARGET: &str = "target";
408
409pub(crate) const OTA_DIR_RELEASE: &str = "release";
411
412pub(crate) const OTA_DIR_DEBUG: &str = "debug";
414
415pub(crate) const OTA_CARGO_ARG_LIB: &str = "--lib";
417
418pub(crate) const OTA_EXT_WASM: &str = "wasm";
420
421pub(crate) const OTA_LAN_PROBE_PRIMARY: &str = "8.8.8.8:80";
423
424pub(crate) const OTA_LAN_PROBE_FALLBACK: &str = "1.1.1.1:80";
426
427pub(crate) const OTA_LAN_BIND_ANY: &str = "0.0.0.0:0";
429
430#[cfg(feature = "update-server")]
432pub(crate) const OTA_HOST_ALL_INTERFACES: &str = "0.0.0.0";
433
434#[cfg(feature = "update-server")]
436pub(crate) const OTA_HOST_LOCALHOST: &str = "127.0.0.1";
437
438pub(crate) const OTA_HTTP_STATUS_OK: &str = "OK";
440
441pub(crate) const OTA_HTTP_STATUS_NO_CONTENT: &str = "No Content";
443
444pub(crate) const OTA_HTTP_STATUS_PARTIAL: &str = "Partial Content";
446
447pub(crate) const OTA_HTTP_STATUS_NOT_MODIFIED: &str = "Not Modified";
449
450pub(crate) const OTA_HTTP_STATUS_BAD_REQUEST: &str = "Bad Request";
452
453pub(crate) const OTA_HTTP_STATUS_NOT_FOUND: &str = "Not Found";
455
456pub(crate) const OTA_HTTP_STATUS_METHOD_NOT_ALLOWED: &str = "Method Not Allowed";
458
459pub(crate) const OTA_HTTP_STATUS_CONFLICT: &str = "Conflict";
461
462pub(crate) const OTA_HTTP_STATUS_RANGE_INVALID: &str = "Range Not Satisfiable";
464
465pub(crate) const OTA_HDR_CACHE_CONTROL_TITLE: &str = "Cache-Control";
467
468pub(crate) const OTA_HDR_ETAG_TITLE: &str = "ETag";
470
471pub(crate) const OTA_HDR_ACCEPT_RANGES_TITLE: &str = "Accept-Ranges";
473
474pub(crate) const OTA_HDR_CONTENT_RANGE_TITLE: &str = "Content-Range";
476
477pub(crate) const OTA_PATH_V1_BLOBS_PREFIX: &str = "/v1/blobs/";
479
480pub(crate) const OTA_PATH_V1_PROJECTS_PREFIX: &str = "/v1/projects/";
482
483pub(crate) const OTA_PATH_SEG_CHANNELS: &str = "channels";
485
486pub(crate) const OTA_PATH_SEG_MANIFEST: &str = "manifest";
488
489pub(crate) const OTA_PATH_SEG_EVENTS: &str = "events";
491
492pub(crate) const OTA_METHOD_GET: &str = "GET";
494
495pub(crate) const OTA_METHOD_HEAD: &str = "HEAD";
497
498pub(crate) const OTA_METHOD_OPTIONS: &str = "OPTIONS";
500
501pub(crate) const OTA_ERR_BUILD_FAILED: &str = "cargo wasm widget build failed";
503
504pub(crate) const OTA_ERR_WASM_NOT_FOUND: &str = "compiled .wasm output artifact not found";
506
507pub(crate) const OTA_ERR_PUSH_KEY_MISSING: &str = "signing key is required when --push is enabled";
509
510pub(crate) const OTA_ERR_RELEASE_MISSING: &str =
512 "release manifest not found for requested sequence";
513
514pub(crate) const OTA_ERR_UNSIGNED_MANIFEST: &str = "release manifest signature is empty";
516
517pub(crate) const OTA_ERR_SIZE_MISMATCH: &str = "blob byte size mismatch";
519
520pub(crate) const OTA_ERR_MANIFEST_DIGEST_MISMATCH: &str =
522 "channel pointer manifest_sha256 does not match manifest";
523
524pub(crate) const OTA_ERR_ROLLBACK_TARGET_BROKEN: &str =
526 "rollback_of points to missing historical release";
527
528pub(crate) const OTA_WARN_NO_KEY_VERIFY: &str =
530 "signature verification skipped because no signing key was provided";
531
532pub(crate) const OTA_HTTP_CACHE_NO_CACHE: &str = "no-cache";
534
535pub(crate) const OTA_HTTP_CACHE_IMMUTABLE: &str = "public, max-age=31536000, immutable";
537
538pub(crate) const OTA_HTTP_MIME_JSON: &str = "application/json; charset=utf-8";
540
541pub(crate) const OTA_HTTP_MIME_OCTET: &str = "application/octet-stream";
543
544pub(crate) const OTA_HTTP_RANGE_BYTES: &str = "bytes";
546
547pub(crate) const OTA_HTTP_ERR_NOT_FOUND: &str = "{\"error\":\"not_found\"}";
549
550pub(crate) const OTA_HTTP_ERR_BAD_REQUEST: &str = "{\"error\":\"bad_request\"}";
552
553pub(crate) const OTA_HTTP_ERR_METHOD_NOT_ALLOWED: &str = "{\"error\":\"method_not_allowed\"}";
555
556pub(crate) const OTA_HTTP_ERR_RANGE_INVALID: &str = "{\"error\":\"range_not_satisfiable\"}";
558
559pub(crate) const OTA_HTTP_QUERY_PROTOCOL: &str = "protocol";
561
562pub(crate) const OTA_HTTP_QUERY_ABI: &str = "abi";
564
565pub(crate) const OTA_HTTP_QUERY_MODE: &str = "mode";
567
568pub(crate) const OTA_HTTP_QUERY_TRACK: &str = "track";
570
571pub(crate) const OTA_HTTP_MODE_DATA: &str = "declarative_data";
573
574pub(crate) const OTA_ETAG_WEAK_PREFIX: &str = "W/";
576
577pub(crate) const OTA_ETAG_WEAK_PREFIX_LOWER: &str = "w/";