diff options
author | Shav Kinderlehrer <[email protected]> | 2024-04-06 12:51:08 -0400 |
---|---|---|
committer | Shav Kinderlehrer <[email protected]> | 2024-04-06 12:51:08 -0400 |
commit | 3c759c85a1c9393fd703f5d1bed7667c8111b63c (patch) | |
tree | 24adf7d578e341cb28a1f892518b02f5ccc42626 | |
parent | aa999294f97e6b3474212b2e6a83df8419ae8bf4 (diff) | |
download | chela-3c759c85a1c9393fd703f5d1bed7667c8111b63c.tar.gz chela-3c759c85a1c9393fd703f5d1bed7667c8111b63c.zip |
Add CHELA_LISTEN_ADDRESS
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | src/main.rs | 2 |
2 files changed, 6 insertions, 2 deletions
@@ -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); |