Embed webapp into the binary with fs-embed, drop --static-dir

ottyl was requiring webapp/dist to be shipped alongside the binary and
served via ServeDir/ServeFile pointed at a --static-dir CLI arg. Embed
the built webapp at compile time instead, so ottyl is a single
self-contained executable with no runtime static directory dependency.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o
This commit is contained in:
Hugh Kaznowski
2026-09-05 16:21:02 +01:00
co-authored by Claude Sonnet 5
parent 1d1b0eee01
commit 7694dcf120
6 changed files with 57 additions and 65 deletions
+1 -5
View File
@@ -30,10 +30,6 @@ struct Args {
#[arg(long, default_value_t = 0)]
port: u16,
/// Directory containing the built webapp (index.html + assets).
#[arg(long, default_value = "webapp/dist")]
static_dir: String,
/// Path to the settings file. Defaults to a per-OS config location
/// (e.g. `~/.config/ottyl/settings.json` on Linux).
#[arg(long)]
@@ -105,7 +101,7 @@ async fn main() {
}
}
let app = api::router(engine_tx, &args.static_dir, settings, settings_path);
let app = api::router(engine_tx, settings, settings_path);
let listener = TcpListener::bind(("0.0.0.0", args.port))
.await
.expect("failed to bind listener");