yourls / images Goto Github PK
View Code? Open in Web Editor NEW📦 Container Images for YOURLS
Home Page: https://yourls.org
License: MIT License
📦 Container Images for YOURLS
Home Page: https://yourls.org
License: MIT License
Hi
Can you add some help about how to reverse proxy it with Apache?
thanks
See https://github.com/YOURLS/YOURLS/issues/2845
Apparently it's "later this week" already, here's a git bisect:
[root@Alice docker-yourls]# git bisect good
3b766d46bd627ce788a307de7805184b7830ab71 is the first bad commit
commit 3b766d46bd627ce788a307de7805184b7830ab71
Author: Léo Colombaro <[email protected]>
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: 3b766d4 is the first bad commit
Started at 72f24c9 = 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.
When using the YOURLS Docker container via Helm chart, there seems to be no way to automatically include plugin configuration. Only a list of pre-defined env vars are supported, adding more requires replacing the config-docker.php file.
Automatic inclusion of additional config files in a well-known location would allow for easy deployment of plugin-enhanced containers via extra volume mounts.
Automatic container deployment via Kubernetes (i.e. via Helm) is becoming more typical. When doing this, the typical way to specify configuration is via environment variables or by mapping "files" to well-known locations inside the container.
The YOURLS container already has (basic) support for this, for a number of well-known env vars drawn in by config-docker.php. But adding additional configuration requires replacing that file (which can be done via above mapping mechanism).
A more elegant version might be to automatically pull in extra config files (one or more files for each plug-in, via Kubernetes' file mapping ("secret"/"configmap") from config-docker.php. This way, per-plugin configuration is made possible, including re-use of the "get values from Docker env" mechanism already available in config-docker.php
foreach ( glob( "/var/www/html/user/plugins/config.d/*.php") as $pluginconfig) {
include $pluginconfig
}
at the end of the file, to include the config files from above well-known location.
Describe the bug
When using MySQL 8, these error message appears when trying to run the docker image.
Warning: mysqli::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] in Standard input code on line 17
Warning: mysqli::__construct(): (HY000/2054): The server requested authentication method unknown to the client in Standard input code on line 17
MySQL Connection Error: (2054) The server requested authentication method unknown to the client
It turns out that the image YOURLS uses PHP version 7.2, which the mysql client didn't support caching_sha2_password
yet. And according to this stackoverflow, it says that PHP version 7.4 fixes that. And it does fix this when I upgrade it to 7.4. So... time to upgrade the PHP I guess?
The image runs fine however when I'm using MySQL 5.7.
To Reproduce
Here just use this docker compose to reproduce
version: '3.1'
services:
yourls:
image: yourls
restart: always
ports:
- 8000:80
environment:
YOURLS_DB_PASS: example
YOURLS_SITE: http://127.0.0.1:8000
YOURLS_USER: example_username
YOURLS_PASS: example_password
mysql:
image: mysql:8
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
Expected behavior
Runs normally
Actual behavior
Failed to boot
Versions
Tested on these docker image tags :
Additional Context
If upgrading php 7.4 is fine, I can do pull request if you want 🙂
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Go to https://hub.docker.com/_/yourls
Find stack.yml demo section
Deploy to PWD
Expected behavior
Yourls should be deployed to play with docker
Actual behavior
Configuration broken or not working
Screenshots
If applicable, add screenshots to help explain your problem.
Versions
tag: latest
Additional context
Any additional information, configuration or data that might be necessary to reproduce the issue.
Super low priority issue : the YOURLS logo at https://hub.docker.com/_/yourls is an old pixelated one, it should be replaced with https://github.com/YOURLS/YOURLS/blob/master/images/yourls-logo.svg
Hi,
.htaccess file is missing in all images resulting in 404 in redirects. I had to copy it manually to get it work.
In addition, I got invalid gateway error in all images except apache which works fine.
thanks.
Having just built and tested this repo, it is my pleasure to report that this project just works on ARM64v8.
I would be happy to send a pull-request enabling it in Docker Images - with your blessing of course.
Hi, I was wondering, is this docker vulnerable to CVE-2019-11043?
It looks like PHP 7.3.11 patches it (released today). As well as a few nginx config changes. Nextcloud wrote up a good article about the issue as well as fixes for it: https://nextcloud.com/blog/urgent-security-issue-in-nginx-php-fpm/
I just wanted to make sure YOURLS isn't also vulnerable. This wouldn't be a bug in YOURLs necessarily but rather the way the container is setup (I haven't had time to investigate myself yet).
Thanks!
Summary
In a regular yourls there is a plugins which allows the admin to define TZ based offset.
Like America/Los_Angeles etc...:
https://github.com/YOURLS/timezones
Can it be added into the docker image?
The basic OFFSET Hours doesn't work for places which have summer and winter time.
I was thinking of creating a separate Docker container image.
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.4. Set the 'ServerName' directive globally to suppress this message
1.8.2
I was running 1.8.1 as docker container hosted on a Synology NAS without any issues.
After the update to 1.8.2 (downloaded new image "latest" and made a container reset with the new image)
I get the following error log in the console:
Warning: Undefined array key 1 in Standard input code on line 8
[Tue Sep 07 12:36:07.003192 2021] [:crit] [pid 1] (38)Function not implemented: AH00141: Could not initialize random number generator
Usually I just reset and restart the container with the new version and all systems are up and running.
No response
Host is running DSM 7.0-41890
DB is external
1.8.2
Due to the way in which environment variables are read within the user/config.php
file (here), any environment variables which are set to falsey values will cause the value to be overwritten by the default value.
One area where this has known to cause a problem is with the YOURLS_DB_PREFIX
variable, since it makes it impossible to set the prefix to an empty string (i.e. no prefix).
Environment variables should support falsy values.
docker run --name some-yourls --link some-mysql:mysql \
-e YOURLS_SITE="http://localhost:8080" \
-e YOURLS_USER="example_username" \
-e YOURLS_PASS="example_password" \
-e YOURLS_DB_PREFIX="" \
-d yourls
No response
Describe the bug
I'm using the change password plugin, along with YOURLS in a Docker container and /var/www/html/user
mapped to a directory on the host. The plugin is updating config.php with the new user's password but logging out and logging back in still references the old password. The container has to be stopped and started to get the new password to work.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
YOURLS should be re-reading the config.php file.
Actual behavior
It appears that YOURLS only reads the config.php file upon startup and never again.
Versions
Latest YOURLS Docker container with the change password plugin installed on the host under the plugins directory.
Hello!
Summary
Our installation of short link must serve about 1,1 millions of links per month.
I see big log table after stress testing.
I decide disable stats in db to decrease heavy load.
Describe the solution you'd like
In basic yourls config we may set this option, https://github.com/YOURLS/YOURLS/blob/master/includes/Config/Config.php#L196-L198, but in docker image - not.
I want to configure this option by environment variable.
Describe the bug
White screen with 1.8 using docker.
To Reproduce
version: '3.1'
services:
yourls:
image: yourls:1.8
restart: always
ports:
- 8080:80
environment:
YOURLS_DB_PASS: example
YOURLS_SITE: http://127.0.0.1:8080
YOURLS_USER: user
YOURLS_PASS: pass
YOURLS_DEBUG: "true"
mysql:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
docker-compose -f docker-compose.yml up
Versions
Docker Image 1.8-apache
$ docker system info
…
Server Version: 20.10.3
…
Kernel Version: 5.10.16-arch1-1
Operating System: Arch Linux
…
Same problem also appears to happen on my server:
$ docker system info
…
Server Version: 19.03.13
…
Kernel Version: 5.10.16-200.fc33.x86_64
Operating System: Fedora 33 (Thirty Three)
…
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 ?
Please add support for setting YOURLS_FLOOD_DELAY_SECONDS in config-docker.php via an environment variable. Thanks!
Settings the environment variable YOURLS_TABLE_PREFIX via docker has no impact on the container. It always defaults to 'yourls_' as the table prefix. I also tried setting an environment variable for YOURLS_DB_PREFIX (matching what is in the sample config file in case the docker container documentation is incorrect) and it works as expected.
Running YOURLS v1.7.6 via https://hub.docker.com/_/yourls/
Hi Guys
Im have some issues with My NGINX config.
Im getting this error in the YOURLS log
Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
Im running on Unraid and using the letsencrypt docker that contains NGINX. This is my config
`server {
listen 443 ssl;
listen [::]:443 ssl;
server_name url.*;
include /config/nginx/ssl.conf;
client_max_body_size 0;
root /config/www/YOURLS;
index index.php index.html index.htm;
# enable for ldap auth, fill in ldap details in ldap.conf
#include /config/nginx/ldap.conf;
location / {
# enable the next two lines for http auth
#auth_basic "Restricted";
#auth_basic_user_file /config/nginx/.htpasswd;
# enable the next two lines for ldap auth
#auth_request /auth;
include /etc/nginx/fastcgi_params;
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_unraid url;
proxy_pass http://192.168.86.41:8088;
}
}`
Im getting this issue when I try my shortened links. I get the Forbidden page.
Can anyone help please?
Hello all,
I run YOURLS on a Raspberry Pi 4 with buster and this docker image.
after installing and running the image I got this issue:
Fatal error: Uncaught RuntimeException: The gmp or bcmath extension must be installed to read
this database.
in /var/www/html/includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Decoder.php:295 ...
Enter into the container:
docker exec -it <YOURLS-Container-Name> /bin/bash
Enter
docker-php-ext-install bcmath
Stop and Restart the Container docker stop ...
and docker start ...
Can you please insert the needed php module into the docker image?
best regards
Chris
1.8.2
After setting up my docker instance of yourls using the standard image, i used it for a while.
Subsequently, i recreated the docker containers (docker-compose down && docker-compose up -d
) and surprisingly, my yourls instance had not persisted.
All the data that i had created was gone and i was back to a fresh instance(install page) !
Does the official docker-compose.yml
not include persistent volumes by default?
If not, what needs to be done to make sure it does?
No response
No response
No response
Describe the bug
I'm migrating from running YOURLS directly on a server to running within a Docker container. I'm using the official YOURLS container but volume-mounting a host directory to /var/www/html/user
in a variant of the advice given in #16.
I've got the $yourls_user_passwords
array defined. When I log on as a newly added admin, YOURLS reports:
Could not auto-encrypt passwords. Error was: "preg_replace problem".
If l look at the config file, though, the password has been encrypted.
I'm honestly not sure if this is a general YOURLS problem or specific to Dockerised YOURLs. Also, this only seems to happen during the browser session that the password is initially encrypted.
To Reproduce
Steps to reproduce the behavior:
/var/www/html/user
.$yourls_user_passwords
and restart the container.Expected behavior
YOURLS refresh the admin display without error.
Actual behavior
The message provided above is displayed. Nothing is given in the output from the container to assist.
Versions
YOURLS Docker container - YOURLS version 1.7.4
Allow aliases, 1.0
Auth Manager Plus, 1.0.5
Update Shortened URL, 0.2.3
The example stack.yml file does not work. You need to give all env vars, as they do not seem to switch to default. Here's a working example:
version: '3.1'
services:
yourls:
image: yourls
restart: always
ports:
- 8080:80
environment:
YOURLS_DB_HOST: mysql
YOURLS_DB_USER: root
YOURLS_DB_PASS: example
YOURLS_DB_NAME: yourls
YOURLS_SITE: https://example.com
mysql:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_ROOT_HOST: '%'
I created a docker-compose.yml based on yours which is available here: https://hub.docker.com/_/yourls
however, it does not have a volume, the data is stored in mysql, but because it does not have a permanent volume, because if you restart the container, you lose all information.
There is no persistent volume, if the containers are destroyed where will the data go?
No response
1.9.1
We are creating our own image using the base image yourls:1.9-apache
.
We have added a custom shell script as our entry point that do the following:
docker-entrypoint
the entry point for base imageWe have a job that check dockerfile and image for vulnerabilities, and we need to set a user inside the dockerfile since it is not recommended to use root user in the container.
Installation of yourls should be using root user and after done we should be able to set a user with non root permissions.
yourls:1.9-apache
.www-data
Installation of yourls will not be possible due to the error Cannot mkdir: No space left on device
No response
It is currently impossible to setup docker-yourls behind a proxy, using a path:
http://domain/path -> PROXY -> DOCKER_YOURLS
Sample proxy conf:
<Location "/path/">
ProxyPass http://localhost:8080/
ProxyPassReverse http://localhost:8080/
<Location>
The README file doesn't mention how to specify the username and password.
You need to set YOURLS_USER
and YOURLS_PASS
, in addition to YOURLS_SITE
(which is mentioned).
Describe the bug
I use your docker images and docker-compose to start yourls app. I just copy your yml cofings then to start it. But the logs tell me MySQL Connection Error: (1045) Access denied for user 'root'@'172.19.0.2' (using password: YES)
, is there some thing wrong with your demo configs?
version: "3.1"
services:
yourls:
image: yourls
restart: always
ports:
- 53080:80
environment:
YOURLS_DB_PASS: dfwHGud736H
YOURLS_SITE: https://dwz.xxxxx.com
YOURLS_USER: fdey273Hueb
YOURLS_PASS: 284hdY2fe892
mysql:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: djwu28w36svsyw82gs7
To Reproduce
Expected behavior
Actual behavior
Screenshots
Versions
You can get this information from referencing CHANGELOG.md
or the releases page.
Also, please include:
Additional context
latest
inserting a password with "&" in the "YOURLS_PASS" as environment variable messes up the config file
yourls_user_passwords = [
'user' => 'passwordwithoutand getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),',
];
i guess the & is actually interpreted
set password YOURLS_PASS = sjkdhaadjsk&
should be fixed/escaped
1.8.2
I noticed that the fix 4fe274d is not present in the image I pulled from dockerhub docker pull yourls:1.8.2
, but it is present in the image I pulled from github registry docker pull ghcr.io/yourls/yourls:1.8.2
.
Docker shows "updated 5 days ago" (20.11.2021), Github shows "updated 6 days ago". The fix was integrated 26 days ago so it should be present in both images.
I have not looked into how the images are created or deployed, so I have no idea about the reason for this discrepancy.
I expect that images on Github and Dockerhub have the same content.
To see that both images are not the same:
docker run yourls:1.8.2
shows the error message "chown: cannot access 'wp-config.php': No such file or directory"
docker run ghcr.io/yourls/yourls:1.8.2
does not show the error message.
No response
Summary
Configure YOURLS_ADMIN_SSL inside a container
Motivation
HTTPS everywhere
Describe the solution you'd like
some config file edits
Describe alternatives you've considered
Rolling my own image
Hi All,
While deploying the latest YOURLS image. We are getting below error.
root@sahilhans-VirtualBox:~# docker logs 703491dc3020d62b0363f9b056a930e2b4cf1911e7cd1325b844c0b9469ad215
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Feb 01 16:29:27.922061 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.14 configured -- resuming normal operations
[Fri Feb 01 16:29:27.924843 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
**[Fri Feb 01 16:32:41.716464 2019] [autoindex:error] [pid 31] [client 127.0.0.1:60106] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive**
127.0.0.1 - - [01/Feb/2019:16:32:56 +0000] "GET / HTTP/1.1" 403 501 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0"
127.0.0.1 - - [01/Feb/2019:16:32:56 +0000] "GET /favicon.ico HTTP/1.1" 200 302 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0"
I am struggling on this from last two days.. Still no luck.
Any help is much appreciated. TIA
The last attempt to fix variable comparison for environment variables in the configuration file in 71832c6 doesn't work for booleans which have true
as default value.
For example
define( 'YOURLS_UNIQUE_URLS', filter_var(getenv('YOURLS_UNIQUE_URLS'), FILTER_VALIDATE_BOOLEAN) ?: true );
will always evaluate to true, even if getenv('YOURLS_UNIQUE_URLS')
is false.
Because if set to false, the statement would be:
define( 'YOURLS_UNIQUE_URLS', false ?: true );
which results in true.
The fix would be to delete the comparsion, because the filter will always return true
or false
. For example:
define( 'YOURLS_UNIQUE_URLS', filter_var(getenv('YOURLS_UNIQUE_URLS'), FILTER_VALIDATE_BOOLEAN));
1.8.1
Our organization requires SSL with out DB connections. I have figured out a fix for the yourls code side, however "docker-entrypoint.sh" does not take SSL connections into consideration.
The fix is relatively easy. Change from using the "new mysqli" to mysql->real_connect, and set the proper variables. Unfortunately for CA verification, you must provide a CA Cert. While there does seem to be a "Verify Off" options flag, it is non-functioning.
This could should work, assuming the "ca.crt" is in the root of the docker container.
$mysql = mysqli_init();
$mysql->ssl_set(NULL, NULL, "/ca.crt", NULL, NULL);
$mysql->real_connect(db_Server, admin_acount, db_pass, DB, PORT);
You could further streamline this by adding a -e DB_SSL=true
environment like variable to the documentation and then do:
$mysql = mysqli_init();
if (DB_SSL) { $mysql->ssl_set(NULL, NULL, "/ca.crt", NULL, NULL); }
$mysql->real_connect(db_Server, admin_acount, db_pass, DB, PORT);
You would also need to add a -v mount option for the user's CA cert:
docker run.....
-v /path/to/ca.crt:/ca.crt
-d yourls
That the entrypoint SH script either use the same PDO dirver, or update the mysqli function to work with SSL.
Setup an external DB, and "require SSL".
Attempt to connecting to the DB using the docker container. Even if you implement the fix on the YOURLS code:
YOURLS/YOURLS#3003 (comment)
The docker container still fails, because the entrypoint script is still failing.
See Description
Hi, is it possible to easily add plugins to existing docker image builds?
E.g. by providing some related path and config envs for plugins in docker-compose
Thanks in advance!
M.
1.9.1
The latest Github Expiry plugin (https://github.com/joshp23/YOURLS-Expiry) not working with the latest version of YOURLS 1.9.1
The installation is a fresh installation of both.
The options appear - blob:https://imgur.com/560d9baa-22a9-4bfe-bf0c-ab3ab2fa9491
But the link has no expiry.
I want only expiring link URLs to be created, by anyone without signing up, registered users can have options to see stats and delete links (but others can't).
Install both and check if they work.
The latest Github Expiry plugin (https://github.com/joshp23/YOURLS-Expiry) as of 18th July is not working with the latest version of YOURLS 1.9.1
If i start the docker container with docker-compose on my own system or by using the pwd button on the dockerhub registry page and then try to access with localhost:8080 or ip:8080 i always get a 403 Forbidden page.
This should be the relevant part of the logs from my system
yourls_1 | [Tue Nov 05 13:48:39.499502 2019] [autoindex:error] [pid 23] [client 138.246.2.73:38506] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
yourls_1 | 138.246.2.73 - - [05/Nov/2019:13:48:39 +0000] "GET / HTTP/1.1" 403 496 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"
not providing more info about my system since it also fails on pwd. if systeminfo still is needed im happy to provide it.
This issue provides visibility into Renovate updates and their statuses. Learn more
This repository currently has no open or pending branches.
1.8.2
I'm using the Yourls Docker Image with the following docker-compose file below. When entering the frontend at https://yourls-url/admin/
the following warning is shown in a banner at the top:
Could not auto-encrypt passwords. Error was: "cannot write file".
As I've read in https://github.com/YOURLS/YOURLS/wiki/Username-Passwords, this is caused by missing write permissions for the www-data user. I built a custom Dockerfile for yourls to override its ENTRYPOINT and CMD to debug what happens in docker-entrypoint.sh
.
It just copies the files from /usr/src/yourls/
to the current directory if there is nothing in it. Then it checks, if the file user/config.php
exits. If not (which is the case for the docker container without a volume mount), then the /usr/src/yourls/user/config-docker.php
is copied to that location. This causes the destination file (user/config.php
) to belong to the root user (as he is executing the docker-entrypoint.sh
file), rendering the auto-encryption feature useless.
This happens here: https://github.com/YOURLS/docker/blob/main/docker-entrypoint.sh#L75
If the -a
or --preserve=all
flag is added to the cp
call, the destination file would also belong to www-data
, which would fix this issue. Please let me know if I should open a MR on this. I don't know if this is intended, but it is kind of irritating to see this warning every week.
Login to the admin dashboard without any errors.
/var/www/html/
)My docker-compose file:
version: '3'
services:
yourls:
image: yourls:1.8.2
container_name: yourls
restart: always
networks:
db:
# my database is in another docker network
# but i have confirmed that this works as intended
ports:
- 8020:80
# I only persist the plugins folder as everything else is configured by envvars
volumes:
- ./plugins:/var/www/html/user/plugins
environment:
YOURLS_SITE: <redacted>
YOURLS_USER: leon
YOURLS_PASS: ${YOURLS_PASS}
YOURLS_DB_HOST: mysql.db
YOURLS_DB_USER: yourls
YOURLS_DB_PASS: ${YOURLS_DB_PASS}
YOURLS_DB_NAME: yourls
YOURLS_PRIVATE: 'TRUE'
networks:
db:
external: true
My custom Dockerfile to test the docker-entrypoint.sh
file:
FROM yourls:latest
CMD ["tail", "-f", "/dev/null"]
Describe the bug
** + Reproduce instructions **
Inspected .htaccess file and played around with it but haven't got it to work.
It looks like it is not 100% fitting for the reverse proxy case. But I couldn't get
it how to bring it to work.
Expected behavior
After setting up a new Docker container it is expected that basic functionality is working out of the box.
Actual behavior
Running into 403
Screenshots
Versions
Docker 18.06-ce
Ubuntu 16.04
Additional context
I´ve instale with Docker using a stack. When I try to access, the response is:
Forbidden
You don't have permission to access this resource.
Apache/2.4.38 (Debian) Server at vdon.us Port 80
But, when I place the https://domain.com/index.php its work very good.
This is a bug or there any thing to correct this?
Deploy from Docker Stack
container_name: yourls_vdon_us
image: yourls:latest
ports:
- "8103:80"
restart: always
volumes:
- yourls_vdon_us:/var/www/html
environment:
YOURLS_SITE: https://vdon.us
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Actual behavior
What actually happens.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions
You can get this information from referencing CHANGELOG.md
or the releases page.
Also, please include:
Additional context
Any additional information, configuration or data that might be necessary to reproduce the issue.
Hi, I see there are still commits into master branch and no releases yet. Is this official to be used or work in progress. Sorry i did not see any comments in README, so i want to know if i can use this yet or not for our company.
Summary
I am trying to build a down stream image using FROM yourls
and include a front end. The issue is that new files copied to /var/www/html are not persisted after the build because the directory is designated as a volume. I'd like to propose removing this from the DOCKERFILE and just let users define volumes at runtime.
Motivation
Allows customization of yourls website in other docker environments
Is your feature request related to a problem? Please describe.
Users cannot use and customize yourls docker containers
Describe the solution you'd like
Remove the VOLUME /var/www/html
from the docker template
The image does not work for me and just throws the following error:
Warning: mysqli::__construct(): (HY000/2002): No such file or directory in Standard input code on line 17
MySQL Connection Error: (2002) No such file or directory
Even if I'm using the given example and linking both containers together. I also tried to pass all database environment variables directly.
Summary
Many docker containers allow using Docker Secrets to pass in environment variables. It would be great to be able to input configuration through secrets.
Motivation
The mysql container can use secrets for its configuration. Using the same method of configuration for both would be great.
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
Be able to append "_FILE" to any of the environment variables to be able to use the /var/secrets files as the source of the values.
Please could you push 1.9.1 to docker hub
To lazy to dockerize it myself :)
No response
Describe the bug
YOURLS does not take into account the configuration values for YOURLS_UNIQUE_URLS
and YOURLS_PRIVATE
when passed as environment variables.
To Reproduce
When running the official Docker image for YOURLS (https://hub.docker.com/_/yourls), configuration is passed as environment variables.
Setting the env variable YOURLS_UNIQUE_URLS
to false results in the PHP constant YOURLS_UNIQUE_URLS
to be set to the string "false"
, which results in an incorrect comparison in the yourls_allow_duplicate_longurls
function (YOURLS_UNIQUE_URLS == false
returns false
, as any not-empty not-"0"
string is truthy).
The same problem happens for the YOURLS_PRIVATE
constant and the yourls_is_private
function (and maybe for others, I haven't checked).
I have worked around the issue with the following patch (works against the tag 1.7.3):
diff --git a/includes/functions.php b/includes/functions.php
index 265f97e..78f5ec7 100644
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -1284,7 +1284,7 @@ function yourls_maybe_unserialize( $original ) {
function yourls_is_private() {
$private = false;
- if ( defined('YOURLS_PRIVATE') && YOURLS_PRIVATE == true ) {
+ if ( defined('YOURLS_PRIVATE') && filter_var(YOURLS_PRIVATE, FILTER_VALIDATE_BOOLEAN) == true ) {
// Allow overruling for particular pages:
@@ -1331,7 +1331,7 @@ function yourls_allow_duplicate_longurls() {
if ( isset($_REQUEST['source']) && $_REQUEST['source'] == 'plugin' )
return false;
}
- return ( defined( 'YOURLS_UNIQUE_URLS' ) && YOURLS_UNIQUE_URLS == false );
+ return ( defined( 'YOURLS_UNIQUE_URLS' ) && filter_var(YOURLS_UNIQUE_URLS, FILTER_VALIDATE_BOOLEAN) == false );
}
/**
Environment (please complete the following information):
Describe the bug
If the config file is mounted from the host, the container fails to start correctly due to an error from sed.
This is important because there are circumstances where it may be necessary to edit the config of a running system and doing that via a host-supplied file is easier then entering the running container and trying to edit it there.
Note that this doesn't happen if you mount a directory from the host higher up the path, e.g. to /var/www/html/user, but there is definitely a use-case for just managing the one file with everything else in the container or ephemeral storage, hence this report.
To Reproduce
Steps to reproduce the behavior:
touch wibble.php
sudo chown www-data:www-data wibble.php
volumes:
- ./wibble.php:/var/www/html/user/config.php
docker-compose up
The yourls container will display a sed error.
Expected behavior
The container should start normally, with the host-mounted config file getting appropriately initialised.
Actual behavior
docker-entrypoint.sh
has a sed
command that tries to update the config file in-place. What sed does behind the scenes is create a temporary file then tries to move that temporary file over the existing file.
If the config file is mounted from the host, it is presented within the container as a filing system, so the move operation fails.
Versions
1.7.6 yourls Docker container
Describe the bug
Trying to start YOURLS with a docker setup doesn't work
To Reproduce
docker-compose.yml:
version: '3.1'
services:
yourls:
image: yourls
restart: always
ports:
- 9080:80
environment:
YOURLS_DB_NAME: mysql
YOURLS_DB_PASS: password
YOURLS_SITE: http://localhost:9080
YOURLS_USER: admin
YOURLS_PASS: admin_password
YOURLS_DEBUG: "true"
YOURLS_PRIVATE: "false"
depends_on:
- mysql
mysql:
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
Expected behavior
It should work normally
Actual behavior
Attaching to yourls_yourls_1, yourls_mysql_1
mysql_1 | 2021-06-20 11:11:08+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.25-1debian10 started.
mysql_1 | 2021-06-20 11:11:08+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
mysql_1 | 2021-06-20 11:11:08+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.25-1debian10 started.
mysql_1 | 2021-06-20 11:11:08+00:00 [Note] [Entrypoint]: Initializing database files
mysql_1 | 2021-06-20T11:11:08.607771Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.25) initializing of server in progress as process 43
mysql_1 | 2021-06-20T11:11:08.615887Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
yourls_1 |
yourls_1 | Warning: Undefined array key 1 in Standard input code on line 8
yourls_1 |
yourls_1 | Warning: mysqli::__construct(): (HY000/2002): Connection refused in Standard input code on line 17
Versions
Docker v20.10.7
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.