nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

Dashboard incorrect number of hosts

Open MrAlfabet opened this issue 2 years ago • 5 comments

Describe the bug Dashboard displays the wrong number of hosts

Nginx Proxy Manager Version 2.10.3

To Reproduce Create hosts as user X Create user Y Login as user Y

Expected behavior Same number of hosts displayed for both accounts on the dashboard

Exactly this bug: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1679 But I managed to replicate it.

MrAlfabet avatar Aug 16 '23 15:08 MrAlfabet

I confirm with 2.10.4: Items created with different users are not counted on the dashboard page, bit are manageable from the specfic pages.

gabviv73 avatar Nov 23 '23 10:11 gabviv73

I successfully recreated this issue by creating Proxy Hosts with a different user. I believe the count is only for proxy hosts (in my case) created by the current user. If I create a new host with my current user the count increases.

If you follow the chain:

  1. https://github.com/NginxProxyManager/nginx-proxy-manager/blob/e08a4d44901081ea0e8b33d0f865d4fc4a0a1806/frontend/js/app/dashboard/main.js#L54
  2. https://github.com/NginxProxyManager/nginx-proxy-manager/blob/e08a4d44901081ea0e8b33d0f865d4fc4a0a1806/frontend/js/app/api.js#L724-L726
  3. https://github.com/NginxProxyManager/nginx-proxy-manager/blob/e08a4d44901081ea0e8b33d0f865d4fc4a0a1806/backend/routes/api/reports.js#L21
  4. https://github.com/NginxProxyManager/nginx-proxy-manager/blob/e08a4d44901081ea0e8b33d0f865d4fc4a0a1806/backend/internal/report.js#L18
  5. https://github.com/NginxProxyManager/nginx-proxy-manager/blob/e08a4d44901081ea0e8b33d0f865d4fc4a0a1806/backend/internal/proxy-host.js#L448-L461

It looks like the visibility flag is not sent properly from the frontend call? The backend query is looking for

if (visibility !== 'all') {
	query.andWhere('owner_user_id', user_id);
}

So it is limiting the count to only the active user.

blockloop avatar Dec 18 '23 20:12 blockloop

Issue is now considered stale. If you want to keep it open, please comment :+1:

github-actions[bot] avatar Jul 21 '24 01:07 github-actions[bot]

you can change this line: if (visibility !== 'all') { query.andWhere('owner_user_id', user_id); }

to: if (visibility && visibility !== 'all') { query.andWhere('owner_user_id', user_id); }

inject it with a volume mapping via docker compose like this for testing: volumes:

  • ./proxy-host.js:/app/internal/proxy-host.js:ro

jasp106 avatar Jul 23 '24 09:07 jasp106

Issue is now considered stale. If you want to keep it open, please comment :+1:

github-actions[bot] avatar Jun 05 '25 02:06 github-actions[bot]

Same issue, the above suggested change does fix the issue.

jotremb avatar Jul 09 '25 17:07 jotremb