From 6dfbc433a1b167d1533f70d6f3f3f876e0d4f55a Mon Sep 17 00:00:00 2001 From: Sijmen Date: Fri, 28 Apr 2023 00:33:13 +0200 Subject: [PATCH] Allow for setting the bind address --- README.md | 9 +++++++++ src/main.rs | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 098a654..121998c 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,15 @@ ![Screenshot](screenshots/screenshot.webp) +## Configuration +Empede is configured using environment variables: + +| Name | Default | Description | +| ----------- | ------------ | --------------------------------- | +| MPD_HOST | localhost | MPD server host | +| MPD_PORT | 6600 | MPD server port | +| EMPEDE_BIND | 0.0.0.0:8080 | Address for Empede to bind to | + ## Running ### Linux 1. Download and extract the [latest release](https://git.sijman.nl/_/empede/releases) diff --git a/src/main.rs b/src/main.rs index 5998189..d1053fa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -196,6 +196,8 @@ async fn main() -> tide::Result<()> { app.at("/static").serve_dir("static/")?; - app.listen("0.0.0.0:8080").await?; + let bind = std::env::var("EMPEDE_BIND").unwrap_or("0.0.0.0:8080".to_string()); + app.listen(bind).await?; + Ok(()) }