08 May 2021

If you install RabbitMQ on macOS using Homebrew, you'll ocassionally get a well-intentioned prompt from the system firewall asking if you'd like to accept incoming connections. You will click Accept and go on your merry way, thinking that - like other times you've done this - that that will be the last time you'll have to do that for RabbitMQ. But it won't be. You'll be prompted again, and again, and again. RabbitMQ occasionally changes the socket it uses so you'll get seemingly endless prompts. The documentation spells out the fix. Based on that, here's what I did to make it work on my machine.

#!/usr/bin/env bash 
V=23.2.6
E=/usr/local/Cellar/erlang/$V/lib/erlang/bin
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add $E/erl
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp $E/erl

E=/usr/local/Cellar/erlang/$V/lib/erlang/erts-11.1.8/bin
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add $E/beam.smp
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp $E/beam.smp