Add nftables support with config generator and IP checker (#22)

* Add nftables support with config generator and IP checker

- Add generate_nft_blacklist.py for generating nftables configurations
- Add check_nft_blacklist.py for verifying IPs against blacklist
- Add blacklists_updater_nftables.sh for automated updates
- Add blacklists_nftables/ directory with generated configs
- Add GitHub Actions workflow for daily nftables updates
- Update README.md with nftables usage instructions

nftables is a modern replacement for iptables with better performance
and lower memory usage, especially for large rulesets. This addition
complements the existing iptables and nginx blacklist formats.

* Added nftables scripts help
This commit is contained in:
Alexander Serkin
2026-01-12 12:46:07 +03:00
committed by GitHub
parent f2d2795afe
commit a3a5ec2ea8
9 changed files with 2305 additions and 0 deletions

33
.github/workflows/update_nftables.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Update nftables Blacklists
on:
schedule:
- cron: '30 2 * * *' # Daily at 02:30 UTC
workflow_dispatch:
jobs:
update-nftables:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Generate nftables blacklists
run: |
chmod +x blacklists_updater_nftables.sh
./blacklists_updater_nftables.sh
- name: Commit and push if changed
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add blacklists_nftables/
git diff --quiet && git diff --staged --quiet || \
(git commit -m "Auto-update nftables blacklists [skip ci]" && git push)