feat: commit hash in banner, version command, file upload/download

This commit is contained in:
Helios Agent 2026-03-03 14:29:22 +01:00
parent cb86894369
commit f7d29a98d3
No known key found for this signature in database
GPG key ID: C8259547CD8309B5
8 changed files with 202 additions and 9 deletions

View file

@ -30,6 +30,9 @@ async fn main() -> anyhow::Result<()> {
.with(tracing_subscriber::fmt::layer())
.init();
const GIT_COMMIT: &str = env!("GIT_COMMIT");
info!("helios-server v{} ({})", env!("CARGO_PKG_VERSION"), GIT_COMMIT);
let api_key = std::env::var("HELIOS_API_KEY")
.unwrap_or_else(|_| "dev-secret".to_string());
@ -52,10 +55,14 @@ async fn main() -> anyhow::Result<()> {
.route("/sessions/:id/windows/minimize-all", post(api::minimize_all))
.route("/sessions/:id/windows/:window_id/focus", post(api::focus_window))
.route("/sessions/:id/windows/:window_id/maximize", post(api::maximize_and_focus))
.route("/sessions/:id/version", get(api::client_version))
.route("/sessions/:id/upload", post(api::upload_file))
.route("/sessions/:id/download", get(api::download_file))
.layer(middleware::from_fn_with_state(state.clone(), require_api_key));
let app = Router::new()
.route("/ws", get(ws_handler::ws_upgrade))
.route("/version", get(api::server_version))
.merge(protected)
.with_state(state);