From f4403b68780ffdb2cc0c401df6170b5ebcf7f64e Mon Sep 17 00:00:00 2001 From: Joe Bellus Date: Wed, 28 Sep 2022 13:25:13 -0400 Subject: [PATCH] Set host adapter to 0.0.0.0 for http and smtp --- .drone.yml | 6 +++--- src/http.rs | 2 +- src/smtp.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5568e02..57f69ec 100644 --- a/.drone.yml +++ b/.drone.yml @@ -26,7 +26,7 @@ steps: - name: binary-deploy image: rust:latest - depends_on: [ build-ui ] + depends_on: [ build-ui, test ] volumes: - name: temp path: /app @@ -47,7 +47,7 @@ steps: - name: build-musl image: rust - depends_on: [ build-ui ] + depends_on: [ build-ui, test ] volumes: - name: temp path: /app @@ -63,7 +63,7 @@ steps: - name: stage-deploy image: plugins/docker privileged: true - depends_on: [ build-musl ] + depends_on: [ build-musl, test ] volumes: - name: temp path: /app diff --git a/src/http.rs b/src/http.rs index 911b2ad..8a5bbb7 100644 --- a/src/http.rs +++ b/src/http.rs @@ -31,7 +31,7 @@ pub async fn server(mailbox: Mailbox, port: u16) -> anyhow::Result<()> { .at("/", EmbeddedFileEndpoint::::new("index.html")) .nest("/", EmbeddedFilesEndpoint::::new()) .with(AddData::new(mailbox)); - if let Err(e) = Server::new(TcpListener::bind(format!("localhost:{}", port))) + if let Err(e) = Server::new(TcpListener::bind(format!("0.0.0.0:{}", port))) .run(app) .await { diff --git a/src/smtp.rs b/src/smtp.rs index 170e3f5..85979f6 100644 --- a/src/smtp.rs +++ b/src/smtp.rs @@ -142,7 +142,7 @@ impl Connection { } pub async fn server(mailbox: Mailbox, port: u16) -> anyhow::Result<()> { - let addr = format!("127.0.0.1:{}", port); + let addr = format!("0.0.0.0:{}", port); let listener = TcpListener::bind(&addr).await?; tracing::info!(port =? port, "SMTP Server running"); tokio::spawn(async move {