diff --git a/static/app.js b/static/app.js index 7fa7e0f..bd8043e 100644 --- a/static/app.js +++ b/static/app.js @@ -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 () => { diff --git a/static/index.html b/static/index.html index 0a0dfd9..af87ca1 100644 --- a/static/index.html +++ b/static/index.html @@ -191,6 +191,15 @@ +
+ Windows (PowerShell) +
+ New-NetFirewallRule -DisplayName "XIVLauncher OTP" -Direction Inbound -RemoteAddress localhost -LocalPort 4646 -Protocol TCP -Action Allow + +
+