-
-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing mealie with Android Firefox leads to 401 on nearly all pages and therefore to an ip ban (fail2ban) #4173
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have this same issue across various browsers & devices. @cyberiuz did you find a solution? |
There are a few auth-only routes in Mealie that don't check if you're logged-in before attempting them. We should only do that if we're logged-in |
As a workaround for now, you can manually disable the nginx-unauthorized jail in your swag container to prevent IPs being banned. You can do this with this command (you may need to replace the container name depending on your docker-compose.yml):
|
Well I created an exception rule for fail2ban for my mealie subdomain, "mobile" and 401 error messages: vim fail2ban/filter.d/nginx-unauthorized.local
Since then I did not have this problem anymore. But of course, this is just a workaround. |
First Check
What is the issue you are experiencing?
I have set up mealie with docker on my webserver.
I use nginx-reverse-proxy with SWAG. It includes fail2ban.
fail2ban has a nginx-unauthorized.conf jail. It is defined by this:
This means, it looks for 401. The 401 error is an HTTP status code indicating the request sent to the website's server lacks valid authentication credentials.
When I access mealie with Android Firefox (without being logged into mealie), I can browse it without problems. I can access recipes, see images.
But nginx/access.log file shows, that nearly every page access returns a 401 error code:
This log contains ten 401 error codes. After those ten 401 errors my ip gets banned by fail2ban.
This is the log that mealie produces:
There we also see those "401 Unauthorized" messages.
If I login first to mealie, then I don't get any 401 errors in the log file.
Also this does not happen with my PC browser (also Firefox).
So the bug is, that mealie should not create 401 error codes, while browsing with Android Firefox and not being logged in.
Steps to Reproduce
see above
Please provide relevant logs
see above
Mealie Version
Version
v1.12.0
Build
0d06494
Deployment
Docker (Linux)
Additional Deployment Details
No response
The text was updated successfully, but these errors were encountered: