Github user mike-jumper commented on a diff in the pull request:

    
https://github.com/apache/incubator-guacamole-client/pull/10#discussion_r64998689
  
    --- Diff: guacamole-docker/bin/start.sh ---
    @@ -90,15 +90,21 @@ set_optional_property() {
     ## instead of a linked container.
     ##
     associate_mysql() {
    -
    -    # Use linked container if specified
    -    if [ -n "$MYSQL_NAME" ]; then
    -        MYSQL_HOSTNAME="$MYSQL_PORT_3306_TCP_ADDR"
    -        MYSQL_PORT="$MYSQL_PORT_3306_TCP_PORT"
    -    fi
    -
    -    # Use default port if none specified
    -    MYSQL_PORT="${MYSQL_PORT-3306}"
    +   : ${MYSQL_HOSTNAME:=mysql}
    +   # overwrite "MYSQL_PORT" with default port if using linked container
    +   if [ -n "$MYSQL_ENV_MYSQL_DATABASE" ]; then
    +           MYSQL_PORT=3306
    +   fi
    +   # Use default port if none specified
    +           : ${MYSQL_PORT:=3306}
    +           
    +   # if we're linked to MySQL and thus have credentials already, let's use 
them
    +   : ${MYSQL_USER:=${MYSQL_ENV_MYSQL_USER:-root}}
    --- End diff --
    
    Defaulting the user (and password) to the root credentials seems awfully 
scary. The documentation covers creating a restricted-privilege user with only 
the necessary permissions to work with the Guacamole database.
    
    I'd think it'd be far better to refuse to start the image and kick back an 
error noting that required environment variables are missing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to