[PR #5905] [CLOSED] [Feature] Add firewall backend selection (iptables/nftables/none) to Fail2ban/IP Limit installer #6026

Closed
opened 2026-11-02 04:05:51 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5905
Author: @hermit-turtle
Created: 7/11/2026
Status: ❌ Closed

Base: main ← Head: main


📝 Commits (10+)

📊 Changes

3 files changed (+241 additions, -148 deletions)

View changed files

📝 install.sh (+51 -8)
📝 internal/web/service/xray.go (+13 -0)
📝 x-ui.sh (+177 -140)

📄 Description

Summary

Added support for choosing the firewall backend for Fail2ban/IP Limit during installation: iptables (default), nftables, or none (skip). This makes the panel more compatible with modern systems while keeping full backward compatibility.

Why

  • Many modern distributions (especially Debian 12+, Ubuntu 22.04+, newer Fedora/RHEL) prefer or default to nftables.
  • Users on minimal or containerized environments often want to skip Fail2ban entirely or use nftables.
  • Previously the installer always forced nftables + iptables mix, which could cause confusion or unnecessary dependencies.
  • Improves user experience and reduces potential conflicts on reinstall/upgrade.

Type of change

  • New feature
  • Refactoring (no behavior change for default users)

Areas affected

  • Install / upgrade script
  • Docker image (indirectly — through install logic)

How was this tested?

  • Fresh installation on Ubuntu 22.04 and Debian 12 with all three options (iptables, nftables, none).
  • Re-installation (upgrade scenario) with different backend choices.
  • Verified that IP Limit works correctly with both backends.
  • Checked that skipping Fail2ban doesn't break panel startup.
  • Tested x-ui menu → IP Limit section after installation.

Breaking changes

None.
Default behavior remains exactly the same (iptables). Existing installations are not affected unless user explicitly chooses a different backend on reinstall.

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I have no unrelated changes mixed into this PR.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5905 **Author:** [@hermit-turtle](https://github.com/hermit-turtle) **Created:** 7/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (10+) - [`8fa97e5`](https://github.com/MHSanaei/3x-ui/commit/8fa97e52fb1d8ca1926abd9d2fdccb98d8a6895d) Update install.sh - [`848998e`](https://github.com/MHSanaei/3x-ui/commit/848998e73857ce6a8c6855654314b50d9a01780d) Update x-ui.sh - [`6f0c649`](https://github.com/MHSanaei/3x-ui/commit/6f0c649e4425479ea7591c31179eac58fea6639a) Update install.sh - [`0dbc06f`](https://github.com/MHSanaei/3x-ui/commit/0dbc06fb6c4ca50ab9e6a2104a78139bbbe0b5d7) Update install.sh - [`2b2c9e7`](https://github.com/MHSanaei/3x-ui/commit/2b2c9e7bb89fde5f88f52f493fff23e67f44b990) Merge branch 'main' of https://github.com/hermit-turtle/3x-ui - [`5e328c8`](https://github.com/MHSanaei/3x-ui/commit/5e328c8db272526d067aa9b0fd5a34ca8e7bd059) Merge branch 'main' into main - [`07883a2`](https://github.com/MHSanaei/3x-ui/commit/07883a2b0202b2e16af1e615e6702d115fbd2fd7) Merge branch 'main' into main - [`ca67ca0`](https://github.com/MHSanaei/3x-ui/commit/ca67ca09ddda4776fd1aa64c6ca9a0e0180e21ea) Merge branch 'MHSanaei:main' into main - [`cdce5ed`](https://github.com/MHSanaei/3x-ui/commit/cdce5ed4f91416334f90032c1b951a9c3a973dad) Merge branch 'MHSanaei:main' into main - [`8991908`](https://github.com/MHSanaei/3x-ui/commit/8991908be7c5af575dc6d5716af13e158cacf74e) Merge branch 'MHSanaei:main' into main ### 📊 Changes **3 files changed** (+241 additions, -148 deletions) <details> <summary>View changed files</summary> 📝 `install.sh` (+51 -8) 📝 `internal/web/service/xray.go` (+13 -0) 📝 `x-ui.sh` (+177 -140) </details> ### 📄 Description ## Summary Added support for choosing the firewall backend for Fail2ban/IP Limit during installation: **iptables** (default), **nftables**, or **none** (skip). This makes the panel more compatible with modern systems while keeping full backward compatibility. ## Why - Many modern distributions (especially Debian 12+, Ubuntu 22.04+, newer Fedora/RHEL) prefer or default to nftables. - Users on minimal or containerized environments often want to skip Fail2ban entirely or use nftables. - Previously the installer always forced nftables + iptables mix, which could cause confusion or unnecessary dependencies. - Improves user experience and reduces potential conflicts on reinstall/upgrade. ## Type of change - [x] New feature - [x] Refactoring (no behavior change for default users) ## Areas affected - [x] Install / upgrade script - [x] Docker image (indirectly — through install logic) ## How was this tested? - Fresh installation on Ubuntu 22.04 and Debian 12 with all three options (iptables, nftables, none). - Re-installation (upgrade scenario) with different backend choices. - Verified that IP Limit works correctly with both backends. - Checked that skipping Fail2ban doesn't break panel startup. - Tested `x-ui` menu → IP Limit section after installation. ## Breaking changes None. Default behavior remains exactly the same (`iptables`). Existing installations are not affected unless user explicitly chooses a different backend on reinstall. ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:05:51 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6026
No description provided.