feat(web_ui): per-path reverse-proxy via HIVE_EXTRA_WEB_PROXIES
This commit is contained in:
parent
6da7835ad9
commit
89ce8790ff
4 changed files with 193 additions and 2 deletions
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
mod actions;
|
||||
mod auth;
|
||||
mod proxy;
|
||||
mod screen;
|
||||
mod state;
|
||||
mod stats;
|
||||
|
|
@ -99,7 +100,7 @@ pub async fn serve(
|
|||
socket,
|
||||
gui_vnc_port,
|
||||
};
|
||||
let app = Router::new()
|
||||
let app: Router<AppState> = Router::new()
|
||||
.route("/api/state", get(state::api_state))
|
||||
.route("/api/dashboard-state", get(state::api_dashboard_state))
|
||||
.route("/events/stream", get(stream::events_stream))
|
||||
|
|
@ -118,7 +119,10 @@ pub async fn serve(
|
|||
.route("/api/bash-tasks", get(stats::api_bash_tasks))
|
||||
.route("/api/stats", get(stats::api_stats))
|
||||
.route("/screen/ws", get(screen::screen_ws))
|
||||
.route("/icon", get(screen::serve_icon))
|
||||
.route("/icon", get(screen::serve_icon));
|
||||
// Mount any `hyperhive.extraWebProxies` under `/extra/<name>/` before the
|
||||
// static fallback so declared proxies win over `ServeDir`.
|
||||
let app = proxy::mount_extra_proxies(app)
|
||||
// Anything else (`/`, `/stats`, `/screen`, `/static/*`)
|
||||
// falls through to the merged dist. ServeDir auto-appends
|
||||
// `.html` when the URL is a bare path that matches a file
|
||||
|
|
|
|||
Loading…
Reference in a new issue