diff --git a/.editorconfig b/.editorconfig new file mode 100755 index 000000000..5f150f350 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# This file is globally distributed to all container image projects from +# https://github.com/linuxserver/docker-jenkins-builder/blob/master/.editorconfig + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +# trim_trailing_whitespace may cause unintended issues and should not be globally set true +trim_trailing_whitespace = false + +[{Dockerfile*,**.yml}] +indent_style = space +indent_size = 2 + +[{**.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/CONTRIBUTING.md b/.github/CONTRIBUTING.md old mode 100755 new mode 100644 index 3dea55a20..2409791f8 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -4,7 +4,7 @@ * While contributing make sure to make all your changes before creating a Pull Request, as our pipeline builds each commit after the PR is open. * Read, and fill the Pull Request template - * If this is a fix for a typo in code or documentation in the README please file an issue + * If this is a fix for a typo (in code, documentation, or the README) please file an issue and let us sort it out. We do not need a PR * If the PR is addressing an existing issue include, closes #\, in the body of the PR commit message * If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://discord.gg/YWrKVTn) @@ -24,7 +24,7 @@ ## Readme If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit. -Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-calibre-web/edit/master/readme-vars.yml). +Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-calibre-web/edit/nightly/readme-vars.yml). These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play. Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io/images/docker-calibre-web) @@ -96,7 +96,7 @@ If you are proposing additional packages to be added, ensure that you added the ### Testing your changes -``` +```bash git clone https://github.com/linuxserver/docker-calibre-web.git cd docker-calibre-web docker build \ @@ -106,15 +106,16 @@ docker build \ ``` The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static` -``` + +```bash docker run --rm --privileged multiarch/qemu-user-static:register --reset ``` Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`. -## Update the chagelog +## Update the changelog -If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-calibre-web/tree/master/root), add an entry to the changelog +If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-calibre-web/tree/nightly/root), add an entry to the changelog ```yml changelogs: diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml old mode 100755 new mode 100644 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml old mode 100755 new mode 100644 diff --git a/.github/ISSUE_TEMPLATE/issue.bug.md b/.github/ISSUE_TEMPLATE/issue.bug.md deleted file mode 100755 index 41f6150bc..000000000 --- a/.github/ISSUE_TEMPLATE/issue.bug.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- -[linuxserverurl]: https://linuxserver.io -[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] - - - - - ------------------------------- - -## Expected Behavior - - -## Current Behavior - - -## Steps to Reproduce - - -1. -2. -3. -4. - -## Environment -**OS:** -**CPU architecture:** x86_64/arm32/arm64 -**How docker service was installed:** - - - -## Command used to create docker container (run/create/compose/screenshot) - - -## Docker logs - diff --git a/.github/ISSUE_TEMPLATE/issue.bug.yml b/.github/ISSUE_TEMPLATE/issue.bug.yml new file mode 100755 index 000000000..ce3d19aff --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue.bug.yml @@ -0,0 +1,76 @@ +# Based on the issue template +name: Bug report +description: Create a report to help us improve +title: "[BUG] " +labels: [Bug] +body: + - type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the bug you encountered. + options: + - label: I have searched the existing issues + required: true + - type: textarea + attributes: + label: Current Behavior + description: Tell us what happens instead of the expected behavior. + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: Tell us what should happen. + validations: + required: false + - type: textarea + attributes: + label: Steps To Reproduce + description: Steps to reproduce the behavior. + placeholder: | + 1. In this environment... + 2. With this config... + 3. Run '...' + 4. See error... + validations: + required: true + - type: textarea + attributes: + label: Environment + description: | + examples: + - **OS**: Ubuntu 20.04 + - **How docker service was installed**: distro's packagemanager + value: | + - OS: + - How docker service was installed: + render: markdown + validations: + required: false + - type: dropdown + attributes: + label: CPU architecture + options: + - x86-64 + - arm64 + validations: + required: true + - type: textarea + attributes: + label: Docker creation + description: | + Command used to create docker container + Provide your docker create/run command or compose yaml snippet, or a screenshot of settings if using a gui to create the container + render: bash + validations: + required: true + - type: textarea + attributes: + description: | + Provide a full docker log, output of "docker logs linuxserver.io" + label: Container logs + placeholder: | + Output of `docker logs linuxserver.io` + render: bash + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/issue.feature.md b/.github/ISSUE_TEMPLATE/issue.feature.md deleted file mode 100755 index 20a91fdb1..000000000 --- a/.github/ISSUE_TEMPLATE/issue.feature.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project - ---- -[linuxserverurl]: https://linuxserver.io -[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] - -<!--- If you are new to Docker or this application our issue tracker is **ONLY** used for reporting bugs or requesting features. Please use [our discord server](https://discord.gg/YWrKVTn) for general support. ---> - -<!--- If this acts as a feature request please ask yourself if this modification is something the whole userbase will benefit from ---> -<!--- If this is a specific change for corner case functionality or plugins please look at making a Docker Mod or local script https://blog.linuxserver.io/2019/09/14/customizing-our-containers/ --> - -<!--- Provide a general summary of the request in the Title above --> - ------------------------------- - -## Desired Behavior -<!--- Tell us what should happen --> - -## Current Behavior -<!--- Tell us what happens instead of the expected behavior --> - -## Alternatives Considered -<!--- Tell us what other options you have tried or considered --> diff --git a/.github/ISSUE_TEMPLATE/issue.feature.yml b/.github/ISSUE_TEMPLATE/issue.feature.yml new file mode 100755 index 000000000..099dcdb5e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue.feature.yml @@ -0,0 +1,31 @@ +# Based on the issue template +name: Feature request +description: Suggest an idea for this project +title: "[FEAT] <title>" +labels: [enhancement] +body: + - type: checkboxes + attributes: + label: Is this a new feature request? + description: Please search to see if a feature request already exists. + options: + - label: I have searched the existing issues + required: true + - type: textarea + attributes: + label: Wanted change + description: Tell us what you want to happen. + validations: + required: true + - type: textarea + attributes: + label: Reason for change + description: Justify your request, why do you want it, what is the benefit. + validations: + required: true + - type: textarea + attributes: + label: Proposed code change + description: Do you have a potential code change in mind? + validations: + required: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index dec28f35d..3127721ef 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,7 +6,7 @@ <!--- Before submitting a pull request please check the following --> -<!--- If this is a fix for a typo in code or documentation in the README please file an issue and let us sort it out we do not need a PR --> +<!--- If this is a fix for a typo (in code, documentation, or the README) please file an issue and let us sort it out. We do not need a PR --> <!--- Ask yourself if this modification is something the whole userbase will benefit from, if this is a specific change for corner case functionality or plugins please look at making a Docker Mod or local script https://blog.linuxserver.io/2019/09/14/customizing-our-containers/ --> <!--- That if the PR is addressing an existing issue include, closes #<issue number> , in the body of the PR commit message --> <!--- You have included links to any files / patches etc your PR may be using in the body of the PR commit message --> @@ -21,7 +21,7 @@ ------------------------------ - - [ ] I have read the [contributing](https://github.com/linuxserver/docker-calibre-web/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications + - [ ] I have read the [contributing](https://github.com/linuxserver/docker-calibre-web/blob/nightly/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications ------------------------------ diff --git a/.github/workflows/call_issue_pr_tracker.yml b/.github/workflows/call_issue_pr_tracker.yml new file mode 100755 index 000000000..2c3078434 --- /dev/null +++ b/.github/workflows/call_issue_pr_tracker.yml @@ -0,0 +1,16 @@ +name: Issue & PR Tracker + +on: + issues: + types: [opened,reopened,labeled,unlabeled,closed] + pull_request_target: + types: [opened,reopened,review_requested,review_request_removed,labeled,unlabeled,closed] + pull_request_review: + types: [submitted,edited,dismissed] + +jobs: + manage-project: + permissions: + issues: write + uses: linuxserver/github-workflows/.github/workflows/issue-pr-tracker.yml@v1 + secrets: inherit diff --git a/.github/workflows/call_issues_cron.yml b/.github/workflows/call_issues_cron.yml new file mode 100755 index 000000000..400edc4b2 --- /dev/null +++ b/.github/workflows/call_issues_cron.yml @@ -0,0 +1,13 @@ +name: Mark stale issues and pull requests +on: + schedule: + - cron: '56 23 * * *' + workflow_dispatch: + +jobs: + stale: + permissions: + issues: write + pull-requests: write + uses: linuxserver/github-workflows/.github/workflows/issues-cron.yml@v1 + secrets: inherit diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml old mode 100755 new mode 100644 index c52d194c2..eae8094a1 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -4,24 +4,26 @@ on: workflow_dispatch: jobs: - external-trigger-master: + external-trigger-nightly: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.3 + - uses: actions/checkout@v3.1.0 - name: External Trigger - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/nightly' run: | - if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_CALIBRE_WEB_MASTER }}" ]; then - echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_CALIBRE_WEB_MASTER is set; skipping trigger. ****" + if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_CALIBRE_WEB_NIGHTLY }}" ]; then + echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_CALIBRE_WEB_NIGHTLY is set; skipping trigger. ****" + echo "Github secret \`PAUSE_EXTERNAL_TRIGGER_CALIBRE_WEB_NIGHTLY\` is set; skipping trigger." >> $GITHUB_STEP_SUMMARY exit 0 fi - echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_CALIBRE_WEB_MASTER\". ****" + echo "**** External trigger running off of nightly branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_CALIBRE_WEB_NIGHTLY\". ****" + echo "External trigger running off of nightly branch. To disable this trigger, set a Github secret named \`PAUSE_EXTERNAL_TRIGGER_CALIBRE_WEB_NIGHTLY\`" >> $GITHUB_STEP_SUMMARY echo "**** Retrieving external version ****" - EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" | jq -r '. | .tag_name') + EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/janeczku/calibre-web/commits/master" | jq -r '. | .sha' | cut -c1-8) if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then echo "**** Can't retrieve external version, exiting ****" - FAILURE_REASON="Can't retrieve external version for calibre-web branch master" + FAILURE_REASON="Can't retrieve external version for calibre-web branch nightly" GHA_TRIGGER_URL="https://github.com/linuxserver/docker-calibre-web/actions/runs/${{ github.run_id }}" curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680, "description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}], @@ -30,9 +32,10 @@ jobs: fi EXT_RELEASE=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g') echo "**** External version: ${EXT_RELEASE} ****" + echo "External version: ${EXT_RELEASE}" >> $GITHUB_STEP_SUMMARY echo "**** Retrieving last pushed version ****" image="linuxserver/calibre-web" - tag="latest" + tag="nightly" token=$(curl -sX GET \ "https://ghcr.io/token?scope=repository%3Alinuxserver%2Fcalibre-web%3Apull" \ | jq -r '.token') @@ -48,29 +51,41 @@ jobs: | jq -r '.config.digest') image_info=$(curl -sL \ --header "Authorization: Bearer ${token}" \ - "https://ghcr.io/v2/${image}/blobs/${digest}" \ - | jq -r '.container_config') + "https://ghcr.io/v2/${image}/blobs/${digest}") + if [[ $(echo $image_info | jq -r '.container_config') == "null" ]]; then + image_info=$(echo $image_info | jq -r '.config') + else + image_info=$(echo $image_info | jq -r '.container_config') + fi IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}') IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}') if [ -z "${IMAGE_VERSION}" ]; then echo "**** Can't retrieve last pushed version, exiting ****" - FAILURE_REASON="Can't retrieve last pushed version for calibre-web tag latest" + FAILURE_REASON="Can't retrieve last pushed version for calibre-web tag nightly" curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680, "description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}], "username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} exit 1 fi echo "**** Last pushed version: ${IMAGE_VERSION} ****" + echo "Last pushed version: ${IMAGE_VERSION}" >> $GITHUB_STEP_SUMMARY if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then echo "**** Version ${EXT_RELEASE} already pushed, exiting ****" + echo "Version ${EXT_RELEASE} already pushed, exiting" >> $GITHUB_STEP_SUMMARY exit 0 - elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then + elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/nightly/lastBuild/api/json | jq -r '.building') == "true" ]; then echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****" + echo "New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY + exit 0 + elif [[ $(( $(date +%s%3N) - $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/nightly/lastBuild/api/json | jq -r '.timestamp') )) -lt $(( 6 * 3600000 )) ]]; then + echo "**** New version ${EXT_RELEASE} found; but the last build was less than 6 hours ago; skipping trigger ****" + echo "New version ${EXT_RELEASE} found; but the last build was less than 6 hours ago; skipping trigger" >> $GITHUB_STEP_SUMMARY exit 0 else echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****" + echo "New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build" >> $GITHUB_STEP_SUMMARY response=$(curl -iX POST \ - https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/master/buildWithParameters?PACKAGE_CHECK=false \ + https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/nightly/buildWithParameters?PACKAGE_CHECK=false \ --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|") echo "**** Jenkins job queue url: ${response%$'\r'} ****" echo "**** Sleeping 10 seconds until job starts ****" @@ -78,6 +93,7 @@ jobs: buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url') buildurl="${buildurl%$'\r'}" echo "**** Jenkins job build url: ${buildurl} ****" + echo "Jenkins job build url: ${buildurl}" >> $GITHUB_STEP_SUMMARY echo "**** Attempting to change the Jenkins job description ****" curl -iX POST \ "${buildurl}submitDescription" \ @@ -85,7 +101,7 @@ jobs: --data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ --data-urlencode "Submit=Submit" echo "**** Notifying Discord ****" - TRIGGER_REASON="A version change was detected for calibre-web tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}" + TRIGGER_REASON="A version change was detected for calibre-web tag nightly. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}" curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903, "description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}], "username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/external_trigger_scheduler.yml b/.github/workflows/external_trigger_scheduler.yml old mode 100755 new mode 100644 index 646d1da86..2bd94887a --- a/.github/workflows/external_trigger_scheduler.yml +++ b/.github/workflows/external_trigger_scheduler.yml @@ -2,14 +2,14 @@ name: External Trigger Scheduler on: schedule: - - cron: '55 * * * *' + - cron: '4 * * * *' workflow_dispatch: jobs: external-trigger-scheduler: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.3 + - uses: actions/checkout@v3.1.0 with: fetch-depth: '0' @@ -17,18 +17,18 @@ jobs: run: | echo "**** Branches found: ****" git for-each-ref --format='%(refname:short)' refs/remotes - echo "**** Pulling the yq docker image ****" - docker pull ghcr.io/linuxserver/yq for br in $(git for-each-ref --format='%(refname:short)' refs/remotes) do br=$(echo "$br" | sed 's|origin/||g') echo "**** Evaluating branch ${br} ****" - ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/jenkins-vars.yml \ - | docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch) - if [ "$br" == "$ls_branch" ]; then - echo "**** Branch ${br} appears to be live; checking workflow. ****" + ls_jenkins_vars=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/jenkins-vars.yml) + ls_branch=$(echo "${ls_jenkins_vars}" | yq -r '.ls_branch') + ls_trigger=$(echo "${ls_jenkins_vars}" | yq -r '.external_type') + if [[ "${br}" == "${ls_branch}" ]] && [[ "${ls_trigger}" != "os" ]]; then + echo "**** Branch ${br} appears to be live and trigger is not os; checking workflow. ****" if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then echo "**** Workflow exists. Triggering external trigger workflow for branch ${br} ****." + echo "Triggering external trigger workflow for branch ${br}" >> $GITHUB_STEP_SUMMARY curl -iX POST \ -H "Authorization: token ${{ secrets.CR_PAT }}" \ -H "Accept: application/vnd.github.v3+json" \ @@ -36,8 +36,10 @@ jobs: https://api.github.com/repos/linuxserver/docker-calibre-web/actions/workflows/external_trigger.yml/dispatches else echo "**** Workflow doesn't exist; skipping trigger. ****" + echo "Skipping branch ${br} due to no external trigger workflow present." >> $GITHUB_STEP_SUMMARY fi else - echo "**** ${br} appears to be a dev branch; skipping trigger. ****" + echo "**** ${br} is either a dev branch, or has no external version; skipping trigger. ****" + echo "Skipping branch ${br} due to being detected as dev branch or having no external version." >> $GITHUB_STEP_SUMMARY fi done diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml old mode 100755 new mode 100644 index 17e3bc054..af9c354ba --- 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-calibre-web/blob/master/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-calibre-web/blob/master/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!' - pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-calibre-web/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!' + 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-calibre-web/blob/nightly/.github/PULL_REQUEST_TEMPLATE.md)!' repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/package_trigger.yml b/.github/workflows/package_trigger.yml old mode 100755 new mode 100644 index 3db3dad48..9a52efe9d --- a/.github/workflows/package_trigger.yml +++ b/.github/workflows/package_trigger.yml @@ -4,25 +4,28 @@ on: workflow_dispatch: jobs: - package-trigger-master: + package-trigger-nightly: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.3 + - uses: actions/checkout@v3.1.0 - name: Package Trigger - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/nightly' run: | - if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_CALIBRE_WEB_MASTER }}" ]; then - echo "**** Github secret PAUSE_PACKAGE_TRIGGER_CALIBRE_WEB_MASTER is set; skipping trigger. ****" + if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_CALIBRE_WEB_NIGHTLY }}" ]; then + echo "**** Github secret PAUSE_PACKAGE_TRIGGER_CALIBRE_WEB_NIGHTLY is set; skipping trigger. ****" + echo "Github secret \`PAUSE_PACKAGE_TRIGGER_CALIBRE_WEB_NIGHTLY\` is set; skipping trigger." >> $GITHUB_STEP_SUMMARY exit 0 fi - if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then + if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/nightly/lastBuild/api/json | jq -r '.building') == "true" ]; then echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****" + echo "There already seems to be an active build on Jenkins; skipping package trigger" >> $GITHUB_STEP_SUMMARY exit 0 fi - echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_CALIBRE_WEB_MASTER\". ****" + echo "**** Package trigger running off of nightly branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_CALIBRE_WEB_NIGHTLY\". ****" + echo "Package trigger running off of nightly branch. To disable, set a Github secret named \`PAUSE_PACKAGE_TRIGGER_CALIBRE_WEB_NIGHTLY\`" >> $GITHUB_STEP_SUMMARY response=$(curl -iX POST \ - https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/master/buildWithParameters?PACKAGE_CHECK=true \ + https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/nightly/buildWithParameters?PACKAGE_CHECK=true \ --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|") echo "**** Jenkins job queue url: ${response%$'\r'} ****" echo "**** Sleeping 10 seconds until job starts ****" @@ -30,6 +33,7 @@ jobs: buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url') buildurl="${buildurl%$'\r'}" echo "**** Jenkins job build url: ${buildurl} ****" + echo "Jenkins job build url: ${buildurl}" >> $GITHUB_STEP_SUMMARY echo "**** Attempting to change the Jenkins job description ****" curl -iX POST \ "${buildurl}submitDescription" \ diff --git a/.github/workflows/package_trigger_scheduler.yml b/.github/workflows/package_trigger_scheduler.yml old mode 100755 new mode 100644 index 8f9f9b2a9..6cfe03f68 --- a/.github/workflows/package_trigger_scheduler.yml +++ b/.github/workflows/package_trigger_scheduler.yml @@ -2,14 +2,14 @@ name: Package Trigger Scheduler on: schedule: - - cron: '31 9 * * 2' + - cron: '9 0 * * 0' workflow_dispatch: jobs: package-trigger-scheduler: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.3 + - uses: actions/checkout@v3.1.0 with: fetch-depth: '0' @@ -17,18 +17,16 @@ jobs: run: | echo "**** Branches found: ****" git for-each-ref --format='%(refname:short)' refs/remotes - echo "**** Pulling the yq docker image ****" - docker pull ghcr.io/linuxserver/yq for br in $(git for-each-ref --format='%(refname:short)' refs/remotes) do br=$(echo "$br" | sed 's|origin/||g') echo "**** Evaluating branch ${br} ****" - ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/jenkins-vars.yml \ - | docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch) + ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/jenkins-vars.yml | yq -r '.ls_branch') if [ "${br}" == "${ls_branch}" ]; then echo "**** Branch ${br} appears to be live; checking workflow. ****" if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/.github/workflows/package_trigger.yml > /dev/null 2>&1; then echo "**** Workflow exists. Triggering package trigger workflow for branch ${br}. ****" + echo "Triggering package trigger workflow for branch ${br}" >> $GITHUB_STEP_SUMMARY triggered_branches="${triggered_branches}${br} " curl -iX POST \ -H "Authorization: token ${{ secrets.CR_PAT }}" \ @@ -38,9 +36,11 @@ jobs: sleep 30 else echo "**** Workflow doesn't exist; skipping trigger. ****" + echo "Skipping branch ${br} due to no package trigger workflow present." >> $GITHUB_STEP_SUMMARY fi else echo "**** ${br} appears to be a dev branch; skipping trigger. ****" + echo "Skipping branch ${br} due to being detected as dev branch." >> $GITHUB_STEP_SUMMARY fi done echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****" diff --git a/.github/workflows/permissions.yml b/.github/workflows/permissions.yml new file mode 100755 index 000000000..1447bc55a --- /dev/null +++ b/.github/workflows/permissions.yml @@ -0,0 +1,10 @@ +name: Permission check +on: + pull_request_target: + paths: + - '**/run' + - '**/finish' + - '**/check' +jobs: + permission_check: + uses: linuxserver/github-workflows/.github/workflows/init-svc-executable-permissions.yml@v1 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100755 index 1806420a2..000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Mark stale issues and pull requests - -on: - schedule: - - cron: "30 1 * * *" - -jobs: - stale: - - runs-on: ubuntu-latest - - steps: - - uses: actions/stale@v1 - with: - stale-issue-message: "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions." - stale-pr-message: "This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions." - stale-issue-label: 'no-issue-activity' - stale-pr-label: 'no-pr-activity' - days-before-stale: 30 - days-before-close: 365 - exempt-issue-labels: 'awaiting-approval,work-in-progress' - exempt-pr-labels: 'awaiting-approval,work-in-progress' - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 96374c4e7..6e8ad9772 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ $RECYCLE.BIN/ Network Trash Folder Temporary Items .apdisk +.jenkins-external diff --git a/Dockerfile b/Dockerfile index cee66dfd4..38d79731c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,73 +1,82 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:focal +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/unrar:latest as unrar + +FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy + # set version label ARG BUILD_DATE ARG VERSION -ARG CALIBREWEB_RELEASE +ARG CALIBREWEB_COMMIT LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="chbmb" +LABEL maintainer="notdriz" RUN \ - echo "**** install build packages ****" && \ - apt-get update && \ - apt-get install -y \ - git \ - libldap2-dev \ - libsasl2-dev \ - python3-pip && \ - echo "**** install runtime packages ****" && \ - apt-get install -y \ - imagemagick \ - libnss3 \ - libxcomposite1 \ - libxi6 \ - libxslt1.1 \ - libldap-2.4-2 \ - libsasl2-2 \ - python3-minimal \ - python3-pkg-resources \ - unrar && \ - echo "**** install calibre-web ****" && \ - if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ - CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/calibre-web.tar.gz -L \ - https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \ - mkdir -p \ - /app/calibre-web && \ - tar xf \ - /tmp/calibre-web.tar.gz -C \ - /app/calibre-web --strip-components=1 && \ - cd /app/calibre-web && \ - pip3 install --no-cache-dir -U -r \ - requirements.txt && \ - pip3 install --no-cache-dir -U -r \ - optional-requirements.txt && \ - echo "***install kepubify" && \ - if [ -z ${KEPUBIFY_RELEASE+x} ]; then \ + echo "**** install build packages ****" && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + libldap2-dev \ + libsasl2-dev \ + python3-dev && \ + echo "**** install runtime packages ****" && \ + apt-get install -y --no-install-recommends \ + imagemagick \ + ghostscript \ + libldap-2.5-0 \ + libsasl2-2 \ + libxi6 \ + libxslt1.1 \ + python3-venv && \ + echo "**** install calibre-web ****" && \ + if [ -z ${CALIBREWEB_COMMIT+x} ]; then \ + CALIBREWEB_COMMIT=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/commits/master" \ + | awk '/sha/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/calibre-web.tar.gz -L \ + "https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_COMMIT}.tar.gz" && \ + mkdir -p \ + /app/calibre-web && \ + tar xf \ + /tmp/calibre-web.tar.gz -C \ + /app/calibre-web --strip-components=1 && \ + cd /app/calibre-web && \ + python3 -m venv /lsiopy && \ + pip install -U --no-cache-dir \ + pip \ + wheel && \ + pip install -U --no-cache-dir -U --find-links https://wheel-index.linuxserver.io/ubuntu/ -r \ + requirements.txt -r \ + optional-requirements.txt && \ + echo "***install kepubify" && \ + if [ -z ${KEPUBIFY_RELEASE+x} ]; then \ KEPUBIFY_RELEASE=$(curl -sX GET "https://api.github.com/repos/pgaskin/kepubify/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /usr/bin/kepubify -L \ - https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-64bit && \ - echo "**** cleanup ****" && \ - apt-get -y purge \ - git \ - libldap2-dev \ - libsasl2-dev \ - python3-pip && \ - apt-get -y autoremove && \ - rm -rf \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/* - + fi && \ + curl -o \ + /usr/bin/kepubify -L \ + https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-64bit && \ + echo "**** cleanup ****" && \ + apt-get -y purge \ + build-essential \ + libldap2-dev \ + libsasl2-dev \ + python3-dev && \ + apt-get -y autoremove && \ + rm -rf \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* \ + /root/.cache + # add local files COPY root/ / +# add unrar +COPY --from=unrar /usr/bin/unrar-ubuntu /usr/bin/unrar + # ports and volumes EXPOSE 8083 VOLUME /config diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index cb957db41..b08e6e6ec 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,87 +1,93 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-focal +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/unrar:arm64v8-latest as unrar + +FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy # set version label ARG BUILD_DATE ARG VERSION -ARG CALIBREWEB_RELEASE +ARG CALIBREWEB_COMMIT LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="chbmb" +LABEL maintainer="notdriz" RUN \ - echo "**** install build packages ****" && \ - apt-get update && \ - apt-get install -y \ - g++ \ - gcc \ - git \ - libffi-dev \ - libjpeg-dev \ - libldap2-dev \ - libsasl2-dev \ - libxml2-dev \ - libxslt1-dev \ - python3-pip \ - zlib1g-dev && \ - echo "**** install runtime packages ****" && \ - apt-get install -y \ - imagemagick \ - libldap-2.4-2 \ - libnss3 \ - libsasl2-2 \ - libxcomposite1 \ - libxi6 \ - libxslt1.1 \ - python3-minimal \ - python3-pkg-resources \ - unrar && \ - echo "**** install calibre-web ****" && \ - if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ - CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/calibre-web.tar.gz -L \ - https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \ - mkdir -p \ - /app/calibre-web && \ - tar xf \ - /tmp/calibre-web.tar.gz -C \ - /app/calibre-web --strip-components=1 && \ - cd /app/calibre-web && \ - pip3 install --no-cache-dir -U -r \ - requirements.txt && \ - pip3 install --no-cache-dir -U -r \ - optional-requirements.txt && \ - echo "***install kepubify" && \ - if [ -z ${KEPUBIFY_RELEASE+x} ]; then \ + echo "**** install build packages ****" && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + libffi-dev \ + libjpeg-dev \ + libldap2-dev \ + libsasl2-dev \ + libxml2-dev \ + libxslt1-dev \ + python3-dev \ + zlib1g-dev && \ + echo "**** install runtime packages ****" && \ + apt-get install -y --no-install-recommends \ + imagemagick \ + ghostscript \ + libldap-2.5-0 \ + libsasl2-2 \ + libxi6 \ + libxslt1.1 \ + python3-venv && \ + echo "**** install calibre-web ****" && \ + if [ -z ${CALIBREWEB_COMMIT+x} ]; then \ + CALIBREWEB_COMMIT=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/commits/master" \ + | awk '/sha/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/calibre-web.tar.gz -L \ + "https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_COMMIT}.tar.gz" && \ + mkdir -p \ + /app/calibre-web && \ + tar xf \ + /tmp/calibre-web.tar.gz -C \ + /app/calibre-web --strip-components=1 && \ + cd /app/calibre-web && \ + python3 -m venv /lsiopy && \ + pip install -U --no-cache-dir \ + pip \ + wheel && \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ -r \ + requirements.txt -r \ + optional-requirements.txt && \ + echo "***install kepubify" && \ + if [ -z ${KEPUBIFY_RELEASE+x} ]; then \ KEPUBIFY_RELEASE=$(curl -sX GET "https://api.github.com/repos/pgaskin/kepubify/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /usr/bin/kepubify -L \ - https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-arm64 && \ - echo "**** cleanup ****" && \ - apt-get -y purge \ - g++ \ - gcc \ - git \ - libffi-dev \ - libjpeg-dev \ - libldap2-dev \ - libsasl2-dev \ - libxml2-dev \ - libxslt1-dev \ - python3-pip \ - zlib1g-dev && \ - apt-get -y autoremove && \ - rm -rf \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/* + fi && \ + curl -o \ + /usr/bin/kepubify -L \ + https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-arm64 && \ + echo "**** cleanup ****" && \ + apt-get -y purge \ + build-essential \ + cmake \ + libffi-dev \ + libjpeg-dev \ + libldap2-dev \ + libsasl2-dev \ + libxml2-dev \ + libxslt1-dev \ + python3-dev \ + zlib1g-dev && \ + apt-get -y autoremove && \ + rm -rf \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* \ + /root/.cache # add local files COPY root/ / +# add unrar +COPY --from=unrar /usr/bin/unrar-ubuntu /usr/bin/unrar + # ports and volumes EXPOSE 8083 VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf deleted file mode 100644 index 5a36033bb..000000000 --- a/Dockerfile.armhf +++ /dev/null @@ -1,89 +0,0 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:arm32v7-focal - -# set version label -ARG BUILD_DATE -ARG VERSION -ARG CALIBREWEB_RELEASE -LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="chbmb" - -RUN \ - echo "**** install build packages ****" && \ - apt-get update && \ - apt-get install -y \ - g++ \ - gcc \ - git \ - libffi-dev \ - libjpeg-dev \ - libldap2-dev \ - libsasl2-dev \ - libssl-dev \ - libxml2-dev \ - libxslt1-dev \ - python3-pip \ - zlib1g-dev && \ - echo "**** install runtime packages ****" && \ - apt-get install -y \ - imagemagick \ - libldap-2.4-2 \ - libnss3 \ - libsasl2-2 \ - libxcomposite1 \ - libxi6 \ - libxslt1.1 \ - python3-minimal \ - python3-pkg-resources \ - unrar && \ - echo "**** install calibre-web ****" && \ - if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ - CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/calibre-web.tar.gz -L \ - https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \ - mkdir -p \ - /app/calibre-web && \ - tar xf \ - /tmp/calibre-web.tar.gz -C \ - /app/calibre-web --strip-components=1 && \ - cd /app/calibre-web && \ - pip3 install --no-cache-dir -U -r \ - requirements.txt && \ - pip3 install --no-cache-dir -U -r \ - optional-requirements.txt && \ - echo "***install kepubify" && \ - if [ -z ${KEPUBIFY_RELEASE+x} ]; then \ - KEPUBIFY_RELEASE=$(curl -sX GET "https://api.github.com/repos/pgaskin/kepubify/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /usr/bin/kepubify -L \ - https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-arm && \ - echo "**** cleanup ****" && \ - apt-get -y purge \ - g++ \ - gcc \ - git \ - libffi-dev \ - libjpeg-dev \ - libldap2-dev \ - libsasl2-dev \ - libssl-dev \ - libxml2-dev \ - libxslt1-dev \ - python3-pip \ - zlib1g-dev && \ - apt-get -y autoremove && \ - rm -rf \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/* - -# add local files -COPY root/ / - -# ports and volumes -EXPOSE 8083 -VOLUME /config diff --git a/Jenkinsfile b/Jenkinsfile index 86f677d19..80f1fa494 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { EXT_GIT_BRANCH = 'master' EXT_USER = 'janeczku' EXT_REPO = 'calibre-web' - BUILD_VERSION_ARG = 'CALIBREWEB_RELEASE' + BUILD_VERSION_ARG = 'CALIBREWEB_COMMIT' LS_USER = 'linuxserver' LS_REPO = 'docker-calibre-web' CONTAINER_NAME = 'calibre-web' @@ -41,10 +41,16 @@ pipeline { // Setup all the basic environment variables needed for the build stage("Set ENV Variables base"){ steps{ + sh '''#! /bin/bash + containers=$(docker ps -aq) + if [[ -n "${containers}" ]]; then + docker stop ${containers} + fi + docker system prune -af --volumes || : ''' script{ env.EXIT_STATUS = '' env.LS_RELEASE = sh( - script: '''docker run --rm ghcr.io/linuxserver/alexeiled-skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':latest 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''', + script: '''docker run --rm quay.io/skopeo/stable:v1 inspect docker://ghcr.io/${LS_USER}/${CONTAINER_NAME}:nightly 2>/dev/null | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''', returnStdout: true).trim() env.LS_RELEASE_NOTES = sh( script: '''cat readme-vars.yml | awk -F \\" '/date: "[0-9][0-9].[0-9][0-9].[0-9][0-9]:/ {print $4;exit;}' | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''', @@ -58,7 +64,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 ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.md ./.github/ISSUE_TEMPLATE/issue.feature.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml ./.github/workflows/package_trigger.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/external_trigger.yml ./.github/workflows/external_trigger_scheduler.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/call_issue_pr_tracker.yml ./.github/workflows/call_issues_cron.yml ./.github/workflows/permissions.yml ./.github/workflows/external_trigger.yml ./.github/workflows/package_trigger.yml' } script{ env.LS_RELEASE_NUMBER = sh( @@ -68,7 +74,7 @@ pipeline { script{ env.LS_TAG_NUMBER = sh( script: '''#! /bin/bash - tagsha=$(git rev-list -n 1 ${LS_RELEASE} 2>/dev/null) + tagsha=$(git rev-list -n 1 nightly-${LS_RELEASE} 2>/dev/null) if [ "${tagsha}" == "${COMMIT_SHA}" ]; then echo ${LS_RELEASE_NUMBER} elif [ -z "${GIT_COMMIT}" ]; then @@ -101,21 +107,21 @@ pipeline { /* ######################## External Release Tagging ######################## */ - // If this is a stable github release use the latest endpoint from github to determine the ext tag - stage("Set ENV github_stable"){ + // If this is a github commit trigger determine the current commit at head + stage("Set ENV github_commit"){ steps{ script{ env.EXT_RELEASE = sh( - script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''', + script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq -r '. | .sha' | cut -c1-8 ''', returnStdout: true).trim() } } } - // If this is a stable or devel github release generate the link for the build message - stage("Set ENV github_link"){ + // If this is a github commit trigger Set the external release link + stage("Set ENV commit_link"){ steps{ script{ - env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE + env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/commit/' + env.EXT_RELEASE } } } @@ -126,13 +132,37 @@ pipeline { env.EXT_RELEASE_CLEAN = sh( script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g' ''', returnStdout: true).trim() + + def semver = env.EXT_RELEASE_CLEAN =~ /(\d+)\.(\d+)\.(\d+)/ + if (semver.find()) { + env.SEMVER = "${semver[0][1]}.${semver[0][2]}.${semver[0][3]}" + } else { + semver = env.EXT_RELEASE_CLEAN =~ /(\d+)\.(\d+)(?:\.(\d+))?(.*)/ + if (semver.find()) { + if (semver[0][3]) { + env.SEMVER = "${semver[0][1]}.${semver[0][2]}.${semver[0][3]}" + } else if (!semver[0][3] && !semver[0][4]) { + env.SEMVER = "${semver[0][1]}.${semver[0][2]}.${(new Date()).format('YYYYMMdd')}" + } + } + } + + if (env.SEMVER != null) { + if (BRANCH_NAME != "master" && BRANCH_NAME != "main") { + env.SEMVER = "${env.SEMVER}-${BRANCH_NAME}" + } + println("SEMVER: ${env.SEMVER}") + } else { + println("No SEMVER detected") + } + } } } - // If this is a master build use live docker endpoints + // If this is a nightly build use live docker endpoints stage("Set ENV live build"){ when { - branch "master" + branch "nightly" environment name: 'CHANGE_ID', value: '' } steps { @@ -140,21 +170,22 @@ pipeline { env.IMAGE = env.DOCKERHUB_IMAGE env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/' + env.CONTAINER_NAME env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/' + env.CONTAINER_NAME + env.QUAYIMAGE = 'quay.io/linuxserver.io/' + env.CONTAINER_NAME if (env.MULTIARCH == 'true') { - env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + env.CI_TAGS = 'amd64-nightly-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-nightly-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER } else { - env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + env.CI_TAGS = 'nightly-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER } env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER - env.META_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER - env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN + env.META_TAG = 'nightly-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + env.EXT_RELEASE_TAG = 'nightly-version-' + env.EXT_RELEASE_CLEAN } } } // If this is a dev build use dev docker endpoints stage("Set ENV dev build"){ when { - not {branch "master"} + not {branch "nightly"} environment name: 'CHANGE_ID', value: '' } steps { @@ -162,14 +193,15 @@ pipeline { env.IMAGE = env.DEV_DOCKERHUB_IMAGE env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lsiodev-' + env.CONTAINER_NAME env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lsiodev-' + env.CONTAINER_NAME + env.QUAYIMAGE = 'quay.io/linuxserver.io/lsiodev-' + env.CONTAINER_NAME if (env.MULTIARCH == 'true') { - env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + env.CI_TAGS = 'amd64-nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA } else { - env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + env.CI_TAGS = 'nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA } env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA - env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA - env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN + env.META_TAG = 'nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + env.EXT_RELEASE_TAG = 'nightly-version-' + env.EXT_RELEASE_CLEAN env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/' } } @@ -184,14 +216,15 @@ pipeline { env.IMAGE = env.PR_DOCKERHUB_IMAGE env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lspipepr-' + env.CONTAINER_NAME env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lspipepr-' + env.CONTAINER_NAME + env.QUAYIMAGE = 'quay.io/linuxserver.io/lspipepr-' + env.CONTAINER_NAME if (env.MULTIARCH == 'true') { - env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + env.CI_TAGS = 'amd64-nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '-pr-' + env.PULL_REQUEST + '|arm64v8-nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '-pr-' + env.PULL_REQUEST } else { - env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + env.CI_TAGS = 'nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '-pr-' + env.PULL_REQUEST } - env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST - env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST - env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN + env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '-pr-' + env.PULL_REQUEST + env.META_TAG = 'nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '-pr-' + env.PULL_REQUEST + env.EXT_RELEASE_TAG = 'nightly-version-' + env.EXT_RELEASE_CLEAN env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.PR_DOCKERHUB_IMAGE + '/tags/' } @@ -210,26 +243,23 @@ pipeline { script{ env.SHELLCHECK_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/shellcheck-result.xml' } - sh '''curl -sL https://raw.githubusercontent.com/linuxserver/docker-shellcheck/master/checkrun.sh | /bin/bash''' + sh '''curl -sL https://raw.githubusercontent.com/linuxserver/docker-jenkins-builder/master/checkrun.sh | /bin/bash''' sh '''#! /bin/bash - set -e - docker pull ghcr.io/linuxserver/lsiodev-spaces-file-upload:latest docker run --rm \ - -e DESTINATION=\"${IMAGE}/${META_TAG}/shellcheck-result.xml\" \ - -e FILE_NAME="shellcheck-result.xml" \ - -e MIMETYPE="text/xml" \ - -v ${WORKSPACE}:/mnt \ - -e SECRET_KEY=\"${S3_SECRET}\" \ - -e ACCESS_KEY=\"${S3_KEY}\" \ - -t ghcr.io/linuxserver/lsiodev-spaces-file-upload:latest \ - python /upload.py''' + -v ${WORKSPACE}:/mnt \ + -e AWS_ACCESS_KEY_ID=\"${S3_KEY}\" \ + -e AWS_SECRET_ACCESS_KEY=\"${S3_SECRET}\" \ + ghcr.io/linuxserver/baseimage-alpine:3.17 s6-envdir -fn -- /var/run/s6/container_environment /bin/bash -c "\ + apk add --no-cache py3-pip && \ + pip install s3cmd && \ + s3cmd put --no-preserve --acl-public -m text/xml /mnt/shellcheck-result.xml s3://ci-tests.linuxserver.io/${IMAGE}/${META_TAG}/shellcheck-result.xml" || :''' } } } // Use helper containers to render templated files stage('Update-Templates') { when { - branch "master" + branch "nightly" environment name: 'CHANGE_ID', value: '' expression { env.CONTAINER_NAME != null @@ -240,54 +270,105 @@ pipeline { set -e TEMPDIR=$(mktemp -d) docker pull ghcr.io/linuxserver/jenkins-builder:latest - docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest + docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=nightly -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest + # Stage 1 - Jenkinsfile update + if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then + mkdir -p ${TEMPDIR}/repo + git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} + cd ${TEMPDIR}/repo/${LS_REPO} + git checkout -f nightly + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/ + git add Jenkinsfile + git commit -m 'Bot Updating Templated Files' + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all + echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + echo "Updating Jenkinsfile" + rm -Rf ${TEMPDIR} + exit 0 + else + echo "Jenkinsfile is up to date." + fi + # Stage 2 - Delete old templates + OLD_TEMPLATES=".github/ISSUE_TEMPLATE.md .github/ISSUE_TEMPLATE/issue.bug.md .github/ISSUE_TEMPLATE/issue.feature.md .github/workflows/call_invalid_helper.yml .github/workflows/stale.yml Dockerfile.armhf" + for i in ${OLD_TEMPLATES}; do + if [[ -f "${i}" ]]; then + TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}" + fi + done + if [[ -n "${TEMPLATES_TO_DELETE}" ]]; then + mkdir -p ${TEMPDIR}/repo + git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} + cd ${TEMPDIR}/repo/${LS_REPO} + git checkout -f nightly + for i in ${TEMPLATES_TO_DELETE}; do + git rm "${i}" + done + git commit -m 'Bot Updating Templated Files' + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all + echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + echo "Deleting old and deprecated templates" + rm -Rf ${TEMPDIR} + exit 0 + else + echo "No templates to delete" + fi + # Stage 3 - Update templates CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) cd ${TEMPDIR}/docker-${CONTAINER_NAME} NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) - if [[ "${CURRENTHASH}" != "${NEWHASH}" ]]; then + if [[ "${CURRENTHASH}" != "${NEWHASH}" ]] || ! grep -q '.jenkins-external' "${WORKSPACE}/.gitignore" 2>/dev/null; then mkdir -p ${TEMPDIR}/repo git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f master + git checkout -f nightly cd ${TEMPDIR}/docker-${CONTAINER_NAME} mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE - rm -f ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE.md cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || : + cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || : cd ${TEMPDIR}/repo/${LS_REPO}/ - git add ${TEMPLATED_FILES} - git rm .github/ISSUE_TEMPLATE.md || : + if ! grep -q '.jenkins-external' .gitignore 2>/dev/null; then + echo ".jenkins-external" >> .gitignore + git add .gitignore + fi + git add readme-vars.yml ${TEMPLATED_FILES} git commit -m 'Bot Updating Templated Files' git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} else echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} fi - mkdir -p ${TEMPDIR}/gitbook - git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation - if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/ - cd ${TEMPDIR}/gitbook/docker-documentation/ - git add images/docker-${CONTAINER_NAME}.md + mkdir -p ${TEMPDIR}/docs + git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/docs/docker-documentation + if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/docs/docker-documentation/docs/images/ + cd ${TEMPDIR}/docs/docker-documentation + git add docs/images/docker-${CONTAINER_NAME}.md git commit -m 'Bot Updating Documentation' git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git --all fi - mkdir -p ${TEMPDIR}/unraid + mkdir -p ${TEMPDIR}/unraid git clone https://github.com/linuxserver/docker-templates.git ${TEMPDIR}/unraid/docker-templates git clone https://github.com/linuxserver/templates.git ${TEMPDIR}/unraid/templates - if [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-icon.png ]]; then - sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-icon.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/${CONTAINER_NAME}.xml + if [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-logo.png ]]; then + sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-logo.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml + elif [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-icon.png ]]; then + sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-icon.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml fi - if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then + if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then + cd ${TEMPDIR}/unraid/templates/ if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then - echo "Image is on the ignore list, skipping Unraid template upload" + echo "Image is on the ignore list, marking Unraid template as deprecated" + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ + git add -u unraid/${CONTAINER_NAME}.xml + git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || : + git commit -m 'Bot Moving Deprecated Unraid Template' || : else - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ - cd ${TEMPDIR}/unraid/templates/ + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ git add unraid/${CONTAINER_NAME}.xml git commit -m 'Bot Updating Unraid Template' - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git --all fi + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git --all fi rm -Rf ${TEMPDIR}''' script{ @@ -300,7 +381,7 @@ pipeline { // Exit the build if the Templated files were just updated stage('Template-exit') { when { - branch "master" + branch "nightly" environment name: 'CHANGE_ID', value: '' environment name: 'FILES_UPDATED', value: 'true' expression { @@ -313,6 +394,26 @@ pipeline { } } } + // If this is a nightly build check the S6 service file perms + stage("Check S6 Service file Permissions"){ + when { + branch "nightly" + environment name: 'CHANGE_ID', value: '' + environment name: 'EXIT_STATUS', value: '' + } + steps { + script{ + sh '''#! /bin/bash + WRONG_PERM=$(find ./ -path "./.git" -prune -o \\( -name "run" -o -name "finish" -o -name "check" \\) -not -perm -u=x,g=x,o=x -print) + if [[ -n "${WRONG_PERM}" ]]; then + echo "The following S6 service files are missing the executable bit; canceling the faulty build: ${WRONG_PERM}" + exit 1 + else + echo "S6 service file perms look good." + fi ''' + } + } + } /* ####################### GitLab Mirroring ####################### */ @@ -339,48 +440,60 @@ pipeline { // Build Docker container for push to LS Repo stage('Build-Single') { when { - environment name: 'MULTIARCH', value: 'false' + expression { + env.MULTIARCH == 'false' || params.PACKAGE_CHECK == 'true' + } environment name: 'EXIT_STATUS', value: '' } steps { echo "Running on node: ${NODE_NAME}" - sh "docker build --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} ." + sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile" + sh "docker buildx build \ + --label \"org.opencontainers.image.created=${GITHUB_DATE}\" \ + --label \"org.opencontainers.image.authors=linuxserver.io\" \ + --label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-calibre-web/packages\" \ + --label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-calibre-web\" \ + --label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-calibre-web\" \ + --label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \ + --label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \ + --label \"org.opencontainers.image.vendor=linuxserver.io\" \ + --label \"org.opencontainers.image.licenses=GPL-3.0-only\" \ + --label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \ + --label \"org.opencontainers.image.title=Calibre-web\" \ + --label \"org.opencontainers.image.description=[Calibre-web](https://github.com/janeczku/calibre-web) is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. It is also possible to integrate google drive and edit metadata and your calibre library through the app itself. This software is a fork of library and licensed under the GPL v3 License. \" \ + --no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \ + --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." } } // Build MultiArch Docker containers for push to LS Repo stage('Build-Multi') { when { - environment name: 'MULTIARCH', value: 'true' + allOf { + environment name: 'MULTIARCH', value: 'true' + expression { params.PACKAGE_CHECK == 'false' } + } environment name: 'EXIT_STATUS', value: '' } parallel { stage('Build X86') { steps { echo "Running on node: ${NODE_NAME}" - sh "docker build --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} ." - } - } - stage('Build ARMHF') { - agent { - label 'ARMHF' - } - steps { - echo "Running on node: ${NODE_NAME}" - echo 'Logging into Github' - sh '''#! /bin/bash - echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin - ''' - sh "docker build --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}" - retry(5) { - sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}" - } - sh '''docker rmi \ - ${IMAGE}:arm32v7-${META_TAG} \ - ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} || :''' + sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile" + sh "docker buildx build \ + --label \"org.opencontainers.image.created=${GITHUB_DATE}\" \ + --label \"org.opencontainers.image.authors=linuxserver.io\" \ + --label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-calibre-web/packages\" \ + --label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-calibre-web\" \ + --label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-calibre-web\" \ + --label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \ + --label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \ + --label \"org.opencontainers.image.vendor=linuxserver.io\" \ + --label \"org.opencontainers.image.licenses=GPL-3.0-only\" \ + --label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \ + --label \"org.opencontainers.image.title=Calibre-web\" \ + --label \"org.opencontainers.image.description=[Calibre-web](https://github.com/janeczku/calibre-web) is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. It is also possible to integrate google drive and edit metadata and your calibre library through the app itself. This software is a fork of library and licensed under the GPL v3 License. \" \ + --no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \ + --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." } } stage('Build ARM64') { @@ -393,15 +506,32 @@ pipeline { sh '''#! /bin/bash echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin ''' - sh "docker build --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 "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile.aarch64" + sh "docker buildx build \ + --label \"org.opencontainers.image.created=${GITHUB_DATE}\" \ + --label \"org.opencontainers.image.authors=linuxserver.io\" \ + --label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-calibre-web/packages\" \ + --label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-calibre-web\" \ + --label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-calibre-web\" \ + --label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \ + --label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \ + --label \"org.opencontainers.image.vendor=linuxserver.io\" \ + --label \"org.opencontainers.image.licenses=GPL-3.0-only\" \ + --label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \ + --label \"org.opencontainers.image.title=Calibre-web\" \ + --label \"org.opencontainers.image.description=[Calibre-web](https://github.com/janeczku/calibre-web) is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. It is also possible to integrate google drive and edit metadata and your calibre library through the app itself. This software is a fork of library and licensed under the GPL v3 License. \" \ + --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \ + --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}" retry(5) { sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}" } - sh '''docker rmi \ - ${IMAGE}:arm64v8-${META_TAG} \ - ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :''' + sh '''#! /bin/bash + containers=$(docker ps -aq) + if [[ -n "${containers}" ]]; then + docker stop ${containers} + fi + docker system prune -af --volumes || : ''' } } } @@ -409,7 +539,7 @@ pipeline { // Take the image we just built and dump package versions for comparison stage('Update-packages') { when { - branch "master" + branch "nightly" environment name: 'CHANGE_ID', value: '' environment name: 'EXIT_STATUS', value: '' } @@ -417,27 +547,22 @@ pipeline { sh '''#! /bin/bash set -e TEMPDIR=$(mktemp -d) - if [ "${MULTIARCH}" == "true" ]; then + if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" == "false" ]; then LOCAL_CONTAINER=${IMAGE}:amd64-${META_TAG} else LOCAL_CONTAINER=${IMAGE}:${META_TAG} fi - if [ "${DIST_IMAGE}" == "alpine" ]; then - docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\ - apk info -v > /tmp/package_versions.txt && \ - sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \ - chmod 777 /tmp/package_versions.txt' - elif [ "${DIST_IMAGE}" == "ubuntu" ]; then - docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\ - apt list -qq --installed | sed "s#/.*now ##g" | cut -d" " -f1 > /tmp/package_versions.txt && \ - sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \ - chmod 777 /tmp/package_versions.txt' - fi + touch ${TEMPDIR}/package_versions.txt + docker run --rm \ + -v /var/run/docker.sock:/var/run/docker.sock:ro \ + -v ${TEMPDIR}:/tmp \ + ghcr.io/anchore/syft:latest \ + ${LOCAL_CONTAINER} -o table=/tmp/package_versions.txt NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 ) echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github" if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO} - git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master + git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f nightly cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/ cd ${TEMPDIR}/${LS_REPO}/ wait @@ -461,19 +586,12 @@ pipeline { // Exit the build if the package file was just updated stage('PACKAGE-exit') { when { - branch "master" + branch "nightly" environment name: 'CHANGE_ID', value: '' environment name: 'PACKAGE_UPDATED', value: 'true' environment name: 'EXIT_STATUS', value: '' } steps { - sh '''#! /bin/bash - echo "Packages were updated. Cleaning up the image and exiting." - if [ "${MULTIARCH}" == "true" ]; then - docker rmi ${IMAGE}:amd64-${META_TAG} - else - docker rmi ${IMAGE}:${META_TAG} - fi''' script{ env.EXIT_STATUS = 'ABORTED' } @@ -482,7 +600,7 @@ pipeline { // Exit the build if this is just a package check and there are no changes to push stage('PACKAGECHECK-exit') { when { - branch "master" + branch "nightly" environment name: 'CHANGE_ID', value: '' environment name: 'PACKAGE_UPDATED', value: 'false' environment name: 'EXIT_STATUS', value: '' @@ -491,13 +609,6 @@ pipeline { } } steps { - sh '''#! /bin/bash - echo "There are no package updates. Cleaning up the image and exiting." - if [ "${MULTIARCH}" == "true" ]; then - docker rmi ${IMAGE}:amd64-${META_TAG} - else - docker rmi ${IMAGE}:${META_TAG} - fi''' script{ env.EXIT_STATUS = 'ABORTED' } @@ -519,14 +630,13 @@ pipeline { ]) { script{ env.CI_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/index.html' + env.CI_JSON_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/report.json' } sh '''#! /bin/bash set -e - docker pull ghcr.io/linuxserver/lsiodev-ci:latest + docker pull ghcr.io/linuxserver/ci:latest if [ "${MULTIARCH}" == "true" ]; 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 tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG} fi docker run --rm \ @@ -545,10 +655,8 @@ pipeline { -e WEB_SCREENSHOT=\"${CI_WEB}\" \ -e WEB_AUTH=\"${CI_AUTH}\" \ -e WEB_PATH=\"${CI_WEBPATH}\" \ - -e DO_REGION="ams3" \ - -e DO_BUCKET="lsio-ci" \ - -t ghcr.io/linuxserver/lsiodev-ci:latest \ - python /ci/ci.py''' + -t ghcr.io/linuxserver/ci:latest \ + python3 test_build.py''' } } } @@ -568,6 +676,12 @@ pipeline { credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207', usernameVariable: 'DOCKERUSER', passwordVariable: 'DOCKERPASS' + ], + [ + $class: 'UsernamePasswordMultiBinding', + credentialsId: 'Quay.io-Robot', + usernameVariable: 'QUAYUSER', + passwordVariable: 'QUAYPASS' ] ]) { retry(5) { @@ -576,24 +690,23 @@ pipeline { echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin - for PUSHIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do + echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin + for PUSHIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${QUAYIMAGE}" "${IMAGE}"; do docker tag ${IMAGE}:${META_TAG} ${PUSHIMAGE}:${META_TAG} - docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:latest + docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:nightly docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${EXT_RELEASE_TAG} - docker push ${PUSHIMAGE}:latest + if [ -n "${SEMVER}" ]; then + docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${SEMVER} + fi + docker push ${PUSHIMAGE}:nightly docker push ${PUSHIMAGE}:${META_TAG} docker push ${PUSHIMAGE}:${EXT_RELEASE_TAG} + if [ -n "${SEMVER}" ]; then + docker push ${PUSHIMAGE}:${SEMVER} + fi done ''' } - sh '''#! /bin/bash - for DELETEIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do - docker rmi \ - ${DELETEIMAGE}:${META_TAG} \ - ${DELETEIMAGE}:${EXT_RELEASE_TAG} \ - ${DELETEIMAGE}:latest || : - done - ''' } } } @@ -610,6 +723,12 @@ pipeline { credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207', usernameVariable: 'DOCKERUSER', passwordVariable: 'DOCKERPASS' + ], + [ + $class: 'UsernamePasswordMultiBinding', + credentialsId: 'Quay.io-Robot', + usernameVariable: 'QUAYUSER', + passwordVariable: 'QUAYPASS' ] ]) { retry(5) { @@ -618,73 +737,72 @@ pipeline { echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin + 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 tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG} fi - for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}"; do + 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-nightly docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} - 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-nightly docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} + if [ -n "${SEMVER}" ]; then + docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${SEMVER} + 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}:arm32v7-${EXT_RELEASE_TAG} + docker push ${MANIFESTIMAGE}:amd64-nightly + docker push ${MANIFESTIMAGE}:arm64v8-${META_TAG} + docker push ${MANIFESTIMAGE}:arm64v8-nightly docker push ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} - docker manifest push --purge ${MANIFESTIMAGE}:latest || : - docker manifest create ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:amd64-latest ${MANIFESTIMAGE}:arm32v7-latest ${MANIFESTIMAGE}:arm64v8-latest - docker manifest annotate ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:arm32v7-latest --os linux --arch arm - docker manifest annotate ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:arm64v8-latest --os linux --arch arm64 --variant v8 + if [ -n "${SEMVER}" ]; then + docker push ${MANIFESTIMAGE}:amd64-${SEMVER} + docker push ${MANIFESTIMAGE}:arm64v8-${SEMVER} + fi + docker manifest push --purge ${MANIFESTIMAGE}:nightly || : + docker manifest create ${MANIFESTIMAGE}:nightly ${MANIFESTIMAGE}:amd64-nightly ${MANIFESTIMAGE}:arm64v8-nightly + docker manifest annotate ${MANIFESTIMAGE}:nightly ${MANIFESTIMAGE}:arm64v8-nightly --os linux --arch arm64 --variant v8 docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG} || : - docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} - docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} --os linux --arch arm + docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8 docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} || : - docker manifest create ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} - docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} --os linux --arch arm + docker manifest create ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} --os linux --arch arm64 --variant v8 - docker manifest push --purge ${MANIFESTIMAGE}:latest + if [ -n "${SEMVER}" ]; then + docker manifest push --purge ${MANIFESTIMAGE}:${SEMVER} || : + docker manifest create ${MANIFESTIMAGE}:${SEMVER} ${MANIFESTIMAGE}:amd64-${SEMVER} ${MANIFESTIMAGE}:arm64v8-${SEMVER} + docker manifest annotate ${MANIFESTIMAGE}:${SEMVER} ${MANIFESTIMAGE}:arm64v8-${SEMVER} --os linux --arch arm64 --variant v8 + fi + token=$(curl -sX GET "https://ghcr.io/token?scope=repository%3Alinuxserver%2F${CONTAINER_NAME}%3Apull" | jq -r '.token') + digest=$(curl -s \ + --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ + --header "Authorization: Bearer ${token}" \ + "https://ghcr.io/v2/linuxserver/${CONTAINER_NAME}/manifests/arm32v7-nightly") + if [[ $(echo "$digest" | jq -r '.layers') != "null" ]]; then + docker manifest push --purge ${MANIFESTIMAGE}:arm32v7-nightly || : + docker manifest create ${MANIFESTIMAGE}:arm32v7-nightly ${MANIFESTIMAGE}:amd64-nightly + docker manifest push --purge ${MANIFESTIMAGE}:arm32v7-nightly + fi + docker manifest push --purge ${MANIFESTIMAGE}:nightly docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG} docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} + if [ -n "${SEMVER}" ]; then + docker manifest push --purge ${MANIFESTIMAGE}:${SEMVER} + fi done ''' } - sh '''#! /bin/bash - for DELETEIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do - docker rmi \ - ${DELETEIMAGE}:amd64-${META_TAG} \ - ${DELETEIMAGE}:amd64-latest \ - ${DELETEIMAGE}:amd64-${EXT_RELEASE_TAG} \ - ${DELETEIMAGE}:arm32v7-${META_TAG} \ - ${DELETEIMAGE}:arm32v7-latest \ - ${DELETEIMAGE}:arm32v7-${EXT_RELEASE_TAG} \ - ${DELETEIMAGE}:arm64v8-${META_TAG} \ - ${DELETEIMAGE}:arm64v8-latest \ - ${DELETEIMAGE}:arm64v8-${EXT_RELEASE_TAG} || : - done - docker rmi \ - ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \ - ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || : - ''' } } } // If this is a public release tag it in the LS Github stage('Github-Tag-Push-Release') { when { - branch "master" + branch "nightly" expression { env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER } @@ -692,25 +810,60 @@ pipeline { environment name: 'EXIT_STATUS', value: '' } steps { - echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}" + echo "Pushing New tag for current commit ${META_TAG}" sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \ - -d '{"tag":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ + -d '{"tag":"'${META_TAG}'",\ "object": "'${COMMIT_SHA}'",\ - "message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\ + "message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to nightly",\ "type": "commit",\ "tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' echo "Pushing New release for Tag" sh '''#! /bin/bash - curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json - echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ - "target_commitish": "master",\ - "name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ - "body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' Changes:**\\n\\n' > start - printf '","draft": false,"prerelease": false}' >> releasebody.json + curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_RELEASE_CLEAN} | jq '.commit.message' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json + echo '{"tag_name":"'${META_TAG}'",\ + "target_commitish": "nightly",\ + "name": "'${META_TAG}'",\ + "body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**'${EXT_REPO}' Changes:**\\n\\n' > start + printf '","draft": false,"prerelease": true}' >> releasebody.json paste -d'\\0' start releasebody.json > releasebody.json.done curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done''' } } + // Add protection to the release branch + stage('Github-Release-Branch-Protection') { + when { + branch "nightly" + environment name: 'CHANGE_ID', value: '' + environment name: 'EXIT_STATUS', value: '' + } + steps { + echo "Setting up protection for release branch nightly" + sh '''#! /bin/bash + curl -H "Authorization: token ${GITHUB_TOKEN}" -X PUT https://api.github.com/repos/${LS_USER}/${LS_REPO}/branches/nightly/protection \ + -d $(jq -c . << EOF + { + "required_status_checks": null, + "enforce_admins": false, + "required_pull_request_reviews": { + "dismiss_stale_reviews": false, + "require_code_owner_reviews": false, + "require_last_push_approval": false, + "required_approving_review_count": 1 + }, + "restrictions": null, + "required_linear_history": false, + "allow_force_pushes": false, + "allow_deletions": false, + "block_creations": false, + "required_conversation_resolution": true, + "lock_branch": false, + "allow_fork_syncing": false, + "required_signatures": false + } +EOF + ) ''' + } + } // Use helper container to sync the current README on master to the dockerhub endpoint stage('Sync-README') { when { @@ -730,8 +883,8 @@ pipeline { set -e TEMPDIR=$(mktemp -d) docker pull ghcr.io/linuxserver/jenkins-builder:latest - docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH="${BRANCH_NAME}" -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest - docker pull ghcr.io/linuxserver/lsiodev-readme-sync + docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH="${BRANCH_NAME}" -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest + docker pull ghcr.io/linuxserver/readme-sync docker run --rm=true \ -e DOCKERHUB_USERNAME=$DOCKERUSER \ -e DOCKERHUB_PASSWORD=$DOCKERPASS \ @@ -739,7 +892,7 @@ pipeline { -e DOCKER_REPOSITORY=${IMAGE} \ -e GIT_BRANCH=master \ -v ${TEMPDIR}/docker-${CONTAINER_NAME}:/mnt \ - ghcr.io/linuxserver/lsiodev-readme-sync bash -c 'node sync' + ghcr.io/linuxserver/readme-sync bash -c 'node sync' rm -Rf ${TEMPDIR} ''' } } @@ -748,12 +901,78 @@ pipeline { stage('Pull Request Comment') { when { not {environment name: 'CHANGE_ID', value: ''} - environment name: 'CI', value: 'true' environment name: 'EXIT_STATUS', value: '' } steps { - sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/issues/${PULL_REQUEST}/comments \ - -d '{"body": "I am a bot, here are the test results for this PR: \\n'${CI_URL}' \\n'${SHELLCHECK_URL}'"}' ''' + sh '''#! /bin/bash + # Function to retrieve JSON data from URL + get_json() { + local url="$1" + local response=$(curl -s "$url") + if [ $? -ne 0 ]; then + echo "Failed to retrieve JSON data from $url" + return 1 + fi + local json=$(echo "$response" | jq .) + if [ $? -ne 0 ]; then + echo "Failed to parse JSON data from $url" + return 1 + fi + echo "$json" + } + + build_table() { + local data="$1" + + # Get the keys in the JSON data + local keys=$(echo "$data" | jq -r 'to_entries | map(.key) | .[]') + + # Check if keys are empty + if [ -z "$keys" ]; then + echo "JSON report data does not contain any keys or the report does not exist." + return 1 + fi + + # Build table header + local header="| Tag | Passed |\\n| --- | --- |\\n" + + # Loop through the JSON data to build the table rows + local rows="" + for build in $keys; do + local status=$(echo "$data" | jq -r ".[\\"$build\\"].test_success") + if [ "$status" = "true" ]; then + status="✅" + else + status="❌" + fi + local row="| "$build" | "$status" |\\n" + rows="${rows}${row}" + done + + local table="${header}${rows}" + local escaped_table=$(echo "$table" | sed 's/\"/\\\\"/g') + echo "$escaped_table" + } + + if [[ "${CI}" = "true" ]]; then + # Retrieve JSON data from URL + data=$(get_json "$CI_JSON_URL") + # Create table from JSON data + table=$(build_table "$data") + echo -e "$table" + + curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/$LS_USER/$LS_REPO/issues/$PULL_REQUEST/comments" \ + -d "{\\"body\\": \\"I am a bot, here are the test results for this PR: \\n${CI_URL}\\n${SHELLCHECK_URL}\\n${table}\\"}" + else + curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/$LS_USER/$LS_REPO/issues/$PULL_REQUEST/comments" \ + -d "{\\"body\\": \\"I am a bot, here is the pushed image/manifest for this PR: \\n\\n\\`${GITHUBIMAGE}:${META_TAG}\\`\\"}" + fi + ''' + } } } @@ -767,18 +986,26 @@ 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} ''' } } } cleanup { + sh '''#! /bin/bash + echo "Performing docker system prune!!" + containers=$(docker ps -aq) + if [[ -n "${containers}" ]]; then + docker stop ${containers} + fi + docker system prune -af --volumes || : + ''' cleanWs() } } diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md index 3aec9a124..d361e6c2c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ -<!-- DO NOT EDIT THIS FILE MANUALLY --> -<!-- Please read the CONTRIBUTING.md --> - +<!-- DO NOT EDIT THIS FILE MANUALLY --> +<!-- Please read https://github.com/linuxserver/docker-calibre-web/blob/nightly/.github/CONTRIBUTING.md --> [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io) [![Blog](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Blog)](https://blog.linuxserver.io "all the things you can do with our containers including How-To guides, opinions and much more!") @@ -12,13 +11,14 @@ The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring: - * regular and timely application updates - * easy user mappings (PGID, PUID) - * custom base image with s6 overlay - * weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth - * regular security updates +* regular and timely application updates +* easy user mappings (PGID, PUID) +* custom base image with s6 overlay +* weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth +* regular security updates Find us at: + * [Blog](https://blog.linuxserver.io) - all the things you can do with our containers including How-To guides, opinions and much more! * [Discord](https://discord.gg/YWrKVTn) - realtime support / chat with the community and the team. * [Discourse](https://discourse.linuxserver.io) - post on our community forum. @@ -28,94 +28,121 @@ Find us at: # [linuxserver/calibre-web](https://github.com/linuxserver/docker-calibre-web) +[![Scarf.io pulls](https://scarf.sh/installs-badge/linuxserver-ci/linuxserver%2Fcalibre-web?color=94398d&label-color=555555&logo-color=ffffff&style=for-the-badge&package-type=docker)](https://scarf.sh/gateway/linuxserver-ci/docker/linuxserver%2Fcalibre-web) [![GitHub Stars](https://img.shields.io/github/stars/linuxserver/docker-calibre-web.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-calibre-web) [![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-calibre-web.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-calibre-web/releases) [![GitHub Package Repository](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub%20Package&logo=github)](https://github.com/linuxserver/docker-calibre-web/packages) [![GitLab Container Registry](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab)](https://gitlab.com/linuxserver.io/docker-calibre-web/container_registry) -[![MicroBadger Layers](https://img.shields.io/microbadger/layers/linuxserver/calibre-web.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge)](https://microbadger.com/images/linuxserver/calibre-web "Get your own version badge on microbadger.com") +[![Quay.io](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Quay.io)](https://quay.io/repository/linuxserver.io/calibre-web) [![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/calibre-web.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/calibre-web) [![Docker Stars](https://img.shields.io/docker/stars/linuxserver/calibre-web.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/calibre-web) -[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-calibre-web%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/master/) +[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-calibre-web%2Fjob%2Fnightly%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/nightly/) [![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%2Fcalibre-web%2Flatest%2Fci-status.yml)](https://ci-tests.linuxserver.io/linuxserver/calibre-web/latest/index.html) [Calibre-web](https://github.com/janeczku/calibre-web) is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. It is also possible to integrate google drive and edit metadata and your calibre library through the app itself. This software is a fork of library and licensed under the GPL v3 License. - [![calibre-web](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/calibre-web-icon.png)](https://github.com/janeczku/calibre-web) ## Supported Architectures -Our images support multiple architectures such as `x86-64`, `arm64` and `armhf`. We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/). +We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/). -Simply pulling `ghcr.io/linuxserver/calibre-web` should retrieve the correct image for your arch, but you can also pull specific arch images via tags. +Simply pulling `lscr.io/linuxserver/calibre-web:nightly` should retrieve the correct image for your arch, but you can also pull specific arch images via tags. The architectures supported by this image are: -| Architecture | Tag | -| :----: | --- | -| x86-64 | amd64-latest | -| arm64 | arm64v8-latest | -| armhf | arm32v7-latest | +| Architecture | Available | Tag | +| :----: | :----: | ---- | +| x86-64 | ✅ | amd64-\<version tag\> | +| arm64 | ✅ | arm64v8-\<version tag\> | +| armhf | ❌ | | +## Version Tags -## Usage +This image provides various versions that are available via tags. Please read the descriptions carefully and exercise caution when using unstable or development tags. + +| Tag | Available | Description | +| :----: | :----: |--- | +| latest | ✅ | Releases of Calibre-Web | +| nightly | ✅ | Commits to the master branch of Calibre-Web | + +## Application Setup + +Webui can be found at `http://your-ip:8083` + +On the initial setup screen, enter `/books` as your calibre library location. + +**Default admin login:** +*Username:* admin +*Password:* admin123 + +If you lock yourself out or forget a password, you will need to specify the app.db similar to this: +`docker exec -it calibre-web python3 /app/calibre-web/cps.py -p /config/app.db -s <user>:<pass>` +If you fail to specify the proper db, it will appear to succeed, but it will not work. + +Unrar is included by default and needs to be set in the Calibre-Web admin page (Basic Configuration:External Binaries) with a path of `/usr/bin/unrar` + +**x86-64 only** We have implemented the optional ability to pull in the dependencies to enable ebook conversion utilising Calibre, this means if you don't require this feature the container isn't uneccessarily bloated but should you require it, it is easily available. +This optional layer will be rebuilt automatically on our CI pipeline upon new Calibre releases so you can stay up to date. +To use this option add the optional environmental variable as detailed above to pull an addition docker layer to enable ebook conversion and then in the Calibre-Web admin page (Basic Configuration:External Binaries) set the **Path to Calibre E-Book Converter** to `/usr/bin/ebook-convert` -Here are some example snippets to help you get started creating a container. +This image contains the [kepubify](https://pgaskin.net/kepubify/) ebook conversion tool (MIT License) to convert epub to kepub. In the Calibre-Web admin page (Basic Configuration:External Binaries) set the **Path to Kepubify E-Book Converter** to `/usr/bin/kepubify` + +## Usage -### docker-compose ([recommended](https://docs.linuxserver.io/general/docker-compose)) +To help you get started creating a container from this image you can either use docker-compose or the docker cli. -Compatible with docker-compose v2 schemas. +### docker-compose (recommended, [click here for more info](https://docs.linuxserver.io/general/docker-compose)) ```yaml --- version: "2.1" services: calibre-web: - image: ghcr.io/linuxserver/calibre-web + image: lscr.io/linuxserver/calibre-web:nightly container_name: calibre-web environment: - PUID=1000 - PGID=1000 - - TZ=Europe/London - - DOCKER_MODS=linuxserver/calibre-web:calibre + - TZ=Etc/UTC + - DOCKER_MODS=linuxserver/mods:universal-calibre volumes: - - <path to data>:/config - - <path to calibre library>:/books + - /path/to/data:/config + - /path/to/calibre/library:/books ports: - 8083:8083 restart: unless-stopped ``` -### docker cli +### docker cli ([click here for more info](https://docs.docker.com/engine/reference/commandline/cli/)) -``` +```bash docker run -d \ --name=calibre-web \ -e PUID=1000 \ -e PGID=1000 \ - -e TZ=Europe/London \ - -e DOCKER_MODS=linuxserver/calibre-web:calibre \ + -e TZ=Etc/UTC \ + -e DOCKER_MODS=linuxserver/mods:universal-calibre \ -p 8083:8083 \ - -v <path to data>:/config \ - -v <path to calibre library>:/books \ + -v /path/to/data:/config \ + -v /path/to/calibre/library:/books \ --restart unless-stopped \ - ghcr.io/linuxserver/calibre-web + lscr.io/linuxserver/calibre-web:nightly ``` - ## Parameters -Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container. +Containers are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container. | Parameter | Function | | :----: | --- | | `-p 8083` | WebUI | | `-e PUID=1000` | for UserID - see below for explanation | | `-e PGID=1000` | for GroupID - see below for explanation | -| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. | -| `-e DOCKER_MODS=linuxserver/calibre-web:calibre` | #optional & **x86-64 only** Adds the ability to perform ebook conversion | +| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). | +| `-e DOCKER_MODS=linuxserver/mods:universal-calibre` | #optional & **x86-64 only** Adds the ability to perform ebook conversion | | `-v /config` | Where calibre-web stores the internal database and config. | | `-v /books` | Where your preexisting calibre database is locate. | @@ -125,11 +152,11 @@ You can set any environment variable from a file by using a special prepend `FIL As an example: -``` --e FILE__PASSWORD=/run/secrets/mysecretpassword +```bash +-e FILE__MYVAR=/run/secrets/mysecretvariable ``` -Will set the environment variable `PASSWORD` based on the contents of the `/run/secrets/mysecretpassword` file. +Will set the environment variable `MYVAR` based on the contents of the `/run/secrets/mysecretvariable` file. ## Umask for running applications @@ -138,63 +165,53 @@ Keep in mind umask is not chmod it subtracts from permissions based on it's valu ## User / Group Identifiers -When using volumes (`-v` flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`. +When using volumes (`-v` flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic. -In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below: +In this instance `PUID=1000` and `PGID=1000`, to find yours use `id your_user` as below: +```bash +id your_user ``` - $ id username - uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup) -``` - -  -## Application Setup +Example output: -Webui can be found at `http://your-ip:8083` +```text +uid=1000(your_user) gid=1000(your_user) groups=1000(your_user) +``` -On the initial setup screen, enter `/books` as your calibre library location. +## Docker Mods -**Default admin login:** -*Username:* admin -*Password:* admin123 +[![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=calibre-web&query=%24.mods%5B%27calibre-web%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=calibre-web "view available mods for this container.") [![Docker Universal Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=universal&query=%24.mods%5B%27universal%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=universal "view available universal mods.") -Unrar is included by default and needs to be set in the Calibre-Web admin page (Basic Configuration:External Binaries) with a path of `/usr/bin/unrar` +We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above. -**x86-64 only** We have implemented the optional ability to pull in the dependencies to enable ebook conversion utilising Calibre, this means if you don't require this feature the container isn't uneccessarily bloated but should you require it, it is easily available. -This optional layer will be rebuilt automatically on our CI pipeline upon new Calibre releases so you can stay up to date. -To use this option add the optional environmental variable as detailed above to pull an addition docker layer to enable ebook conversion and then in the Calibre-Web admin page (Basic Configuration:External Binaries) set the **Path to Calibre E-Book Converter** to `/usr/bin/ebook-convert` +## Support Info -This image contains the [kepubify](https://pgaskin.net/kepubify/) ebook conversion tool (MIT License) to convert epub to kepub. In the Calibre-Web admin page (Basic Configuration:External Binaries) set the **Path to Kepubify E-Book Converter** to `/usr/bin/kepubify` +* Shell access whilst the container is running: -To reverse proxy with our Letsencrypt docker container we include a preconfigured reverse proxy config, for other instances of Nginx use the following location block: -``` - location /calibre-web { - proxy_pass http://<your-ip>:8083; - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Scheme $scheme; - proxy_set_header X-Script-Name /calibre-web; - } -``` + ```bash + docker exec -it calibre-web /bin/bash + ``` +* To monitor the logs of the container in realtime: -## Docker Mods -[![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=calibre-web&query=%24.mods%5B%27calibre-web%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=calibre-web "view available mods for this container.") [![Docker Universal Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=universal&query=%24.mods%5B%27universal%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=universal "view available universal mods.") + ```bash + docker logs -f calibre-web + ``` -We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above. +* Container version number: + ```bash + docker inspect -f '{{ index .Config.Labels "build_version" }}' calibre-web + ``` -## Support Info +* Image version number: -* Shell access whilst the container is running: `docker exec -it calibre-web /bin/bash` -* To monitor the logs of the container in realtime: `docker logs -f calibre-web` -* container version number - * `docker inspect -f '{{ index .Config.Labels "build_version" }}' calibre-web` -* image version number - * `docker inspect -f '{{ index .Config.Labels "build_version" }}' ghcr.io/linuxserver/calibre-web` + ```bash + docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/calibre-web:nightly + ``` ## Updating Info @@ -203,48 +220,101 @@ Most of our images are static, versioned, and require an image update and contai Below are the instructions for updating containers: ### Via Docker Compose -* Update all images: `docker-compose pull` - * or update a single image: `docker-compose pull calibre-web` -* Let compose update all containers as necessary: `docker-compose up -d` - * or update a single container: `docker-compose up -d calibre-web` -* You can also remove the old dangling images: `docker image prune` + +* Update images: + * All images: + + ```bash + docker-compose pull + ``` + + * Single image: + + ```bash + docker-compose pull calibre-web + ``` + +* Update containers: + * All containers: + + ```bash + docker-compose up -d + ``` + + * Single container: + + ```bash + docker-compose up -d calibre-web + ``` + +* You can also remove the old dangling images: + + ```bash + docker image prune + ``` ### Via Docker Run -* Update the image: `docker pull ghcr.io/linuxserver/calibre-web` -* Stop the running container: `docker stop calibre-web` -* Delete the container: `docker rm calibre-web` + +* Update the image: + + ```bash + docker pull lscr.io/linuxserver/calibre-web:nightly + ``` + +* Stop the running container: + + ```bash + docker stop calibre-web + ``` + +* Delete the container: + + ```bash + docker rm calibre-web + ``` + * Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your `/config` folder and settings will be preserved) -* You can also remove the old dangling images: `docker image prune` +* You can also remove the old dangling images: + + ```bash + docker image prune + ``` ### Via Watchtower auto-updater (only use if you don't remember the original parameters) + * Pull the latest image at its tag and replace it with the same env variables in one run: - ``` - docker run --rm \ - -v /var/run/docker.sock:/var/run/docker.sock \ - containrrr/watchtower \ - --run-once calibre-web - ``` + + ```bash + docker run --rm \ + -v /var/run/docker.sock:/var/run/docker.sock \ + containrrr/watchtower \ + --run-once calibre-web + ``` + * You can also remove the old dangling images: `docker image prune` -**Note:** We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose). +**warning**: We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose). ### Image Update Notifications - Diun (Docker Image Update Notifier) -* We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported. + +**tip**: We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported. ## Building locally If you want to make local modifications to these images for development purposes or just to customize the logic: -``` + +```bash git clone https://github.com/linuxserver/docker-calibre-web.git cd docker-calibre-web docker build \ --no-cache \ --pull \ - -t ghcr.io/linuxserver/calibre-web:latest . + -t lscr.io/linuxserver/calibre-web:nightly . ``` The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static` -``` + +```bash docker run --rm --privileged multiarch/qemu-user-static:register --reset ``` @@ -252,6 +322,16 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **17.10.23:** - Remove some packages that are required by the calibre mod but not the base container. +* **07.10.23:** - Install unrar from [linuxserver repo](https://github.com/linuxserver/docker-unrar). Switch to Python virtual environment. +* **13.04.23:** - Deprecate armhf. +* **29.01.23:** - Add cmake as build dep for Levenshtein. +* **27.12.22:** - Add ghostscript, libxtst6, libxkbfile-dev. +* **20.12.22:** - Improve init script and prevent harmless error. +* **22.10.22:** - Rebase to jammy. Upgrade to s6v3. Clean up build dependencies. +* **04.11.21:** - Fix pip arguments +* **10.02.21:** - Add libxrandr2 +* **25.01.21:** - Add nightly tag * **19.01.21:** - Add python3-pkg-resources * **13.01.21:** - Rebase to Ubuntu Focal, see [here](https://docs.linuxserver.io/faq#my-host-is-incompatible-with-images-based-on-ubuntu-focal) for troubleshooting armhf. * **12.10.20:** - Add libxi6 diff --git a/jenkins-vars.yml b/jenkins-vars.yml index f31a209a7..6608e78aa 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -1,16 +1,17 @@ --- - # jenkins variables project_name: docker-calibre-web -external_type: github_stable -release_type: stable -release_tag: latest -ls_branch: master +external_type: github_commit +release_type: prerelease +release_tag: nightly +ls_branch: nightly +build_armhf: false +external_trigger_delay_hours: 6 repo_vars: - EXT_GIT_BRANCH = 'master' - EXT_USER = 'janeczku' - EXT_REPO = 'calibre-web' - - BUILD_VERSION_ARG = 'CALIBREWEB_RELEASE' + - BUILD_VERSION_ARG = 'CALIBREWEB_COMMIT' - LS_USER = 'linuxserver' - LS_REPO = 'docker-calibre-web' - CONTAINER_NAME = 'calibre-web' diff --git a/package_versions.txt b/package_versions.txt index ad814d3ec..ed8d2ce90 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -1,244 +1,396 @@ -adduser3.118ubuntu2 -apt2.0.2ubuntu0.2 -apt-utils2.0.2ubuntu0.2 -base-files11ubuntu5.2 -base-passwd3.5.47 -bash5.0-6ubuntu1.1 -bsdutils1:2.34-0.1ubuntu9.1 -bzip21.0.8-2 -ca-certificates20201027ubuntu0.20.04.1 -coreutils8.30-3ubuntu2 -curl7.68.0-1ubuntu2.4 -dash0.5.10.2-6 -dbus1.12.16-2ubuntu2.1 -debconf1.5.73 -debianutils4.9.1 -diffutils1:3.7-3 -dirmngr2.2.19-3ubuntu2 -dpkg1.19.7ubuntu3 -e2fsprogs1.45.5-2ubuntu1 -fdisk2.34-0.1ubuntu9.1 -file1:5.38-4 -findutils4.7.0-1ubuntu1 -fontconfig2.13.1-2ubuntu3 -fontconfig-config2.13.1-2ubuntu3 -fonts-dejavu-core2.37-1 -fonts-droid-fallback1:6.0.1r16-1.1 -fonts-noto-mono20200323-1build1~ubuntu20.04.1 -fonts-urw-base3520170801.1-3 -gcc-10-base10.2.0-5ubuntu1~20.04 -ghostscript9.50~dfsg-5ubuntu4.2 -gnupg2.2.19-3ubuntu2 -gnupg-l10n2.2.19-3ubuntu2 -gnupg-utils2.2.19-3ubuntu2 -gpg2.2.19-3ubuntu2 -gpg-agent2.2.19-3ubuntu2 -gpgconf2.2.19-3ubuntu2 -gpgsm2.2.19-3ubuntu2 -gpgv2.2.19-3ubuntu2 -gpg-wks-client2.2.19-3ubuntu2 -gpg-wks-server2.2.19-3ubuntu2 -grep3.4-1 -gsfonts1:8.11+urwcyr1.0.7~pre44-4.4 -gzip1.10-0ubuntu4 -hicolor-icon-theme0.17-2 -hostname3.23 -imagemagick-6-common8:6.9.10.23+dfsg-2.1ubuntu11.2 -imagemagick-6.q168:6.9.10.23+dfsg-2.1ubuntu11.2 -imagemagick8:6.9.10.23+dfsg-2.1ubuntu11.2 -init-system-helpers1.57 -krb5-locales1.17-6ubuntu4.1 -libacl12.2.53-6 -libapparmor12.13.3-7ubuntu5.1 -libapt-pkg6.02.0.2ubuntu0.2 -libasn1-8-heimdal7.7.0+dfsg-1ubuntu1 -libassuan02.5.3-7ubuntu2 -libattr11:2.4.48-5 -libaudit11:2.8.5-2ubuntu6 -libaudit-common1:2.8.5-2ubuntu6 -libavahi-client30.7-4ubuntu7 -libavahi-common30.7-4ubuntu7 -libavahi-common-data0.7-4ubuntu7 -libblkid12.34-0.1ubuntu9.1 -libbrotli11.0.7-6ubuntu0.1 -libbsd00.10.0-1 -libbz2-1.01.0.8-2 -libc62.31-0ubuntu9.1 -libcairo21.16.0-4ubuntu1 -libcap-ng00.7.9-2.1build1 -libc-bin2.31-0ubuntu9.1 -libcom-err21.45.5-2ubuntu1 -libcrypt11:4.4.10-10ubuntu4 -libcups22.3.1-9ubuntu1.1 -libcurl47.68.0-1ubuntu2.4 -libdatrie10.2.12-3 -libdb5.35.3.28+dfsg1-0.6ubuntu2 -libdbus-1-31.12.16-2ubuntu2.1 -libdebconfclient00.251ubuntu1 -libdjvulibre213.5.27.1-14build1 -libdjvulibre-text3.5.27.1-14build1 -libexpat12.2.9-1build1 -libext2fs21.45.5-2ubuntu1 -libfdisk12.34-0.1ubuntu9.1 -libffi73.3-4 -libfftw3-double33.3.8-2ubuntu1 -libfontconfig12.13.1-2ubuntu3 -libfreetype62.10.1-2ubuntu0.1 -libfribidi01.0.8-2 -libgcc-s110.2.0-5ubuntu1~20.04 -libgcrypt201.8.5-5ubuntu1 -libglib2.0-02.64.3-1~ubuntu20.04.1 -libglib2.0-data2.64.3-1~ubuntu20.04.1 -libgmp102:6.2.0+dfsg-4 -libgnutls303.6.13-2ubuntu1.3 -libgomp110.2.0-5ubuntu1~20.04 -libgpg-error01.37-1 -libgraphite2-31.3.13-11build1 -libgs99.50~dfsg-5ubuntu4.2 -libgs9-common9.50~dfsg-5ubuntu4.2 -libgssapi3-heimdal7.7.0+dfsg-1ubuntu1 -libgssapi-krb5-21.17-6ubuntu4.1 -libharfbuzz0b2.6.4-1ubuntu4 -libhcrypto4-heimdal7.7.0+dfsg-1ubuntu1 -libheimbase1-heimdal7.7.0+dfsg-1ubuntu1 -libheimntlm0-heimdal7.7.0+dfsg-1ubuntu1 -libhogweed53.5.1+really3.5.1-2 -libhx509-5-heimdal7.7.0+dfsg-1ubuntu1 -libicu6666.1-2ubuntu2 -libidn111.33-2.2ubuntu2 -libidn2-02.2.0-2 -libijs-0.350.35-15 -libilmbase242.3.0-6build1 -libjbig02.1-3.1build1 -libjbig2dec00.18-1ubuntu1 -libjpeg88c-2ubuntu8 -libjpeg-turbo82.0.3-0ubuntu1.20.04.1 -libk5crypto31.17-6ubuntu4.1 -libkeyutils11.6-6ubuntu1 -libkrb5-26-heimdal7.7.0+dfsg-1ubuntu1 -libkrb5-31.17-6ubuntu4.1 -libkrb5support01.17-6ubuntu4.1 -libksba81.3.5-2 -liblcms2-22.9-4 -libldap-2.4-22.4.49+dfsg-2ubuntu1.5 -libldap-common2.4.49+dfsg-2ubuntu1.5 -liblqr-1-00.4.2-2.1 -libltdl72.4.6-14 -liblz4-11.9.2-2 -liblzma55.2.4-1ubuntu1 -libmagic11:5.38-4 -libmagickcore-6.q16-68:6.9.10.23+dfsg-2.1ubuntu11.2 -libmagickcore-6.q16-6-extra8:6.9.10.23+dfsg-2.1ubuntu11.2 -libmagickwand-6.q16-68:6.9.10.23+dfsg-2.1ubuntu11.2 -libmagic-mgc1:5.38-4 -libmount12.34-0.1ubuntu9.1 -libmpdec22.4.2-3 -libncurses66.2-0ubuntu2 -libncursesw66.2-0ubuntu2 -libnetpbm102:10.0-15.3build1 -libnettle73.5.1+really3.5.1-2 -libnghttp2-141.40.0-1build1 -libnpth01.6-1 -libnspr42:4.25-1 -libnss32:3.49.1-1ubuntu1.5 -libopenexr242.3.0-6ubuntu0.3 -libopenjp2-72.3.1-1ubuntu4.20.04.1 -libp11-kit00.23.20-1ubuntu0.1 -libpam0g1.3.1-5ubuntu4.1 -libpam-modules1.3.1-5ubuntu4.1 -libpam-modules-bin1.3.1-5ubuntu4.1 -libpam-runtime1.3.1-5ubuntu4.1 -libpango-1.0-01.44.7-2ubuntu4 -libpangocairo-1.0-01.44.7-2ubuntu4 -libpangoft2-1.0-01.44.7-2ubuntu4 -libpaper11.1.28 -libpaper-utils1.1.28 -libpcre2-8-010.34-7 -libpcre32:8.39-12build1 -libpixman-1-00.38.4-0ubuntu1 -libpng16-161.6.37-2 -libprocps82:3.3.16-1ubuntu2 -libpsl50.21.0-1ubuntu1 -libpython3.8-minimal3.8.5-1~20.04 -libpython3.8-stdlib3.8.5-1~20.04 -libpython3-stdlib3.8.2-0ubuntu2 -libreadline88.0-4 -libroken18-heimdal7.7.0+dfsg-1ubuntu1 -librtmp12.4+20151223.gitfa8646d.1-2build1 -libsasl2-22.1.27+dfsg-2 -libsasl2-modules2.1.27+dfsg-2 -libsasl2-modules-db2.1.27+dfsg-2 -libseccomp22.4.3-1ubuntu3.20.04.3 -libselinux13.0-1build2 -libsemanage13.0-1build2 -libsemanage-common3.0-1build2 -libsepol13.0-1 -libsmartcols12.34-0.1ubuntu9.1 -libsqlite3-03.31.1-4ubuntu0.2 -libss21.45.5-2ubuntu1 -libssh-40.9.3-2ubuntu2.1 -libssl1.11.1.1f-1ubuntu2.1 -libstdc++610.2.0-5ubuntu1~20.04 -libsystemd0245.4-4ubuntu3.4 -libtasn1-64.16.0-2 -libthai00.1.28-3 -libthai-data0.1.28-3 -libtiff54.1.0+git191117-2build1 -libtinfo66.2-0ubuntu2 -libudev1245.4-4ubuntu3.4 -libunistring20.9.10-2 -libuuid12.34-0.1ubuntu9.1 -libwebp60.6.1-2 -libwebpmux30.6.1-2 -libwind0-heimdal7.7.0+dfsg-1ubuntu1 -libwmf0.2-70.2.8.4-17ubuntu1 -libx11-62:1.6.9-2ubuntu1.1 -libx11-data2:1.6.9-2ubuntu1.1 -libxau61:1.0.9-0ubuntu1 -libxcb11.14-2 -libxcb-render01.14-2 -libxcb-shm01.14-2 -libxcomposite11:0.4.5-1 -libxdmcp61:1.1.3-0ubuntu1 -libxext62:1.3.4-0ubuntu1 -libxi62:1.7.10-0ubuntu1 -libxml22.9.10+dfsg-5 -libxrender11:0.9.10-1 -libxslt1.11.1.34-4 -libzstd11.4.4+dfsg-3 -locales2.31-0ubuntu9.1 -login1:4.8.1-1ubuntu5.20.04 -logsave1.45.5-2ubuntu1 -lsb-base11.1.0ubuntu2 -mawk1.3.4.20200120-2 -mime-support3.64ubuntu1 -mount2.34-0.1ubuntu9.1 -ncurses-base6.2-0ubuntu2 -ncurses-bin6.2-0ubuntu2 -netpbm2:10.0-15.3build1 -openssl1.1.1f-1ubuntu2.1 -passwd1:4.8.1-1ubuntu5.20.04 -perl-base5.30.0-9ubuntu0.2 -pinentry-curses1.1.0-3build1 -poppler-data0.4.9-2 -procps2:3.3.16-1ubuntu2 -publicsuffix20200303.0012-1 -python33.8.2-0ubuntu2 -python3.83.8.5-1~20.04 -python3.8-minimal3.8.5-1~20.04 -python3-minimal3.8.2-0ubuntu2 -python3-pkg-resources45.2.0-1 -readline-common8.0-4 -sed4.7-1 -sensible-utils0.0.12+nmu1 -shared-mime-info1.15-1 -sysvinit-utils2.96-2.1ubuntu1 -tar1.30+dfsg-7ubuntu0.20.04.1 -tzdata2020f-0ubuntu0.20.04.1 -ubuntu-keyring2020.02.11.2 -ucf3.0038+nmu1 -unrar1:5.6.6-2build1 -util-linux2.34-0.1ubuntu9.1 -xdg-user-dirs0.17-2ubuntu1 -xz-utils5.2.4-1ubuntu1 -zlib1g1:1.2.11.dfsg-2ubuntu1.2 +NAME VERSION TYPE +APScheduler 3.10.4 python +Babel 2.13.0 python +Brotli 1.1.0 python +Deprecated 1.2.14 python +Flask 2.3.3 python +Flask-Dance 7.0.0 python +Flask-Limiter 3.4.1 python +Flask-Login 0.6.2 python +Flask-Principal 0.4.0 python +Flask-SimpleLDAP 1.4.0 python +Flask-WTF 1.1.2 python +Jinja2 3.1.2 python +Levenshtein 0.21.1 python +MarkupSafe 2.1.3 python +Pillow 10.0.1 python +PyDrive2 1.17.0 python +PySocks 1.7.1 python +PyYAML 6.0.1 python +Pygments 2.16.1 python +SQLAlchemy 1.4.49 python +SQLAlchemy-Utils 0.41.1 python +Simple Launcher Executable 1.1.0.14 dotnet +Sphinx 7.2.6 python +URLObject 2.4.3 python +Unidecode 1.3.7 python +WTForms 3.1.0 python +Wand 0.6.11 python +Werkzeug 2.3.7 python +adduser 3.118ubuntu5 deb +advocate 1.0.0 python +alabaster 0.7.13 python +anyio 4.0.0 python +apt 2.4.10 deb +apt-utils 2.4.10 deb +arrow 1.3.0 python +attrs 23.1.0 python +base-files 12ubuntu4.3 deb +base-passwd 3.5.52build1 deb +bash 5.1-6ubuntu1 deb +bash 5.1.16 binary +beautifulsoup4 4.12.2 python +bibtexparser 1.4.1 python +blinker 1.6.3 python +bsdutils 1:2.37.2-4ubuntu3 deb +ca-certificates 20230311ubuntu0.22.04.1 deb +cachetools 5.3.1 python +certifi 2023.7.22 python +cffi 1.16.0 python +chardet 4.0.0 python +charset-normalizer 3.3.0 python +click 8.1.7 python +comicapi 3.2.0 python +coreutils 8.32-4.1ubuntu1 deb +cryptography 41.0.4 python +curl 7.81.0-1ubuntu1.13 deb +dash 0.5.11+git20210903+057cd650a4ed-3build1 deb +debconf 1.5.79ubuntu1 deb +debianutils 5.5-1ubuntu2 deb +diffutils 1:3.8-0ubuntu2 deb +dirmngr 2.2.27-3ubuntu2.1 deb +docutils 0.18.1 python +dpkg 1.21.1ubuntu2.2 deb +dpkg-dev 1.21.1ubuntu2.2 deb +e2fsprogs 1.46.5-2ubuntu1.1 deb +exceptiongroup 1.1.3 python +fake-useragent 1.3.0 python +faust-cchardet 2.1.19 python +findutils 4.8.0-1ubuntu3 deb +flask-babel 3.1.0 python +fontconfig-config 2.13.1-4.2ubuntu5 deb +fonts-urw-base35 20200910-1 deb +free-proxy 1.1.1 python +gcc-12-base 12.3.0-1ubuntu1~22.04 deb +gevent 23.9.1 python +ghostscript 9.55.0~dfsg1-0ubuntu5.4 deb +github.com/beevik/etree v1.1.0 go-module +github.com/kr/smartypants v0.1.0 go-module +github.com/pgaskin/kepubify/_/html v0.0.0-20211223234002-6ee2cc632cdc go-module +github.com/pgaskin/kepubify/v4 (devel) go-module +github.com/spf13/pflag v1.0.5 go-module +gnupg 2.2.27-3ubuntu2.1 deb +gnupg-l10n 2.2.27-3ubuntu2.1 deb +gnupg-utils 2.2.27-3ubuntu2.1 deb +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c go-module +golang.org/x/text v0.3.6 go-module +goodreads 0.3.2 python +google-api-core 2.12.0 python +google-api-python-client 2.97.0 python +google-auth 2.23.3 python +google-auth-httplib2 0.1.1 python +google-auth-oauthlib 1.0.0 python +googleapis-common-protos 1.61.0 python +gpg 2.2.27-3ubuntu2.1 deb +gpg-agent 2.2.27-3ubuntu2.1 deb +gpg-wks-client 2.2.27-3ubuntu2.1 deb +gpg-wks-server 2.2.27-3ubuntu2.1 deb +gpgconf 2.2.27-3ubuntu2.1 deb +gpgsm 2.2.27-3ubuntu2.1 deb +gpgv 2.2.27-3ubuntu2.1 deb +greenlet 2.0.2 python +grep 3.7-1build1 deb +gzip 1.10-4ubuntu4.1 deb +h11 0.14.0 python +hicolor-icon-theme 0.17-2 deb +hostname 3.23ubuntu2 deb +html2text 2020.1.16 python +httpcore 0.18.0 python +httplib2 0.22.0 python +httpx 0.25.0 python +idna 3.4 python +imagemagick 8:6.9.11.60+dfsg-1.3ubuntu0.22.04.3 deb +imagemagick-6-common 8:6.9.11.60+dfsg-1.3ubuntu0.22.04.3 deb +imagemagick-6.q16 8:6.9.11.60+dfsg-1.3ubuntu0.22.04.3 deb +imagesize 1.4.1 python +importlib-metadata 6.8.0 python +importlib-resources 6.1.0 python +inflate64 0.3.1 python +init-system-helpers 1.62 deb +iso-639 0.4.5 python +itsdangerous 2.1.2 python +jq 1.6-2.1ubuntu3 deb +jsonschema 4.19.1 python +jsonschema-specifications 2023.7.1 python +libacl1 2.3.1-1 deb +libaom3 3.3.0-1 deb +libapt-pkg6.0 2.4.10 deb +libassuan0 2.5.5-1build1 deb +libattr1 1:2.5.1-1build1 deb +libaudit-common 1:3.0.7-1build1 deb +libaudit1 1:3.0.7-1build1 deb +libavahi-client3 0.8-5ubuntu5.1 deb +libavahi-common-data 0.8-5ubuntu5.1 deb +libavahi-common3 0.8-5ubuntu5.1 deb +libblkid1 2.37.2-4ubuntu3 deb +libbrotli1 1.0.9-2build6 deb +libbsd0 0.11.5-1 deb +libbz2-1.0 1.0.8-5build1 deb +libc-bin 2.35-0ubuntu3.1 deb +libc6 2.35-0ubuntu3.4 deb +libcap-ng0 0.7.9-2.2build3 deb +libcap2 1:2.44-1ubuntu0.22.04.1 deb +libcom-err2 1.46.5-2ubuntu1.1 deb +libcrypt1 1:4.4.27-1 deb +libcups2 2.4.1op1-1ubuntu4.7 deb +libcurl4 7.81.0-1ubuntu1.13 deb +libdav1d5 0.9.2-1 deb +libdb5.3 5.3.28+dfsg1-0.8ubuntu3 deb +libdbus-1-3 1.12.20-2ubuntu4.1 deb +libde265-0 1.0.8-1 deb +libdebconfclient0 0.261ubuntu1 deb +libdeflate0 1.10-2 deb +libexpat1 2.4.7-1ubuntu0.2 deb +libext2fs2 1.46.5-2ubuntu1.1 deb +libffi8 3.4.2-4 deb +libfftw3-double3 3.3.8-2ubuntu8 deb +libfontconfig1 2.13.1-4.2ubuntu5 deb +libfreetype6 2.11.1+dfsg-1ubuntu0.2 deb +libgcc-s1 12.3.0-1ubuntu1~22.04 deb +libgcrypt20 1.9.4-3ubuntu3 deb +libglib2.0-0 2.72.4-0ubuntu2.2 deb +libgmp10 2:6.2.1+dfsg-3ubuntu1 deb +libgnutls30 3.7.3-4ubuntu1.2 deb +libgomp1 12.3.0-1ubuntu1~22.04 deb +libgpg-error0 1.43-3 deb +libgs9 9.55.0~dfsg1-0ubuntu5.4 deb +libgs9-common 9.55.0~dfsg1-0ubuntu5.4 deb +libgssapi-krb5-2 1.19.2-2ubuntu0.2 deb +libheif1 1.12.0-2build1 deb +libhogweed6 3.7.3-1build2 deb +libicu70 70.1-2 deb +libidn12 1.38-4ubuntu1 deb +libidn2-0 2.3.2-2build1 deb +libijs-0.35 0.35-15build2 deb +libjbig0 2.1-3.1ubuntu0.22.04.1 deb +libjbig2dec0 0.19-3build2 deb +libjpeg-turbo8 2.1.2-0ubuntu1 deb +libjpeg8 8c-2ubuntu10 deb +libjq1 1.6-2.1ubuntu3 deb +libjs-jquery 3.6.0+dfsg+~3.5.13-1 deb +libk5crypto3 1.19.2-2ubuntu0.2 deb +libkeyutils1 1.6.1-2ubuntu3 deb +libkrb5-3 1.19.2-2ubuntu0.2 deb +libkrb5support0 1.19.2-2ubuntu0.2 deb +libksba8 1.6.0-2ubuntu0.2 deb +liblcms2-2 2.12~rc1-2build2 deb +libldap-2.5-0 2.5.16+dfsg-0ubuntu0.22.04.1 deb +libldap-common 2.5.16+dfsg-0ubuntu0.22.04.1 deb +liblqr-1-0 0.4.2-2.1 deb +libltdl7 2.4.6-15build2 deb +liblz4-1 1.9.3-2build2 deb +liblzma5 5.2.5-2ubuntu1 deb +libmagickcore-6.q16-6 8:6.9.11.60+dfsg-1.3ubuntu0.22.04.3 deb +libmagickwand-6.q16-6 8:6.9.11.60+dfsg-1.3ubuntu0.22.04.3 deb +libmd0 1.0.4-1build1 deb +libmount1 2.37.2-4ubuntu3 deb +libmpdec3 2.5.1-2build2 deb +libncurses6 6.3-2ubuntu0.1 deb +libncursesw6 6.3-2ubuntu0.1 deb +libnettle8 3.7.3-1build2 deb +libnghttp2-14 1.43.0-1build3 deb +libnpth0 1.6-3build2 deb +libnsl2 1.3.0-2build2 deb +libnspr4 2:4.32-3build1 deb +libnss3 2:3.68.2-0ubuntu1.2 deb +libnuma1 2.0.14-3ubuntu2 deb +libonig5 6.9.7.1-2build1 deb +libopenjp2-7 2.4.0-6 deb +libp11-kit0 0.24.0-6build1 deb +libpam-modules 1.4.0-11ubuntu2.3 deb +libpam-modules-bin 1.4.0-11ubuntu2.3 deb +libpam-runtime 1.4.0-11ubuntu2.3 deb +libpam0g 1.4.0-11ubuntu2.3 deb +libpaper1 1.1.28build2 deb +libpcre2-8-0 10.39-3ubuntu0.1 deb +libpcre3 2:8.39-13ubuntu0.22.04.1 deb +libpng16-16 1.6.37-3build5 deb +libprocps8 2:3.3.17-6ubuntu2 deb +libpsl5 0.21.0-1.2build2 deb +libpthread-stubs0-dev 0.4-1build2 deb +libpython3-stdlib 3.10.6-1~22.04 deb +libpython3.10-minimal 3.10.12-1~22.04.2 deb +libpython3.10-stdlib 3.10.12-1~22.04.2 deb +libreadline8 8.1.2-1 deb +librtmp1 2.4+20151223.gitfa8646d.1-2build4 deb +libsasl2-2 2.1.27+dfsg2-3ubuntu1.2 deb +libsasl2-modules 2.1.27+dfsg2-3ubuntu1.2 deb +libsasl2-modules-db 2.1.27+dfsg2-3ubuntu1.2 deb +libseccomp2 2.5.3-2ubuntu2 deb +libselinux1 3.3-1build2 deb +libsemanage-common 3.3-1build2 deb +libsemanage2 3.3-1build2 deb +libsepol2 3.3-1build1 deb +libsmartcols1 2.37.2-4ubuntu3 deb +libsqlite3-0 3.37.2-2ubuntu0.1 deb +libss2 1.46.5-2ubuntu1.1 deb +libssh-4 0.9.6-2ubuntu0.22.04.1 deb +libssl3 3.0.2-0ubuntu1.10 deb +libstdc++6 12.3.0-1ubuntu1~22.04 deb +libsystemd0 249.11-0ubuntu3.9 deb +libtasn1-6 4.18.0-4build1 deb +libtiff5 4.3.0-6ubuntu0.6 deb +libtinfo6 6.3-2ubuntu0.1 deb +libtirpc-common 1.3.2-2ubuntu0.1 deb +libtirpc3 1.3.2-2ubuntu0.1 deb +libudev1 249.11-0ubuntu3.9 deb +libunistring2 1.0-1 deb +libuuid1 2.37.2-4ubuntu3 deb +libwebp7 1.2.2-2ubuntu0.22.04.2 deb +libwebpdemux2 1.2.2-2ubuntu0.22.04.2 deb +libwebpmux3 1.2.2-2ubuntu0.22.04.2 deb +libx11-6 2:1.7.5-1ubuntu0.3 deb +libx11-data 2:1.7.5-1ubuntu0.3 deb +libx11-dev 2:1.7.5-1ubuntu0.3 deb +libx265-199 3.5-2 deb +libxau-dev 1:1.0.9-1build5 deb +libxau6 1:1.0.9-1build5 deb +libxcb1 1.14-3ubuntu3 deb +libxcb1-dev 1.14-3ubuntu3 deb +libxcomposite1 1:0.4.5-1build2 deb +libxdmcp-dev 1:1.1.3-0ubuntu5 deb +libxdmcp6 1:1.1.3-0ubuntu5 deb +libxext6 2:1.3.4-1build1 deb +libxi6 2:1.8-1build1 deb +libxkbfile-dev 1:1.1.0-1build3 deb +libxkbfile1 1:1.1.0-1build3 deb +libxml2 2.9.13+dfsg-1ubuntu0.3 deb +libxrandr2 2:1.5.2-1build1 deb +libxrender1 1:0.9.10-1build4 deb +libxslt1.1 1.1.34-4ubuntu0.22.04.1 deb +libxtst6 2:1.2.3-1build4 deb +libxxhash0 0.8.1-1 deb +libzstd1 1.4.8+dfsg-3build1 deb +limits 3.6.0 python +locales 2.35-0ubuntu3.4 deb +login 1:4.8.1-2ubuntu2.1 deb +logsave 1.46.5-2ubuntu1.1 deb +lsb-base 11.1.0ubuntu4 deb +lxml 4.9.3 python +markdown-it-py 3.0.0 python +markdown2 2.4.10 python +mawk 1.3.4.20200120-3 deb +mdurl 0.1.2 python +media-types 7.0.0 deb +mount 2.37.2-4ubuntu3 deb +multivolumefile 0.2.3 python +natsort 8.3.1 python +ncurses-base 6.3-2ubuntu0.1 deb +ncurses-bin 6.3-2ubuntu0.1 deb +ndg-httpsclient 0.5.1 python +netcat 1.218-4ubuntu1 deb +netcat-openbsd 1.218-4ubuntu1 deb +netifaces 0.11.0 python +nose 1.3.7 python +oauth2client 4.1.3 python +oauthlib 3.2.2 python +openssl 3.0.2-0ubuntu1.10 deb +ordered-set 4.1.0 python +outcome 1.2.0 python +packaging 23.2 python +passwd 1:4.8.1-2ubuntu2.1 deb +perl 5.34.0-3ubuntu1.2 deb +perl-base 5.34.0-3ubuntu1.2 deb +pinentry-curses 1.1.1-1build2 deb +pip 23.2.1 python +poppler-data 0.4.11-1 deb +procps 2:3.3.17-6ubuntu2 deb +protobuf 4.24.4 python +psutil 5.9.5 python +publicsuffix 20211207.1025-1 deb +py7zr 0.20.6 python +pyOpenSSL 23.2.0 python +pyasn1 0.5.0 python +pyasn1-modules 0.3.0 python +pybcj 1.0.1 python +pycountry 22.3.5 python +pycparser 2.21 python +pycryptodomex 3.19.0 python +pyparsing 3.1.1 python +pypdf 3.15.5 python +pyppmd 1.0.0 python +python-Levenshtein 0.21.1 python +python-dateutil 2.8.2 python +python-dotenv 1.0.0 python +python-ldap 3.4.3 python +python3 3.10.6-1~22.04 deb +python3-distutils 3.10.8-1~22.04 deb +python3-lib2to3 3.10.8-1~22.04 deb +python3-minimal 3.10.6-1~22.04 deb +python3-pip-whl 22.0.2+dfsg-1ubuntu0.3 deb +python3-setuptools-whl 59.6.0-1.2ubuntu0.22.04.1 deb +python3-venv 3.10.6-1~22.04 deb +python3.10 3.10.12-1~22.04.2 deb +python3.10-minimal 3.10.12-1~22.04.2 deb +python3.10-venv 3.10.12-1~22.04.2 deb +pytz 2023.3.post1 python +pyzstd 0.15.9 python +rapidfuzz 3.4.0 python +rarfile 4.1 python +rauth 0.7.3 python +readline-common 8.1.2-1 deb +referencing 0.30.2 python +requests 2.31.0 python +requests-oauthlib 1.3.1 python +rich 13.6.0 python +rpds-py 0.10.6 python +rsa 4.9 python +scholarly 1.7.11 python +sed 4.8-1ubuntu2 deb +selenium 4.14.0 python +sensible-utils 0.0.17 deb +setuptools 59.6.0 python +six 1.16.0 python +sniffio 1.3.0 python +snowballstemmer 2.2.0 python +sortedcontainers 2.4.0 python +soupsieve 2.5 python +sphinx-rtd-theme 1.3.0 python +sphinxcontrib-applehelp 1.0.7 python +sphinxcontrib-devhelp 1.0.5 python +sphinxcontrib-htmlhelp 2.0.4 python +sphinxcontrib-jquery 4.1 python +sphinxcontrib-jsmath 1.0.1 python +sphinxcontrib-qthelp 1.0.6 python +sphinxcontrib-serializinghtml 1.1.9 python +stdlib go1.17.8 go-module +sysvinit-utils 3.01-1ubuntu1 deb +tar 1.34+dfsg-1ubuntu0.1.22.04.1 deb +text2digits 0.1.0 python +texttable 1.7.0 python +tornado 6.3.3 python +trio 0.22.2 python +trio-websocket 0.11.1 python +types-python-dateutil 2.8.19.14 python +typing_extensions 4.8.0 python +tzdata 2023c-0ubuntu0.22.04.2 deb +tzlocal 5.1 python +ubuntu-keyring 2021.03.26 deb +ucf 3.0043 deb +uritemplate 4.1.1 python +urllib3 1.26.17 python +usrmerge 25ubuntu2 deb +util-linux 2.37.2-4ubuntu3 deb +wheel 0.41.2 python +wordninja 2.0.0 python +wrapt 1.15.0 python +wsproto 1.2.0 python +x11-common 1:7.7+23ubuntu2 deb +x11proto-dev 2021.5-1 deb +xmltodict 0.13.0 python +xorg-sgml-doctools 1:1.11-1.1 deb +xtrans-dev 1.4.0-1 deb +zipp 3.17.0 python +zlib1g 1:1.2.11.dfsg-2ubuntu9.2 deb +zope.event 5.0 python +zope.interface 6.1 python diff --git a/readme-vars.yml b/readme-vars.yml index b0ace4f76..9df85c310 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -5,6 +5,7 @@ project_name: calibre-web project_url: "https://github.com/janeczku/calibre-web" project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/calibre-web-icon.png" project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}" +project_categories: "Books" project_blurb: | [{{ project_name|capitalize }}]({{ project_url }}) is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. It is also possible to integrate google drive and edit metadata and your calibre library through the app itself. @@ -14,7 +15,12 @@ project_blurb: | available_architectures: - { arch: "{{ arch_x86_64 }}", tag: "amd64-latest"} - { arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"} - - { arch: "{{ arch_armhf }}", tag: "arm32v7-latest"} + +# development version +development_versions: true +development_versions_items: + - { tag: "latest", desc: "Releases of Calibre-Web" } + - { tag: "nightly", desc: "Commits to the master branch of Calibre-Web" } # container parameters common_param_env_vars_enabled: true @@ -22,11 +28,11 @@ param_container_name: "{{ project_name }}" param_usage_include_env: true param_env_vars: - { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London." } - - { env_var: "DOCKER_MODS", env_value: "linuxserver/calibre-web:calibre", desc: "#optional & **x86-64 only** Adds the ability to perform ebook conversion"} + - { env_var: "DOCKER_MODS", env_value: "linuxserver/mods:universal-calibre", desc: "#optional & **x86-64 only** Adds the ability to perform ebook conversion"} param_usage_include_vols: true param_volumes: - - { vol_path: "/config", vol_host_path: "<path to data>", desc: "Where calibre-web stores the internal database and config." } - - { vol_path: "/books", vol_host_path: "<path to calibre library>", desc: "Where your preexisting calibre database is locate." } + - { vol_path: "/config", vol_host_path: "/path/to/data", desc: "Where calibre-web stores the internal database and config." } + - { vol_path: "/books", vol_host_path: "/path/to/calibre/library", desc: "Where your preexisting calibre database is locate." } param_usage_include_ports: true param_ports: - { external_port: "8083", internal_port: "8083", port_desc: "WebUI" } @@ -50,27 +56,31 @@ app_setup_block: | *Username:* admin *Password:* admin123 + If you lock yourself out or forget a password, you will need to specify the app.db similar to this: + `docker exec -it calibre-web python3 /app/calibre-web/cps.py -p /config/app.db -s <user>:<pass>` + If you fail to specify the proper db, it will appear to succeed, but it will not work. + Unrar is included by default and needs to be set in the Calibre-Web admin page (Basic Configuration:External Binaries) with a path of `/usr/bin/unrar` **x86-64 only** We have implemented the optional ability to pull in the dependencies to enable ebook conversion utilising Calibre, this means if you don't require this feature the container isn't uneccessarily bloated but should you require it, it is easily available. This optional layer will be rebuilt automatically on our CI pipeline upon new Calibre releases so you can stay up to date. - To use this option add the optional environmental variable as detailed above to pull an addition docker layer to enable ebook conversion and then in the Calibre-Web admin page (Basic Configuration:External Binaries) set the **Path to Calibre E-Book Converter** to `/usr/bin/ebook-convert` - + To use this option add the optional environmental variable as detailed above to pull an addition docker layer to enable ebook conversion and then in the Calibre-Web admin page (Basic Configuration:External Binaries) set the **Path to Calibre E-Book Converter** to `/usr/bin/ebook-convert` + This image contains the [kepubify](https://pgaskin.net/kepubify/) ebook conversion tool (MIT License) to convert epub to kepub. In the Calibre-Web admin page (Basic Configuration:External Binaries) set the **Path to Kepubify E-Book Converter** to `/usr/bin/kepubify` - To reverse proxy with our Letsencrypt docker container we include a preconfigured reverse proxy config, for other instances of Nginx use the following location block: - ``` - location /calibre-web { - proxy_pass http://<your-ip>:8083; - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Scheme $scheme; - proxy_set_header X-Script-Name /calibre-web; - } - ``` # changelog changelogs: + - { date: "17.10.23:", desc: "Remove some packages that are required by the calibre mod but not the base container."} + - { date: "07.10.23:", desc: "Install unrar from [linuxserver repo](https://github.com/linuxserver/docker-unrar). Switch to Python virtual environment."} + - { date: "13.04.23:", desc: "Deprecate armhf."} + - { date: "29.01.23:", desc: "Add cmake as build dep for Levenshtein."} + - { date: "27.12.22:", desc: "Add ghostscript, libxtst6, libxkbfile-dev."} + - { date: "20.12.22:", desc: "Improve init script and prevent harmless error."} + - { date: "22.10.22:", desc: "Rebase to jammy. Upgrade to s6v3. Clean up build dependencies."} + - { date: "04.11.21:", desc: "Fix pip arguments"} + - { date: "10.02.21:", desc: "Add libxrandr2"} + - { date: "25.01.21:", desc: "Add nightly tag"} - { date: "19.01.21:", desc: "Add python3-pkg-resources"} - { date: "13.01.21:", desc: "Rebase to Ubuntu Focal, see [here](https://docs.linuxserver.io/faq#my-host-is-incompatible-with-images-based-on-ubuntu-focal) for troubleshooting armhf." } - { date: "12.10.20:", desc: "Add libxi6"} diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config deleted file mode 100644 index 384f5cba3..000000000 --- a/root/etc/cont-init.d/30-config +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/with-contenv bash - -# create symlinks for imagemagick policy.xml -[[ -f /etc/ImageMagick-6/policy.xml ]] && \ - rm /etc/ImageMagick-6/policy.xml -[[ ! -L /etc/ImageMagick-6/policy.xml ]] && \ - ln -s /defaults/policy.xml /etc/ImageMagick-6/policy.xml - -# create symlinks for database and log -[[ ! -f /config/app.db ]] && \ - cp /defaults/app.db /config/app.db -[[ -f /app/calibre-web/app.db ]] && \ - rm /app/calibre-web/app.db -[[ ! -L /app/calibre-web/app.db ]] && \ - ln -s /config/app.db /app/calibre-web/app.db - -# create symlinks for log -[[ ! -f /config/calibre-web.log ]] && \ - touch /config/calibre-web.log -[[ -f /app/calibre-web/calibre-web.log ]] && \ - rm /app/calibre-web/calibre-web.log -[[ ! -L /app/calibre-web/calibre-web.log ]] && \ - ln -s /config/calibre-web.log /app/calibre-web/calibre-web.log - -# create Google drive client_secrets.json file -[[ ! -f /config/client_secrets.json ]] && \ - echo "{}" > /config/client_secrets.json -[[ -f /app/calibre-web/client_secrets.json ]] && - rm /app/calibre-web/client_secrets.json -[[ ! -L /app/calibre-web/client_secrets.json ]] && - ln -s /config/client_secrets.json /app/calibre-web/client_secrets.json - -# create Google drive symlinks for database -[[ ! -f /config/gdrive.db ]] && \ - cp /app/calibre-web/gdrive.db /config/gdrive.db -[[ -f /app/calibre-web/gdrive.db ]] && \ - rm /app/calibre-web/gdrive.db -[[ ! -L /app/calibre-web/gdrive.db ]] && \ - ln -s /config/gdrive.db /app/calibre-web/gdrive.db - -# check if kepubify is present and if so make executable -[[ -f /usr/bin/kepubify ]] && \ -[[ ! -x /usr/bin/kepubify ]] && \ - chmod +x /usr/bin/kepubify - -# permissions -chown -R abc:abc \ - /config \ - /app/calibre-web diff --git a/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/dependencies.d/init-config b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/dependencies.d/init-config new file mode 100644 index 000000000..e69de29bb diff --git a/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/run b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/run new file mode 100755 index 000000000..ade464b4f --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/run @@ -0,0 +1,24 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +# create symlinks for imagemagick policy.xml +rm -rf /etc/ImageMagick-6/policy.xml +ln -s /defaults/policy.xml /etc/ImageMagick-6/policy.xml + +# create Google drive client_secrets.json file +if [[ ! -f /config/client_secrets.json ]]; then + echo "{}" > /config/client_secrets.json +fi + +# check if kepubify is present and if so make executable +if [[ -f /usr/bin/kepubify ]] && [[ ! -x /usr/bin/kepubify ]]; then + chmod +x /usr/bin/kepubify +fi + +# Pre-stage some files & directories for permissions purposes +mkdir -p /app/calibre-web/cps/cache + +# permissions +lsiown -R abc:abc \ + /config \ + /app/calibre-web/cps/cache diff --git a/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/type b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/type new file mode 100644 index 000000000..bdd22a185 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/type @@ -0,0 +1 @@ +oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/up b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/up new file mode 100644 index 000000000..ceac1e28d --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-calibre-web-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-calibre-web-config b/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-calibre-web-config new file mode 100644 index 000000000..e69de29bb diff --git a/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/dependencies.d/init-services b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/dependencies.d/init-services new file mode 100644 index 000000000..e69de29bb diff --git a/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/notification-fd b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/notification-fd new file mode 100644 index 000000000..00750edc0 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/notification-fd @@ -0,0 +1 @@ +3 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/run b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/run new file mode 100755 index 000000000..79f812fa6 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/run @@ -0,0 +1,8 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +export CALIBRE_DBPATH=/config + +exec \ + s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8083" \ + cd /app/calibre-web s6-setuidgid abc python3 /app/calibre-web/cps.py diff --git a/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/type b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/type new file mode 100644 index 000000000..5883cff0c --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/type @@ -0,0 +1 @@ +longrun diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-calibre-web-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-calibre-web-config new file mode 100644 index 000000000..e69de29bb diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-calibre-web b/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-calibre-web new file mode 100644 index 000000000..e69de29bb diff --git a/root/etc/services.d/calibre-web/run b/root/etc/services.d/calibre-web/run deleted file mode 100644 index 228e498fc..000000000 --- a/root/etc/services.d/calibre-web/run +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/with-contenv bash - -cd /app/calibre-web || exit - -exec \ - s6-setuidgid abc python3 /app/calibre-web/cps.py