diff --git a/README.md b/README.md index 7bba8d7f..6ca5f203 100644 --- a/README.md +++ b/README.md @@ -631,6 +631,7 @@ Below is the complete list of parameters that can be set using environment varia - **DB_POOL**: The database connection pool count. Defaults to `5`. - **DB_SKIP_CHECK**: Skip waiting for the database to start. Defaults to `false`. - **DB_SSL_MODE**: Configures the database ssl mode. Valid options for [postgresql](https://www.postgresql.org/docs/9.1/libpq-ssl.html) (disable|allow|prefer|require|verify-ca|verify-full) and [mysql](https://dev.mysql.com/doc/refman/5.7/en/connection-options.html#option_general_ssl-mode) (disable||preferred|required|verify_ca|verify_identity). Defaults to '' +- **LOGGER_LEVEL**: Configures the amount of messages that are generated when redmine is running. Possible values are: `debug`, `info`, `warn`, `error`. Defaults to `info` - **NGINX_ENABLED**: Enable/disable the nginx server. Disabling Nginx is not recommended (see #148), use at your discretion. Defaults to `true`. When disabled publish port `8080` instead of the usual port `80` or `443`. - **NGINX_WORKERS**: The number of nginx workers to start. Defaults to `1`. - **NGINX_MAX_UPLOAD_SIZE**: Maximum acceptable upload size. Defaults to `20m`. diff --git a/assets/runtime/config/redmine/additional_environment.rb b/assets/runtime/config/redmine/additional_environment.rb index afdf7ff2..2a317a39 100644 --- a/assets/runtime/config/redmine/additional_environment.rb +++ b/assets/runtime/config/redmine/additional_environment.rb @@ -1,4 +1,10 @@ -config.gem 'dalli' -config.action_controller.perform_caching = true -config.cache_classes = true -config.cache_store = :mem_cache_store, "{{MEMCACHE_HOST}}:{{MEMCACHE_PORT}}" +# Copy this file to additional_environment.rb and add any statements +# that need to be passed to the Rails::Initializer. `config` is +# available in this context. +# +# Example: +# +# config.log_level = :debug +# ... +# + diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index 10231476..6bcc722c 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -3,6 +3,9 @@ # DEBUGGING DEBUG=${DEBUG:-} +# LOGGER +LOGGER_LEVEL=${LOGGER_LEVEL:-info} + ## CORE REDMINE_ATTACHMENTS_DIR=${REDMINE_ATTACHMENTS_DIR:-$REDMINE_DATA_DIR/files} REDMINE_PLUGINS_DIR=${REDMINE_PLUGINS_DIR:-$REDMINE_DATA_DIR/plugins} diff --git a/assets/runtime/functions b/assets/runtime/functions index 9e8a39e6..e429657b 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -9,7 +9,7 @@ REDMINE_CONFIG="${REDMINE_INSTALL_DIR}/config/configuration.yml" REDMINE_DATABASE_CONFIG="${REDMINE_INSTALL_DIR}/config/database.yml" REDMINE_UNICORN_CONFIG="${REDMINE_INSTALL_DIR}/config/unicorn.rb" REDMINE_SECRET_CONFIG="${REDMINE_INSTALL_DIR}/config/initializers/secret_token.rb" -REDMINE_MEMCACHED_CONFIG="${REDMINE_INSTALL_DIR}/config/additional_environment.rb" +REDMINE_ADDITIONAL_CONFIG="${REDMINE_INSTALL_DIR}/config/additional_environment.rb" REDMINE_NGINX_CONFIG="/etc/nginx/sites-enabled/redmine" IMAGE_VERSION=$(cat /VERSION) @@ -329,13 +329,20 @@ redmine_configure_memcached() { if [[ ${MEMCACHE_ENABLED} == true ]]; then echo "Configuring redmine::memcached..." - install_template ${REDMINE_USER}: redmine/additional_environment.rb ${REDMINE_MEMCACHED_CONFIG} 0644 - update_template ${REDMINE_MEMCACHED_CONFIG} \ - MEMCACHE_HOST \ - MEMCACHE_PORT + { + echo "config.gem 'dalli'" + echo "config.action_controller.perform_caching = true" + echo "config.cache_classes = true" + echo "config.cache_store = :mem_cache_store, ${MEMCACHE_HOST}:${MEMCACHE_PORT}" + } >> "${REDMINE_ADDITIONAL_CONFIG}" fi } +redmine_configure_logger() { + echo "Configuring redmine::logger..." + echo "config.log_level = :${LOGGER_LEVEL}" >> "${REDMINE_ADDITIONAL_CONFIG}" +} + redmine_configure_unicorn() { echo "Configuring redmine::unicorn..." if [[ ${REDMINE_RELATIVE_URL_ROOT} == / ]]; then @@ -852,6 +859,7 @@ symlink_dotfiles() { install_configuration_templates() { echo "Installing configuration templates..." + install_template ${REDMINE_USER}: redmine/additional_environment.rb ${REDMINE_ADDITIONAL_CONFIG} 0644 install_template ${REDMINE_USER}: redmine/configuration.yml ${REDMINE_CONFIG} 0640 install_template ${REDMINE_USER}: redmine/database.yml ${REDMINE_DATABASE_CONFIG} 0640 install_template ${REDMINE_USER}: redmine/unicorn.rb ${REDMINE_UNICORN_CONFIG} 0644 @@ -892,6 +900,7 @@ configure_redmine() { redmine_configure_database redmine_configure_memcached + redmine_configure_logger redmine_configure_unicorn redmine_configure_secret_token redmine_configure_concurrent_uploads