-
Notifications
You must be signed in to change notification settings - Fork 36
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
(Status: error) for site behind Authelia #68
Comments
Looks like this is because the HEAD method is returning a 405 Method Not Allowed. |
Asking on Authelia's repo: authelia/authelia#4998 |
Yep essentially 4xx or 5xx HTTP response codes are considered down, as per the underlying guzzle library. When I am able I do plan on adding some more options to the status checking feature, maybe an alternate URL or as you suggest a list of acceptable responses. Thanks for reaching out, keep me posted on the response from authelia 😀 |
@daledavies Seems like the easiest approach (for here anyway) would be a way to override the request type per site. So, something like
|
@daledavies Don't suppose you want to add to the discussion? |
Based on the discussion, it sounds like maybe the best thing to do is to allow the list of acceptable responses while also allowing a specification of if redirects should be followed? From my viewpoint, if the site is returning a 303 See Other, it's up for my use case. That's much more simplistic than actually allowing full authentication to be able to get into the site. |
Yes this feature was only intended to be a simple status check, I'm not going to implement authentication and passing a request body etc. I'm happy to implement additional request methods and a list of acceptable response codes if I can though. One other thing though, I had set the gizzle client options to allow redirects, so this shouldn't be a problem. |
Aside from this, would an alternate status URL help too? I think it might be beneficial for some cases. |
@daledavies I do think that would help - being able to point to one place for the link and another for the status could let me try to set up a health check endpoint that's not protected by authentication. |
I'll see about implementing all the above then :) |
I've added a change to allow for per-site status options as discussed above. I'll push a new release of Jump soon but just want to look at a few other issues first. |
This has been included in the latest v1.3.1 release today, you can pull this from Docker Hub using either the Thanks for reporting this, I'll close the issue for now but feel free to repoen or open a new one if needed :) |
@daledavies Trying to test this - I added |
There aren't any verbose logs specific to the status checking, you'll get a mixture of nginx and php logs via Other than that remember docker has its own internal network so the true test would be to exec into the jump container and curl from there, if you haven't already. |
I've reopened this issue until we get this sorted, I appreciate your persistence 😀 |
Relevant bits:
EDIT: From inside the Jump container. |
All my testing suggests that Jump correctly sends a GET request and also follows redirects, the status returned is from the final destination. I think though that by default guzzle will only follow 5 redirects so that could possibly be your problem. Could you test with curl like before, but also paste the location header rather than the response body? |
It might also help if I set guzzle to add the referrer when redirecting, by default it does not and this works for everything I've tested with, but maybe authelia needs it. |
While testing with curl you could also tell it to follow redirects and limit the number to 5, will make it similar to what guzzle is joing in Jump...
|
I've pushed an image to Docker Hub you can test with, it should give some more information in Could you pull daledavies/jump:redirecttest and give it a spin? :) |
So, this is interesting. Here's it with curl, which looks right:
Here's are the PHP errors from the docker logs:
So the app is seeing a 401 instead of the 302. Trying with |
That's working! Edit: So nice to see greens across the board. |
Interesting, glad it's working for you. Out of interest can you share your full sites.json file? That first error is unrelated to this problem but I'm intrigued what caused it. |
|
Perhaps a 401 might be correct, in terms of the request being unauthorized. Also some differences between the curl and what Jump is doing, Curl wil be using the GET method where your configuration for Jump means it will use the default HEAD method for the request. It looks like Authelia have implemented something to handle HEAD requests, but maybe they might respond differently depending on the request method. |
If I do it with a HEAD request, I get:
So still don't really know where the 401 comes from. |
If you we're not seeing anything in Jump's logs referring to I'm trying to think why this might be. I've done some testing with guzzle in Jump and can see there are two differences in the request headers sent by Jump... guzzle doesn't set the Anyway I can't help thinking that we might gain some insight from Authelia's own logs, can you see anything relevant in those when you do the curl vs Jump test? |
@cinderblockgames Did you find anything in the Authelia logs? |
I haven't had a chance, but I'll try to look this week. |
Does the site redirecting for authentication keep jump from being able to pick up that the site is up? I feel like 2XX and 3XX should be considered up, 4XX and 5XX considered down. (Or maybe have the ability to specify which status codes are considered up?)
The text was updated successfully, but these errors were encountered: