Package Details: crowdsec-nginx-bouncer 1.1.6-1

Git Clone URL: https://aur.archlinux.org/crowdsec-nginx-bouncer.git (read-only, click to copy)
Package Base: crowdsec-nginx-bouncer
Description: CrowdSec bouncer for Nginx
Upstream URL: https://doc.crowdsec.net/docs/bouncers/nginx
Keywords: bouncer crowdsec
Licenses: MIT
Conflicts: cs-nginx-bouncer
Provides: cs-nginx-bouncer
Replaces: cs-nginx-bouncer
Submitter: FirstAirBender
Maintainer: ChrisTX
Last Packager: ChrisTX
Votes: 6
Popularity: 0.70
First Submitted: 2023-10-10 07:11 (UTC)
Last Updated: 2026-05-06 20:25 (UTC)

Dependencies (8)

Required by (0)

Sources (1)

Latest Comments

1 2 Next › Last »

ChrisTX commented on 2026-04-03 14:50 (UTC)

@FirstAirBender I did document below what I had to change, but I didn't give any instructions because I couldn't.

The luarocks instructions you gave might work for you, but if somebody had installed the dependent Lua packages from AUR beforehand, luarocks in the install script wouldn't do anything, and the instructions you gave would corrupt that package.

This is exactly why orphaned files are such a problem for packaging: pacman -S lua-resty-http && pacman -S crowdsec-nginx-bouncer and pacman -S crowdsec-nginx-bouncer && pacman -S lua-resty-http leave the system in a different state and require different remediation.

As for rebuilding mod-lua: That's not necessary, but it might be for you if you swap luajit-openresty to luajit. mod-lua will warn about this each startup and switching the luajit package requires a rebuild.

Regarding the mod-lua config: That's documented by the package itself, and again, I don't know how a user would have configured this. It's absolutely possible somebody created that file manually and now uninstalling crowdsec-nginx-bouncer would also disable nginx-mod-lua as a side effect. Something it clearly shouldn't be doing. I have asked in the comments for both mod-lua packages about adding such a config file, but that's all I can do.

FirstAirBender commented on 2026-04-03 01:26 (UTC) (edited on 2026-04-03 01:29 (UTC) by FirstAirBender)

@ChrisTX this is absolutely a trash way of upgrading/taking over a package, without bothering to even document how to fix the issues you introduced.

For those affected, here are the steps to take:

  1. remove the luarocks packages:

    sudo luarocks --lua-version=5.1 remove lua-resty-http 0.17.1-0; sudo luarocks --lua-version=5.1 remove lua-cjson 2.1.0.10-1

  2. Do the update now.

  3. Create the file /etc/nginx/modules/cs-nginx-bouncer-nginx-module.conf, with the following:

    load_module /usr/lib/nginx/modules/ndk_http_module.so; load_module /usr/lib/nginx/modules/ngx_http_lua_module.so;

  4. Rebuild the mod-ndk, and mod-lua packages. For me, they were:

    nginx-mainline-mod-ndk nginx-mainline-mod-lua

  5. Check if nginx still works after everything: sudo nginx -t.

  6. Restart nginx

ChrisTX commented on 2026-03-25 20:31 (UTC)

I took the package over, but had to make a number of changes to the package, so you will experience some issues upgrading:

  1. I replaced the luarocks solution with dependencies on the respective AUR packages. A package should never create orphan files, which the luarocks solution does.
  2. The installation of the mod-lua module is gone. Packages should not configure other packages, either the user does this, or the mod-lua packages need changes.
  3. I've made luajit-openresty and the mod-luas optdepends. This allows using the package with regular nginx stable as well. Not using luajit-openresty will cause a warning, but installing it replaces luajit for everything on the system.

The package also cleanly passes namcap now and installs its licence as it's supposed to.

FirstAirBender commented on 2025-09-09 01:25 (UTC) (edited on 2025-09-09 01:26 (UTC) by FirstAirBender)

@mertemba thanks for your comment, and sorry for the overdue response. I've updated the post_install script to include that

mertemba commented on 2025-06-20 10:45 (UTC) (edited on 2025-06-20 10:45 (UTC) by mertemba)

On my machine, the post install script calls luarocks which installs the two dependencies for lua5.4, but nginx uses lua5.1. Thus I had to manually install the dependencies for the used version:

sudo luarocks --lua-version=5.1 install lua-resty-http 0.17.1-0
sudo luarocks --lua-version=5.1 install lua-cjson 2.1.0.10-1

If this is correct, could you please adapt the post install script accordingly?

slip commented on 2023-12-29 01:44 (UTC)

Hmm, I already use nginx-mainline so it was installed from the beginning before I started. Using yay also resulted in the same. luarocks reporting everything under 5.4 but not 5.1 and nginx core dump.

Must just be an issue with my system, so I think I'll leave it at that. Appreciate the input along the way though.

FirstAirBender commented on 2023-12-29 01:25 (UTC) (edited on 2023-12-29 01:38 (UTC) by FirstAirBender)

@slip The dependencies were not found with makepkg because it tries to resolve deps using pacman, but those deps are in the AUR. I don't know how paru works, but yay has a -B option, which if combined with -i, allows you to build a local PKGBUILD. So yay -Bi . is the command to use. If paru has something similar, please use that.

As for the conflicts you're facing, I tried it myself, and I see the issue. The problem seems to be that the install process wants to install nginx before nginx-mainline. The solution I found is to install nginx-mainline first, and then proceed with the rest of the installation.

slip commented on 2023-12-29 01:22 (UTC)

I came back today to look a little more into it. Running luarocks --lua-version=5.4 list shows both the lua modules installed. Everything in the dump shows that it's looking for 5.1, so maybe it's a path issue?

slip commented on 2023-12-28 01:20 (UTC)

@FirstAirBender, I went back to try again after completely removing the package and its dependencies. I do recall getting the conflict in paru the first time around earlier today. I opted to let it replace luajit with luajit-openresty and the build failed. Running it with paru immediately after will complete the install process due to luajit-openresty now being installed. I assume it's because in paru's order, nginx-mainline-mod-lua is called before luajit-openresty, and it has luajit as a dependency and therefore creates the conflict. Just a guess though.

Ignoring that route, I also tried building it with makepkg. I cloned the package, ran makepkg -sir and it instantly quit out with errors about dependencies.

Here's a link to both install logs. The makepkg run is first and then starting on line 25 is the paru output. Hopefully these are legitimate errors and not just something I'm doing wrong.

https://pastes.io/jdwdj9ln0b

slip commented on 2023-12-27 22:59 (UTC)

Okay, that's good to know. Initially I used paru, but also built it directly with makepkg as a sanity check earlier. I'll attempt it again. Thanks.