From 532607e53ebc4e0681c097e28e1f68362eca418b Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 16 Apr 2024 10:07:30 -0700 Subject: [PATCH] feat(core): turn on --webserver by default --- CHANGELOG.md | 10 ++++++++++ crates/tabby/src/serve.rs | 15 +++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9283f7c26553..b092aa5f6e25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# v0.11.0 [UNRELEASED] + +## Notice + +* The `--webserver` flag is now enabled by default in `tabby serve`. To turn off the webserver and only use OSS features, use the `--no-webserver` flag. + +## Features + +## Fixes and Improvements + # v0.10.0 [UNRELEASED] ## Features diff --git a/crates/tabby/src/serve.rs b/crates/tabby/src/serve.rs index c226049b05ad..085d2b3176b8 100644 --- a/crates/tabby/src/serve.rs +++ b/crates/tabby/src/serve.rs @@ -106,8 +106,13 @@ pub struct ServeArgs { parallelism: u8, #[cfg(feature = "ee")] - #[clap(hide = true, long, default_value_t = false)] + #[clap(hide = true, long, default_value_t = true)] + #[deprecated] webserver: bool, + + #[cfg(feature = "ee")] + #[clap(hide = true, long, default_value_t = false)] + no_webserver: bool, } pub async fn main(config: &Config, args: &ServeArgs) { @@ -122,8 +127,10 @@ pub async fn main(config: &Config, args: &ServeArgs) { info!("Starting server, this might take a few minutes..."); + let webserver = !args.no_webserver; + #[cfg(feature = "ee")] - let ws = if args.webserver { + let ws = if webserver { Some(tabby_webserver::public::WebserverHandle::new(create_event_logger()).await) } else { None @@ -155,7 +162,7 @@ pub async fn main(config: &Config, args: &ServeArgs) { .merge(SwaggerUi::new("/swagger-ui").url("/api-docs/openapi.json", ApiDoc::openapi())); #[cfg(feature = "ee")] - let (api, ui) = if args.webserver { + let (api, ui) = if webserver { let (api, ui) = ws .unwrap() .attach_webserver(api, ui, code, args.chat_model.is_some(), args.port) @@ -289,7 +296,7 @@ async fn api_router( Router::new().route("/v1beta/server_setting", routing::get(routes::setting)); #[cfg(feature = "ee")] - if !args.webserver { + if args.no_webserver { routers.push(server_setting_router) }