-
Notifications
You must be signed in to change notification settings - Fork 298
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
Shaarli via proxy: cannot login ('wrong password'). #319
Comments
Hello @Beun! There are several cases in I'll provide you with a patch to add some verbose and see what's going on in the PHP functions so you can rootcause the issue (sometimes during the weekend). In the meantime, could you check if there is any useful information from the server / PHP access and error logs? |
Hi! In the error log ( /var/log/httpd/error_log ) there was a recurring error 'PHP Warning: date_default_timezone_get()', but upon setting the correct timezone in my php.ini, that problem disappeared. Now, while using Shaarli, there are no new errors whatsoever in the error log, not even when getting the 'wrong password' message in the browser while attempting to log in. In the access log ( /var/log/httpd/access_log ) I can see that when I go to Shaarli on its local IP, the local IP of the machine I'm working on shows up in the access log. Now I'm guessing here... But could it be that the password request does not get passed through correctly? Request comes from one IP, and the answer goes to another IP? |
Probably related: if I launch PHP internal server with |
I'm currently cooking a Docker image, and am also facing issues with some pages when performing host-guest port translation:
There may be some checks to perform on how internal URLs are formed in [EDIT] |
Some points:
Some literature:
@Beun could you:
Snippet: <?php
echo '<pre>';
ksort($_SERVER);
print_r($_SERVER);
echo '</pre>';
?> Moreover, Shaarli authentication is logged under |
I uploaded the snippet as testing.php, and what I found was the following: Visiting Shaarli/testing.php on its own local IP, in a browser, [REMOTE_ADDR] shows the physical IP of the machine where I'm using the browser. In both cases [HTTP_HOST] shows the local IP address of the Shaarli. [HTTP_X_FORWARDED_HOST] and [HTTP_X_FORWARDED_SERVER] are only displayed when visiting the the domain name, and both show the correct domain name. [HTTP_CLIENT_IP] I do not see at all. And in data/log.txt there is only login information, like: Thx :) |
@Beun were you successful in logging in through a proxy server? If not, I can try to reproduce this use case with a couple container appliances (though I may not have time till a couple weeks) [EDIT] diggin' a bit through old issues / PRs:
|
I also get a login error with 0.5.2. It did not happen with 0.5.1 (and my workaround is to use 0.5.1). I'm not using a proxy. |
@Beun The session cookie is attached to a domain, which is provided by You need to use the ProxyPassReverseCookieDomain directive.
Note that I had to use the local IP instead of localhost because of this : http://stackoverflow.com/questions/1134290/cookies-on-localhost-with-explicit-domain Let us know if this fixes your issue. I'll add a bit of documentation on this. |
|
See https://github.com/shaarli/Shaarli/wiki/Server-configuration#proxies for the documentation (don't hesitate to add practical examples!) |
Two (completely up to date) CentOS7 VM's:
One is running the latest version of Shaarli. The other one is a proxy.
All is proxied with ProxyPass and ProxyPassReverse. This works just fine for all my other (CentOS) webservers (ownCloud, Piwik, etc.).
The problem: Shaarli with the FQDN (via the proxy) gets displayed alright, but I cannot log in. It keeps saying 'wrong password'.
Shaarli at the local IP: no problem logging in.
After several attempts my IP got banned. In ipbans.php I can see the banned IP is the local IP of my proxy server.
Am I doing something wrong? Have I missed something?
Or am I trying to do something Shaarli can't handle?
Thx.
The text was updated successfully, but these errors were encountered: