Closed (fixed)
Project:
Aegir Hosting Tasks Extra
Version:
7.x-3.x-dev
Component:
Http basic auth
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
6 Oct 2016 at 07:51 UTC
Updated:
9 Mar 2017 at 18:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
helmo commentedHere's a draft which basically works for apache. It needs a few extra lines for nginx ....
Comment #3
helmo 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 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 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 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 commentedThanks for the link, that did a trick! All works now, as far as I am concerned, "Tested and Approved"!
Comment #9
helmo 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 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 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 commentedHmm, that already was in my patch from #2 :( ... now it's gone.
Comment #15
helmo commentedcommitted.