From 0a47a08cc0c2679e0184aca69f6298dc4872e798 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 22 Jan 2023 16:28:25 -0600 Subject: [PATCH 1/6] Rebase to alpine 3.17 with php8.1 --- .github/workflows/call_invalid_helper.yml | 12 ++++++++++ Dockerfile | 22 +++++++++---------- Dockerfile.aarch64 | 22 +++++++++---------- Dockerfile.armhf | 22 +++++++++---------- Jenkinsfile | 8 +++---- README.md | 3 +++ readme-vars.yml | 8 ++++--- .../dependencies.d/init-heimdall-config | 0 .../dependencies.d/init-nginx-end | 0 .../s6-rc.d/init-heimdall-config/run} | 3 +-- .../s6-rc.d/init-heimdall-config/type | 1 + .../s6-rc.d/init-heimdall-config/up | 1 + .../svc-queue/dependencies.d/init-services | 0 .../s6-rc.d/svc-queue}/run | 0 root/etc/s6-overlay/s6-rc.d/svc-queue/type | 1 + .../user/contents.d/init-heimdall-config | 0 .../s6-rc.d/user/contents.d/svc-queue | 0 17 files changed, 61 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/call_invalid_helper.yml create mode 100644 root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-heimdall-config create mode 100644 root/etc/s6-overlay/s6-rc.d/init-heimdall-config/dependencies.d/init-nginx-end rename root/etc/{cont-init.d/50-config => s6-overlay/s6-rc.d/init-heimdall-config/run} (97%) mode change 100644 => 100755 create mode 100644 root/etc/s6-overlay/s6-rc.d/init-heimdall-config/type create mode 100644 root/etc/s6-overlay/s6-rc.d/init-heimdall-config/up create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-queue/dependencies.d/init-services rename root/etc/{services.d/queue => s6-overlay/s6-rc.d/svc-queue}/run (100%) mode change 100644 => 100755 create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-queue/type create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/init-heimdall-config create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-queue diff --git a/.github/workflows/call_invalid_helper.yml b/.github/workflows/call_invalid_helper.yml new file mode 100644 index 0000000..773767c --- /dev/null +++ b/.github/workflows/call_invalid_helper.yml @@ -0,0 +1,12 @@ +name: Comment on invalid interaction +on: + issues: + types: + - labeled +jobs: + add-comment-on-invalid: + if: github.event.label.name == 'invalid' + permissions: + issues: write + uses: linuxserver/github-workflows/.github/workflows/invalid-interaction-helper.yml@v1 + secrets: inherit diff --git a/Dockerfile b/Dockerfile index 2196102..4e56c82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15 +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.17 # set version label ARG BUILD_DATE @@ -13,16 +15,14 @@ ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 RUN \ echo "**** install runtime packages ****" && \ apk add --no-cache --upgrade \ - curl \ - php8-ctype \ - php8-curl \ - php8-intl \ - php8-pdo_pgsql \ - php8-pdo_sqlite \ - php8-pdo_mysql \ - php8-tokenizer \ - php8-zip \ - tar && \ + php81-ctype \ + php81-curl \ + php81-intl \ + php81-pdo_pgsql \ + php81-pdo_sqlite \ + php81-pdo_mysql \ + php81-tokenizer \ + php81-zip && \ echo "**** install heimdall ****" && \ mkdir -p \ /heimdall && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index a18fb82..2411550 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15 +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.17 # set version label ARG BUILD_DATE @@ -13,16 +15,14 @@ ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 RUN \ echo "**** install runtime packages ****" && \ apk add --no-cache --upgrade \ - curl \ - php8-ctype \ - php8-curl \ - php8-intl \ - php8-pdo_pgsql \ - php8-pdo_sqlite \ - php8-pdo_mysql \ - php8-tokenizer \ - php8-zip \ - tar && \ + php81-ctype \ + php81-curl \ + php81-intl \ + php81-pdo_pgsql \ + php81-pdo_sqlite \ + php81-pdo_mysql \ + php81-tokenizer \ + php81-zip && \ echo "**** install heimdall ****" && \ mkdir -p \ /heimdall && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index abac25a..7739e88 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15 +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.17 # set version label ARG BUILD_DATE @@ -13,16 +15,14 @@ ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 RUN \ echo "**** install runtime packages ****" && \ apk add --no-cache --upgrade \ - curl \ - php8-ctype \ - php8-curl \ - php8-intl \ - php8-pdo_pgsql \ - php8-pdo_sqlite \ - php8-pdo_mysql \ - php8-tokenizer \ - php8-zip \ - tar && \ + php81-ctype \ + php81-curl \ + php81-intl \ + php81-pdo_pgsql \ + php81-pdo_sqlite \ + php81-pdo_mysql \ + php81-tokenizer \ + php81-zip && \ echo "**** install heimdall ****" && \ mkdir -p \ /heimdall && \ diff --git a/Jenkinsfile b/Jenkinsfile index 60fa4c4..afde1c4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -464,7 +464,7 @@ pipeline { --label \"org.opencontainers.image.licenses=GPL-3.0-only\" \ --label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \ --label \"org.opencontainers.image.title=Heimdall\" \ - --label \"org.opencontainers.image.description=[Heimdall](https://heimdall.site) is a way to organise all those links to your most used web sites and web applications in a simple way. Simplicity is the key to Heimdall. Why not use it as your browser start page? It even has the ability to include a search bar using either Google, Bing or DuckDuckGo.\" \ + --label \"org.opencontainers.image.description=[Heimdall](https://heimdall.site) is a way to organise all those links to your most used web sites and web applications in a simple way. Simplicity is the key to Heimdall. Why not use it as your browser start page? It even has the ability to include a search bar using either Google, Bing or DuckDuckGo. \" \ --no-cache --pull -t ${IMAGE}:${META_TAG} \ --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." } @@ -494,7 +494,7 @@ pipeline { --label \"org.opencontainers.image.licenses=GPL-3.0-only\" \ --label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \ --label \"org.opencontainers.image.title=Heimdall\" \ - --label \"org.opencontainers.image.description=[Heimdall](https://heimdall.site) is a way to organise all those links to your most used web sites and web applications in a simple way. Simplicity is the key to Heimdall. Why not use it as your browser start page? It even has the ability to include a search bar using either Google, Bing or DuckDuckGo.\" \ + --label \"org.opencontainers.image.description=[Heimdall](https://heimdall.site) is a way to organise all those links to your most used web sites and web applications in a simple way. Simplicity is the key to Heimdall. Why not use it as your browser start page? It even has the ability to include a search bar using either Google, Bing or DuckDuckGo. \" \ --no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \ --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." } @@ -521,7 +521,7 @@ pipeline { --label \"org.opencontainers.image.licenses=GPL-3.0-only\" \ --label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \ --label \"org.opencontainers.image.title=Heimdall\" \ - --label \"org.opencontainers.image.description=[Heimdall](https://heimdall.site) is a way to organise all those links to your most used web sites and web applications in a simple way. Simplicity is the key to Heimdall. Why not use it as your browser start page? It even has the ability to include a search bar using either Google, Bing or DuckDuckGo.\" \ + --label \"org.opencontainers.image.description=[Heimdall](https://heimdall.site) is a way to organise all those links to your most used web sites and web applications in a simple way. Simplicity is the key to Heimdall. Why not use it as your browser start page? It even has the ability to include a search bar using either Google, Bing or DuckDuckGo. \" \ --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \ --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}" @@ -555,7 +555,7 @@ pipeline { --label \"org.opencontainers.image.licenses=GPL-3.0-only\" \ --label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \ --label \"org.opencontainers.image.title=Heimdall\" \ - --label \"org.opencontainers.image.description=[Heimdall](https://heimdall.site) is a way to organise all those links to your most used web sites and web applications in a simple way. Simplicity is the key to Heimdall. Why not use it as your browser start page? It even has the ability to include a search bar using either Google, Bing or DuckDuckGo.\" \ + --label \"org.opencontainers.image.description=[Heimdall](https://heimdall.site) is a way to organise all those links to your most used web sites and web applications in a simple way. Simplicity is the key to Heimdall. Why not use it as your browser start page? It even has the ability to include a search bar using either Google, Bing or DuckDuckGo. \" \ --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \ --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}" diff --git a/README.md b/README.md index 0574b3d..a9b72ff 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,9 @@ Find us at: [![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Fci-tests.linuxserver.io%2Flinuxserver%2Fheimdall%2Flatest%2Fci-status.yml)](https://ci-tests.linuxserver.io/linuxserver/heimdall/latest/index.html) [Heimdall](https://heimdall.site) is a way to organise all those links to your most used web sites and web applications in a simple way. + Simplicity is the key to Heimdall. + Why not use it as your browser start page? It even has the ability to include a search bar using either Google, Bing or DuckDuckGo. [![heimdall](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/heimdall-banner.png)](https://heimdall.site) @@ -240,6 +242,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **20.01.23:** - Rebase to alpine 3.17 with php8.1. * **14.11.22:** - Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base)). * **04.11.22:** - Build commits to upstream branch 2.x for the `development` tag. * **13.03.21:** - Make searchproviders.yaml user configurable. diff --git a/readme-vars.yml b/readme-vars.yml index c69fa69..5851c2e 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -4,11 +4,12 @@ project_name: heimdall project_url: "https://heimdall.site" project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/heimdall-banner.png" -project_blurb: "[{{ project_name|capitalize }}]({{ project_url }}) is a way to organise all those links to your most used web sites and web applications in a simple way. +project_blurb: | + [{{ project_name|capitalize }}]({{ project_url }}) is a way to organise all those links to your most used web sites and web applications in a simple way. -Simplicity is the key to Heimdall. + Simplicity is the key to Heimdall. -Why not use it as your browser start page? It even has the ability to include a search bar using either Google, Bing or DuckDuckGo." + Why not use it as your browser start page? It even has the ability to include a search bar using either Google, Bing or DuckDuckGo. project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}" # supported architectures @@ -49,6 +50,7 @@ app_setup_block: | # changelog changelogs: + - { date: "20.01.23:", desc: "Rebase to alpine 3.17 with php8.1." } - { date: "14.11.22:", desc: "Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base))." } - { date: "04.11.22:", desc: "Build commits to upstream branch 2.x for the `development` tag." } - { date: "13.03.21:", desc: "Make searchproviders.yaml user configurable." } diff --git a/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-heimdall-config b/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-heimdall-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/dependencies.d/init-nginx-end b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/dependencies.d/init-nginx-end new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/cont-init.d/50-config b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run old mode 100644 new mode 100755 similarity index 97% rename from root/etc/cont-init.d/50-config rename to root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run index 60a566e..1bcb0c6 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run @@ -47,8 +47,7 @@ ln -s /config/www/searchproviders.yaml /app/www/storage/app/searchproviders.yaml # tidy up install files & set permissions if [[ -f /heimdall/heimdall.tar.gz ]]; then rm -rf /heimdall - chown -R abc:abc /app/www - chown -R abc:abc /config + lsiown -R abc:abc /config fi # copy .env if not exists diff --git a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/type b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/type @@ -0,0 +1 @@ +oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/up b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/up new file mode 100644 index 0000000..e728444 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-heimdall-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/svc-queue/dependencies.d/init-services b/root/etc/s6-overlay/s6-rc.d/svc-queue/dependencies.d/init-services new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/services.d/queue/run b/root/etc/s6-overlay/s6-rc.d/svc-queue/run old mode 100644 new mode 100755 similarity index 100% rename from root/etc/services.d/queue/run rename to root/etc/s6-overlay/s6-rc.d/svc-queue/run diff --git a/root/etc/s6-overlay/s6-rc.d/svc-queue/type b/root/etc/s6-overlay/s6-rc.d/svc-queue/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-queue/type @@ -0,0 +1 @@ +longrun diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-heimdall-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-heimdall-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-queue b/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-queue new file mode 100644 index 0000000..e69de29 From b9940034b8ac1246813a0c17ebd41671fab7edef Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 23 Jan 2023 19:50:44 -0600 Subject: [PATCH 2/6] Move install back to Dockerfile --- Dockerfile | 15 +++++++++++++- Dockerfile.aarch64 | 15 +++++++++++++- Dockerfile.armhf | 15 +++++++++++++- .../s6-rc.d/init-heimdall-config/run | 20 ++----------------- 4 files changed, 44 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4e56c82..7269b97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,11 @@ RUN \ php81-pdo_mysql \ php81-tokenizer \ php81-zip && \ + echo "**** configure nginx ****" && \ + echo 'fastcgi_param PHP_AUTH_USER $remote_user; # Heimdall user authorization' >> \ + /etc/nginx/fastcgi_params && \ + echo 'fastcgi_param PHP_AUTH_PW $http_authorization; # Heimdall user authorization' >> \ + /etc/nginx/fastcgi_params && \ echo "**** install heimdall ****" && \ mkdir -p \ /heimdall && \ @@ -31,8 +36,16 @@ RUN \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ - /heimdall/heimdall.tar.gz -L \ + /tmp/heimdall.tar.gz -L \ "https://github.com/linuxserver/Heimdall/archive/${HEIMDALL_RELEASE}.tar.gz" && \ + mkdir -p \ + /app/www && \ + tar xf \ + /tmp/heimdall.tar.gz -C \ + /app/www --strip-components=1 && \ + cp /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig && \ + chown -R abc:abc \ + /app/www && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 2411550..07e2312 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -23,6 +23,11 @@ RUN \ php81-pdo_mysql \ php81-tokenizer \ php81-zip && \ + echo "**** configure nginx ****" && \ + echo 'fastcgi_param PHP_AUTH_USER $remote_user; # Heimdall user authorization' >> \ + /etc/nginx/fastcgi_params && \ + echo 'fastcgi_param PHP_AUTH_PW $http_authorization; # Heimdall user authorization' >> \ + /etc/nginx/fastcgi_params && \ echo "**** install heimdall ****" && \ mkdir -p \ /heimdall && \ @@ -31,8 +36,16 @@ RUN \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ - /heimdall/heimdall.tar.gz -L \ + /tmp/heimdall.tar.gz -L \ "https://github.com/linuxserver/Heimdall/archive/${HEIMDALL_RELEASE}.tar.gz" && \ + mkdir -p \ + /app/www && \ + tar xf \ + /tmp/heimdall.tar.gz -C \ + /app/www --strip-components=1 && \ + cp /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig && \ + chown -R abc:abc \ + /app/www && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 7739e88..d4d4a52 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -23,6 +23,11 @@ RUN \ php81-pdo_mysql \ php81-tokenizer \ php81-zip && \ + echo "**** configure nginx ****" && \ + echo 'fastcgi_param PHP_AUTH_USER $remote_user; # Heimdall user authorization' >> \ + /etc/nginx/fastcgi_params && \ + echo 'fastcgi_param PHP_AUTH_PW $http_authorization; # Heimdall user authorization' >> \ + /etc/nginx/fastcgi_params && \ echo "**** install heimdall ****" && \ mkdir -p \ /heimdall && \ @@ -31,8 +36,16 @@ RUN \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ - /heimdall/heimdall.tar.gz -L \ + /tmp/heimdall.tar.gz -L \ "https://github.com/linuxserver/Heimdall/archive/${HEIMDALL_RELEASE}.tar.gz" && \ + mkdir -p \ + /app/www && \ + tar xf \ + /tmp/heimdall.tar.gz -C \ + /app/www --strip-components=1 && \ + cp /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig && \ + chown -R abc:abc \ + /app/www && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* diff --git a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run index 1bcb0c6..345b6dc 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run @@ -4,20 +4,8 @@ # make our folders mkdir -p \ /config/www/{avatars,backgrounds,icons,logs,SupportedApps} \ - /app/www \ /config/log/heimdall -# install heimdall if necessary -if [[ -f /heimdall/heimdall.tar.gz ]]; then - echo "New container detected, installing Heimdall" - tar xf \ - /heimdall/heimdall.tar.gz -C \ - /app/www --strip-components=1 - echo -e '\n# Heimdall user authorization\nfastcgi_param PHP_AUTH_USER $remote_user;\nfastcgi_param PHP_AUTH_PW $http_authorization;' >> \ - /etc/nginx/fastcgi_params - cp /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig -fi - # create symlinks symlinks=( /app/www/storage/app/public/avatars @@ -35,21 +23,17 @@ for i in "${symlinks[@]}"; do if [[ ! -L "${i}" ]]; then ln -s /config/www/"$(basename "${i}")" "${i}" fi + lsiown -R abc:abc /config/www/"$(basename "${i}")" done # copy searchproviders if not exists and symlink if [[ ! -f /config/www/searchproviders.yaml ]]; then cp /app/www/storage/app/searchproviders.yaml.orig /config/www/searchproviders.yaml + lsiown -R abc:abc /config/www/searchproviders.yaml fi rm -rf /app/www/storage/app/searchproviders.yaml ln -s /config/www/searchproviders.yaml /app/www/storage/app/searchproviders.yaml -# tidy up install files & set permissions -if [[ -f /heimdall/heimdall.tar.gz ]]; then - rm -rf /heimdall - lsiown -R abc:abc /config -fi - # copy .env if not exists if [[ ! -f /config/www/.env ]]; then install -g abc -o abc /app/www/.env.example /config/www/.env From 59fd8f30c9446821ecb9c9ec02c7cb99333b3f3d Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 23 Jan 2023 20:08:33 -0600 Subject: [PATCH 3/6] Only set folder permissions when symlinking --- root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run index 345b6dc..738711e 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run @@ -19,11 +19,13 @@ symlinks=( for i in "${symlinks[@]}"; do if [[ -e "${i}" && ! -L "${i}" ]]; then rm -rf "${i}" + if [[ -d /config/www/"$(basename "${i}")" ]]; then + lsiown -R abc:abc /config/www/"$(basename "${i}")" + fi fi if [[ ! -L "${i}" ]]; then ln -s /config/www/"$(basename "${i}")" "${i}" fi - lsiown -R abc:abc /config/www/"$(basename "${i}")" done # copy searchproviders if not exists and symlink From fb74b689ec40641d7d250222641e91e419650148 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 23 Jan 2023 20:46:38 -0600 Subject: [PATCH 4/6] Adjust file ownership --- Dockerfile | 4 +--- Dockerfile.aarch64 | 4 +--- Dockerfile.armhf | 4 +--- .../s6-overlay/s6-rc.d/init-heimdall-config/run | 17 +++++++++++++---- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7269b97..ef1cee3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,9 +43,7 @@ RUN \ tar xf \ /tmp/heimdall.tar.gz -C \ /app/www --strip-components=1 && \ - cp /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig && \ - chown -R abc:abc \ - /app/www && \ + mv /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 07e2312..0da0d51 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -43,9 +43,7 @@ RUN \ tar xf \ /tmp/heimdall.tar.gz -C \ /app/www --strip-components=1 && \ - cp /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig && \ - chown -R abc:abc \ - /app/www && \ + mv /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* diff --git a/Dockerfile.armhf b/Dockerfile.armhf index d4d4a52..3d0bc02 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -43,9 +43,7 @@ RUN \ tar xf \ /tmp/heimdall.tar.gz -C \ /app/www --strip-components=1 && \ - cp /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig && \ - chown -R abc:abc \ - /app/www && \ + mv /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* diff --git a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run index 738711e..9a35033 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run @@ -3,6 +3,7 @@ # make our folders mkdir -p \ + /app/www/bootstrap/cache \ /config/www/{avatars,backgrounds,icons,logs,SupportedApps} \ /config/log/heimdall @@ -19,19 +20,27 @@ symlinks=( for i in "${symlinks[@]}"; do if [[ -e "${i}" && ! -L "${i}" ]]; then rm -rf "${i}" - if [[ -d /config/www/"$(basename "${i}")" ]]; then - lsiown -R abc:abc /config/www/"$(basename "${i}")" - fi fi if [[ ! -L "${i}" ]]; then ln -s /config/www/"$(basename "${i}")" "${i}" fi + if [[ -d /config/www/"$(basename "${i}")" ]]; then + lsiown abc:abc /config/www/"$(basename "${i}")" + fi done +# set permissions on new container +if [[ ! -f /config/www/searchproviders.yaml ]]; then + echo "New container detected, setting permissions" + lsiown -R abc:abc \ + /app \ + /config +fi + # copy searchproviders if not exists and symlink if [[ ! -f /config/www/searchproviders.yaml ]]; then cp /app/www/storage/app/searchproviders.yaml.orig /config/www/searchproviders.yaml - lsiown -R abc:abc /config/www/searchproviders.yaml + lsiown abc:abc /config/www/searchproviders.yaml fi rm -rf /app/www/storage/app/searchproviders.yaml ln -s /config/www/searchproviders.yaml /app/www/storage/app/searchproviders.yaml From 96d2cfabc4f74958e03987f21e4953e1a450cb56 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Wed, 25 Jan 2023 19:18:59 -0600 Subject: [PATCH 5/6] Adjust for overlayfs chown bug --- Dockerfile | 5 ++-- Dockerfile.aarch64 | 5 ++-- Dockerfile.armhf | 5 ++-- .../s6-rc.d/init-heimdall-config/run | 29 ++++++++++--------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index ef1cee3..e9aff27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,11 +39,10 @@ RUN \ /tmp/heimdall.tar.gz -L \ "https://github.com/linuxserver/Heimdall/archive/${HEIMDALL_RELEASE}.tar.gz" && \ mkdir -p \ - /app/www && \ + /app/www-tmp && \ tar xf \ /tmp/heimdall.tar.gz -C \ - /app/www --strip-components=1 && \ - mv /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig && \ + /app/www-tmp --strip-components=1 && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 0da0d51..dfe7146 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -39,11 +39,10 @@ RUN \ /tmp/heimdall.tar.gz -L \ "https://github.com/linuxserver/Heimdall/archive/${HEIMDALL_RELEASE}.tar.gz" && \ mkdir -p \ - /app/www && \ + /app/www-tmp && \ tar xf \ /tmp/heimdall.tar.gz -C \ - /app/www --strip-components=1 && \ - mv /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig && \ + /app/www-tmp --strip-components=1 && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 3d0bc02..e58d92a 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -39,11 +39,10 @@ RUN \ /tmp/heimdall.tar.gz -L \ "https://github.com/linuxserver/Heimdall/archive/${HEIMDALL_RELEASE}.tar.gz" && \ mkdir -p \ - /app/www && \ + /app/www-tmp && \ tar xf \ /tmp/heimdall.tar.gz -C \ - /app/www --strip-components=1 && \ - mv /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig && \ + /app/www-tmp --strip-components=1 && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* diff --git a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run index 9a35033..9c25723 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run @@ -3,10 +3,17 @@ # make our folders mkdir -p \ - /app/www/bootstrap/cache \ /config/www/{avatars,backgrounds,icons,logs,SupportedApps} \ /config/log/heimdall +# install heimdall if necessary +if [[ -d /app/www-tmp ]]; then + echo "New container detected, installing Heimdall" + mv /app/www-tmp /app/www + cp /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig + touch /app/set-perms +fi + # create symlinks symlinks=( /app/www/storage/app/public/avatars @@ -24,27 +31,23 @@ for i in "${symlinks[@]}"; do if [[ ! -L "${i}" ]]; then ln -s /config/www/"$(basename "${i}")" "${i}" fi - if [[ -d /config/www/"$(basename "${i}")" ]]; then - lsiown abc:abc /config/www/"$(basename "${i}")" - fi done -# set permissions on new container -if [[ ! -f /config/www/searchproviders.yaml ]]; then - echo "New container detected, setting permissions" - lsiown -R abc:abc \ - /app \ - /config -fi - # copy searchproviders if not exists and symlink if [[ ! -f /config/www/searchproviders.yaml ]]; then cp /app/www/storage/app/searchproviders.yaml.orig /config/www/searchproviders.yaml - lsiown abc:abc /config/www/searchproviders.yaml fi rm -rf /app/www/storage/app/searchproviders.yaml ln -s /config/www/searchproviders.yaml /app/www/storage/app/searchproviders.yaml +# tidy up install files & set permissions +if [[ -d /app/set-perms ]]; then + rm /app/set-perms + lsiown -R abc:abc \ + /app/www \ + /config +fi + # copy .env if not exists if [[ ! -f /config/www/.env ]]; then install -g abc -o abc /app/www/.env.example /config/www/.env From de8ba1b570a8df394c62a4e16793b634cf2261cd Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Wed, 25 Jan 2023 19:33:19 -0600 Subject: [PATCH 6/6] Fix perm check --- root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run index 9c25723..acb35fa 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-heimdall-config/run @@ -41,8 +41,8 @@ rm -rf /app/www/storage/app/searchproviders.yaml ln -s /config/www/searchproviders.yaml /app/www/storage/app/searchproviders.yaml # tidy up install files & set permissions -if [[ -d /app/set-perms ]]; then - rm /app/set-perms +if [[ -f /app/set-perms ]]; then + rm -rf /app/set-perms lsiown -R abc:abc \ /app/www \ /config