Skip to content

Commit

Permalink
feat(core): turn on --webserver by default
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed Apr 16, 2024
1 parent 283f238 commit 532607e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 11 additions & 4 deletions crates/tabby/src/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

Check warning on line 109 in crates/tabby/src/serve.rs

View check run for this annotation

Codecov / codecov/patch

crates/tabby/src/serve.rs#L109

Added line #L109 was not covered by tests
#[deprecated]
webserver: bool,

#[cfg(feature = "ee")]
#[clap(hide = true, long, default_value_t = false)]
no_webserver: bool,

Check warning on line 115 in crates/tabby/src/serve.rs

View check run for this annotation

Codecov / codecov/patch

crates/tabby/src/serve.rs#L114-L115

Added lines #L114 - L115 were not covered by tests
}

pub async fn main(config: &Config, args: &ServeArgs) {
Expand All @@ -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;

Check warning on line 130 in crates/tabby/src/serve.rs

View check run for this annotation

Codecov / codecov/patch

crates/tabby/src/serve.rs#L130

Added line #L130 was not covered by tests

#[cfg(feature = "ee")]
let ws = if args.webserver {
let ws = if webserver {

Check warning on line 133 in crates/tabby/src/serve.rs

View check run for this annotation

Codecov / codecov/patch

crates/tabby/src/serve.rs#L133

Added line #L133 was not covered by tests
Some(tabby_webserver::public::WebserverHandle::new(create_event_logger()).await)
} else {
None
Expand Down Expand Up @@ -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 {

Check warning on line 165 in crates/tabby/src/serve.rs

View check run for this annotation

Codecov / codecov/patch

crates/tabby/src/serve.rs#L165

Added line #L165 was not covered by tests
let (api, ui) = ws
.unwrap()
.attach_webserver(api, ui, code, args.chat_model.is_some(), args.port)
Expand Down Expand Up @@ -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 {

Check warning on line 299 in crates/tabby/src/serve.rs

View check run for this annotation

Codecov / codecov/patch

crates/tabby/src/serve.rs#L299

Added line #L299 was not covered by tests
routers.push(server_setting_router)
}

Expand Down

0 comments on commit 532607e

Please sign in to comment.