8565942392
Serve the whole stack behind one host: site at /, game UI at /game/, gateway REST at /api + /healthz, Connect at /rpc (prefix stripped by the edge Caddy). The built artifact is domain-agnostic — the UI talks to the gateway same-origin via relative URLs, so the same bundle runs under any host with no rebuild and with CORS disabled. - Rename the Connect proto service galaxy.gateway.v1.EdgeGateway -> edge.v1.Gateway; regenerate Go + TS; public path /rpc/edge.v1.Gateway. - Move the game UI under base path /game (env BASE_PATH); make the manifest, service-worker scope, WASM loader, and all navigation base-aware via a withBase helper. - Relative API + /rpc Connect prefix; Vite dev proxy mirrors the strip. - Rewrite the edge Caddy (dev + prod) for path-based routing; empty CORS allow-lists (same-origin); single host. - New VitePress project site (site/): i18n en/ru with switcher, LaTeX math, minimal monospace theme; built and served at /. - dev-deploy compose/Makefile + CI (dev-deploy, prod-build, new site-build) build and seed the site; probes hit /, /game/, /healthz. - Sync docs (ARCHITECTURE, gateway README/openapi, dev-deploy & local-dev READMEs, CLAUDE.md, ui/PLAN). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
65 lines
2.4 KiB
Protocol Buffer
65 lines
2.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package edge.v1;
|
|
|
|
option go_package = "galaxy/gateway/proto/edge/v1;edgev1";
|
|
|
|
import "buf/validate/validate.proto";
|
|
|
|
service Gateway {
|
|
rpc ExecuteCommand(ExecuteCommandRequest) returns (ExecuteCommandResponse);
|
|
rpc SubscribeEvents(SubscribeEventsRequest) returns (stream GatewayEvent);
|
|
}
|
|
|
|
message ExecuteCommandRequest {
|
|
// protocol_version identifies the request envelope version. The gateway
|
|
// accepts only the literal "v1" after required-field validation succeeds.
|
|
string protocol_version = 1 [(buf.validate.field).string.min_len = 1];
|
|
string device_session_id = 2 [(buf.validate.field).string.min_len = 1];
|
|
string message_type = 3 [(buf.validate.field).string.min_len = 1];
|
|
int64 timestamp_ms = 4 [(buf.validate.field).int64.gt = 0];
|
|
string request_id = 5 [(buf.validate.field).string.min_len = 1];
|
|
bytes payload_bytes = 6 [(buf.validate.field).bytes.min_len = 1];
|
|
// payload_hash is the raw 32-byte SHA-256 digest of payload_bytes.
|
|
bytes payload_hash = 7 [(buf.validate.field).bytes.min_len = 1];
|
|
bytes signature = 8 [(buf.validate.field).bytes.min_len = 1];
|
|
string trace_id = 9;
|
|
}
|
|
|
|
message ExecuteCommandResponse {
|
|
string protocol_version = 1;
|
|
string request_id = 2;
|
|
int64 timestamp_ms = 3;
|
|
string result_code = 4;
|
|
bytes payload_bytes = 5;
|
|
bytes payload_hash = 6;
|
|
bytes signature = 7;
|
|
}
|
|
|
|
message SubscribeEventsRequest {
|
|
// protocol_version identifies the request envelope version. The gateway
|
|
// accepts only the literal "v1" after required-field validation succeeds.
|
|
string protocol_version = 1 [(buf.validate.field).string.min_len = 1];
|
|
string device_session_id = 2 [(buf.validate.field).string.min_len = 1];
|
|
string message_type = 3 [(buf.validate.field).string.min_len = 1];
|
|
int64 timestamp_ms = 4 [(buf.validate.field).int64.gt = 0];
|
|
string request_id = 5 [(buf.validate.field).string.min_len = 1];
|
|
// payload_hash is the raw 32-byte SHA-256 digest of payload_bytes. Empty
|
|
// payloads must use the SHA-256 digest of the empty byte slice.
|
|
bytes payload_hash = 6 [(buf.validate.field).bytes.min_len = 1];
|
|
bytes signature = 7 [(buf.validate.field).bytes.min_len = 1];
|
|
bytes payload_bytes = 8;
|
|
string trace_id = 9;
|
|
}
|
|
|
|
message GatewayEvent {
|
|
string event_type = 1;
|
|
string event_id = 2;
|
|
int64 timestamp_ms = 3;
|
|
bytes payload_bytes = 4;
|
|
bytes payload_hash = 5;
|
|
bytes signature = 6;
|
|
string request_id = 7;
|
|
string trace_id = 8;
|
|
}
|