Closed Niduroki closed 3 years ago
+1
Yes unless @LeoColomb says otherwise I think this should go to YOURLS/docker-yourls
I confirm the issue, but not sure it's really related to Docker though.
The HTTP answer does not contain body, headers seem to be fine (cookies set):
HTTP/1.1 200 OK
Date: Wed, 24 Feb 2021 01:07:59 GMT
Server: Apache/2.4.38 (Debian)
X-Powered-By: PHP/8.0.2
Set-Cookie: yourls_8067cb0a05586cfc4567539da63ded94=a0bd396d5dead373021ffcfe260e25e0; expires=Wed, 03-Mar-2021 01:07:59 GMT; Max-Age=604800; path=/; domain=ip172-18-0-92-c0qq2v1bqvp0008tb240-8080.direct.labs.play-with-docker.com; HttpOnly; SameSite=Lax
Content-Length: 0
Keep-Alive: timeout=5, max=93
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
Honestly I don't know... What would run differently in the docker environment? I was maybe suspecting a cookie thing but it seems to be correctly stored.
So, if we narrow the problem to being caused by YOURLS_PRIVATE = true, the thing is : files includes/auth.php
or includes/functions-auth.php
haven't changed between 1.7.9 and 1.8... (except for a function that was moved in from another file)
Sorry, I'm lost here
It's a problem with the docker image, pretty certain of that. I changed the image in the docker-compose file above to 1.7.9 and then did a very silly update:
[root@Alice git]# docker-compose -f dco.yml up -d
Building with native build. […]
Creating network "git_default" with the default driver
Creating git_mysql_1 ... done
Creating git_yourls_1 ... done
[root@Alice git]# docker exec -it git_yourls_1 bash
root@725293abf232:/var/www/html# cp user/config.php ~/
root@725293abf232:/var/www/html# cd ..
root@725293abf232:/var/www# rm -rf html
root@725293abf232:/var/www# apt-get update && apt-get install git
[…]
root@725293abf232:/var/www# cp ~/config.php html/user/
root@725293abf232:/var/www# cd html/
root@725293abf232:/var/www/html# git checkout 1.8
Note: checking out '1.8'.
You are in 'detached HEAD' state. […]
HEAD is now at a280e37 Update CHANGELOG.md
root@725293abf232:/var/www/html#
after which it works perfectly fine. Might try a git bisect later this week.
Guessing this should be moved to yourls/docker-yourls then?
See https://github.com/YOURLS/docker-yourls/issues/64 Also includes a git-bisect, because it's later this week already, I suppose?
Copy-pasting the git bisect into here, since we're continuing here, sorry.
[root@Alice docker-yourls]# git bisect good
3b766d46bd627ce788a307de7805184b7830ab71 is the first bad commit
commit 3b766d46bd627ce788a307de7805184b7830ab71
Author: Léo Colombaro <git@colombaro.fr>
Date: Mon Feb 22 19:30:48 2021 +0100
Move ENV_FILE usage to config file
Ref https://github.com/docker-library/official-images/pull/9068#issuecomment-725748134
apache/config-docker.php | 25 ++++++++++++++++++-------
apache/docker-entrypoint.sh | 30 ------------------------------
config-docker.php | 25 ++++++++++++++++++-------
docker-entrypoint.sh | 30 ------------------------------
fpm-alpine/config-docker.php | 25 ++++++++++++++++++-------
fpm-alpine/docker-entrypoint.sh | 30 ------------------------------
fpm/config-docker.php | 25 ++++++++++++++++++-------
fpm/docker-entrypoint.sh | 30 ------------------------------
8 files changed, 72 insertions(+), 148 deletions(-)
[root@Alice docker-yourls]#
Nice Link: https://github.com/YOURLS/docker-yourls/commit/3b766d46bd627ce788a307de7805184b7830ab71 is the first bad commit
Started at https://github.com/YOURLS/docker-yourls/commit/72f24c9b782ddf3f5c694e5461ba03330124463e = Good ended at master = bad. I made sure
ENV YOURLS_VERSION 1.8
ENV YOURLS_SHA256 76c6db3b37a9c9f2570d280dce03b0fc34cd690767af77a2aed2cb2fbbaf546f
is used in every revision, and then built a apache image for each revision, naming it something like bisect-3b76
and testing it via the docker-compose file from the yourls#2845 issue whether it's good or bad.
@Niduroki Please don't duplicate the case.
Same problem for me here on 1.8, tried fixing it for over an hour, but unfortunately couldn't.
Same issue...At first I tought that something wrong with my nginx or cloudflare and had a lot of try to solve it. When I found this issue, I tried 1.7.9 and it worked :( Hope you guys can fix it.
+1 here - upgraded from 1.7.9 to 1.8 and I get a white screen on admin/upgrade.php and nothing in the logs Moving back to 1.7.9 works.
I found the line causing the error in a docker environment :
$hash = yourls_hash_passwords_now( YOURLS_CONFIGFILE );
https://github.com/YOURLS/YOURLS/blob/5dde5a93f181cfbde3e6fa343a6cb668a1071a5e/includes/auth.php#L45require $config_file;
.
https://github.com/YOURLS/YOURLS/blob/5dde5a93f181cfbde3e6fa343a6cb668a1071a5e/includes/functions-auth.php#L175YOURLS_CONFIGFILE
being NULL
, it's the require NULL
that breaks everything(Oddly enough, first checking if the file to require()
is either is_readable()
or is_writable()
doesn't suffice.)
Now, this file and this require()
line hasn't changed during the last 8 years so it's obviously something related to recent changes in the docker image. I'm not familiar enough with the docker image to pinpoint what changed and is causing this... @LeoColomb ? :)
@ozh Ah, cool, I was about to start a debug-night 😉. Main change is PHP 8.
I'll check permission at installation.
👍
Thanks @LeoColomb
This said, why wouldn't
be enough to prevent this?
@ozh The mentioned lines are "just" checking file permissions. The issue here was the function declared twice, the file itself (= raw content) is readable and writable. 🙂
I can see this issue is closed but I don't believe it's been published to Docker Hub. Any idea when a fix for this may be available for download?
Yup, waiting for @ozh to publish a release 😉
Not forgotten, I promise :) Will be done tomorrow, or by the end of the week (there's one remaining issue I want to investigate before pushing 1.8.1)
Describe the bug White screen with 1.8 using docker.
To Reproduce 1) docker-compose file:
2)
docker-compose -f docker-compose.yml up
3) Go to http://127.0.0.1:8080/admin, click install, click "YOURLS Administration Page" 4) White screen. Even the debug setting doesn't give any output. 5) Clear cookies, log in again: White screen.Versions Docker Image 1.8-apache
Same problem also appears to happen on my server:
Additional context It's something to do with the authentication. If you add
YOURLS_PRIVATE: "false"
to the yourls environment variables everything works as expected (without password-protection, that is).Is this maybe a docker problem to report over at https://github.com/YOURLS/docker-yourls ?