wok-6.x annotate fail2ban/receipt @ rev 13197
Up: fail2ban to 0.8.7.1.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Sun Aug 05 11:03:51 2012 +0000 (2012-08-05) |
parents | ad0b23f0fdd8 |
children | 1716dac173ae |
rev | line source |
---|---|
pascal@1809 | 1 # SliTaz package receipt. |
pascal@1809 | 2 |
pascal@1809 | 3 PACKAGE="fail2ban" |
slaxemulator@13197 | 4 VERSION="0.8.7.1" |
pascal@1809 | 5 CATEGORY="network" |
pascal@11341 | 6 SHORT_DESC="Scans log files to bans IP that makes too many password failures." |
pascal@1809 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
slaxemulator@13197 | 8 TARBALL="${PACKAGE}_${VERSION}.orig.tar.gz" |
pascal@1809 | 9 WEB_SITE="http://www.fail2ban.org/wiki/index.php/Main_Page" |
pascal@11341 | 10 DEPENDS="iptables" |
pascal@8940 | 11 BUILD_DEPENDS="python" |
slaxemulator@13197 | 12 WGET_URL="https://github.com/downloads/$PACKAGE/$PACKAGE/$TARBALL" |
jozee@4936 | 13 TAGS="monitor network" |
pascal@11341 | 14 CONFIG_FILES="/etc/fail2ban" |
pascal@1809 | 15 |
pascal@1809 | 16 # Rules to configure and make the package. |
pascal@1809 | 17 compile_rules() |
pascal@1809 | 18 { |
pascal@1809 | 19 cd $src |
pascal@11341 | 20 python setup.py install --root=$DESTDIR |
pascal@1809 | 21 } |
pascal@1809 | 22 |
pascal@1809 | 23 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1809 | 24 genpkg_rules() |
pascal@1809 | 25 { |
slaxemulator@13197 | 26 mkdir -p $fs/etc/logrotate.d $fs/etc/init.d |
slaxemulator@13197 | 27 cp -a $install/* $fs |
slaxemulator@11345 | 28 sed -i -e 's|127.0.0.1|& 192.168.0.0/16|;s|sshd.log|messages|' \ |
pascal@11341 | 29 -e '/ssh-iptables/{nn;s/false/true/}' $fs/etc/fail2ban/jail.conf |
pascal@11341 | 30 cat >> $fs/etc/fail2ban/jail.conf <<EOT |
pascal@11341 | 31 [ssh-ddos] |
pascal@11341 | 32 |
pascal@11341 | 33 enabled = true |
pascal@11341 | 34 port = ssh,sftp |
pascal@11341 | 35 filter = sshd-ddos |
pascal@11341 | 36 action = iptables-allports[name=SSHDDOS] |
pascal@11341 | 37 logpath = /var/log/messages |
pascal@11341 | 38 maxretry = 2 |
pascal@11341 | 39 |
pascal@11341 | 40 EOT |
pascal@11341 | 41 ln -s /usr/bin/fail2ban-client $fs/etc/init.d/fail2ban |
pascal@11341 | 42 cat > $fs/etc/logrotate.d/fail2ban <<EOT |
pascal@11341 | 43 /var/log/fail2ban.log { |
pascal@11341 | 44 weekly |
pascal@11341 | 45 rotate 10 |
pascal@11341 | 46 compress |
pascal@11341 | 47 postrotate |
pascal@11341 | 48 /etc/init.d/fail2ban reload >/dev/null || true |
pascal@11341 | 49 endscript |
pascal@1809 | 50 } |
pascal@11341 | 51 EOT |
pascal@11341 | 52 } |