mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 04:09:23 +00:00
Merge pull request #201 from basecamp/firewall
Enable ufw firewall by default
This commit is contained in:
26
install/firewall.sh
Normal file
26
install/firewall.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! command -v ufw &>/dev/null; then
|
||||
yay -Sy --noconfirm --needed ufw ufw-docker
|
||||
|
||||
# Allow nothing in, everything out
|
||||
sudo ufw default deny incoming
|
||||
sudo ufw default allow outgoing
|
||||
|
||||
# Allow ports for LocalSend
|
||||
sudo ufw allow 53317/udp
|
||||
sudo ufw allow 53317/tcp
|
||||
|
||||
# Allow SSH in
|
||||
sudo ufw allow 22/tcp
|
||||
|
||||
# Allow Docker containers to use DNS on host
|
||||
sudo ufw allow in on docker0 to any port 53
|
||||
|
||||
# Turn on the firewall
|
||||
sudo ufw enable
|
||||
|
||||
# Turn on Docker protections
|
||||
sudo ufw-docker install
|
||||
sudo ufw reload
|
||||
fi
|
2
migrations/1752709610.sh
Normal file
2
migrations/1752709610.sh
Normal file
@ -0,0 +1,2 @@
|
||||
echo "Enable ufw firewall"
|
||||
source ~/.local/share/omarchy/install/firewall.sh
|
Reference in New Issue
Block a user