Commit 0d764f1
committed
feat(iplimit): auto-install fail2ban on install and update
IP limit enforcement is gated on fail2ban being present (ce8b1be), but the bare-metal install.sh/update.sh never installed it, so the feature stayed disabled until the user ran the IP Limit menu by hand. Docker already auto-configures it; bare-metal hosts did not.
Extract the fail2ban install + jail setup out of install_iplimit into a non-interactive setup_fail2ban_iplimit() (no exit/before_show_menu, returns a status) exposed via 'x-ui setup-fail2ban', and call it from install.sh and update.sh after the panel is up. update.sh is the primary update path (x-ui update and the panel self-updater both run it). Honors XUI_ENABLE_FAIL2BAN (proceed only when unset or true, matching the Go gate) and is non-fatal so a fail2ban failure never aborts the install/update.1 parent 6836536 commit 0d764f1
3 files changed
Lines changed: 84 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1300 | 1300 | | |
1301 | 1301 | | |
1302 | 1302 | | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
1303 | 1329 | | |
1304 | 1330 | | |
1305 | 1331 | | |
| |||
1487 | 1513 | | |
1488 | 1514 | | |
1489 | 1515 | | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
1490 | 1520 | | |
1491 | 1521 | | |
1492 | 1522 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
857 | 884 | | |
858 | 885 | | |
859 | 886 | | |
| |||
1037 | 1064 | | |
1038 | 1065 | | |
1039 | 1066 | | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
1040 | 1072 | | |
1041 | 1073 | | |
1042 | 1074 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2166 | 2166 | | |
2167 | 2167 | | |
2168 | 2168 | | |
2169 | | - | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
2170 | 2178 | | |
2171 | 2179 | | |
2172 | 2180 | | |
| |||
2216 | 2224 | | |
2217 | 2225 | | |
2218 | 2226 | | |
2219 | | - | |
| 2227 | + | |
2220 | 2228 | | |
2221 | 2229 | | |
2222 | 2230 | | |
2223 | 2231 | | |
2224 | 2232 | | |
2225 | | - | |
| 2233 | + | |
2226 | 2234 | | |
2227 | 2235 | | |
2228 | 2236 | | |
| |||
2267 | 2275 | | |
2268 | 2276 | | |
2269 | 2277 | | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
2270 | 2286 | | |
2271 | 2287 | | |
2272 | 2288 | | |
| |||
3263 | 3279 | | |
3264 | 3280 | | |
3265 | 3281 | | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
3266 | 3285 | | |
3267 | 3286 | | |
3268 | 3287 | | |
| |||
0 commit comments