Support for list of subnets/ips that should be ignored in sophomorix-… #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As previously seen on linuxmuster#172
Changes that make it possible to ... :
... give a list of IPs/networks that should be ignored in sophomorix-query.
... give a "prefered" IP, i.e. one, that will be preferred if there are multiple connections for a user.
The first option is used to block out any servers that open SMB connections on behalf of the user (for example Nextcloud servers) and that should be ignored when determining the user's room.
The second option can be used by the WebUI (PR will follow if/when this PR is accepted) to pass the user's IP address to the script. If a user has a SMB connection from that IP, it will be used for room detection, else it will be ignored.
Notes on the PR:
not sure if I correctly added the dependency on libnetaddr-ip-perl. If not, I'll happily adjust it.
The list of IPs/networks is currently hardcoded to reside within /etc/linuxmuster/sophomorix/sophomorix-query.ignored_nets.txt. It is most likely better pratice to store this in sophomorix_config but I am unsure on how to add it there.
Related links: https://ask.linuxmuster.net/t/konsole-aktueller-raum-durch-nextcloud-irritiert/10438/4
I am not sure if this is helpful at all as I am neither used to write Perl nor skilled in the LMN-coding style. I do hope it is, but sorry if not ...