Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.It might be nice to be able to whitelist certain IP's from the basic authentication.
Use cases:
- Allow access from your own ip without the password questions
- When using the Web-based 'Cron method' in a master slave Aegir setup we have to allow the originating hostmaster server access.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | whitelist_ip_s_for-2812853-13.patch | 7.82 KB | helmo |











Comments
Comment #2
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commentedHere's a draft which basically works for apache. It needs a few extra lines for nginx ....
Comment #3
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commented@colan: Is this easy to to in nginx?
Comment #4
colanI haven't had the need to set this up yet, but it looks like it can be done as per Restricting Access with HTTP Basic Authentication.
Comment #5
milovan CreditAttribution: milovan commentedGreat patch, works as expected (on Apache)! Little request if possible, add to description also that adding multiple ip addresses should be separated with one blank space.
Other than that, awesome job, thank you.
Comment #6
milovan CreditAttribution: milovan commentedNot to be picky, but I stumbled on one "design" issue. I wanted to protect local development server, but to allow everyone in local (IP 192.168.1.*) to access site without typing in credentials. So, I tried to use * for wildcard, but that didn't work. When I tried to enter IP addresses of developers' computers, I was faced with field limitation of total characters (around 15 IP addresses can sit in 255 character limit).
Is it possible to either add support for wildcard, or maybe make a list of IP fields (like on server tab)? Or if I am doing something wrong, to please let me know how to achieve it.
Thanks!
Comment #7
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commented192.168.1.0/24 should work in your case.
Have a look at the examples from apache on https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#allow for more options.
Comment #8
milovan CreditAttribution: milovan commentedThanks for the link, that did a trick! All works now, as far as I am concerned, "Tested and Approved"!
Comment #9
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commentedWe could add a small check in the UI to only enable this for Apache installations until the nginx backend is done.
We have `protected $application_name == apache|nginx` in those objects ... but why is it protected?
Comment #10
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commentedFound this while chattign with ergonlogic in irc
drush php-eval "print_r(d('@server_master')->service('http')->config_data()['application_name']);Comment #11
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commentedI've added the check for apache and also a validation hook to limit the input a bit
Comment #12
ergonlogicA few minor style regressions appear to have found their may into the latest patch:
Comment #13
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commentedHmm, that already was in my patch from #2 :( ... now it's gone.
Comment #15
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commentedcommitted.