diff options
| author | salmonik <salmonik@tuta.io> | 2026-07-29 12:21:32 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-07-29 12:21:32 +0200 |
| commit | bc0d3d2f324ee613424ee31103207222b4b19640 (patch) | |
| tree | 483f699f303c44af6ec27b8f357e220b4d683e0c /src/sanitize.rs | |
| parent | Enable/disable mods, batch toggle & delete (diff) | |
| download | minecraft-ui-bc0d3d2f324ee613424ee31103207222b4b19640.tar.gz minecraft-ui-bc0d3d2f324ee613424ee31103207222b4b19640.zip | |
Config editor, host networking, whitelist RCON
- 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
Diffstat (limited to 'src/sanitize.rs')
| -rw-r--r-- | src/sanitize.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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<PathBuf> { | |||
| 136 | Some(server_dir.join("instances").join(&safe)) | 136 | Some(server_dir.join("instances").join(&safe)) |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | /// Build a safe path to the instance's config/ directory. | ||
| 140 | pub fn instance_config_dir(server_dir: &Path, instance_name: &str) -> Option<PathBuf> { | ||
| 141 | let data = instance_data_dir(server_dir, instance_name)?; | ||
| 142 | Some(data.join("config")) | ||
| 143 | } | ||
| 144 | |||
| 139 | /// Validate that a backup filename does not contain path traversal. | 145 | /// Validate that a backup filename does not contain path traversal. |
| 140 | pub fn sanitize_backup_filename(raw: &str) -> Option<String> { | 146 | pub fn sanitize_backup_filename(raw: &str) -> Option<String> { |
| 141 | let trimmed = raw.trim(); | 147 | let trimmed = raw.trim(); |
