Skip to content

Only chown things in the entrypoint that are not already owned by redmine #128

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 1 commit into from
Sep 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions 3.3/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ case "$1" in
file_env 'REDMINE_DB_ENCODING' 'utf8'

mkdir -p "$(dirname "$REDMINE_DB_DATABASE")"
chown -R redmine:redmine "$(dirname "$REDMINE_DB_DATABASE")"
find "$(dirname "$REDMINE_DB_DATABASE")" \! -user redmine -exec chown redmine '{}' +
fi

REDMINE_DB_ADAPTER="$adapter"
Expand Down Expand Up @@ -129,9 +129,10 @@ case "$1" in
fi

# https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-8-File-system-permissions
chown -R redmine:redmine files log public/plugin_assets
find files log public/plugin_assets \! -user redmine -exec chown redmine:redmine '{}' +
# directories 755, files 644:
chmod -R ugo-x,u+rwX,go+rX,go-w files log tmp public/plugin_assets
find files log tmp public/plugin_assets -type d \! -perm 755 -exec chmod 755 '{}' +
find files log tmp public/plugin_assets -type f \! -perm 644 -exec chmod 644 '{}' +

if [ "$1" != 'rake' -a -n "$REDMINE_PLUGINS_MIGRATE" ]; then
gosu redmine rake redmine:plugins:migrate
Expand Down
7 changes: 4 additions & 3 deletions 3.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ case "$1" in
file_env 'REDMINE_DB_ENCODING' 'utf8'

mkdir -p "$(dirname "$REDMINE_DB_DATABASE")"
chown -R redmine:redmine "$(dirname "$REDMINE_DB_DATABASE")"
find "$(dirname "$REDMINE_DB_DATABASE")" \! -user redmine -exec chown redmine '{}' +
fi

REDMINE_DB_ADAPTER="$adapter"
Expand Down Expand Up @@ -129,9 +129,10 @@ case "$1" in
fi

# https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-8-File-system-permissions
chown -R redmine:redmine files log public/plugin_assets
find files log public/plugin_assets \! -user redmine -exec chown redmine:redmine '{}' +
# directories 755, files 644:
chmod -R ugo-x,u+rwX,go+rX,go-w files log tmp public/plugin_assets
find files log tmp public/plugin_assets -type d \! -perm 755 -exec chmod 755 '{}' +
find files log tmp public/plugin_assets -type f \! -perm 644 -exec chmod 644 '{}' +

if [ "$1" != 'rake' -a -n "$REDMINE_PLUGINS_MIGRATE" ]; then
gosu redmine rake redmine:plugins:migrate
Expand Down
7 changes: 4 additions & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ case "$1" in
file_env 'REDMINE_DB_ENCODING' 'utf8'

mkdir -p "$(dirname "$REDMINE_DB_DATABASE")"
chown -R redmine:redmine "$(dirname "$REDMINE_DB_DATABASE")"
find "$(dirname "$REDMINE_DB_DATABASE")" \! -user redmine -exec chown redmine '{}' +
fi

REDMINE_DB_ADAPTER="$adapter"
Expand Down Expand Up @@ -129,9 +129,10 @@ case "$1" in
fi

# https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-8-File-system-permissions
chown -R redmine:redmine files log public/plugin_assets
find files log public/plugin_assets \! -user redmine -exec chown redmine:redmine '{}' +
# directories 755, files 644:
chmod -R ugo-x,u+rwX,go+rX,go-w files log tmp public/plugin_assets
find files log tmp public/plugin_assets -type d \! -perm 755 -exec chmod 755 '{}' +
find files log tmp public/plugin_assets -type f \! -perm 644 -exec chmod 644 '{}' +

if [ "$1" != 'rake' -a -n "$REDMINE_PLUGINS_MIGRATE" ]; then
gosu redmine rake redmine:plugins:migrate
Expand Down