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

IP Whitelist? #4

Open
techjp opened this issue Apr 30, 2016 · 7 comments
Open

IP Whitelist? #4

techjp opened this issue Apr 30, 2016 · 7 comments

Comments

@techjp
Copy link

techjp commented Apr 30, 2016

The idea of blacklisting IPs is great and for public YOURLS sites I'm sure very useful. For private sites though an IP whitelist would be super useful. Is this something that would be difficult to add?

@apelly
Copy link

apelly commented May 1, 2016

There is already a plugin for that. Check the YOURLS website for information.

@techjp
Copy link
Author

techjp commented May 1, 2016

Thanks for the reply!

I have looked through the plugin list carefully. Maybe I missed it? Maybe it has been removed?

I see a plugin that will allow certain domains to be whitelisted for shortcuts but not one that allows only certain IPs to access the admin page.

@drbeco
Copy link

drbeco commented Jan 15, 2021

I'm trying to work-around a whitelist by blacklisting ranges and let alone just one IP. But the plugin changes what I write in the list, inverts the values. Maybe I'm doing someting wrong.

Example: suppose you want to whitelist 168.15.16.17. Then I tried the following blacklists:

1.0.0.1-167.255.255.254
169.0.0.1-255.255.255.254

If I finish here, the plugin works fine, but it whitelist all 168.0.0.0 IPs. Now when I try to close the range by blacklisting:

168.0.0.1-168.15.16.16

This first part of the range works. But the last part, don't work:

168.15.16.18-168.255.255.254 (it breaks)

This range, when I save, becomes:

168.255.255.254-168.15.16.18

And blocks all IPs.

Any suggestion on how to make this workaround: block all IPs except a single one.

Thanks

@LudoBoggio
Copy link
Owner

LudoBoggio commented Jan 16, 2021

Hello, Ruben,
Unfortunately, as you can see, I wrote this plug-in more than 8 years ago, and never touched it since. Therefore, I might not be of a great help, I don't even remember my own code.
Please feel free to reverse engineer-the code and make some test. If you provide a correction, I'll be happy to merge your correction, mentioning you properly.
In the mean time, did you try to blacklist 1.0.0.1-168.15.16.16 then 168.15.16.18-255.255.255.254 ?

@LudoBoggio
Copy link
Owner

Checking my code, I guess the mistake might come from function ludo_blacklist_ip_Analyze_IP, line 17, but I don't remember how my comparison is (or not) working.

@drbeco
Copy link

drbeco commented Jan 16, 2021

blacklist 1.0.0.1-168.15.16.16 then 168.15.16.18-255.255.255.254 ?

This was my first attempt. The first part works, but not the second.

@drbeco
Copy link

drbeco commented Jan 16, 2021

Just a wild guess: maybe you are comparing strings, not numbers, and then "11" and "110" comes first than "12" and "120"?

(as I said, it is just a guess)

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

4 participants