From 848b8756981ac9207f7cac26f2e588e2306e1c53 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Tue, 17 Feb 2026 14:43:16 +0000 Subject: [PATCH] fix: Use PORT env var instead of BOTSERVER_PORT, default to port 9000 - Change BOTSERVER_PORT to PORT for consistency with .env.embedded - Update default port from 8080 to 9000 in config - Fix service port references in security integration - Update directory setup ExternalPort to 9000 Co-Authored-By: Claude Sonnet 4.5 --- src/core/config/mod.rs | 12 ++++++------ src/core/package_manager/setup/directory_setup.rs | 10 +++++----- src/security/integration.rs | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs index 4fb2185c7..b6e3c572c 100644 --- a/src/core/config/mod.rs +++ b/src/core/config/mod.rs @@ -291,10 +291,10 @@ impl AppConfig { smtp_server: get_str("EMAIL_SMTP_SERVER", "smtp.gmail.com"), smtp_port: get_u16("EMAIL_SMTP_PORT", 587), }; - let port = std::env::var("BOTSERVER_PORT") + let port = std::env::var("PORT") .ok() .and_then(|v| v.parse::().ok()) - .unwrap_or_else(|| get_u16("server_port", 8080)); + .unwrap_or_else(|| get_u16("server_port", 9000)); Ok(Self { drive, @@ -302,7 +302,7 @@ impl AppConfig { server: ServerConfig { host: get_str("server_host", "0.0.0.0"), port, - base_url: config_map.get("server_base_url").cloned().unwrap_or_else(|| "http://localhost:8080".to_string()), + base_url: config_map.get("server_base_url").cloned().unwrap_or_else(|| "http://localhost:9000".to_string()), }, site_path: { ConfigManager::new(pool.clone()).get_config( @@ -329,10 +329,10 @@ impl AppConfig { smtp_server: "smtp.gmail.com".to_string(), smtp_port: 587, }; - let port = std::env::var("BOTSERVER_PORT") + let port = std::env::var("PORT") .ok() .and_then(|v| v.parse::().ok()) - .unwrap_or(8080); + .unwrap_or(9000); Ok(Self { drive: minio, @@ -340,7 +340,7 @@ impl AppConfig { server: ServerConfig { host: "0.0.0.0".to_string(), port, - base_url: "http://localhost:8080".to_string(), + base_url: "http://localhost:9000".to_string(), }, site_path: "./botserver-stack/sites".to_string(), diff --git a/src/core/package_manager/setup/directory_setup.rs b/src/core/package_manager/setup/directory_setup.rs index 875416590..4fda55020 100644 --- a/src/core/package_manager/setup/directory_setup.rs +++ b/src/core/package_manager/setup/directory_setup.rs @@ -337,7 +337,7 @@ impl DirectorySetup { _org_id: &str, ) -> Result<(String, String, String)> { let app_name = "BotServer"; - let redirect_uri = "http://localhost:8080/auth/callback".to_string(); + let redirect_uri = "http://localhost:9000/auth/callback".to_string(); let project_response = self .client @@ -362,7 +362,7 @@ impl DirectorySetup { "grantTypes": ["OIDC_GRANT_TYPE_AUTHORIZATION_CODE", "OIDC_GRANT_TYPE_REFRESH_TOKEN", "OIDC_GRANT_TYPE_PASSWORD"], "appType": "OIDC_APP_TYPE_WEB", "authMethodType": "OIDC_AUTH_METHOD_TYPE_POST", - "postLogoutRedirectUris": ["http://localhost:8080", "http://localhost:3000", "http://localhost:9000"], + "postLogoutRedirectUris": ["http://localhost:9000", "http://localhost:3000", "http://localhost:9000"], "accessTokenType": "OIDC_TOKEN_TYPE_BEARER", "devMode": true, })) @@ -466,10 +466,10 @@ Database: Machine: Identification: Hostname: localhost - WebhookAddress: http://localhost:8080 + WebhookAddress: http://localhost:9000 -ExternalDomain: localhost:8080 -ExternalPort: 8080 +ExternalDomain: localhost:9000 +ExternalPort: 9000 ExternalSecure: false TLS: diff --git a/src/security/integration.rs b/src/security/integration.rs index f9b1cb941..6e69c146a 100644 --- a/src/security/integration.rs +++ b/src/security/integration.rs @@ -35,9 +35,9 @@ impl TlsIntegration { services.insert( "api".to_string(), ServiceUrls { - original: "http://localhost:8080".to_string(), + original: "http://localhost:9000".to_string(), secure: "https://localhost:8443".to_string(), - port: 8080, + port: 9000, tls_port: 8443, }, ); @@ -105,9 +105,9 @@ impl TlsIntegration { services.insert( "directory".to_string(), ServiceUrls { - original: "http://localhost:8080".to_string(), + original: "http://localhost:9000".to_string(), secure: "https://localhost:8446".to_string(), - port: 8080, + port: 9000, tls_port: 8446, }, );