Skip to content

Commit

Permalink
Merge pull request #546 from siberianlove/feature-configure-avatar-se…
Browse files Browse the repository at this point in the history
…rver

Add avatar server URL configuration support
  • Loading branch information
jcormier authored Feb 28, 2024
2 parents 3caaad0 + 91696e8 commit 590d949
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ Below is the complete list of parameters that can be set using environment varia
- **REDMINE_BACKUP_SCHEDULE**: Setup cron job to schedule automatic backups. Possible values `disable`, `daily`, `weekly` or `monthly`. Disabled by default
- **REDMINE_BACKUP_EXPIRY**: Configure how long (in seconds) to keep backups before they are deleted. By default when automated backups are disabled backups are kept forever (0 seconds), else the backups expire in 7 days (604800 seconds).
- **REDMINE_BACKUP_TIME**: Set a time for the automatic backups in `HH:MM` format. Defaults to `04:00`.
- **REDMINE_AVATAR_SERVER_URL**: Avatar server for displaying user icons. Defaults to `https://www.gravatar.com`
- **DATABASE_URL**: The database URL. See [Configuring a Database](https://guides.rubyonrails.org/configuring.html#configuring-a-database). Possible schemes: `postgres`, `postgresql`, `mysql2`, and `sqlite3`. Defaults to no URL.
- **DB_ADAPTER**: The database type. Possible values: `mysql2`, `postgresql`, and 'sqlite3'. Defaults to `mysql`.
- **DB_ENCODING**: The database encoding. For `DB_ADAPTER` values `postresql` and `mysql2`, this parameter defaults to `unicode` and `utf8` respectively. For full unicode support (all emojis) with mariadb or mysql set this to `utf8mb4` and make sure to also set all tables to `utf8mb4` and use `collate utf8mb4_unicode_ci`. Existing databases can be converted by following this [HowTo](https://www.redmine.org/projects/redmine/wiki/HowTo_convert_a_database_from_utf8_to_utf8mb4).
Expand Down
2 changes: 1 addition & 1 deletion assets/runtime/config/redmine/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ default:
#
# URL of each avatar is: #{avatar_server_url}/avatar/#{hash}
#
#avatar_server_url: https://www.gravatar.com # default
avatar_server_url: {{REDMINE_AVATAR_SERVER_URL}}
#avatar_server_url: https://seccdn.libravatar.org

# Configure CommonMark hardbreaks behaviour
Expand Down
3 changes: 3 additions & 0 deletions assets/runtime/env-defaults
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,6 @@ fi

## MINIMAGICK
REDMINE_MINIMAGICK_FONT_PATH=${REDMINE_MINIMAGICK_FONT_PATH:-/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf}

## AVATAR_SERVER
REDMINE_AVATAR_SERVER_URL=${REDMINE_AVATAR_SERVER_URL:-https://www.gravatar.com}
7 changes: 7 additions & 0 deletions assets/runtime/functions
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,12 @@ redmine_configure_minimagick_font() {
REDMINE_MINIMAGICK_FONT_PATH
}

redmine_configure_avatar_server() {
echo "Configuring redmine::avatar::url..."
update_template ${REDMINE_CONFIG} \
REDMINE_AVATAR_SERVER_URL
}

backup_dump_database() {
eval $(parse_yaml "${REDMINE_CONFIG}" config_)
eval $(parse_yaml "${REDMINE_DATABASE_CONFIG}" database_)
Expand Down Expand Up @@ -895,6 +901,7 @@ configure_redmine() {
redmine_configure_fetch_commits
redmine_configure_backups
redmine_configure_minimagick_font
redmine_configure_avatar_server

# configure secure-cookie if using SSL/TLS
if [[ ${REDMINE_HTTPS} == true ]]; then
Expand Down

0 comments on commit 590d949

Please sign in to comment.