-
Notifications
You must be signed in to change notification settings - Fork 58
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
theme issues with https site #251
Comments
Hi @rrossouw01 - I ran into the exact same problem. Not with docker, but with apache2 as reverse proxy and ssl terminator and a little arm box running flatpress on armbian on it. In my setup I workarounded this with giving the apache server on the armbox an snakeoil ssl cert , so the reverse proxy can talk via https with its backend. Far away from a good solution :D When I remember right, in the actual master branch (1.3-dev ) I saw a fix for this problem in the commits? I can search later on for this, maybe i find it , if i saw it right. :) |
@DeltaLima, is the issue with RC1 still valid? |
@rrossouw01 @DeltaLima Thanks for reporting and testing! |
1.3.1 did not work for me. from Maintain > Updates diff below. same change as before.
|
not sure this is much better but I tried instead of above to just set scheme (you have $serverport) to whatever the config is.
|
Hello @rrossouw01, Many thanks for your feedback.
in the line below line 192? Can you please replace lines 189 to 191 with Line 189 in ba890f3
With best regards |
$_SERVER['HTTPS'] is not set. so returns NULL and for $serverport returned http://
|
With both?
and also: |
I copied defaults.php from the repo and tweaked the function a little for my scenario. keep in mind I have not used php in almost 15 years so not good code here just demonstrating what works for me:
|
not sure I understood what you asked. I have to move on to my job now. I can test tonight if you want me to plug anything into the defaults.php. |
@azett Apparently a load balancer @rrossouw01 I will test your variant. Unfortunately, I do not have an environment with a load balancer available for testing. Thank you in advance for testing. |
That did not work for me. I did a slightly more simple version as shown below. I assume that we can always say if $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' it is an LB/PROXY or variant of it. And in my case if local server is NOT https then we should have $serverport true or your function return isHttp as True.
function is_https() {
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' && $_SERVER ['SERVER_PORT'] != 443) {
return True;
} else {
return ( !empty($_SERVER ['HTTPS']) && $_SERVER['HTTPS'] != 'off' or $_SERVER ['SERVER_PORT'] == 443 );
}
}
…________________________________
From: Frank Hochmuth ***@***.***>
Sent: Monday, April 22, 2024 3:19 PM
To: flatpressblog/flatpress ***@***.***>
Cc: Riaan Rossouw ***@***.***>; Mention ***@***.***>
Subject: Re: [flatpressblog/flatpress] theme issues with https site (Issue #251)
@azett<https://github.com/azett> Apparently a load balancer $_SERVER ['HTTPS'] is not defined here.
@rrossouw01<https://github.com/rrossouw01> I will test your variant. Unfortunately, I don't have a load balancer available for testing.
If you have time this evening, please replace lines 189 to 191 as follows:
function is_https() {
//return (isset($_SERVER ['HTTPS']) && ($_SERVER ['HTTPS'] == '1' || strtolower($_SERVER ['HTTPS']) == 'on'));
return (!empty($_SERVER ['HTTPS']) && $_SERVER['HTTPS'] != 'off' or $_SERVER ['SERVER_PORT'] == 443);
}
Then check if there are still theme problems.
With best regards
Frank
—
Reply to this email directly, view it on GitHub<#251 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AL4RLPF3WRMQX3YVRW4V2VTY6VWFXAVCNFSM6AAAAAA2AR2XEWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZQHA4DCNZTHE>.
You are receiving this because you were mentioned.
T
|
Thank you all for testing and fixing! I put it all together in the issue371_httphttps branch. |
Hello everyone, I take the liberty of closing this issue with pleasure #371 (comment). Note: The issue371_httphttps branch has Smarty version 4.3.1, the master branch 4.4.1 (e544ed6). If the path specification in the defaults.php file does not match Smarty, it will lead to a white page during setup. Line 71 in b9b3dd5
Have a good start into the new week |
In case anyone else has this issue. If you run your site on docker and probably kubermetes containers you likely run internal on http and external (load balancer) on https. Flatpress does not pull up any theme like this. So unless there is something more elegant to fix this here is a quick hacky diff in defaults.php to work around it. Probably should detect serverport from the config file not from PHP.
The text was updated successfully, but these errors were encountered: