Skip to main content

Module web_ui

Module web_ui 

Source
Expand description

Embedded single-binary SSR Forge Web UI for arks serve (E8 — GitHub/GitLab common interface).

Compile-time embedded assets (include_str!), strict HTML entity escaping on every dynamic value, and Content-Security-Policy: default-src 'self'; script-src 'self'. Never interferes with Git smart/dumb HTTP (info/refs, git-upload-pack, git-receive-pack, objects/, HEAD) or Git LFS (info/lfs/).

Spec: sot:root/v0-2-0-scope-expansion §2.8 (E8).

Structs§

LoopbackWebhookGuard
RAII guard permitting loopback webhook delivery strictly for a single repository common_dir without mutating process-wide environment variables.

Constants§

WEB_UI_CSP

Functions§

allow_loopback_webhooks_for_repo
Explicitly allow loopback webhook targets for common_dir while the returned guard is alive.
handle_web_ui
Route browser GET/POST requests to the embedded SSR Web UI (local Actions disabled).
handle_web_ui_with_actions
Route browser GET/POST requests to the embedded SSR Web UI; returns None for Git smart/dumb HTTP and LFS paths so protocol traffic passes through untouched.
html_escape
Strictly escape HTML special characters to prevent XSS.
init_bare_repo
Initialize a standards-compliant bare Git repository purely in Rust (zero git spawn).
is_ssrf_blocked_url
Default SSRF check (fail-closed for loopback & private ranges unless explicitly allowed via ARKS_WEBHOOK_ALLOW_LOOPBACK=1 or ARKS_WEBHOOK_ALLOW_PRIVATE=1).
multi_repo_page_handler
Build a PageHandler serving multiple Git repositories under root_dir.
multi_repo_page_handler_full
Build a PageHandler serving multiple Git repositories under root_dir with explicit disable_lfs, disable_web_ui, and operator has_basic_auth options.
multi_repo_page_handler_opts
Build a PageHandler serving multiple Git repositories under root_dir with explicit disable_lfs and disable_web_ui options (INT-S04).
web_ui_page_handler
Build a PageHandler serving the embedded SSR Web UI for git_dir (local Actions runner disabled unless ARKS_SERVE_ALLOW_LOCAL_ACTIONS=1).
web_ui_page_handler_with_actions
Build a PageHandler serving the embedded SSR Web UI with explicit opt-in control over local Actions workflow execution.