diff --git a/README.md b/README.md index df648e6..fd28202 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,10 @@ volumes: Used to define the database connection for Chela to use. ##### `CHELA_HOST` -The hostname that Chela should refer to itself as. Defaults to `localhost` +The hostname that Chela should refer to itself as. Defaults to `localhost`. + +##### `CHELA_LISTEN_ADDRESS` +The address that Chela should listen on. Defaults to `0.0.0.0`. ### Manually #### Build @@ -61,6 +64,7 @@ $ cargo build -r ```bash $ export DATABASE_URL=postgres://chela:password@dbhost/postgres?sslmode=disable $ export CHELA_HOST=example.com +$ export CHELA_LISTEN_ADDRESS=127.0.0.1 $ ./target/release/chela ``` diff --git a/src/main.rs b/src/main.rs index 18fa942..22750a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -57,7 +57,7 @@ async fn main() -> eyre::Result<()> { sqids, }; - let address = "0.0.0.0"; + let address = std::env::var("CHELA_LISTEN_ADDRESS").unwrap_or("0.0.0.0".to_string()); let port = 3000; let router = init_routes(server_state);