NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
23.32k stars 2.7k forks source link

satisfy_any toggle not working #4088

Open mikeymasonic opened 1 month ago

mikeymasonic commented 1 month ago

Checklist

Describe the bug Whenever I set "Satisfy Any" in an access list details section, it doesn't work. For instance if I have an HTTP Auth setup and an IP route, if I access that particular proxy on a whitelisted IP, I get prompted for HTTP authentication. If I go to the proxy with a non whitelisted IP, I get 403 Forbidden and no HTTP Auth prompt. The check box does save the previous saved state however.

I've taken a look at the config files and I notice this near the end:

# Access checks must...

    satisfy all;

If I manually change this to satisfy any;, everything works as expected.

Another unrelated issue, I notice in the GUI I'm on version v2.12.1, but in my docker instance I see: NPM_BUILD_VERSION | 2.11.3

If I login to my docker container I see: Version 2.11.3 (35d7a3a) 2024-07-01 11:42:06 UTC I've pulled the latest image several times.

Nginx Proxy Manager Version

v2.12.1

To Reproduce Steps to reproduce the behavior:

  1. Access Lists
  2. Edit an existing list
  3. Add a valid whitelist ip
  4. Add an HTTP login/password
  5. Ensure Satisfy Any is checked
  6. Save
  7. Try to access proxy with your whitelisted IP, you'll still see an HTTP login
  8. Try to access proxy with non whitelisted IP, you'll get 403 - Forbidden
  9. If you manually change your proxy config file from satisfy all; to satisfy any;, everything works as expected

Expected behavior

Screenshots

Operating System

Using a docker instance on Ubuntu

Additional context

binary-person commented 1 month ago

it seems that rolling back to "2.11.3" fixes it, but updating it to "2.12.0" and "2.12.1" breaks it

Gabri3lZ commented 1 month ago

It looks like the commit 4572b205c912db498706e9a3e8f1891c94129c88 changed some model types from integer to boolean (one of them is the satisfy_any field). But the evaluation still checks for "satisfy_any == 1".

I don't know if this is the only case the evaluation does not match the model type anymore though.

Gabri3lZ commented 1 month ago

Should be fixed by dad8d0c from @chrismaffey

bill340 commented 4 weeks ago

satisfy any is always overwritten to satisfy all in the .conf file after restarting the Nginx container. So the toggle in the GUI and also what I write in the .conf file is not used, but overwritten again...

allenwakeup commented 2 weeks ago

/backend/templates/_access.conf (line 20) change from {% if access_list.satisfy_any == 1 %} to {% if access_list.satisfy_any == 1 or access_list.satisfy_any == true %}

docker v2.12.1

ghisch commented 2 weeks ago

You can temporarily use nginxproxymanager/nginx-proxy-manager-dev:pr-4107 as it was fixed 2W ago in https://github.com/NginxProxyManager/nginx-proxy-manager/pull/4107.

Should be fixed in next release I guess.