look for OXIDE_LISTEN_ON env variable to set ip and port

This commit is contained in:
T-x-T 2025-07-24 17:32:12 +02:00
parent 01ff71b92e
commit 3912efa659
3 changed files with 6 additions and 2 deletions

View file

@ -6,6 +6,8 @@ services:
- 25565:25565
volumes:
- "data:/app/world"
environment:
OXIDE_LISTEN_ON: "0.0.0.0:25565"
volumes:
data:

View file

@ -6,6 +6,7 @@ services:
- 25565:25565
volumes:
- "data:/app/world"
environment:
OXIDE_LISTEN_ON: "0.0.0.0:25565"
volumes:
data:

View file

@ -19,7 +19,8 @@ fn main() {
}
fn initialize_server() {
let listener = TcpListener::bind("0.0.0.0:25565").unwrap();
let listener = TcpListener::bind(std::env::var("OXIDE_LISTEN_ON").unwrap_or("0.0.0.0:25565".to_string())).unwrap();
println!("oxide listening on {}", listener.local_addr().unwrap());
let block_states = data::blocks::get_blocks();