mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-11 03:51:01 +00:00
fix(docker): request restart when remote client protocol changes
This commit is contained in:
1 parent
4d8ca00e46
commit
ca2a555d7c
2 files changed
+18
-1
No files matched your search
@@ -0,0 +1,7 @@
|
||||
---
|
||||
area: manager
|
||||
type: fixed
|
||||
audience: admins
|
||||
title: Docker friend mode requests a restart when remote client support changes
|
||||
---
|
||||
Enabling remote CoA clients now requests a world restart even when the game ports were already open. Repeating the same unchanged setting does not request another restart.
|
||||
@@ -59,10 +59,11 @@ pub fn set_open(root: &Path, meta: &Path, open: bool) -> Result<bool> {
|
||||
if changed {
|
||||
fsx::atomic_write_json(&root.join(MARKER), &cfg)?;
|
||||
}
|
||||
let remote_changed = coa_edit.is_some();
|
||||
if let Some(text) = coa_edit {
|
||||
fsx::atomic_write(&coa_conf, text.as_bytes())?;
|
||||
}
|
||||
Ok(changed)
|
||||
Ok(changed || remote_changed)
|
||||
}
|
||||
|
||||
/// What each service can be reached from, computed from how the containers publish their ports: the database is never published,
|
||||
@@ -110,6 +111,15 @@ mod tests {
|
||||
assert_eq!(Config::load(&root).unwrap().bind_address, "127.0.0.1");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enabling_remote_client_protocol_requires_restart_even_when_ports_are_open() {
|
||||
let (_d, root, meta) = server(Some("0.0.0.0"));
|
||||
fs::write(root.join("Core/configs/modules/coa.conf"), "CoA.Enable = 1\nCoA.AllowRemoteClients = 0\n").unwrap();
|
||||
assert!(set_open(&root, &meta, true).unwrap());
|
||||
assert_eq!(Config::load(&root).unwrap().bind_address, "0.0.0.0");
|
||||
assert!(!set_open(&root, &meta, true).unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_address_chosen_by_hand_is_kept_when_opening_and_other_settings_survive() {
|
||||
let (_d, root, meta) = server(Some("192.168.1.20"));
|
||||
|
||||
Reference in new issue
Block a user