From bc0d3d2f324ee613424ee31103207222b4b19640 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 29 Jul 2026 12:21:32 +0200 Subject: Config editor, host networking, whitelist RCON MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Config file editor at /instances/{id}/config (browse & edit config/ files) - Host networking for Docker container (fixes WireGuard MTU DNS issues) - Whitelist changes applied live via RCON instead of stopping the server - Config edit handler detects which fields changed: whitelist → RCON, other settings → restart container - walk_dir simplified (removed unused root param) - import_world uses if-let instead of never-looping while-let - docker-compose.yml updated as reference template --- src/sanitize.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/sanitize.rs') diff --git a/src/sanitize.rs b/src/sanitize.rs index f251131..19c7045 100644 --- a/src/sanitize.rs +++ b/src/sanitize.rs @@ -136,6 +136,12 @@ pub fn instance_dir(server_dir: &Path, instance_name: &str) -> Option { Some(server_dir.join("instances").join(&safe)) } +/// Build a safe path to the instance's config/ directory. +pub fn instance_config_dir(server_dir: &Path, instance_name: &str) -> Option { + let data = instance_data_dir(server_dir, instance_name)?; + Some(data.join("config")) +} + /// Validate that a backup filename does not contain path traversal. pub fn sanitize_backup_filename(raw: &str) -> Option { let trimmed = raw.trim(); -- cgit v1.2.3