feat: add PowerShell firewall configuration command to UI
This commit is contained in:
parent
e153a76b77
commit
c15f965a2b
2 changed files with 12 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
const portInput = document.getElementById('port');
|
||||
const ufwCmd = document.getElementById('ufw-cmd');
|
||||
const iptablesCmd = document.getElementById('iptables-cmd');
|
||||
const winCmd = document.getElementById('win-cmd');
|
||||
const loginOverlay = document.getElementById('login-overlay');
|
||||
const loginForm = document.getElementById('login-form');
|
||||
const loginError = document.getElementById('login-error');
|
||||
|
|
@ -86,11 +87,12 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
});
|
||||
|
||||
const updateFirewallCmds = () => {
|
||||
if (!ufwCmd || !iptablesCmd) return;
|
||||
if (!ufwCmd || !iptablesCmd || !winCmd) return;
|
||||
const port = portInput.value || '4646';
|
||||
const hostIp = config.firewall_host_ip || window.location.hostname;
|
||||
ufwCmd.textContent = `sudo ufw allow from ${hostIp} to any port ${port} proto tcp`;
|
||||
iptablesCmd.textContent = `sudo iptables -I INPUT -p tcp -s ${hostIp} --dport ${port} -j ACCEPT`;
|
||||
winCmd.textContent = `New-NetFirewallRule -DisplayName "XIVLauncher OTP" -Direction Inbound -RemoteAddress ${hostIp} -LocalPort ${port} -Protocol TCP -Action Allow`;
|
||||
};
|
||||
|
||||
const fetchConfig = async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue