greentic-gui-0.4.10 is not a library.
greentic-gui
Axum-based Greentic GUI runtime that serves tenant-specific GUI packs, enforces auth, injects fragments, and exposes worker/session/telemetry APIs plus a small browser SDK.
Quick start
Installation (crates.io)
From source via crates.io:
Installation (prebuilt binaries)
This repo publishes “binstall-ready” archives for Linux/macOS/Windows via GitHub Releases.
Stable (latest tagged release):
Nightly (latest master):
- Download the correct archive from the GitHub Release named
Nightly(tagnightly), unzip/untar, and placegreentic-guion yourPATH.
Environment defaults:
BIND_ADDR=0.0.0.0:8080PACK_ROOT=./packsDEFAULT_TENANT=tenant-defaultGREENTIC_ENV=devGREENTIC_TEAM=gui
Configuration (env vars)
- HTTP/server
BIND_ADDR: listen address (host:port).ENABLE_CORS:1/trueto enable permissive CORS (dev only).
- Packs
PACK_ROOT: filesystem root for packs.PACK_CACHE_TTL_SECS: cache TTL for tenant configs (0 = disabled).GREENTIC_DISTRIBUTOR_URL: enable distributor-backed pack loading.GREENTIC_DISTRIBUTOR_ENV: distributor environment id (defaults toGREENTIC_ENV).GREENTIC_DISTRIBUTOR_TOKEN: bearer for distributor calls.GREENTIC_DISTRIBUTOR_PACKS: JSON mapping of pack refs (seesrc/packs.rs).GREENTIC_OCI_BEARERorGREENTIC_OCI_USERNAME+GREENTIC_OCI_PASSWORD: auth when downloading OCI artifacts.- Cache clear: POST
/api/gui/cache/clear.
- Auth/OAuth
OAUTH_BROKER_URL(required): broker base URL for/auth/{provider}/start.OAUTH_ISSUER,OAUTH_AUDIENCE,OAUTH_JWKS_URL(required): bearer validation via greentic-oauth-sdk.OAUTH_REQUIRED_SCOPES: comma-separated scopes (optional).- Fallback pages: static
/loginand/logoutserved fromassets/if no pack overrides.
- Sessions
REDIS_URL: use Redis-backed session store; otherwise in-memory.SESSION_TTL_SECS: cookie Max-Age; store expiry follows greentic-session defaults.
- Workers
WORKER_GATEWAY_URL(optional): endpoint for remote worker gateway; if unset, a stub backend echoes payloads.WORKER_GATEWAY_TOKEN(optional): bearer token for the gateway.WORKER_GATEWAY_TIMEOUT_MS(optional): HTTP timeout in milliseconds (default 5000).WORKER_GATEWAY_RETRIES(optional): retry attempts on failure (default 2).WORKER_GATEWAY_BACKOFF_MS(optional): backoff base delay between retries (default 200).
- Auth fallbacks
/loginservesassets/login.htmlwhen no auth pack is mounted./logoutredirects to/auth/logout./unauthorizedservesassets/unauthorized.html.
- Packs
/api/gui/cache/clearclears the in-memory pack cache./api/gui/packs/reloadclears cache and re-warms a tenant (JSON body{ "tenant": "<id>" }, default tenant if omitted); logs cache hit/miss counters.
- Browser tests
- Run
npm install(plusnpx playwright install --with-depsif needed), start the server locally, thennpm run test:browserto run Playwright against/tests/sdk-harness.
- Run
- Telemetry
- Standard OTLP vars (
OTEL_EXPORTER_OTLP_ENDPOINT,OTEL_SERVICE_NAME=greentic-gui, headers, etc.) respected via greentic-telemetry.
- Standard OTLP vars (
Secrets workflow
- GUI surfaces pack-declared
secret_requirementsand apack_init_hintpath from/api/gui/config; consumers can show these to operators. - On upstream missing-secret errors (runner/worker gateway/preflight),
/api/gui/worker/messagereturnserror=missing_secretswith the requirements and a remediation hintgreentic-secrets init --pack <path>(extend similar handling to other APIs once upstreams emit structured errors). - GUI never lists or fetches secret values; it only relays requirements and hints.
SDK
- Source:
src/gui-sdk/index.ts; bundled toassets/gui-sdk.js(globalwindow.GreenticGUI). - Build:
npm run build-sdk - Tests (Node):
npm run test-sdk(smoke + simple assertions) - Served at
/greentic/gui-sdk.js
Current limitations
- WorkerHost is an echo stub until greentic-interfaces-host exposes stable worker types/serde.
- No hot-reload/watchers for packs; distributor “internal” handles are treated as local paths.
- Fragment Wasmtime path requires real component artifacts; errors surface as logged placeholders.
- SDK has Node tests only (no browser harness yet).