Add CHELA_LISTEN_ADDRESS

This commit is contained in:
Shav Kinderlehrer 2024-04-06 12:51:08 -04:00
parent aa999294f9
commit 3c759c85a1
2 changed files with 6 additions and 2 deletions

View File

@ -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
```

View File

@ -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);