restrict firewall commands to host IP and expose service on all interfaces
This commit is contained in:
parent
000aa5710b
commit
340f8e5bef
2 changed files with 10 additions and 6 deletions
|
|
@ -5,7 +5,7 @@ services:
|
|||
build: .
|
||||
container_name: xivlauncher-remote-otp
|
||||
ports:
|
||||
- "127.0.0.1:${WEB_PORT:-8814}:8080"
|
||||
- "${WEB_PORT:-8814}:8080"
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
environment:
|
||||
|
|
|
|||
|
|
@ -6,11 +6,15 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
const ufwCmd = document.getElementById('ufw-cmd');
|
||||
const iptablesCmd = document.getElementById('iptables-cmd');
|
||||
|
||||
portInput.addEventListener('input', (e) => {
|
||||
const port = e.target.value || '4646';
|
||||
ufwCmd.textContent = `sudo ufw allow ${port}/tcp`;
|
||||
iptablesCmd.textContent = `sudo iptables -I INPUT -p tcp --dport ${port} -j ACCEPT`;
|
||||
});
|
||||
const updateFirewallCmds = () => {
|
||||
const port = portInput.value || '4646';
|
||||
const hostIp = 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`;
|
||||
};
|
||||
|
||||
portInput.addEventListener('input', updateFirewallCmds);
|
||||
updateFirewallCmds();
|
||||
|
||||
const fetchInstances = async () => {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue