Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shellcheck warnings for assets/runtime/functions file #291

Open
jcormier opened this issue Aug 1, 2017 · 3 comments
Open

Fix shellcheck warnings for assets/runtime/functions file #291

jcormier opened this issue Aug 1, 2017 · 3 comments

Comments

@jcormier
Copy link
Collaborator

jcormier commented Aug 1, 2017

Though not every warning may need to be fixed.

 $ shellcheck assets/runtime/functions

In assets/runtime/functions line 3:
source ${REDMINE_RUNTIME_DIR}/env-defaults
       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 19:
   local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
                                            ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 21:
        -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
                                                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 22:
   awk -F$fs '{
         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 28:
         printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3);
                                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 47:
  if [[ $(whoami) == ${REDMINE_USER} ]]; then
                     ^-- SC2053: Quote the rhs of = in [[ ]] to prevent glob interpretation.


In assets/runtime/functions line 48:
    $@
    ^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.


In assets/runtime/functions line 50:
    sudo -HEu ${REDMINE_USER} "$@"
              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 66:
    cp ${USERCONF_TEMPLATES_DIR}/${SRC} ${DEST}
       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                 ^-- SC2086: Double quote to prevent globbing and word splitting.
                                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 68:
    cp ${SYSCONF_TEMPLATES_DIR}/${SRC} ${DEST}
       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                ^-- SC2086: Double quote to prevent globbing and word splitting.
                                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 70:
  chmod ${MODE} ${DEST}
        ^-- SC2086: Double quote to prevent globbing and word splitting.
                ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 71:
  chown ${OWNERSHIP} ${DEST}
        ^-- SC2086: Double quote to prevent globbing and word splitting.
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 84:
  local USR=$(stat -c %U ${FILE})
        ^-- SC2155: Declare and assign separately to avoid masking return values.
                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 85:
  local tmp_file=$(mktemp)
        ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 86:
  cp -a "${FILE}" ${tmp_file}
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 89:
  for variable in ${VARIABLES[@]}; do
                  ^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.


In assets/runtime/functions line 91:
    sed -ri "s/[{]{2}$variable[}]{2}/\${$variable}/g" ${tmp_file}
                                                      ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 96:
    export ${VARIABLES[@]}
           ^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.


In assets/runtime/functions line 97:
    local IFS=":"; sudo -HEu ${USR} envsubst "${VARIABLES[*]/#/$}" < ${tmp_file} > ${FILE}
                             ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                   ^-- SC2024: sudo doesn't affect redirects. Use sudo cat file | ..
                                                                     ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                                 ^-- SC2024: sudo doesn't affect redirects. Use ..| sudo tee file
                                                                                   ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 99:
  rm -f ${tmp_file}
        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 199:
    timeout=$(expr $timeout - 1)
              ^-- SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].


In assets/runtime/functions line 217:
  update_template ${REDMINE_DATABASE_CONFIG} \
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 228:
    exec_as_redmine sed -i "/reconnect: /d" ${REDMINE_DATABASE_CONFIG}
                                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 252:
    install_template ${REDMINE_USER}: redmine/additional_environment.rb ${REDMINE_MEMCACHED_CONFIG} 0644
                     ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 253:
    update_template ${REDMINE_MEMCACHED_CONFIG} \
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 262:
    exec_as_redmine sed -i '/{{REDMINE_RELATIVE_URL_ROOT}}/d' ${REDMINE_UNICORN_CONFIG}
                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 267:
    exec_as_redmine sed -i "s|127.0.0.1:8080|0.0.0.0:8080|" ${REDMINE_UNICORN_CONFIG}
                                                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 270:
  update_template ${REDMINE_UNICORN_CONFIG} \
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 286:
    REDMINE_SECRET_TOKEN=$(< /dev/urandom tr -dc [:alnum:] | head -c64)
                                                 ^-- SC2060: Quote parameters to tr to prevent glob expansion.


In assets/runtime/functions line 288:
  update_template ${REDMINE_SECRET_CONFIG} REDMINE_SECRET_TOKEN
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 293:
  update_template ${REDMINE_CONFIG} REDMINE_CONCURRENT_UPLOADS
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 298:
  update_template ${REDMINE_CONFIG} \
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 305:
  update_template ${REDMINE_CONFIG} \
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 326:
      ${REDMINE_CONFIG}
      ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 334:
        ${REDMINE_CONFIG}
        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 337:
        exec_as_redmine sed -i '/{{SMTP_PASS}}/d' ${REDMINE_CONFIG}
                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 342:
      exec_as_redmine sed -i '/{{SMTP_AUTHENTICATION}}/d' ${REDMINE_CONFIG}
                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 346:
      exec_as_redmine sed -i '/{{SMTP_OPENSSL_VERIFY_MODE}}/d' ${REDMINE_CONFIG}
                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 349:
    update_template ${REDMINE_CONFIG} \
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 363:
        update_template ${REDMINE_CONFIG} SMTP_CA_PATH
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 366:
        update_template ${REDMINE_CONFIG} SMTP_CA_FILE
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 372:
        ${REDMINE_CONFIG}
        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 380:
    crontab -u ${REDMINE_USER} -l >/tmp/cron.${REDMINE_USER}
               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 381:
    if ! grep -q 'redmine:email:receive_imap' /tmp/cron.${REDMINE_USER}; then
                                                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 406:
      echo "*/${IMAP_INTERVAL} * * * * cd ${REDMINE_HOME}/redmine && bundle exec rake redmine:email:receive_imap host=${IMAP_HOST} port=${IMAP_PORT} ssl=${IMAP_SSL} starttls=${IMAP_STARTTLS} username=${IMAP_USER} password=${IMAP_PASS} ${INCOMING_EMAIL_OPTIONS} RAILS_ENV=${RAILS_ENV} >> ${REDMINE_LOG_DIR}/redmine/cron_rake.log 2>&1" >>/tmp/cron.${REDMINE_USER}
                                                                                                                                                                                                                                                                                                                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 408:
    crontab -u ${REDMINE_USER} /tmp/cron.${REDMINE_USER}
               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 409:
    rm -rf /tmp/cron.${REDMINE_USER}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 416:
      crontab -u ${REDMINE_USER} -l >/tmp/cron.${REDMINE_USER}
                 ^-- SC2086: Double quote to prevent globbing and word splitting.
                                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 417:
      if ! grep -q 'Repository.fetch_changesets' /tmp/cron.${REDMINE_USER}; then
                                                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 421:
            echo "@${REDMINE_FETCH_COMMITS} cd ${REDMINE_HOME}/redmine && ./script/rails runner \"Repository.fetch_changesets\" -e ${RAILS_ENV} >> ${REDMINE_LOG_DIR}/redmine/cron_rake.log 2>&1" >>/tmp/cron.${REDMINE_USER}
                                                                                                                                                                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 424:
            echo "@${REDMINE_FETCH_COMMITS} cd ${REDMINE_HOME}/redmine && ./bin/rails runner \"Repository.fetch_changesets\" -e ${RAILS_ENV} >> ${REDMINE_LOG_DIR}/redmine/cron_rake.log 2>&1" >>/tmp/cron.${REDMINE_USER}
                                                                                                                                                                                                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 431:
        crontab -u ${REDMINE_USER} /tmp/cron.${REDMINE_USER}
                   ^-- SC2086: Double quote to prevent globbing and word splitting.
                                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 433:
      rm -rf /tmp/cron.${REDMINE_USER}
                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 441:
      crontab -u ${REDMINE_USER} -l >/tmp/cron.${REDMINE_USER}
                 ^-- SC2086: Double quote to prevent globbing and word splitting.
                                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 442:
      if ! grep -q '/usr/bin/redmine-backup-create' /tmp/cron.${REDMINE_USER}; then
                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 445:
        day_of_month=*
                     ^-- SC2125: Brace expansions and globs are literal in assignments. Quote it or use an array.


In assets/runtime/functions line 446:
        month=*
              ^-- SC2125: Brace expansions and globs are literal in assignments. Quote it or use an array.


In assets/runtime/functions line 447:
        day_of_week=*
                    ^-- SC2125: Brace expansions and globs are literal in assignments. Quote it or use an array.


In assets/runtime/functions line 453:
        echo "$min $hour $day_of_month $month $day_of_week /usr/bin/redmine-backup-create >> ${REDMINE_LOG_DIR}/redmine/backups.log 2>&1" >> /tmp/cron.${REDMINE_USER}
                                                                                                                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 454:
        crontab -u ${REDMINE_USER} /tmp/cron.${REDMINE_USER}
                   ^-- SC2086: Double quote to prevent globbing and word splitting.
                                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 456:
      rm -rf /tmp/cron.${REDMINE_USER}
                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 463:
  update_template ${REDMINE_CONFIG} \
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 471:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 472:
  eval $(parse_yaml ${REDMINE_DATABASE_CONFIG} database_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 473:
  case ${database_production_adapter} in
       ^-- SC2154: database_production_adapter is referenced but not assigned.


In assets/runtime/functions line 475:
      echo "Dumping PostgreSQL database ${database_production_database}..."
                                        ^-- SC2154: database_production_database is referenced but not assigned.


In assets/runtime/functions line 476:
      PGPASSWORD=${database_production_password} pg_dump --clean \
                 ^-- SC2154: database_production_password is referenced but not assigned.


In assets/runtime/functions line 477:
        --host ${database_production_host} --port ${database_production_port} \
               ^-- SC2154: database_production_host is referenced but not assigned.
               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                  ^-- SC2154: database_production_port is referenced but not assigned.
                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 478:
        --username ${database_production_username} \
                   ^-- SC2154: database_production_username is referenced but not assigned.
                   ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 479:
        ${database_production_database} > ${config_default_backup_storage_path}/database.sql
        ^-- SC2086: Double quote to prevent globbing and word splitting.
                                          ^-- SC2154: config_default_backup_storage_path is referenced but not assigned.
                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 484:
        --host ${database_production_host} --port ${database_production_port} \
               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 485:
        --user ${database_production_username} --default-character-set ${database_production_encoding} \
               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                       ^-- SC2154: database_production_encoding is referenced but not assigned.
                                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 486:
        ${database_production_database} > ${config_default_backup_storage_path}/database.sql
        ^-- SC2086: Double quote to prevent globbing and word splitting.
                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 489:
  chown ${REDMINE_USER}: ${config_default_backup_storage_path}/database.sql
        ^-- SC2086: Double quote to prevent globbing and word splitting.
                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 490:
  exec_as_redmine gzip -f ${config_default_backup_storage_path}/database.sql
                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 494:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 497:
  local dirname=$(basename ${directory})
        ^-- SC2155: Declare and assign separately to avoid masking return values.
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 501:
  exec_as_redmine tar -cf ${config_default_backup_storage_path}/${dirname}${extension} -C ${directory} .
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 505:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 506:
  eval $(parse_yaml ${REDMINE_DATABASE_CONFIG} database_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 512:
  ) > ${config_default_backup_storage_path}/backup_information.yml
      ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 513:
  chown ${REDMINE_USER}: ${config_default_backup_storage_path}/backup_information.yml
        ^-- SC2086: Double quote to prevent globbing and word splitting.
                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 517:
  local tar_file="$(date +%s)_redmine_backup.tar"
        ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 518:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 521:
  exec_as_redmine tar -cf ${config_default_backup_storage_path}/${tar_file} -C ${config_default_backup_storage_path} $@
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                                                                     ^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.


In assets/runtime/functions line 522:
  exec_as_redmine chmod 0644 ${config_default_backup_storage_path}/${tar_file}
                             ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                   ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 524:
  for f in $@
           ^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.


In assets/runtime/functions line 526:
    exec_as_redmine rm -rf ${config_default_backup_storage_path}/${f}
                           ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                 ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 531:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 532:
  if [[ ${config_default_backup_expiry} -gt 0 ]]; then
        ^-- SC2154: config_default_backup_expiry is referenced but not assigned.


In assets/runtime/functions line 535:
    local now=$(date +%s)
          ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 536:
    local cutoff=$(expr ${now} - ${config_default_backup_expiry})
          ^-- SC2155: Declare and assign separately to avoid masking return values.
                   ^-- SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
                        ^-- SC2086: Double quote to prevent globbing and word splitting.
                                 ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 537:
    for backup in $(ls ${config_default_backup_storage_path}/*_redmine_backup.tar)
                  ^-- SC2045: Iterating over ls output is fragile. Use globs.
                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 539:
      local timestamp=$(stat -c %Y ${backup})
            ^-- SC2155: Declare and assign separately to avoid masking return values.
                                   ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 541:
        rm ${backup}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 542:
        removed=$(expr ${removed} + 1)
                  ^-- SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].


In assets/runtime/functions line 552:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 553:
  tar -xf ${config_default_backup_storage_path}/${backup} -C ${config_default_backup_storage_path}
          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 557:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 558:
  eval $(parse_yaml ${REDMINE_DATABASE_CONFIG} database_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 559:
  eval $(parse_yaml ${config_default_backup_storage_path}/backup_information.yml backup_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 562:
  if [[ $(vercmp ${REDMINE_VERSION} ${backup_info_redmine_version}) -lt 0 ]]; then
                 ^-- SC2086: Double quote to prevent globbing and word splitting.
                                    ^-- SC2154: backup_info_redmine_version is referenced but not assigned.
                                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 574:
  if [[ ${database_production_adapter} != ${backup_info_database_adapter} ]]; then
                                          ^-- SC2154: backup_info_database_adapter is referenced but not assigned.


In assets/runtime/functions line 583:
  exec_as_redmine rm -rf ${config_default_backup_storage_path}/backup_information.yml
                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 587:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 588:
  eval $(parse_yaml ${REDMINE_DATABASE_CONFIG} database_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 592:
      gzip -dc ${config_default_backup_storage_path}/database.sql.gz | \
               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 594:
          --host ${database_production_host} --port ${database_production_port} \
                 ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 595:
          --username ${database_production_username} \
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 596:
          ${database_production_database}
          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 600:
      gzip -dc ${config_default_backup_storage_path}/database.sql.gz | \
               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 602:
          --host ${database_production_host} --port ${database_production_port} \
                 ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 603:
          --user ${database_production_username} --default-character-set ${database_production_encoding} \
                 ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 604:
          ${database_production_database}
          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 611:
  exec_as_redmine rm -rf ${config_default_backup_storage_path}/database.sql.gz
                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 615:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 618:
  local dirname=$(basename ${directory})
        ^-- SC2155: Declare and assign separately to avoid masking return values.
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 622:
  files=($(shopt -s nullglob;shopt -s dotglob;echo ${directory}/*))
                                                   ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 624:
    exec_as_redmine mv ${directory} ${directory}.$(date +%s)
                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                    ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                 ^-- SC2046: Quote this to prevent word splitting.


In assets/runtime/functions line 626:
    exec_as_redmine rm -rf ${directory}
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 628:
  exec_as_redmine mkdir -p ${directory}
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 629:
  exec_as_redmine tar -xf ${config_default_backup_storage_path}/${dirname}${extension} -C ${directory}
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 630:
  exec_as_redmine rm -rf ${config_default_backup_storage_path}/${dirname}${extension}
                         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 640:
  USERMAP_ORIG_UID=$(id -u ${REDMINE_USER})
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 641:
  USERMAP_ORIG_GID=$(id -g ${REDMINE_USER})
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 646:
    groupmod -g ${USERMAP_GID} ${REDMINE_USER}
                ^-- SC2086: Double quote to prevent globbing and word splitting.
                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 648:
    find ${REDMINE_HOME} -path ${REDMINE_DATA_DIR}/\* -prune -o -print0 | xargs -0 chown -h ${REDMINE_USER}:
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 654:
  mkdir -p ${REDMINE_LOG_DIR}/supervisor
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 655:
  chmod -R u+rw,go+r ${REDMINE_LOG_DIR}/supervisor
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 656:
  chown -R root: ${REDMINE_LOG_DIR}/supervisor
                 ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 658:
  mkdir -p ${REDMINE_LOG_DIR}/nginx
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 659:
  chmod -R u+rw,go+r ${REDMINE_LOG_DIR}/nginx
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 660:
  chown -R ${REDMINE_USER}: ${REDMINE_LOG_DIR}/nginx
           ^-- SC2086: Double quote to prevent globbing and word splitting.
                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 662:
  mkdir -p ${REDMINE_LOG_DIR}/redmine
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 663:
  chmod -R u+rw,go+r ${REDMINE_LOG_DIR}/redmine
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 664:
  chown -R ${REDMINE_USER}: ${REDMINE_LOG_DIR}/redmine
           ^-- SC2086: Double quote to prevent globbing and word splitting.
                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 669:
  chmod -R u+rw,go+r ${REDMINE_DATA_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 670:
  chown -R ${REDMINE_USER}: ${REDMINE_DATA_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.
                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 673:
  mkdir -p ${REDMINE_PLUGINS_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 674:
  chmod -R u+rw,go+r ${REDMINE_PLUGINS_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 675:
  chown -R ${REDMINE_USER}: ${REDMINE_PLUGINS_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.
                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 678:
  mkdir -p ${REDMINE_THEMES_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 679:
  chmod -R u+rw,go+r ${REDMINE_THEMES_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 680:
  chown -R ${REDMINE_USER}: ${REDMINE_THEMES_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.
                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 683:
  mkdir -p ${REDMINE_ATTACHMENTS_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 684:
  chmod -R u+rw,go+r ${REDMINE_ATTACHMENTS_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 685:
  chown -R ${REDMINE_USER}: ${REDMINE_ATTACHMENTS_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.
                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 688:
  mkdir -p ${REDMINE_BACKUPS_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 689:
  chmod -R u+rw,go+r ${REDMINE_BACKUPS_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 690:
  chown -R ${REDMINE_USER}: ${REDMINE_BACKUPS_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.
                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 700:
  mkdir -p ${REDMINE_DOTFILES_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 701:
  chmod -R u+rw,go+r ${REDMINE_DOTFILES_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 702:
  chown -R ${REDMINE_USER}: ${REDMINE_DOTFILES_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.
                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 704:
  mkdir -p ${REDMINE_DOTFILES_DIR}/.ssh
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 705:
  chmod -R u+rw,go-rwx ${REDMINE_DOTFILES_DIR}/.ssh
                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 706:
  chown -R ${REDMINE_USER}: ${REDMINE_DOTFILES_DIR}/.ssh
           ^-- SC2086: Double quote to prevent globbing and word splitting.
                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 708:
  mkdir -p ${REDMINE_DOTFILES_DIR}/.subversion
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 709:
  chmod -R u+rw,go+r ${REDMINE_DOTFILES_DIR}/.subversion
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 710:
  chown -R ${REDMINE_USER}: ${REDMINE_DOTFILES_DIR}/.subversion
           ^-- SC2086: Double quote to prevent globbing and word splitting.
                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 713:
  mkdir -p ${REDMINE_DATA_DIR}/tmp
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 714:
  chmod -R u+rw,go+r ${REDMINE_DATA_DIR}/tmp
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 715:
  chown -R ${REDMINE_USER}: ${REDMINE_DATA_DIR}/tmp
           ^-- SC2086: Double quote to prevent globbing and word splitting.
                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 721:
    exec_as_redmine rm -rf ${REDMINE_DOTFILES_DIR}/.ssh/id_rsa ${REDMINE_DOTFILES_DIR}/.ssh/id_rsa.pub
                           ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 722:
    exec_as_redmine ssh-keygen -qt rsa -N '' -f ${REDMINE_DOTFILES_DIR}/.ssh/id_rsa
                                                ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 726:
  chmod 0600 ${REDMINE_DOTFILES_DIR}/.ssh/id_rsa ${REDMINE_DOTFILES_DIR}/.ssh/id_rsa.pub
             ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                 ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 727:
  chmod 0700 ${REDMINE_DOTFILES_DIR}/.ssh
             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 732:
  for dotfile in $(find ${REDMINE_DOTFILES_DIR} -maxdepth 1 -type d -not -path ${REDMINE_DOTFILES_DIR})
                 ^-- SC2044: For loops over find output are fragile. Use find -exec or a while read loop.
                        ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 734:
    exec_as_redmine rm -rf ${REDMINE_HOME}/$(basename ${dotfile})
                           ^-- SC2086: Double quote to prevent globbing and word splitting.
                                           ^-- SC2046: Quote this to prevent word splitting.
                                                      ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 735:
    exec_as_redmine ln -sf ${dotfile} ${REDMINE_HOME}/$(basename ${dotfile})
                           ^-- SC2086: Double quote to prevent globbing and word splitting.
                                      ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                      ^-- SC2046: Quote this to prevent word splitting.
                                                                 ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 742:
  install_template ${REDMINE_USER}: redmine/configuration.yml ${REDMINE_CONFIG} 0640
                   ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 743:
  install_template ${REDMINE_USER}: redmine/database.yml ${REDMINE_DATABASE_CONFIG} 0640
                   ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 744:
  install_template ${REDMINE_USER}: redmine/unicorn.rb ${REDMINE_UNICORN_CONFIG} 0644
                   ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 745:
  install_template ${REDMINE_USER}: redmine/secret_token.rb ${REDMINE_SECRET_CONFIG} 0644
                   ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 748:
    install_template ${REDMINE_USER}: redmine/config.ru ${REDMINE_INSTALL_DIR}/config.ru 0644
                     ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 776:
  update_template ${REDMINE_CONFIG} \
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 794:
    exec_as_redmine sed -i "s/:key => '_redmine_session'/:secure => true, :key => '_redmine_session'/" ${REDMINE_INSTALL_DIR}/config/application.rb
                                                                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 798:
  rm -rf ${REDMINE_INSTALL_DIR}/tmp/sockets/redmine.socket
         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 881:
  [[ -f ${REDMINE_DATA_DIR}/tmp/VERSION ]] && CACHE_VERSION=$(cat ${REDMINE_DATA_DIR}/tmp/VERSION)
                                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 884:
    if [[ -n ${CACHE_VERSION} && $(vercmp ${REDMINE_VERSION} ${CACHE_VERSION}) -lt 0 ]]; then
                                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 895:
    rm -rf ${REDMINE_DATA_DIR}/tmp
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 896:
    exec_as_redmine mkdir -p ${REDMINE_DATA_DIR}/tmp
                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 897:
    exec_as_redmine mkdir -p ${REDMINE_DATA_DIR}/tmp/thumbnails
                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 898:
    exec_as_redmine mkdir -p ${REDMINE_DATA_DIR}/tmp/plugin_assets
                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 899:
    exec_as_redmine chmod -R u+rw,go+r ${REDMINE_DATA_DIR}/tmp
                                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 910:
    echo ${REDMINE_VERSION} | exec_as_redmine tee --append ${REDMINE_DATA_DIR}/tmp/VERSION >/dev/null
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 915:
    exec_as_redmine cp -a ${REDMINE_INSTALL_DIR}/vendor/bundle ${REDMINE_DATA_DIR}/tmp/
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 916:
    exec_as_redmine cp -a ${REDMINE_INSTALL_DIR}/Gemfile.lock ${REDMINE_DATA_DIR}/tmp/
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 918:
  rm -rf ${REDMINE_INSTALL_DIR}/vendor/bundle ${REDMINE_INSTALL_DIR}/Gemfile.lock
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 921:
  ln -sf ${REDMINE_DATA_DIR}/tmp/bundle ${REDMINE_INSTALL_DIR}/vendor/bundle
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 922:
  ln -sf ${REDMINE_DATA_DIR}/tmp/Gemfile.lock ${REDMINE_INSTALL_DIR}/Gemfile.lock
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 928:
    rsync -avq --chown=${REDMINE_USER}:${REDMINE_USER} ${REDMINE_PLUGINS_DIR}/ ${REDMINE_INSTALL_DIR}/plugins/
                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 932:
      mv ${REDMINE_PLUGINS_DIR}/init ${REDMINE_PLUGINS_DIR}/post-install.sh
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 938:
      . ${REDMINE_PLUGINS_DIR}/pre-install.sh
        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 943:
    [[ -f ${REDMINE_DATA_DIR}/tmp/plugins.sha1 ]] && CURRENT_SHA1=$(cat ${REDMINE_DATA_DIR}/tmp/plugins.sha1)
                                                                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 944:
    PLUGINS_SHA1=$(find ${REDMINE_PLUGINS_DIR} -type f -print0 | sort -z | xargs -0 sha1sum | sha1sum | awk '{print $1}')
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 948:
      rm -rf ${REDMINE_DATA_DIR}/tmp/plugin_assets/*
             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 951:
      exec_as_redmine bundle install -j$(nproc) --without development test --path ${REDMINE_INSTALL_DIR}/vendor/bundle --quiet
                                       ^-- SC2046: Quote this to prevent word splitting.
                                                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 957:
      echo -n ${PLUGINS_SHA1} > ${REDMINE_DATA_DIR}/tmp/plugins.sha1
              ^-- SC2086: Double quote to prevent globbing and word splitting.
                                ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 963:
      . ${REDMINE_PLUGINS_DIR}/post-install.sh
        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 967:
    rm -rf ${REDMINE_DATA_DIR}/tmp/plugins.sha1
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 974:
    rsync -avq --chown=${REDMINE_USER}:${REDMINE_USER} ${REDMINE_THEMES_DIR}/ ${REDMINE_INSTALL_DIR}/public/themes/
                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 984:
  exec_as_redmine bundle exec rake $@
                                   ^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.


In assets/runtime/functions line 988:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 990:
  backup_dump_directory ${config_default_attachments_storage_path} .tar
                        ^-- SC2154: config_default_attachments_storage_path is referenced but not assigned.
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 991:
  backup_dump_directory ${REDMINE_DOTFILES_DIR} .tar.gz
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 992:
  backup_dump_directory ${REDMINE_PLUGINS_DIR} .tar.gz
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 993:
  backup_dump_directory ${REDMINE_THEMES_DIR} .tar.gz
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1000:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1004:
  for arg in $@
             ^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.


In assets/runtime/functions line 1015:
    num_backups=$(ls ${config_default_backup_storage_path}/*_redmine_backup.tar | wc -l)
                  ^-- SC2012: Use find instead of ls to better handle non-alphanumeric filenames.
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1022:
    for b in $(ls ${config_default_backup_storage_path} | grep _redmine_backup.tar | sort -r)
               ^-- SC2010: Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames.
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1040:
  backup_restore_unpack ${tar_file}
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1043:
  backup_restore_directory ${config_default_attachments_storage_path} .tar
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1044:
  backup_restore_directory ${REDMINE_DOTFILES_DIR} .tar.gz
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1045:
  backup_restore_directory ${REDMINE_PLUGINS_DIR} .tar.gz
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1046:
  backup_restore_directory ${REDMINE_THEMES_DIR} .tar.gz
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1049:
  rm -rf ${REDMINE_DATA_DIR}/tmp
         ^-- SC2086: Double quote to prevent globbing and word splitting.
@frank-dspeed
Copy link
Collaborator

@jcormier please check branch: issue_291 and post result thanks

@jcormier
Copy link
Collaborator Author

jcormier commented Aug 2, 2017

Made some comments on the commits. I'll make a pass at it.

Remaining warnings

 $ shellcheck assets/runtime/functions 

In assets/runtime/functions line 3:
source ${REDMINE_RUNTIME_DIR}/env-defaults
       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 20:
   local fs=$(echo @|tr @ '\034')
         ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 22:
        -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
                                                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 29:
         printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3);
                                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 69:
    cp ${SYSCONF_TEMPLATES_DIR}/"${SRC}" "${DEST}"
       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 84:
  local VARIABLES="($@)"
                  ^-- SC2124: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.


In assets/runtime/functions line 85:
  local USR="$(stat -c %U ${FILE})"
        ^-- SC2155: Declare and assign separately to avoid masking return values.
                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 86:
  local tmp_file="$(mktemp)"
        ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 97:
    export ${VARIABLES[@]}
           ^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.


In assets/runtime/functions line 98:
    local IFS=":"; sudo -HEu ${USR} envsubst "${VARIABLES[*]/#/$}" < "${tmp_file}" > ${FILE}
                             ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                   ^-- SC2024: sudo doesn't affect redirects. Use sudo cat file | ..
                                                                                   ^-- SC2024: sudo doesn't affect redirects. Use ..| sudo tee file
                                                                                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 200:
    timeout=$(expr $timeout - 1)
              ^-- SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].


In assets/runtime/functions line 218:
  update_template ${REDMINE_DATABASE_CONFIG} \
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 229:
    exec_as_redmine sed -i "/reconnect: /d" ${REDMINE_DATABASE_CONFIG}
                                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 253:
    install_template "${REDMINE_USER}": redmine/additional_environment.rb ${REDMINE_MEMCACHED_CONFIG} 0644
                                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 254:
    update_template ${REDMINE_MEMCACHED_CONFIG} \
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 263:
    exec_as_redmine sed -i '/{{REDMINE_RELATIVE_URL_ROOT}}/d' ${REDMINE_UNICORN_CONFIG}
                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 268:
    exec_as_redmine sed -i "s|127.0.0.1:8080|0.0.0.0:8080|" ${REDMINE_UNICORN_CONFIG}
                                                            ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 271:
  update_template ${REDMINE_UNICORN_CONFIG} \
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 287:
    REDMINE_SECRET_TOKEN=$(< /dev/urandom tr -dc [:alnum:] | head -c64)
                                                 ^-- SC2060: Quote parameters to tr to prevent glob expansion.


In assets/runtime/functions line 289:
  update_template ${REDMINE_SECRET_CONFIG} REDMINE_SECRET_TOKEN
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 294:
  update_template ${REDMINE_CONFIG} REDMINE_CONCURRENT_UPLOADS
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 299:
  update_template ${REDMINE_CONFIG} \
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 306:
  update_template ${REDMINE_CONFIG} \
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 327:
      ${REDMINE_CONFIG}
      ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 335:
        ${REDMINE_CONFIG}
        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 338:
        exec_as_redmine sed -i '/{{SMTP_PASS}}/d' ${REDMINE_CONFIG}
                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 343:
      exec_as_redmine sed -i '/{{SMTP_AUTHENTICATION}}/d' ${REDMINE_CONFIG}
                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 347:
      exec_as_redmine sed -i '/{{SMTP_OPENSSL_VERIFY_MODE}}/d' ${REDMINE_CONFIG}
                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 350:
    update_template ${REDMINE_CONFIG} \
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 364:
        update_template ${REDMINE_CONFIG} SMTP_CA_PATH
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 367:
        update_template ${REDMINE_CONFIG} SMTP_CA_FILE
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 373:
        ${REDMINE_CONFIG}
        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 446:
        day_of_month=*
                     ^-- SC2125: Brace expansions and globs are literal in assignments. Quote it or use an array.


In assets/runtime/functions line 447:
        month=*
              ^-- SC2125: Brace expansions and globs are literal in assignments. Quote it or use an array.


In assets/runtime/functions line 448:
        day_of_week=*
                    ^-- SC2125: Brace expansions and globs are literal in assignments. Quote it or use an array.


In assets/runtime/functions line 472:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 473:
  eval $(parse_yaml ${REDMINE_DATABASE_CONFIG} database_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 474:
  case ${database_production_adapter} in
       ^-- SC2154: database_production_adapter is referenced but not assigned.


In assets/runtime/functions line 476:
      echo "Dumping PostgreSQL database ${database_production_database}..."
                                        ^-- SC2154: database_production_database is referenced but not assigned.


In assets/runtime/functions line 477:
      PGPASSWORD=${database_production_password} pg_dump --clean \
                 ^-- SC2154: database_production_password is referenced but not assigned.


In assets/runtime/functions line 478:
        --host ${database_production_host} --port ${database_production_port} \
               ^-- SC2154: database_production_host is referenced but not assigned.
               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                  ^-- SC2154: database_production_port is referenced but not assigned.
                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 479:
        --username ${database_production_username} \
                   ^-- SC2154: database_production_username is referenced but not assigned.
                   ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 480:
        ${database_production_database} > ${config_default_backup_storage_path}/database.sql
        ^-- SC2086: Double quote to prevent globbing and word splitting.
                                          ^-- SC2154: config_default_backup_storage_path is referenced but not assigned.
                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 485:
        --host ${database_production_host} --port ${database_production_port} \
               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 486:
        --user ${database_production_username} --default-character-set ${database_production_encoding} \
               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                       ^-- SC2154: database_production_encoding is referenced but not assigned.
                                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 487:
        ${database_production_database} > ${config_default_backup_storage_path}/database.sql
        ^-- SC2086: Double quote to prevent globbing and word splitting.
                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 490:
  chown "${REDMINE_USER}": ${config_default_backup_storage_path}/database.sql
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 491:
  exec_as_redmine gzip -f ${config_default_backup_storage_path}/database.sql
                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 495:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 498:
  local dirname=$(basename ${directory})
        ^-- SC2155: Declare and assign separately to avoid masking return values.
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 502:
  exec_as_redmine tar -cf ${config_default_backup_storage_path}/${dirname}${extension} -C ${directory} .
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 506:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 507:
  eval $(parse_yaml ${REDMINE_DATABASE_CONFIG} database_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 513:
  ) > ${config_default_backup_storage_path}/backup_information.yml
      ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 514:
  chown "${REDMINE_USER}": ${config_default_backup_storage_path}/backup_information.yml
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 518:
  local tar_file="$(date +%s)_redmine_backup.tar"
        ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 519:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 522:
  exec_as_redmine tar -cf ${config_default_backup_storage_path}/${tar_file} -C ${config_default_backup_storage_path} $@
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                                                                     ^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.


In assets/runtime/functions line 523:
  exec_as_redmine chmod 0644 ${config_default_backup_storage_path}/${tar_file}
                             ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                   ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 525:
  for f in $@
           ^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.


In assets/runtime/functions line 527:
    exec_as_redmine rm -rf ${config_default_backup_storage_path}/${f}
                           ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                 ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 532:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 533:
  if [[ ${config_default_backup_expiry} -gt 0 ]]; then
        ^-- SC2154: config_default_backup_expiry is referenced but not assigned.


In assets/runtime/functions line 536:
    local now=$(date +%s)
          ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 537:
    local cutoff=$(expr ${now} - ${config_default_backup_expiry})
          ^-- SC2155: Declare and assign separately to avoid masking return values.
                   ^-- SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
                        ^-- SC2086: Double quote to prevent globbing and word splitting.
                                 ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 538:
    for backup in $(ls ${config_default_backup_storage_path}/*_redmine_backup.tar)
                  ^-- SC2045: Iterating over ls output is fragile. Use globs.
                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 540:
      local timestamp=$(stat -c %Y ${backup})
            ^-- SC2155: Declare and assign separately to avoid masking return values.
                                   ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 542:
        rm ${backup}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 543:
        removed=$(expr ${removed} + 1)
                  ^-- SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].


In assets/runtime/functions line 553:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 554:
  tar -xf ${config_default_backup_storage_path}/${backup} -C ${config_default_backup_storage_path}
          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 558:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 559:
  eval $(parse_yaml ${REDMINE_DATABASE_CONFIG} database_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 560:
  eval $(parse_yaml ${config_default_backup_storage_path}/backup_information.yml backup_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 563:
  if [[ $(vercmp ${REDMINE_VERSION} ${backup_info_redmine_version}) -lt 0 ]]; then
                 ^-- SC2086: Double quote to prevent globbing and word splitting.
                                    ^-- SC2154: backup_info_redmine_version is referenced but not assigned.
                                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 575:
  if [[ ${database_production_adapter} != ${backup_info_database_adapter} ]]; then
                                          ^-- SC2154: backup_info_database_adapter is referenced but not assigned.


In assets/runtime/functions line 584:
  exec_as_redmine rm -rf ${config_default_backup_storage_path}/backup_information.yml
                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 588:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 589:
  eval $(parse_yaml ${REDMINE_DATABASE_CONFIG} database_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 593:
      gzip -dc ${config_default_backup_storage_path}/database.sql.gz | \
               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 595:
          --host ${database_production_host} --port ${database_production_port} \
                 ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 596:
          --username ${database_production_username} \
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 597:
          ${database_production_database}
          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 601:
      gzip -dc ${config_default_backup_storage_path}/database.sql.gz | \
               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 603:
          --host ${database_production_host} --port ${database_production_port} \
                 ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 604:
          --user ${database_production_username} --default-character-set ${database_production_encoding} \
                 ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 605:
          ${database_production_database}
          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 612:
  exec_as_redmine rm -rf ${config_default_backup_storage_path}/database.sql.gz
                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 616:
  eval $(parse_yaml ${REDMINE_CONFIG} config_)
       ^-- SC2046: Quote this to prevent word splitting.
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 619:
  local dirname=$(basename ${directory})
        ^-- SC2155: Declare and assign separately to avoid masking return values.
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 623:
  files=($(shopt -s nullglob;shopt -s dotglob;echo ${directory}/*))
                                                   ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 625:
    exec_as_redmine mv ${directory} ${directory}.$(date +%s)
                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                    ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                 ^-- SC2046: Quote this to prevent word splitting.


In assets/runtime/functions line 627:
    exec_as_redmine rm -rf ${directory}
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 629:
  exec_as_redmine mkdir -p ${directory}
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 630:
  exec_as_redmine tar -xf ${config_default_backup_storage_path}/${dirname}${extension} -C ${directory}
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 631:
  exec_as_redmine rm -rf ${config_default_backup_storage_path}/${dirname}${extension}
                         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 646:
    echo "Mapping UID and GID for "${REDMINE_USER}":${REDMINE_USER} to $USERMAP_UID:$USERMAP_GID"
                                   ^-- SC2027: The surrounding quotes actually unquote this. Remove or escape them.
                                   ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 647:
    groupmod -g ${USERMAP_GID} "${REDMINE_USER}"
                ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 649:
    find ${REDMINE_HOME} -path ${REDMINE_DATA_DIR}/\* -prune -o -print0 | xargs -0 chown -h "${REDMINE_USER}":
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 655:
  mkdir -p ${REDMINE_LOG_DIR}/supervisor
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 656:
  chmod -R u+rw,go+r ${REDMINE_LOG_DIR}/supervisor
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 657:
  chown -R root: ${REDMINE_LOG_DIR}/supervisor
                 ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 659:
  mkdir -p ${REDMINE_LOG_DIR}/nginx
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 660:
  chmod -R u+rw,go+r ${REDMINE_LOG_DIR}/nginx
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 661:
  chown -R "${REDMINE_USER}": ${REDMINE_LOG_DIR}/nginx
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 663:
  mkdir -p ${REDMINE_LOG_DIR}/redmine
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 664:
  chmod -R u+rw,go+r ${REDMINE_LOG_DIR}/redmine
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 665:
  chown -R "${REDMINE_USER}": ${REDMINE_LOG_DIR}/redmine
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 670:
  chmod -R u+rw,go+r ${REDMINE_DATA_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 671:
  chown -R "${REDMINE_USER}": ${REDMINE_DATA_DIR}
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 674:
  mkdir -p ${REDMINE_PLUGINS_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 675:
  chmod -R u+rw,go+r ${REDMINE_PLUGINS_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 676:
  chown -R "${REDMINE_USER}": ${REDMINE_PLUGINS_DIR}
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 679:
  mkdir -p ${REDMINE_THEMES_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 680:
  chmod -R u+rw,go+r ${REDMINE_THEMES_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 681:
  chown -R "${REDMINE_USER}": ${REDMINE_THEMES_DIR}
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 684:
  mkdir -p ${REDMINE_ATTACHMENTS_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 685:
  chmod -R u+rw,go+r ${REDMINE_ATTACHMENTS_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 686:
  chown -R "${REDMINE_USER}": ${REDMINE_ATTACHMENTS_DIR}
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 689:
  mkdir -p ${REDMINE_BACKUPS_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 690:
  chmod -R u+rw,go+r ${REDMINE_BACKUPS_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 691:
  chown -R "${REDMINE_USER}": ${REDMINE_BACKUPS_DIR}
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 714:
  mkdir -p ${REDMINE_DATA_DIR}/tmp
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 715:
  chmod -R u+rw,go+r ${REDMINE_DATA_DIR}/tmp
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 716:
  chown -R "${REDMINE_USER}": ${REDMINE_DATA_DIR}/tmp
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 733:
  for dotfile in "$(find ${REDMINE_DOTFILES_DIR} -maxdepth 1 -type d -not -path ${REDMINE_DOTFILES_DIR})"
                 ^-- SC2066: Since you double quoted this, it will not word split, and the loop will only run once.
                         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                                ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 735:
    exec_as_redmine rm -rf ${REDMINE_HOME}/$(basename ${dotfile})
                           ^-- SC2086: Double quote to prevent globbing and word splitting.
                                           ^-- SC2046: Quote this to prevent word splitting.
                                                      ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 736:
    exec_as_redmine ln -sf ${dotfile} ${REDMINE_HOME}/$(basename ${dotfile})
                           ^-- SC2086: Double quote to prevent globbing and word splitting.
                                      ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                      ^-- SC2046: Quote this to prevent word splitting.
                                                                 ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 743:
  install_template "${REDMINE_USER}": redmine/configuration.yml ${REDMINE_CONFIG} 0640
                                                                ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 744:
  install_template "${REDMINE_USER}": redmine/database.yml ${REDMINE_DATABASE_CONFIG} 0640
                                                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 745:
  install_template "${REDMINE_USER}": redmine/unicorn.rb ${REDMINE_UNICORN_CONFIG} 0644
                                                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 746:
  install_template "${REDMINE_USER}": redmine/secret_token.rb ${REDMINE_SECRET_CONFIG} 0644
                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 749:
    install_template "${REDMINE_USER}": redmine/config.ru ${REDMINE_INSTALL_DIR}/config.ru 0644
                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 777:
  update_template ${REDMINE_CONFIG} \
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 795:
    exec_as_redmine sed -i "s/:key => '_redmine_session'/:secure => true, :key => '_redmine_session'/" ${REDMINE_INSTALL_DIR}/config/application.rb
                                                                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 799:
  rm -rf ${REDMINE_INSTALL_DIR}/tmp/sockets/redmine.socket
         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 882:
  [[ -f ${REDMINE_DATA_DIR}/tmp/VERSION ]] && CACHE_VERSION=$(cat ${REDMINE_DATA_DIR}/tmp/VERSION)
                                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 885:
    if [[ -n ${CACHE_VERSION} && $(vercmp ${REDMINE_VERSION} ${CACHE_VERSION}) -lt 0 ]]; then
                                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 896:
    rm -rf ${REDMINE_DATA_DIR}/tmp
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 897:
    exec_as_redmine mkdir -p ${REDMINE_DATA_DIR}/tmp
                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 898:
    exec_as_redmine mkdir -p ${REDMINE_DATA_DIR}/tmp/thumbnails
                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 899:
    exec_as_redmine mkdir -p ${REDMINE_DATA_DIR}/tmp/plugin_assets
                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 900:
    exec_as_redmine chmod -R u+rw,go+r ${REDMINE_DATA_DIR}/tmp
                                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 911:
    echo ${REDMINE_VERSION} | exec_as_redmine tee --append ${REDMINE_DATA_DIR}/tmp/VERSION >/dev/null
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 916:
    exec_as_redmine cp -a ${REDMINE_INSTALL_DIR}/vendor/bundle ${REDMINE_DATA_DIR}/tmp/
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 917:
    exec_as_redmine cp -a ${REDMINE_INSTALL_DIR}/Gemfile.lock ${REDMINE_DATA_DIR}/tmp/
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 919:
  rm -rf ${REDMINE_INSTALL_DIR}/vendor/bundle ${REDMINE_INSTALL_DIR}/Gemfile.lock
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 922:
  ln -sf ${REDMINE_DATA_DIR}/tmp/bundle ${REDMINE_INSTALL_DIR}/vendor/bundle
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 923:
  ln -sf ${REDMINE_DATA_DIR}/tmp/Gemfile.lock ${REDMINE_INSTALL_DIR}/Gemfile.lock
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 929:
    rsync -avq --chown=${REDMINE_USER}:${REDMINE_USER} ${REDMINE_PLUGINS_DIR}/ ${REDMINE_INSTALL_DIR}/plugins/
                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 933:
      mv ${REDMINE_PLUGINS_DIR}/init ${REDMINE_PLUGINS_DIR}/post-install.sh
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 939:
      . ${REDMINE_PLUGINS_DIR}/pre-install.sh
        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 944:
    [[ -f ${REDMINE_DATA_DIR}/tmp/plugins.sha1 ]] && CURRENT_SHA1=$(cat ${REDMINE_DATA_DIR}/tmp/plugins.sha1)
                                                                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 945:
    PLUGINS_SHA1=$(find ${REDMINE_PLUGINS_DIR} -type f -print0 | sort -z | xargs -0 sha1sum | sha1sum | awk '{print $1}')
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 949:
      rm -rf ${REDMINE_DATA_DIR}/tmp/plugin_assets/*
             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 952:
      exec_as_redmine bundle install -j$(nproc) --without development test --path ${REDMINE_INSTALL_DIR}/vendor/bundle --quiet
                                       ^-- SC2046: Quote this to prevent word splitting.
                                                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 958:
      echo -n ${PLUGINS_SHA1} > ${REDMINE_DATA_DIR}/tmp/plugins.sha1
              ^-- SC2086: Double quote to prevent globbing and word splitting.
                                ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 964:
      . ${REDMINE_PLUGINS_DIR}/post-install.sh
        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 968:
    rm -rf ${REDMINE_DATA_DIR}/tmp/plugins.sha1
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 975:
    rsync -avq --chown=${REDMINE_USER}:${REDMINE_USER} ${REDMINE_THEMES_DIR}/ ${REDMINE_INSTALL_DIR}/public/themes/
                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 989:
  eval "$(parse_yaml ${REDMINE_CONFIG} config_)"
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 991:
  backup_dump_directory "${config_default_attachments_storage_path}" .tar
                         ^-- SC2154: config_default_attachments_storage_path is referenced but not assigned.


In assets/runtime/functions line 1001:
  eval "$(parse_yaml ${REDMINE_CONFIG} config_)"
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1016:
    num_backups=$(find ${config_default_backup_storage_path}/*_redmine_backup.tar | wc -l)
                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1023:
    for b in $(find ${config_default_backup_storage_path}/*_redmine_backup.tar | sort -r)
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1041:
  backup_restore_unpack ${tar_file}
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1044:
  backup_restore_directory ${config_default_attachments_storage_path} .tar
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1046:
  backup_restore_directory ${REDMINE_PLUGINS_DIR} .tar.gz
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1047:
  backup_restore_directory ${REDMINE_THEMES_DIR} .tar.gz
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1050:
  rm -rf ${REDMINE_DATA_DIR}/tmp
         ^-- SC2086: Double quote to prevent globbing and word splitting.

@jcormier
Copy link
Collaborator Author

jcormier commented Aug 2, 2017

Pushed another commit for round 3. Plenty of additional. Some of which we will probably ignore. Like the Declare and assign separately ones...

 $ shellcheck assets/runtime/functions 

In assets/runtime/functions line 20:
   local fs=$(echo @|tr @ '\034')
         ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 29:
         printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, "$2", "$3");
                                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 85:
  local USR=$(stat -c %U "${FILE}")
        ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 86:
  local tmp_file="$(mktemp)"
        ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 100:
    sudo -HEu "${USR}" envsubst "${VARIABLES[*]/#/$}" < "${tmp_file}" > "${FILE}"
                                                      ^-- SC2024: sudo doesn't affect redirects. Use sudo cat file | ..
                                                                      ^-- SC2024: sudo doesn't affect redirects. Use ..| sudo tee file


In assets/runtime/functions line 476:
  case "${database_production_adapter}" in
        ^-- SC2154: database_production_adapter is referenced but not assigned.


In assets/runtime/functions line 478:
      echo "Dumping PostgreSQL database ${database_production_database}..."
                                        ^-- SC2154: database_production_database is referenced but not assigned.


In assets/runtime/functions line 479:
      PGPASSWORD="${database_production_password}" pg_dump --clean \
                  ^-- SC2154: database_production_password is referenced but not assigned.


In assets/runtime/functions line 480:
        --host "${database_production_host}" --port "${database_production_port}" \
                ^-- SC2154: database_production_host is referenced but not assigned.
                                                     ^-- SC2154: database_production_port is referenced but not assigned.


In assets/runtime/functions line 481:
        --username "${database_production_username}" \
                    ^-- SC2154: database_production_username is referenced but not assigned.


In assets/runtime/functions line 482:
        "${database_production_database}" > "${config_default_backup_storage_path}/database.sql"
                                             ^-- SC2154: config_default_backup_storage_path is referenced but not assigned.


In assets/runtime/functions line 488:
        --user "${database_production_username}" --default-character-set "${database_production_encoding}" \
                                                                          ^-- SC2154: database_production_encoding is referenced but not assigned.


In assets/runtime/functions line 500:
  local dirname=$(basename "${directory}")
        ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 520:
  local tar_file="$(date +%s)_redmine_backup.tar"
        ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 535:
  if [[ "${config_default_backup_expiry}" -gt 0 ]]; then
         ^-- SC2154: config_default_backup_expiry is referenced but not assigned.


In assets/runtime/functions line 538:
    local now=$(date +%s)
          ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 542:
      local timestamp=$(stat -c %Y "${backup}")
            ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 565:
  if [[ $(vercmp "${REDMINE_VERSION}" "${backup_info_redmine_version}") -lt 0 ]]; then
                                       ^-- SC2154: backup_info_redmine_version is referenced but not assigned.


In assets/runtime/functions line 577:
  if [[ ${database_production_adapter} != ${backup_info_database_adapter} ]]; then
                                          ^-- SC2154: backup_info_database_adapter is referenced but not assigned.


In assets/runtime/functions line 621:
  local dirname=$(basename "${directory}")
        ^-- SC2155: Declare and assign separately to avoid masking return values.


In assets/runtime/functions line 657:
  mkdir -p ${REDMINE_LOG_DIR}/supervisor
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 658:
  chmod -R u+rw,go+r ${REDMINE_LOG_DIR}/supervisor
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 659:
  chown -R root: ${REDMINE_LOG_DIR}/supervisor
                 ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 661:
  mkdir -p ${REDMINE_LOG_DIR}/nginx
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 662:
  chmod -R u+rw,go+r ${REDMINE_LOG_DIR}/nginx
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 663:
  chown -R "${REDMINE_USER}": ${REDMINE_LOG_DIR}/nginx
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 665:
  mkdir -p ${REDMINE_LOG_DIR}/redmine
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 666:
  chmod -R u+rw,go+r ${REDMINE_LOG_DIR}/redmine
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 667:
  chown -R "${REDMINE_USER}": ${REDMINE_LOG_DIR}/redmine
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 672:
  chmod -R u+rw,go+r ${REDMINE_DATA_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 673:
  chown -R "${REDMINE_USER}": ${REDMINE_DATA_DIR}
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 676:
  mkdir -p ${REDMINE_PLUGINS_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 677:
  chmod -R u+rw,go+r ${REDMINE_PLUGINS_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 678:
  chown -R "${REDMINE_USER}": ${REDMINE_PLUGINS_DIR}
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 681:
  mkdir -p ${REDMINE_THEMES_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 682:
  chmod -R u+rw,go+r ${REDMINE_THEMES_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 683:
  chown -R "${REDMINE_USER}": ${REDMINE_THEMES_DIR}
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 686:
  mkdir -p ${REDMINE_ATTACHMENTS_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 687:
  chmod -R u+rw,go+r ${REDMINE_ATTACHMENTS_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 688:
  chown -R "${REDMINE_USER}": ${REDMINE_ATTACHMENTS_DIR}
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 691:
  mkdir -p ${REDMINE_BACKUPS_DIR}
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 692:
  chmod -R u+rw,go+r ${REDMINE_BACKUPS_DIR}
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 693:
  chown -R "${REDMINE_USER}": ${REDMINE_BACKUPS_DIR}
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 716:
  mkdir -p ${REDMINE_DATA_DIR}/tmp
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 717:
  chmod -R u+rw,go+r ${REDMINE_DATA_DIR}/tmp
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 718:
  chown -R "${REDMINE_USER}": ${REDMINE_DATA_DIR}/tmp
                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 735:
  for dotfile in "$(find ${REDMINE_DOTFILES_DIR} -maxdepth 1 -type d -not -path ${REDMINE_DOTFILES_DIR})"
                 ^-- SC2066: Since you double quoted this, it will not word split, and the loop will only run once.
                         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                                ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 737:
    exec_as_redmine rm -rf ${REDMINE_HOME}/$(basename ${dotfile})
                           ^-- SC2086: Double quote to prevent globbing and word splitting.
                                           ^-- SC2046: Quote this to prevent word splitting.
                                                      ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 738:
    exec_as_redmine ln -sf ${dotfile} ${REDMINE_HOME}/$(basename ${dotfile})
                           ^-- SC2086: Double quote to prevent globbing and word splitting.
                                      ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                      ^-- SC2046: Quote this to prevent word splitting.
                                                                 ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 745:
  install_template "${REDMINE_USER}": redmine/configuration.yml ${REDMINE_CONFIG} 0640
                                                                ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 746:
  install_template "${REDMINE_USER}": redmine/database.yml ${REDMINE_DATABASE_CONFIG} 0640
                                                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 747:
  install_template "${REDMINE_USER}": redmine/unicorn.rb ${REDMINE_UNICORN_CONFIG} 0644
                                                         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 748:
  install_template "${REDMINE_USER}": redmine/secret_token.rb ${REDMINE_SECRET_CONFIG} 0644
                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 751:
    install_template "${REDMINE_USER}": redmine/config.ru ${REDMINE_INSTALL_DIR}/config.ru 0644
                                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 779:
  update_template ${REDMINE_CONFIG} \
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 797:
    exec_as_redmine sed -i "s/:key => '_redmine_session'/:secure => true, :key => '_redmine_session'/" ${REDMINE_INSTALL_DIR}/config/application.rb
                                                                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 801:
  rm -rf ${REDMINE_INSTALL_DIR}/tmp/sockets/redmine.socket
         ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 884:
  [[ -f ${REDMINE_DATA_DIR}/tmp/VERSION ]] && CACHE_VERSION=$(cat ${REDMINE_DATA_DIR}/tmp/VERSION)
                                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 887:
    if [[ -n ${CACHE_VERSION} && $(vercmp ${REDMINE_VERSION} ${CACHE_VERSION}) -lt 0 ]]; then
                                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 898:
    rm -rf ${REDMINE_DATA_DIR}/tmp
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 899:
    exec_as_redmine mkdir -p ${REDMINE_DATA_DIR}/tmp
                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 900:
    exec_as_redmine mkdir -p ${REDMINE_DATA_DIR}/tmp/thumbnails
                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 901:
    exec_as_redmine mkdir -p ${REDMINE_DATA_DIR}/tmp/plugin_assets
                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 902:
    exec_as_redmine chmod -R u+rw,go+r ${REDMINE_DATA_DIR}/tmp
                                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 913:
    echo ${REDMINE_VERSION} | exec_as_redmine tee --append ${REDMINE_DATA_DIR}/tmp/VERSION >/dev/null
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 918:
    exec_as_redmine cp -a ${REDMINE_INSTALL_DIR}/vendor/bundle ${REDMINE_DATA_DIR}/tmp/
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 919:
    exec_as_redmine cp -a ${REDMINE_INSTALL_DIR}/Gemfile.lock ${REDMINE_DATA_DIR}/tmp/
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 921:
  rm -rf ${REDMINE_INSTALL_DIR}/vendor/bundle ${REDMINE_INSTALL_DIR}/Gemfile.lock
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 924:
  ln -sf ${REDMINE_DATA_DIR}/tmp/bundle ${REDMINE_INSTALL_DIR}/vendor/bundle
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 925:
  ln -sf ${REDMINE_DATA_DIR}/tmp/Gemfile.lock ${REDMINE_INSTALL_DIR}/Gemfile.lock
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 931:
    rsync -avq --chown=${REDMINE_USER}:${REDMINE_USER} ${REDMINE_PLUGINS_DIR}/ ${REDMINE_INSTALL_DIR}/plugins/
                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                               ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 935:
      mv ${REDMINE_PLUGINS_DIR}/init ${REDMINE_PLUGINS_DIR}/post-install.sh
         ^-- SC2086: Double quote to prevent globbing and word splitting.
                                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 941:
      . ${REDMINE_PLUGINS_DIR}/pre-install.sh
        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 946:
    [[ -f ${REDMINE_DATA_DIR}/tmp/plugins.sha1 ]] && CURRENT_SHA1=$(cat ${REDMINE_DATA_DIR}/tmp/plugins.sha1)
                                                                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 947:
    PLUGINS_SHA1=$(find ${REDMINE_PLUGINS_DIR} -type f -print0 | sort -z | xargs -0 sha1sum | sha1sum | awk '{print $1}')
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 951:
      rm -rf ${REDMINE_DATA_DIR}/tmp/plugin_assets/*
             ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 954:
      exec_as_redmine bundle install -j$(nproc) --without development test --path ${REDMINE_INSTALL_DIR}/vendor/bundle --quiet
                                       ^-- SC2046: Quote this to prevent word splitting.
                                                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 960:
      echo -n ${PLUGINS_SHA1} > ${REDMINE_DATA_DIR}/tmp/plugins.sha1
              ^-- SC2086: Double quote to prevent globbing and word splitting.
                                ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 966:
      . ${REDMINE_PLUGINS_DIR}/post-install.sh
        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 970:
    rm -rf ${REDMINE_DATA_DIR}/tmp/plugins.sha1
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 977:
    rsync -avq --chown=${REDMINE_USER}:${REDMINE_USER} ${REDMINE_THEMES_DIR}/ ${REDMINE_INSTALL_DIR}/public/themes/
                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                              ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 991:
  eval "$(parse_yaml ${REDMINE_CONFIG} config_)"
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 993:
  backup_dump_directory "${config_default_attachments_storage_path}" .tar
                         ^-- SC2154: config_default_attachments_storage_path is referenced but not assigned.


In assets/runtime/functions line 1003:
  eval "$(parse_yaml ${REDMINE_CONFIG} config_)"
                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1018:
    num_backups=$(find ${config_default_backup_storage_path}/*_redmine_backup.tar | wc -l)
                       ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1025:
    for b in $(find ${config_default_backup_storage_path}/*_redmine_backup.tar | sort -r)
                    ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1043:
  backup_restore_unpack ${tar_file}
                        ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1046:
  backup_restore_directory ${config_default_attachments_storage_path} .tar
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1048:
  backup_restore_directory ${REDMINE_PLUGINS_DIR} .tar.gz
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1049:
  backup_restore_directory ${REDMINE_THEMES_DIR} .tar.gz
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In assets/runtime/functions line 1052:
  rm -rf ${REDMINE_DATA_DIR}/tmp
         ^-- SC2086: Double quote to prevent globbing and word splitting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants