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
8c4066f3
Commit
8c4066f3
authored
Mar 19, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec: add ban-internal-server subpackage
parent
a3f8fe16
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
161 additions
and
0 deletions
+161
-0
ban.php
ban-internal-server/data/www/ban.php
+28
-0
index.html
ban-internal-server/data/www/index.html
+69
-0
unban.html
ban-internal-server/data/www/unban.html
+2
-0
unban.php
ban-internal-server/data/www/unban.php
+29
-0
eterban.conf
ban-internal-server/etc/nginx/sites-enabled.d/eterban.conf
+26
-0
eterban.spec
eterban.spec
+7
-0
No files found.
ban-internal-server/data/www/ban.php
0 → 100644
View file @
8c4066f3
//Где сменить IP-адреса серверов
<?php
$ip
=
$_SERVER
[
'REMOTE_ADDR'
];
echo
"You are banned!, Your IP:
$ip
<br>"
;
$settings
=
'/etc/eterban/settings.ini'
;
$ini_array
=
parse_ini_file
(
"
$settings
"
);
$host_redis
=
$ini_array
[
'redis_server'
];
$redis
=
new
Redis
;
$redis
->
pconnect
(
$host_redis
,
6379
);
$key
=
$redis
->
get
(
$ip
);
?>
<button
onclick=
"unban()"
>
Unban
</button>
<script
type=
"text/javascript"
src=
"//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.js"
></script>
<script>
function
unban
(){
/*$.get("unban.php?&key=
<?php
echo
$key
;
?>
", function(data, status){
});*/
window
.
location
.
href
=
"unban.php?key=
<?php
echo
$key
;
?>
"
;
}
</script>
\ No newline at end of file
ban-internal-server/data/www/index.html
0 → 100644
View file @
8c4066f3
<!DOCTYPE HTML>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
IP-адрес, к которому вы обратились, заблокирован на сервере. This IP is banned!
</title>
<style>
html
{
font-family
:
sans-serif
;
text-align
:
center
;
}
body
{
overflow
:
hidden
;
}
big
{
font-weight
:
bold
;
}
.center
{
width
:
800px
;
height
:
500px
;
max-width
:
100vw
;
max-width
:
calc
(
100vw
-
2rem
);
min-height
:
100vh
;
margin
:
auto
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.button
{
text-decoration
:
none
;
display
:
inline-block
;
width
:
140px
;
height
:
40px
;
line-height
:
40px
;
border-radius
:
5px
;
margin
:
10px
20px
;
font-family
:
inherit
;
font-size
:
15px
;
text-transform;
text-align
:
center
;
font-weight
:
600
;
color
:
#ffffff
;
background
:
#0d6efd
;
box-shadow
:
0
8px
15px
rgba
(
0
,
0
,
0
,
.1
);
transition
:
.3s
;
}
.button
:hover
{
background
:
#2EE59D
;
box-shadow
:
0
15px
20px
rgba
(
46
,
229
,
157
,
.4
);
color
:
white
;
transform
:
translateY
(
-7px
);
}
</style>
</head>
<body>
<div
class=
center
>
<p><big>
Доступ к запрашиваемому ресурсу ограничен в связи с подозрительной активностью этого IP-адреса.
<br>
Если вы считаете, что блокировка ошибочна, обратитесь к администратору.
<br>
<br>
Access to the requested resource is restricted due to suspicious activity from this IP address.
<br>
If you believe this is a mistake, please contact your administrator.
</big>
</div>
</body>
<html>
ban-internal-server/data/www/unban.html
0 → 100644
View file @
8c4066f3
YYYYYYYYYYYYYes
\ No newline at end of file
ban-internal-server/data/www/unban.php
0 → 100644
View file @
8c4066f3
<?php
$ip
=
$_SERVER
[
'REMOTE_ADDR'
];
$old_addr
=
$_SERVER
[
'HTTP_REFERER'
];
$settings
=
'/etc/eterban/settings.ini'
;
$ini_array
=
parse_ini_file
(
"
$settings
"
);
//print_r($ini_array);
//print_r($ini_array['redis_server']);
$host_redis
=
$ini_array
[
'redis_server'
];
//print_r($host_redis);
$hostname
=
$ini_array
[
'hostname'
];
if
(
empty
(
$hostname
))
{
$hostname
=
gethostname
();
//print_r ($hostname);
}
$redis
=
new
Redis
();
$redis
->
pconnect
(
$host_redis
,
6379
);
$redis
->
publish
(
'unban'
,
$ip
);
$redis
->
publish
(
'by'
,
$ip
.
" was unblocked by
$hostname
"
);
$redis
->
close
();
echo
"Wait 5 seconds, please"
?>
<script>
function
update
()
{
window
.
location
.
href
=
"/"
;
}
setTimeout
(
"update()"
,
5000
);
</script>
ban-internal-server/etc/nginx/sites-enabled.d/eterban.conf
0 → 100644
View file @
8c4066f3
server
{
listen
91
.
232
.
225
.
67
:
82
;
#server_name priv.etersoft.ru;
root
/
var
/
www
/
html
/
eterban
-
internal
/;
location
/ {
# add_header Access-Control-Allow-Origin *;
# try_files $uri $uri/ /index.php?$query_string;
index
index
.
html
;
#include /etc/nginx/fastcgi_params;
#fastcgi_pass unix:/var/run/php7-fpm/php7.fpm.sock;
}
location
~* \.
php
$ {
#try_files $uri = 404;
fastcgi_split_path_info
^(.+\.
php
)(/.+)$;
fastcgi_pass
unix
:/
var
/
run
/
php7
-
fpm
/
php7
-
fpm
.
sock
;
# подключаем сокет php-fpm
fastcgi_index
index
.
php
;
fastcgi_param
SCRIPT_FILENAME
$
document_root
$
fastcgi_script_name
;
include
fastcgi_params
;
}
access_log
/
var
/
log
/
nginx
/
eterban_access
.
log
;
error_log
/
var
/
log
/
nginx
/
eterban_error
.
log
;
}
eterban.spec
View file @
8c4066f3
...
@@ -88,6 +88,11 @@ install -m 644 gateway/etc/cron.hourly/* %buildroot/etc/cron.hourly/
...
@@ -88,6 +88,11 @@ install -m 644 gateway/etc/cron.hourly/* %buildroot/etc/cron.hourly/
install -m 644 ban-server/data/www/* %buildroot%webserver_htdocsdir/%name/
install -m 644 ban-server/data/www/* %buildroot%webserver_htdocsdir/%name/
install -m 644 ban-server/etc/nginx/sites-enabled.d/* %buildroot/etc/nginx/sites-enabled.d/
install -m 644 ban-server/etc/nginx/sites-enabled.d/* %buildroot/etc/nginx/sites-enabled.d/
mkdir -p %buildroot%webserver_htdocsdir/%name-internal/
mkdir -p %buildroot/etc/nginx/sites-available.d/
install -m 644 ban-internal-server/data/www/* %buildroot%webserver_htdocsdir/%name-internal/
install -m 644 ban-internal-server/etc/nginx/sites-enabled.d/eterban.conf %buildroot/etc/nginx/sites-available.d/eterban-internal.conf
install -m 644 prod-server/etc/fail2ban/action.d/* %buildroot/etc/fail2ban/action.d/
install -m 644 prod-server/etc/fail2ban/action.d/* %buildroot/etc/fail2ban/action.d/
cp -a prod-server/usr/share/%name/* %buildroot%_datadir/%name/
cp -a prod-server/usr/share/%name/* %buildroot%_datadir/%name/
...
@@ -116,7 +121,9 @@ cp -a prod-server/usr/share/%name/* %buildroot%_datadir/%name/
...
@@ -116,7 +121,9 @@ cp -a prod-server/usr/share/%name/* %buildroot%_datadir/%name/
%files web
%files web
%webserver_htdocsdir/%name/
%webserver_htdocsdir/%name/
%webserver_htdocsdir/%name-internal/
%config(noreplace) /etc/nginx/sites-enabled.d/eterban.conf
%config(noreplace) /etc/nginx/sites-enabled.d/eterban.conf
%config(noreplace) /etc/nginx/sites-available.d/eterban-internal.conf
%files fail2ban
%files fail2ban
%_datadir/%name/ban.py
%_datadir/%name/ban.py
...
...
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