dokku / dokku-http-auth

dokku plugin that gives the ability to manage HTTP basic auth for an application
MIT License
84 stars 20 forks source link

Feature: IP Whitelisting #5

Closed nmec closed 2 years ago

nmec commented 7 years ago

Would it be possible to whitelist IPs so users would not need to enter a password? The following would need to be added to the conf:

satisfy any;
allow 80.19.20.149;
allow 230.43.228.9;
deny all;

auth_basic "Restricted";
auth_basic_user_file my-app/htpasswd;
josegonzalez commented 2 years ago

Apologies for the late reply.

That might be cool, but would complicate the plugin quite a bit. I'd rather keep it simple for now.

josegonzalez commented 2 years ago

Note: if someone wants to tackle this, it would be a good idea to use the property-functions to manage the allowed IP list, and also switch to sigil for templating the file out.

josegonzalez commented 2 years ago

Actually I'm just going to do this now since i'm already refactoring the plugin and it's a bit simpler than I expected to implement.

josegonzalez commented 2 years ago

This was implemented as of 0.6.0 of the plugin :)

OscarMeier commented 2 years ago

I'm getting the following error with version 0.6.0 by running dokku plugin:update http-auth && dokku plugin:install:

/var/lib/dokku/plugins/enabled/http-auth/install: line 16: trigger-builder-herokuish-install: command not found

Should'nt the line https://github.com/dokku/dokku-http-auth/blob/master/install#L16 be trigger-http-auth-install "$@"?

josegonzalez commented 2 years ago

Fixed that, thanks for the comment!

OscarMeier commented 2 years ago

Thank you for the quick fix!