diff --git a/.editorconfig b/.editorconfig index a92f7df..5f150f3 100755 --- a/.editorconfig +++ b/.editorconfig @@ -15,6 +15,6 @@ trim_trailing_whitespace = false indent_style = space indent_size = 2 -[{**.sh,root/etc/cont-init.d/**,root/etc/services.d/**}] +[{**.sh,root/etc/s6-overlay/s6-rc.d/**,root/etc/cont-init.d/**,root/etc/services.d/**}] indent_style = space indent_size = 4 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/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 07b35ea..2c9d827 100755 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -8,6 +8,6 @@ jobs: steps: - uses: actions/first-interaction@v1 with: - issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-davos/blob/master/.github/ISSUE_TEMPLATE/issue.bug.yml) or [feature](https://github.com/linuxserver/docker-davos/blob/master/.github/ISSUE_TEMPLATE/issue.feature.yml) issue templates!' + issue-message: 'Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.' pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-davos/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!' repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/permissions.yml b/.github/workflows/permissions.yml new file mode 100644 index 0000000..2df6b61 --- /dev/null +++ b/.github/workflows/permissions.yml @@ -0,0 +1,9 @@ +name: Permission check +on: + pull_request: + paths: + - '**/run' + - '**/finish' +jobs: + permission_check: + uses: linuxserver/github-workflows/.github/workflows/init-svc-executable-permissions.yml@v1 diff --git a/Dockerfile b/Dockerfile index a9b0a17..3b915a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + FROM openjdk:8-alpine as buildstage ARG DAVOS_RELEASE @@ -27,7 +29,7 @@ RUN \ cp build/libs/*.jar /davos.jar && \ chmod 755 /davos.jar -FROM ghcr.io/linuxserver/baseimage-alpine:3.15 +FROM ghcr.io/linuxserver/baseimage-alpine:3.17 # set version label ARG BUILD_DATE @@ -38,7 +40,6 @@ LABEL maintainer="JAGFin1,Thelamer" # install packages RUN \ apk add --no-cache \ - curl \ nss \ openjdk8-jre \ sqlite-libs diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 4b5b1b9..cdd73b2 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + FROM openjdk:8-alpine as buildstage ARG DAVOS_RELEASE @@ -27,7 +29,7 @@ RUN \ cp build/libs/*.jar /davos.jar && \ chmod 755 /davos.jar -FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.15 +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.17 # set version label ARG BUILD_DATE @@ -38,7 +40,6 @@ LABEL maintainer="JAGFin1,Thelamer" # install packages RUN \ apk add --no-cache \ - curl \ nss \ openjdk8-jre \ sqlite-libs diff --git a/Dockerfile.armhf b/Dockerfile.armhf index ff33112..e18cddf 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + FROM openjdk:8-alpine as buildstage ARG DAVOS_RELEASE @@ -27,7 +29,7 @@ RUN \ cp build/libs/*.jar /davos.jar && \ chmod 755 /davos.jar -FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.15 +FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.17 # set version label ARG BUILD_DATE @@ -38,7 +40,6 @@ LABEL maintainer="JAGFin1,Thelamer" # install packages RUN \ apk add --no-cache \ - curl \ nss \ openjdk8-jre \ sqlite-libs diff --git a/Jenkinsfile b/Jenkinsfile index 774cf6d..c76ea26 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -59,7 +59,7 @@ pipeline { env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/' env.PULL_REQUEST = env.CHANGE_ID - env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE .editorconfig ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.yml ./.github/ISSUE_TEMPLATE/issue.feature.yml ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/external_trigger_scheduler.yml ./.github/workflows/greetings.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/stale.yml ./.github/workflows/external_trigger.yml ./.github/workflows/package_trigger.yml' + env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE .editorconfig ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.yml ./.github/ISSUE_TEMPLATE/issue.feature.yml ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/external_trigger_scheduler.yml ./.github/workflows/greetings.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/stale.yml ./.github/workflows/call_invalid_helper.yml ./.github/workflows/permissions.yml ./.github/workflows/external_trigger.yml ./.github/workflows/package_trigger.yml' } script{ env.LS_RELEASE_NUMBER = sh( @@ -815,19 +815,19 @@ pipeline { echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin if [ "${CI}" == "false" ]; then docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} - docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${META_TAG} + docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG} fi for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do docker tag ${IMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} - docker tag ${IMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} - docker tag ${IMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-latest - docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-latest - docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-latest docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} + docker tag ${IMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} + docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-latest docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} + docker tag ${IMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} + docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-latest docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} if [ -n "${SEMVER}" ]; then docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${SEMVER} @@ -835,13 +835,13 @@ pipeline { docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${SEMVER} fi docker push ${MANIFESTIMAGE}:amd64-${META_TAG} - docker push ${MANIFESTIMAGE}:arm32v7-${META_TAG} - docker push ${MANIFESTIMAGE}:arm64v8-${META_TAG} - docker push ${MANIFESTIMAGE}:amd64-latest - docker push ${MANIFESTIMAGE}:arm32v7-latest - docker push ${MANIFESTIMAGE}:arm64v8-latest docker push ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} + docker push ${MANIFESTIMAGE}:amd64-latest + docker push ${MANIFESTIMAGE}:arm32v7-${META_TAG} + docker push ${MANIFESTIMAGE}:arm32v7-latest docker push ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} + docker push ${MANIFESTIMAGE}:arm64v8-${META_TAG} + docker push ${MANIFESTIMAGE}:arm64v8-latest docker push ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} if [ -n "${SEMVER}" ]; then docker push ${MANIFESTIMAGE}:amd64-${SEMVER} @@ -987,12 +987,12 @@ pipeline { sh 'echo "build aborted"' } else if (currentBuild.currentResult == "SUCCESS"){ - sh ''' curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png","embeds": [{"color": 1681177,\ + sh ''' curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/jenkins-avatar.png","embeds": [{"color": 1681177,\ "description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**ShellCheck Results:** '${SHELLCHECK_URL}'\\n**Status:** Success\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\ "username": "Jenkins"}' ${BUILDS_DISCORD} ''' } else { - sh ''' curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png","embeds": [{"color": 16711680,\ + sh ''' curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/jenkins-avatar.png","embeds": [{"color": 16711680,\ "description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**ShellCheck Results:** '${SHELLCHECK_URL}'\\n**Status:** failure\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\ "username": "Jenkins"}' ${BUILDS_DISCORD} ''' } diff --git a/README.md b/README.md index bb279cb..b70a333 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ The architectures supported by this image are: | :----: | :----: | ---- | | x86-64 | ✅ | amd64-\ | | arm64 | ✅ | arm64v8-\ | -| armhf| ✅ | arm32v7-\ | +| armhf | ✅ | arm32v7-\ | ## Application Setup @@ -78,9 +78,10 @@ services: environment: - PUID=1000 - PGID=1000 + - TZ=Etc/UTC volumes: - - :/config - - :/download + - /path/to/data>:/config + - /path/to/downloads/folder:/download ports: - 8080:8080 restart: unless-stopped @@ -93,11 +94,13 @@ docker run -d \ --name=davos \ -e PUID=1000 \ -e PGID=1000 \ + -e TZ=Etc/UTC \ -p 8080:8080 \ - -v :/config \ - -v :/download \ + -v /path/to/data>:/config \ + -v /path/to/downloads/folder:/download \ --restart unless-stopped \ lscr.io/linuxserver/davos:latest + ``` ## Parameters @@ -109,6 +112,7 @@ Container images are configured using parameters passed at runtime (such as thos | `-p 8080` | This is the default port that davos runs under | | `-e PUID=1000` | for UserID - see below for explanation | | `-e PGID=1000` | for GroupID - see below for explanation | +| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). | | `-v /config` | davos's config location. This is where it stores its database file and logs. | | `-v /download` | davos's file download location | @@ -221,6 +225,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **13.02.23:** - Rebase to Alpine 3.17, migrate to s6v3. * **15.01.22:** - Rebasing to alpine 3.15. * **01.06.20:** - Rebasing to alpine 3.12. * **19.12.19:** - Rebasing to alpine 3.11. diff --git a/readme-vars.yml b/readme-vars.yml index 5691638..e147a04 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -18,8 +18,8 @@ available_architectures: param_container_name: "{{ project_name }}" param_usage_include_vols: true param_volumes: - - { vol_path: "/config", vol_host_path: "", desc: "davos's config location. This is where it stores its database file and logs." } - - { vol_path: "/download", vol_host_path: "", desc: "davos's file download location" } + - { vol_path: "/config", vol_host_path: "/path/to/data>", desc: "davos's config location. This is where it stores its database file and logs." } + - { vol_path: "/download", vol_host_path: "/path/to/downloads/folder", desc: "davos's file download location" } param_usage_include_ports: true param_ports: @@ -32,6 +32,7 @@ app_setup_block: | # changelog changelogs: + - { date: "13.02.23:", desc: "Rebase to Alpine 3.17, migrate to s6v3." } - { date: "15.01.22:", desc: "Rebasing to alpine 3.15." } - { date: "01.06.20:", desc: "Rebasing to alpine 3.12." } - { date: "19.12.19:", desc: "Rebasing to alpine 3.11." } diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config deleted file mode 100644 index b5d37e0..0000000 --- a/root/etc/cont-init.d/30-config +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/with-contenv bash - -# permissions -chown -R abc:abc \ - /app \ - /config -chown abc:abc \ - /download diff --git a/root/etc/s6-rc.d/init-config-end/dependencies.d/init-davos-config b/root/etc/s6-rc.d/init-config-end/dependencies.d/init-davos-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-rc.d/init-davos-config/dependencies.d/init-config b/root/etc/s6-rc.d/init-davos-config/dependencies.d/init-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-rc.d/init-davos-config/run b/root/etc/s6-rc.d/init-davos-config/run new file mode 100755 index 0000000..6cbde24 --- /dev/null +++ b/root/etc/s6-rc.d/init-davos-config/run @@ -0,0 +1,9 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +# permissions +lsiown -R abc:abc \ + /config + +lsiown abc:abc \ + /download diff --git a/root/etc/s6-rc.d/init-davos-config/type b/root/etc/s6-rc.d/init-davos-config/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/root/etc/s6-rc.d/init-davos-config/type @@ -0,0 +1 @@ +oneshot diff --git a/root/etc/s6-rc.d/init-davos-config/up b/root/etc/s6-rc.d/init-davos-config/up new file mode 100644 index 0000000..e25c874 --- /dev/null +++ b/root/etc/s6-rc.d/init-davos-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-davos-config/run diff --git a/root/etc/s6-rc.d/svc-davos/dependencies.d/init-services b/root/etc/s6-rc.d/svc-davos/dependencies.d/init-services new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-rc.d/svc-davos/notification-fd b/root/etc/s6-rc.d/svc-davos/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/root/etc/s6-rc.d/svc-davos/notification-fd @@ -0,0 +1 @@ +3 diff --git a/root/etc/s6-rc.d/svc-davos/run b/root/etc/s6-rc.d/svc-davos/run new file mode 100755 index 0000000..85f3073 --- /dev/null +++ b/root/etc/s6-rc.d/svc-davos/run @@ -0,0 +1,6 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +exec \ + s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8080" \ + s6-setuidgid abc /usr/bin/java -jar /app/davos/davos.jar diff --git a/root/etc/s6-rc.d/svc-davos/type b/root/etc/s6-rc.d/svc-davos/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/root/etc/s6-rc.d/svc-davos/type @@ -0,0 +1 @@ +longrun diff --git a/root/etc/s6-rc.d/user/contents.d/init-davos-config b/root/etc/s6-rc.d/user/contents.d/init-davos-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-rc.d/user/contents.d/svc-davos b/root/etc/s6-rc.d/user/contents.d/svc-davos new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/services.d/davos/run b/root/etc/services.d/davos/run deleted file mode 100644 index ba91bcd..0000000 --- a/root/etc/services.d/davos/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/with-contenv bash - -exec \ - s6-setuidgid abc /usr/bin/java -jar /app/davos/davos.jar