Skip to content

Commit eb656aa

Browse files
committed
Updated readme
1 parent 0ddc9ac commit eb656aa

2 files changed

Lines changed: 30 additions & 6 deletions

File tree

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func main() {
3333
Type: plugin.PluginType_Utilities,
3434
VersionMajor: 0,
3535
VersionMinor: 1,
36-
VersionPatch: 0,
36+
VersionPatch: 1,
3737
UIPath: UI_PATH,
3838
})
3939
if err != nil {

readme.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
# Zoraxy Fail2ban Plugin
22

3-
Test
3+
This is a simple plugin for [Zoraxy](https://github.com/tobychui/zoraxy) that enables you to use the [Fail2Ban](https://github.com/fail2ban/fail2ban) daemon to block spam bots and scapers. This plugin is mostly just the visual interface in Zoraxy, which includes some simple controls such as updating configs or manually banning IPs.
4+
5+
<img width="1897" height="935" alt="image" src="https://github.com/user-attachments/assets/1aefb7bf-49b2-4700-bc0a-7ee70b63becc" />
46

57
# Installation
8+
To use this plugin, you must first have fail2ban installed.
9+
10+
## Fail2Ban
11+
12+
All the following steps is assumed to be run with `sudo -i` or as a root user.
13+
14+
First install fail2ban from the APT repository:
615

716
```bash
8-
sudo -i
917
apt update
1018
apt upgrade
1119
apt install fail2ban
20+
```
21+
22+
Then you can create the filter that we need to parse Zoraxy log files. You can also change the config values later in Zoraxy.
1223

24+
```bash
1325
rm /etc/fail2ban/jail.d/*.conf
1426
cat <<EOF >/etc/fail2ban/filter.d/zoraxy.conf
1527
[Definition]
@@ -18,8 +30,11 @@ cat <<EOF >/etc/fail2ban/filter.d/zoraxy.conf
1830
failregex = \[client:\s*<HOST>\].*(GET|POST|HEAD|PUT|DELETE|OPTIONS)\s+/(?!favicon\.ico|robots\.txt|api/notes/|api/renew|apple-touch-icon(?:-[^/]+)?(?:-precomposed)?\.png)[^\s]*\s+(401|403|404|429|444)
1931
EOF
2032
chmod 777 /etc/fail2ban/filter.d/zoraxy.conf
33+
```
2134

35+
Then you can create the fail2ban jail config, where you can change settings to your needs. You can also change the config values later in Zoraxy.
2236

37+
```bash
2338
cat <<EOF >/etc/fail2ban/jail.local
2439
# /etc/fail2ban/jail.local
2540
[DEFAULT]
@@ -46,17 +61,26 @@ bantime.maxtime = 720h
4661
banaction = nftables-allports
4762
EOF
4863
chmod 777 /etc/fail2ban/jail.local
64+
```
4965

66+
Finally you can restart fail2ban and allow non-root users to modify the fail2ban socket (This is needed for restarting and updating configs).
67+
68+
```bash
5069
systemctl restart fail2ban
5170

5271
chmod 777 /var/run/fail2ban/fail2ban.sock
5372
```
5473

55-
Then
74+
## Plugin
75+
76+
You can now install the Zoraxy plugin itself, by doing the following:
5677

5778
```bash
5879
mkdir -p /opt/zoraxy/plugins/zoraxyfail2ban
5980
cd /opt/zoraxy/plugins/zoraxyfail2ban
60-
wget https://github.com/kris701/ZoraxyFail2BanPlugin/releases/download/v0.1.0/zoraxyfail2ban
81+
# wget <LINK_TO_LATEST_BINARY>
82+
wget https://github.com/kris701/zoraxyfail2ban/releases/download/v0.1.1/zoraxyfail2ban
6183
chmod +x zoraxyfail2ban
62-
```
84+
```
85+
86+
Then you can restart your Zoraxy server or service and you should be able to see the new plugin in the sidebar.

0 commit comments

Comments
 (0)