diff --git a/docker/Dockerfile b/docker/Dockerfile index 1571e0a46..60496e400 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -181,8 +181,7 @@ COPY --from=frontend-build /front/dist ${WEBSERVER_FOLDER} COPY ./frontend/assets ${WEBSERVER_FOLDER}/assets RUN mkdir -p ${WEBSERVER_FOLDER}/assets/romm && \ - ln -sf /romm/resources ${WEBSERVER_FOLDER}/assets/romm/resources && \ - ln -sf /romm/assets ${WEBSERVER_FOLDER}/assets/romm/assets + ln -sf /romm/resources ${WEBSERVER_FOLDER}/assets/romm/resources COPY ./backend /backend # Setup init script and config files diff --git a/docker/init_scripts/docker-entrypoint.sh b/docker/init_scripts/docker-entrypoint.sh index 5392c7b38..1b86987df 100755 --- a/docker/init_scripts/docker-entrypoint.sh +++ b/docker/init_scripts/docker-entrypoint.sh @@ -61,18 +61,17 @@ fi # Replace environment variables used in nginx configuration templates. /docker-entrypoint.d/20-envsubst-on-templates.sh >/dev/null -# Fix symbolic links used by nginx for assets, if they do not point to the correct location, +# Fix symbolic links used by nginx for resources, +# if they don't point to the correct location, # set by the ROMM_BASE_PATH environment variable. -for subfolder in assets resources; do - if [[ -L /var/www/html/assets/romm/${subfolder} ]]; then - target=$(readlink "/var/www/html/assets/romm/${subfolder}") +if [[ -L /var/www/html/assets/romm/resources ]]; then + target=$(readlink "/var/www/html/assets/romm/resources") - # If the target is not the same as ${ROMM_BASE_PATH}/${subfolder}, recreate the symbolic link. - if [[ ${target} != "${ROMM_BASE_PATH}/${subfolder}" ]]; then - rm "/var/www/html/assets/romm/${subfolder}" - ln -s "${ROMM_BASE_PATH}/${subfolder}" "/var/www/html/assets/romm/${subfolder}" - fi + # If the target is not the same as ${ROMM_BASE_PATH}/resources, recreate the symbolic link. + if [[ ${target} != "${ROMM_BASE_PATH}/resources" ]]; then + rm "/var/www/html/assets/romm/resources" + ln -s "${ROMM_BASE_PATH}/resources" "/var/www/html/assets/romm/resources" fi -done +fi exec "$@" diff --git a/entrypoint.sh b/entrypoint.sh index 33e77dc2c..6c581a395 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,21 +5,19 @@ set -e echo "Starting entrypoint script..." # Create symlinks for frontend -for subfolder in assets resources; do - if [[ -L /app/frontend/assets/romm/${subfolder} ]]; then - target=$(readlink "/app/frontend/assets/romm/${subfolder}") +if [[ -L /app/frontend/assets/romm/resources ]]; then + target=$(readlink "/app/frontend/assets/romm/resources") - # If the target is not the same as ${ROMM_BASE_PATH}/${subfolder}, recreate the symbolic link. - if [[ ${target} != "${ROMM_BASE_PATH}/${subfolder}" ]]; then - rm "/app/frontend/assets/romm/${subfolder}" - ln -s "${ROMM_BASE_PATH}/${subfolder}" "/app/frontend/assets/romm/${subfolder}" - fi - elif [[ ! -e /app/frontend/assets/romm/${subfolder} ]]; then - # Ensure parent directory exists before creating symbolic link - mkdir -p "/app/frontend/assets/romm" - ln -s "${ROMM_BASE_PATH}/${subfolder}" "/app/frontend/assets/romm/${subfolder}" + # If the target is not the same as ${ROMM_BASE_PATH}/resources, recreate the symbolic link. + if [[ ${target} != "${ROMM_BASE_PATH}/resources" ]]; then + rm "/app/frontend/assets/romm/resources" + ln -s "${ROMM_BASE_PATH}/resources" "/app/frontend/assets/romm/resources" fi -done +elif [[ ! -e /app/frontend/assets/romm/resources ]]; then + # Ensure parent directory exists before creating symbolic link + mkdir -p "/app/frontend/assets/romm" + ln -s "${ROMM_BASE_PATH}/resources" "/app/frontend/assets/romm/resources" +fi # Define a signal handler to propagate termination signals function handle_termination() { diff --git a/frontend/src/components/Settings/Administration/Users/Dialog/DeleteUser.vue b/frontend/src/components/Settings/Administration/Users/Dialog/DeleteUser.vue index fa94524a6..9414131c2 100644 --- a/frontend/src/components/Settings/Administration/Users/Dialog/DeleteUser.vue +++ b/frontend/src/components/Settings/Administration/Users/Dialog/DeleteUser.vue @@ -65,7 +65,7 @@ function closeDialog() { diff --git a/frontend/src/components/Settings/Administration/Users/UsersTable.vue b/frontend/src/components/Settings/Administration/Users/UsersTable.vue index 295c2eb7a..a6360306f 100644 --- a/frontend/src/components/Settings/Administration/Users/UsersTable.vue +++ b/frontend/src/components/Settings/Administration/Users/UsersTable.vue @@ -136,7 +136,7 @@ onMounted(() => { diff --git a/frontend/src/components/common/Navigation/SettingsDrawer.vue b/frontend/src/components/common/Navigation/SettingsDrawer.vue index 5e11fcabd..4cfd51674 100644 --- a/frontend/src/components/common/Navigation/SettingsDrawer.vue +++ b/frontend/src/components/common/Navigation/SettingsDrawer.vue @@ -92,7 +92,7 @@ function onClose() { diff --git a/frontend/src/views/Settings/UserProfile.vue b/frontend/src/views/Settings/UserProfile.vue index 885a7bf16..b0764ffb6 100644 --- a/frontend/src/views/Settings/UserProfile.vue +++ b/frontend/src/views/Settings/UserProfile.vue @@ -92,7 +92,7 @@ onUnmounted(() => { :src=" imagePreviewUrl || (userToEdit.avatar_path - ? `/assets/romm/assets/${userToEdit.avatar_path}?ts=${userToEdit.updated_at}` + ? `/api/raw/assets/${userToEdit.avatar_path}?ts=${userToEdit.updated_at}` : defaultAvatarPath) " >