Skip to content
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

IO-1467: Add mod_locales_vol_fix #171

Merged
merged 8 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ backups
done.txt
static/nginx_init.sh
static/nginx.conf
.idea/
19 changes: 19 additions & 0 deletions src/_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function mod_check() {
fi
mod_etl_fix
mod_uploads_vol_fix
mod_locales_vol_fix
VALIDATION_ONLY=1 configure_couchbase_users
postgres_metrics_validation
check_for_maintenance_mode
Expand Down Expand Up @@ -80,6 +81,24 @@ function mod_uploads_vol_fix() {
fi
}

function mod_locales_vol_fix() {
if [ "$CONTAINER_RUNTIME" == "podman" ]; then
error "localesOverride volume ownership checks are not supported with Podman. Skipping"
return
else
info "Checking localesOverride volume ownership"
local user=`compose_client exec plextracapi whoami`
local dotfile_exist=`compose_client exec plextracapi find localesOverride -type f -name .vol-chown-pt`
if [ "$user" != "root" ] && [ "$dotfile_exist" = "" ]; then
# this uid:gid is hardcoded in the base image and expected by the backend, do NOT change this chown
info "Ensuring upload volume ownership is 1337:1337, this may take awhile..."
compose_client exec -u 0 plextracapi chown -R 1337:1337 localesOverride/
compose_client exec -u 0 plextracapi chmod 664 -R localesOverride/
compose_client exec plextracapi touch localesOverride/.vol-chown-pt
fi
fi
}

# Check for an existing installation
function _check_no_existing_installation() {
if [ ${IGNORE_EXISTING_INSTALLATION:-0} -eq 1 ]; then
Expand Down