Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eterban
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eterban
Commits
72ffa764
Commit
72ffa764
authored
Jul 21, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gateway: reload whitelist on HUP
parent
b58b9465
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
eterban.sh
gateway/usr/bin/eterban.sh
+6
-0
eterban_switcher.py
gateway/usr/share/eterban/eterban_switcher.py
+10
-0
No files found.
gateway/usr/bin/eterban.sh
View file @
72ffa764
...
@@ -89,6 +89,11 @@ if [ "$command" = "clear" ] ; then
...
@@ -89,6 +89,11 @@ if [ "$command" = "clear" ] ; then
exit
exit
fi
fi
if
[
"
$command
"
=
"reload-whitelist"
]
;
then
systemctl
kill
--signal
=
HUP eterban.service
exit
fi
if
[
"
$command
"
=
"info"
]
;
then
if
[
"
$command
"
=
"info"
]
;
then
/usr/share/eterban/autoban_cli.py info
$1
/usr/share/eterban/autoban_cli.py info
$1
exit
exit
...
@@ -121,6 +126,7 @@ Commands:
...
@@ -121,6 +126,7 @@ Commands:
unban <ip> - unban IP
unban <ip> - unban IP
ban <ip> - ban IP
ban <ip> - ban IP
clear --force - remove all IPs from ban
clear --force - remove all IPs from ban
reload-whitelist - reload whitelist.txt without restarting eterban
Auto-unban commands:
Auto-unban commands:
info <ip> - show ban info and history for IP
info <ip> - show ban info and history for IP
...
...
gateway/usr/share/eterban/eterban_switcher.py
View file @
72ffa764
...
@@ -329,6 +329,15 @@ def log_redis_error(message):
...
@@ -329,6 +329,15 @@ def log_redis_error(message):
log
.
flush
()
log
.
flush
()
def
reload_whitelist
(
signum
,
frame
):
"""Reload the configured whitelist without changing firewall topology."""
try
:
loaded
=
load_whitelist
()
log_redis_error
(
"Whitelist reloaded: "
+
str
(
loaded
)
+
" entries"
)
except
(
OSError
,
subprocess
.
SubprocessError
)
as
error
:
log_redis_error
(
"Unable to reload whitelist: "
+
str
(
error
))
def
configure_autoban_logging
():
def
configure_autoban_logging
():
autoban_log
=
logging
.
getLogger
(
'autoban_manager'
)
autoban_log
=
logging
.
getLogger
(
'autoban_manager'
)
autoban_log
.
setLevel
(
logging
.
ERROR
)
autoban_log
.
setLevel
(
logging
.
ERROR
)
...
@@ -339,6 +348,7 @@ def configure_autoban_logging():
...
@@ -339,6 +348,7 @@ def configure_autoban_logging():
configure_autoban_logging
()
configure_autoban_logging
()
signal
.
signal
(
signal
.
SIGHUP
,
reload_whitelist
)
conntrack_queue
=
queue
.
Queue
(
maxsize
=
1024
)
conntrack_queue
=
queue
.
Queue
(
maxsize
=
1024
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment