Skip to content

Commit

Permalink
Drop secrets.yml and just use SECRET_KEY_BASE
Browse files Browse the repository at this point in the history
  • Loading branch information
yosifkit committed Jan 17, 2025
1 parent 2ac7919 commit d51b58c
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 100 deletions.
20 changes: 10 additions & 10 deletions 5.0/alpine3.20/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions 5.0/alpine3.21/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions 5.0/bookworm/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions 5.1/alpine3.20/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions 5.1/alpine3.21/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions 5.1/bookworm/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions 6.0/alpine3.20/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions 6.0/alpine3.21/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions 6.0/bookworm/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,17 @@ if [ -n "$isLikelyRedmine" ]; then
# install additional gems for Gemfile.local and plugins
bundle check || bundle install

if [ ! -s config/secrets.yml ]; then
file_env 'REDMINE_SECRET_KEY_BASE'
if [ -n "$REDMINE_SECRET_KEY_BASE" ]; then
cat > 'config/secrets.yml' <<-YML
$RAILS_ENV:
secret_key_base: "$REDMINE_SECRET_KEY_BASE"
YML
elif [ ! -f config/initializers/secret_token.rb ]; then
rake generate_secret_token
fi
file_env 'REDMINE_SECRET_KEY_BASE'
# 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
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}"

if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then
rake db:migrate
fi
Expand Down

0 comments on commit d51b58c

Please sign in to comment.