SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "fail2ban"

# SliTaz package receipt.

PACKAGE="fail2ban"
VERSION="0.8.4"
CATEGORY="network"
SHORT_DESC="Scans log files to bans IP that makes too many password failures."
MAINTAINER="pascal.bellard@slitaz.org"
TARBALL="$PACKAGE-$VERSION.tar.bz2"
WEB_SITE="http://www.fail2ban.org/wiki/index.php/Main_Page"
DEPENDS="iptables"
BUILD_DEPENDS="python"
WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
TAGS="monitor network"
CONFIG_FILES="/etc/fail2ban"

# Rules to configure and make the package.
compile_rules()
{
    cd $src
    python setup.py install --root=$DESTDIR
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/etc/logrotate.d
    cp -a $_pkg/* $fs
    sed -i -e 's|127.0.0.1|& 192.168.0.0/16|;s|sshd.log|messages|' \
        -e '/ssh-iptables/{nn;s/false/true/}' $fs/etc/fail2ban/jail.conf
    cat >> $fs/etc/fail2ban/jail.conf <<EOT
[ssh-ddos]

enabled  = true
port     = ssh,sftp
filter   = sshd-ddos
action   = iptables-allports[name=SSHDDOS]
logpath  = /var/log/messages
maxretry = 2

EOT
    ln -s /usr/bin/fail2ban-client $fs/etc/init.d/fail2ban
    cat > $fs/etc/logrotate.d/fail2ban <<EOT
/var/log/fail2ban.log {
    weekly
    rotate 10
    compress
    postrotate
    /etc/init.d/fail2ban reload >/dev/null || true
    endscript
}
EOT
}
3382 packages and 430813 files in stable database (Mon Mar 4 17:53:49 2019)