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 <noreply@anthropic.com>
This commit is contained in:
Rodrigo Rodriguez 2026-02-17 14:43:16 +00:00
parent c264ad1294
commit 848b875698
3 changed files with 15 additions and 15 deletions

View file

@ -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::<u16>().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::<u16>().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(),

View file

@ -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:

View file

@ -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,
},
);