-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Update redmine #20059
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
Merged
Merged
Update redmine #20059
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changes: - docker-library/redmine@01d5e42: Fix for rails getting confused by an empty env var (docker-library/redmine#398)
Diff for bd2c425:diff --git a/_bashbrew-cat b/_bashbrew-cat
index f67d2d3..bfe92cc 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -3,60 +3,60 @@ GitRepo: https://github.com/docker-library/redmine.git
Tags: 5.1.10, 5.1, 5, 5.1.10-trixie, 5.1-trixie, 5-trixie
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: b5192c29c3c06bafb09b57eec4fa7f2f1a64ec03
+GitCommit: 01d5e42cea07875240d7a6f4f6b3a1e13fdcf411
Directory: 5.1/trixie
Tags: 5.1.10-alpine3.21, 5.1-alpine3.21, 5-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 912d5e834802a5b3901bbc8bc642f8aff3ce91b8
+GitCommit: 01d5e42cea07875240d7a6f4f6b3a1e13fdcf411
Directory: 5.1/alpine3.21
Tags: 5.1.10-alpine3.22, 5.1-alpine3.22, 5-alpine3.22, 5.1.10-alpine, 5.1-alpine, 5-alpine
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 912d5e834802a5b3901bbc8bc642f8aff3ce91b8
+GitCommit: 01d5e42cea07875240d7a6f4f6b3a1e13fdcf411
Directory: 5.1/alpine3.22
Tags: 5.1.10-bookworm, 5.1-bookworm, 5-bookworm
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 912d5e834802a5b3901bbc8bc642f8aff3ce91b8
+GitCommit: 01d5e42cea07875240d7a6f4f6b3a1e13fdcf411
Directory: 5.1/bookworm
Tags: 6.0.7, 6.0, 6.0.7-trixie, 6.0-trixie
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: a5559e1b8e4ff20203b73604dd91c3eb184899f1
+GitCommit: 01d5e42cea07875240d7a6f4f6b3a1e13fdcf411
Directory: 6.0/trixie
Tags: 6.0.7-alpine3.21, 6.0-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 912d5e834802a5b3901bbc8bc642f8aff3ce91b8
+GitCommit: 01d5e42cea07875240d7a6f4f6b3a1e13fdcf411
Directory: 6.0/alpine3.21
Tags: 6.0.7-alpine3.22, 6.0-alpine3.22, 6.0.7-alpine, 6.0-alpine
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 912d5e834802a5b3901bbc8bc642f8aff3ce91b8
+GitCommit: 01d5e42cea07875240d7a6f4f6b3a1e13fdcf411
Directory: 6.0/alpine3.22
Tags: 6.0.7-bookworm, 6.0-bookworm
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 912d5e834802a5b3901bbc8bc642f8aff3ce91b8
+GitCommit: 01d5e42cea07875240d7a6f4f6b3a1e13fdcf411
Directory: 6.0/bookworm
Tags: 6.1.0, 6.1, 6, latest, 6.1.0-trixie, 6.1-trixie, 6-trixie, trixie
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 782887eb82bfea15a4a6ea05569b81b323dd25cc
+GitCommit: 01d5e42cea07875240d7a6f4f6b3a1e13fdcf411
Directory: 6.1/trixie
Tags: 6.1.0-alpine3.21, 6.1-alpine3.21, 6-alpine3.21, alpine3.21
Architectures: amd64, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 782887eb82bfea15a4a6ea05569b81b323dd25cc
+GitCommit: 01d5e42cea07875240d7a6f4f6b3a1e13fdcf411
Directory: 6.1/alpine3.21
Tags: 6.1.0-alpine3.22, 6.1-alpine3.22, 6-alpine3.22, alpine3.22, 6.1.0-alpine, 6.1-alpine, 6-alpine, alpine
Architectures: amd64, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 782887eb82bfea15a4a6ea05569b81b323dd25cc
+GitCommit: 01d5e42cea07875240d7a6f4f6b3a1e13fdcf411
Directory: 6.1/alpine3.22
Tags: 6.1.0-bookworm, 6.1-bookworm, 6-bookworm, bookworm
Architectures: amd64, arm64v8
-GitCommit: f0741776f38b451da162138348628b8cf44b5a23
+GitCommit: 01d5e42cea07875240d7a6f4f6b3a1e13fdcf411
Directory: 6.1/bookworm
diff --git a/redmine_5-alpine/docker-entrypoint.sh b/redmine_5-alpine/docker-entrypoint.sh
index 0bcee63..f956052 100755
--- a/redmine_5-alpine/docker-entrypoint.sh
+++ b/redmine_5-alpine/docker-entrypoint.sh
@@ -144,19 +144,26 @@ if [ -n "$isLikelyRedmine" ]; then
# just use the rails variable rather than trying to put it into a yml file
# https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/application.rb#L438
# https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L484 (rails 7.1-stable)
- if [ -n "${SECRET_KEY_BASE}" ] && [ -n "${REDMINE_SECRET_KEY_BASE}" ]; then
+ if [ -n "${SECRET_KEY_BASE:-}" ] && [ -n "${REDMINE_SECRET_KEY_BASE:-}" ]; then
echo >&2
echo >&2 'warning: both SECRET_KEY_BASE and REDMINE_SECRET_KEY_BASE{_FILE} set, only SECRET_KEY_BASE will apply'
echo >&2
fi
- : "${SECRET_KEY_BASE:=$REDMINE_SECRET_KEY_BASE}"
+ : "${SECRET_KEY_BASE:=${REDMINE_SECRET_KEY_BASE:-}}"
export SECRET_KEY_BASE
- # generate SECRET_KEY_BASE if not set; this is not recommended unless the secret_token.rb is saved when container is recreated
- if [ -z "$SECRET_KEY_BASE" ] && [ ! -f config/initializers/secret_token.rb ]; then
+ if [ -z "$SECRET_KEY_BASE" ]; then
+ # https://github.com/docker-library/redmine/issues/397
+ # empty string is truthy in ruby and so masks the generated fallback config
+ # https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L454
+ unset SECRET_KEY_BASE
+ # generate SECRET_KEY_BASE in-file since it is not set or empty; this is not recommended unless the secret_token.rb is saved when container is recreated
+ if [ ! -f config/initializers/secret_token.rb ]; then
+ echo >&2
echo >&2 'warning: no *SECRET_KEY_BASE set; running `rake generate_secret_token` to create one in "config/initializers/secret_token.rb"'
- unset SECRET_KEY_BASE # just in case
+ echo >&2
rake generate_secret_token
fi
+ fi
if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrate
diff --git a/redmine_5-alpine3.21/docker-entrypoint.sh b/redmine_5-alpine3.21/docker-entrypoint.sh
index 0bcee63..f956052 100755
--- a/redmine_5-alpine3.21/docker-entrypoint.sh
+++ b/redmine_5-alpine3.21/docker-entrypoint.sh
@@ -144,19 +144,26 @@ if [ -n "$isLikelyRedmine" ]; then
# just use the rails variable rather than trying to put it into a yml file
# https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/application.rb#L438
# https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L484 (rails 7.1-stable)
- if [ -n "${SECRET_KEY_BASE}" ] && [ -n "${REDMINE_SECRET_KEY_BASE}" ]; then
+ if [ -n "${SECRET_KEY_BASE:-}" ] && [ -n "${REDMINE_SECRET_KEY_BASE:-}" ]; then
echo >&2
echo >&2 'warning: both SECRET_KEY_BASE and REDMINE_SECRET_KEY_BASE{_FILE} set, only SECRET_KEY_BASE will apply'
echo >&2
fi
- : "${SECRET_KEY_BASE:=$REDMINE_SECRET_KEY_BASE}"
+ : "${SECRET_KEY_BASE:=${REDMINE_SECRET_KEY_BASE:-}}"
export SECRET_KEY_BASE
- # generate SECRET_KEY_BASE if not set; this is not recommended unless the secret_token.rb is saved when container is recreated
- if [ -z "$SECRET_KEY_BASE" ] && [ ! -f config/initializers/secret_token.rb ]; then
+ if [ -z "$SECRET_KEY_BASE" ]; then
+ # https://github.com/docker-library/redmine/issues/397
+ # empty string is truthy in ruby and so masks the generated fallback config
+ # https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L454
+ unset SECRET_KEY_BASE
+ # generate SECRET_KEY_BASE in-file since it is not set or empty; this is not recommended unless the secret_token.rb is saved when container is recreated
+ if [ ! -f config/initializers/secret_token.rb ]; then
+ echo >&2
echo >&2 'warning: no *SECRET_KEY_BASE set; running `rake generate_secret_token` to create one in "config/initializers/secret_token.rb"'
- unset SECRET_KEY_BASE # just in case
+ echo >&2
rake generate_secret_token
fi
+ fi
if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrate
diff --git a/redmine_5-bookworm/docker-entrypoint.sh b/redmine_5-bookworm/docker-entrypoint.sh
index 0bcee63..f956052 100755
--- a/redmine_5-bookworm/docker-entrypoint.sh
+++ b/redmine_5-bookworm/docker-entrypoint.sh
@@ -144,19 +144,26 @@ if [ -n "$isLikelyRedmine" ]; then
# just use the rails variable rather than trying to put it into a yml file
# https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/application.rb#L438
# https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L484 (rails 7.1-stable)
- if [ -n "${SECRET_KEY_BASE}" ] && [ -n "${REDMINE_SECRET_KEY_BASE}" ]; then
+ if [ -n "${SECRET_KEY_BASE:-}" ] && [ -n "${REDMINE_SECRET_KEY_BASE:-}" ]; then
echo >&2
echo >&2 'warning: both SECRET_KEY_BASE and REDMINE_SECRET_KEY_BASE{_FILE} set, only SECRET_KEY_BASE will apply'
echo >&2
fi
- : "${SECRET_KEY_BASE:=$REDMINE_SECRET_KEY_BASE}"
+ : "${SECRET_KEY_BASE:=${REDMINE_SECRET_KEY_BASE:-}}"
export SECRET_KEY_BASE
- # generate SECRET_KEY_BASE if not set; this is not recommended unless the secret_token.rb is saved when container is recreated
- if [ -z "$SECRET_KEY_BASE" ] && [ ! -f config/initializers/secret_token.rb ]; then
+ if [ -z "$SECRET_KEY_BASE" ]; then
+ # https://github.com/docker-library/redmine/issues/397
+ # empty string is truthy in ruby and so masks the generated fallback config
+ # https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L454
+ unset SECRET_KEY_BASE
+ # generate SECRET_KEY_BASE in-file since it is not set or empty; this is not recommended unless the secret_token.rb is saved when container is recreated
+ if [ ! -f config/initializers/secret_token.rb ]; then
+ echo >&2
echo >&2 'warning: no *SECRET_KEY_BASE set; running `rake generate_secret_token` to create one in "config/initializers/secret_token.rb"'
- unset SECRET_KEY_BASE # just in case
+ echo >&2
rake generate_secret_token
fi
+ fi
if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrate
diff --git a/redmine_5-trixie/docker-entrypoint.sh b/redmine_5-trixie/docker-entrypoint.sh
index 0bcee63..f956052 100755
--- a/redmine_5-trixie/docker-entrypoint.sh
+++ b/redmine_5-trixie/docker-entrypoint.sh
@@ -144,19 +144,26 @@ if [ -n "$isLikelyRedmine" ]; then
# just use the rails variable rather than trying to put it into a yml file
# https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/application.rb#L438
# https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L484 (rails 7.1-stable)
- if [ -n "${SECRET_KEY_BASE}" ] && [ -n "${REDMINE_SECRET_KEY_BASE}" ]; then
+ if [ -n "${SECRET_KEY_BASE:-}" ] && [ -n "${REDMINE_SECRET_KEY_BASE:-}" ]; then
echo >&2
echo >&2 'warning: both SECRET_KEY_BASE and REDMINE_SECRET_KEY_BASE{_FILE} set, only SECRET_KEY_BASE will apply'
echo >&2
fi
- : "${SECRET_KEY_BASE:=$REDMINE_SECRET_KEY_BASE}"
+ : "${SECRET_KEY_BASE:=${REDMINE_SECRET_KEY_BASE:-}}"
export SECRET_KEY_BASE
- # generate SECRET_KEY_BASE if not set; this is not recommended unless the secret_token.rb is saved when container is recreated
- if [ -z "$SECRET_KEY_BASE" ] && [ ! -f config/initializers/secret_token.rb ]; then
+ if [ -z "$SECRET_KEY_BASE" ]; then
+ # https://github.com/docker-library/redmine/issues/397
+ # empty string is truthy in ruby and so masks the generated fallback config
+ # https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L454
+ unset SECRET_KEY_BASE
+ # generate SECRET_KEY_BASE in-file since it is not set or empty; this is not recommended unless the secret_token.rb is saved when container is recreated
+ if [ ! -f config/initializers/secret_token.rb ]; then
+ echo >&2
echo >&2 'warning: no *SECRET_KEY_BASE set; running `rake generate_secret_token` to create one in "config/initializers/secret_token.rb"'
- unset SECRET_KEY_BASE # just in case
+ echo >&2
rake generate_secret_token
fi
+ fi
if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrate
diff --git a/redmine_6.0-alpine/docker-entrypoint.sh b/redmine_6.0-alpine/docker-entrypoint.sh
index 0bcee63..f956052 100755
--- a/redmine_6.0-alpine/docker-entrypoint.sh
+++ b/redmine_6.0-alpine/docker-entrypoint.sh
@@ -144,19 +144,26 @@ if [ -n "$isLikelyRedmine" ]; then
# just use the rails variable rather than trying to put it into a yml file
# https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/application.rb#L438
# https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L484 (rails 7.1-stable)
- if [ -n "${SECRET_KEY_BASE}" ] && [ -n "${REDMINE_SECRET_KEY_BASE}" ]; then
+ if [ -n "${SECRET_KEY_BASE:-}" ] && [ -n "${REDMINE_SECRET_KEY_BASE:-}" ]; then
echo >&2
echo >&2 'warning: both SECRET_KEY_BASE and REDMINE_SECRET_KEY_BASE{_FILE} set, only SECRET_KEY_BASE will apply'
echo >&2
fi
- : "${SECRET_KEY_BASE:=$REDMINE_SECRET_KEY_BASE}"
+ : "${SECRET_KEY_BASE:=${REDMINE_SECRET_KEY_BASE:-}}"
export SECRET_KEY_BASE
- # generate SECRET_KEY_BASE if not set; this is not recommended unless the secret_token.rb is saved when container is recreated
- if [ -z "$SECRET_KEY_BASE" ] && [ ! -f config/initializers/secret_token.rb ]; then
+ if [ -z "$SECRET_KEY_BASE" ]; then
+ # https://github.com/docker-library/redmine/issues/397
+ # empty string is truthy in ruby and so masks the generated fallback config
+ # https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L454
+ unset SECRET_KEY_BASE
+ # generate SECRET_KEY_BASE in-file since it is not set or empty; this is not recommended unless the secret_token.rb is saved when container is recreated
+ if [ ! -f config/initializers/secret_token.rb ]; then
+ echo >&2
echo >&2 'warning: no *SECRET_KEY_BASE set; running `rake generate_secret_token` to create one in "config/initializers/secret_token.rb"'
- unset SECRET_KEY_BASE # just in case
+ echo >&2
rake generate_secret_token
fi
+ fi
if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrate
diff --git a/redmine_6.0-alpine3.21/docker-entrypoint.sh b/redmine_6.0-alpine3.21/docker-entrypoint.sh
index 0bcee63..f956052 100755
--- a/redmine_6.0-alpine3.21/docker-entrypoint.sh
+++ b/redmine_6.0-alpine3.21/docker-entrypoint.sh
@@ -144,19 +144,26 @@ if [ -n "$isLikelyRedmine" ]; then
# just use the rails variable rather than trying to put it into a yml file
# https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/application.rb#L438
# https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L484 (rails 7.1-stable)
- if [ -n "${SECRET_KEY_BASE}" ] && [ -n "${REDMINE_SECRET_KEY_BASE}" ]; then
+ if [ -n "${SECRET_KEY_BASE:-}" ] && [ -n "${REDMINE_SECRET_KEY_BASE:-}" ]; then
echo >&2
echo >&2 'warning: both SECRET_KEY_BASE and REDMINE_SECRET_KEY_BASE{_FILE} set, only SECRET_KEY_BASE will apply'
echo >&2
fi
- : "${SECRET_KEY_BASE:=$REDMINE_SECRET_KEY_BASE}"
+ : "${SECRET_KEY_BASE:=${REDMINE_SECRET_KEY_BASE:-}}"
export SECRET_KEY_BASE
- # generate SECRET_KEY_BASE if not set; this is not recommended unless the secret_token.rb is saved when container is recreated
- if [ -z "$SECRET_KEY_BASE" ] && [ ! -f config/initializers/secret_token.rb ]; then
+ if [ -z "$SECRET_KEY_BASE" ]; then
+ # https://github.com/docker-library/redmine/issues/397
+ # empty string is truthy in ruby and so masks the generated fallback config
+ # https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L454
+ unset SECRET_KEY_BASE
+ # generate SECRET_KEY_BASE in-file since it is not set or empty; this is not recommended unless the secret_token.rb is saved when container is recreated
+ if [ ! -f config/initializers/secret_token.rb ]; then
+ echo >&2
echo >&2 'warning: no *SECRET_KEY_BASE set; running `rake generate_secret_token` to create one in "config/initializers/secret_token.rb"'
- unset SECRET_KEY_BASE # just in case
+ echo >&2
rake generate_secret_token
fi
+ fi
if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrate
diff --git a/redmine_6.0-bookworm/docker-entrypoint.sh b/redmine_6.0-bookworm/docker-entrypoint.sh
index 0bcee63..f956052 100755
--- a/redmine_6.0-bookworm/docker-entrypoint.sh
+++ b/redmine_6.0-bookworm/docker-entrypoint.sh
@@ -144,19 +144,26 @@ if [ -n "$isLikelyRedmine" ]; then
# just use the rails variable rather than trying to put it into a yml file
# https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/application.rb#L438
# https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L484 (rails 7.1-stable)
- if [ -n "${SECRET_KEY_BASE}" ] && [ -n "${REDMINE_SECRET_KEY_BASE}" ]; then
+ if [ -n "${SECRET_KEY_BASE:-}" ] && [ -n "${REDMINE_SECRET_KEY_BASE:-}" ]; then
echo >&2
echo >&2 'warning: both SECRET_KEY_BASE and REDMINE_SECRET_KEY_BASE{_FILE} set, only SECRET_KEY_BASE will apply'
echo >&2
fi
- : "${SECRET_KEY_BASE:=$REDMINE_SECRET_KEY_BASE}"
+ : "${SECRET_KEY_BASE:=${REDMINE_SECRET_KEY_BASE:-}}"
export SECRET_KEY_BASE
- # generate SECRET_KEY_BASE if not set; this is not recommended unless the secret_token.rb is saved when container is recreated
- if [ -z "$SECRET_KEY_BASE" ] && [ ! -f config/initializers/secret_token.rb ]; then
+ if [ -z "$SECRET_KEY_BASE" ]; then
+ # https://github.com/docker-library/redmine/issues/397
+ # empty string is truthy in ruby and so masks the generated fallback config
+ # https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L454
+ unset SECRET_KEY_BASE
+ # generate SECRET_KEY_BASE in-file since it is not set or empty; this is not recommended unless the secret_token.rb is saved when container is recreated
+ if [ ! -f config/initializers/secret_token.rb ]; then
+ echo >&2
echo >&2 'warning: no *SECRET_KEY_BASE set; running `rake generate_secret_token` to create one in "config/initializers/secret_token.rb"'
- unset SECRET_KEY_BASE # just in case
+ echo >&2
rake generate_secret_token
fi
+ fi
if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrate
diff --git a/redmine_6.0-trixie/docker-entrypoint.sh b/redmine_6.0-trixie/docker-entrypoint.sh
index 0bcee63..f956052 100755
--- a/redmine_6.0-trixie/docker-entrypoint.sh
+++ b/redmine_6.0-trixie/docker-entrypoint.sh
@@ -144,19 +144,26 @@ if [ -n "$isLikelyRedmine" ]; then
# just use the rails variable rather than trying to put it into a yml file
# https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/application.rb#L438
# https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L484 (rails 7.1-stable)
- if [ -n "${SECRET_KEY_BASE}" ] && [ -n "${REDMINE_SECRET_KEY_BASE}" ]; then
+ if [ -n "${SECRET_KEY_BASE:-}" ] && [ -n "${REDMINE_SECRET_KEY_BASE:-}" ]; then
echo >&2
echo >&2 'warning: both SECRET_KEY_BASE and REDMINE_SECRET_KEY_BASE{_FILE} set, only SECRET_KEY_BASE will apply'
echo >&2
fi
- : "${SECRET_KEY_BASE:=$REDMINE_SECRET_KEY_BASE}"
+ : "${SECRET_KEY_BASE:=${REDMINE_SECRET_KEY_BASE:-}}"
export SECRET_KEY_BASE
- # generate SECRET_KEY_BASE if not set; this is not recommended unless the secret_token.rb is saved when container is recreated
- if [ -z "$SECRET_KEY_BASE" ] && [ ! -f config/initializers/secret_token.rb ]; then
+ if [ -z "$SECRET_KEY_BASE" ]; then
+ # https://github.com/docker-library/redmine/issues/397
+ # empty string is truthy in ruby and so masks the generated fallback config
+ # https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L454
+ unset SECRET_KEY_BASE
+ # generate SECRET_KEY_BASE in-file since it is not set or empty; this is not recommended unless the secret_token.rb is saved when container is recreated
+ if [ ! -f config/initializers/secret_token.rb ]; then
+ echo >&2
echo >&2 'warning: no *SECRET_KEY_BASE set; running `rake generate_secret_token` to create one in "config/initializers/secret_token.rb"'
- unset SECRET_KEY_BASE # just in case
+ echo >&2
rake generate_secret_token
fi
+ fi
if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrate
diff --git a/redmine_alpine/docker-entrypoint.sh b/redmine_alpine/docker-entrypoint.sh
index 0bcee63..f956052 100755
--- a/redmine_alpine/docker-entrypoint.sh
+++ b/redmine_alpine/docker-entrypoint.sh
@@ -144,19 +144,26 @@ if [ -n "$isLikelyRedmine" ]; then
# just use the rails variable rather than trying to put it into a yml file
# https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/application.rb#L438
# https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L484 (rails 7.1-stable)
- if [ -n "${SECRET_KEY_BASE}" ] && [ -n "${REDMINE_SECRET_KEY_BASE}" ]; then
+ if [ -n "${SECRET_KEY_BASE:-}" ] && [ -n "${REDMINE_SECRET_KEY_BASE:-}" ]; then
echo >&2
echo >&2 'warning: both SECRET_KEY_BASE and REDMINE_SECRET_KEY_BASE{_FILE} set, only SECRET_KEY_BASE will apply'
echo >&2
fi
- : "${SECRET_KEY_BASE:=$REDMINE_SECRET_KEY_BASE}"
+ : "${SECRET_KEY_BASE:=${REDMINE_SECRET_KEY_BASE:-}}"
export SECRET_KEY_BASE
- # generate SECRET_KEY_BASE if not set; this is not recommended unless the secret_token.rb is saved when container is recreated
- if [ -z "$SECRET_KEY_BASE" ] && [ ! -f config/initializers/secret_token.rb ]; then
+ if [ -z "$SECRET_KEY_BASE" ]; then
+ # https://github.com/docker-library/redmine/issues/397
+ # empty string is truthy in ruby and so masks the generated fallback config
+ # https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L454
+ unset SECRET_KEY_BASE
+ # generate SECRET_KEY_BASE in-file since it is not set or empty; this is not recommended unless the secret_token.rb is saved when container is recreated
+ if [ ! -f config/initializers/secret_token.rb ]; then
+ echo >&2
echo >&2 'warning: no *SECRET_KEY_BASE set; running `rake generate_secret_token` to create one in "config/initializers/secret_token.rb"'
- unset SECRET_KEY_BASE # just in case
+ echo >&2
rake generate_secret_token
fi
+ fi
if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrate
diff --git a/redmine_alpine3.21/docker-entrypoint.sh b/redmine_alpine3.21/docker-entrypoint.sh
index 0bcee63..f956052 100755
--- a/redmine_alpine3.21/docker-entrypoint.sh
+++ b/redmine_alpine3.21/docker-entrypoint.sh
@@ -144,19 +144,26 @@ if [ -n "$isLikelyRedmine" ]; then
# just use the rails variable rather than trying to put it into a yml file
# https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/application.rb#L438
# https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L484 (rails 7.1-stable)
- if [ -n "${SECRET_KEY_BASE}" ] && [ -n "${REDMINE_SECRET_KEY_BASE}" ]; then
+ if [ -n "${SECRET_KEY_BASE:-}" ] && [ -n "${REDMINE_SECRET_KEY_BASE:-}" ]; then
echo >&2
echo >&2 'warning: both SECRET_KEY_BASE and REDMINE_SECRET_KEY_BASE{_FILE} set, only SECRET_KEY_BASE will apply'
echo >&2
fi
- : "${SECRET_KEY_BASE:=$REDMINE_SECRET_KEY_BASE}"
+ : "${SECRET_KEY_BASE:=${REDMINE_SECRET_KEY_BASE:-}}"
export SECRET_KEY_BASE
- # generate SECRET_KEY_BASE if not set; this is not recommended unless the secret_token.rb is saved when container is recreated
- if [ -z "$SECRET_KEY_BASE" ] && [ ! -f config/initializers/secret_token.rb ]; then
+ if [ -z "$SECRET_KEY_BASE" ]; then
+ # https://github.com/docker-library/redmine/issues/397
+ # empty string is truthy in ruby and so masks the generated fallback config
+ # https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L454
+ unset SECRET_KEY_BASE
+ # generate SECRET_KEY_BASE in-file since it is not set or empty; this is not recommended unless the secret_token.rb is saved when container is recreated
+ if [ ! -f config/initializers/secret_token.rb ]; then
+ echo >&2
echo >&2 'warning: no *SECRET_KEY_BASE set; running `rake generate_secret_token` to create one in "config/initializers/secret_token.rb"'
- unset SECRET_KEY_BASE # just in case
+ echo >&2
rake generate_secret_token
fi
+ fi
if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrate
diff --git a/redmine_bookworm/docker-entrypoint.sh b/redmine_bookworm/docker-entrypoint.sh
index 0bcee63..f956052 100755
--- a/redmine_bookworm/docker-entrypoint.sh
+++ b/redmine_bookworm/docker-entrypoint.sh
@@ -144,19 +144,26 @@ if [ -n "$isLikelyRedmine" ]; then
# just use the rails variable rather than trying to put it into a yml file
# https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/application.rb#L438
# https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L484 (rails 7.1-stable)
- if [ -n "${SECRET_KEY_BASE}" ] && [ -n "${REDMINE_SECRET_KEY_BASE}" ]; then
+ if [ -n "${SECRET_KEY_BASE:-}" ] && [ -n "${REDMINE_SECRET_KEY_BASE:-}" ]; then
echo >&2
echo >&2 'warning: both SECRET_KEY_BASE and REDMINE_SECRET_KEY_BASE{_FILE} set, only SECRET_KEY_BASE will apply'
echo >&2
fi
- : "${SECRET_KEY_BASE:=$REDMINE_SECRET_KEY_BASE}"
+ : "${SECRET_KEY_BASE:=${REDMINE_SECRET_KEY_BASE:-}}"
export SECRET_KEY_BASE
- # generate SECRET_KEY_BASE if not set; this is not recommended unless the secret_token.rb is saved when container is recreated
- if [ -z "$SECRET_KEY_BASE" ] && [ ! -f config/initializers/secret_token.rb ]; then
+ if [ -z "$SECRET_KEY_BASE" ]; then
+ # https://github.com/docker-library/redmine/issues/397
+ # empty string is truthy in ruby and so masks the generated fallback config
+ # https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L454
+ unset SECRET_KEY_BASE
+ # generate SECRET_KEY_BASE in-file since it is not set or empty; this is not recommended unless the secret_token.rb is saved when container is recreated
+ if [ ! -f config/initializers/secret_token.rb ]; then
+ echo >&2
echo >&2 'warning: no *SECRET_KEY_BASE set; running `rake generate_secret_token` to create one in "config/initializers/secret_token.rb"'
- unset SECRET_KEY_BASE # just in case
+ echo >&2
rake generate_secret_token
fi
+ fi
if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrate
diff --git a/redmine_trixie/docker-entrypoint.sh b/redmine_trixie/docker-entrypoint.sh
index 0bcee63..f956052 100755
--- a/redmine_trixie/docker-entrypoint.sh
+++ b/redmine_trixie/docker-entrypoint.sh
@@ -144,19 +144,26 @@ if [ -n "$isLikelyRedmine" ]; then
# just use the rails variable rather than trying to put it into a yml file
# https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/application.rb#L438
# https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L484 (rails 7.1-stable)
- if [ -n "${SECRET_KEY_BASE}" ] && [ -n "${REDMINE_SECRET_KEY_BASE}" ]; then
+ if [ -n "${SECRET_KEY_BASE:-}" ] && [ -n "${REDMINE_SECRET_KEY_BASE:-}" ]; then
echo >&2
echo >&2 'warning: both SECRET_KEY_BASE and REDMINE_SECRET_KEY_BASE{_FILE} set, only SECRET_KEY_BASE will apply'
echo >&2
fi
- : "${SECRET_KEY_BASE:=$REDMINE_SECRET_KEY_BASE}"
+ : "${SECRET_KEY_BASE:=${REDMINE_SECRET_KEY_BASE:-}}"
export SECRET_KEY_BASE
- # generate SECRET_KEY_BASE if not set; this is not recommended unless the secret_token.rb is saved when container is recreated
- if [ -z "$SECRET_KEY_BASE" ] && [ ! -f config/initializers/secret_token.rb ]; then
+ if [ -z "$SECRET_KEY_BASE" ]; then
+ # https://github.com/docker-library/redmine/issues/397
+ # empty string is truthy in ruby and so masks the generated fallback config
+ # https://github.com/rails/rails/blob/1aa9987169213ce5ce43c20b2643bc64c235e792/railties/lib/rails/application.rb#L454
+ unset SECRET_KEY_BASE
+ # generate SECRET_KEY_BASE in-file since it is not set or empty; this is not recommended unless the secret_token.rb is saved when container is recreated
+ if [ ! -f config/initializers/secret_token.rb ]; then
+ echo >&2
echo >&2 'warning: no *SECRET_KEY_BASE set; running `rake generate_secret_token` to create one in "config/initializers/secret_token.rb"'
- unset SECRET_KEY_BASE # just in case
+ echo >&2
rake generate_secret_token
fi
+ fi
if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrateRelevant Maintainers: |
yosifkit
approved these changes
Oct 9, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes: