From 97c3db3bd25ddaab5315f2e676716ad787426ffe Mon Sep 17 00:00:00 2001 From: rustmailer Date: Wed, 14 Jan 2026 00:27:31 +0800 Subject: [PATCH] chore: default to binding 0.0.0.0 and support binding IPv6 addresses. --- env/{rustmailer.env => bichon.env} | 2 +- src/modules/rest/mod.rs | 2 +- src/modules/settings/cli.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename env/{rustmailer.env => bichon.env} (94%) diff --git a/env/rustmailer.env b/env/bichon.env similarity index 94% rename from env/rustmailer.env rename to env/bichon.env index 5f79424..c3073e9 100644 --- a/env/rustmailer.env +++ b/env/bichon.env @@ -28,7 +28,7 @@ BICHON_ROOT_DIR=/data/bichon-data # Enable API access token validation BICHON_ENABLE_ACCESS_TOKEN=false -# IP address to bind the HTTP and gRPC servers to (default: ::) +# IP address to bind the HTTP servers to (default: 0.0.0.0) BICHON_BIND_IP= # Comma-separated list of allowed CORS origins (e.g. https://app.example.com) diff --git a/src/modules/rest/mod.rs b/src/modules/rest/mod.rs index d7d0014..541ff3d 100644 --- a/src/modules/rest/mod.rs +++ b/src/modules/rest/mod.rs @@ -51,7 +51,7 @@ pub type ApiResult = std::result::Result; pub async fn start_http_server() -> BichonResult<()> { let listener = TcpListener::bind(( - SETTINGS.bichon_bind_ip.clone().unwrap_or("::".into()), + SETTINGS.bichon_bind_ip.clone().unwrap_or("0.0.0.0".into()), SETTINGS.bichon_http_port as u16, )); diff --git a/src/modules/settings/cli.rs b/src/modules/settings/cli.rs index 822c814..88cbfdb 100644 --- a/src/modules/settings/cli.rs +++ b/src/modules/settings/cli.rs @@ -50,8 +50,8 @@ pub struct Settings { #[clap( long, env, - default_value = "::", - help = "The IP address that the node binds to, in IPv4 or IPv6 format (e.g., 192.168.1.1 or ::1). Required in cluster mode.", + default_value = "0.0.0.0", + help = "The IP address that the node binds to, in IPv4 or IPv6 format (e.g., 192.168.1.1 or ::1).", value_parser = ValueParser::new(|s: &str| { // Ensure the input is a valid IPv4 or IPv6 address if s.parse::().is_err() && s.parse::().is_err() {