Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/deploy-firewall.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: deploy firewall
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
deploy-firewall:
runs-on: self-hosted
steps:
- name: Check out the pull request or main branch
uses: actions/checkout@v4
with:
# For pull requests, use the source branch; otherwise, use the current branch
ref: ${{ github.event.pull_request.head.ref || github.ref_name }}
fetch-depth: 0 # Fetch all history to ensure complete build context
- run: |
sudo cp server.nft /etc/nft-conf/
sudo nft -f /etc/nftables.conf
sudo service docker restart


4 changes: 4 additions & 0 deletions server.nft
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ table inet filter {
icmp type { destination-unreachable, router-advertisement, router-solicitation, time-exceeded, parameter-problem } accept comment "Accept ICMP"
ip protocol igmp accept comment "Accept IGMP"
meta l4proto vmap @input_vmap
tcp dport {21115-21119} accept
udp dport 21116 accept
}

chain forward {
Expand All @@ -41,6 +43,8 @@ table inet filter {
tcp sport 2049 accept
udp sport 2049 accept
tcp sport @web counter packets 0 bytes 0 accept comment "Accept web server"
tcp sport {21115-21119} accept
udp sport 21116 accept
}

chain TCP {
Expand Down