Commit e9c3b7cb authored by Ruzal Gimazov's avatar Ruzal Gimazov

Code review on unban.php, add /etc/nginx/sites-enabled.d/eterban.conf

parent bb4405ea
<?php <?php
$ip = $_SERVER['REMOTE_ADDR']; $ip = $_SERVER['REMOTE_ADDR'];
$old_addr = $_SERVER['HTTP_REFERER']; $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 = new Redis();
$redis->pconnect($host_redis,6379); $redis->pconnect($host_redis,6379);
$redis->publish('unban', $ip); $redis->publish('unban', $ip);
$redis->publish('by', $ip . " was unblocked by ckick"); $redis->publish('by', $ip . " was unblocked by $hostname");
$redis->close(); $redis->close();
echo "Wait 5 secons, please" echo "Wait 5 seconds, please"
?> ?>
<script> <script>
function update() function update()
...@@ -16,4 +26,4 @@ ...@@ -16,4 +26,4 @@
} }
setTimeout("update()", 5000); setTimeout("update()", 5000);
</script> </script>
\ No newline at end of file
...@@ -62,12 +62,14 @@ mkdir -p %buildroot/etc/fail2ban/action.d/ ...@@ -62,12 +62,14 @@ mkdir -p %buildroot/etc/fail2ban/action.d/
mkdir -p %buildroot/etc/systemd/system/ mkdir -p %buildroot/etc/systemd/system/
mkdir -p %buildroot/var/log/eterban/ mkdir -p %buildroot/var/log/eterban/
mkdir -p %buildroot%webserver_htdocsdir/%name/ mkdir -p %buildroot%webserver_htdocsdir/%name/
mkdir -p %buildroot/etc/nginx/sites-enabled.d/
cp -a gateway/usr/share/%name/* %buildroot%_datadir/%name/ cp -a gateway/usr/share/%name/* %buildroot%_datadir/%name/
install -m 644 gateway/etc/eterban/* %buildroot/etc/%name/ install -m 644 gateway/etc/eterban/* %buildroot/etc/%name/
install -m 644 gateway/etc/systemd/system/* %buildroot/etc/systemd/system/ install -m 644 gateway/etc/systemd/system/* %buildroot/etc/systemd/system/
install -m 644 ban-server/data/www/* %buildroot%webserver_htdocsdir/%name/ 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/ install -m 644 prod-server/etc/fail2ban/action.d/* %buildroot/etc/fail2ban/action.d/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment