Dashboard incorrect number of hosts
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.
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.
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:
- https://github.com/NginxProxyManager/nginx-proxy-manager/blob/e08a4d44901081ea0e8b33d0f865d4fc4a0a1806/frontend/js/app/dashboard/main.js#L54
- https://github.com/NginxProxyManager/nginx-proxy-manager/blob/e08a4d44901081ea0e8b33d0f865d4fc4a0a1806/frontend/js/app/api.js#L724-L726
- https://github.com/NginxProxyManager/nginx-proxy-manager/blob/e08a4d44901081ea0e8b33d0f865d4fc4a0a1806/backend/routes/api/reports.js#L21
- https://github.com/NginxProxyManager/nginx-proxy-manager/blob/e08a4d44901081ea0e8b33d0f865d4fc4a0a1806/backend/internal/report.js#L18
- 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.
Issue is now considered stale. If you want to keep it open, please comment :+1:
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
Issue is now considered stale. If you want to keep it open, please comment :+1:
Same issue, the above suggested change does fix the issue.