Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to exclude subnets #45

Closed
pittbull opened this issue Aug 5, 2024 · 7 comments
Closed

Ability to exclude subnets #45

pittbull opened this issue Aug 5, 2024 · 7 comments

Comments

@pittbull
Copy link

pittbull commented Aug 5, 2024

Hi, just found your tool and must say I allready love it very much. Thank you for the effort.

One question on exclusions: is it much work to enable CIDR notation in the monitoringips.txt file? I am frequently accessing my services via proxy services (work enforced), and I would like to be able to exclude entire subnets.

@smilebasti
Copy link
Owner

Hi, great to hear.

Currently, the monitoringips.txt gets the ips with

elif $monitorfile && grep --line-buffered -qFx $outsideip /monitoringips.txt
. This is just a simple comparison for the same IP. This would require a rewrite of that logic. Currently, i don't have the time for that.
You are welcome to open am Pull request if you know how to implement such thing.

I will leave this issue open for the future and my todo list.

@pittbull
Copy link
Author

pittbull commented Aug 10, 2024

Appreciate the lack of time on your part, so I've done some searching and there exists a command 'grepcidr' which will solve this problem.

Unfortunately the official package does not, but there exists a forked version 3 here which does. Any chance you could update the image with this command? (I downloaded the zip on my labserver and it was no efforts making and installing it)

If so I can create a PR which would add the possibility to use CIDR as well.

@pittbull
Copy link
Author

Compiled the linked package on another machine and made it available to the image. Confirming that the following command will identify the ip both if specified as an ip and in cidr notation:

grepcidr -D ip monitoringips.txt

@pittbull
Copy link
Author

Compiled the linked package on another machine and made it available to the image. Confirming that the following command will identify the ip both if specified as an ip and in cidr notation:

grepcidr -D ip monitoringips.txt

  • Cloned your reposity locally
  • Added grepcidr
  • Changed sendips.sh line 59 to: elif grepcidr -D $outsideip ./monitoringips.txt >> /dev/nul
  • Rebuild image

Success!

@smilebasti
Copy link
Owner

Hi, great to hear.
I would implement it. Would you mind sharing how you compiled grepcidr and made it available to the image?
Never worked with make files.
Thanks

@smilebasti smilebasti reopened this Aug 21, 2024
@pittbull
Copy link
Author

pittbull commented Aug 21, 2024

No worries - not an expert myself. Perhaps I got lucky, but I downloaded it to a temp folder on my server and entered into it and ran "build".

Copy the grepcidr file to the folder with your Dockerfile and add the following to it:

`COPY grepcidr /usr/local/bin/grepcidr

RUN chmod +x /usr/local/bin/grepcidr`

@smilebasti
Copy link
Owner

No worries - not an expert myself. Perhaps I got lucky, but I downloaded it to a temp folder on my server and entered into it and ran "build".

Copy the grepcidr file to the folder with your Dockerfile and add the following to it:

`COPY grepcidr /usr/local/bin/grepcidr

RUN chmod +x /usr/local/bin/grepcidr`

Thanks. Got it to work. Will release it in the coming days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants