Coder Social home page Coder Social logo

yourls / images Goto Github PK

View Code? Open in Web Editor NEW
128.0 6.0 40.0 5.1 MB

📦 Container Images for YOURLS

Home Page: https://yourls.org

License: MIT License

PHP 33.30% Shell 55.55% Dockerfile 11.15%
yourls docker docker-image docker-library container container-image oci-image

images's Introduction

Your Own URL Shortener

CI Scrutinizer Code Quality PHP Version Support Packagist OpenCollective OpenCollective

YOURLS is a set of PHP scripts that will allow you to run Your Own URL Shortener, on your server. You'll have full control over your data, detailed stats, analytics, plugins, and more. It's free and open-source.

Quick Start

Get YOURLS :

  • Download the latest release
  • Using Composer? You can simply composer create-project yourls/yourls . in an empty directory.

Install YOURLS:

  • Read yourls.org for starters
  • The complete documentation is on docs.yourls.org and contains everything from beginners to experts.

Community news, tips and tricks

Contributing

Feature suggestion? Bug to report?

Before opening any issue, please search for existing issues (open and closed) and read the Contributing Guidelines.

Backers

Do you use and enjoy YOURLS? Become a backer and show your support to our open source project.

Sponsors

Does your company use YOURLS? Ask your manager or marketing team if your company would be interested in supporting our project. Your company logo will show here. Help support our open-source development efforts by becoming a sponsor.

License

Free software. Do whatever the hell you want with it.
YOURLS is released under the MIT license.

images's People

Contributors

chrisro89 avatar dependabot-preview[bot] avatar dependabot[bot] avatar docker-library-bot avatar j0wi avatar jhollowe avatar leocolomb avatar nhumrich avatar ozh avatar pchiu33 avatar pcolmer avatar renovate-bot avatar renovate[bot] avatar smankusors avatar thechristschn avatar vitalyzhakov avatar ykweyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

images's Issues

.htaccess file is missing in all images

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.

Setting environment variables to falsy values (0, empty string, etc) reverts to default value

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

1.8.2

Description

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).

Expectation

Environment variables should support falsy values.

Reproduction steps

  1. Spin up a new yourls instance. e.g.
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
  1. Perform yourls installation.
  2. Check the yourls database, observe that the tables are all prefixed with "yourls_", despite passing an empty string for YOURLS_DB_PREFIX

Context

No response

The gmp or bcmath extension must be installed to read this database

Hello all,

Basic install armv7 (Raspberry Pi 4) issue

I run YOURLS on a Raspberry Pi 4 with buster and this docker image.
after installing and running the image I got this issue:

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 ... 

Workaround from me:

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 ...

Question for a Fix

Can you please insert the needed php module into the docker image?

best regards
Chris

Unable to access docker-yourls via path & proxy

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>
  • docker-yourls has port mapping 8080:80
  • setting YOURLS_SITE to http://domain/path does not help

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

This repository currently has no open or pending branches.


  • Check this box to trigger a request for Renovate to run again on this repository

It seems something wrong with your demo yml configs ?

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

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Actual behavior

Screenshots

Versions
You can get this information from referencing CHANGELOG.md or the releases page.
Also, please include:

  • The OS and what version of the OS you're running.
  • Plugins or extensions activated if applicable.

Additional context

YOURLS not re-reading config when running in Docker?

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:

  1. Run YOURLS in a Docker container with the change password plugin active.
  2. Log in and change the password. Confirm that the encrypted password has changed.
  3. Log out and log in with the new password - failure.
  4. Log out and log in with the old password - success.
  5. Stop and restart the Docker container.
  6. Log out and log in with the new password - success.

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.

Cannot acces withou enter "index.php" on url

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:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

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:

  • The OS and what version of the OS you're running.
  • Plugins or extensions activated if applicable.

Additional context
Any additional information, configuration or data that might be necessary to reproduce the issue.

docker container doesn't start after resetting the container

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

1.8.2

Description

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

Expectation

Usually I just reset and restart the container with the new version and all systems are up and running.

Reproduction steps

No response

Context

Host is running DSM 7.0-41890
DB is external

YOURLS failed when using MySQL 8

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 :

  • 1.7.9
  • 1.7.9-fpm

Additional Context
If upgrading php 7.4 is fine, I can do pull request if you want 🙂

Cannot use container with a mounted config file.

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:

  1. Create an empty file to be used as a config file, e.g.
touch wibble.php
sudo chown www-data:www-data wibble.php
  1. Modify the docker-compose.yml file so that it volume-mounts this file, e.g.
    volumes:
      - ./wibble.php:/var/www/html/user/config.php
  1. Try to bring up the YOURLS/MySQL stack:
    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

Docker setup doesn't work at all

Describe the bug
Trying to start YOURLS with a docker setup doesn't work
image

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

NGINX Config issue

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?

White screen with 1.8 using docker

Describe the bug
White screen with 1.8 using docker.

To Reproduce

  1. docker-compose file:
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
  1. docker-compose -f docker-compose.yml up
  2. Go to http://127.0.0.1:8080/admin, click install, click "YOURLS Administration Page"
  3. White screen. Even the debug setting doesn't give any output.
  4. Clear cookies, log in again: White screen.

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 ?

docker yourls error

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

Allow using Docker secrets for Environment Variables

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.

Images on dockerhub and github registry not the same

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

1.8.2

Description

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.

Expectation

I expect that images on Github and Dockerhub have the same content.

Reproduction steps

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.

Context

No response

"&" in the password bricks the config file (docker)

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

latest

Description

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'),',
];

Expectation

i guess the & is actually interpreted

Reproduction steps

set password YOURLS_PASS = sjkdhaadjsk&

Context

should be fixed/escaped

docker update

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Summary

Please could you push 1.9.1 to docker hub

Motivation

To lazy to dockerize it myself :)

Describe the solution

No response

config.php belongs to user root by default: Could not auto-encrypt passwords. Error was: "cannot write file".

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

1.8.2

Description

The problem

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".

Troubleshooting

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.

Expectation

Login to the admin dashboard without any errors.

Reproduction steps

  1. Install yourls with the docker-compose file below (without volume mount to /var/www/html/)
  2. Enter the admin frontend
  3. See the warning

Context

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"]

Comparison for boolean variables in configuration is still faulty

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));

Broken entrypoint

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.

Example for docker-compose on https://hub.docker.com/_/yourls/ not working

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: '%'

White screen with 1.8 image

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.

Error: Cannot serve directory /var/www/html/

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

Latest Github Expiry plugin not working with latest version of YOURLS

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

1.9.1

Description

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.

Expectation

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).

Reproduction steps

Install both and check if they work.

Context

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

YOURLS does wrong comparisons for the configuration

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):

  • YOURLS version: 1.7.3 (from the official docker image)
    • Plugins enabled: YOURLS-Import-Export
  • PHP version: 7.2.14

Docker version deprecated?

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.
image

Versions
tag: latest

Additional context
Any additional information, configuration or data that might be necessary to reproduce the issue.

First Release ?

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.

Automatic inclusion of plugin-specific configuration

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Summary

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.

Motivation

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

Describe the solution

  • define a well-known location for plug-in config files, i. e. "/var/www/html/user/plugins/config.d"
  • extend config-docker.php with
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.

  • Alternatively, make the location configurable via env var and only run the "foreach" if the location value is set.

Cannot serve directory

Describe the bug
** + Reproduce instructions **

  • I installed latest Yourls Docker Image.
  • Followed the Instructions.
  • Added Hostname to my Frontend Nginx Proxy
  • Ran /admin/install.php successfully
  • Added an example URL
  • Gone to that url (https://shorturl.treide.org/1)
  • Got 403

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

snap

Versions
Docker 18.06-ce
Ubuntu 16.04

Additional context

Mysqli with SSL is broken

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

1.8.1

Description

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

Expectation

That the entrypoint SH script either use the same PDO dirver, or update the mysqli function to work with SSL.

Reproduction steps

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.

Context

See Description

Fresh docker-compose install only shows "403 Forbidden"

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.

Docker data not persisted

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

1.8.2

Description

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?

Expectation

No response

Reproduction steps

No response

Context

No response

"preg_replace problem" when running YOURLS in a Docker container

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:

  1. Create a user directory to be volume-mounted by Docker
  2. Run the YOURLS container, mapping the user directory to /var/www/html/user.
  3. Finish the initialisation of YOURLS then stop the container.
  4. Add a new user under $yourls_user_passwords and restart the container.
  5. Log in as the new user.
  6. Click on the "Admin interface" link.

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

Volume in docker-compose.yml

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Summary

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.

Motivation

There is no persistent volume, if the containers are destroyed where will the data go?

Describe the solution

No response

Integrate yourls plugins to docker image

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.

YOURLS_TABLE_PREFIX not functional

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/

Error setting `USER` in `Dockerfile`

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

1.9.1

Description

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:

  • install custom plugins we need
  • copy our own custom config from a mounted volume created
  • execute docker-entrypoint the entry point for base image

Expectation

We 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.

Reproduction steps

  • create a new dockerfile with base yourls:1.9-apache.
  • set USER in the dockerfile to www-data
  • build the docker image and run

Error

Installation of yourls will not be possible due to the error Cannot mkdir: No space left on device

Context

No response

CVE-2019-11043 PHP+Nginx remote code execution

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!

Remove VOLUME from DOCKERFILE

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

Support for ARM64v8

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.

Reverse proxy

Hi

Can you add some help about how to reverse proxy it with Apache?

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.