Coder Social home page Coder Social logo

Comments (8)

LeoColomb avatar LeoColomb commented on June 2, 2024 2

@ozh I honestly have no opinion on this point.
That being said, it could be weird to have YOURLS checking the env for only 2 variables. And might raise a case for its volatility.

from images.

ozh avatar ozh commented on June 2, 2024

Your code :

yourls_user_passwords = [
    'user' => 'passwordwithoutand getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),',
];

Sets a user with username "user", and the password is the following string : "passwordwithoutand getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),", which I'm not sure is what you're trying to achieve.

Chars in passwords are not "escaped" and you can use any char in your passwords, see the ones used in unit tests.

There is no bug there. If you're not sure about how to use a setting or config, please open a discussion instead.

from images.

JustinGuese avatar JustinGuese commented on June 2, 2024

Hey @ozh, the code snippet is the result of the config file that is auto-generated if you would set the environment variables

  • YOULRS_USER="user"
  • YOURLS_PASS="passwordwithoutand&"

using these settings the docker images fails and just prints a php error, which is due - i guess - to the config.php being generated in a wrong way

i solved it by using another password without "&", and it works now, so i don't care what you do with this information. but i thought you might be interested in this bug, but sure just leave the bug in

if someone else observes the same issue just remove the "&" from your password

from images.

JustinGuese avatar JustinGuese commented on June 2, 2024

if you want to reproduce:

version: '3.1'

services:

  yourls:
    image: yourls
    restart: always
    ports:
      - 8080:80
    environment:
      YOURLS_DB_PASS: example
      YOURLS_SITE: http://localhost:8080/
      YOURLS_USER: example_username
      YOURLS_PASS: "example_password&"

  mysql:
    image: mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example
      MYSQL_DATABASE: yourls

localhost:8080/admin

Parse error: syntax error, unexpected identifier "YOURLS_USER", expecting "]" in /var/www/html/user/config.php on line 75

from images.

LeoColomb avatar LeoColomb commented on June 2, 2024

Thanks for opening the ticket @JustinGuese.
I can reproduce, indeed.
The behavior is caused by the sed command on the entrypoint.
https://github.com/YOURLS/docker/blob/2dec68f8872e6634020c3795e1f87504a4a65c22/docker-entrypoint.sh#L80

from images.

LeoColomb avatar LeoColomb commented on June 2, 2024

This change should do the trick: 10a7a68 (#165)
Do you confirm?

from images.

ozh avatar ozh commented on June 2, 2024

@LeoColomb would it be simpler and make sense if we checked for YOURLS_USER and YOURLS_PASS env var in YOURLS/YOURLS itself ?

from images.

JustinGuese avatar JustinGuese commented on June 2, 2024

@LeoColomb should work as a "quickfix". i mean it's a rare case, so probably not causing too much trouble

from images.

Related Issues (20)

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.