diff --git a/self-host/customize-deployment/environment-variables.mdx b/self-host/customize-deployment/environment-variables.mdx index 6513f528..e82ff0b1 100644 --- a/self-host/customize-deployment/environment-variables.mdx +++ b/self-host/customize-deployment/environment-variables.mdx @@ -137,6 +137,15 @@ These variables allow you to configure [S3 Object Storage](/self-host/customize- | `RESULTS_S3_REGION` | Region where the S3 query storage bucket is located (default=S3_REGION) | | `RESULTS_S3_ACCESS_KEY` | Access key for authenticating with the S3 query storage bucket (default=S3_ACCESS_KEY) | | `RESULTS_S3_SECRET_KEY` | Secret key for authenticating with the S3 query storage bucket (default=S3_SECRET_KEY) | +| `PERSISTENT_DOWNLOAD_URLS_ENABLED` | Enables persistent download URLs for CSV and dashboard exports. When enabled, downloads return a stable Lightdash-hosted URL instead of a direct S3 signed URL. Each time the persistent URL is accessed, a fresh S3 signed URL is generated on the fly. (default=false) | +| `PERSISTENT_DOWNLOAD_URL_EXPIRATION_SECONDS` | How long persistent download URLs remain accessible before expiring. Each access within this window generates a fresh S3 signed URL. (default=259200, 3 days) | + +### Persistent download URLs + +When `PERSISTENT_DOWNLOAD_URLS_ENABLED` is set to `true`, CSV and dashboard ZIP exports return a stable Lightdash-hosted URL (e.g. `https://lightdash.example.com/api/v1/file/{id}`) instead of a direct S3 signed URL. Each time this URL is accessed, Lightdash generates a short-lived S3 signed URL and redirects to it. This means: + +- The underlying S3 URL never goes stale and download links survive IAM credential rotation +- The persistent URL itself remains accessible for the duration set by `PERSISTENT_DOWNLOAD_URL_EXPIRATION_SECONDS` (default: 3 days), after which it returns a "download link has expired" error ## Cache