Fix: keep the local FRP address and align the MCP read-only preset

A subordinate that already runs its own FRP proxy must keep advertising
its own master address: the upstream auto FRP is only a fallback entry
and should not overwrite the address baked into generated clients and
kernel payloads. GetEffectiveMasterAddress now returns the local address
when [frp] UseFrp is on and a master address is configured; otherwise the
upstream address is used exactly as before. The startup banner, the hot
switch tips and the settings dialog follow the same rule, and the dialog
now explains under the field when the address is supplied by the
upstream FRP.

The MCP settings dialog's read-only preset now unchecks every other tool
switch (file transfer, host management, chat, keylog), matching the smart
preset and the first-open state; previously Smart followed by Read-only
left those four checked.

The FRP auto-proxy messages now go through _TRF and the three language
files carry the new local-FRP variants and the upstream-address hint.

Verified: build.cmd server passes; the default (no local FRP) path is
unchanged.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-11-28 10:27:20 +01:00
1 parent a6c417a061
commit b0e172bf91
7 files changed
+58 -8

No files matched your search

+6 -2
View File
@@ -314,17 +314,21 @@ void CMcpSettingsDlg::OnHttpsToggle()
// 「只读模式」预设:一键切到只读安全的工具组合。
// 顺带打开「启用 MCP」(未开则开),勾选「只读模式(禁命令执行)」,
// 并关闭所有「要求只读关闭」才生效的开关,避免保存后这些功能处于
// 「已勾选但实际无效」的状态。
// 并关闭其余所有工具开关——与「智能模式」互相切换后状态才一致。
// (此前漏关 fileTransfer/machine/chat/keylog,Smart→ReadOnly 会残留勾选。)
void CMcpSettingsDlg::OnPresetReadonly()
{
m_btnEnable.SetCheck(BST_CHECKED);
m_btnReadonly.SetCheck(BST_CHECKED);
m_btnTerminal.SetCheck(BST_UNCHECKED);
m_btnRemoteControl.SetCheck(BST_UNCHECKED);
m_btnFileTransfer.SetCheck(BST_UNCHECKED);
m_btnFileWrite.SetCheck(BST_UNCHECKED);
m_btnManage.SetCheck(BST_UNCHECKED);
m_btnMachine.SetCheck(BST_UNCHECKED);
m_btnMachineDangerous.SetCheck(BST_UNCHECKED);
m_btnChat.SetCheck(BST_UNCHECKED);
m_btnKeylog.SetCheck(BST_UNCHECKED);
m_btnBuild.SetCheck(BST_UNCHECKED);
}