forked from gotenberg/gotenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/upgrade from upstream #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
toindev
wants to merge
280
commits into
main
Choose a base branch
from
feat/upgrade_from_upstream
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
280 commits
Select commit
Hold shift + click to select a range
a9b44ee
chore(lint): remove rule G115 (gosec) exception
gulien b418f1e
feat(pdfengines): add support for flattening annotations (#1105)
chakalov 1d1b4fb
feat(pdfengines): add flatten form field to split route
gulien 6519221
chore(deps): update Go dependencies
gulien 7afeefe
ci(actions): add local actions
gulien 27ecb4f
chore(deps): bump codecov/codecov-action from 4 to 5
dependabot[bot] 85c7f28
ci(merge): fix alternate registry target image
gulien 2293300
ci(merge): fix alternate registry target image #2
gulien 71d571a
fix(Makefile): wrong arg for --pdfengines-convert-engines
gulien 740e701
chore(deps): update Go dependencies
gulien a1596f7
feat(api): add debug route
gulien a1848d3
feat(conf): override flags' values with their corresponding environme…
gulien 6b0c01b
chore(deps): update Go dependencies
gulien 198d911
chore(deps): switch to github.com/mholt/archives
gulien f0c1952
ci(lint): fix missing error handling
gulien 08daa86
test(api): add missing context
gulien d5aa880
ci(build-push): fix typo in tag name
gulien 679715f
chore(deps): update Go dependencies
gulien 7676d7a
ci(build-push): fix typo in tag
gulien 0a6a97c
ci(merge): fix thecodingmachine target
gulien 3dc8c18
fix(fs): get file by ext sorted by mod time
gulien 80f3f89
fix(pdfcpu): correct sorting for the output paths of the split method
gulien 083e0e3
chore(deps): update Go dependencies
gulien 8d7cc55
chore(go): upgrade to 1.24
gulien 81cc483
test: fix issues with go 1.24
gulien 28e07ba
docs(README): add pdfme sponsor (#1131)
hand-dot b13a809
ci(continous-delivery): remove wrong outputs
gulien d8603f4
feat: update short description
gulien d41de5d
docs(README): switch to new short description [skip ci]
gulien 70953aa
fix(qpdf): allow warnings (#1135)
zshehov 904e0f6
fix(pdfengines): split and read metadata pdf engines calls
gulien 16e4c10
chore(deps): update Go dependencies
gulien 85eaef0
fix(deps): update Go dependencies - chromedp ERROR: unhandled page ev…
gulien b31024c
feat(libreoffice): add updateIndexes form field
gulien 7d14546
feat(logging): add GCP severity mapping
gulien 6e22706
chore(logging): remove unit tests - integration tests are inc anyway
gulien 8252142
chore(deps): update Go dependencies
gulien 147e3b1
docs(godoc): improve the UpdateIndexes godoc
gulien ea6854f
docs(godoc): add link to issue 1149 [ci skip]
gulien 2544d82
docs(README): add GitHub Trending badge [ci skip]
gulien 536d3ee
feat(formatting): add prettier
gulien 820b914
feat(formatting): add prettier-plugin-sh
gulien 0febb60
test: add integration tests
gulien 2131de7
ci(test): no concurrency
gulien 33f9f1d
docs(test): add TODOs [ci skip]
gulien cd6add1
ci(build-test-push): add missing Cloud Run tags
gulien 67a65c6
ci(edge): fix wrong repository and tag
gulien f112cb7
ci(tests): add go test timeout
gulien 218052d
chore(tests): fix typo [skip ci]
gulien a9754d6
fix(logging): correctly map GCP structured log keys (#1159)
ChocoChipset 6c727b7
refactor(logging): use log-enable-gcp-fields
gulien e7c77b7
ci(continous-delivery): fix wrong version
gulien 0b7c51a
chore(deps): update golangci-lint to v2
gulien c737579
ci(lint): fix golangci-lint action version
gulien 368c4fa
chore(logging): better description for --log-enable-gcp-fields flag […
gulien 674f1de
chore(deps): update Go dependencies
gulien 45f04ae
fix(chromium): printBackground now works as expected and PDF are not …
gulien bf4607d
chore(.gitignore): remove coverage entries [skip ci]
gulien 10588ef
fix(webhook): content-disposition header (#1164)
stephentgrammer 7fe0e05
test(webhook): add integration testing for the webhook feature - test…
gulien 1bfe867
feat(debug): only build debug data when flag is true (#1167)
ChocoChipset 02c4343
fix(test): missing env var for debug
gulien ab81444
fix(Makefile): add double-quote to new flag
gulien a7dfa21
fix(pdfengines): correct merge order - fixes #1168
gulien 7ca1d11
chore(deps): update Go dependencies
gulien 9701f88
fix(pdfcpu): use custom sort to retrieve the splitted PDFs
gulien 3cbf772
docs(godoc): fix a bunch of typos
gulien a731bf0
chore(deps): update Go dependencies
gulien fabe323
fix(chromium): add --no-zygote and --disable-dev-shm-usage flags - fi…
gulien 088b327
feat(dep): add dependabot for mod and docker files (#1179)
ChocoChipset e536320
chore(deps): bump github.com/testcontainers/testcontainers-go
dependabot[bot] 9a38f16
chore(deps): bump github.com/docker/docker
dependabot[bot] c78ef87
chore(deps): bump github.com/shirou/gopsutil/v4 from 4.25.3 to 4.25.4
dependabot[bot] 3d652bc
ci(dependabot): add npm
gulien b63f4c5
ci(lint): update golangci-lint version
gulien 5c43eef
chore(deps): bump golangci/golangci-lint-action from 7 to 8
dependabot[bot] 05f9ac3
chore(deps-dev): bump prettier-plugin-gherkin from 3.1.1 to 3.1.2
dependabot[bot] 910af7a
chore(deps): bump golang.org/x/sync from 0.13.0 to 0.14.0
dependabot[bot] a7c0243
chore(deps-dev): bump prettier from 3.5.2 to 3.5.3
dependabot[bot] 64add9a
chore(deps-dev): bump prettier-plugin-sh from 0.15.0 to 0.17.2
dependabot[bot] 71f1f3d
feat(chromium): change sort of wait delay action and wait expression …
RandalTeng ca1d110
chore(deps-dev): bump prettier-plugin-sh from 0.17.2 to 0.17.4 (#1205)
dependabot[bot] 1ed33a7
chore(deps): bump golang.org/x/net from 0.39.0 to 0.40.0 (#1204)
dependabot[bot] 4b30567
feat(chromium): close page after conversion
gulien 45b47a1
feat(Dockerfile): use upx-ucl to reduce Go binaries size
gulien 79425af
feat(Dockerfile): use jlink to switch to a lightweight JRE
gulien be3145a
chore(libreoffice): switch to env var for handling non-basic latin ch…
gulien 9175733
ci: make it work for forks too
gulien 6631719
fix: graceful shutdown with asynchronous processes - fixes #1022
gulien 9aaab97
fix(pdfengines): read metadata better webhook error - fixes #1148
gulien 790b69a
test(integration): fix typo
gulien e662f5c
fix(libreoffice): correct values for CreateDate, MetadataDate, and Mo…
gulien de1b887
test(integration): fix rules failed toleration
gulien 5aa1cd7
feat(Dockerfile): pin versions of dependencies (#1190)
ChocoChipset e187042
Revert "test(integration): fix rules failed toleration"
gulien f13a6c0
Revert "fix(libreoffice): correct values for CreateDate, MetadataDate…
gulien 67ebe17
chore(deps): bump github.com/mholt/archives from 0.1.1 to 0.1.2
dependabot[bot] ce155fb
feat(chromium): add generateTaggedPdf to form fields - closes #1210
gulien 1d86308
fix(godoc): typo
gulien f759120
feat(chromium): split filenames can be controlled with the Gotenberg-…
gulien 61c8217
feat(Dockerfile): support for arbitrary user ids - closes #1049
gulien 8875f4d
ci: fix needs entries in merge_clean_snapshot_tags step
gulien a50e60b
fix(Dockerfile): remove fonts-dejavu-extra as the package is already …
gulien 8634989
fix(Dockerfile): typo
gulien 4aff498
chore(deps): bump github.com/labstack/echo/v4 from 4.13.3 to 4.13.4
dependabot[bot] 6f71427
docs(README): remove Zolsec from sponsors
gulien a635fd8
chore(deps): bump github.com/shirou/gopsutil/v4 from 4.25.4 to 4.25.5
dependabot[bot] 9226b78
chore(deps): bump github.com/docker/docker
dependabot[bot] cf2d413
test(integration): comment scenario that is not happening anymore on …
gulien b0a84bc
chore(integration): prettify
gulien aa58615
fix(api): outpout filename as path - fixes #1227
gulien f0fc704
chore(deps): bump golang.org/x/sync from 0.14.0 to 0.15.0
dependabot[bot] fcf4118
chore(deps): bump golang.org/x/text from 0.25.0 to 0.26.0
dependabot[bot] ffeb470
chore(deps): bump golang.org/x/net from 0.40.0 to 0.41.0
dependabot[bot] e945329
chore(deps-dev): bump prettier from 3.5.3 to 3.6.0
dependabot[bot] 2ba7014
chore(deps): bump github.com/chromedp/chromedp from 0.13.6 to 0.13.7
dependabot[bot] 16f740b
chore(deps): bump github.com/hashicorp/go-retryablehttp
dependabot[bot] 57264da
chore(deps): bump github.com/alexliesenfeld/health from 0.8.0 to 0.8.1
dependabot[bot] 51b0841
chore(deps): bump github.com/mholt/archives from 0.1.2 to 0.1.3
dependabot[bot] ac5dfb7
chore(deps): bump github.com/docker/docker
dependabot[bot] ef745dc
chore(deps-dev): bump prettier from 3.6.0 to 3.6.2
dependabot[bot] e79d7e6
chore(deps-dev): bump prettier-plugin-sh from 0.17.4 to 0.18.0
dependabot[bot] 00a85b0
chore(deps): bump github.com/shirou/gopsutil/v4 from 4.25.5 to 4.25.6
dependabot[bot] f73b727
chore(deps): bump github.com/docker/docker
dependabot[bot] 0e250a9
chore(deps): bump golang.org/x/net from 0.41.0 to 0.42.0
dependabot[bot] 59a091e
chore(deps): bump github.com/docker/docker
dependabot[bot] 3a71032
tests(integration): use same targeted platform for integration-tools …
roy20021 588e27e
chore(deps): bump github.com/cucumber/godog from 0.15.0 to 0.15.1
dependabot[bot] 911fdd3
chore(deps): bump github.com/testcontainers/testcontainers-go
dependabot[bot] 339afe6
chore(deps): bump github.com/docker/docker
dependabot[bot] 6ff5109
fix(integration): non-working scenarios because of a remote service down
gulien 53b4c70
chore: prettify
gulien 94c831c
fix(integration): failing scenarios
gulien f299f3e
fix(chromium): Enable GPU support
EyeCantCU fc11f55
feat(webhook) add support for sync upload with webhook url (#1233)
ynarwal 02ad6c7
feat(webhook): switch to --webhook-enable-sync-mode flag instead of h…
gulien 087967b
chore(deps): bump golang.org/x/term from 0.33.0 to 0.34.0
dependabot[bot] 4e9d7a3
chore(deps): bump github.com/docker/go-connections from 0.5.0 to 0.6.0
dependabot[bot] 1a9ae45
chore(deps): bump github.com/chromedp/chromedp from 0.14.0 to 0.14.1
dependabot[bot] 8d795a4
chore(deps): bump golang.org/x/net from 0.42.0 to 0.43.0
dependabot[bot] db8f0ad
fix(chromium): hypen-data now work everytime
gulien d496cbf
fix(sort): better sorting algorithm - fixes #1287
gulien 2635213
feat(build): #540 add AWS Lambda support
gulien d6ffd19
ci(build): #540 add AWS Lambda support
gulien a9d10b2
fix(build): missing args for AWS Lambda Dockerfile
gulien d371ae8
chore(build): add missing GOTENBERG_BUILD_DEBUG_DATA configuration fo…
gulien e86d38c
feat(build): add default configuration for Cloud Run variant
gulien 1ff4b3a
fix(ci): add missing AWS Lambda tags to push step
gulien 2f487d2
fix(ci): ignore empty tags in push step
gulien 9e13061
fix(ci): ignore empty tags in push step - second attempt
gulien bee56cf
fix(ci): add missing outputs for AWS Lambda tags
gulien cb98b0c
feat(misc): add --gotenberg-hide-banner flag
gulien fb63ffb
ci(lint): update golangci-lint
gulien e0b5ccb
chore(go): update to 1.25
gulien b7afa49
chore(deps): update pdfcpu to v0.11.0
gulien 8cab823
chore(deps): update noto-color-emoji to v2.048
gulien 4fc94ca
chore(deps): npm update
gulien f08b9d3
chore(deps): bump actions/checkout from 4 to 5
dependabot[bot] 97ec494
chore(deps): bump debian from 12-slim to 13-slim
gulien f54f78d
chore(build): use Chromium for all arch
gulien 50d1b18
fix(build): switch from /home/gotenberg to /opt/gotenberg for hype´ data
gulien 4d526fe
fix(build): use buffered invoke mode and do not auto-start LibreOffic…
gulien fd48141
chore(deps): update Go dependencies
gulien 3dd9ce1
feat(chromium): add MathJaX support
gulien 18bb7ef
ci(actions): switch to actions/checkout@v5
gulien 638c4e6
chore(deps): update Go dependencies
gulien 99307be
feat: add PDF encryption feature (#1217)
thoven87 ba944f9
chore: slight improvement of the encrypt feature to be more in line w…
gulien 0ad6623
fix(pdgengines): encrypt behavior accross different engines
gulien 84ca118
chore(deps): update Go dependencies
gulien d6ebc7f
chore(pdfengines): better custom error message if invalid args
gulien a961365
chore(deps): bump actions/setup-go from 5 to 6
dependabot[bot] 5b84a5e
chore(deps): bump actions/setup-node from 4 to 5
dependabot[bot] beb1e38
chore(deps): bump github.com/prometheus/client_golang
dependabot[bot] 8f0121a
chore(deps): bump golang.org/x/sync from 0.16.0 to 0.17.0
dependabot[bot] 9aaab2d
chore(deps): bump github.com/docker/docker
dependabot[bot] e7e7267
docs(README): add JetBrains logo
gulien aff7530
feat(build): use trixie-backports for LibreOffice 25.8 - closes #1323
gulien a78c433
chore(deps): bump golang.org/x/net from 0.43.0 to 0.44.0
dependabot[bot] 76d36d1
chore(deps): update Go dependencies
gulien ed5d1fa
fix(Dockerfile): remove upx stage
gulien a057c62
chore(deps): update Go dependencies
gulien fd5930b
chore(deps): bump github.com/shirou/gopsutil/v4 from 4.25.8 to 4.25.9
dependabot[bot] efa0d3f
chore(deps): bump github.com/docker/docker
dependabot[bot] 63ae987
feat(build): add ppc64le architecture (#1344)
gulien e5ccb82
chore(deps): update Go dependencies
gulien 4fe2ff5
chore(deps): update No Emoji to v2.051
gulien 9dc6e30
ci(deps): update golangci-lint to v2.5.0
gulien e33ca6a
fix(deps): revert indirect nwaples/rardecode/v2 bump
omni-htg c7424df
feat(Dockerfile): add basic LibreOffice Hyphenation support
omni-htg c0c4c21
chore(deps): bump actions/checkout from 4 to 5
dependabot[bot] 9a49ea4
chore(deps): bump golang.org/x/net from 0.44.0 to 0.46.0
dependabot[bot] da20f04
chore(deps): bump github.com/chromedp/chromedp from 0.14.1 to 0.14.2
dependabot[bot] e85d414
chore(deps): bump github.com/docker/docker
dependabot[bot] b31e520
chore(deps-dev): bump prettier-plugin-gherkin from 3.1.2 to 3.1.3
dependabot[bot] 1639d82
chore(deps): bump actions/setup-node from 5 to 6
dependabot[bot] c44dc7f
chore(deps): bump github.com/mholt/archives from 0.1.4 to 0.1.5
dependabot[bot] 3eefe33
Update pdfcpu version
pebosi c7ccabc
fix(chromium): mark the flag --chromium-incognito as deprecated and i…
gulien 83fdc01
fix(chromium): accept case-insensitive values for the cookies' sameSi…
gulien 0e6bb27
fix(chromium): add missing wrapped error
gulien d5a58cf
chore(deps): bump github.com/shirou/gopsutil/v4 from 4.25.9 to 4.25.10
dependabot[bot] f4d3fba
feat: add tests tags
Jean-Beru a0ee800
feat(pdfengines): add embed feature
Jean-Beru 286efbe
chore(deps): bump Go from 1.25.0 to 1.25.4
tomquist ea103d3
chore(deps): bump github.com/testcontainers/testcontainers-go
dependabot[bot] fcaa26a
chore(deps): bump golang.org/x/sync from 0.17.0 to 0.18.0
dependabot[bot] ca4f014
chore(deps): bump github.com/docker/docker
dependabot[bot] 3544e9c
chore(deps): bump golangci/golangci-lint-action from 8 to 9
dependabot[bot] 7a60e82
chore(deps): use node 24.11 for dev tools
gulien 4429aea
chore(tests): rename embed feature file
gulien f9ad8bd
test(integration): add more tags, complete embed feature tests suite,…
gulien 4a788ce
fix(lint): non-used method in tests
gulien b2c3187
fix(chromium): better native errors handling
gulien 43354ca
chore(deps): update Go dependencies
gulien dd07c73
chore(deps): bump golang.org/x/crypto from 0.44.0 to 0.45.0
dependabot[bot] 15fdc99
fix(chromium): add net::ERR_HTTP2_PROTOCOL_ERROR in the EventLoadingF…
aW3st fb61948
chore(deps): bump actions/checkout from 5 to 6
dependabot[bot] 507d0cb
chore(deps): bump go.uber.org/zap from 1.27.0 to 1.27.1
dependabot[bot] 0a05091
chore(deps-dev): bump prettier from 3.6.2 to 3.7.3
dependabot[bot] 2f7218b
chore(deps): bump github.com/shirou/gopsutil/v4 from 4.25.10 to 4.25.11
dependabot[bot] 8b9858a
fix(chromium): resource intensive health check
gulien 9fba76f
chore(deps-dev): bump prettier from 3.7.3 to 3.7.4
dependabot[bot] 04e596b
chore(deps): bump golang.org/x/text from 0.31.0 to 0.32.0
dependabot[bot] 77b9776
chore(deps): bump github.com/labstack/echo/v4 from 4.13.4 to 4.14.0
dependabot[bot] 0b211c3
feat(chromium): add `IgnoreResourceHttpStatusDomains` option to filte…
frostmark 5c49821
chore(deps): bump github.com/labstack/echo/v4 from 4.14.0 to 4.15.0 (…
dependabot[bot] 4f800c8
chore(deps): bump github.com/shirou/gopsutil/v4 from 4.25.11 to 4.25.…
dependabot[bot] b1ad21c
chore(go): update Go version to 1.25.5 (#1440)
jmendes-alto 935686b
chore(deps): bump golang.org/x/text from 0.32.0 to 0.33.0
dependabot[bot] d111591
chore(deps): bump golang.org/x/term from 0.38.0 to 0.39.0
dependabot[bot] 37a0868
chore: integrate upstream changes
toindev 92de0cf
feat(prometheus): add new flag --prometheus-metrics-path
davpsh 3220ca4
feat(chromium): add `waitForSelector` option to Chromium conversions …
danxmoran e14cab0
fix(api): propagate request context to stop processing on client disc…
romanek-adam-b2c2 463bb2f
fix(webhook): detach context from request lifecycle to prevent cancel…
romanek-adam-b2c2 ba1a730
chore(deps-dev): bump prettier from 3.7.4 to 3.8.1
dependabot[bot] b762143
chore(deps): bump golang.org/x/net from 0.48.0 to 0.49.0
dependabot[bot] 4531849
chore(deps): update Go dependencies
gulien f57ecb6
fix(exiftool): remove derived tags to prevent side effects when writi…
gulien 05e15a1
chore(.gitignore): add junie folder
gulien b7a6b7a
Revert "chore(.gitignore): add junie folder"
gulien 32d9485
docs(ai): add AGENTS.md
gulien 3d9b2de
fix(style): AGENTS.md
gulien 1195c37
chore(go): bump Go to 1.25.7
jmendes-alto 3775731
feat(Dockerfile): manage system time zone (#1465)
davpsh 241d507
chore(deps): bump github.com/shirou/gopsutil/v4 from 4.25.12 to 4.26.…
dependabot[bot] 12c25a2
feat(chromium): re-add concurrency support for Chromium (#1467)
TomBrouws 9d7f473
Merge remote-tracking branch 'upstream/main' into feat/upgrade_from_u…
toindev ca4db1f
ci: use credentials
toindev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| .git | ||
| .git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| GOTENBERG_VERSION=snapshot | ||
| DOCKER_REGISTRY=ghcr.io/fulll | ||
| DOCKER_REPOSITORY=gotenberg | ||
| DOCKERFILE=build/Dockerfile | ||
| DOCKERFILE_CLOUDRUN=build/Dockerfile.cloudrun | ||
| DOCKERFILE_AWS_LAMBDA=build/Dockerfile.aws-lambda | ||
| DOCKER_BUILD_CONTEXT='.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| name: Build Test Push | ||
| description: Build, test and push Docker images for a given platform | ||
| author: Julien Neuhart | ||
|
|
||
| inputs: | ||
| github_token: | ||
| 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 | ||
| platform: | ||
| description: linux/amd64, linux/ppc64le, linux/386, linux/arm64, linux/arm/v7 | ||
| required: true | ||
| version: | ||
| description: Gotenberg version | ||
| required: true | ||
| skip_integrations_tests: | ||
| description: Define whether to skip integration testing | ||
| default: false | ||
| alternate_repository: | ||
| description: Alternate repository to push the tags to | ||
| dry_run: | ||
| description: Dry run this action | ||
|
|
||
| outputs: | ||
| tags: | ||
| description: Comma separated list of tag | ||
| value: ${{ steps.build.outputs.tags }} | ||
| tags_cloud_run: | ||
| description: Comma separated list of Cloud Run tags (linux/amd64 only) | ||
| value: ${{ steps.build.outputs.tags_cloud_run }} | ||
| tags_aws_lambda: | ||
| description: Comma separated list of AWS Lambda tags (linux/amd64 and linux/arm64 only) | ||
| value: ${{ steps.build.outputs.tags_aws_lambda }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - 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: Build ${{ inputs.platform }} | ||
| id: build | ||
| shell: bash | ||
| run: | | ||
| .github/actions/build-test-push/build.sh \ | ||
| --version "${{ inputs.version }}" \ | ||
| --platform "${{ inputs.platform }}" \ | ||
| --alternate-repository "${{ inputs.alternate_repository }}" \ | ||
| --dry-run "${{ inputs.dry_run }}" | ||
|
|
||
| - name: Run integration tests | ||
| if: inputs.skip_integrations_tests != 'true' | ||
| shell: bash | ||
| run: | | ||
| .github/actions/build-test-push/test.sh \ | ||
| --version "${{ inputs.version }}" \ | ||
| --platform "${{ inputs.platform }}" \ | ||
| --alternate-repository "${{ inputs.alternate_repository }}" \ | ||
| --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 | ||
| run: | | ||
| echo "tags=${{ steps.build.outputs.tags }}" | ||
| echo "tags_cloud_run=${{ steps.build.outputs.tags_cloud_run }}" | ||
| echo "tags_aws_lambda=${{ steps.build.outputs.tags_aws_lambda }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,184 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Exit early. | ||
| # See: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#The-Set-Builtin. | ||
| set -e | ||
|
|
||
| # Source dot env file. | ||
| source .env | ||
|
|
||
| # Arguments. | ||
| version="" | ||
| platform="" | ||
| alternate_repository="" | ||
| dry_run="" | ||
|
|
||
| while [[ $# -gt 0 ]]; do | ||
| case $1 in | ||
| --version) | ||
| version="${2//v/}" | ||
| shift 2 | ||
| ;; | ||
| --platform) | ||
| platform="$2" | ||
| shift 2 | ||
| ;; | ||
| --alternate-repository) | ||
| alternate_repository="$2" | ||
| shift 2 | ||
| ;; | ||
| --dry-run) | ||
| dry_run="$2" | ||
| shift 2 | ||
| ;; | ||
| *) | ||
| echo "Unknown option $1" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| echo "Build and push 👷" | ||
| echo | ||
|
|
||
| echo "Gotenberg version: $version" | ||
| echo "Target platform: $platform" | ||
|
|
||
| if [ -n "$alternate_repository" ]; then | ||
| DOCKER_REPOSITORY=$alternate_repository | ||
| echo "⚠️ Using $alternate_repository for DOCKER_REPOSITORY" | ||
| fi | ||
|
|
||
| if [ "$dry_run" = "true" ]; then | ||
| echo "🚧 Dry run" | ||
| fi | ||
|
|
||
| # Build tags arrays. | ||
| tags=() | ||
| tags_cloud_run=() | ||
| tags_aws_lambda=() | ||
|
|
||
| IFS='/' read -ra arch <<< "$platform" | ||
| IFS='.' read -ra semver <<< "$version" | ||
|
|
||
| if [ "${#semver[@]}" -eq 3 ]; then | ||
| echo | ||
| echo "Semver version detected" | ||
|
|
||
| major="${semver[0]}" | ||
| minor="${semver[1]}" | ||
| patch="${semver[2]}" | ||
|
|
||
| tags+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:latest-${arch[1]}") | ||
| tags+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$major-${arch[1]}") | ||
| tags+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$major.$minor-${arch[1]}") | ||
| tags+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$major.$minor.$patch-${arch[1]}") | ||
|
|
||
| if [ "$platform" = "linux/amd64" ]; then | ||
| tags_cloud_run+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:latest-cloudrun") | ||
| tags_cloud_run+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$major-cloudrun") | ||
| tags_cloud_run+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$major.$minor-cloudrun") | ||
| tags_cloud_run+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$major.$minor.$patch-cloudrun") | ||
| fi | ||
|
|
||
| if [ "$platform" = "linux/amd64" ] || [ "$platform" = "linux/arm64" ]; then | ||
| tags_aws_lambda+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:latest-aws-lambda-${arch[1]}") | ||
| tags_aws_lambda+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$major-aws-lambda-${arch[1]}") | ||
| tags_aws_lambda+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$major.$minor-aws-lambda-${arch[1]}") | ||
| tags_aws_lambda+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$major.$minor.$patch-aws-lambda-${arch[1]}") | ||
| fi | ||
| else | ||
| echo | ||
| echo "Non-semver version detected, fallback to $version" | ||
|
|
||
| tags+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$version-${arch[1]}") | ||
| if [ "$platform" = "linux/amd64" ]; then | ||
| tags_cloud_run+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$version-cloudrun") | ||
| fi | ||
|
|
||
| if [ "$platform" = "linux/amd64" ] || [ "$platform" = "linux/arm64" ]; then | ||
| tags_aws_lambda+=("$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$version-aws-lambda-${arch[1]}") | ||
| fi | ||
| fi | ||
|
|
||
| tags_flags=() | ||
| tags_cloud_run_flags=() | ||
| tags_aws_lambda_flags=() | ||
|
|
||
| echo "Will use the following tags:" | ||
| for tag in "${tags[@]}"; do | ||
| tags_flags+=("-t" "$tag") | ||
| echo "- $tag" | ||
| done | ||
| for tag in "${tags_cloud_run[@]}"; do | ||
| tags_cloud_run_flags+=("-t" "$tag") | ||
| echo "- $tag" | ||
| done | ||
| for tag in "${tags_aws_lambda[@]}"; do | ||
| tags_aws_lambda_flags+=("-t" "$tag") | ||
| echo "- $tag" | ||
| done | ||
| echo | ||
|
|
||
| # Build images. | ||
| run_cmd() { | ||
| local cmd="$1" | ||
|
|
||
| if [ "$dry_run" = "true" ]; then | ||
| echo "🚧 Dry run - would run the following command:" | ||
| echo "$cmd" | ||
| echo | ||
| else | ||
| echo "⚙️ Running command:" | ||
| echo "$cmd" | ||
| eval "$cmd" | ||
| echo | ||
| fi | ||
| } | ||
|
|
||
| join() { | ||
| local delimiter="$1" | ||
| shift | ||
| local IFS="$delimiter" | ||
| echo "$*" | ||
| } | ||
|
|
||
| no_arch_tag="$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$version" | ||
|
|
||
| cmd="docker buildx build \ | ||
| --build-arg GOTENBERG_VERSION=$version \ | ||
| --platform $platform \ | ||
| --load \ | ||
| ${tags_flags[*]} \ | ||
| -t $no_arch_tag \ | ||
| -f $DOCKERFILE $DOCKER_BUILD_CONTEXT | ||
| " | ||
| run_cmd "$cmd" | ||
|
|
||
| if [ "$platform" = "linux/amd64" ]; then | ||
| cmd="docker build \ | ||
| --build-arg DOCKER_REGISTRY=$DOCKER_REGISTRY \ | ||
| --build-arg DOCKER_REPOSITORY=$DOCKER_REPOSITORY \ | ||
| --build-arg GOTENBERG_VERSION=$version \ | ||
| ${tags_cloud_run_flags[*]} \ | ||
| -f $DOCKERFILE_CLOUDRUN $DOCKER_BUILD_CONTEXT | ||
| " | ||
| run_cmd "$cmd" | ||
| fi | ||
|
|
||
| if [ "$platform" = "linux/amd64" ] || [ "$platform" = "linux/arm64" ]; then | ||
| cmd="docker build \ | ||
| --build-arg DOCKER_REGISTRY=$DOCKER_REGISTRY \ | ||
| --build-arg DOCKER_REPOSITORY=$DOCKER_REPOSITORY \ | ||
| --build-arg GOTENBERG_VERSION=$version \ | ||
| ${tags_aws_lambda_flags[*]} \ | ||
| -f $DOCKERFILE_AWS_LAMBDA $DOCKER_BUILD_CONTEXT | ||
| " | ||
| run_cmd "$cmd" | ||
| fi | ||
|
|
||
| echo "✅ Done!" | ||
| echo "tags=$(join "," "${tags[@]}")" >> "$GITHUB_OUTPUT" | ||
| echo "tags_cloud_run=$(join "," "${tags_cloud_run[@]}")" >> "$GITHUB_OUTPUT" | ||
| echo "tags_aws_lambda=$(join "," "${tags_aws_lambda[@]}")" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Exit early. | ||
| # See: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#The-Set-Builtin. | ||
| set -e | ||
|
|
||
| # Source dot env file. | ||
| source .env | ||
|
|
||
| # Arguments. | ||
| tags="" | ||
| dry_run="" | ||
|
|
||
| while [[ $# -gt 0 ]]; do | ||
| case $1 in | ||
| --tags) | ||
| tags="$2" | ||
| shift 2 | ||
| ;; | ||
| --dry-run) | ||
| dry_run=$2 | ||
| shift 2 | ||
| ;; | ||
| *) | ||
| echo "Unknown option $1" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| echo "Push tag(s) 📦" | ||
| echo | ||
|
|
||
| echo "Tag(s) to push:" | ||
| IFS=',' read -ra tmp_tags_to_push <<< "$tags" | ||
|
|
||
| tags_to_push=() | ||
| for tag in "${tmp_tags_to_push[@]}"; do | ||
| [ -n "$tag" ] && tags_to_push+=("$tag") | ||
| done | ||
|
|
||
| for tag in "${tags_to_push[@]}"; do | ||
| echo "- $tag" | ||
| done | ||
|
|
||
| if [ "$dry_run" = "true" ]; then | ||
| echo "🚧 Dry run" | ||
| fi | ||
| echo | ||
|
|
||
| # Push tags. | ||
| run_cmd() { | ||
| local cmd="$1" | ||
|
|
||
| if [ "$dry_run" = "true" ]; then | ||
| echo "🚧 Dry run - would run the following command:" | ||
| echo "$cmd" | ||
| echo | ||
| else | ||
| echo "⚙️ Running command:" | ||
| echo "$cmd" | ||
| eval "$cmd" | ||
| echo | ||
| fi | ||
| } | ||
|
|
||
| for tag in "${tags_to_push[@]}"; do | ||
| cmd="docker push $tag" | ||
| run_cmd "$cmd" | ||
|
|
||
| echo "➡️ $tag pushed" | ||
| echo | ||
| done | ||
|
|
||
| echo "✅ Done!" | ||
| exit 0 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script uses eval("$cmd") to execute a dynamically constructed command string, which can hide the actual operations. Avoid eval; run commands directly or use arrays to execute without shell evaluation.
Details
✨ AI Reasoning
The code builds command strings dynamically (including interpolated arrays and variables) and executes them via eval in a helper that runs build commands. Dynamically constructed and evaluated shell commands can hide actual executed operations and make review or static analysis miss side effects. This harms transparency and increases risk that injected values or unexpected expansions change runtime behavior.
🔧 How do I fix it?
Ensure code is transparent and not intentionally obfuscated. Avoid hiding functionality from code review. Focus on intent and deception, not specific patterns.
Reply
@AikidoSec feedback: [FEEDBACK]to get better review comments in the future.Reply
@AikidoSec ignore: [REASON]to ignore this issue.More info