2022-07-04 13:35:04 +02:00
|
|
|
# Copyright 1999-2022 Gentoo Authors
|
2020-11-24 23:38:08 +01:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2022-09-20 13:33:15 +02:00
|
|
|
EAPI=8
|
2020-11-24 23:38:08 +01:00
|
|
|
|
2024-03-30 02:52:54 +01:00
|
|
|
PYTHON_COMPAT=( python3_{8..12} )
|
2021-06-09 01:15:24 +02:00
|
|
|
inherit python-single-r1
|
|
|
|
|
2020-11-24 23:38:08 +01:00
|
|
|
DESCRIPTION="Script for blocking IP addresses with many concurrent connections"
|
|
|
|
HOMEPAGE="https://gittr.ch/linux/ddos-mitigator"
|
2021-06-09 01:15:24 +02:00
|
|
|
SRC_URI="https://gittr.ch/linux/ddos-mitigator/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
2024-06-12 00:56:18 +02:00
|
|
|
|
|
|
|
S="${WORKDIR}/${PN}"
|
2020-11-24 23:38:08 +01:00
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
SLOT="0"
|
|
|
|
KEYWORDS="~amd64"
|
|
|
|
|
2024-06-12 00:56:18 +02:00
|
|
|
RESTRICT="mirror"
|
|
|
|
|
|
|
|
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
2020-11-24 23:38:08 +01:00
|
|
|
|
|
|
|
RDEPEND="
|
2021-06-09 01:15:24 +02:00
|
|
|
${PYTHON_DEPS}
|
2020-11-24 23:38:08 +01:00
|
|
|
app-admin/sudo
|
2021-06-09 01:15:24 +02:00
|
|
|
$(python_gen_cond_dep '
|
|
|
|
dev-python/geoip2[${PYTHON_USEDEP}]
|
|
|
|
')
|
2020-11-24 23:38:08 +01:00
|
|
|
net-analyzer/fail2ban
|
|
|
|
sys-apps/coreutils
|
|
|
|
sys-apps/grep
|
|
|
|
sys-apps/iproute2
|
|
|
|
sys-apps/moreutils
|
|
|
|
sys-apps/util-linux
|
|
|
|
"
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
dosbin ddos-mitigator.sh
|
|
|
|
dosbin geoip-lookup.py
|
|
|
|
|
|
|
|
insinto /etc
|
|
|
|
doins ddos-mitigator.conf
|
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
ewarn "Please note that you will need a GeoIP2 country- or"
|
|
|
|
ewarn "city-database in order to use this package."
|
|
|
|
elog "It is out of scope for this package to give detailed"
|
|
|
|
elog "instructions on how to install such a database. Just"
|
|
|
|
elog "google it."
|
|
|
|
elog "net-misc/geoipupdate might help, too ..."
|
|
|
|
}
|