Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to main content
Version: 9.x

Configuration

Gotenberg needs no configuration to start. Flags and environment variables tune it: every flag has a variable, so --api-timeout is API_TIMEOUT.

Set a flag​

Pass flags to the gotenberg command, which the image runs by default:

docker run --rm -p "3000:3000" gotenberg/gotenberg:9 \
gotenberg --api-timeout=60s

Or set the variable instead, which suits Compose and Kubernetes:

compose.yaml
services:
gotenberg:
image: gotenberg/gotenberg:9
environment:
API_TIMEOUT: 60s
CHROMIUM_DENY_PRIVATE_IPS: "true"
  • The variable wins when you set both.
  • A list takes repeated flags, or comma-separated values: WEBHOOK_ALLOW_LIST=^https://hooks\.example\.com/,^https://events\.example\.com/. A list you set replaces its default.
  • A duration takes a unit: 30s, 5m. A size takes one too: 5MB, 1GB.

Flags​

Gotenberg's own --help describes the flags below, with their defaults.

API​

The HTTP server: port, limits, timeouts, authentication, and the files Gotenberg downloads for downloadFrom.

--api-archive-max-entriesAPI_ARCHIVE_MAX_ENTRIESinteger

Set the maximum number of entries of a zip archive sent in the archives form field

Default: 10000

--api-archive-max-ratioAPI_ARCHIVE_MAX_RATIOinteger

Set how many times its own size a zip archive sent in the archives form field may unpack to - guards against zip bombs

Default: 100

--api-bind-ipAPI_BIND_IPstring

Set the IP address the API should bind to for incoming connections

Default: none

--api-body-limitAPI_BODY_LIMITstring

Set the body limit for multipart/form-data requests - it accepts values like 5MB, 1GB, etc

Default: none

--api-correlation-id-headerAPI_CORRELATION_ID_HEADERstring

Set the header name to use for identifying requests

Default: Gotenberg-Trace

--api-disable-debug-route-telemetryAPI_DISABLE_DEBUG_ROUTE_TELEMETRYboolean

Disable telemetry for the debug route

Default: true

--api-disable-download-fromAPI_DISABLE_DOWNLOAD_FROMboolean

Disable the download from feature

Default: false

--api-disable-health-check-route-telemetryAPI_DISABLE_HEALTH_CHECK_ROUTE_TELEMETRYboolean

Disable telemetry for health check route

Default: true

--api-disable-root-route-telemetryAPI_DISABLE_ROOT_ROUTE_TELEMETRYboolean

Disable telemetry for the root route

Default: true

--api-disable-version-route-telemetryAPI_DISABLE_VERSION_ROUTE_TELEMETRYboolean

Disable telemetry for the version route

Default: true

--api-download-from-allow-listAPI_DOWNLOAD_FROM_ALLOW_LISTlist

Set the allowed URLs for the download from feature using regular expressions - supports multiple values. A match bypasses --api-download-from-deny-private-ips (API_DOWNLOAD_FROM_DENY_PRIVATE_IPS) and --api-download-from-deny-public-ips (API_DOWNLOAD_FROM_DENY_PUBLIC_IPS), so terminate the host or the pattern also matches suffix hosts, for example ^https?://internal\.svc(:|/|$)

Default: none

--api-download-from-deny-listAPI_DOWNLOAD_FROM_DENY_LISTlist

Set the denied URLs for the download from feature using regular expressions - supports multiple values

Default: none

--api-download-from-deny-private-ipsAPI_DOWNLOAD_FROM_DENY_PRIVATE_IPSboolean

Reject downloadFrom URLs whose host resolves to a non-public IP address (loopback, RFC1918, link-local, unique-local). Enable on deployments that accept untrusted downloadFrom sources to mitigate SSRF against internal services

Default: false

--api-download-from-deny-public-ipsAPI_DOWNLOAD_FROM_DENY_PUBLIC_IPSboolean

Reject downloadFrom URLs whose host resolves to a public IP address. Enable on air-gapped or data-governed deployments to prevent downloads from reaching the public internet

Default: false

--api-download-from-enable-environment-proxyAPI_DOWNLOAD_FROM_ENABLE_ENVIRONMENT_PROXYboolean

Route downloadFrom fetches through the proxy defined by the standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables, including credentials

Default: false

--api-download-from-max-concurrencyAPI_DOWNLOAD_FROM_MAX_CONCURRENCYinteger

Set the maximum number of downloadFrom entries fetched concurrently per request - bounds the outbound fan-out. 0 means no limit; --api-disable-download-from (API_DISABLE_DOWNLOAD_FROM) turns downloadFrom off

Default: 10

--api-download-from-max-entriesAPI_DOWNLOAD_FROM_MAX_ENTRIESinteger

Set the maximum number of downloadFrom entries allowed per request. 0 means no limit; --api-disable-download-from (API_DISABLE_DOWNLOAD_FROM) turns downloadFrom off

Default: 0

--api-download-from-max-retryAPI_DOWNLOAD_FROM_MAX_RETRYinteger

Set the maximum number of retries for the download from feature

Default: 4

--api-enable-basic-authAPI_ENABLE_BASIC_AUTHboolean

Enable basic authentication - will look for the GOTENBERG_API_BASIC_AUTH_USERNAME and GOTENBERG_API_BASIC_AUTH_PASSWORD environment variables

Default: false

--api-enable-debug-routeAPI_ENABLE_DEBUG_ROUTEboolean

Enable the debug route

Default: false

--api-enable-oidc-authAPI_ENABLE_OIDC_AUTHboolean

Enable OIDC bearer token authentication - mutually exclusive with basic authentication

Default: false

--api-oidc-audienceAPI_OIDC_AUDIENCEstring

Set the expected OIDC audience - the token aud claim must contain it

Default: none

--api-oidc-issuerAPI_OIDC_ISSUERstring

Set the OIDC issuer URL, e.g. https://tenant.example.com/ - the token iss claim must match

Default: none

--api-oidc-jwks-urlAPI_OIDC_JWKS_URLstring

Set the OIDC JWKS URL - discovered from the issuer's well-known configuration when empty

Default: none

--api-portAPI_PORTinteger

Set the port on which the API should listen

Default: 3000

--api-port-from-envAPI_PORT_FROM_ENVstring

Set the environment variable with the port on which the API should listen - override the default port

Default: none

--api-root-pathAPI_ROOT_PATHstring

Set the root path of the API - for service discovery via URL paths

Default: /

--api-start-timeoutAPI_START_TIMEOUTduration

Set the time limit for the API to start

Default: 30s

--api-timeoutAPI_TIMEOUTduration

Set the time limit for requests

Default: 30s

--api-tls-cert-fileAPI_TLS_CERT_FILEstring

Path to the TLS/SSL certificate file - for HTTPS support

Default: none

--api-tls-key-fileAPI_TLS_KEY_FILEstring

Path to the TLS/SSL key file - for HTTPS support

Default: none

Chromium​

--chromium-allow-file-access-from-filesCHROMIUM_ALLOW_FILE_ACCESS_FROM_FILESboolean

Allow file:// URIs to read other file:// URIs

Default: false

--chromium-allow-insecure-localhostCHROMIUM_ALLOW_INSECURE_LOCALHOSTboolean

Ignore TLS/SSL errors on localhost

Default: false

--chromium-allow-listCHROMIUM_ALLOW_LISTlist

Set the allowed URLs for Chromium using regular expressions - supports multiple values. A match bypasses --chromium-deny-private-ips (CHROMIUM_DENY_PRIVATE_IPS) and --chromium-deny-public-ips (CHROMIUM_DENY_PUBLIC_IPS), so terminate the host or the pattern also matches suffix hosts, for example ^https?://internal\.svc(:|/|$)

Default: none

--chromium-auto-startCHROMIUM_AUTO_STARTboolean

Automatically launch Chromium upon initialization if set to true; otherwise, Chromium will start at the time of the first conversion

Default: false

--chromium-clear-cacheCHROMIUM_CLEAR_CACHEboolean

Clear Chromium cache between each conversion - only applies with --chromium-shared-browser-context

Default: false

--chromium-clear-cookiesCHROMIUM_CLEAR_COOKIESboolean

Clear Chromium cookies between each conversion - only applies with --chromium-shared-browser-context

Default: false

--chromium-clear-storageCHROMIUM_CLEAR_STORAGEboolean

Clear Chromium local storage between each conversion - only applies with --chromium-shared-browser-context

Default: false

--chromium-debug-protocolCHROMIUM_DEBUG_PROTOCOLboolean

Log every DevTools Protocol message between Gotenberg and Chromium at the debug level of --log-level (LOG_LEVEL). The messages carry URLs, cookies and header values whole, credentials included: enable it only to troubleshoot

Default: false

--chromium-deny-listCHROMIUM_DENY_LISTlist

Set the denied URLs for Chromium using regular expressions - supports multiple values. A Web Worker's HTTPS request shows its host only: the list sees https://host/, so a rule that names a path cannot refuse it

Default: [^file:(?!//\/tmp/).*]

--chromium-deny-private-ipsCHROMIUM_DENY_PRIVATE_IPSboolean

Reject URLs whose host resolves to a non-public IP address (loopback, RFC1918, link-local, unique-local). Enable on deployments that accept untrusted form input to mitigate SSRF against internal services

Default: false

--chromium-deny-public-ipsCHROMIUM_DENY_PUBLIC_IPSboolean

Reject URLs whose host resolves to a public IP address. Enable on air-gapped or data-governed deployments to prevent outbound traffic from leaving a private network

Default: false

--chromium-disable-javascriptCHROMIUM_DISABLE_JAVASCRIPTboolean

Disable JavaScript

Default: false

--chromium-disable-routesCHROMIUM_DISABLE_ROUTESboolean

Disable the routes

Default: false

--chromium-disable-web-securityCHROMIUM_DISABLE_WEB_SECURITYboolean

Don't enforce the same-origin policy

Default: false

--chromium-enable-environment-proxyCHROMIUM_ENABLE_ENVIRONMENT_PROXYboolean

Route Chromium's outbound requests through the proxy defined by the standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables, including credentials. Use this instead of --chromium-proxy-server for authenticated proxies, and leave --chromium-proxy-server and --chromium-host-resolver-rules unset

Default: false

--chromium-host-resolver-rulesCHROMIUM_HOST_RESOLVER_RULESstring

Set custom mappings to the host resolver, such as MAP intranet.local 10.0.0.5. The internal DNS-rebinding pinning proxy applies them and checks the address a rule maps a host to, so --chromium-deny-private-ips (CHROMIUM_DENY_PRIVATE_IPS) and --chromium-deny-public-ips (CHROMIUM_DENY_PUBLIC_IPS) still hold

Default: none

--chromium-idle-shutdown-timeoutCHROMIUM_IDLE_SHUTDOWN_TIMEOUTduration

Shutdown Chromium after being idle for the given duration. 0 keeps it running

Default: 0s

--chromium-ignore-certificate-errorsCHROMIUM_IGNORE_CERTIFICATE_ERRORSboolean

Ignore the certificate errors

Default: false

--chromium-max-concurrencyCHROMIUM_MAX_CONCURRENCYinteger

Maximum number of concurrent conversions. Chromium supports up to 6

Default: 6

--chromium-max-memoryCHROMIUM_MAX_MEMORYstring

Set the anonymous resident memory Chromium, all its processes together, may hold while it converts - it accepts values like 1500MB, 2GB, etc. Over it, Gotenberg kills Chromium, which fails every conversion in flight with a 503, and restarts it. Keep it under the container's memory limit, so that a runaway page does not get the container OOM-killed. Empty disables this feature

Default: none

--chromium-max-queue-sizeCHROMIUM_MAX_QUEUE_SIZEinteger

Maximum request queue size for Chromium. 0 means no limit

Default: 0

--chromium-proxy-serverCHROMIUM_PROXY_SERVERstring

Set the outbound proxy server; this switch only affects HTTP and HTTPS requests. Setting it turns off the internal DNS-rebinding pinning proxy: your proxy resolves each host after Gotenberg checks it, so a DNS rebinding can slip past --chromium-deny-private-ips (CHROMIUM_DENY_PRIVATE_IPS) and --chromium-deny-public-ips (CHROMIUM_DENY_PUBLIC_IPS)

Default: none

--chromium-restart-afterCHROMIUM_RESTART_AFTERinteger

Number of conversions after which Chromium will automatically restart. 0 never restarts it

Default: 100

--chromium-shared-browser-contextCHROMIUM_SHARED_BROWSER_CONTEXTboolean

Run every conversion in one shared browser context, so cookies, cache, and storage carry over between conversions. Only enable it when all callers trust each other: a conversion can then reuse cookies another one set

Default: false

--chromium-start-timeoutCHROMIUM_START_TIMEOUTduration

Maximum duration to wait for Chromium to start or restart

Default: 20s

LibreOffice​

--libreoffice-allow-listLIBREOFFICE_ALLOW_LISTlist

Set the allowed URLs for the requests LibreOffice sends, using regular expressions - supports multiple values. LibreOffice requests only the style sheets an HTML document links, and the URLs a document's macros open once --libreoffice-enable-macros (LIBREOFFICE_ENABLE_MACROS) runs them; the images and other content an uploaded document links to never load. A match bypasses --libreoffice-deny-private-ips (LIBREOFFICE_DENY_PRIVATE_IPS) and --libreoffice-deny-public-ips (LIBREOFFICE_DENY_PUBLIC_IPS), so terminate the host or the pattern also matches suffix hosts, for example ^https?://internal\.svc(:|/|$)

Default: none

--libreoffice-auto-startLIBREOFFICE_AUTO_STARTboolean

Automatically launch LibreOffice upon initialization if set to true; otherwise, LibreOffice will start at the time of the first conversion

Default: false

--libreoffice-deny-listLIBREOFFICE_DENY_LISTlist

Set the denied URLs for the requests LibreOffice sends, using regular expressions - supports multiple values. LibreOffice requests only the style sheets an HTML document links, and the URLs a document's macros open once --libreoffice-enable-macros (LIBREOFFICE_ENABLE_MACROS) runs them; the images and other content an uploaded document links to never load. An HTTPS request shows its host only: the list sees https://host/, so a rule that names a path cannot refuse it

Default: none

--libreoffice-deny-private-ipsLIBREOFFICE_DENY_PRIVATE_IPSboolean

Reject the requests LibreOffice sends whose host resolves to a non-public IP address (loopback, RFC1918, link-local, unique-local). LibreOffice requests only the style sheets an HTML document links, and the URLs a document's macros open once --libreoffice-enable-macros (LIBREOFFICE_ENABLE_MACROS) runs them; the images and other content an uploaded document links to never load. Enable on deployments that accept untrusted documents to mitigate SSRF against internal services

Default: false

--libreoffice-deny-public-ipsLIBREOFFICE_DENY_PUBLIC_IPSboolean

Reject the requests LibreOffice sends whose host resolves to a public IP address. LibreOffice requests only the style sheets an HTML document links, and the URLs a document's macros open once --libreoffice-enable-macros (LIBREOFFICE_ENABLE_MACROS) runs them; the images and other content an uploaded document links to never load. Enable on air-gapped or data-governed deployments to prevent outbound traffic from leaving a private network

Default: false

--libreoffice-disable-routesLIBREOFFICE_DISABLE_ROUTESboolean

Disable the routes

Default: false

--libreoffice-enable-environment-proxyLIBREOFFICE_ENABLE_ENVIRONMENT_PROXYboolean

Route LibreOffice outbound fetches through the proxy defined by the standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables, including credentials

Default: false

--libreoffice-enable-macrosLIBREOFFICE_ENABLE_MACROSboolean

Run the macros of the converted documents, including the ones bound to document events such as load. Macros run code inside the container: enable it only for trusted documents

Default: false

--libreoffice-idle-shutdown-timeoutLIBREOFFICE_IDLE_SHUTDOWN_TIMEOUTduration

Shutdown LibreOffice after being idle for the given duration. 0 keeps it running

Default: 0s

--libreoffice-max-memoryLIBREOFFICE_MAX_MEMORYstring

Set the anonymous resident memory LibreOffice may hold during a conversion - it accepts values like 900MB, 1GB, etc. Over it, Gotenberg kills LibreOffice, answers 422 and restarts it. Keep it under the container's memory limit, so that a runaway conversion fails alone rather than getting the container OOM-killed. Empty disables this feature

Default: none

--libreoffice-max-queue-sizeLIBREOFFICE_MAX_QUEUE_SIZEinteger

Maximum request queue size for LibreOffice. 0 means no limit

Default: 0

--libreoffice-restart-afterLIBREOFFICE_RESTART_AFTERinteger

Number of conversions after which LibreOffice will automatically restart. 0 never restarts it

Default: 10

--libreoffice-start-timeoutLIBREOFFICE_START_TIMEOUTduration

Maximum duration to wait for LibreOffice to start or restart

Default: 20s

PDF​

How litho processes PDFs, and the timestamp authorities the sign and timestamp stages may call.

--pdf-allow-listPDF_ALLOW_LISTlist

Set the allowed timestamp authority URLs for the sign and timestamp stages using regular expressions - supports multiple values. A match bypasses --pdf-deny-private-ips (PDF_DENY_PRIVATE_IPS) and --pdf-deny-public-ips (PDF_DENY_PUBLIC_IPS), so terminate the host or the pattern also matches suffix hosts, for example ^https?://tsa\.example\.com(:|/|$)

Default: none

--pdf-deny-listPDF_DENY_LISTlist

Set the denied timestamp authority URLs for the sign and timestamp stages using regular expressions - supports multiple values

Default: none

--pdf-deny-private-ipsPDF_DENY_PRIVATE_IPSboolean

Reject timestamp authority URLs whose host resolves to a non-public IP address (loopback, RFC1918, link-local, unique-local). Enable on deployments that accept untrusted requests to mitigate SSRF against internal services

Default: false

--pdf-deny-public-ipsPDF_DENY_PUBLIC_IPSboolean

Reject timestamp authority URLs whose host resolves to a public IP address. Enable on air-gapped or data-governed deployments

Default: false

--pdf-disable-routesPDF_DISABLE_ROUTESboolean

Disable the routes

Default: false

--pdf-disable-stagesPDF_DISABLE_STAGESboolean

Refuse the stages field of the Chromium and LibreOffice conversion routes, so that they only convert - with --pdf-disable-routes (PDF_DISABLE_ROUTES), no request runs PDF processing

Default: false

--pdf-enable-environment-proxyPDF_ENABLE_ENVIRONMENT_PROXYboolean

Route timestamp authority requests through the proxy defined by the standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables, including credentials

Default: false

--pdf-max-concurrencyPDF_MAX_CONCURRENCYinteger

Set the maximum number of PDF documents a request processes concurrently, across all requests - raising it trades memory and CPU for speed on multi-document requests

Default: 1

--pdf-max-embedded-file-bytesPDF_MAX_EMBEDDED_FILE_BYTESstring

Set the maximum size of an embedded file read for validation - it accepts values like 50MB, 1GB, etc; empty keeps litho's default, 50 MiB

Default: none

--pdf-max-image-pixelsPDF_MAX_IMAGE_PIXELSinteger

Set the maximum number of pixels an image may hold - 0 keeps litho's default, 100000000 (100 million)

Default: 0

--pdf-max-render-pixelsPDF_MAX_RENDER_PIXELSinteger

Set the maximum number of pixels a page drawn as an image may hold, at 16 bytes of memory each - 0 keeps litho's default, 50000000 (50 million), a Letter or A4 page at 600 dpi. The render stage refuses a larger page; flatten-transparency composites at a lower resolution to fit

Default: 0

--pdf-max-stream-bytesPDF_MAX_STREAM_BYTESstring

Set the maximum size a PDF stream may decode to - it accepts values like 256MB, 1GB, etc; empty keeps litho's default, 256 MiB

Default: none

Webhook​

--webhook-allow-listWEBHOOK_ALLOW_LISTlist

Set the allowed URLs for the webhook feature using regular expressions - supports multiple values. A match bypasses --webhook-deny-private-ips (WEBHOOK_DENY_PRIVATE_IPS) and --webhook-deny-public-ips (WEBHOOK_DENY_PUBLIC_IPS), so terminate the host or the pattern also matches suffix hosts, for example ^https?://internal\.svc(:|/|$)

Default: none

--webhook-client-timeoutWEBHOOK_CLIENT_TIMEOUTduration

Set the time limit for requests to the webhook

Default: 30s

--webhook-deny-listWEBHOOK_DENY_LISTlist

Set the denied URLs for the webhook feature using regular expressions - supports multiple values

Default: none

--webhook-deny-private-ipsWEBHOOK_DENY_PRIVATE_IPSboolean

Reject webhook URLs whose host resolves to a non-public IP address (loopback, RFC1918, link-local, unique-local). Enable on deployments that accept untrusted webhook destinations to mitigate SSRF against internal services

Default: false

--webhook-deny-public-ipsWEBHOOK_DENY_PUBLIC_IPSboolean

Reject webhook URLs whose host resolves to a public IP address. Enable on air-gapped or data-governed deployments to prevent callbacks from leaving a private network

Default: false

--webhook-disableWEBHOOK_DISABLEboolean

Disable the webhook feature

Default: false

--webhook-enable-environment-proxyWEBHOOK_ENABLE_ENVIRONMENT_PROXYboolean

Route webhook callbacks through the proxy defined by the standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables, including credentials

Default: false

--webhook-enable-sync-modeWEBHOOK_ENABLE_SYNC_MODEboolean

Enable synchronous mode for the webhook feature

Default: false

--webhook-max-retryWEBHOOK_MAX_RETRYinteger

Set the maximum number of retries for the webhook feature

Default: 4

--webhook-retry-max-waitWEBHOOK_RETRY_MAX_WAITduration

Set the maximum duration to wait before trying to call the webhook again

Default: 30s

--webhook-retry-min-waitWEBHOOK_RETRY_MIN_WAITduration

Set the minimum duration to wait before trying to call the webhook again

Default: 1s

Logging​

--log-fields-prefixLOG_FIELDS_PREFIXstring

Prepend a specified prefix to each log field key

Default: none

--log-levelLOG_LEVELstring

Set the log level

Default: info

--log-std-enable-gcp-fieldsLOG_STD_ENABLE_GCP_FIELDSboolean

Use GCP-compatible field names in log output

Default: false

--log-std-formatLOG_STD_FORMATstring

Set the format of the logs Gotenberg writes to standard error

Default: auto

--log-std-level-caseLOG_STD_LEVEL_CASEstring

Set the case of the level field in the logs Gotenberg writes to standard error, either lower or upper

Default: lower

Gotenberg​

The process itself: startup banner, debug data, graceful shutdown.

--gotenberg-build-debug-dataGOTENBERG_BUILD_DEBUG_DATAboolean

Set if build data is needed

Default: true

--gotenberg-graceful-shutdown-durationGOTENBERG_GRACEFUL_SHUTDOWN_DURATIONduration

Set the graceful shutdown duration

Default: 30s

--gotenberg-hide-bannerGOTENBERG_HIDE_BANNERboolean

Hide the ASCII art banner above the startup summary

Default: false