Bind dashboard to 0.0.0.0 for container accessibility
All checks were successful
CI / Format (push) Successful in 3s
CI / Security Audit (push) Successful in 1m40s
CI / Clippy (push) Successful in 3m22s
CI / Tests (push) Successful in 4m32s

Dioxus defaults to 127.0.0.1 which is unreachable from outside the
container. Hardcode 0.0.0.0 binding so reverse proxies can reach it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-03-08 17:39:25 +01:00
parent 175d303dc4
commit b95ce44fb9

View File

@@ -45,7 +45,8 @@ pub fn server_start(app: fn() -> Element) -> Result<(), DashboardError> {
.with_expiry(tower_sessions::Expiry::OnInactivity(Duration::hours(24))) .with_expiry(tower_sessions::Expiry::OnInactivity(Duration::hours(24)))
.with_signed(key); .with_signed(key);
let addr = dioxus_cli_config::fullstack_address_or_localhost(); let port = dioxus_cli_config::server_port().unwrap_or(8080);
let addr = std::net::SocketAddr::from(([0, 0, 0, 0], port));
let listener = tokio::net::TcpListener::bind(addr) let listener = tokio::net::TcpListener::bind(addr)
.await .await
.map_err(|e| DashboardError::Other(format!("Failed to bind: {e}")))?; .map_err(|e| DashboardError::Other(format!("Failed to bind: {e}")))?;