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
e9c3b7cb
Commit
e9c3b7cb
authored
Mar 11, 2020
by
Ruzal Gimazov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code review on unban.php, add /etc/nginx/sites-enabled.d/eterban.conf
parent
bb4405ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
unban.php
ban-server/data/www/unban.php
+14
-5
eterban.spec
eterban.spec
+2
-0
No files found.
ban-server/data/www/unban.php
View file @
e9c3b7cb
<?php
$ip
=
$_SERVER
[
'REMOTE_ADDR'
];
$old_addr
=
$_SERVER
[
'HTTP_REFERER'
];
$host_redis
=
'10.20.30.101'
;
$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
ckick
"
);
$redis
->
publish
(
'by'
,
$ip
.
" was unblocked by
$hostname
"
);
$redis
->
close
();
echo
"Wait 5 secons, please"
echo
"Wait 5 secon
d
s, please"
?>
<script>
function
update
()
...
...
@@ -16,4 +26,4 @@
}
setTimeout
(
"update()"
,
5000
);
</script>
\ No newline at end of file
</script>
eterban.spec
View file @
e9c3b7cb
...
...
@@ -62,12 +62,14 @@ mkdir -p %buildroot/etc/fail2ban/action.d/
mkdir -p %buildroot/etc/systemd/system/
mkdir -p %buildroot/var/log/eterban/
mkdir -p %buildroot%webserver_htdocsdir/%name/
mkdir -p %buildroot/etc/nginx/sites-enabled.d/
cp -a gateway/usr/share/%name/* %buildroot%_datadir/%name/
install -m 644 gateway/etc/eterban/* %buildroot/etc/%name/
install -m 644 gateway/etc/systemd/system/* %buildroot/etc/systemd/system/
install -m 644 ban-server/data/www/* %buildroot%webserver_htdocsdir/%name/
imstall -m 644 ban-server//etc/nginx/sites-enabled.d/* %buildroot/etc/nginx/sites-enabled.d/
install -m 644 prod-server/etc/fail2ban/action.d/* %buildroot/etc/fail2ban/action.d/
...
...
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