diff --git a/.aikido b/.aikido new file mode 100644 index 000000000..814c5e38b --- /dev/null +++ b/.aikido @@ -0,0 +1,12 @@ +ignore: + cves: + CVE-2026-23949: + reason: python dependency, waiting for upstream release of gotenberg + CVE-2026-24049: + reason: python dependency, waiting for upstream release of gotenberg + CVE-2025-48924: + reason: java dependency, waiting for upstream release of gotenberg + CVE-2025-47914: + reason: Go dependency, waiting for upstream release of gotenberg + CVE-2025-58181: + reason: Go dependency, waiting for upstream release of gotenberg \ No newline at end of file diff --git a/.env b/.env index 993c849f0..db1010749 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ GOTENBERG_VERSION=snapshot -DOCKER_REGISTRY=gotenberg +DOCKER_REGISTRY=ghcr.io/fulll DOCKER_REPOSITORY=gotenberg DOCKERFILE=build/Dockerfile DOCKERFILE_CLOUDRUN=build/Dockerfile.cloudrun diff --git a/.github/actions/build-test-push/action.yml b/.github/actions/build-test-push/action.yml index 5167de4b3..ad048aa75 100644 --- a/.github/actions/build-test-push/action.yml +++ b/.github/actions/build-test-push/action.yml @@ -7,12 +7,12 @@ inputs: description: The GitHub token required: true default: ${{ github.token }} - docker_hub_username: - description: The Docker Hub username - required: true - docker_hub_password: - description: The Docker Hub password - required: true + # docker_hub_username: + # description: The Docker Hub username + # required: true + # docker_hub_password: + # description: The Docker Hub password + # required: true platform: description: linux/amd64, linux/ppc64le, linux/386, linux/arm64, linux/arm/v7 required: true @@ -50,40 +50,50 @@ runs: - name: Check out code uses: actions/checkout@v5 - - name: Log in to Docker Hub - if: inputs.docker_hub_username != '' - uses: docker/login-action@v3 - with: - username: ${{ inputs.docker_hub_username }} - password: ${{ inputs.docker_hub_password }} + # - name: Log in to Docker Hub + # if: inputs.docker_hub_username != '' + # uses: docker/login-action@v3 + # with: + # username: ${{ inputs.docker_hub_username }} + # password: ${{ inputs.docker_hub_password }} - name: Build ${{ inputs.platform }} id: build shell: bash + env: + INPUT_VERSION: ${{ inputs.version }} + INPUT_PLATFORM: ${{ inputs.platform }} + INPUT_ALTERNATE_REPOSITORY: ${{ inputs.alternate_repository }} + INPUT_DRY_RUN: ${{ inputs.dry_run }} run: | .github/actions/build-test-push/build.sh \ - --version "${{ inputs.version }}" \ - --platform "${{ inputs.platform }}" \ - --alternate-repository "${{ inputs.alternate_repository }}" \ - --dry-run "${{ inputs.dry_run }}" + --version "$INPUT_VERSION" \ + --platform "$INPUT_PLATFORM" \ + --alternate-repository "$INPUT_ALTERNATE_REPOSITORY" \ + --dry-run "$INPUT_DRY_RUN" - name: Run integration tests if: inputs.skip_integrations_tests != 'true' shell: bash + env: + INPUT_VERSION: ${{ inputs.version }} + INPUT_PLATFORM: ${{ inputs.platform }} + INPUT_ALTERNATE_REPOSITORY: ${{ inputs.alternate_repository }} + INPUT_DRY_RUN: ${{ inputs.dry_run }} run: | .github/actions/build-test-push/test.sh \ - --version "${{ inputs.version }}" \ - --platform "${{ inputs.platform }}" \ - --alternate-repository "${{ inputs.alternate_repository }}" \ - --dry-run "${{ inputs.dry_run }}" + --version "$INPUT_VERSION" \ + --platform "$INPUT_PLATFORM" \ + --alternate-repository "$INPUT_ALTERNATE_REPOSITORY" \ + --dry-run "$INPUT_DRY_RUN" - - name: Push - if: inputs.docker_hub_username != '' - shell: bash - run: | - .github/actions/build-test-push/push.sh \ - --tags "${{ steps.build.outputs.tags }},${{ steps.build.outputs.tags_cloud_run }},${{ steps.build.outputs.tags_aws_lambda }}" \ - --dry-run "${{ inputs.dry_run }}" + # - name: Push + # if: inputs.docker_hub_username != '' + # shell: bash + # run: | + # .github/actions/build-test-push/push.sh \ + # --tags "${{ steps.build.outputs.tags }},${{ steps.build.outputs.tags_cloud_run }},${{ steps.build.outputs.tags_aws_lambda }}" \ + # --dry-run "${{ inputs.dry_run }}" - name: Outputs shell: bash diff --git a/.github/actions/clean/action.yml b/.github/actions/clean/action.yml index 4dae20bf4..c7f725f11 100644 --- a/.github/actions/clean/action.yml +++ b/.github/actions/clean/action.yml @@ -23,9 +23,12 @@ runs: env: DOCKERHUB_USERNAME: ${{ inputs.docker_hub_username }} DOCKERHUB_TOKEN: ${{ inputs.docker_hub_password }} + INPUT_TAGS: ${{ inputs.tags }} + INPUT_SNAPSHOT_VERSION: ${{ inputs.snapshot_version }} + INPUT_DRY_RUN: ${{ inputs.dry_run }} shell: bash run: | .github/actions/clean/clean.sh \ - --tags "${{ inputs.tags }}" \ - --snapshot-version "${{ inputs.snapshot_version }}" \ - --dry-run "${{ inputs.dry_run }}" + --tags "$INPUT_TAGS" \ + --snapshot-version "$INPUT_SNAPSHOT_VERSION" \ + --dry-run "$INPUT_DRY_RUN" diff --git a/.github/actions/merge/action.yml b/.github/actions/merge/action.yml index 002146793..7824de288 100644 --- a/.github/actions/merge/action.yml +++ b/.github/actions/merge/action.yml @@ -41,8 +41,12 @@ runs: - name: Merge shell: bash + env: + INPUT_TAGS: ${{ inputs.tags }} + INPUT_ALTERNATE_REGISTRY: ${{ inputs.alternate_registry }} + INPUT_DRY_RUN: ${{ inputs.dry_run }} run: | .github/actions/merge/merge.sh \ - --tags "${{ inputs.tags }}" \ - --alternate-registry "${{ inputs.alternate_registry }}" \ - --dry-run "${{ inputs.dry_run }}" + --tags "$INPUT_TAGS" \ + --alternate-registry "$INPUT_ALTERNATE_REGISTRY" \ + --dry-run "$INPUT_DRY_RUN" diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index ad0bf860a..478b52e9c 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -19,132 +19,42 @@ jobs: - name: Checkout source code uses: actions/checkout@v6 + # action modified to onlu build - name: Build and push id: build_push uses: ./.github/actions/build-test-push with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} version: ${{ github.event.release.tag_name }} platform: linux/amd64 skip_integrations_tests: true - release_386: - name: Release linux/386 - runs-on: ubuntu-latest - outputs: - tags: ${{ steps.build_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build and push - id: build_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: ${{ github.event.release.tag_name }} - platform: linux/386 - skip_integrations_tests: true - - release_ppc64le: - name: Release linux/ppc64le - runs-on: ubuntu-24.04-ppc64le - outputs: - tags: ${{ steps.build_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build and push - id: build_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: ${{ github.event.release.tag_name }} - platform: linux/ppc64le - skip_integrations_tests: true - - release_arm64: - name: Release linux/arm64 - runs-on: ubuntu-24.04-arm - outputs: - tags: ${{ steps.build_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build and push - id: build_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: ${{ github.event.release.tag_name }} - platform: linux/arm64 - skip_integrations_tests: true - - release_arm_v7: - name: Release linux/arm/v7 - runs-on: ubuntu-24.04-arm - outputs: - tags: ${{ steps.build_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build and push - id: build_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: ${{ github.event.release.tag_name }} - platform: linux/arm/v7 - skip_integrations_tests: true - - merge_clean_release_tags: - needs: - - release_amd64 - - release_386 - - release_ppc64le - - release_arm64 - - release_arm_v7 - name: Merge and clean release tags - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Merge - uses: ./.github/actions/merge - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - tags: "${{ needs.release_amd64.outputs.tags }},${{ needs.release_386.outputs.tags }},${{ needs.release_ppc64le.outputs.tags }},${{ needs.release_arm64.outputs.tags }},${{ needs.release_arm_v7.outputs.tags }}" - alternate_registry: thecodingmachine - - - name: Merge AWS Lambda - uses: ./.github/actions/merge - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - tags: "${{ needs.release_amd64.outputs.tags_aws_lambda }},${{ needs.release_arm64.outputs.tags_aws_lambda }}" - alternate_registry: thecodingmachine - - - name: Clean - uses: ./.github/actions/clean - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - tags: "${{ needs.release_amd64.outputs.tags }},${{ needs.release_386.outputs.tags }},${{ needs.release_ppc64le.outputs.tags }},${{ needs.release_arm64.outputs.tags }},${{ needs.release_arm_v7.outputs.tags }},${{ needs.release_amd64.outputs.tags_aws_lambda }},${{ needs.release_arm64.outputs.tags_aws_lambda }}" + # list docker images that have bee built + - name: Output built tags to console + run: | + echo "Tags: ${{ steps.build_push.outputs.tags }}" + echo "Cloud Run Tags: ${{ steps.build_push.outputs.tags_cloud_run }}" + echo "AWS Lambda Tags: ${{ steps.build_push.outputs.tags_aws_lambda }}" + + - name: generate aws credentials config + env: + AWS_CREDENTIALS: ${{ secrets.STAGING_AWS_CREDENTIALS }} + aws-region: eu-central-1 + run: | + mkdir -p "${HOME}/.aws" + echo "${AWS_CREDENTIALS}" > "${HOME}/.aws/credentials" + + # Get the image build by the upstream process then : + # - tag it for AWS ECR + # - push it to AWS ECR + - name: docker login and push + run: | + # Extract the tag name and strip the first letter using cut + TAG_NAME=$(echo "${{ github.event.release.tag_name }}" | cut -c 2-) + + docker tag ghcr.io/fulll/gotenberg:latest-cloudrun ${AWS_ECR_REGISTRY}/gotenberg-fulll:${TAG_NAME}-cloudrun + aws --region eu-central-1 ecr get-login-password | docker login --username AWS --password-stdin ${AWS_ECR_REGISTRY} + docker tag ${AWS_ECR_REGISTRY}/gotenberg-fulll:${TAG_NAME}-cloudrun ${AWS_ECR_REGISTRY}/gotenberg-fulll:latest + docker push ${AWS_ECR_REGISTRY}/gotenberg-fulll:${TAG_NAME}-cloudrun + docker push ${AWS_ECR_REGISTRY}/gotenberg-fulll:latest + env: + AWS_ECR_REGISTRY: ${{ secrets.AWS_ECR_REGISTRY }} diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml deleted file mode 100644 index 3118205cc..000000000 --- a/.github/workflows/continuous-integration.yml +++ /dev/null @@ -1,398 +0,0 @@ -name: Continuous Integration - -on: - push: - branches: - - main - pull_request: - branches: - - main - -concurrency: - group: ${{ (github.event_name == 'pull_request' && github.event.pull_request.number) || 'main' }} - cancel-in-progress: true - -permissions: - contents: write - -jobs: - lint: - name: Lint Golang codebase - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Setup Go - uses: actions/setup-go@v6 - with: - go-version-file: go.mod - - - name: Run linters - uses: golangci/golangci-lint-action@v9 - with: - version: v2.10.1 - - lint-prettier: - name: Lint non-Golang codebase - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Setup Node.js - uses: actions/setup-node@v6 - with: - node-version-file: .node-version - - - name: Install Dependencies - run: npm i - - - name: Run linters - run: make lint-prettier - - test-unit: - needs: - - lint - - lint-prettier - name: Run unit tests - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Setup Go - uses: actions/setup-go@v6 - with: - go-version-file: go.mod - - - name: Run tests - run: make test-unit - - snapshot_amd64: - if: github.event_name == 'pull_request' - needs: - - test-unit - name: Snapshot linux/amd64 - runs-on: ubuntu-latest - outputs: - tags: ${{ steps.build_test_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_test_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build, test and push - id: build_test_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: pr-${{ github.event.pull_request.number }} - platform: linux/amd64 - alternate_repository: snapshot - - snapshot_ppc64le: - if: github.event_name == 'pull_request' - needs: - - test-unit - name: Snapshot linux/ppc64le - runs-on: ubuntu-24.04-ppc64le - outputs: - tags: ${{ steps.build_test_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_test_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build, test and push - id: build_test_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: pr-${{ github.event.pull_request.number }} - platform: linux/ppc64le - alternate_repository: snapshot - - snapshot_386: - if: github.event_name == 'pull_request' - needs: - - test-unit - name: Snapshot linux/386 - runs-on: ubuntu-latest - outputs: - tags: ${{ steps.build_test_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_test_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build, test and push - id: build_test_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: pr-${{ github.event.pull_request.number }} - platform: linux/386 - alternate_repository: snapshot - - snapshot_arm64: - if: github.event_name == 'pull_request' - needs: - - test-unit - name: Snapshot linux/arm64 - runs-on: ubuntu-24.04-arm - outputs: - tags: ${{ steps.build_test_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_test_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build, test and push - id: build_test_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: pr-${{ github.event.pull_request.number }} - platform: linux/arm64 - alternate_repository: snapshot - - snapshot_arm_v7: - if: github.event_name == 'pull_request' - needs: - - test-unit - name: Snapshot linux/arm/v7 - runs-on: ubuntu-24.04-arm - outputs: - tags: ${{ steps.build_test_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_test_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build, test and push - id: build_test_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: pr-${{ github.event.pull_request.number }} - platform: linux/arm/v7 - alternate_repository: snapshot - - merge_clean_snapshot_guard: - needs: - - snapshot_amd64 - - snapshot_386 - - snapshot_ppc64le - - snapshot_arm64 - - snapshot_arm_v7 - name: Secrets access check - runs-on: ubuntu-latest - outputs: - continue: ${{ steps.check.outputs.continue }} - steps: - - name: Check - id: check - run: | - if [ -n "${{ secrets.DOCKERHUB_USERNAME }}" ]; then - echo "continue=true" >> "$GITHUB_OUTPUT" - else - echo "continue=false" >> "$GITHUB_OUTPUT" - fi - - merge_clean_snapshot_tags: - if: needs.merge_clean_snapshot_guard.outputs.continue == 'true' - needs: - - merge_clean_snapshot_guard - - snapshot_amd64 - - snapshot_386 - - snapshot_ppc64le - - snapshot_arm64 - - snapshot_arm_v7 - name: Merge and clean snapshot tags - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Merge - uses: ./.github/actions/merge - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - tags: "${{ needs.snapshot_amd64.outputs.tags }},${{ needs.snapshot_386.outputs.tags }},${{ needs.snapshot_ppc64le.outputs.tags }},${{ needs.snapshot_arm64.outputs.tags }},${{ needs.snapshot_arm_v7.outputs.tags }}" - - - name: Merge AWS Lambda - uses: ./.github/actions/merge - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - tags: "${{ needs.snapshot_amd64.outputs.tags_aws_lambda }},${{ needs.snapshot_arm64.outputs.tags_aws_lambda }}" - - - name: Clean - uses: ./.github/actions/clean - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - tags: "${{ needs.snapshot_amd64.outputs.tags }},${{ needs.snapshot_386.outputs.tags }},${{ needs.snapshot_ppc64le.outputs.tags }},${{ needs.snapshot_arm64.outputs.tags }},${{ needs.snapshot_arm_v7.outputs.tags }},${{ needs.snapshot_amd64.outputs.tags_aws_lambda }},${{ needs.snapshot_arm64.outputs.tags_aws_lambda }}" - - edge_amd64: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - needs: - - test-unit - name: Edge linux/amd64 - runs-on: ubuntu-latest - outputs: - tags: ${{ steps.build_test_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_test_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build, test and push - id: build_test_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: edge - platform: linux/amd64 - - edge_386: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - needs: - - test-unit - name: Edge linux/386 - runs-on: ubuntu-latest - outputs: - tags: ${{ steps.build_test_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_test_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build, test and push - id: build_test_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: edge - platform: linux/386 - - edge_ppc64le: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - needs: - - test-unit - name: Edge linux/ppc64le - runs-on: ubuntu-24.04-ppc64le - outputs: - tags: ${{ steps.build_test_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_test_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build, test and push - id: build_test_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: edge - platform: linux/ppc64le - - edge_arm64: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - needs: - - test-unit - name: Edge linux/arm64 - runs-on: ubuntu-24.04-arm - outputs: - tags: ${{ steps.build_test_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_test_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build, test and push - id: build_test_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: edge - platform: linux/arm64 - - edge_arm_v7: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - needs: - - test-unit - name: Edge linux/arm/v7 - runs-on: ubuntu-24.04-arm - outputs: - tags: ${{ steps.build_test_push.outputs.tags }} - tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} - tags_aws_lambda: ${{ steps.build_test_push.outputs.tags_aws_lambda }} - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Build, test and push - id: build_test_push - uses: ./.github/actions/build-test-push - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - version: edge - platform: linux/arm/v7 - - merge_clean_edge_tags: - needs: - - edge_amd64 - - edge_386 - - edge_ppc64le - - edge_arm64 - - edge_arm_v7 - name: Merge and clean edge tags - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v6 - - - name: Merge - uses: ./.github/actions/merge - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - tags: "${{ needs.edge_amd64.outputs.tags }},${{ needs.edge_386.outputs.tags }},${{ needs.edge_ppc64le.outputs.tags }},${{ needs.edge_arm64.outputs.tags }},${{ needs.edge_arm_v7.outputs.tags }}" - alternate_registry: thecodingmachine - - - name: Merge AWS Lambda - uses: ./.github/actions/merge - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - tags: "${{ needs.edge_amd64.outputs.tags_aws_lambda }},${{ needs.edge_arm64.outputs.tags_aws_lambda }}" - alternate_registry: thecodingmachine - - - name: Clean - uses: ./.github/actions/clean - with: - docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }} - docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }} - tags: "${{ needs.edge_amd64.outputs.tags }},${{ needs.edge_386.outputs.tags }},${{ needs.edge_ppc64le.outputs.tags }},${{ needs.edge_arm64.outputs.tags }},${{ needs.edge_arm_v7.outputs.tags }},${{ needs.edge_amd64.outputs.tags_aws_lambda }},${{ needs.edge_arm64.outputs.tags_aws_lambda }}" diff --git a/FEATURE_SPECIFICATION.md b/FEATURE_SPECIFICATION.md new file mode 100644 index 000000000..4d28e2c9c --- /dev/null +++ b/FEATURE_SPECIFICATION.md @@ -0,0 +1,765 @@ +# Feature Implementation Specification: PDF Bookmarks Import + +## Overview +This document specifies the changes implemented to add PDF bookmark import functionality to Gotenberg using the pdfcpu library. The feature allows users to provide bookmark data when converting HTML/Markdown to PDF via the Chromium module, which are then imported into the generated PDF using pdfcpu. + +## Core Feature: PDF Bookmarks Import + +### 1. PDF Engine Interface Extension + +**File**: `pkg/gotenberg/pdfengine.go` + +**Change**: Add a new method to the `PdfEngine` interface: + +```go +// ImportBookmarks imports bookmarks from a JSON file into a given PDF. +ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error +``` + +**Parameters**: +- `inputPath`: Path to the source PDF file +- `inputBookmarksPath`: Path to the JSON file containing bookmark data (in pdfcpu format) +- `outputPath`: Path where the PDF with imported bookmarks will be saved + +--- + +### 2. PdfCpu Implementation + +**File**: `pkg/modules/pdfcpu/pdfcpu.go` + +**Changes**: + +1. **Update module documentation** (`doc.go`): + - Add "2. Import bookmarks in a PDF file." to the list of capabilities + +2. **Implement `ImportBookmarks` method**: + +```go +func (engine *PdfCpu) ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error { + if inputBookmarksPath == "" { + return nil + } + + var args []string + args = append(args, "bookmarks", "import", inputPath, inputBookmarksPath, outputPath) + + cmd, err := gotenberg.CommandContext(ctx, logger, engine.binPath, args...) + if err != nil { + return fmt.Errorf("create command: %w", err) + } + + _, err = cmd.Exec() + if err == nil { + return nil + } + + return fmt.Errorf("ImportBookmarks PDFs with pdfcpu: %w", err) +} +``` + +**Logic**: +- If no bookmarks path provided, return nil (no-op) +- Execute pdfcpu command: `pdfcpu bookmarks import ` +- Handle errors appropriately + +--- + +### 3. Stub Implementations for Other PDF Engines + +Add `ImportBookmarks` methods returning `gotenberg.ErrPdfEngineMethodNotSupported` error to: + +**Files**: +- `pkg/modules/exiftool/exiftool.go` +- `pkg/modules/libreoffice/pdfengine/pdfengine.go` +- `pkg/modules/pdftk/pdftk.go` +- `pkg/modules/qpdf/qpdf.go` + +**Implementation** (same for all): + +```go +func (engine *[EngineName]) ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error { + return fmt.Errorf("import bookmarks into PDF with [EngineName]: %w", gotenberg.ErrPdfEngineMethodNotSupported) +} +``` + +--- + +### 4. Mock Update + +**File**: `pkg/gotenberg/mocks.go` + +**Changes**: + +1. Add `ImportBookmarksMock` field to `PdfEngineMock` struct: + +```go +type PdfEngineMock struct { + MergeMock func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error + ConvertMock func(ctx context.Context, logger *zap.Logger, formats PdfFormats, inputPath, outputPath string) error + ReadMetadataMock func(ctx context.Context, logger *zap.Logger, inputPath string) (map[string]interface{}, error) + WriteMetadataMock func(ctx context.Context, logger *zap.Logger, metadata map[string]interface{}, inputPath string) error + ImportBookmarksMock func(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error +} +``` + +2. Implement the mock method: + +```go +func (engine *PdfEngineMock) ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error { + return engine.ImportBookmarksMock(ctx, logger, inputPath, inputBookmarksPath, outputPath) +} +``` + +--- + +### 5. Multi PDF Engines Support + +**File**: `pkg/modules/pdfengines/multi.go` + +**Changes**: + +1. Add `importBookmarksEngines` field to `multiPdfEngines` struct: + +```go +type multiPdfEngines struct { + mergeEngines []gotenberg.PdfEngine + convertEngines []gotenberg.PdfEngine + readMedataEngines []gotenberg.PdfEngine + writeMedataEngines []gotenberg.PdfEngine + importBookmarksEngines []gotenberg.PdfEngine +} +``` + +2. Update constructor `newMultiPdfEngines` to accept the new parameter + +3. Implement `ImportBookmarks` method with concurrent engine execution pattern (similar to other methods): + +```go +func (multi *multiPdfEngines) ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error { + var err error + errChan := make(chan error, 1) + + for _, engine := range multi.importBookmarksEngines { + go func(engine gotenberg.PdfEngine) { + errChan <- engine.ImportBookmarks(ctx, logger, inputPath, inputBookmarksPath, outputPath) + }(engine) + + select { + case mergeErr := <-errChan: + errored := multierr.AppendInto(&err, mergeErr) + if !errored { + return nil + } + case <-ctx.Done(): + return ctx.Err() + } + } + + return fmt.Errorf("import bookmarks into PDF with multi PDF engines: %w", err) +} +``` + +**Note**: The logic tries engines in order until one succeeds or all fail. + +--- + +### 6. PDF Engines Module Configuration + +**File**: `pkg/modules/pdfengines/pdfengines.go` + +**Changes**: + +1. Add `importBookmarksNames` field to `PdfEngines` struct: + +```go +type PdfEngines struct { + mergeNames []string + convertNames []string + readMetadataNames []string + writeMedataNames []string + importBookmarksNames []string + engines []gotenberg.PdfEngine + disableRoutes bool +} +``` + +2. Add flag in `Descriptor()` method: + +```go +fs.StringSlice("pdfengines-import-bookmarks-engines", []string{"pdfcpu"}, "Set the PDF engines and their order for the import bookmarks feature - empty means all") +``` + +**Default**: `["pdfcpu"]` + +3. Update `Provision()` to read and assign the flag: + +```go +importBookmarksNames := flags.MustStringSlice("pdfengines-import-bookmarks-engines") +// ... later in the method +mod.importBookmarksNames = defaultNames +if len(importBookmarksNames) > 0 { + mod.importBookmarksNames = importBookmarksNames +} +``` + +4. Add validation in `Validate()`: + +```go +findNonExistingEngines(mod.importBookmarksNames) +``` + +5. Add system message in `SystemMessages()`: + +```go +fmt.Sprintf("import bookmarks engines - %s", strings.Join(mod.importBookmarksNames[:], " ")) +``` + +6. Update `PdfEngine()` method to pass import bookmarks engines to constructor: + +```go +return newMultiPdfEngines( + engines(mod.mergeNames), + engines(mod.convertNames), + engines(mod.readMetadataNames), + engines(mod.writeMedataNames), + engines(mod.importBookmarksNames), +), nil +``` + +--- + +### 7. PDF Engines Routes Helper + +**File**: `pkg/modules/pdfengines/routes.go` + +**Add**: New stub function `ImportBookmarksStub`: + +```go +func ImportBookmarksStub(ctx *api.Context, engine gotenberg.PdfEngine, inputPath string, inputBookmarks []byte, outputPath string) (string, error) { + if len(inputBookmarks) == 0 { + fmt.Println("ImportBookmarksStub BM empty") + return inputPath, nil + } + + inputBookmarksPath := ctx.GeneratePath(".json") + err := os.WriteFile(inputBookmarksPath, inputBookmarks, 0o600) + if err != nil { + return "", fmt.Errorf("write file %v: %w", inputBookmarksPath, err) + } + err = engine.ImportBookmarks(ctx, ctx.Log(), inputPath, inputBookmarksPath, outputPath) + if err != nil { + return "", fmt.Errorf("import bookmarks %v: %w", inputPath, err) + } + + return outputPath, nil +} +``` + +**Logic**: +- Takes bookmark data as JSON bytes +- If empty, returns input path unchanged +- Creates temporary JSON file with bookmark data +- Calls engine's ImportBookmarks method +- Returns output path on success + +**Note**: Need to import "os" package. + +--- + +### 8. Chromium Module Integration + +**File**: `pkg/modules/chromium/chromium.go` + +**Changes**: + +1. Import pdfcpu package: + ```go + import "github.com/pdfcpu/pdfcpu/pkg/pdfcpu" + ``` + +2. Add `Bookmarks` field to `PdfOptions` struct: + +```go +type PdfOptions struct { + // ... existing fields ... + + // Bookmarks to be inserted unmarshaled + // as defined in pdfcpu bookmarks export + Bookmarks pdfcpu.BookmarkTree + + // ... remaining fields ... +} +``` + +3. Update `DefaultPdfOptions()` to initialize bookmarks: + +```go +func DefaultPdfOptions() PdfOptions { + return PdfOptions{ + // ... existing fields ... + Bookmarks: pdfcpu.BookmarkTree{}, + // ... remaining fields ... + } +} +``` + +--- + +**File**: `pkg/modules/chromium/routes.go` + +**Changes**: + +1. Import required packages: + ```go + import "github.com/pdfcpu/pdfcpu/pkg/pdfcpu" + ``` + +2. In `FormDataChromiumPdfOptions` function, add bookmark parsing: + + a. Add variable declaration: + ```go + var ( + // ... existing variables ... + bookmarks pdfcpu.BookmarkTree + ) + ``` + + b. Add custom form field handler: + ```go + Custom("bookmarks", func(value string) error { + if len(value) > 0 { + err := json.Unmarshal([]byte(value), &bookmarks) + if err != nil { + return fmt.Errorf("unmarshal bookmarks: %w", err) + } + } else { + bookmarks = defaultPdfOptions.Bookmarks + } + return nil + }) + ``` + + c. Include in returned options: + ```go + return formData, PdfOptions{ + // ... existing fields ... + Bookmarks: bookmarks, + // ... remaining fields ... + } + ``` + +3. In `convertUrl` function (after PDF generation, before conversion), add bookmark import logic: + +```go +if options.GenerateDocumentOutline { + if len(options.Bookmarks.Bookmarks) > 0 { + bookmarks, errMarshal := json.Marshal(options.Bookmarks) + outputBMPath := ctx.GeneratePath(".pdf") + + if errMarshal == nil { + outputPath, err = pdfengines.ImportBookmarksStub(ctx, engine, outputPath, bookmarks, outputBMPath) + if err != nil { + return fmt.Errorf("import bookmarks into PDF err: %w", err) + } + } else { + return fmt.Errorf("import bookmarks into PDF errMarshal : %w", errMarshal) + } + } +} +``` + +**Logic**: +- Only process bookmarks if `GenerateDocumentOutline` is true and bookmarks exist +- Marshal the bookmarks back to JSON +- Generate output path for PDF with bookmarks +- Call `ImportBookmarksStub` helper +- Update `outputPath` to the new path with bookmarks +- This happens **before** the `pdfengines.ConvertStub` call + +--- + +### 9. Test Updates + +**File**: `pkg/modules/pdfengines/multi_test.go` + +**Changes**: Add `nil` parameter to all `newMultiPdfEngines` calls in tests (for import bookmarks engines). + +Example: +```go +newMultiPdfEngines( + // ... existing parameters ... + nil, // import bookmarks engines +) +``` + +**Locations**: All test cases in `TestMultiPdfEngines_*` functions. + +--- + +**File**: `pkg/modules/pdfengines/pdfengines_test.go` + +**Changes**: + +1. Add `importBookmarksNames` field initialization in test structs: + +```go +mod := PdfEngines{ + mergeNames: []string{"foo", "bar"}, + convertNames: []string{"foo", "bar"}, + readMetadataNames: []string{"foo", "bar"}, + writeMedataNames: []string{"foo", "bar"}, + importBookmarksNames: []string{"foo", "bar"}, + engines: // ... +} +``` + +2. Update expected message count in `TestPdfEngines_SystemMessages`: + - Change from `4` to `5` messages + +3. Add expected message for import bookmarks: + +```go +expectedMessages := []string{ + // ... existing messages ... + fmt.Sprintf("import bookmarks engines - %s", strings.Join(mod.importBookmarksNames[:], " ")), +} +``` + +**Note**: Some test cases may have commented out assertions for `expectedImportBookmarksPdfEngines` - these should be implemented or left as TODOs based on project conventions. + +--- + +## Dependencies + +### Go Module Updates + +**File**: `go.mod` + +**Changes**: + +1. Add pdfcpu dependency in require block: + +```go +require ( + github.com/dlclark/regexp2 v1.11.4 + github.com/pdfcpu/pdfcpu v0.9.1 +) +``` + +2. Add indirect dependencies: + +```go +require ( + // ... existing ... + github.com/hhrutter/lzw v1.0.0 // indirect + github.com/hhrutter/tiff v1.0.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + golang.org/x/image v0.21.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect +) +``` + +**File**: `go.sum` + +Updated with checksums for all new dependencies and their transitive dependencies. + +--- + +## Build and Deployment Changes + +### 1. Dockerfile + +**File**: `build/Dockerfile` + +**Changes**: Add support for pinning Chrome version via build argument: + +1. Add build argument: + ```dockerfile + ARG CHROME_VERSION + ``` + +2. Modify Chrome installation logic (line ~152) to support conditional installation: + +```dockerfile +RUN \ + /bin/bash -c \ + 'set -e &&\ + if [[ "$(dpkg --print-architecture)" == "amd64" ]]; then \ + apt-get update -qq &&\ + if [ -z "$CHROME_VERSION" ]; then \ + # Install latest stable version + curl https://dl.google.com/linux/linux_signing_key.pub | apt-key add - &&\ + echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list &&\ + apt-get update -qq &&\ + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends --allow-unauthenticated google-chrome-stable &&\ + mv /usr/bin/google-chrome-stable /usr/bin/chromium; \ + else \ + # Install specific version + apt-get update -qq &&\ + curl --output /tmp/chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb" &&\ + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends /tmp/chrome.deb &&\ + mv /usr/bin/google-chrome-stable /usr/bin/chromium &&\ + rm -rf /tmp/chrome.deb; \ + fi \ + elif [[ "$(dpkg --print-architecture)" == "armhf" ]]; then \ + # ... existing armhf logic unchanged ... +``` + +**Logic**: +- If `CHROME_VERSION` is empty/unset: install latest stable version (original behavior) +- If `CHROME_VERSION` is set: download and install specific .deb file from Google's repository + +--- + +### 2. Makefile + +**File**: `Makefile` + +**Changes**: + +1. Update default Docker registry: + ```makefile + DOCKER_REGISTRY=ghcr.io/fulll + ``` + (was: `DOCKER_REGISTRY=gotenberg`) + +2. Add `CHROME_VERSION` build argument to `build` target: + +```makefile +build: + # ... existing arguments ... + --build-arg CHROME_VERSION=$(CHROME_VERSION) \ + # ... rest of command ... +``` + +3. Add `CHROME_VERSION` to `build-tests` target: + +```makefile +build-tests: + # ... existing arguments ... + --build-arg CHROME_VERSION=$(CHROME_VERSION) \ + # ... rest of command ... +``` + +4. Add `CHROME_VERSION` parameter to `release` target: + +```makefile +release: + $(PDFCPU_VERSION) \ + $(DOCKER_REGISTRY) \ + $(DOCKER_REPOSITORY) \ + $(LINUX_AMD64_RELEASE) \ + $(CHROME_VERSION) # Add as 11th parameter +``` + +--- + +### 3. Release Script + +**File**: `scripts/release.sh` + +**Changes**: + +1. Add `CHROME_VERSION` parameter (11th argument): + ```bash + CHROME_VERSION="${11}" + ``` + +2. Remove multi-arch platform flag logic, force Linux AMD64 only: + ```bash + # Replace conditional logic with: + PLATFORM_FLAG="--platform linux/amd64" + ``` + (Note: Original had conditional for AMD64 only vs multi-arch) + +3. Add `CHROME_VERSION` build argument to docker buildx command: + +```bash +docker buildx build \ + # ... existing arguments ... + --build-arg CHROME_VERSION="$CHROME_VERSION" \ + # ... rest of command ... +``` + +--- + +### 4. GitHub Actions CI/CD + +**File**: `.github/workflows/continuous_delivery.yml` + +**Changes**: + +1. Update Docker registry from Docker Hub to GitHub Container Registry: + +```yaml +- name: Log in to Docker Hub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} +``` + +2. Add Chrome version and release flag to build step: + +```yaml +- name: Build and push Docker image for release + env: + LINUX_AMD64_RELEASE: "true" + run: | + make release CHROME_VERSION=127.0.6533.119-1 GOTENBERG_VERSION=${{ github.event.release.tag_name }} DOCKER_REGISTRY=ghcr.io/fulll DOCKER_REPOSITORY=gotenberg +``` + +**Specifics**: +- `CHROME_VERSION=127.0.6533.119-1` (pinned version) +- `LINUX_AMD64_RELEASE="true"` +- Registry: `ghcr.io/fulll` +- Repository: `gotenberg` + +3. Add AWS ECR deployment steps: + +```yaml +- name: generate aws credentials config + env: + AWS_CREDENTIALS: ${{ secrets.STAGING_AWS_CREDENTIALS }} + aws-region: eu-central-1 + run: | + mkdir -p "${HOME}/.aws" + echo "${AWS_CREDENTIALS}" > "${HOME}/.aws/credentials" + +- name: docker login and push + run: | + # Extract tag name and strip first letter + TAG_NAME=$(echo "${{ github.event.release.tag_name }}" | cut -c 2-) + + docker pull ghcr.io/fulll/gotenberg:${TAG_NAME}-cloudrun + docker tag ghcr.io/fulll/gotenberg:${TAG_NAME}-cloudrun ${AWS_ECR_REGISTRY}/gotenberg-fulll:${TAG_NAME}-cloudrun + aws --region eu-central-1 ecr get-login-password | docker login --username AWS --password-stdin ${AWS_ECR_REGISTRY} + docker tag ${AWS_ECR_REGISTRY}/gotenberg-fulll:${TAG_NAME}-cloudrun ${AWS_ECR_REGISTRY}/gotenberg-fulll:latest + docker push ${AWS_ECR_REGISTRY}/gotenberg-fulll:${TAG_NAME}-cloudrun + docker push ${AWS_ECR_REGISTRY}/gotenberg-fulll:latest +``` + +**Logic**: +- Setup AWS credentials from secrets +- Extract release tag (remove 'v' prefix) +- Pull cloudrun variant from GitHub Container Registry +- Tag for AWS ECR (both versioned and latest) +- Push to ECR in eu-central-1 region + +**ECR Details**: +- Account ID: `private_from_secret` +- Region: `eu-central-1` +- Repository: `gotenberg-fulll` + +--- + +## API Usage + +### Request Parameters + +Users can now provide bookmarks when converting HTML/Markdown to PDF via Chromium routes: + +**Form Field**: `bookmarks` (string, JSON format) + +**Format**: JSON string matching pdfcpu BookmarkTree structure + +**Example**: +```json +{ + "Bookmarks": [ + { + "Title": "Chapter 1", + "PageFrom": 1, + "PageThru": -1, + "Kids": [ + { + "Title": "Section 1.1", + "PageFrom": 2, + "PageThru": -1 + } + ] + } + ] +} +``` + +**Behavior**: +- Bookmarks are only imported if `generateDocumentOutline` is `true` +- If bookmarks field is empty/missing, no bookmarks are added +- Invalid JSON returns error to user + +--- + +## Implementation Notes and Clarifications + +1. **Test Coverage**: + - In `pdfengines_test.go`, the commented-out assertions for `expectedImportBookmarksPdfEngines` are intentional + - No additional test implementation is required beyond what's shown + - Keep the commented code as-is + +2. **Debug Logging**: + - The `ImportBookmarksStub` function includes: `fmt.Println("ImportBookmarksStub BM empty")` + - **Keep this logging statement** - it's intentional for debugging purposes + +3. **Bookmark Validation**: + - No additional validation of bookmark structure is needed beyond JSON unmarshaling + - pdfcpu handles its own validation + - Keep the current simple approach + +4. **Implementation Approach**: + - The current approach (marshal to JSON → write temp file → call pdfcpu CLI) is intentional + - **Keep this approach** - do not refactor to use pdfcpu's Go API directly + - This maintains consistency with how other PDF operations are handled + +5. **Multi-Architecture Support**: + - **Linux AMD64 only** is intentional and required + - The project is customized for specific deployment needs + - Do not attempt to restore multi-arch support + +6. **AWS ECR Deployment**: + - AWS ECR push steps are **required and must be kept** + - This is for the project's specific deployment pipeline + - All AWS-related configuration should be preserved as-is + +7. **Chrome Version Pinning**: + - Chrome version **must be pinned** to a specific version for reproducible builds + - This allows control over Chrome updates in case new versions introduce breaking changes + - When reimplementing, update to the latest available stable Chrome version at that time, but keep it fixed (not "latest") + - Example: If current version is `127.0.6533.119-1`, find the latest stable version and pin to that specific version number + - Check https://dl.google.com/linux/chrome/deb/dists/stable/main/binary-amd64/Packages for available versions + +--- + +## Implementation Checklist + +When reimplementing on a newer version: + +- [ ] Add pdfcpu dependency to go.mod +- [ ] Extend PdfEngine interface with ImportBookmarks method +- [ ] Implement ImportBookmarks in pdfcpu module +- [ ] Add stub implementations in other PDF engines +- [ ] Update mock implementations +- [ ] Add multi-engine support for import bookmarks +- [ ] Add configuration flag for import bookmarks engines +- [ ] Update PdfEngines module to handle import bookmarks +- [ ] Add ImportBookmarksStub helper function +- [ ] Add Bookmarks field to Chromium PdfOptions +- [ ] Add bookmarks form field parsing in Chromium routes +- [ ] Integrate bookmark import in convertUrl function +- [ ] Update all test files with new parameters +- [ ] Add Chrome version build argument to Dockerfile +- [ ] Update Makefile with CHROME_VERSION support +- [ ] Update release script +- [ ] (Optional) Update CI/CD for specific deployment needs +- [ ] Test bookmark import with sample pdfcpu bookmark JSON +- [ ] Verify all PDF engines return appropriate errors +- [ ] Validate multi-engine fallback behavior + +--- + +## References + +- pdfcpu documentation: https://github.com/pdfcpu/pdfcpu +- pdfcpu bookmark format: See pdfcpu CLI documentation for `bookmarks export` command output format +- Original commit: `67c02e41cc185765ca4775a82556d55aaf882e8f` diff --git a/Makefile b/Makefile index 73d9d57f2..314b2cf0a 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ help: ## Show the help build: ## Build the Gotenberg's Docker image docker build \ -t $(DOCKER_REGISTRY)/$(DOCKER_REPOSITORY):$(GOTENBERG_VERSION) \ + -t gotenberg/gotenberg:snapshot \ -f $(DOCKERFILE) $(DOCKER_BUILD_CONTEXT) TZ=UTC diff --git a/build/Dockerfile b/build/Dockerfile index 5ce278da0..3c240b65a 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,7 +1,8 @@ # ARG instructions do not create additional layers. Instead, next layers will # concatenate them. Also, we have to repeat ARG instructions in each build # stage that uses them. -ARG GOLANG_VERSION=1.26.0 +ARG GOLANG_VERSION=1.26.1 +ARG CHROME_VERSION=146.0.7680.164-1 # ---------------------------------------------- # pdfcpu binary build stage @@ -55,7 +56,10 @@ RUN go build -o gotenberg -ldflags "-s -w -X 'github.com/gotenberg/gotenberg/v8/ # Custom JRE stage # Credits: https://github.com/jodconverter/docker-image-jodconverter-runtime # ---------------------------------------------- -FROM debian:13-slim AS custom-jre-stage +FROM debian:13-slim@sha256:1d3c811171a08a5adaa4a163fbafd96b61b87aa871bbc7aa15431ac275d3d430 AS custom-jre-stage + +# Setting DOCKERFILE_DATE forces a build cache refresh for the package upgrades +ENV DOCKERFILE_DATE=2026-03-16 RUN \ apt-get update -qq &&\ @@ -77,7 +81,7 @@ RUN jlink \ # ---------------------------------------------- # Base image stage # ---------------------------------------------- -FROM debian:13-slim AS base-image-stage +FROM debian:13-slim@sha256:1d3c811171a08a5adaa4a163fbafd96b61b87aa871bbc7aa15431ac275d3d430 AS base-image-stage ARG TIMEZONE=UTC ENV TZ=$TIMEZONE @@ -94,6 +98,7 @@ FROM base-image-stage ARG GOTENBERG_VERSION=snapshot ARG GOTENBERG_USER_GID=1001 ARG GOTENBERG_USER_UID=1001 +ARG CHROME_VERSION # See https://github.com/googlefonts/noto-emoji/releases. ARG NOTO_COLOR_EMOJI_VERSION=v2.051 # See https://gitlab.com/pdftk-java/pdftk/-/releases - Binary package. @@ -106,6 +111,9 @@ LABEL org.opencontainers.image.title="Gotenberg" \ org.opencontainers.image.documentation="https://gotenberg.dev" \ org.opencontainers.image.source="https://github.com/gotenberg/gotenberg" +# Setting DOCKERFILE_DATE forces a build cache refresh for the package upgrades +ENV DOCKERFILE_DATE=2026-03-16 + RUN \ # Create a non-root user. # All processes in the Docker container will run with this dedicated user. @@ -194,9 +202,30 @@ RUN \ RUN \ # Install Chromium. - apt-get update -qq &&\ - apt-get upgrade -yqq &&\ - DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends chromium &&\ + /bin/bash -c \ + 'set -e &&\ + if [[ "$(dpkg --print-architecture)" == "amd64" ]]; then \ + apt-get update -qq &&\ + if [ -z "$CHROME_VERSION" ]; then \ + # Install latest stable version (use gpg dearmor instead of apt-key) + curl -fsSL https://dl.google.com/linux/linux_signing_key.pub -o /usr/share/keyrings/google-linux-signing-keyring.gpg &&\ + echo "deb [signed-by=/usr/share/keyrings/google-linux-signing-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list &&\ + apt-get update -qq &&\ + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends --allow-unauthenticated google-chrome-stable &&\ + mv /usr/bin/google-chrome-stable /usr/bin/chromium; \ + else \ + # Install specific version + apt-get update -qq &&\ + curl -fsSL --output /tmp/chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb" &&\ + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends /tmp/chrome.deb &&\ + mv /usr/bin/google-chrome-stable /usr/bin/chromium &&\ + rm -rf /tmp/chrome.deb; \ + fi \ + elif [[ "$(dpkg --print-architecture)" == "armhf" ]]; then \ + apt-get update -qq &&\ + apt-get upgrade -yqq &&\ + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends chromium; \ + fi' &&\ # Verify installation. chromium --version &&\ # Cleanup. diff --git a/go.mod b/go.mod index b5ce89344..414b1496a 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,12 @@ module github.com/gotenberg/gotenberg/v8 -go 1.26.0 +go 1.26.1 require ( github.com/alexliesenfeld/health v0.8.1 github.com/barasher/go-exiftool v1.10.0 - github.com/chromedp/cdproto v0.0.0-20250803210736-d308e07a266d - github.com/chromedp/chromedp v0.14.2 + github.com/chromedp/cdproto v0.0.0-20260320225252-cf654f46fc63 + github.com/chromedp/chromedp v0.15.0 github.com/cucumber/godog v0.15.1 github.com/dlclark/regexp2 v1.11.5 github.com/docker/docker v28.5.2+incompatible @@ -18,16 +18,17 @@ require ( github.com/labstack/gommon v0.4.2 github.com/mholt/archives v0.1.5 github.com/microcosm-cc/bluemonday v1.0.27 + github.com/pdfcpu/pdfcpu v0.11.1 github.com/prometheus/client_golang v1.23.2 - github.com/shirou/gopsutil/v4 v4.26.1 + github.com/shirou/gopsutil/v4 v4.26.2 github.com/spf13/pflag v1.0.10 - github.com/testcontainers/testcontainers-go v0.40.0 + github.com/testcontainers/testcontainers-go v0.41.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.1 - golang.org/x/net v0.50.0 - golang.org/x/sync v0.19.0 - golang.org/x/term v0.40.0 - golang.org/x/text v0.34.0 + golang.org/x/net v0.52.0 + golang.org/x/sync v0.20.0 + golang.org/x/term v0.41.0 + golang.org/x/text v0.35.0 ) require ( @@ -42,6 +43,7 @@ require ( github.com/bodgit/sevenzip v1.6.1 // indirect github.com/bodgit/windows v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chromedp/sysutil v1.1.0 // indirect github.com/containerd/errdefs v1.0.0 // indirect @@ -55,25 +57,28 @@ require ( github.com/distribution/reference v0.6.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect - github.com/ebitengine/purego v0.9.1 // indirect + github.com/ebitengine/purego v0.10.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-json-experiment/json v0.0.0-20260214004413-d219187c3433 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-ole/go-ole v1.3.0 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect github.com/gobwas/httphead v0.1.0 // indirect github.com/gobwas/pool v0.2.1 // indirect github.com/gobwas/ws v1.4.0 // indirect - github.com/gofrs/uuid v4.4.0+incompatible // indirect + github.com/gofrs/uuid v4.3.1+incompatible // indirect github.com/gorilla/css v1.0.1 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-memdb v1.3.5 // indirect - github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/go-memdb v1.3.4 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/klauspost/compress v1.18.4 // indirect + github.com/hhrutter/lzw v1.0.0 // indirect + github.com/hhrutter/pkcs7 v0.2.0 // indirect + github.com/hhrutter/tiff v1.0.2 // indirect + github.com/klauspost/compress v1.18.2 // indirect github.com/klauspost/pgzip v1.2.6 // indirect - github.com/lufia/plan9stats v0.0.0-20260216142805-b3301c5f2a88 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.10 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -86,19 +91,19 @@ require ( github.com/moby/sys/user v0.4.0 // indirect github.com/moby/sys/userns v0.1.0 // indirect github.com/moby/term v0.5.2 // indirect - github.com/morikuni/aec v1.1.0 // indirect + github.com/morikuni/aec v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/nwaples/rardecode/v2 v2.2.2 // indirect + github.com/nwaples/rardecode/v2 v2.2.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect - github.com/pierrec/lz4/v4 v4.1.25 // indirect + github.com/pierrec/lz4/v4 v4.1.22 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_model v0.6.2 // indirect - github.com/prometheus/common v0.67.5 // indirect - github.com/prometheus/procfs v0.19.2 // indirect - github.com/sirupsen/logrus v1.9.4 // indirect + github.com/prometheus/common v0.66.1 // indirect + github.com/prometheus/procfs v0.16.1 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/sorairolake/lzip-go v0.3.8 // indirect github.com/spf13/afero v1.15.0 // indirect github.com/stretchr/testify v1.11.1 // indirect @@ -109,17 +114,23 @@ require ( github.com/valyala/fasttemplate v1.2.2 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 // indirect - go.opentelemetry.io/otel v1.40.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 // indirect - go.opentelemetry.io/otel/metric v1.40.0 // indirect - go.opentelemetry.io/otel/trace v1.40.0 // indirect - go.opentelemetry.io/proto/otlp v1.7.1 // indirect - go.yaml.in/yaml/v2 v2.4.3 // indirect - go4.org v0.0.0-20260112195520-a5071408f32f // indirect - golang.org/x/crypto v0.48.0 // indirect - golang.org/x/sys v0.41.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.42.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 // indirect + go.opentelemetry.io/otel/metric v1.42.0 // indirect + go.opentelemetry.io/otel/sdk v1.42.0 // indirect + go.opentelemetry.io/otel/trace v1.42.0 // indirect + go.opentelemetry.io/proto/otlp v1.10.0 // indirect + go.yaml.in/yaml/v2 v2.4.2 // indirect + go4.org v0.0.0-20230225012048-214862532bf5 // indirect + golang.org/x/crypto v0.49.0 // indirect + golang.org/x/image v0.32.0 // indirect + golang.org/x/sys v0.42.0 // indirect golang.org/x/time v0.14.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260316172706-e463d84ca32d // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c // indirect + google.golang.org/grpc v1.79.3 // indirect google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a7c6c3333..ddbc76f25 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,28 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/STARRY-S/zip v0.2.3 h1:luE4dMvRPDOWQdeDdUxUoZkzUIpTccdKdhHHsQJ1fm4= @@ -26,14 +45,21 @@ github.com/bodgit/windows v1.0.1 h1:tF7K6KOluPYygXa3Z2594zxlkbKPAOvqr97etrGNIz4= github.com/bodgit/windows v1.0.1/go.mod h1:a6JLwrB4KrTR5hBpp8FI9/9W9jJfeQ2h4XDXU74ZCdM= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chromedp/cdproto v0.0.0-20250803210736-d308e07a266d h1:ZtA1sedVbEW7EW80Iz2GR3Ye6PwbJAJXjv7D74xG6HU= -github.com/chromedp/cdproto v0.0.0-20250803210736-d308e07a266d/go.mod h1:NItd7aLkcfOA/dcMXvl8p1u+lQqioRMq/SqDp71Pb/k= -github.com/chromedp/chromedp v0.14.2 h1:r3b/WtwM50RsBZHMUm9fsNhhzRStTHrKdr2zmwbZSzM= -github.com/chromedp/chromedp v0.14.2/go.mod h1:rHzAv60xDE7VNy/MYtTUrYreSc0ujt2O1/C3bzctYBo= +github.com/chromedp/cdproto v0.0.0-20260320225252-cf654f46fc63 h1:f027idvVkILyihTa8Z2vQCxTYPqHNdKlW7cXdMSZegU= +github.com/chromedp/cdproto v0.0.0-20260320225252-cf654f46fc63/go.mod h1:cbyjALe67vDvlvdiG9369P8w5U2w6IshwtyD2f2Tvag= +github.com/chromedp/chromedp v0.15.0 h1:B5abPcaCVetu6GDHsQKj8HbMhDWdiOM52E/TuOfuwyY= +github.com/chromedp/chromedp v0.15.0/go.mod h1:V5szO2ASqoBZsIQ88EfNMRhi9737Equm5HFL9tsBt3Q= github.com/chromedp/sysutil v1.1.0 h1:PUFNv5EcprjqXZD9nJb9b/c9ibAbxiYo4exNWZyipwM= github.com/chromedp/sysutil v1.1.0/go.mod h1:WiThHUdltqCNKGc4gaU50XgYjwjYIhKWoHGPTUfWTJ8= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= @@ -70,12 +96,16 @@ github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 h1:2tV76y6Q9BB+NEBasnqvs7e49aEBFI8ejC89PSnWH+4= github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= -github.com/ebitengine/purego v0.9.1 h1:a/k2f2HQU3Pi399RPW1MOaZyhKJL9w/xFpKAg4q1s0A= -github.com/ebitengine/purego v0.9.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= +github.com/ebitengine/purego v0.10.0 h1:QIw4xfpWT6GWTzaW5XEKy3HXoqrJGx1ijYHzTF0/ISU= +github.com/ebitengine/purego v0.10.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-json-experiment/json v0.0.0-20260214004413-d219187c3433 h1:vymEbVwYFP/L05h5TKQxvkXoKxNvTpjxYKdF1Nlwuao= github.com/go-json-experiment/json v0.0.0-20260214004413-d219187c3433/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -83,9 +113,8 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= -github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= @@ -93,20 +122,45 @@ github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm github.com/gobwas/ws v1.4.0 h1:CTaoG1tojrh4ucGPcoJFiAQUAsEWekEWvLy7GsVNqGs= github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc= github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.3.1+incompatible h1:0/KbAdpx3UXAx1kEOWHJeOkpbgRFGHVgv+CFIY7dBJI= github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/gomarkdown/markdown v0.0.0-20260217112301-37c66b85d6ab h1:VYNivV7P8IRHUam2swVUNkhIdp0LRRFKe4hXNnoZKTc= github.com/gomarkdown/markdown v0.0.0-20260217112301-37c66b85d6ab/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8= github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 h1:X5VWvz21y3gzm9Nw/kaUeku/1+uBhcekkmy4IkffJww= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1/go.mod h1:Zanoh4+gvIgluNqcfMVTJueD4wSS5hT7zTt4Mrutd90= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 h1:HWRh5R2+9EifMyIHV7ZV+MIZqgz+PMpZ14Jynv3O2Zs= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0/go.mod h1:JfhWUomR1baixubs02l85lZYYOm7LV6om4ceouMv45c= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= @@ -114,27 +168,37 @@ github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-memdb v1.3.4 h1:XSL3NR682X/cVk2IeV0d70N4DZ9ljI885xAEU8IoK3c= github.com/hashicorp/go-memdb v1.3.4/go.mod h1:uBTr1oQbtuMgd1SSGoR8YV27eT3sBHbYiNm53bMpgSg= -github.com/hashicorp/go-memdb v1.3.5 h1:b3taDMxCBCBVgyRrS1AZVHO14ubMYZB++QpNhBg+Nyo= -github.com/hashicorp/go-memdb v1.3.5/go.mod h1:8IVKKBkVe+fxFgdFOYxzQQNjz+sWCyHCdIC/+5+Vy1Y= github.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVUrx/c8Unxc48= github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= -github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hhrutter/lzw v1.0.0 h1:laL89Llp86W3rRs83LvKbwYRx6INE8gDn0XNb1oXtm0= +github.com/hhrutter/lzw v1.0.0/go.mod h1:2HC6DJSn/n6iAZfgM3Pg+cP1KxeWc3ezG8bBqW5+WEo= +github.com/hhrutter/pkcs7 v0.2.0 h1:i4HN2XMbGQpZRnKBLsUwO3dSckzgX142TNqY/KfXg+I= +github.com/hhrutter/pkcs7 v0.2.0/go.mod h1:aEzKz0+ZAlz7YaEMY47jDHL14hVWD6iXt0AgqgAvWgE= +github.com/hhrutter/tiff v1.0.2 h1:7H3FQQpKu/i5WaSChoD1nnJbGx4MxU5TlNqqpxw55z8= +github.com/hhrutter/tiff v1.0.2/go.mod h1:pcOeuK5loFUE7Y/WnzGw20YxUdnqjY1P0Jlcieb/cCw= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c= -github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= +github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uqnapk= +github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -150,8 +214,8 @@ github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0 github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80 h1:6Yzfa6GP0rIo/kULo2bwGEkFvCePZ3qHDDTC3/J9Swo= github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs= -github.com/lufia/plan9stats v0.0.0-20260216142805-b3301c5f2a88 h1:PTw+yKnXcOFCR6+8hHTyWBeQ/P4Nb7dd4/0ohEcWQuM= -github.com/lufia/plan9stats v0.0.0-20260216142805-b3301c5f2a88/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE= github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= @@ -182,20 +246,22 @@ github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= -github.com/morikuni/aec v1.1.0 h1:vBBl0pUnvi/Je71dsRrhMBtreIqNMYErSAbEeb8jrXQ= -github.com/morikuni/aec v1.1.0/go.mod h1:xDRgiq/iw5l+zkao76YTKzKttOp2cwPEne25HDkJnBw= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/nwaples/rardecode/v2 v2.2.2 h1:/5oL8dzYivRM/tqX9VcTSWfbpwcbwKG1QtSJr3b3KcU= -github.com/nwaples/rardecode/v2 v2.2.2/go.mod h1:7uz379lSxPe6j9nvzxUZ+n7mnJNgjsRNb6IbvGVHRmw= +github.com/nwaples/rardecode/v2 v2.2.0 h1:4ufPGHiNe1rYJxYfehALLjup4Ls3ck42CWwjKiOqu0A= +github.com/nwaples/rardecode/v2 v2.2.0/go.mod h1:7uz379lSxPe6j9nvzxUZ+n7mnJNgjsRNb6IbvGVHRmw= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde h1:x0TT0RDC7UhAVbbWWBzr41ElhJx5tXPWkIHA2HWPRuw= github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= -github.com/pierrec/lz4/v4 v4.1.25 h1:kocOqRffaIbU5djlIBr7Wh+cx82C0vtFb0fOurZHqD0= -github.com/pierrec/lz4/v4 v4.1.25/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4= +github.com/pdfcpu/pdfcpu v0.11.1 h1:htHBSkGH5jMKWC6e0sihBFbcKZ8vG1M67c8/dJxhjas= +github.com/pdfcpu/pdfcpu v0.11.1/go.mod h1:pP3aGga7pRvwFWAm9WwFvo+V68DfANi9kxSQYioNYcw= +github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= +github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -204,19 +270,22 @@ github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= -github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4= -github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw= -github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws= -github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= +github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs= +github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA= +github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= +github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v4 v4.26.1 h1:TOkEyriIXk2HX9d4isZJtbjXbEjf5qyKPAzbzY0JWSo= -github.com/shirou/gopsutil/v4 v4.26.1/go.mod h1:medLI9/UNAb0dOI9Q3/7yWSqKkj00u+1tgY8nvv41pc= -github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= -github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= +github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= +github.com/shirou/gopsutil/v4 v4.26.2 h1:X8i6sicvUFih4BmYIGT1m2wwgw2VG9YgrDTi7cIRGUI= +github.com/shirou/gopsutil/v4 v4.26.2/go.mod h1:LZ6ewCSkBqUpvSOf+LsTGnRinC6iaNUNMGBtDkJBaLQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sorairolake/lzip-go v0.3.8 h1:j5Q2313INdTA80ureWYRhX+1K78mUXfMoPZCw/ivWik= github.com/sorairolake/lzip-go v0.3.8/go.mod h1:JcBqGMV0frlxwrsE9sMWXDjqn3EeVf0/54YPsw66qkU= github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= @@ -232,14 +301,16 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/testcontainers/testcontainers-go v0.40.0 h1:pSdJYLOVgLE8YdUY2FHQ1Fxu+aMnb6JfVz1mxk7OeMU= -github.com/testcontainers/testcontainers-go v0.40.0/go.mod h1:FSXV5KQtX2HAMlm7U3APNyLkkap35zNLxukw9oBi/MY= +github.com/testcontainers/testcontainers-go v0.41.0 h1:mfpsD0D36YgkxGj2LrIyxuwQ9i2wCKAD+ESsYM1wais= +github.com/testcontainers/testcontainers-go v0.41.0/go.mod h1:pdFrEIfaPl24zmBjerWTTYaY0M6UHsqA1YSvsoU40MI= github.com/tklauser/go-sysconf v0.3.16 h1:frioLaCQSsF5Cy1jgRBrzr6t502KIIwQ0MArYICU0nA= github.com/tklauser/go-sysconf v0.3.16/go.mod h1:/qNL9xxDhc7tx3HSRsLWNnuzbVfh3e7gh/BmM179nYI= github.com/tklauser/numcpus v0.11.0 h1:nSTwhKH5e1dMNsCdVBukSZrURJRoHbSEQjdEbY+9RXw= @@ -253,72 +324,237 @@ github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQ github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 h1:7iP2uCb7sGddAr30RRS6xjKy7AZ2JtTOPA3oolgVSw8= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0/go.mod h1:c7hN3ddxs/z6q9xwvfLPk+UHlWRQyaeR1LdgfL/66l0= -go.opentelemetry.io/otel v1.40.0 h1:oA5YeOcpRTXq6NN7frwmwFR0Cn3RhTVZvXsP4duvCms= -go.opentelemetry.io/otel v1.40.0/go.mod h1:IMb+uXZUKkMXdPddhwAHm6UfOwJyh4ct1ybIlV14J0g= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 h1:Ahq7pZmv87yiyn3jeFz/LekZmPLLdKejuO3NcK9MssM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0/go.mod h1:MJTqhM0im3mRLw1i8uGHnCvUEeS7VwRyxlLC78PA18M= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= -go.opentelemetry.io/otel/metric v1.40.0 h1:rcZe317KPftE2rstWIBitCdVp89A2HqjkxR3c11+p9g= -go.opentelemetry.io/otel/metric v1.40.0/go.mod h1:ib/crwQH7N3r5kfiBZQbwrTge743UDc7DTFVZrrXnqc= -go.opentelemetry.io/otel/sdk v1.40.0 h1:KHW/jUzgo6wsPh9At46+h4upjtccTmuZCFAc9OJ71f8= -go.opentelemetry.io/otel/sdk v1.40.0/go.mod h1:Ph7EFdYvxq72Y8Li9q8KebuYUr2KoeyHx0DRMKrYBUE= -go.opentelemetry.io/otel/sdk/metric v1.40.0 h1:mtmdVqgQkeRxHgRv4qhyJduP3fYJRMX4AtAlbuWdCYw= -go.opentelemetry.io/otel/sdk/metric v1.40.0/go.mod h1:4Z2bGMf0KSK3uRjlczMOeMhKU2rhUqdWNoKcYrtcBPg= -go.opentelemetry.io/otel/trace v1.40.0 h1:WA4etStDttCSYuhwvEa8OP8I5EWu24lkOzp+ZYblVjw= -go.opentelemetry.io/otel/trace v1.40.0/go.mod h1:zeAhriXecNGP/s2SEG3+Y8X9ujcJOTqQ5RgdEJcawiA= -go.opentelemetry.io/proto/otlp v1.7.1 h1:gTOMpGDb0WTBOP8JaO72iL3auEZhVmAQg4ipjOVAtj4= -go.opentelemetry.io/proto/otlp v1.7.1/go.mod h1:b2rVh6rfI/s2pHWNlB7ILJcRALpcNDzKhACevjI+ZnE= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.42.0 h1:lSQGzTgVR3+sgJDAU/7/ZMjN9Z+vUip7leaqBKy4sho= +go.opentelemetry.io/otel v1.42.0/go.mod h1:lJNsdRMxCUIWuMlVJWzecSMuNjE7dOYyWlqOXWkdqCc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 h1:THuZiwpQZuHPul65w4WcwEnkX2QIuMT+UFoOrygtoJw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0/go.mod h1:J2pvYM5NGHofZ2/Ru6zw/TNWnEQp5crgyDeSrYpXkAw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.41.0 h1:inYW9ZhgqiDqh6BioM7DVHHzEGVq76Db5897WLGZ5Go= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.41.0/go.mod h1:Izur+Wt8gClgMJqO/cZ8wdeeMryJ/xxiOVgFSSfpDTY= +go.opentelemetry.io/otel/metric v1.42.0 h1:2jXG+3oZLNXEPfNmnpxKDeZsFI5o4J+nz6xUlaFdF/4= +go.opentelemetry.io/otel/metric v1.42.0/go.mod h1:RlUN/7vTU7Ao/diDkEpQpnz3/92J9ko05BIwxYa2SSI= +go.opentelemetry.io/otel/sdk v1.42.0 h1:LyC8+jqk6UJwdrI/8VydAq/hvkFKNHZVIWuslJXYsDo= +go.opentelemetry.io/otel/sdk v1.42.0/go.mod h1:rGHCAxd9DAph0joO4W6OPwxjNTYWghRWmkHuGbayMts= +go.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4LenLmOYY= +go.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc= +go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g= +go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc= go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= -go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= -go4.org v0.0.0-20260112195520-a5071408f32f h1:ziUVAjmTPwQMBmYR1tbdRFJPtTcQUI12fH9QQjfb0Sw= -go4.org v0.0.0-20260112195520-a5071408f32f/go.mod h1:ZRJnO5ZI4zAwMFp+dS1+V6J6MSyAowhRqAE+DPa1Xp0= -golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= -golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= -golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60= -golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= -golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= -golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= +go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= +go4.org v0.0.0-20230225012048-214862532bf5 h1:nifaUDeh+rPaBCMPMQHZmvJf+QdpLFnuQPwx+LxVmtc= +go4.org v0.0.0-20230225012048-214862532bf5/go.mod h1:F57wTi5Lrj6WLyswp5EYV1ncrEbFGHD4hhz6S1ZYeaU= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= +golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.32.0 h1:6lZQWq75h7L5IWNk0r+SCpUJ6tUVd3v4ZHnbRKLkUDQ= +golang.org/x/image v0.32.0/go.mod h1:/R37rrQmKXtO6tYXAjtDLwQgFLHmhW+V6ayXlxzP2Pc= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= +golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= -golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= -golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= -golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= -golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU= +golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= +golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20251202230838-ff82c1b0f217 h1:GvESR9BIyHUahIb0NcTum6itIWtdoglGX+rnGxm2934= -google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls= -google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b h1:Mv8VFug0MP9e5vUxfBcE3vUkV6CImK3cMNMIDFjmzxU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= -google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= -google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto/googleapis/api v0.0.0-20260316172706-e463d84ca32d h1:RdWlPmVySdTF0IBIZzvZJvSD0ZocPBNUsnE+uGBxj+4= +google.golang.org/genproto/googleapis/api v0.0.0-20260316172706-e463d84ca32d/go.mod h1:X2gu9Qwng7Nn009s/r3RUxqkzQNqOrAy79bluY7ojIg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c h1:xgCzyF2LFIO/0X2UAoVRiXKU5Xg6VjToG4i2/ecSswk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE= +google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/pkg/gotenberg/mocks.go b/pkg/gotenberg/mocks.go index 6a0d5035b..c4aa8d56c 100644 --- a/pkg/gotenberg/mocks.go +++ b/pkg/gotenberg/mocks.go @@ -54,6 +54,7 @@ type PdfEngineMock struct { WriteMetadataMock func(ctx context.Context, logger *zap.Logger, metadata map[string]any, inputPath string) error EncryptMock func(ctx context.Context, logger *zap.Logger, inputPath, userPassword, ownerPassword string) error EmbedFilesMock func(ctx context.Context, logger *zap.Logger, filePaths []string, inputPath string) error + ImportBookmarksMock func(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error } func (engine *PdfEngineMock) Merge(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error { @@ -88,6 +89,10 @@ func (engine *PdfEngineMock) EmbedFiles(ctx context.Context, logger *zap.Logger, return engine.EmbedFilesMock(ctx, logger, filePaths, inputPath) } +func (engine *PdfEngineMock) ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error { + return engine.ImportBookmarksMock(ctx, logger, inputPath, inputBookmarksPath, outputPath) +} + // PdfEngineProviderMock is a mock for the [PdfEngineProvider] interface. type PdfEngineProviderMock struct { PdfEngineMock func() (PdfEngine, error) diff --git a/pkg/gotenberg/pdfengine.go b/pkg/gotenberg/pdfengine.go index 2709b43c2..7803466a7 100644 --- a/pkg/gotenberg/pdfengine.go +++ b/pkg/gotenberg/pdfengine.go @@ -138,6 +138,9 @@ type PdfEngine interface { // WriteMetadata writes the metadata into a given PDF file. WriteMetadata(ctx context.Context, logger *zap.Logger, metadata map[string]any, inputPath string) error + // ImportBookmarks imports bookmarks from a JSON file into a given PDF. + ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error + // Encrypt adds password protection to a PDF file. // The userPassword is required to open the document. // The ownerPassword provides full access to the document. diff --git a/pkg/modules/chromium/chromium.go b/pkg/modules/chromium/chromium.go index b952a60bd..cdae54503 100644 --- a/pkg/modules/chromium/chromium.go +++ b/pkg/modules/chromium/chromium.go @@ -13,6 +13,7 @@ import ( "github.com/alexliesenfeld/health" "github.com/chromedp/cdproto/network" "github.com/dlclark/regexp2" + "github.com/pdfcpu/pdfcpu/pkg/pdfcpu" flag "github.com/spf13/pflag" "go.uber.org/zap" @@ -271,6 +272,10 @@ type PdfOptions struct { // embedded into the PDF. GenerateDocumentOutline bool + // Bookmarks to be inserted unmarshaled + // as defined in pdfcpu bookmarks export + Bookmarks pdfcpu.BookmarkTree + // GenerateTaggedPdf defines whether to generate tagged (accessible) // PDF. GenerateTaggedPdf bool @@ -295,6 +300,7 @@ func DefaultPdfOptions() PdfOptions { FooterTemplate: "", PreferCssPageSize: false, GenerateDocumentOutline: false, + Bookmarks: pdfcpu.BookmarkTree{}, GenerateTaggedPdf: false, } } diff --git a/pkg/modules/chromium/routes.go b/pkg/modules/chromium/routes.go index 426b97a67..4ea5bbdb5 100644 --- a/pkg/modules/chromium/routes.go +++ b/pkg/modules/chromium/routes.go @@ -17,6 +17,7 @@ import ( "github.com/gomarkdown/markdown" "github.com/labstack/echo/v4" "github.com/microcosm-cc/bluemonday" + "github.com/pdfcpu/pdfcpu/pkg/pdfcpu" "go.uber.org/multierr" "github.com/gotenberg/gotenberg/v8/pkg/gotenberg" @@ -289,6 +290,7 @@ func FormDataChromiumPdfOptions(ctx *api.Context) (*api.FormData, PdfOptions) { preferCssPageSize bool generateDocumentOutline bool generateTaggedPdf bool + bookmarks pdfcpu.BookmarkTree ) form. @@ -307,7 +309,18 @@ func FormDataChromiumPdfOptions(ctx *api.Context) (*api.FormData, PdfOptions) { Content("footer.html", &footerTemplate, defaultPdfOptions.FooterTemplate). Bool("preferCssPageSize", &preferCssPageSize, defaultPdfOptions.PreferCssPageSize). Bool("generateDocumentOutline", &generateDocumentOutline, defaultPdfOptions.GenerateDocumentOutline). - Bool("generateTaggedPdf", &generateTaggedPdf, defaultPdfOptions.GenerateTaggedPdf) + Bool("generateTaggedPdf", &generateTaggedPdf, defaultPdfOptions.GenerateTaggedPdf). + Custom("bookmarks", func(value string) error { + if len(value) > 0 { + err := json.Unmarshal([]byte(value), &bookmarks) + if err != nil { + return fmt.Errorf("unmarshal bookmarks: %w", err) + } + } else { + bookmarks = defaultPdfOptions.Bookmarks + } + return nil + }) pdfOptions := PdfOptions{ Options: options, @@ -326,6 +339,7 @@ func FormDataChromiumPdfOptions(ctx *api.Context) (*api.FormData, PdfOptions) { FooterTemplate: footerTemplate, PreferCssPageSize: preferCssPageSize, GenerateDocumentOutline: generateDocumentOutline, + Bookmarks: bookmarks, GenerateTaggedPdf: generateTaggedPdf, } @@ -748,6 +762,22 @@ func convertUrl(ctx *api.Context, chromium Api, engine gotenberg.PdfEngine, url return fmt.Errorf("convert to PDF: %w", err) } + if options.GenerateDocumentOutline { + if len(options.Bookmarks.Bookmarks) > 0 { + bookmarks, errMarshal := json.Marshal(options.Bookmarks) + outputBMPath := ctx.GeneratePath(".pdf") + + if errMarshal == nil { + outputPath, err = pdfengines.ImportBookmarksStub(ctx, engine, outputPath, bookmarks, outputBMPath) + if err != nil { + return fmt.Errorf("import bookmarks into PDF err: %w", err) + } + } else { + return fmt.Errorf("import bookmarks into PDF errMarshal : %w", errMarshal) + } + } + } + outputPaths, err := pdfengines.SplitPdfStub(ctx, engine, mode, []string{outputPath}) if err != nil { return fmt.Errorf("split PDF: %w", err) diff --git a/pkg/modules/exiftool/exiftool.go b/pkg/modules/exiftool/exiftool.go index 21f473a13..f0513b8e1 100644 --- a/pkg/modules/exiftool/exiftool.go +++ b/pkg/modules/exiftool/exiftool.go @@ -213,6 +213,11 @@ func (engine *ExifTool) EmbedFiles(ctx context.Context, logger *zap.Logger, file return fmt.Errorf("embed files with ExifTool: %w", gotenberg.ErrPdfEngineMethodNotSupported) } +// ImportBookmarks is not available in this implementation. +func (engine *ExifTool) ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error { + return fmt.Errorf("import bookmarks into PDF with ExifTool: %w", gotenberg.ErrPdfEngineMethodNotSupported) +} + // Interface guards. var ( _ gotenberg.Module = (*ExifTool)(nil) diff --git a/pkg/modules/libreoffice/pdfengine/pdfengine.go b/pkg/modules/libreoffice/pdfengine/pdfengine.go index 3fd828ef8..6c8a4b18b 100644 --- a/pkg/modules/libreoffice/pdfengine/pdfengine.go +++ b/pkg/modules/libreoffice/pdfengine/pdfengine.go @@ -101,6 +101,11 @@ func (engine *LibreOfficePdfEngine) EmbedFiles(ctx context.Context, logger *zap. return fmt.Errorf("embed files with LibreOffice: %w", gotenberg.ErrPdfEngineMethodNotSupported) } +// ImportBookmarks is not available in this implementation. +func (engine *LibreOfficePdfEngine) ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error { + return fmt.Errorf("import bookmarks into PDF with LibreOffice: %w", gotenberg.ErrPdfEngineMethodNotSupported) +} + // Interface guards. var ( _ gotenberg.Module = (*LibreOfficePdfEngine)(nil) diff --git a/pkg/modules/pdfcpu/doc.go b/pkg/modules/pdfcpu/doc.go index 6856a27ac..689a9a3d5 100644 --- a/pkg/modules/pdfcpu/doc.go +++ b/pkg/modules/pdfcpu/doc.go @@ -2,7 +2,8 @@ // interface using the pdfcpu command-line tool. This package allows for: // // 1. The merging of PDF files. -// 2. The splitting of PDF files. +// 2. Import bookmarks in a PDF file. +// 3. The splitting of PDF files. // // See: https://github.com/pdfcpu/pdfcpu. package pdfcpu diff --git a/pkg/modules/pdfcpu/pdfcpu.go b/pkg/modules/pdfcpu/pdfcpu.go index c0de3fbbc..35f731ca5 100644 --- a/pkg/modules/pdfcpu/pdfcpu.go +++ b/pkg/modules/pdfcpu/pdfcpu.go @@ -228,6 +228,28 @@ func (engine *PdfCpu) Encrypt(ctx context.Context, logger *zap.Logger, inputPath return nil } +// ImportBookmarks imports bookmarks from a JSON file into a given PDF. +func (engine *PdfCpu) ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error { + if inputBookmarksPath == "" { + return nil + } + + var args []string + args = append(args, "bookmarks", "import", inputPath, inputBookmarksPath, outputPath) + + cmd, err := gotenberg.CommandContext(ctx, logger, engine.binPath, args...) + if err != nil { + return fmt.Errorf("create command: %w", err) + } + + _, err = cmd.Exec() + if err == nil { + return nil + } + + return fmt.Errorf("import bookmarks into PDFs with pdfcpu: %w", err) +} + // Interface guards. var ( _ gotenberg.Module = (*PdfCpu)(nil) diff --git a/pkg/modules/pdfengines/multi.go b/pkg/modules/pdfengines/multi.go index 3ec176b08..a30fb4ae2 100644 --- a/pkg/modules/pdfengines/multi.go +++ b/pkg/modules/pdfengines/multi.go @@ -20,6 +20,7 @@ type multiPdfEngines struct { writeMetadataEngines []gotenberg.PdfEngine passwordEngines []gotenberg.PdfEngine embedEngines []gotenberg.PdfEngine + importBookmarksEngines []gotenberg.PdfEngine } func newMultiPdfEngines( @@ -30,17 +31,19 @@ func newMultiPdfEngines( readMetadataEngines, writeMetadataEngines, passwordEngines, - embedEngines []gotenberg.PdfEngine, + embedEngines, + importBookmarksEngines []gotenberg.PdfEngine, ) *multiPdfEngines { return &multiPdfEngines{ - mergeEngines: mergeEngines, - splitEngines: splitEngines, - flattenEngines: flattenEngines, - convertEngines: convertEngines, - readMetadataEngines: readMetadataEngines, - writeMetadataEngines: writeMetadataEngines, - passwordEngines: passwordEngines, - embedEngines: embedEngines, + mergeEngines: mergeEngines, + splitEngines: splitEngines, + flattenEngines: flattenEngines, + convertEngines: convertEngines, + readMetadataEngines: readMetadataEngines, + writeMetadataEngines: writeMetadataEngines, + passwordEngines: passwordEngines, + embedEngines: embedEngines, + importBookmarksEngines: importBookmarksEngines, } } @@ -266,6 +269,31 @@ func (multi *multiPdfEngines) EmbedFiles(ctx context.Context, logger *zap.Logger return fmt.Errorf("embed files into PDF using multi PDF engines: %w", err) } +// ImportBookmarks imports bookmarks from a JSON file into a PDF using the first available +// engine that supports bookmark importing. +func (multi *multiPdfEngines) ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error { + var err error + errChan := make(chan error, 1) + + for _, engine := range multi.importBookmarksEngines { + go func(engine gotenberg.PdfEngine) { + errChan <- engine.ImportBookmarks(ctx, logger, inputPath, inputBookmarksPath, outputPath) + }(engine) + + select { + case mergeErr := <-errChan: + errored := multierr.AppendInto(&err, mergeErr) + if !errored { + return nil + } + case <-ctx.Done(): + return ctx.Err() + } + } + + return fmt.Errorf("import bookmarks into PDF with multi PDF engines: %w", err) +} + // Interface guards. var ( _ gotenberg.PdfEngine = (*multiPdfEngines)(nil) diff --git a/pkg/modules/pdfengines/pdfengines.go b/pkg/modules/pdfengines/pdfengines.go index 1070857eb..a7326d0dd 100644 --- a/pkg/modules/pdfengines/pdfengines.go +++ b/pkg/modules/pdfengines/pdfengines.go @@ -28,16 +28,17 @@ func init() { // the [api.Router] interface to expose relevant PDF processing routes if // enabled. type PdfEngines struct { - mergeNames []string - splitNames []string - flattenNames []string - convertNames []string - readMetadataNames []string - writeMetadataNames []string - encryptNames []string - embedNames []string - engines []gotenberg.PdfEngine - disableRoutes bool + mergeNames []string + splitNames []string + flattenNames []string + convertNames []string + readMetadataNames []string + writeMetadataNames []string + encryptNames []string + embedNames []string + importBookmarksNames []string + engines []gotenberg.PdfEngine + disableRoutes bool } // Descriptor returns a PdfEngines' module descriptor. @@ -54,6 +55,7 @@ func (mod *PdfEngines) Descriptor() gotenberg.ModuleDescriptor { fs.StringSlice("pdfengines-write-metadata-engines", []string{"exiftool"}, "Set the PDF engines and their order for the write metadata feature - empty means all") fs.StringSlice("pdfengines-encrypt-engines", []string{"qpdf", "pdftk", "pdfcpu"}, "Set the PDF engines and their order for the password protection feature - empty means all") fs.StringSlice("pdfengines-embed-engines", []string{"pdfcpu"}, "Set the PDF engines and their order for the file embedding feature - empty means all") + fs.StringSlice("pdfengines-import-bookmarks-engines", []string{"pdfcpu"}, "Set the PDF engines and their order for the import bookmarks feature - empty means all") fs.Bool("pdfengines-disable-routes", false, "Disable the routes") // Deprecated flags. @@ -81,6 +83,7 @@ func (mod *PdfEngines) Provision(ctx *gotenberg.Context) error { writeMetadataNames := flags.MustStringSlice("pdfengines-write-metadata-engines") encryptNames := flags.MustStringSlice("pdfengines-encrypt-engines") embedNames := flags.MustStringSlice("pdfengines-embed-engines") + importBookmarksNames := flags.MustStringSlice("pdfengines-import-bookmarks-engines") mod.disableRoutes = flags.MustBool("pdfengines-disable-routes") engines, err := ctx.Modules(new(gotenberg.PdfEngine)) @@ -147,6 +150,11 @@ func (mod *PdfEngines) Provision(ctx *gotenberg.Context) error { mod.embedNames = embedNames } + mod.importBookmarksNames = defaultNames + if len(importBookmarksNames) > 0 { + mod.importBookmarksNames = importBookmarksNames + } + return nil } @@ -196,6 +204,7 @@ func (mod *PdfEngines) Validate() error { findNonExistingEngines(mod.writeMetadataNames) findNonExistingEngines(mod.encryptNames) findNonExistingEngines(mod.embedNames) + findNonExistingEngines(mod.importBookmarksNames) if len(nonExistingEngines) == 0 { return nil @@ -215,6 +224,7 @@ func (mod *PdfEngines) SystemMessages() []string { fmt.Sprintf("read metadata engines - %s", strings.Join(mod.readMetadataNames[:], " ")), fmt.Sprintf("write metadata engines - %s", strings.Join(mod.writeMetadataNames[:], " ")), fmt.Sprintf("encrypt engines - %s", strings.Join(mod.encryptNames[:], " ")), + fmt.Sprintf("import bookmarks engines - %s", strings.Join(mod.importBookmarksNames[:], " ")), } } @@ -243,6 +253,7 @@ func (mod *PdfEngines) PdfEngine() (gotenberg.PdfEngine, error) { engines(mod.writeMetadataNames), engines(mod.encryptNames), engines(mod.embedNames), + engines(mod.importBookmarksNames), ), nil } diff --git a/pkg/modules/pdfengines/routes.go b/pkg/modules/pdfengines/routes.go index 0da835ed1..77e9733b2 100644 --- a/pkg/modules/pdfengines/routes.go +++ b/pkg/modules/pdfengines/routes.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "net/http" + "os" "path/filepath" "strconv" "strings" @@ -301,6 +302,26 @@ func EmbedFilesStub(ctx *api.Context, engine gotenberg.PdfEngine, embedPaths []s return nil } +// ImportBookmarksStub imports bookmarks into a PDF file. +func ImportBookmarksStub(ctx *api.Context, engine gotenberg.PdfEngine, inputPath string, inputBookmarks []byte, outputPath string) (string, error) { + if len(inputBookmarks) == 0 { + fmt.Println("ImportBookmarksStub BM empty") + return inputPath, nil + } + + inputBookmarksPath := ctx.GeneratePath(".json") + err := os.WriteFile(inputBookmarksPath, inputBookmarks, 0o600) + if err != nil { + return "", fmt.Errorf("write file %v: %w", inputBookmarksPath, err) + } + err = engine.ImportBookmarks(ctx, ctx.Log(), inputPath, inputBookmarksPath, outputPath) + if err != nil { + return "", fmt.Errorf("import bookmarks %v: %w", inputPath, err) + } + + return outputPath, nil +} + // mergeRoute returns an [api.Route] which can merge PDFs. func mergeRoute(engine gotenberg.PdfEngine) api.Route { return api.Route{ diff --git a/pkg/modules/pdftk/pdftk.go b/pkg/modules/pdftk/pdftk.go index fa5bebdb0..8981bd1cb 100644 --- a/pkg/modules/pdftk/pdftk.go +++ b/pkg/modules/pdftk/pdftk.go @@ -188,6 +188,11 @@ func (engine *PdfTk) EmbedFiles(ctx context.Context, logger *zap.Logger, filePat return fmt.Errorf("embed files with PDFtk: %w", gotenberg.ErrPdfEngineMethodNotSupported) } +// ImportBookmarks is not available in this implementation. +func (engine *PdfTk) ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error { + return fmt.Errorf("import bookmarks into PDF with PDFtk: %w", gotenberg.ErrPdfEngineMethodNotSupported) +} + // Interface guards. var ( _ gotenberg.Module = (*PdfTk)(nil) diff --git a/pkg/modules/qpdf/qpdf.go b/pkg/modules/qpdf/qpdf.go index 07a5a35f9..72507b61b 100644 --- a/pkg/modules/qpdf/qpdf.go +++ b/pkg/modules/qpdf/qpdf.go @@ -206,6 +206,11 @@ func (engine *QPdf) EmbedFiles(ctx context.Context, logger *zap.Logger, filePath return fmt.Errorf("embed files with QPDF: %w", gotenberg.ErrPdfEngineMethodNotSupported) } +// ImportBookmarks is not available in this implementation. +func (engine *QPdf) ImportBookmarks(ctx context.Context, logger *zap.Logger, inputPath, inputBookmarksPath, outputPath string) error { + return fmt.Errorf("import bookmarks into PDF with QPDF: %w", gotenberg.ErrPdfEngineMethodNotSupported) +} + var ( _ gotenberg.Module = (*QPdf)(nil) _ gotenberg.Provisioner = (*QPdf)(nil)