From 1b0c1b6cff3a85d5f71661c9fee616b6ac46470a Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Thu, 7 Nov 2024 21:50:47 +0000 Subject: [PATCH 01/34] Searchbar in nav auto select, and exe nolonger disable CLI (#2197) * fix remmeber me * remove uselss comment * Update translation files (#2185) Signed-off-by: GitHub Action Co-authored-by: GitHub Action * exe no longer disable CLI --------- Signed-off-by: GitHub Action Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: GitHub Action Co-authored-by: a --- build.gradle | 2 +- .../SPDF/config/EndpointConfiguration.java | 1 + .../SPDF/config/ExternalAppDepConfig.java | 2 ++ src/main/resources/static/js/search.js | 34 +++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8302ffdf..bb0b6bac 100644 --- a/build.gradle +++ b/build.gradle @@ -78,7 +78,7 @@ launch4j { errTitle="Encountered error, Do you have Java 21?" downloadUrl="https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.exe" - variables=["BROWSER_OPEN=true", "ENDPOINTS_GROUPS_TO_REMOVE=CLI"] + variables=["BROWSER_OPEN=true"] jreMinVersion="17" mutexName="Stirling-PDF" diff --git a/src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java b/src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java index 9c0b3bf4..45b658e8 100644 --- a/src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java +++ b/src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java @@ -191,6 +191,7 @@ public class EndpointConfiguration { // LibreOffice addEndpointToGroup("LibreOffice", "repair"); addEndpointToGroup("LibreOffice", "file-to-pdf"); + addEndpointToGroup("Unoconv", "file-to-pdf"); addEndpointToGroup("LibreOffice", "xlsx-to-pdf"); addEndpointToGroup("LibreOffice", "pdf-to-word"); addEndpointToGroup("LibreOffice", "pdf-to-presentation"); diff --git a/src/main/java/stirling/software/SPDF/config/ExternalAppDepConfig.java b/src/main/java/stirling/software/SPDF/config/ExternalAppDepConfig.java index c939bd60..f8ab43ad 100644 --- a/src/main/java/stirling/software/SPDF/config/ExternalAppDepConfig.java +++ b/src/main/java/stirling/software/SPDF/config/ExternalAppDepConfig.java @@ -42,6 +42,7 @@ public class ExternalAppDepConfig { put("ocrmypdf", List.of("OCRmyPDF")); put("weasyprint", List.of("Weasyprint")); put("pdftohtml", List.of("Pdftohtml")); + put("unoconv", List.of("Unoconv")); } }; @@ -101,6 +102,7 @@ public class ExternalAppDepConfig { checkDependencyAndDisableGroup("ocrmypdf"); checkDependencyAndDisableGroup("weasyprint"); checkDependencyAndDisableGroup("pdftohtml"); + checkDependencyAndDisableGroup("unoconv"); // Special handling for Python/OpenCV dependencies boolean pythonAvailable = isCommandAvailable("python3") || isCommandAvailable("python"); diff --git a/src/main/resources/static/js/search.js b/src/main/resources/static/js/search.js index aec3e6c1..a4d292ea 100644 --- a/src/main/resources/static/js/search.js +++ b/src/main/resources/static/js/search.js @@ -70,3 +70,37 @@ document.querySelector("#navbarSearchInput").addEventListener("input", function resultsBox.style.width = window.navItemMaxWidth + "px"; }); +const searchDropdown = document.getElementById('searchDropdown'); +const searchInput = document.getElementById('navbarSearchInput'); +const dropdownMenu = searchDropdown.querySelector('.dropdown-menu'); + +// Handle dropdown shown event +searchDropdown.addEventListener('shown.bs.dropdown', function () { + searchInput.focus(); +}); + +// Handle hover opening +searchDropdown.addEventListener('mouseenter', function () { + const dropdownInstance = new bootstrap.Dropdown(searchDropdown); + dropdownInstance.show(); + + setTimeout(() => { + searchInput.focus(); + }, 100); +}); + +// Handle mouse leave +searchDropdown.addEventListener('mouseleave', function () { + // Check if current value is empty (including if user typed and then deleted) + if (searchInput.value.trim().length === 0) { + searchInput.blur(); + const dropdownInstance = new bootstrap.Dropdown(searchDropdown); + dropdownInstance.hide(); + } +}); + +searchDropdown.addEventListener('hidden.bs.dropdown', function () { + if (searchInput.value.trim().length === 0) { + searchInput.blur(); + } +}); From e97cb9d49ead2258190305e68c040ad053f04674 Mon Sep 17 00:00:00 2001 From: Renan <82916964+thisisrenan@users.noreply.github.com> Date: Fri, 8 Nov 2024 19:51:03 -0300 Subject: [PATCH 02/34] Add option to insert blank page between pages in Multi-tool (#2194) (#2201) --- src/main/resources/static/css/pdfActions.css | 9 ++ .../static/js/multitool/PdfActionsManager.js | 12 +++ .../static/js/multitool/PdfContainer.js | 84 ++++++++++++++++--- src/main/resources/templates/multi-tool.html | 5 ++ 4 files changed, 98 insertions(+), 12 deletions(-) diff --git a/src/main/resources/static/css/pdfActions.css b/src/main/resources/static/css/pdfActions.css index b76e45b1..30ac1eee 100644 --- a/src/main/resources/static/css/pdfActions.css +++ b/src/main/resources/static/css/pdfActions.css @@ -126,3 +126,12 @@ html[dir="rtl"] .pdf-actions_container:last-child>.pdf-actions_insert-file-butto aspect-ratio: 1; border-radius: 100px; } + +.pdf-actions_insert-file-blank-button { + position: absolute; + top: 75%; + right: 50%; + translate: 0% -50%; + aspect-ratio: 1; + border-radius: 100px; +} diff --git a/src/main/resources/static/js/multitool/PdfActionsManager.js b/src/main/resources/static/js/multitool/PdfActionsManager.js index 033b3991..6f62f256 100644 --- a/src/main/resources/static/js/multitool/PdfActionsManager.js +++ b/src/main/resources/static/js/multitool/PdfActionsManager.js @@ -73,6 +73,11 @@ class PdfActionsManager { this.addFiles(imgContainer); } + insertFileBlankButtonCallback(e) { + var imgContainer = this.getPageContainer(e.target); + this.addFiles(imgContainer, true); + } + splitFileButtonCallback(e) { var imgContainer = this.getPageContainer(e.target); imgContainer.classList.toggle("split-before"); @@ -89,6 +94,7 @@ class PdfActionsManager { this.rotateCWButtonCallback = this.rotateCWButtonCallback.bind(this); this.deletePageButtonCallback = this.deletePageButtonCallback.bind(this); this.insertFileButtonCallback = this.insertFileButtonCallback.bind(this); + this.insertFileBlankButtonCallback = this.insertFileBlankButtonCallback.bind(this); this.splitFileButtonCallback = this.splitFileButtonCallback.bind(this); } @@ -152,6 +158,12 @@ class PdfActionsManager { splitFileButton.onclick = this.splitFileButtonCallback; insertFileButtonContainer.appendChild(splitFileButton); + const insertFileBlankButton = document.createElement("button"); + insertFileBlankButton.classList.add("btn", "btn-primary", "pdf-actions_insert-file-blank-button"); + insertFileBlankButton.innerHTML = `insert_page_break`; + insertFileBlankButton.onclick = this.insertFileBlankButtonCallback; + insertFileButtonContainer.appendChild(insertFileBlankButton); + div.appendChild(insertFileButtonContainer); // add this button to every element, but only show it on the last one :D diff --git a/src/main/resources/static/js/multitool/PdfContainer.js b/src/main/resources/static/js/multitool/PdfContainer.js index 0cc1a110..97a34e1d 100644 --- a/src/main/resources/static/js/multitool/PdfContainer.js +++ b/src/main/resources/static/js/multitool/PdfContainer.js @@ -22,6 +22,7 @@ class PdfContainer { this.nameAndArchiveFiles = this.nameAndArchiveFiles.bind(this); this.splitPDF = this.splitPDF.bind(this); this.splitAll = this.splitAll.bind(this); + this.addFilesBlankAll = this.addFilesBlankAll.bind(this) this.pdfAdapters = pdfAdapters; @@ -38,6 +39,7 @@ class PdfContainer { window.exportPdf = this.exportPdf; window.rotateAll = this.rotateAll; window.splitAll = this.splitAll; + window.addFilesBlankAll = this.addFilesBlankAll const filenameInput = document.getElementById("filename-input"); const downloadBtn = document.getElementById("export-button"); @@ -77,19 +79,25 @@ class PdfContainer { } } - addFiles(nextSiblingElement) { - var input = document.createElement("input"); - input.type = "file"; - input.multiple = true; - input.setAttribute("accept", "application/pdf,image/*"); - input.onchange = async (e) => { - const files = e.target.files; + addFiles(nextSiblingElement, blank = false) { + if (blank) { - this.addFilesFromFiles(files, nextSiblingElement); - this.updateFilename(files ? files[0].name : ""); - }; + this.addFilesBlank(nextSiblingElement); - input.click(); + } else { + var input = document.createElement("input"); + input.type = "file"; + input.multiple = true; + input.setAttribute("accept", "application/pdf,image/*"); + input.onchange = async (e) => { + const files = e.target.files; + + this.addFilesFromFiles(files, nextSiblingElement); + this.updateFilename(files ? files[0].name : ""); + }; + + input.click(); + } } async addFilesFromFiles(files, nextSiblingElement) { @@ -108,6 +116,47 @@ class PdfContainer { }); } + async addFilesBlank(nextSiblingElement) { + const pdfContent = ` + %PDF-1.4 + 1 0 obj + << /Type /Catalog /Pages 2 0 R >> + endobj + 2 0 obj + << /Type /Pages /Kids [3 0 R] /Count 1 >> + endobj + 3 0 obj + << /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Contents 5 0 R >> + endobj + 5 0 obj + << /Length 44 >> + stream + 0 0 0 595 0 842 re + W + n + endstream + endobj + xref + 0 6 + 0000000000 65535 f + 0000000010 00000 n + 0000000071 00000 n + 0000000121 00000 n + 0000000205 00000 n + 0000000400 00000 n + trailer + << /Size 6 /Root 1 0 R >> + startxref + 278 + %%EOF + `; + const blob = new Blob([pdfContent], { type: 'application/pdf' }); + const url = URL.createObjectURL(blob); + const file = new File([blob], "blank_page.pdf", { type: "application/pdf" }); + await this.addPdfFile(file, nextSiblingElement); + } + + rotateElement(element, deg) { var lastTransform = element.style.rotate; if (!lastTransform) { @@ -224,6 +273,17 @@ class PdfContainer { } } + + addFilesBlankAll() { + const allPages = this.pagesContainer.querySelectorAll(".page-container"); + allPages.forEach((page, index) => { + if (index !== 0) { + this.addFiles(page, true) + } + }); + } + + splitAll() { const allPages = this.pagesContainer.querySelectorAll(".page-container"); if (this.pagesContainer.querySelectorAll(".split-before").length > 0) { @@ -450,7 +510,7 @@ function detectImageType(uint8Array) { // Check for TIFF signature (little-endian and big-endian) if ((uint8Array[0] === 73 && uint8Array[1] === 73 && uint8Array[2] === 42 && uint8Array[3] === 0) || - (uint8Array[0] === 77 && uint8Array[1] === 77 && uint8Array[2] === 0 && uint8Array[3] === 42)) { + (uint8Array[0] === 77 && uint8Array[1] === 77 && uint8Array[2] === 0 && uint8Array[3] === 42)) { return 'TIFF'; } diff --git a/src/main/resources/templates/multi-tool.html b/src/main/resources/templates/multi-tool.html index c3f78322..261a4ca8 100644 --- a/src/main/resources/templates/multi-tool.html +++ b/src/main/resources/templates/multi-tool.html @@ -47,6 +47,11 @@ cut + From 645c786d951c3e59dd9fe611b52a4ea1da424ede Mon Sep 17 00:00:00 2001 From: Ludovic Ortega Date: Sun, 10 Nov 2024 14:48:58 +0100 Subject: [PATCH 11/34] feat: move helm chart to https://github.com/Stirling-Tools/Stirling-PDF-chart (#2208) * feat: remove helm chart Signed-off-by: Ludovic Ortega * feat: mention kubernetes in install doc Signed-off-by: Ludovic Ortega --------- Signed-off-by: Ludovic Ortega --- .github/scripts/gradle_to_chart.py | 100 -------- .../workflows/lint-helm-charts.yml-disabled | 47 ---- .../release-helm-charts.yml-disabled | 31 --- .github/workflows/sync_files.yml | 42 --- .pre-commit-config.yaml | 6 - README.md | 4 + chart/stirling-pdf/Chart.yaml | 16 -- chart/stirling-pdf/README.md | 95 ------- chart/stirling-pdf/README.md.gotmpl | 25 -- chart/stirling-pdf/templates/NOTES.txt | 30 --- chart/stirling-pdf/templates/_helpers.tpl | 129 ---------- chart/stirling-pdf/templates/deployment.yaml | 131 ---------- chart/stirling-pdf/templates/ingress.yaml | 85 ------- chart/stirling-pdf/templates/pv.yaml | 16 -- chart/stirling-pdf/templates/pvc.yaml | 27 -- chart/stirling-pdf/templates/service.yaml | 48 ---- .../templates/serviceaccount.yaml | 13 - .../templates/servicemonitor.yaml | 31 --- chart/stirling-pdf/values.yaml | 239 ------------------ cr.yaml | 2 - 20 files changed, 4 insertions(+), 1113 deletions(-) delete mode 100644 .github/scripts/gradle_to_chart.py delete mode 100644 .github/workflows/lint-helm-charts.yml-disabled delete mode 100644 .github/workflows/release-helm-charts.yml-disabled delete mode 100644 chart/stirling-pdf/Chart.yaml delete mode 100644 chart/stirling-pdf/README.md delete mode 100644 chart/stirling-pdf/README.md.gotmpl delete mode 100644 chart/stirling-pdf/templates/NOTES.txt delete mode 100644 chart/stirling-pdf/templates/_helpers.tpl delete mode 100644 chart/stirling-pdf/templates/deployment.yaml delete mode 100644 chart/stirling-pdf/templates/ingress.yaml delete mode 100644 chart/stirling-pdf/templates/pv.yaml delete mode 100644 chart/stirling-pdf/templates/pvc.yaml delete mode 100644 chart/stirling-pdf/templates/service.yaml delete mode 100644 chart/stirling-pdf/templates/serviceaccount.yaml delete mode 100644 chart/stirling-pdf/templates/servicemonitor.yaml delete mode 100644 chart/stirling-pdf/values.yaml delete mode 100644 cr.yaml diff --git a/.github/scripts/gradle_to_chart.py b/.github/scripts/gradle_to_chart.py deleted file mode 100644 index c8944f6d..00000000 --- a/.github/scripts/gradle_to_chart.py +++ /dev/null @@ -1,100 +0,0 @@ -import re -import yaml - -# Paths to the files -chart_yaml_path = "chart/stirling-pdf/Chart.yaml" -gradle_path = "build.gradle" - - -def get_chart_version(path): - """ - Reads the version and the appVersion from Chart.yaml. - - Args: - path (str): The file path to the Chart.yaml. - - Returns: - dict: The version under "chart" key and the appVersion under "app" key. - """ - with open(path, encoding="utf-8") as file: - chart_yaml = yaml.safe_load(file) - return { - "chart": chart_yaml["version"], - "app": chart_yaml["appVersion"] - } - - -def get_gradle_version(path): - """ - Extracts the version from build.gradle. - - Args: - path (str): The file path to the build.gradle. - - Returns: - str: The version if found, otherwise an empty string. - """ - with open(path, encoding="utf-8") as file: - for line in file: - if "version =" in line: - # Extracts the value after 'version =' - return re.search(r'version\s*=\s*[\'"](.+?)[\'"]', line).group(1) - return "" - - -def get_new_chart_version(chart_version, old_app_version, new_app_version): - """ - Get the new chart version from - - Args: - str: The current chart version. - str: The current app version. - str: The new app version. - - Returns: - str: The new chart version to update to. - """ - chart_major, chart_minor, chart_patch = chart_version.split(".") - - old_major, old_minor, old_patch = old_app_version.split(".") - new_major, new_minor, new_patch = new_app_version.split(".") - - if old_major != new_major: - new_chart_version = f"{int(chart_major)+1}.0.0" - elif old_minor != new_minor: - new_chart_version = f"{chart_major}.{int(chart_minor)+1}.0" - elif old_patch != new_patch: - new_chart_version = f"{chart_major}.{chart_minor}.{int(chart_patch)+1}" - - return new_chart_version - - -def update_chart_version(path, new_chart_version, new_app_version): - """ - Updates the version and the appVersion in Chart.yaml with a new version. - - Args: - path (str): The file path to the Chart.yaml. - new_chart_version (str): The new chart version to update to. - new_app_version (str): The new app version to update to. - """ - with open(path, encoding="utf-8") as file: - chart_yaml = yaml.safe_load(file) - chart_yaml["version"] = new_chart_version - chart_yaml["appVersion"] = new_app_version - with open(path, "w", encoding="utf-8") as file: - yaml.safe_dump(chart_yaml, file) - - -# Main logic -chart_version = get_chart_version(chart_yaml_path) -gradle_version = get_gradle_version(gradle_path) - -if chart_version["app"] != gradle_version: - new_chart_version = get_new_chart_version(chart_version["chart"], chart_version["app"], gradle_version, ) - print( - f"Versions do not match. Updating Chart.yaml from {chart_version['chart']} to {new_chart_version}." - ) - update_chart_version(chart_yaml_path, new_chart_version, gradle_version) -else: - print("Versions match. No update required.") diff --git a/.github/workflows/lint-helm-charts.yml-disabled b/.github/workflows/lint-helm-charts.yml-disabled deleted file mode 100644 index 3b012091..00000000 --- a/.github/workflows/lint-helm-charts.yml-disabled +++ /dev/null @@ -1,47 +0,0 @@ -name: Lint and Test Helm Charts - -on: - push: - branches: ["main"] - pull_request: - branches: ["main"] - -jobs: - lint-test: - runs-on: ubuntu-latest - - permissions: - contents: read - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Helm - uses: azure/setup-helm@v4 - - - name: Set up python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - - name: Run pre-commit - uses: pre-commit/action@v3.0.1 - with: - extra_args: helm-docs-built - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2 - - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) - if [[ -n "$changed" ]]; then - echo "changed=true" >> "$GITHUB_OUTPUT" - fi - - - name: Run chart-testing - if: steps.list-changed.outputs.changed == 'true' - run: ct lint --target-branch ${{ github.event.repository.default_branch }} --validate-maintainers=false diff --git a/.github/workflows/release-helm-charts.yml-disabled b/.github/workflows/release-helm-charts.yml-disabled deleted file mode 100644 index 0dca6fb5..00000000 --- a/.github/workflows/release-helm-charts.yml-disabled +++ /dev/null @@ -1,31 +0,0 @@ -name: Release Helm charts - -on: - push: - branches: - - main - -permissions: - contents: write - -jobs: - release: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up git config - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.6.0 - with: - config: "./cr.yaml" - charts_dir: "chart" - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/sync_files.yml b/.github/workflows/sync_files.yml index 486cad5f..d220f92d 100644 --- a/.github/workflows/sync_files.yml +++ b/.github/workflows/sync_files.yml @@ -14,48 +14,6 @@ permissions: pull-requests: write jobs: - sync-versions: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - name: Install dependencies - run: pip install pyyaml - - name: Sync versions - run: python .github/scripts/gradle_to_chart.py - - name: Run pre-commit helm-docs-built - uses: pre-commit/action@v3.0.1 - with: - extra_args: helm-docs-built - - name: Set up git config - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - - name: Run git add - run: | - git add . - git diff --staged --quiet || git commit -m ":floppy_disk: Sync Versions - > Made via sync_files.yml" || echo "no changes" - - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Update files - committer: GitHub Action - author: GitHub Action - signoff: true - branch: sync_version - title: ":floppy_disk: Update Version" - body: | - Auto-generated by [create-pull-request][1] - - [1]: https://github.com/peter-evans/create-pull-request - draft: false - delete-branch: true - labels: github-actions sync-readme: runs-on: ubuntu-latest steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 125f0b50..45ce3639 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,9 +37,3 @@ repos: language: python exclude: ^(src/main/resources/static/pdfjs|src/main/resources/static/pdfjs-legacy) files: ^.*(\.html|\.css|\.js)$ - - repo: https://github.com/norwoodj/helm-docs - rev: v1.14.2 - hooks: - - id: helm-docs-built - args: - - --chart-search-root=chart diff --git a/README.md b/README.md index d8164c13..40d27dd7 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,10 @@ services: Note: Podman is CLI-compatible with Docker, so simply replace "docker" with "podman". +### Kubernetes + +See the kubernetes helm chart [here](https://github.com/Stirling-Tools/Stirling-PDF-chart) + ## Enable OCR/Compression Feature Please view the [HowToUseOCR.md](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToUseOCR.md). diff --git a/chart/stirling-pdf/Chart.yaml b/chart/stirling-pdf/Chart.yaml deleted file mode 100644 index d99ddaf5..00000000 --- a/chart/stirling-pdf/Chart.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v2 -appVersion: 0.32.0 -description: locally hosted web application that allows you to perform various operations - on PDF files -home: https://github.com/Stirling-Tools/Stirling-PDF -keywords: -- stirling-pdf -- helm -- charts repo -maintainers: -- name: Stirling-Tools - url: https://github.com/Stirling-Tools/Stirling-PDF -name: stirling-pdf-chart -sources: -- https://github.com/Stirling-Tools/Stirling-PDF -version: 1.1.0 diff --git a/chart/stirling-pdf/README.md b/chart/stirling-pdf/README.md deleted file mode 100644 index 7536c6f0..00000000 --- a/chart/stirling-pdf/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# stirling-pdf-chart - -![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![AppVersion: 0.30.1](https://img.shields.io/badge/AppVersion-0.30.1-informational?style=flat-square) - -locally hosted web application that allows you to perform various operations on PDF files - -**Homepage:** - -## Maintainers - -| Name | Email | Url | -| ---- | ------ | --- | -| Stirling-Tools | | | - -## Source Code - -* - -## Chart Repo - -Add the following repo to use the chart: - -```console -helm repo add stirling-pdf https://stirling-tools.github.io/Stirling-PDF -``` - -## Values - -| Key | Type | Default | Description | -|-----|------|---------|-------------| -| affinity | object | `{}` | | -| commonLabels | object | `{}` | Labels to apply to all resources | -| containerSecurityContext | object | `{}` | | -| deployment.annotations | object | `{}` | Stirling-pdf Deployment annotations | -| deployment.extraVolumeMounts | list | `[]` | Additional volumes to mount | -| deployment.extraVolumes | list | `[]` | Additional volumes | -| deployment.labels | object | `{}` | | -| deployment.sidecarContainers | object | `{}` | of the chart's content, send notifications... | -| envs | list | `[]` | | -| extraArgs | list | `[]` | | -| image.pullPolicy | string | `"IfNotPresent"` | | -| image.repository | string | `"frooodle/s-pdf"` | | -| image.tag | string | `nil` | | -| ingress | object | `{"annotations":{},"enabled":false,"hosts":[],"ingressClassName":null,"labels":{},"pathType":"ImplementationSpecific"}` | Ingress for load balancer | -| ingress.annotations | object | `{}` | Stirling-pdf Ingress annotations | -| ingress.hosts | list | `[]` | Must be provided if Ingress is enabled | -| ingress.ingressClassName | string | `nil` | See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress | -| ingress.labels | object | `{}` | Stirling-pdf Ingress labels | -| nodeSelector | object | `{}` | | -| persistence.accessMode | string | `"ReadWriteOnce"` | | -| persistence.enabled | bool | `false` | | -| persistence.labels | object | `{}` | | -| persistence.path | string | `"/tmp"` | | -| persistence.pv | object | `{"accessMode":"ReadWriteOnce","capacity":{"storage":"8Gi"},"enabled":false,"nfs":{"path":null,"server":null},"pvname":null}` | stirling-pdf data Persistent Volume Storage Class If defined, storageClassName: If set to "-", storageClassName: "", which disables dynamic provisioning If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner. (gp2 on AWS, standard on GKE, AWS & OpenStack) storageClass: "-" volumeName: | -| persistence.size | string | `"8Gi"` | | -| podAnnotations | object | `{}` | Read more about kube2iam to provide access to s3 https://github.com/jtblin/kube2iam | -| podLabels | object | `{}` | ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ | -| priorityClassName | string | `""` | | -| probes.liveness.failureThreshold | int | `3` | | -| probes.liveness.initialDelaySeconds | int | `5` | | -| probes.liveness.periodSeconds | int | `10` | | -| probes.liveness.successThreshold | int | `1` | | -| probes.liveness.timeoutSeconds | int | `1` | | -| probes.livenessHttpGetConfig.scheme | string | `"HTTP"` | | -| probes.readiness.failureThreshold | int | `3` | | -| probes.readiness.initialDelaySeconds | int | `5` | | -| probes.readiness.periodSeconds | int | `10` | | -| probes.readiness.successThreshold | int | `1` | | -| probes.readiness.timeoutSeconds | int | `1` | | -| probes.readinessHttpGetConfig.scheme | string | `"HTTP"` | | -| replicaCount | int | `1` | | -| resources | object | `{}` | | -| rootPath | string | `"/"` | Rootpath for the application | -| secret.labels | object | `{}` | | -| securityContext | object | `{"enabled":true,"fsGroup":1000}` | does not allow this, try setting securityContext: {} | -| service.annotations | object | `{}` | | -| service.externalPort | int | `8080` | | -| service.externalTrafficPolicy | string | `"Local"` | | -| service.labels | object | `{}` | | -| service.loadBalancerIP | string | `nil` | Only valid if service.type: LoadBalancer | -| service.loadBalancerSourceRanges | list | `[]` | Only valid if service.type: LoadBalancer | -| service.nodePort | string | `nil` | | -| service.servicename | string | `nil` | | -| service.targetPort | string | `nil` | from deployment above. Leave empty to use stirling-pdf directly. | -| service.type | string | `"ClusterIP"` | | -| serviceAccount.annotations | object | `{}` | | -| serviceAccount.automountServiceAccountToken | bool | `false` | | -| serviceAccount.create | bool | `true` | | -| serviceAccount.name | string | `""` | | -| serviceMonitor.enabled | bool | `false` | | -| serviceMonitor.labels | object | `{}` | | -| serviceMonitor.metricsPath | string | `"/metrics"` | | -| strategy.type | string | `"RollingUpdate"` | | -| tolerations | list | `[]` | | -| volumePermissions | object | `{"image":{"pullPolicy":"Always","registry":"docker.io","repository":"bitnami/minideb","tag":"buster"}}` | volumePermissions: Change the owner of the persistent volume mountpoint to RunAsUser:fsGroup | diff --git a/chart/stirling-pdf/README.md.gotmpl b/chart/stirling-pdf/README.md.gotmpl deleted file mode 100644 index caaddb04..00000000 --- a/chart/stirling-pdf/README.md.gotmpl +++ /dev/null @@ -1,25 +0,0 @@ -{{ template "chart.header" . }} - -{{ template "chart.deprecationWarning" . }} - -{{ template "chart.badgesSection" . }} - -{{ template "chart.description" . }} - -{{ template "chart.homepageLine" . }} - -{{ template "chart.maintainersSection" . }} - -{{ template "chart.sourcesSection" . }} - -{{ template "chart.requirementsSection" . }} - -## Chart Repo - -Add the following repo to use the chart: - -```console -helm repo add stirling-pdf https://docs.stirlingpdf.com/Stirling-PDF/ -``` - -{{ template "chart.valuesSection" . }} diff --git a/chart/stirling-pdf/templates/NOTES.txt b/chart/stirling-pdf/templates/NOTES.txt deleted file mode 100644 index 3b432f00..00000000 --- a/chart/stirling-pdf/templates/NOTES.txt +++ /dev/null @@ -1,30 +0,0 @@ -** Please be patient while the chart is being deployed ** - -Get the stirlingpdf URL by running: - -{{- if contains "NodePort" .Values.service.type }} - - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "stirlingpdf.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT/ - -{{- else if contains "LoadBalancer" .Values.service.type }} - -** Please ensure an external IP is associated to the {{ template "stirlingpdf.fullname" . }} service before proceeding ** -** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "stirlingpdf.fullname" . }} ** - - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "stirlingpdf.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.service.externalPort }}/ - -OR - - export SERVICE_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "stirlingpdf.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].hostname}') - echo http://$SERVICE_HOST:{{ .Values.service.externalPort }}/ - -{{- else if contains "ClusterIP" .Values.service.type }} - - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "stirlingpdf.name" . }}" -l "release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo http://127.0.0.1:8080/ - kubectl port-forward $POD_NAME 8080:8080 --namespace {{ .Release.Namespace }} - -{{- end }} diff --git a/chart/stirling-pdf/templates/_helpers.tpl b/chart/stirling-pdf/templates/_helpers.tpl deleted file mode 100644 index 4c862604..00000000 --- a/chart/stirling-pdf/templates/_helpers.tpl +++ /dev/null @@ -1,129 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "stirlingpdf.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "stirlingpdf.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{- /* -Create chart name and version as used by the chart label. - -It does minimal escaping for use in Kubernetes labels. - -Example output: - -stirlingpdf-0.4.5 -*/ -}} -{{- define "stirlingpdf.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end -}} - -{{/* -Common labels -*/}} -{{- define "stirlingpdf.labels" -}} -helm.sh/chart: {{ include "stirlingpdf.chart" . }} -{{ include "stirlingpdf.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -{{- if .Values.commonLabels}} -{{ toYaml .Values.commonLabels }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "stirlingpdf.selectorLabels" -}} -app.kubernetes.io/name: {{ include "stirlingpdf.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "stirlingpdf.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "stirlingpdf.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} - -{{/* -Return the proper image name to change the volume permissions -*/}} -{{- define "stirlingpdf.volumePermissions.image" -}} -{{- $registryName := .Values.volumePermissions.image.registry -}} -{{- $repositoryName := .Values.volumePermissions.image.repository -}} -{{- $tag := .Values.volumePermissions.image.tag | toString -}} -{{/* -Helm 2.11 supports the assignment of a value to a variable defined in a different scope, -but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. -Also, we can't use a single if because lazy evaluation is not an option -*/}} -{{- if .Values.global }} - {{- if .Values.global.imageRegistry }} - {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} - {{- else -}} - {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} - {{- end -}} -{{- else -}} - {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} -{{- end -}} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names -*/}} -{{- define "stirlingpdf.imagePullSecrets" -}} -{{/* -Helm 2.11 supports the assignment of a value to a variable defined in a different scope, -but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic. -Also, we can not use a single if because lazy evaluation is not an option -*/}} -{{- if .Values.global }} -{{- if .Values.global.imagePullSecrets }} -imagePullSecrets: -{{- range .Values.global.imagePullSecrets }} - - name: {{ . }} -{{- end }} -{{- else if or .Values.image.pullSecrets .Values.volumePermissions.image.pullSecrets }} -imagePullSecrets: -{{- range .Values.image.pullSecrets }} - - name: {{ . }} -{{- end }} -{{- range .Values.volumePermissions.image.pullSecrets }} - - name: {{ . }} -{{- end }} -{{- end -}} -{{- else if or .Values.image.pullSecrets .Values.volumePermissions.image.pullSecrets }} -imagePullSecrets: -{{- range .Values.image.pullSecrets }} - - name: {{ . }} -{{- end }} -{{- range .Values.volumePermissions.image.pullSecrets }} - - name: {{ . }} -{{- end }} -{{- end -}} -{{- end -}} \ No newline at end of file diff --git a/chart/stirling-pdf/templates/deployment.yaml b/chart/stirling-pdf/templates/deployment.yaml deleted file mode 100644 index d91e8097..00000000 --- a/chart/stirling-pdf/templates/deployment.yaml +++ /dev/null @@ -1,131 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "stirlingpdf.fullname" . }} - {{- with .Values.deployment.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} - labels: - {{- include "stirlingpdf.labels" . | nindent 4 }} - {{- if .Values.deployment.labels }} - {{- toYaml .Values.deployment.labels | nindent 4 }} - {{- end }} -spec: - selector: - matchLabels: - {{- include "stirlingpdf.selectorLabels" . | nindent 6 }} - replicas: {{ .Values.replicaCount }} - strategy: -{{ toYaml .Values.strategy | indent 4 }} - revisionHistoryLimit: 10 - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "stirlingpdf.selectorLabels" . | nindent 8 }} - {{- if .Values.podLabels }} - {{- toYaml .Values.podLabels | nindent 8 }} - {{- end }} - spec: - {{- if .Values.priorityClassName }} - priorityClassName: "{{ .Values.priorityClassName }}" - {{- end }} - {{- if .Values.securityContext.enabled }} - securityContext: - fsGroup: {{ .Values.securityContext.fsGroup }} - {{- if .Values.securityContext.runAsNonRoot }} - runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }} - {{- end }} - {{- if .Values.securityContext.supplementalGroups }} - supplementalGroups: {{ .Values.securityContext.supplementalGroups }} - {{- end }} - {{- else if .Values.persistence.enabled }} - initContainers: - - name: volume-permissions - image: {{ template "stirlingpdf.volumePermissions.image" . }} - imagePullPolicy: "{{ .Values.volumePermissions.image.pullPolicy }}" - securityContext: - {{- toYaml .Values.containerSecurityContext | nindent 10 }} - command: ['sh', '-c', 'chown -R {{ .Values.securityContext.fsGroup }}:{{ .Values.securityContext.fsGroup }} {{ .Values.persistence.path }}'] - volumeMounts: - - mountPath: {{ .Values.persistence.path }} - name: storage-volume - {{- end }} -{{- include "stirlingpdf.imagePullSecrets" . | indent 6 }} - containers: - - name: {{ .Chart.Name }} - image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - securityContext: - {{- toYaml .Values.containerSecurityContext | nindent 10 }} - env: - - name: SYSTEM_ROOTURIPATH - value: {{ .Values.rootPath}} -{{- if .Values.envs }} -{{ toYaml .Values.envs | indent 8 }} -{{- end }} -{{- if .Values.extraArgs }} - args: -{{ toYaml .Values.extraArgs | indent 8 }} -{{- end }} - ports: - - name: http - containerPort: 8080 - livenessProbe: - httpGet: - path: {{ .Values.rootPath}} - port: http -{{ toYaml .Values.probes.livenessHttpGetConfig | indent 12 }} -{{ toYaml .Values.probes.liveness | indent 10 }} - readinessProbe: - httpGet: - path: {{ .Values.rootPath}} - port: http -{{ toYaml .Values.probes.readinessHttpGetConfig | indent 12 }} -{{ toYaml .Values.probes.readiness | indent 10 }} - volumeMounts: -{{- if .Values.deployment.extraVolumeMounts }} - {{- toYaml .Values.deployment.extraVolumeMounts | nindent 8 }} -{{- end }} -{{- if .Values.deployment.sidecarContainers }} -{{- range $name, $spec := .Values.deployment.sidecarContainers }} - - name: {{ $name }} -{{- toYaml $spec | nindent 8 }} -{{- end }} -{{- end }} - {{- with .Values.resources }} - resources: -{{ toYaml . | indent 10 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} - {{- if .Values.schedulerName }} - schedulerName: {{ .Values.schedulerName }} - {{- end }} - serviceAccountName: {{ include "stirlingpdf.serviceAccountName" . }} - automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} - volumes: - {{- if .Values.deployment.extraVolumes }} - {{- toYaml .Values.deployment.extraVolumes | nindent 6 }} - {{- end }} - - name: storage-volume - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ .Values.persistence.existingClaim | default (include "stirlingpdf.fullname" .) }} - {{- else }} - emptyDir: {} - {{- end }} diff --git a/chart/stirling-pdf/templates/ingress.yaml b/chart/stirling-pdf/templates/ingress.yaml deleted file mode 100644 index c09fef68..00000000 --- a/chart/stirling-pdf/templates/ingress.yaml +++ /dev/null @@ -1,85 +0,0 @@ -{{- if .Values.ingress.enabled }} -{{- $servicePort := .Values.service.externalPort -}} -{{- $serviceName := include "stirlingpdf.fullname" . -}} -{{- $ingressExtraPaths := .Values.ingress.extraPaths -}} ---- -{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion }} -apiVersion: extensions/v1beta1 -{{- else if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion }} -apiVersion: networking.k8s.io/v1beta1 -{{- else }} -apiVersion: networking.k8s.io/v1 -{{- end }} -kind: Ingress -metadata: - name: {{ include "stirlingpdf.fullname" . }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} - labels: - {{- include "stirlingpdf.labels" . | nindent 4 }} - {{- with .Values.ingress.labels }} - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- with .Values.ingress.ingressClassName }} - ingressClassName: {{ . }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .name }} - http: - paths: - {{- range $ingressExtraPaths }} - - path: {{ default "/" .path | quote }} - backend: - {{- if semverCompare "<1.19-0" $.Capabilities.KubeVersion.GitVersion }} - {{- if $.Values.service.servicename }} - serviceName: {{ $.Values.service.servicename }} - {{- else }} - serviceName: {{ default $serviceName .service }} - {{- end }} - servicePort: {{ default $servicePort .port }} - {{- else }} - service: - {{- if $.Values.service.servicename }} - name: {{ $.Values.service.servicename }} - {{- else }} - name: {{ default $serviceName .service }} - {{- end }} - port: - number: {{ default $servicePort .port }} - pathType: {{ default $.Values.ingress.pathType .pathType }} - {{- end }} - {{- end }} - - path: {{ default "/" .path | quote }} - backend: - {{- if semverCompare "<1.19-0" $.Capabilities.KubeVersion.GitVersion }} - {{- if $.Values.service.servicename }} - serviceName: {{ $.Values.service.servicename }} - {{- else }} - serviceName: {{ default $serviceName .service }} - {{- end }} - servicePort: {{ default $servicePort .servicePort }} - {{- else }} - service: - {{- if $.Values.service.servicename }} - name: {{ $.Values.service.servicename }} - {{- else }} - name: {{ default $serviceName .service }} - {{- end }} - port: - number: {{ default $servicePort .port }} - pathType: {{ $.Values.ingress.pathType }} - {{- end }} - {{- end }} - tls: - {{- range .Values.ingress.hosts }} - {{- if .tls }} - - hosts: - - {{ .name }} - secretName: {{ .tlsSecret }} - {{- end }} - {{- end }} -{{- end -}} diff --git a/chart/stirling-pdf/templates/pv.yaml b/chart/stirling-pdf/templates/pv.yaml deleted file mode 100644 index aa99c6a9..00000000 --- a/chart/stirling-pdf/templates/pv.yaml +++ /dev/null @@ -1,16 +0,0 @@ -{{- if .Values.persistence.pv.enabled -}} -apiVersion: v1 -kind: PersistentVolume -metadata: - name: {{ .Values.persistence.pv.pvname | default (include "stirlingpdf.fullname" .) }} - labels: - {{- include "stirlingpdf.labels" . | nindent 4 }} -spec: - capacity: - storage: {{ .Values.persistence.pv.capacity.storage }} - accessModes: - - {{ .Values.persistence.pv.accessMode | quote }} - nfs: - server: {{ .Values.persistence.pv.nfs.server }} - path: {{ .Values.persistence.pv.nfs.path | quote }} -{{- end }} \ No newline at end of file diff --git a/chart/stirling-pdf/templates/pvc.yaml b/chart/stirling-pdf/templates/pvc.yaml deleted file mode 100644 index f7a21722..00000000 --- a/chart/stirling-pdf/templates/pvc.yaml +++ /dev/null @@ -1,27 +0,0 @@ -{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ include "stirlingpdf.fullname" . }} - labels: - {{- include "stirlingpdf.labels" . | nindent 4 }} - {{- with .Values.persistence.labels }} - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - accessModes: - - {{ .Values.persistence.accessMode | quote }} - resources: - requests: - storage: {{ .Values.persistence.size | quote }} -{{- if .Values.persistence.storageClass }} -{{- if (eq "-" .Values.persistence.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.persistence.storageClass }}" -{{- end }} -{{- if .Values.persistence.volumeName }} - volumeName: "{{ .Values.persistence.volumeName }}" -{{- end }} -{{- end }} -{{- end }} diff --git a/chart/stirling-pdf/templates/service.yaml b/chart/stirling-pdf/templates/service.yaml deleted file mode 100644 index 13ee2420..00000000 --- a/chart/stirling-pdf/templates/service.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.service.servicename | default (include "stirlingpdf.fullname" .) }} - {{- with .Values.service.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} - labels: - {{- include "stirlingpdf.labels" . | nindent 4 }} - {{- with .Values.service.labels }} - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - type: {{ .Values.service.type }} - {{- if (or (eq .Values.service.type "LoadBalancer") (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort)))) }} - externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} - {{- end }} - {{- if (and (eq .Values.service.type "LoadBalancer") .Values.service.loadBalancerIP) }} - loadBalancerIP: {{ .Values.service.loadBalancerIP }} - {{- end }} - {{- if (and (eq .Values.service.type "LoadBalancer") .Values.service.loadBalancerSourceRanges) }} - loadBalancerSourceRanges: - {{- with .Values.service.loadBalancerSourceRanges }} -{{ toYaml . | indent 2 }} - {{- end }} - {{- end }} - {{- if eq .Values.service.type "ClusterIP" }} - {{- if .Values.service.clusterIP }} - clusterIP: {{ .Values.service.clusterIP }} - {{- end }} - {{- end }} - ports: - - port: {{ .Values.service.externalPort }} -{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }} - nodePort: {{.Values.service.nodePort}} -{{- end }} -{{- if .Values.service.targetPort }} - targetPort: {{ .Values.service.targetPort }} - name: {{ .Values.service.targetPort }} -{{- else }} - targetPort: http - name: http -{{- end }} - protocol: TCP - - selector: - {{- include "stirlingpdf.selectorLabels" . | nindent 4 }} diff --git a/chart/stirling-pdf/templates/serviceaccount.yaml b/chart/stirling-pdf/templates/serviceaccount.yaml deleted file mode 100644 index 7156e4a4..00000000 --- a/chart/stirling-pdf/templates/serviceaccount.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if .Values.serviceAccount.create -}} ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "stirlingpdf.serviceAccountName" . }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{ toYaml . | nindent 4 }} - {{- end }} - labels: - {{- include "stirlingpdf.labels" . | nindent 4 }} -{{- end }} diff --git a/chart/stirling-pdf/templates/servicemonitor.yaml b/chart/stirling-pdf/templates/servicemonitor.yaml deleted file mode 100644 index ca0d31bb..00000000 --- a/chart/stirling-pdf/templates/servicemonitor.yaml +++ /dev/null @@ -1,31 +0,0 @@ -{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) ( .Values.serviceMonitor.enabled ) }} -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: {{ include "stirlingpdf.fullname" . }} - namespace: {{ .Values.serviceMonitor.namespace | default .Release.Namespace }} - labels: - {{- include "stirlingpdf.labels" . | nindent 4 }} - {{- with .Values.serviceMonitor.labels }} - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - endpoints: - - targetPort: 8080 -{{- if .Values.serviceMonitor.interval }} - interval: {{ .Values.serviceMonitor.interval }} -{{- end }} -{{- if .Values.serviceMonitor.metricsPath }} - path: {{ .Values.serviceMonitor.metricsPath }} -{{- end }} -{{- if .Values.serviceMonitor.timeout }} - scrapeTimeout: {{ .Values.serviceMonitor.timeout }} -{{- end }} - jobLabel: {{ include "stirlingpdf.fullname" . }} - namespaceSelector: - matchNames: - - {{ .Release.Namespace }} - selector: - matchLabels: - {{- include "stirlingpdf.selectorLabels" . | nindent 6 }} -{{- end }} diff --git a/chart/stirling-pdf/values.yaml b/chart/stirling-pdf/values.yaml deleted file mode 100644 index eec1856e..00000000 --- a/chart/stirling-pdf/values.yaml +++ /dev/null @@ -1,239 +0,0 @@ -extraArgs: - [] - # - --storage-timestamp-tolerance 1s -replicaCount: 1 -strategy: - type: RollingUpdate -image: - repository: frooodle/s-pdf - # took Chart appVersion by default - tag: ~ - pullPolicy: IfNotPresent -secret: - labels: {} -# -- Labels to apply to all resources -commonLabels: {} -# team_name: dev - -# -- Rootpath for the application -rootPath: / - -envs: [] -# - name: UI_APP_NAME -# value: "Stirling PDF" -# - name: UI_HOME_DESCRIPTION -# value: "Your locally hosted one-stop-shop for all your PDF needs." -# - name: UI_APP_NAVBAR_NAME -# value: "Stirling PDF" -# - name: ALLOW_GOOGLE_VISIBILITY -# value: "true" -# - name: APP_LOCALE -# value: "en_GB" - -deployment: - # -- Stirling-pdf Deployment annotations - annotations: {} - # name: value - labels: {} - # name: value - # -- Additional volumes - extraVolumes: [] - # - name: nginx-config - # secret: - # secretName: nginx-config - # -- Additional volumes to mount - extraVolumeMounts: [] - # -- sidecarContainers for the stirling-pdf - # -- Can be used to add a proxy to the pod that does - # -- scanning for secrets, signing, authentication, validation - # -- of the chart's content, send notifications... - sidecarContainers: {} - ## Example sidecarContainer which uses an extraVolume from above and - ## a named port that can be referenced in the service as targetPort. - # proxy: - # image: nginx:latest - # ports: - # - name: proxy - # containerPort: 8081 - # volumeMounts: - # - name: nginx-config - # readOnly: true - # mountPath: /etc/nginx - -# -- Pod annotations -# -- ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ -# -- Read more about kube2iam to provide access to s3 https://github.com/jtblin/kube2iam -podAnnotations: - {} - # iam.amazonaws.com/role: role-arn - -# -- Pod labels -# -- ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ -podLabels: - {} - # name: value - -service: - servicename: - type: ClusterIP - externalTrafficPolicy: Local - # -- Uses pre-assigned IP address from cloud provider - # -- Only valid if service.type: LoadBalancer - loadBalancerIP: - # -- Limits which cidr blocks can connect to service's load balancer - # -- Only valid if service.type: LoadBalancer - loadBalancerSourceRanges: [] - # clusterIP: None - externalPort: 8080 - # -- targetPort of the container to use. If a sidecar should handle the - # -- requests first, use the named port from the sidecar. See sidecar example - # -- from deployment above. Leave empty to use stirling-pdf directly. - targetPort: - nodePort: - annotations: {} - labels: {} - -serviceMonitor: - enabled: false - # namespace: prometheus - labels: {} - metricsPath: "/metrics" - # timeout: 60 - # interval: 60 - -resources: {} -# limits: -# cpu: 100m -# memory: 128Mi -# requests: -# cpu: 80m -# memory: 64Mi - -probes: - liveness: - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 1 - successThreshold: 1 - failureThreshold: 3 - livenessHttpGetConfig: - scheme: HTTP - readiness: - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 1 - successThreshold: 1 - failureThreshold: 3 - readinessHttpGetConfig: - scheme: HTTP - -serviceAccount: - create: true - name: "" - automountServiceAccountToken: false - ## Annotations for the Service Account - annotations: {} - -# -- UID/GID 1000 is the default user "stirling-pdf" used in -# -- the container image starting in v0.8.0 and above. This -# -- is required for local persistent storage. If your cluster -# -- does not allow this, try setting securityContext: {} -securityContext: - enabled: true - fsGroup: 1000 - ## Optionally, specify supplementalGroups and/or - ## runAsNonRoot for security purposes - # runAsNonRoot: true - # supplementalGroups: [1000] - -containerSecurityContext: {} - -priorityClassName: "" - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -persistence: - enabled: false - accessMode: ReadWriteOnce - size: 8Gi - labels: - {} - # name: value - path: /tmp - ## A manually managed Persistent Volume and Claim - ## Requires persistence.enabled: true - ## If defined, PVC must be created manually before volume will be bound - # existingClaim: - - # -- stirling-pdf data Persistent Volume Storage Class - # If defined, storageClassName: - # If set to "-", storageClassName: "", which disables dynamic provisioning - # If undefined (the default) or set to null, no storageClassName spec is - # set, choosing the default provisioner. (gp2 on AWS, standard on - # GKE, AWS & OpenStack) - # storageClass: "-" - # volumeName: - pv: - enabled: false - pvname: - capacity: - storage: 8Gi - accessMode: ReadWriteOnce - nfs: - server: - path: - -# -- Init containers parameters: -# -- volumePermissions: Change the owner of the persistent volume mountpoint to RunAsUser:fsGroup -volumePermissions: - image: - registry: docker.io - repository: bitnami/minideb - tag: buster - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - # pullSecrets: - # - myRegistryKeySecretName - -# -- Ingress for load balancer -ingress: - enabled: false - pathType: "ImplementationSpecific" - # -- Stirling-pdf Ingress labels - labels: - {} - # dns: "route53" - - # -- Stirling-pdf Ingress annotations - annotations: - {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - - # -- Stirling-pdf Ingress hostnames - # -- Must be provided if Ingress is enabled - hosts: - [] - # - name: stirling-pdf.domain1.com - # path: / - # tls: false - # - name: stirling-pdf.domain2.com - # path: / - # - # ## Set this to true in order to enable TLS on the ingress record - # tls: true - # - # ## If TLS is set to true, you must declare what secret will store the key/certificate for TLS - # ## Secrets must be added manually to the namespace - # tlsSecret: stirling-pdf.domain2-tls - - # -- For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName - # -- See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress - ingressClassName: diff --git a/cr.yaml b/cr.yaml deleted file mode 100644 index 7a948c73..00000000 --- a/cr.yaml +++ /dev/null @@ -1,2 +0,0 @@ -skip-existing: true -generate-release-notes: true \ No newline at end of file From 7d1d6d1f1254c897c2dc084df01b04015c1539e1 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Mon, 11 Nov 2024 10:40:27 +0000 Subject: [PATCH 12/34] Update Version-groups.md --- Version-groups.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Version-groups.md b/Version-groups.md index 84bf749d..c6322eb4 100644 --- a/Version-groups.md +++ b/Version-groups.md @@ -54,3 +54,16 @@ The 'Fat' container contains all those found in 'Full' with security jar along w | ocr-pdf | | ✔️ | | pdf-to-pdfa | | ✔️ | | remove-blanks | | ✔️ | +pdf-to-text | ✔️ | ✔️ +pdf-to-html | | ✔️ +pdf-to-word | | ✔️ +pdf-to-presentation | | ✔️ +pdf-to-xml | | ✔️ +remove-annotations | ✔️ | ✔️ +remove-cert-sign | ✔️ | ✔️ +remove-image-pdf | ✔️ | ✔️ +file-to-pdf | | ✔️ +xlsx-to-pdf | | ✔️ +html-to-pdf | | ✔️ +url-to-pdf | | ✔️ +repair | | ✔️ From 128ca8e224bfc2545443430a8f4fa44fb3cdac79 Mon Sep 17 00:00:00 2001 From: Ludy Date: Mon, 11 Nov 2024 12:55:46 +0100 Subject: [PATCH 13/34] Fix: Reading the username based on the login method. (#2211) --- .../software/SPDF/config/security/UserService.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/stirling/software/SPDF/config/security/UserService.java b/src/main/java/stirling/software/SPDF/config/security/UserService.java index a95ee135..4b130d11 100644 --- a/src/main/java/stirling/software/SPDF/config/security/UserService.java +++ b/src/main/java/stirling/software/SPDF/config/security/UserService.java @@ -19,10 +19,12 @@ import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.stereotype.Service; +import lombok.extern.slf4j.Slf4j; import stirling.software.SPDF.config.interfaces.DatabaseBackupInterface; import stirling.software.SPDF.config.security.saml2.CustomSaml2AuthenticatedPrincipal; import stirling.software.SPDF.config.security.session.SessionPersistentRegistry; import stirling.software.SPDF.controller.api.pipeline.UserServiceInterface; +import stirling.software.SPDF.model.ApplicationProperties; import stirling.software.SPDF.model.AuthenticationType; import stirling.software.SPDF.model.Authority; import stirling.software.SPDF.model.Role; @@ -31,6 +33,7 @@ import stirling.software.SPDF.repository.AuthorityRepository; import stirling.software.SPDF.repository.UserRepository; @Service +@Slf4j public class UserService implements UserServiceInterface { @Autowired private UserRepository userRepository; @@ -45,6 +48,8 @@ public class UserService implements UserServiceInterface { @Autowired DatabaseBackupInterface databaseBackupHelper; + @Autowired ApplicationProperties applicationProperties; + // Handle OAUTH2 login and user auto creation. public boolean processOAuth2PostLogin(String username, boolean autoCreateUser) throws IllegalArgumentException, IOException { @@ -354,6 +359,14 @@ public class UserService implements UserServiceInterface { if (principal instanceof UserDetails) { return ((UserDetails) principal).getUsername(); + } else if (principal instanceof OAuth2User) { + return ((OAuth2User) principal) + .getAttribute( + applicationProperties.getSecurity().getOauth2().getUseAsUsername()); + } else if (principal instanceof CustomSaml2AuthenticatedPrincipal) { + return ((CustomSaml2AuthenticatedPrincipal) principal).getName(); + } else if (principal instanceof String) { + return (String) principal; } else { return principal.toString(); } From 361a0c9be80ec93b62564b8307765822b9279e23 Mon Sep 17 00:00:00 2001 From: leo-jmateo <128976497+leo-jmateo@users.noreply.github.com> Date: Mon, 11 Nov 2024 23:38:54 +0100 Subject: [PATCH 14/34] Update messages_ca_CA.properties (#2210) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update messages_ca_CA.properties Partial Catalan Translation Contribution for Stirling PDF Hi, I’ve completed a partial Catalan translation for Stirling PDF, covering all strings up to the Pipeline section. I focused on maintaining consistency in terminology to ensure a smooth user experience in Catalan. * Update messages_ca_CA.properties Update on Catalan Translation Verification – Test 2 Passed Hi [Developer’s Name], I’ve now completed the verification for Test 2 and ensured that all keys in messages_en_GB.properties align with those in messages_ca_CA.properties. The files should now be fully synchronized with no missing or extra keys. I’ll proceed to re-run the tests to confirm everything is in order. Please feel free to review the updated pull request, and let me know if there’s anything further you’d like me to adjust. Thank you for your support! Best regards, --------- Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> --- src/main/resources/messages_ca_CA.properties | 76 ++++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/main/resources/messages_ca_CA.properties b/src/main/resources/messages_ca_CA.properties index 02d1c556..03f75af4 100644 --- a/src/main/resources/messages_ca_CA.properties +++ b/src/main/resources/messages_ca_CA.properties @@ -3,8 +3,8 @@ ########### # the direction that the language is written (ltr = left to right, rtl = right to left) language.direction=ltr -addPageNumbers.fontSize=Font Size -addPageNumbers.fontName=Font Name +addPageNumbers.fontSize=Mida del tipus de lletra +addPageNumbers.fontName=Nom del tipus de lletra pdfPrompt=Selecciona PDF(s) multiPdfPrompt=Selecciona PDFs (2+) multiPdfDropPrompt=Selecciona (o arrossega) els documents PDF @@ -12,17 +12,17 @@ imgPrompt=Selecciona Imatge(s) genericSubmit=Envia processTimeWarning=Alerta: Aquest procés pot tardar 1 minut depenent de la mida de l'arxiu pageOrderPrompt=Ordre de Pàgines (Llista separada per comes) : -pageSelectionPrompt=Custom Page Selection (Enter a comma-separated list of page numbers 1,5,6 or Functions like 2n+1) : +pageSelectionPrompt=Selecció de pàgines personalitzada (Introdueix una llista separada per comes de números de pàgina, 1,5,6 o funcions com 2n+1): goToPage=Anar true=Verdader false=Fals unknown=Desconegut save=Desa -saveToBrowser=Save to Browser +saveToBrowser=Desa al navegador close=Tanca filesSelected=fitxers seleccionats noFavourites=No s'ha afegit cap favorit -downloadComplete=Download Complete +downloadComplete=Descarrega completa bored=Avorrit esperant? alphabet=Alfabet downloadPdf=Descarregueu PDF @@ -46,47 +46,47 @@ red=Vermell green=Verd blue=Blau custom=Personalitzat... -WorkInProgess=Work in progress, May not work or be buggy, Please report any problems! -poweredBy=Powered by -yes=Yes +WorkInProgess=En desenvolupament, pot no funcionar o contenir errors. Si us plau, informa de qualsevol problema! +poweredBy=Impulsat per +yes=Si no=No -changedCredsMessage=Credentials changed! -notAuthenticatedMessage=User not authenticated. -userNotFoundMessage=User not found. -incorrectPasswordMessage=Current password is incorrect. -usernameExistsMessage=New Username already exists. -invalidUsernameMessage=Invalid username, username can only contain letters, numbers and the following special characters @._+- or must be a valid email address. -invalidPasswordMessage=The password must not be empty and must not have spaces at the beginning or end. -confirmPasswordErrorMessage=New Password and Confirm New Password must match. -deleteCurrentUserMessage=Cannot delete currently logged in user. -deleteUsernameExistsMessage=The username does not exist and cannot be deleted. +changedCredsMessage=Credencials canviades! +notAuthenticatedMessage=Usuari no autenticat. +userNotFoundMessage=Usuari no trobat. +incorrectPasswordMessage=La contrasenya actual és incorrecta. +usernameExistsMessage=El nou nom d’usuari ja existeix. +invalidUsernameMessage=Nom d’usuari no vàlid, només pot contenir lletres, números i els següents caràcters especials @._+- o ha de ser una adreça de correu electrònic vàlida. +invalidPasswordMessage=La contrasenya no pot estar buida ni tenir espais al principi o al final. +confirmPasswordErrorMessage=La contrasenya no pot estar buida ni tenir espais al principi o al final. +deleteCurrentUserMessage=No es pot eliminar l’usuari actualment connectat. +deleteUsernameExistsMessage=El nom d’usuari no existeix i no es pot eliminar. downgradeCurrentUserMessage=No es pot reduir la funció de l'usuari actual -disabledCurrentUserMessage=The current user cannot be disabled +disabledCurrentUserMessage=L’usuari actual no pot ser deshabilitat downgradeCurrentUserLongMessage=No es pot baixar la funció de l'usuari actual. Per tant, no es mostrarà l'usuari actual. -userAlreadyExistsOAuthMessage=The user already exists as an OAuth2 user. -userAlreadyExistsWebMessage=The user already exists as an web user. +userAlreadyExistsOAuthMessage=L’usuari ja existeix com a usuari OAuth2. +userAlreadyExistsWebMessage=L’usuari ja existeix com a usuari web. error=Error oops=Oops! -help=Help -goHomepage=Go to Homepage -joinDiscord=Join our Discord server -seeDockerHub=See Docker Hub -visitGithub=Visit Github Repository -donate=Donate +help=Ajuda +goHomepage=Vés a la pàgina principal +joinDiscord=Uneix-te al nostre servidor de Discord +seeDockerHub=Veure Docker Hub +visitGithub=Visita el repositori de GitHub +donate=Fes una donació color=Color -sponsor=Sponsor -info=Info +sponsor=Patrocinador +info=Informació pro=Pro -page=Page -pages=Pages -loading=Loading... -addToDoc=Add to Document +page=Pàgina +pages=Pàgines +loading=Carregant... +addToDoc=Afegeix al document -legal.privacy=Privacy Policy -legal.terms=Terms and Conditions -legal.accessibility=Accessibility -legal.cookie=Cookie Policy -legal.impressum=Impressum +legal.privacy=Política de Privacitat +legal.terms=Termes i condicions +legal.accessibility=Accessibilitat +legal.cookie=Política de galetes +legal.impressum=Avís Legal ############### # Pipeline # From ceabcf2b3df4d0dfeb4250f3badf7d7ee5982b64 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Mon, 11 Nov 2024 23:12:57 +0000 Subject: [PATCH 15/34] Update get-info-on-pdf.html #2212 --- src/main/resources/templates/security/get-info-on-pdf.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/resources/templates/security/get-info-on-pdf.html b/src/main/resources/templates/security/get-info-on-pdf.html index 45c2d9d4..97ddf723 100644 --- a/src/main/resources/templates/security/get-info-on-pdf.html +++ b/src/main/resources/templates/security/get-info-on-pdf.html @@ -30,10 +30,8 @@ + + +