opnsense / plugins

OPNsense plugin collection
https://opnsense.org/
BSD 2-Clause "Simplified" License
849 stars 644 forks source link

mDNS Repeater plugin: Enable blocklist parameter in the gui to allow blocking subnets. #4362

Open Kodehyrden opened 5 days ago

Kodehyrden commented 5 days ago

This pull request should mitigate the problem described in this forum post: https://forum.opnsense.org/index.php?topic=44083.0

It will allow the user to add a subnet to be blocked by the mDNS Repeater. The parameter is already available in the program itself.

This is my very first commit to this repository. Comments are very much welcome. FYI I have also mailed Franz Fabian, maintainer of the mDNS Repeater plugin for OPNsense.

Monviech commented 4 days ago

https://github.com/geekman/mdns-repeater/releases/tag/1.11

It says here that it supports 16 addresses in a blocklist. Why is it limited to 1 in the PR?

Kodehyrden commented 1 day ago

Monviech, first of all, please accept my apologies for the work I have push on you regarding this pull request. I honestly thought it was a lot easier than expected. I have now created a virtual dev environment on my promox. I have installed the modified plugin and it appears now to be working. I did however also realize that changes needs to be made to mens-repeater port. It needs to support black list on the command line as well. I have med the changes, and will create a PR for the ports repository anytime soon. This PR is dependent on acceptance on the ports pull request.

Monviech commented 1 day ago

Yeah some things that seem easy can become quite complicated, we're all learning every day. :)

What do you mean you have to do a PR in ports? The ports are mostly synchronized from upstream. Can you explain what exactly you need that is not working right now?

Kodehyrden commented 1 day ago

The command line for the mens-repeater need to support blacklists. This is the PR: Support blacklist on the commandline #208

Kodehyrden commented 1 day ago

You're right. Since the code is pulled from https://github.com/kennylevinsen/mdns-repeater/ I will make the pull request here instead. I have deleted my pull request to the ports repository. Oh-my...

Monviech commented 1 day ago

Its okay, one step at a time. If you have questions don't be afraid to ask.

Kodehyrden commented 1 day ago

It actually turns out that this particular change is not possible to make upstream. Hence the PR for the opnsense ports collection is uphold.

Monviech commented 1 day ago

The .in file comes from a different upstream, the FreeBSD ports. They only have a copy on github, the real place to patch that file is in their bugzilla.

Before going that long hard route, I would try if you can script your way around in the jinja template to construct all parameters you need into the existing variable.

(if possible, don't take my advice here 100% serious I do not know any better, did not look at it too deeply)

Kodehyrden commented 18 hours ago

PR closed in ports collection. Jinja script mods to support blacklist using existing env variable.