summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorsmac892023-10-10 01:10:48 -0600
committersmac892023-10-10 01:10:48 -0600
commit01b618c4f1d92f52b0d3ea8ba4d6adc7112273af (patch)
tree38b98d9ba12d4c8bf521684948a49eb906b99736 /PKGBUILD
downloadaur-01b618c4f1d92f52b0d3ea8ba4d6adc7112273af.tar.gz
create version 1.0.5
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD52
1 files changed, 52 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..ade85e2d2f6f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,52 @@
+# Maintainer: FirstAirBender <noblechuk5 at web dot de>
+pkgname=crowdsec-nginx-bouncer
+pkgver=1.0.5
+pkgrel=1
+pkgdesc="CrowdSec bouncer for Nginx"
+arch=('any')
+url="https://doc.crowdsec.net/docs/bouncers/nginx"
+_giturl="https://github.com/crowdsecurity/cs-nginx-bouncer"
+license=('MIT')
+depends=(
+ 'crowdsec'
+ 'nginx-mainline-mod-lua'
+ 'luajit-openresty'
+ 'lua51'
+ 'luarocks'
+)
+makedepends=(
+ 'gettext'
+)
+backup=(
+ etc/nginx/lua/templates/crowdsec/{ban,captcha}.html
+ etc/nginx/conf.d/crowdsec_nginx.conf
+ etc/crowdsec/bouncers/crowdsec-nginx-bouncer.conf
+)
+install=cs-nginx-bouncer.install
+source=(
+ "$pkgname-$pkgver.tar.gz::${_giturl}/releases/download/v${pkgver}/${pkgname}.tgz"
+ "cs-nginx-bouncer-nginx-module.conf"
+ "cs-nginx-bouncer.install"
+)
+sha256sums=('2bb65903558598fc72c20de512267cbf0759d79f0e038c5a3b8ecf2626470d3f'
+ '48b8356f3652ae766496a28714a661c30c9616c12b9cb39ff75dfa78f4677f99'
+ '6f11751ebbbedcf88ba9a08697b2d33f457caa4c57bf46722a67d2018b568607')
+
+prepare() {
+ cd "$pkgname-v$pkgver"
+ sed -i s:var/lib/crowdsec/lua/templates:etc/nginx/lua/templates/crowdsec: lua-mod/config_example.conf
+ # $prefix see https://openresty-reference.readthedocs.io/en/latest/Directives/#lua_package_path
+ sed -i s:/usr/local/lua/crowdsec/:'$prefix/lua/plugins/crowdsec/': nginx/crowdsec_nginx.conf
+}
+
+package() {
+ cd "$pkgname-v$pkgver"
+ install -dm755 $pkgdir/etc/nginx/lua/plugins/crowdsec/
+ install -dm755 $pkgdir/etc/nginx/lua/templates/crowdsec/
+
+ install -Dm644 {nginx,$pkgdir/etc/nginx/conf.d}/crowdsec_nginx.conf
+ install -Dm644 $srcdir/cs-nginx-bouncer-nginx-module.conf -t $pkgdir/etc/nginx/modules
+ cp -R lua-mod/lib/* $pkgdir/etc/nginx/lua/plugins/crowdsec/
+ cp -R lua-mod/templates/* $pkgdir/etc/nginx/lua/templates/crowdsec/
+ install -Dm600 lua-mod/config_example.conf $pkgdir/etc/crowdsec/bouncers/crowdsec-nginx-bouncer.conf
+}