Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,9 @@ DATABASE_PASSWORD=change-me
# Feature flags
# STACKABLE_COCKPIT_COMPLETION_ENABLED=false # Disable SQL editor code completion (default: true)
# STACKABLE_COCKPIT_STORAGE_BROWSER_ENABLED=true # Enable S3/HDFS file browser (default: false)
# PUBLIC_STACKABLE_COCKPIT_STORAGE_RESTORE_TABS=true # File browser: continue where you left off — restore open tabs from the last session (default: false)
# PUBLIC_STACKABLE_COCKPIT_INFINITE_SCROLL_ENABLED=true # Load CSV and Parquet preview rows lazily while scrolling; any other value than "true" disables it (default: true)
# PUBLIC_STACKABLE_COCKPIT_STORAGE_CUT_COPY_ENABLED=true # Enables cut/copy and dragging in the storage browser; client-only, the server work is gated by paste/move (default: false)
# PUBLIC_STACKABLE_COCKPIT_STORAGE_PASTE_ENABLED=true # Enables paste in the storage browser; the transfer API accepts copies only with this, and moves with this or MOVE_ENABLED (default: false)
# PUBLIC_STACKABLE_COCKPIT_STORAGE_RENAME_ENABLED=true # Enables rename in the storage browser; also enforced by the transfer API (default: false)
# PUBLIC_STACKABLE_COCKPIT_STORAGE_MOVE_ENABLED=true # Enables drag-and-drop move in the storage browser (dragging also needs CUT_COPY_ENABLED); the transfer API accepts moves with this or PASTE_ENABLED (default: false)
# PUBLIC_STACKABLE_COCKPIT_STORAGE_TRANSFER_ENABLED=true # Enables cut, copy, paste, rename and drag-and-drop move in the storage browser; also enforced by the transfer API (default: false)

# Storage browser limits and settings
# Storage browser limits and settings. Invalid values stop the server at startup.
# STACKABLE_COCKPIT_TEXT_PREVIEW_BYTES=262144 # Max bytes fetched for text, TSV and JSON previews; editable files are fetched completely (default: 262144)
# STACKABLE_COCKPIT_IMAGE_PREVIEW_BYTES=5242880 # Max bytes fetched for image previews (default: 5242880)
# STACKABLE_COCKPIT_PDF_PREVIEW_BYTES=26214400 # Max bytes fetched for PDF previews (default: 26214400)
Expand Down
7 changes: 1 addition & 6 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ STACKABLE_COCKPIT_PDF_PREVIEW_BYTES=26214400
STACKABLE_COCKPIT_FILE_PREVIEW_ROWS=250
STACKABLE_COCKPIT_FILE_PREVIEW_COLUMNS=50
STACKABLE_COCKPIT_PARQUET_PREVIEW_DISALLOWED_COMPRESSION_TYPES=gzip-no_offset
PUBLIC_STACKABLE_COCKPIT_STORAGE_RESTORE_TABS=true
PUBLIC_STACKABLE_COCKPIT_PAGE_SIZES=25,50,100
PUBLIC_STACKABLE_COCKPIT_DEFAULT_PAGE_SIZE=25
PUBLIC_STACKABLE_COCKPIT_MAX_RECENT_FILES=15
PUBLIC_STACKABLE_COCKPIT_UPLOAD_CONCURRENCY=3
PUBLIC_STACKABLE_COCKPIT_INFINITE_SCROLL_ENABLED=true
PUBLIC_STACKABLE_COCKPIT_STORAGE_CUT_COPY_ENABLED=true
PUBLIC_STACKABLE_COCKPIT_STORAGE_PASTE_ENABLED=true
PUBLIC_STACKABLE_COCKPIT_STORAGE_RENAME_ENABLED=true
PUBLIC_STACKABLE_COCKPIT_STORAGE_MOVE_ENABLED=true
PUBLIC_STACKABLE_COCKPIT_STORAGE_TRANSFER_ENABLED=true
# One object at a time, so the cancel E2E test can stop a move mid-way.
STACKABLE_COCKPIT_STORAGE_TRANSFER_CONCURRENCY=1
GARAGE_ADMIN_URL=http://localhost:30902
Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,15 @@ docker run -p 3000:3000 cockpit:0.0.0-dev

The application is configured via environment variables.
Create a `.env` file at the project root, or set them in your deployment environment.
Invalid values (e.g. `abc` for an integer) stop the server at startup with an error that names the invalid variables.

### Feature Flags

| Variable | Type | Default | Description | Example |
| --------------------------------------------------- | -------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| `STACKABLE_COCKPIT_COMPLETION_ENABLED` | `boolean` (`"false"` to disable) | `true` | Enables the SQL editor code-completion provider and the metadata endpoint. Set to `"false"` to fall back to plain syntax highlighting. | `STACKABLE_COCKPIT_COMPLETION_ENABLED=false` |
| `STACKABLE_COCKPIT_STORAGE_BROWSER_ENABLED` | `boolean` (`"true"` to enable) | `false` | Shows the S3/HDFS file browser in the sidebar and activates routes under `/storage`. Must be explicitly opted in to expose storage credentials and the file-browser UI. | `STACKABLE_COCKPIT_STORAGE_BROWSER_ENABLED=true` |
| `PUBLIC_STACKABLE_COCKPIT_STORAGE_CUT_COPY_ENABLED` | `boolean` (`"true"` to enable) | `false` | Shows Cut/Copy in the file browser and lets items be dragged. Client-only: it fills the clipboard, the S3 work happens on paste or move. | `PUBLIC_STACKABLE_COCKPIT_STORAGE_CUT_COPY_ENABLED=true` |
| `PUBLIC_STACKABLE_COCKPIT_STORAGE_PASTE_ENABLED` | `boolean` (`"true"` to enable) | `false` | Shows Paste in the file browser. When disabled, the server rejects copies via `/api/storage/transfer` with 404, and moves too unless the Move flag is enabled. | `PUBLIC_STACKABLE_COCKPIT_STORAGE_PASTE_ENABLED=true` |
| `PUBLIC_STACKABLE_COCKPIT_STORAGE_RENAME_ENABLED` | `boolean` (`"true"` to enable) | `false` | Shows Rename in the file browser. The server accepts renames via `/api/storage/transfer` only when this is enabled. | `PUBLIC_STACKABLE_COCKPIT_STORAGE_RENAME_ENABLED=true` |
| `PUBLIC_STACKABLE_COCKPIT_STORAGE_MOVE_ENABLED` | `boolean` (`"true"` to enable) | `false` | Enables drag-and-drop move in the file browser (dragging also needs cut/copy). The server accepts moves via `/api/storage/transfer` only when this or paste is enabled, since cut-and-paste also moves. | `PUBLIC_STACKABLE_COCKPIT_STORAGE_MOVE_ENABLED=true` |
| Variable | Type | Default | Description | Example |
| --------------------------------------------------- | -------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| `STACKABLE_COCKPIT_COMPLETION_ENABLED` | `boolean` (`"false"` to disable) | `true` | Enables the SQL editor code-completion provider and the metadata endpoint. Set to `"false"` to fall back to plain syntax highlighting. | `STACKABLE_COCKPIT_COMPLETION_ENABLED=false` |
| `STACKABLE_COCKPIT_STORAGE_BROWSER_ENABLED` | `boolean` (`"true"` to enable) | `false` | Shows the S3/HDFS file browser in the sidebar and activates routes under `/storage`. Must be explicitly opted in to expose storage credentials and the file-browser UI. | `STACKABLE_COCKPIT_STORAGE_BROWSER_ENABLED=true` |
| `PUBLIC_STACKABLE_COCKPIT_STORAGE_TRANSFER_ENABLED` | `boolean` (`"true"` to enable) | `false` | Shows Cut, Copy, Paste and Rename in the file browser and enables drag-and-drop move. When disabled, the server rejects copies, moves and renames via `/api/storage/transfer` with 404. | `PUBLIC_STACKABLE_COCKPIT_STORAGE_TRANSFER_ENABLED=true` |

### Storage Preview Limits

Expand All @@ -115,9 +113,9 @@ Create a `.env` file at the project root, or set them in your deployment environ

### Storage Transfers

| Variable | Type | Default | Description | Example |
| ------------------------------------------------ | --------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| `STACKABLE_COCKPIT_STORAGE_TRANSFER_CONCURRENCY` | `integer` | `8` | Objects copied at once within one copy, move or rename request. Copies run server-side in the storage backend (S3 CopyObject); no data streams through the app. A missing or invalid value falls back to the default. | `STACKABLE_COCKPIT_STORAGE_TRANSFER_CONCURRENCY=4` |
| Variable | Type | Default | Description | Example |
| ------------------------------------------------ | --------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| `STACKABLE_COCKPIT_STORAGE_TRANSFER_CONCURRENCY` | `integer` | `8` | Objects copied at once within one copy, move or rename request. Copies run server-side in the storage backend (S3 CopyObject); no data streams through the app. | `STACKABLE_COCKPIT_STORAGE_TRANSFER_CONCURRENCY=4` |

### Request Body Size

Expand Down
53 changes: 31 additions & 22 deletions deploy/helm/cockpit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ The following table lists the configurable parameters of the Cockpit chart and t
| --- | --- | --- |
| `config.nodeEnv` | Node.js environment | `production` |
| `config.bodySizeLimit` | Sets `BODY_SIZE_LIMIT`, the maximum request body size (e.g. `12M`). Must be at least the editable file size limit (`PUBLIC_STACKABLE_COCKPIT_MAX_EDITABLE_FILE_SIZE`, 5 MiB by default), otherwise saving larger files in the text editor fails. | `""` (image default `6M`) |
| `config.archiveCacheMaxMb` | Sets `STACKABLE_COCKPIT_ARCHIVE_CACHE_MAX_MB`, the maximum total size in MB of the archive preview cache in `/tmp`. Keep it below `tmp.sizeLimit`. | `""` (app default `512`) |
| `tmp.sizeLimit` | Size limit of the `/tmp` emptyDir. The kubelet evicts the pod when it is exceeded. Keep it above `config.archiveCacheMaxMb`. Empty means no limit. | `1Gi` |
| `tmp.sizeLimit` | Size limit of the `/tmp` emptyDir. The kubelet evicts the pod when it is exceeded. Keep it above `storage.archiveCacheMaxMb`. Empty means no limit. | `1Gi` |

### Database Parameters

Expand All @@ -122,26 +121,29 @@ All feature parameters are optional. Omit them to use the application defaults.
| --- | --- | --- |
| `features.trino.completion.enabled` | Enable SQL code completion. | `true` (application default) |
| `features.storage.enabled` | Show the S3/HDFS file browser and enable routes under `/storage`. | `false` (application default) |
| `features.storage.pageSizes` | Comma-separated page size options. | `25,50,100` (application default) |
| `features.storage.defaultPageSize` | Default page size; must be included in `pageSizes`. | First configured page size (application default) |
| `features.storage.maxRecentFiles` | Number of recently visited storage locations retained locally. | `15` (application default) |
| `features.storage.uploadConcurrency` | Maximum parallel requests for file uploads. | `3` (application default) |
| `features.storage.textPreviewBytes` | Maximum bytes fetched for text, TSV, and JSON previews. Editable text files (text types except CSV/TSV, up to the editable file size limit) are always fetched completely. | `262144` (application default) |
| `features.storage.imagePreviewBytes` | Maximum bytes fetched for image previews. | `5242880` (application default) |
| `features.storage.pdfPreviewBytes` | Maximum bytes fetched for PDF previews. | `26214400` (application default) |
| `features.storage.filePreviewRows` | Maximum rows in tabular file previews. | `250` (application default) |
| `features.storage.filePreviewColumns` | Maximum columns in tabular file previews. | `50` (application default) |
| `features.storage.transferConcurrency` | Objects copied at once within one copy, move or rename request. | `8` (application default) |
| `features.storage.restoreTabs` | Restore open file browser tabs from the last session. | `false` (application default) |
| `features.storage.infiniteScroll` | Load CSV and Parquet preview rows lazily while scrolling. | `true` (application default) |
| `features.storage.cutCopy` | Show Cut/Copy and allow dragging items. Client-only: the server work happens on paste or move. | `false` (application default) |
| `features.storage.paste` | Show Paste. The transfer API accepts copies only when this is enabled, and moves when this or `move` is enabled. | `false` (application default) |
| `features.storage.rename` | Show Rename. The transfer API only accepts renames when this is enabled. | `false` (application default) |
| `features.storage.move` | Allow drag-and-drop move. Dragging also needs `cutCopy`. The transfer API accepts moves when this or `paste` is enabled. | `false` (application default) |
| `features.storage.maxEditableFileSize` | Maximum size in bytes of files that can be edited and saved in the text editor. `config.bodySizeLimit` must be at least this large. | `5242880` (application default) |
| `features.storage.archivePreviewMaxMb` | Maximum size in MB of an archive opened for preview, checked against its compressed size, the total size of the listed entries and the size of an extracted entry. The archive cache is raised to at least twice this value, so keep `tmp.sizeLimit` above that. | `100` (application default) |
| `features.storage.parquetPreviewDisallowedCompressionTypes` | Comma-separated Parquet compression codecs that are not previewed. A `-no_offset` suffix (e.g. `gzip-no_offset`) only blocks files without an offset index. | `gzip-no_offset` (application default) |
| `features.storage.downloadHistoryRetentionDays` | Days a user's download history is kept. Integer from 1 to 3650. | `30` (application default) |
| `features.storage.transfer` | Show Cut, Copy, Paste and Rename and allow drag-and-drop move. The transfer API rejects copies, moves and renames while this is disabled. | `false` (application default) |

### Storage Browser Parameters

Limits and tuning for the file browser. Empty values use the application defaults; invalid values stop the application at startup.

| Parameter | Description | Default |
| --- | --- | --- |
| `storage.pageSizes` | Comma-separated page size options. | `""` (application default `25,50,100`) |
| `storage.defaultPageSize` | Default page size; must be included in `pageSizes`. | `""` (application default Smallest page size) |
| `storage.maxRecentFiles` | Number of recently visited storage locations retained locally. | `""` (application default `15`) |
| `storage.uploadConcurrency` | Maximum parallel requests for file uploads. | `""` (application default `3`) |
| `storage.transferConcurrency` | Objects copied at once within one copy, move or rename request. | `""` (application default `8`) |
| `storage.textPreviewBytes` | Maximum bytes fetched for text, TSV, and JSON previews. Editable text files (text types except CSV/TSV, up to the editable file size limit) are always fetched completely. | `""` (application default `262144`) |
| `storage.imagePreviewBytes` | Maximum bytes fetched for image previews. | `""` (application default `5242880`) |
| `storage.pdfPreviewBytes` | Maximum bytes fetched for PDF previews. | `""` (application default `26214400`) |
| `storage.filePreviewRows` | Maximum rows in tabular file previews. | `""` (application default `250`) |
| `storage.filePreviewColumns` | Maximum columns in tabular file previews. | `""` (application default `50`) |
| `storage.maxEditableFileSize` | Maximum size in bytes of files that can be edited and saved in the text editor. `config.bodySizeLimit` must be at least this large. | `""` (application default `5242880`) |
| `storage.archivePreviewMaxMb` | Maximum size in MB of an archive opened for preview, checked against its compressed size, the total size of the listed entries and the size of an extracted entry. The archive cache is raised to at least twice this value, so keep `tmp.sizeLimit` above that. | `""` (application default `100`) |
| `storage.archiveCacheMaxMb` | Maximum total size in MB of the archive preview cache in `/tmp`. Keep it below `tmp.sizeLimit`. | `""` (application default `512`) |
| `storage.parquetPreviewDisallowedCompressionTypes` | Comma-separated Parquet compression codecs that are not previewed. A `-no_offset` suffix (e.g. `gzip-no_offset`) only blocks files without an offset index. | `""` (application default `gzip-no_offset`) |
| `storage.downloadHistoryRetentionDays` | Days a user's download history is kept. Integer from 1 to 3650. | `""` (application default `30`) |

### Authentication Parameters

Expand Down Expand Up @@ -198,6 +200,13 @@ A configured CA certificate (`caCert` or `secretClass`) replaces the system trus
| `extraVolumes` | Additional pod volumes, e.g. a Secret holding a CA certificate for `trino.tls.caCert`, `database.tls.caCert` or `storage.tls.caCert`. | `[]` |
| `extraVolumeMounts` | Additional volume mounts for the Cockpit container. | `[]` |

### Environment Parameters

| Parameter | Description | Default |
| --- | --- | --- |
| `extraEnv` | Additional environment variables for the Cockpit container, e.g. settings the chart does not expose. Do not repeat a variable the chart already sets. | `[]` |
| `extraEnvFrom` | Additional `envFrom` sources (ConfigMaps or Secrets) for the Cockpit container. | `[]` |

### Resource Parameters

| Parameter | Description | Default |
Expand Down
16 changes: 16 additions & 0 deletions deploy/helm/cockpit/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,19 @@ Database port, validated: int64 turns "" or "abc" into 0, which would fail only
{{- end }}
{{- $port }}
{{- end }}

{{/*
A value as a quoted environment variable. A whole number arrives as float64 and would render
as 5.24288e+06. Anything else is passed through unchanged for the application to validate.
*/}}
{{- define "cockpit.envValue" -}}
{{- if and (kindIs "float64" .) (eq (floor .) .) }}{{ int64 . | quote }}{{ else }}{{ . | quote }}{{ end }}
{{- end }}

{{/*
"true" when a value is set: not omitted, null or an empty string. Unlike `with`, 0 and false
count as set, so the application rejects them instead of the chart dropping them.
*/}}
{{- define "cockpit.isSet" -}}
{{- if and (not (kindIs "invalid" .)) (ne (toString .) "") }}true{{ end }}
{{- end }}
Loading
Loading