From a6df7ca39d0ec32ee457ed5e2986c5040579745d Mon Sep 17 00:00:00 2001 From: Zach Bean Date: Sun, 30 Jul 2023 08:53:55 -0500 Subject: [PATCH 1/8] Load stylesheets in the same order as when they were in the head --- .../lidarr/root/etc/cont-init.d/98-themepark | 20 +++++++++++-------- .../s6-overlay/s6-rc.d/init-mod-themepark/run | 20 +++++++++++-------- .../root/etc/cont-init.d/98-themepark | 20 +++++++++++-------- .../s6-overlay/s6-rc.d/init-mod-themepark/run | 20 +++++++++++-------- .../radarr/root/etc/cont-init.d/98-themepark | 20 +++++++++++-------- .../s6-overlay/s6-rc.d/init-mod-themepark/run | 20 +++++++++++-------- .../readarr/root/etc/cont-init.d/98-themepark | 18 ++++++++++------- .../s6-overlay/s6-rc.d/init-mod-themepark/run | 18 ++++++++++------- .../sonarr/root/etc/cont-init.d/98-themepark | 20 +++++++++++-------- .../s6-overlay/s6-rc.d/init-mod-themepark/run | 20 +++++++++++-------- .../root/etc/cont-init.d/98-themepark | 20 +++++++++++-------- .../s6-overlay/s6-rc.d/init-mod-themepark/run | 20 +++++++++++-------- 12 files changed, 142 insertions(+), 94 deletions(-) diff --git a/docker-mods/lidarr/root/etc/cont-init.d/98-themepark b/docker-mods/lidarr/root/etc/cont-init.d/98-themepark index d782d34530..416c756ee7 100755 --- a/docker-mods/lidarr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/lidarr/root/etc/cont-init.d/98-themepark @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/lidarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/lidarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index 140834376d..387dcb9e42 100755 --- a/docker-mods/lidarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/lidarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/prowlarr/root/etc/cont-init.d/98-themepark b/docker-mods/prowlarr/root/etc/cont-init.d/98-themepark index 537108d8f9..541878d5a1 100755 --- a/docker-mods/prowlarr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/prowlarr/root/etc/cont-init.d/98-themepark @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/prowlarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/prowlarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index bd68c4a9c0..16b0285f03 100755 --- a/docker-mods/prowlarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/prowlarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/radarr/root/etc/cont-init.d/98-themepark b/docker-mods/radarr/root/etc/cont-init.d/98-themepark index 2945c94953..aaba7e32b7 100755 --- a/docker-mods/radarr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/radarr/root/etc/cont-init.d/98-themepark @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/radarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/radarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index bc39ae49d2..555ab47232 100755 --- a/docker-mods/radarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/radarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/readarr/root/etc/cont-init.d/98-themepark b/docker-mods/readarr/root/etc/cont-init.d/98-themepark index 00e30314cf..ac247e5760 100755 --- a/docker-mods/readarr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/readarr/root/etc/cont-init.d/98-themepark @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s/// /g" "${APP_FILEPATH}" - sed -i "s/// /g" "${APP_FILEPATH}" - sed -i "s/// /g" "${LOGIN_FILEPATH}" - sed -i "s/// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s/// /g" "${APP_FILEPATH}" - sed -i "s/// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' fi diff --git a/docker-mods/readarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/readarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index 19ac27f249..b6c21926ec 100755 --- a/docker-mods/readarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/readarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s/// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' fi diff --git a/docker-mods/sonarr/root/etc/cont-init.d/98-themepark b/docker-mods/sonarr/root/etc/cont-init.d/98-themepark index 501578f2f4..0a4a71e1cd 100755 --- a/docker-mods/sonarr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/sonarr/root/etc/cont-init.d/98-themepark @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/sonarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/sonarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index a854a5107c..11d97d71fa 100755 --- a/docker-mods/sonarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/sonarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/whisparr/root/etc/cont-init.d/98-themepark b/docker-mods/whisparr/root/etc/cont-init.d/98-themepark index c8ab5aa836..a34e608995 100755 --- a/docker-mods/whisparr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/whisparr/root/etc/cont-init.d/98-themepark @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/whisparr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/whisparr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index 1647b4f2a6..cdea12d613 100755 --- a/docker-mods/whisparr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/whisparr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi From 2f86f4a35ba6f28345e99b41ae7dba48ef084b5f Mon Sep 17 00:00:00 2001 From: GilbN <24592972+GilbN@users.noreply.github.com> Date: Tue, 1 Aug 2023 11:46:41 +0200 Subject: [PATCH 2/8] Update mods workflow (#504) * Build all mods on push --- .github/workflows/auto-build.yml | 96 +++++++++++++++++--------------- 1 file changed, 50 insertions(+), 46 deletions(-) diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index 1a2287b98c..05d4595c7d 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -3,8 +3,10 @@ on: push: branches: - master + - develop + - testing paths: - - 'docker-mods/**' + - '**/docker-mods/**' workflow_dispatch: inputs: app: @@ -43,6 +45,7 @@ on: append-tag: required: false description: 'Append a the tag with "-custom" e.g :radarr-testing' + jobs: push_to_ghcr_io: runs-on: ubuntu-latest @@ -51,46 +54,47 @@ jobs: uses: actions/checkout@v3.1.0 with: fetch-depth: 0 - - name: get changed files - id: getfile - run: | - echo "files=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} docker-mods/| xargs)" >> $GITHUB_ENV - name: Login to GitHub Container Registry uses: docker/login-action@v2.1.0 with: registry: ghcr.io - username: ${{ github.repository_owner }} + username: ${{ secrets.GHCR_USER }} password: ${{ secrets.GH_PAT }} - - name: find correct directory then build&push + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: build all on push if: ${{ github.event_name == 'push' }} run: | - for i in ${{ env.files }} - do - directory="$( echo $i | cut -d'/' -f2 -s )" - if [ -z "$directory" ]; then - continue # Skip root dir - elif [ "$i" == *.md ]; then - continue # Skip markdown files - elif [ "$i" == *.yml ]; then - continue # Skip YAML files - fi - docker build docker-mods/$directory --tag ghcr.io/gilbn/theme.park:$directory - docker push ghcr.io/gilbn/theme.park:$directory - done + branch=${{ steps.extract_branch.outputs.branch }} + + if [ "$branch" = "master" ]; then + branch="" + else + branch="-$branch" + fi + for dir in docker-mods/*; + do + app="$( echo "$dir" | cut -d'/' -f2 -s )" + docker build docker-mods/$app --tag ghcr.io/${{ secrets.GHCR_USER }}/theme.park:$app$branch + docker push ghcr.io/${{ secrets.GHCR_USER }}/theme.park:$app$branch + done - name: manually build if: ${{ github.event.inputs.app && github.event.inputs.app != 'build-all-the-mods' }} run: | - docker build docker-mods/${{ github.event.inputs.app }} --tag ghcr.io/gilbn/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} - docker push ghcr.io/gilbn/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} + docker build docker-mods/${{ github.event.inputs.app }} --tag ghcr.io/${{ secrets.GHCR_USER }}/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} + docker push ghcr.io/${{ secrets.GHCR_USER }}/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} - name: manually build all mods if: ${{ github.event.inputs.app == 'build-all-the-mods' }} run: | for dir in docker-mods/*; do app="$( echo "$dir" | cut -d'/' -f2 -s )" - docker build docker-mods/$app --tag ghcr.io/gilbn/theme.park:$app${{ github.event.inputs.append-tag }} - docker push ghcr.io/gilbn/theme.park:$app${{ github.event.inputs.append-tag }} + docker build docker-mods/$app --tag ghcr.io/${{ secrets.GHCR_USER }}/theme.park:$app${{ github.event.inputs.append-tag }} + docker push ghcr.io/${{ secrets.GHCR_USER }}/theme.park:$app${{ github.event.inputs.append-tag }} done + push_to_dockerhub: runs-on: ubuntu-latest steps: @@ -98,42 +102,42 @@ jobs: uses: actions/checkout@v3.1.0 with: fetch-depth: 0 - - name: get changed files - id: getfile - run: | - echo "files=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} docker-mods/| xargs)" >> $GITHUB_ENV - name: Login to Docker Hub uses: docker/login-action@v2.1.0 with: username: ${{ secrets.DH_USER }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: find correct directory then build&push + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: build all on push if: ${{ github.event_name == 'push' }} run: | - for i in ${{ env.files }} - do - directory="$( echo $i | cut -d'/' -f2 -s )" - if [ -z "$directory" ]; then - continue # Skip root dir - elif [ "$i" == *.md ]; then - continue # Skip markdown files - elif [ "$i" == *.yml ]; then - continue # Skip YAML files - fi - docker build docker-mods/$directory --tag gilbn/theme.park:$directory - docker push gilbn/theme.park:$directory - done + branch=${{ steps.extract_branch.outputs.branch }} + + if [ "$branch" = "master" ]; then + branch="" + else + branch="-$branch" + fi + for dir in docker-mods/*; + do + app="$( echo "$dir" | cut -d'/' -f2 -s )" + docker build docker-mods/$app --tag ${{ secrets.DH_USER }}/theme.park:$app$branch + docker push ${{ secrets.DH_USER }}/theme.park:$app$branch + done - name: manually build if: ${{ github.event.inputs.app && github.event.inputs.app != 'build-all-the-mods' }} run: | - docker build docker-mods/${{ github.event.inputs.app }} --tag gilbn/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} - docker push gilbn/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} + docker build docker-mods/${{ github.event.inputs.app }} --tag ${{ secrets.DH_USER }}/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} + docker push ${{ secrets.DH_USER }}/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} - name: manually build all mods if: ${{ github.event.inputs.app == 'build-all-the-mods' }} run: | for dir in docker-mods/*; do app="$( echo "$dir" | cut -d'/' -f2 -s )" - docker build docker-mods/$app --tag gilbn/theme.park:$app${{ github.event.inputs.append-tag }} - docker push gilbn/theme.park:$app${{ github.event.inputs.append-tag }} + docker build docker-mods/$app --tag ${{ secrets.DH_USER }}/theme.park:$app${{ github.event.inputs.append-tag }} + docker push ${{ secrets.DH_USER }}/theme.park:$app${{ github.event.inputs.append-tag }} done From 9850f655ed61cdee7b48ee6b3dbac76fe80ea362 Mon Sep 17 00:00:00 2001 From: lukas Date: Tue, 15 Aug 2023 09:35:53 +0200 Subject: [PATCH 3/8] Update gitea themes for 1.20 --- css/base/gitea/gitea-base.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/css/base/gitea/gitea-base.css b/css/base/gitea/gitea-base.css index 9f43e61ca4..19fc212983 100644 --- a/css/base/gitea/gitea-base.css +++ b/css/base/gitea/gitea-base.css @@ -24,7 +24,11 @@ --color-primary: rgb(var(--gitea-color-primary-dark-4),.6); --color-primary-dark-2: rgb(var(--gitea-color-primary-dark-4),.8); --color-primary-dark-4: rgb(var(--gitea-color-primary-dark-4)); - } + --color-nav-bg: var(--main-bg-color); + --color-button: transparent; + --color-menu: transparent; + --color-footer: transparent; +} body { background: var(--main-bg-color); From 8b8406f3103e76e23afecb463cf98f4cbb2367de Mon Sep 17 00:00:00 2001 From: Lex Nastin Date: Tue, 8 Aug 2023 03:33:37 +0100 Subject: [PATCH 4/8] add support for latest transmission --- css/base/transmission/transmission-base.css | 22 ++++++++++++------- .../s6-overlay/s6-rc.d/init-mod-themepark/run | 7 +++++- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/css/base/transmission/transmission-base.css b/css/base/transmission/transmission-base.css index 732d51ac32..dd90df3852 100644 --- a/css/base/transmission/transmission-base.css +++ b/css/base/transmission/transmission-base.css @@ -285,23 +285,27 @@ div#toolbar>div#toolbar-inspector:before { } ul.torrent_list, -ul.torrent_list li.torrent.even { - background: var(--transparency-dark-25) +ul.torrent_list li.torrent.even, +ul.torrent-list, +ul.torrent-list li.torrent.even { + background: var(--transparency-dark-25) !important; } ul.torrent_list li.torrent div.torrent_name { color: var(--text-hover); } -ul.torrent_list li.torrent.selected { - background: var(--transparency-dark-25); +ul.torrent_list li.torrent.selected, +ul.torrent-list li.torrent.selected { + background: var(--transparency-dark-50) !important; } -ul.torrent_list li.torrent { +ul.torrent_list li.torrent, +ul.torrent-list li.torrent { border-bottom: 1px solid rgba(204, 204, 204, 0.1); padding: 4px 30px 5px 14px; color: var(--text); - background: var(--transparency-light-10); + background: var(--transparency-light-10) !important; } /* Modal */ @@ -961,7 +965,9 @@ div.torrent_footer #compact-button.selected:before { /*Compact mode*/ ul.torrent_list li.torrent div.torrent_name.paused, -ul.torrent_list li.torrent.compact div.torrent_name { +ul.torrent_list li.torrent.compact div.torrent_name, +ul.torrent-list li.torrent div.torrent_name.paused, +ul.torrent-list li.torrent.compact div.torrent_name { color: var(--text); } @@ -982,4 +988,4 @@ ul.torrent_list li.torrent.compact div.torrent_name { .ui-icon, .ui-widget-content .ui-icon { background-image: url(/resources/transmission/icons.png); -} \ No newline at end of file +} diff --git a/docker-mods/transmission/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/transmission/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index 45c279630d..8f7b3a1f7c 100755 --- a/docker-mods/transmission/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/transmission/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -43,8 +43,13 @@ if ! grep -q "${TP_DOMAIN}/css/base" /usr/share/transmission/web/index.html; the echo '---------------------------' echo '| Adding the stylesheet |' echo '---------------------------' + echo 'There may be 2 missing file errors right now. If there\'s only 2 you may safely' + echo 'ignore them as they\'re there for backwards compatability. If there are more' + echo 'errors than that, something went wrong.' sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/web/index.html sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/web/index.html + sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/public_html/index.html + sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/public_html/index.html printf 'Stylesheet set to %s\n' "${TP_THEME} " -fi \ No newline at end of file +fi From a1ad36fd4715585acaacf4770860236758715d94 Mon Sep 17 00:00:00 2001 From: Lex Nastin Date: Tue, 8 Aug 2023 21:16:00 +0100 Subject: [PATCH 5/8] fix transmission log message --- .../root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-mods/transmission/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/transmission/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index 8f7b3a1f7c..13bfa7ada6 100755 --- a/docker-mods/transmission/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/transmission/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -43,8 +43,8 @@ if ! grep -q "${TP_DOMAIN}/css/base" /usr/share/transmission/web/index.html; the echo '---------------------------' echo '| Adding the stylesheet |' echo '---------------------------' - echo 'There may be 2 missing file errors right now. If there\'s only 2 you may safely' - echo 'ignore them as they\'re there for backwards compatability. If there are more' + echo 'There may be 2 missing file errors right now. If there''s only 2 you may safely' + echo 'ignore them as they''re there for backwards compatability. If there are more' echo 'errors than that, something went wrong.' sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/web/index.html sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/web/index.html From d852434b45023f75382f2f757534afd1f95d7926 Mon Sep 17 00:00:00 2001 From: Marius <24592972+gilbN@users.noreply.github.com> Date: Sun, 20 Aug 2023 17:51:10 +0200 Subject: [PATCH 6/8] Add script for loading unraid theme locally --- css/addons/unraid/local.sh | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 css/addons/unraid/local.sh diff --git a/css/addons/unraid/local.sh b/css/addons/unraid/local.sh new file mode 100644 index 0000000000..441be67370 --- /dev/null +++ b/css/addons/unraid/local.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# +# Theme-Park Theme CSS Synchronization Script +# +# This script synchronizes the CSS files needed for the theme-park.dev Unraid theme +# into the Dynamix CSS styles folder. The script creates destination subfolders if +# they don't exist and performs rsync for each subfolder. It then updates the @import references +# in CSS files so the the files get correctly loaded on the client. +# +# This script is intended for users of the "Theme Engine" plugin, allowing custom +# styling to be added into the HTML head that references the copied CSS files. +# +# After running this script, you can use the following code snippet as an example +# in your HTML head to include the copied CSS files using the "Theme Engine" plugin: +# +# +# +# +# Tip: You can use the "User Scripts" plugin in Unraid to schedule this script to run +# automatically when the Unraid array starts. +# + +# Define root source folder (CHANGE THIS TO YOUR DESIRED SOURCE FOLDER) +root_source_folder="/path/to/the/theme-park/root/folder" + + +# -------------------- Start of Script -------------------- +# Define subfolders +subfolders=("base/unraid" "theme-options" "defaults" "community-theme-options") + +# Main destination folder +main_destination_folder="/usr/local/emhttp/plugins/dynamix/styles/theme-park/css/" + +# User instructions +# Instructions: Only change the 'root_source_folder' variable to point to your desired source directory. +# Do NOT modify other variables unless you understand their purpose. + +# Create subfolders if they don't exist +for subfolder in "${subfolders[@]}"; do + destination_folder="$main_destination_folder$subfolder" + if [ ! -d "$destination_folder" ]; then + echo "Destination folder not found. Creating destination folder: $destination_folder" + mkdir -p "$destination_folder" + fi +done + +# Perform rsync for each subfolder to its corresponding destination +for subfolder in "${subfolders[@]}"; do + source_folder="$root_source_folder/$subfolder" + destination_folder="$main_destination_folder$subfolder" + + # Check if source folder exists + if [ ! -d "$source_folder" ]; then + echo "Source folder not found: $source_folder" + exit 1 + fi + + rsync -av --delete "$source_folder/" "$destination_folder" + echo "Synchronization complete for source: $source_folder to destination: $destination_folder" +done + +# Update import references in CSS files so the the files get correctly loaded on the client +echo "Updating import references..." +find "$main_destination_folder" -type f -name "*.css" -exec sed -i 's|@import url("/css/|@import url("/webGui/styles/theme-park/css/|g' {} + + +echo "Reference update complete." + +# ---- End of Script ---- + +echo "All synchronizations complete." From 993e36f0d7ce74769615d6b0413e47332a65925d Mon Sep 17 00:00:00 2001 From: Marius <24592972+gilbN@users.noreply.github.com> Date: Sun, 20 Aug 2023 18:00:42 +0200 Subject: [PATCH 7/8] Add addon folder check --- themes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes.py b/themes.py index 637afdcb46..40f7b20373 100644 --- a/themes.py +++ b/themes.py @@ -36,7 +36,7 @@ def create_addons_json() -> str: addon_folders = [name for name in listdir( addon_root) if isdir(join(addon_root, name))] for app in addon_folders: - app_addons = [addon for addon in listdir(f"{addon_root}/{app}")] + app_addons = [addon for addon in listdir(f"{addon_root}/{app}") if isdir(f"{addon_root}/{app}/{addon}")] ADDONS["addons"].update({ app: { addon: {} for addon in app_addons From a55b14f23a6e309c24f2ceb1a8d88286c07f094d Mon Sep 17 00:00:00 2001 From: Marius <24592972+gilbN@users.noreply.github.com> Date: Tue, 22 Aug 2023 21:39:26 +0200 Subject: [PATCH 8/8] some cleanup --- css/addons/unraid/local.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/css/addons/unraid/local.sh b/css/addons/unraid/local.sh index 441be67370..7858172cd1 100644 --- a/css/addons/unraid/local.sh +++ b/css/addons/unraid/local.sh @@ -5,18 +5,17 @@ # This script synchronizes the CSS files needed for the theme-park.dev Unraid theme # into the Dynamix CSS styles folder. The script creates destination subfolders if # they don't exist and performs rsync for each subfolder. It then updates the @import references -# in CSS files so the the files get correctly loaded on the client. +# in the CSS files so the files get correctly loaded by the client. # # This script is intended for users of the "Theme Engine" plugin, allowing custom # styling to be added into the HTML head that references the copied CSS files. # # After running this script, you can use the following code snippet as an example -# in your HTML head to include the copied CSS files using the "Theme Engine" plugin: +# in your HTML head (Custom styling (advanced)) to include the copied CSS files using the "Theme Engine" plugin: # # -# +# # # Tip: You can use the "User Scripts" plugin in Unraid to schedule this script to run # automatically when the Unraid array starts.