mirror of
https://github.com/kerberos-io/helm-charts.git
synced 2026-11-25 23:40:24 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf4c7cbafd |
+45
-36
@@ -58,7 +58,7 @@ legacy opt-out, TLS/configuration mounts and deployment modes.
|
||||
### Hardened frontend images
|
||||
|
||||
Starting with chart **`0.170.0`**, both frontends default to shell-free
|
||||
`ghcr.io/uug-ai/hub-frontend` (default `v1.19.80` since chart `0.209.0`), running as `65532:65532` on port `8080`
|
||||
`ghcr.io/uug-ai/hub-frontend:v1.19.42`, running as `65532:65532` on port `8080`
|
||||
with a read-only root filesystem and writable `/tmp`. The Service and ingress
|
||||
remain on port `80`. Admin retains its legacy image and port `80`; its hardened
|
||||
runtime remains opt-in.
|
||||
@@ -583,6 +583,44 @@ Both settings default to off; the API setting applies only to Hub API pods in
|
||||
|
||||
Validate rendering with `bash scripts/check-hub-ask.sh` from the repository root.
|
||||
|
||||
### Redaction plans
|
||||
|
||||
A redaction plan is the saved state of the redaction editor for one video: a
|
||||
list of regions to hide, each with its own style (blur, pixelate or black),
|
||||
frame range and positions. With plans the editor is no longer limited to the
|
||||
tracks a detector found, and it keeps a draft per video.
|
||||
|
||||
```yaml
|
||||
kerberoshub:
|
||||
api:
|
||||
redactionPlans:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
One value switches both sides: `REDACTION_PLANS_ENABLED` on Hub API and
|
||||
`FEATURE_REDACTION_PLANS_ENABLED` on the frontend (and the demo frontend). The
|
||||
frontend cannot be switched on without the API. It defaults to off.
|
||||
|
||||
Switch it on only when all three are in place:
|
||||
|
||||
- **Redaction worker:** the `hub-pipeline-redaction` worker that consumes this
|
||||
deployment's redaction queue is newer than v1.2.15. An older worker finds no
|
||||
regions in a plan-only job and stores an unchanged copy of the video as a
|
||||
completed redaction. Check the worker that really renders the jobs: a
|
||||
deployment without its own worker has them rendered by another one on the
|
||||
same queue.
|
||||
- **Hub API:** an image with redaction plans. Until then the variable is
|
||||
ignored and `regions` edits are refused.
|
||||
- **Frontend:** an image with redaction plans. Until then the variable is
|
||||
ignored and the editor works on detector tracks only.
|
||||
|
||||
While it is off, Hub API refuses redaction edits of type `regions` and answers
|
||||
404 on the plan and draft routes. Redactions made from detector tracks work
|
||||
with the setting on or off.
|
||||
|
||||
Validate rendering with `bash scripts/check-hub-redaction-plans.sh` from the
|
||||
repository root.
|
||||
|
||||
### Passkeys
|
||||
|
||||
Users and sub-users can create and manage their own passkeys in **Profile >
|
||||
@@ -945,7 +983,7 @@ kerberospipeline:
|
||||
| `kerberoshub.serviceAccount.labels` | Labels applied to `kerberoshub.serviceAccount` resources. | `""` |
|
||||
| `kerberoshub.api.repository` | The Docker registry where the Kerberos Hub API container is hosted. | `"ghcr.io/uug-ai/hub-api"` |
|
||||
| `kerberoshub.api.pullPolicy` | The Docker registry pull policy. | `"IfNotPresent"` |
|
||||
| `kerberoshub.api.tag` | The Docker image tag/version. | `"v1.11.93"` |
|
||||
| `kerberoshub.api.tag` | The Docker image tag/version. | `"v1.11.43"` |
|
||||
| `kerberoshub.api.replicas` | The number of pods/replicas running for the Kerberos Hub API deployment. | `2` |
|
||||
| `kerberoshub.api.audit.enabled` | Enable audit publishing from Hub API when global auditing is enabled. | `true` |
|
||||
| `kerberoshub.api.logLevel` | Log verbosity level for `kerberoshub.api`. | `"info"` |
|
||||
@@ -969,6 +1007,7 @@ kerberospipeline:
|
||||
| `kerberoshub.api.accountDeletion.enabled` | An owner can delete their own account on the profile page: sets `FEATURE_ACCOUNT_DELETION_ENABLED` on hub-api and the frontend. A deletion locks the account at once and is erased after `graceDays`. An account that is already locked stays locked, and can still be reactivated, when this is switched off again. | `false` |
|
||||
| `kerberoshub.api.accountDeletion.graceDays` | Days a requested deletion can still be cancelled by signing in, 0 to 30 (`ACCOUNT_DELETION_GRACE_DAYS`). | `14` |
|
||||
| `kerberoshub.api.organisationDeletion.enabled` | The primary owner of an organisation can delete it in the organisation settings: sets `FEATURE_ORGANISATION_DELETION_ENABLED` on hub-api and the frontend. A deletion closes the organisation to every member at once and is erased after `accountDeletion.graceDays` by the `kerberoshub.cleanup.accountDeletion.purge` worker; members keep their accounts and their other organisations. An organisation that is already closed stays closed, and its primary owner can still reopen it, when this is switched off again. | `false` |
|
||||
| `kerberoshub.api.redactionPlans.enabled` | Redaction plans: the redaction editor saves and submits a list of regions, each with its own style and frame range, and keeps a draft per video. Sets `REDACTION_PLANS_ENABLED` on hub-api, which then accepts redaction edits of type `regions`, stores their plan and serves the plan and draft routes, and `FEATURE_REDACTION_PLANS_ENABLED` on the frontend. Needs Hub API and frontend images with redaction plans, and a `hub-pipeline-redaction` worker newer than v1.2.15 rendering this deployment's jobs: an older worker finds no regions in such a job and stores an unchanged copy of the video as a completed redaction. While it is off, hub-api refuses `regions` edits and the editor works on detector tracks only. | `false` |
|
||||
| `kerberoshub.api.mediaProxy.enabled` | Serve media through hub-api (`/media/proxy`) instead of handing out Vault/storage URLs, hiding the storage endpoint from clients. | `false` |
|
||||
| `kerberoshub.api.mediaProxy.publicUrl` | Public hub-api base URL used in proxied media URLs. Defaults to `{schema}://{url}`. | `""` |
|
||||
| `kerberoshub.api.mediaProxy.key` | Key used to encrypt proxied media URLs (`openssl rand -hex 32`). Defaults to a key derived from `jwtSecret`. | `""` |
|
||||
@@ -1019,7 +1058,7 @@ kerberospipeline:
|
||||
| `kerberoshub.api.sso.extraHeaders.value` | Header value for each configured SSO extra header entry. | `""` |
|
||||
| `kerberoshub.frontend.repository` | The Docker registry where the Kerberos Hub frontend is hosted. | `"ghcr.io/uug-ai/hub-frontend"` |
|
||||
| `kerberoshub.frontend.pullPolicy` | The Docker registry pull policy. | `"IfNotPresent"` |
|
||||
| `kerberoshub.frontend.tag` | The Docker image tag/version. | `"v1.19.80"` |
|
||||
| `kerberoshub.frontend.tag` | The Docker image tag/version. | `"v1.19.42"` |
|
||||
| `kerberoshub.frontend.replicas` | The number of pods/replicas running for the Kerberos Hub frontend deployment. | `2` |
|
||||
| `kerberoshub.frontend.logLevel` | Log verbosity level for `kerberoshub.frontend`. | `"info"` |
|
||||
| `kerberoshub.frontend.schema` | The protocol to serve the Kerberos Hub frontend, `'http'` or `'https'`. | `"https"` |
|
||||
@@ -1660,32 +1699,6 @@ Deployers describe what a node exposes; Hub code owns what that means:
|
||||
Worker images, queues, resources and credentials stay in `kerberoshub.services`.
|
||||
No new loader environment variable is set.
|
||||
|
||||
#### Conditional settings (`when`)
|
||||
|
||||
A param can apply only while an earlier `select` or `boolean` param has one of
|
||||
the listed values, for example a forwarder setting that exists only for one
|
||||
provider:
|
||||
|
||||
```yaml
|
||||
params:
|
||||
- {name: broker, type: select, options: [rabbitmq, mqtt], default: rabbitmq}
|
||||
- {name: topic, type: string, required: true, when: {param: broker, in: [mqtt]}}
|
||||
```
|
||||
|
||||
While its condition does not hold, a param is hidden in the editor, is not
|
||||
required, gets no default, and its stored value is dropped on save. The
|
||||
controlling param must be declared earlier; its value (or default when unset)
|
||||
is compared with `in`. Conditions can chain at most 3 deep, and there is one
|
||||
condition per param (no `and`/`or`). Invalid conditions make the contract
|
||||
unavailable, like other contract errors.
|
||||
|
||||
**`when` needs a compatible Hub API and frontend** (conditional params,
|
||||
uug-ai/hub-api#900 and uug-ai/hub-frontend#1115): hub-api `v1.11.92` or later
|
||||
and hub-frontend `v1.19.78` or later. Since chart `0.209.0` the default tags
|
||||
(`v1.11.93`, `v1.19.80`) include both. An older API rejects a contract that
|
||||
uses it, which removes that stage from the editor; pin an older API only with
|
||||
`workflowConfiguration.includeDefaults: false` or your own forwarder contract.
|
||||
|
||||
Conditions are not free-form: a new or changed predicate on a connection may
|
||||
only test a declared field of Start or of a stage upstream of that connection
|
||||
(stage outputs are addressed as `results.<stage>.<path>`), with one of its
|
||||
@@ -1724,13 +1737,9 @@ schemas/
|
||||
catalog required. It declares no `params`, so any settings come from
|
||||
`kerberoshub.workflows.editorStages`.
|
||||
- [Forwarder contract ConfigMap](templates/configMaps/workflow-contracts/forwarder.yaml):
|
||||
presentation and per-node delivery settings for custom workflows, with a
|
||||
provider choice. `rabbitmq` (default) adds queue, virtual host, queue
|
||||
declaration and dead-letter settings. `mqtt` adds topic, QoS, retain and
|
||||
client ID, and needs a forwarder worker with the MQTT provider. Both share
|
||||
host, port, TLS, credentials, completion mode and retries. The
|
||||
provider-specific settings use `when`. Deployment-global workflows keep
|
||||
their deployment bindings. No output fields are declared.
|
||||
presentation and required per-node delivery and RabbitMQ destination settings
|
||||
for custom workflows. Deployment-global workflows keep their deployment
|
||||
bindings. No output fields are declared.
|
||||
- [Custom pose example](examples/workflow-contracts/pose.yaml): hypothetical
|
||||
worker, demonstrating presentation, settings (`params`), a file catalog, inline
|
||||
choices and a numeric field.
|
||||
|
||||
@@ -215,22 +215,6 @@
|
||||
"file": {"type": "string", "pattern": "^\\.\\./catalogs/[A-Za-z0-9_-][A-Za-z0-9._-]*\\.json$"}
|
||||
},
|
||||
"description": "Options for a select or multiselect setting from a shared catalog file (keys become options, labels become optionLabels). Use instead of options."
|
||||
},
|
||||
"when": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["param", "in"],
|
||||
"properties": {
|
||||
"param": {"type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_]*$", "maxLength": 64, "description": "A select or boolean param declared earlier in this contract."},
|
||||
"in": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 64,
|
||||
"items": {"oneOf": [{"type": "string", "minLength": 1, "maxLength": 160}, {"type": "boolean"}]},
|
||||
"description": "Values of that param (its options, or true/false) for which this setting applies."
|
||||
}
|
||||
},
|
||||
"description": "Show, validate, default and store this setting only while the named earlier select or boolean param has one of these values; otherwise its value is dropped on save. Chains of at most 3. Requires a Hub API that supports conditional params."
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
|
||||
@@ -5,24 +5,20 @@ stage: forwarder
|
||||
contractVersion: 1
|
||||
presentation:
|
||||
name: Forward to my system
|
||||
description: Send the run's data to your own RabbitMQ or MQTT destination.
|
||||
description: Send the run's data to your own RabbitMQ destination.
|
||||
icon: share
|
||||
color: green
|
||||
|
||||
# Custom workflows supply their own connection; deployment credentials are never
|
||||
# inherited. Non-secret defaults are stored on save, not read from the worker.
|
||||
# Provider-specific settings use `when` (conditional params): they are shown,
|
||||
# required, defaulted and stored only for the selected provider. `when` needs a
|
||||
# Hub API and frontend that support conditional params (hub-api with uug-ai/hub-api#900,
|
||||
# hub-frontend with uug-ai/hub-frontend#1115); older APIs reject this contract.
|
||||
# inherited. These non-secret defaults are stored on save, not read from the worker.
|
||||
params:
|
||||
- name: broker
|
||||
label: Provider
|
||||
description: Where the run's data is sent. Custom workflows use their own destination; shared deployment integrations are reserved for global workflows.
|
||||
description: Custom workflows use their own RabbitMQ destination. Shared deployment integrations are reserved for global workflows.
|
||||
type: select
|
||||
required: true
|
||||
options: [rabbitmq, mqtt]
|
||||
optionLabels: {rabbitmq: RabbitMQ, mqtt: MQTT}
|
||||
options: [rabbitmq]
|
||||
optionLabels: {rabbitmq: RabbitMQ}
|
||||
default: rabbitmq
|
||||
group: Delivery
|
||||
- name: mode
|
||||
@@ -34,118 +30,53 @@ params:
|
||||
optionLabels: {delivered: Complete after delivery, callback: Wait for result}
|
||||
default: delivered
|
||||
group: Delivery
|
||||
- name: maxRetries
|
||||
label: Maximum retries
|
||||
description: Whole number of retries after a failed delivery. Use 0 for no retries.
|
||||
type: number
|
||||
required: false
|
||||
default: 5
|
||||
minimum: 0
|
||||
maximum: 2147483647
|
||||
group: Delivery
|
||||
- name: host
|
||||
label: Host
|
||||
description: Your broker's host name or IP address, without a scheme or port. Required before enabling the workflow.
|
||||
description: Your RabbitMQ destination host. Required before enabling the workflow.
|
||||
type: string
|
||||
required: true
|
||||
placeholder: broker.example.com
|
||||
group: Connection
|
||||
placeholder: rabbitmq.example.com
|
||||
group: RabbitMQ destination
|
||||
- name: port
|
||||
label: Port
|
||||
description: Your broker's port, a whole number. RabbitMQ usually uses 5671 with TLS or 5672 without; MQTT 8883 with TLS or 1883 without.
|
||||
description: Your RabbitMQ destination port, a whole number (usually 5671 with TLS or 5672 without TLS).
|
||||
type: number
|
||||
required: true
|
||||
minimum: 1
|
||||
maximum: 65535
|
||||
group: Connection
|
||||
group: RabbitMQ destination
|
||||
- name: queue
|
||||
label: Queue
|
||||
description: Your destination queue. Its dead-letter queue is this name followed by .forwarder-dead-letter.
|
||||
type: string
|
||||
required: true
|
||||
group: RabbitMQ destination
|
||||
- name: vhost
|
||||
label: Virtual host
|
||||
description: Your RabbitMQ virtual host. Use / for the broker's default virtual host.
|
||||
type: string
|
||||
required: true
|
||||
placeholder: /
|
||||
group: RabbitMQ destination
|
||||
- name: tls
|
||||
label: Use TLS
|
||||
description: Encrypt the connection and verify the broker certificate using system trust roots. Deployment TLS overrides are never inherited.
|
||||
type: boolean
|
||||
required: true
|
||||
default: true
|
||||
group: Connection
|
||||
group: RabbitMQ destination
|
||||
- name: username
|
||||
label: Username
|
||||
description: Your broker username. Deployment credentials are never used.
|
||||
description: Your RabbitMQ destination username. Deployment credentials are never used.
|
||||
type: string
|
||||
required: true
|
||||
group: Credentials
|
||||
group: RabbitMQ credentials
|
||||
- name: password
|
||||
label: Password
|
||||
description: Your broker password. Required before enabling the workflow; masked after saving. Changing the provider or connection asks for it again.
|
||||
description: Your RabbitMQ destination password. Required before enabling the workflow; masked after saving.
|
||||
type: secret
|
||||
required: true
|
||||
group: Credentials
|
||||
|
||||
# RabbitMQ only.
|
||||
- name: queue
|
||||
label: Queue
|
||||
description: Your RabbitMQ destination queue.
|
||||
type: string
|
||||
required: true
|
||||
group: RabbitMQ
|
||||
when: {param: broker, in: [rabbitmq]}
|
||||
- name: vhost
|
||||
label: Virtual host
|
||||
description: Your RabbitMQ virtual host. Omitted or blank values use /, never the deployment virtual host.
|
||||
type: string
|
||||
required: false
|
||||
default: /
|
||||
group: RabbitMQ
|
||||
when: {param: broker, in: [rabbitmq]}
|
||||
- name: declareQueue
|
||||
label: Declare destination queues
|
||||
description: Create durable quorum target and dead-letter queues when missing. When disabled, both must already exist. Dead-letter routing is never configured; configure it separately on the external consumer or broker.
|
||||
type: boolean
|
||||
required: false
|
||||
default: true
|
||||
group: RabbitMQ
|
||||
when: {param: broker, in: [rabbitmq]}
|
||||
- name: deadLetterQueue
|
||||
label: Destination dead-letter queue
|
||||
description: External destination dead-letter queue to create or check; must differ from Queue. Omitted or blank values use Queue followed by .forwarder-dead-letter. Forwarder does not route failed messages here automatically; configure external consumer or broker dead-letter routing separately. Never use the internal failed-dispatch queue, which can contain secrets.
|
||||
type: string
|
||||
required: false
|
||||
placeholder: <queue>.forwarder-dead-letter
|
||||
group: RabbitMQ
|
||||
when: {param: broker, in: [rabbitmq]}
|
||||
|
||||
# MQTT only.
|
||||
- name: topic
|
||||
label: Topic
|
||||
description: One topic to publish to, without + or # wildcards and not starting with $. The message includes a signed link to the recording, so anyone who can read this topic can download it until the link expires.
|
||||
type: string
|
||||
required: true
|
||||
placeholder: plant/line-1/events
|
||||
group: MQTT
|
||||
when: {param: broker, in: [mqtt]}
|
||||
- name: qos
|
||||
label: Quality of service
|
||||
description: 0 sends once without confirmation; 1 waits for the broker to confirm (may duplicate); 2 confirms exactly once per connection. Subscribers should deduplicate by executionId.
|
||||
type: select
|
||||
required: true
|
||||
options: ['0', '1', '2']
|
||||
optionLabels: {'0': At most once (0), '1': At least once (1), '2': Exactly once (2)}
|
||||
default: '1'
|
||||
group: MQTT
|
||||
when: {param: broker, in: [mqtt]}
|
||||
- name: retain
|
||||
label: Retain message
|
||||
description: Ask the broker to keep the latest message on this topic for subscribers that connect later.
|
||||
type: boolean
|
||||
required: false
|
||||
default: false
|
||||
group: MQTT
|
||||
when: {param: broker, in: [mqtt]}
|
||||
- name: clientId
|
||||
label: Client ID
|
||||
description: Fixed MQTT client ID, for brokers that use it in access rules (at most 128 characters). Leave empty to use a new random ID per delivery.
|
||||
type: string
|
||||
required: false
|
||||
placeholder: hub-fwd-<random>
|
||||
group: MQTT
|
||||
when: {param: broker, in: [mqtt]}
|
||||
group: RabbitMQ credentials
|
||||
|
||||
# It contributes no output fields: connections after it can still use Start and
|
||||
# earlier stages in Extra conditions.
|
||||
|
||||
@@ -462,6 +462,11 @@ spec:
|
||||
- name: FEATURE_ORGANISATION_DELETION_ENABLED
|
||||
value: {{ (.Values.kerberoshub.api.organisationDeletion | default dict).enabled | default false | quote }}
|
||||
|
||||
# Redaction plans: redaction edits of type "regions", their plans and their drafts.
|
||||
# The redaction worker must render plans before this is switched on.
|
||||
- name: REDACTION_PLANS_ENABLED
|
||||
value: {{ (.Values.kerberoshub.api.redactionPlans | default dict).enabled | default false | quote }}
|
||||
|
||||
# Onboarding: /register creates only the account; the organisation comes at first sign-in.
|
||||
# A variable already set in kerberoshub.extraEnv is left to it.
|
||||
{{- $onboarding := (.Values.organisations | default dict).onboarding | default dict }}
|
||||
|
||||
@@ -379,6 +379,9 @@ spec:
|
||||
value: "{{ .Values.kerberoshub.frontend.features.faceRedaction.enabled }}"
|
||||
- name: FEATURE_FACE_REDACTION_CLASSIFIER_TRACKS_ENABLED
|
||||
value: "{{ .Values.kerberoshub.frontend.features.faceRedaction.classifierTracksEnabled }}"
|
||||
# Follows hub-api: the editor only sends redaction plans where the API accepts them.
|
||||
- name: FEATURE_REDACTION_PLANS_ENABLED
|
||||
value: "{{ (.Values.kerberoshub.api.redactionPlans | default dict).enabled | default false }}"
|
||||
|
||||
# features > media
|
||||
- name: FEATURE_MEDIA_FORWARD_ENABLED
|
||||
|
||||
@@ -473,6 +473,9 @@ spec:
|
||||
value: "{{ .Values.kerberoshub.frontend.features.faceRedaction.enabled }}"
|
||||
- name: FEATURE_FACE_REDACTION_CLASSIFIER_TRACKS_ENABLED
|
||||
value: "{{ .Values.kerberoshub.frontend.features.faceRedaction.classifierTracksEnabled }}"
|
||||
# Follows hub-api: the editor only sends redaction plans where the API accepts them.
|
||||
- name: FEATURE_REDACTION_PLANS_ENABLED
|
||||
value: "{{ (.Values.kerberoshub.api.redactionPlans | default dict).enabled | default false }}"
|
||||
|
||||
# features > media
|
||||
- name: FEATURE_MEDIA_FORWARD_ENABLED
|
||||
|
||||
+11
-2
@@ -424,7 +424,7 @@ kerberoshub:
|
||||
api:
|
||||
repository: ghcr.io/uug-ai/hub-api
|
||||
pullPolicy: IfNotPresent
|
||||
tag: "v1.11.93"
|
||||
tag: "v1.11.43"
|
||||
replicas: 2
|
||||
podSecurityContext:
|
||||
fsGroup: 65532
|
||||
@@ -516,6 +516,15 @@ kerberoshub:
|
||||
# kerberoshub.cleanup.accountDeletion.purge worker does the erasing.
|
||||
organisationDeletion:
|
||||
enabled: false # Serves the delete route on hub-api and shows "Delete organisation" in the frontend.
|
||||
# Redaction plans: the redaction editor saves and submits a list of
|
||||
# regions, each with its own style and frame range, and keeps a draft per
|
||||
# video. hub-api stores the plan and sends it to the redaction worker.
|
||||
# Only switch it on once the hub-pipeline-redaction worker that renders
|
||||
# this deployment's jobs is newer than v1.2.15: an older worker finds no
|
||||
# regions in such a job and stores an unchanged copy of the video as a
|
||||
# completed redaction.
|
||||
redactionPlans:
|
||||
enabled: false # Accepts redaction plans on hub-api (REDACTION_PLANS_ENABLED) and switches the frontend's redaction editor to them (FEATURE_REDACTION_PLANS_ENABLED).
|
||||
mediaProxy:
|
||||
enabled: false
|
||||
publicUrl: "" # Optional override of the public hub-api base URL; defaults to {schema}://{url}.
|
||||
@@ -637,7 +646,7 @@ kerberoshub:
|
||||
frontend:
|
||||
repository: ghcr.io/uug-ai/hub-frontend
|
||||
pullPolicy: IfNotPresent
|
||||
tag: "v1.19.80"
|
||||
tag: "v1.19.42"
|
||||
replicas: 2
|
||||
containerPort: 8080
|
||||
securityContext:
|
||||
|
||||
@@ -29,7 +29,7 @@ for mode in all ui; do
|
||||
--set kerberoshub.frontend.demoEnabled=true)"
|
||||
for name in hub-frontend hub-frontend-demo; do
|
||||
deployment="$(resource Deployment "$name" <<< "$rendered")"
|
||||
assert_contains "$deployment" 'image: "ghcr.io/uug-ai/hub-frontend:v1.19.80"$'
|
||||
assert_contains "$deployment" 'image: "ghcr.io/uug-ai/hub-frontend:v1.19.42"$'
|
||||
assert_contains "$deployment" 'containerPort: 8080$'
|
||||
[[ "$(grep -c 'containerPort:' <<< "$deployment")" == 1 ]]
|
||||
for setting in 'name: http' 'runAsNonRoot: true' 'runAsUser: 65532' \
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
CHART_DIR="${1:-charts/hub}"
|
||||
|
||||
# Prints "<deployment> <variable> <value>" for the redaction plans variables.
|
||||
extract_plans() {
|
||||
awk '
|
||||
/^---/ { deployment=0; name=""; variable="" }
|
||||
/^kind: Deployment$/ { deployment=1 }
|
||||
deployment && /^ name:/ { name=$2 }
|
||||
/- name: (FEATURE_)?REDACTION_PLANS_ENABLED$/ { variable=$3; next }
|
||||
variable != "" && /value:/ {
|
||||
value=$0
|
||||
sub(/^[[:space:]]*value: /, "", value)
|
||||
print name, variable, value
|
||||
variable=""
|
||||
}
|
||||
' | sort
|
||||
}
|
||||
|
||||
assert_plans() {
|
||||
local rendered="$1" expected="$2" actual
|
||||
actual="$(printf '%s\n' "$rendered" | extract_plans)"
|
||||
if [[ "$actual" != "$expected" ]]; then
|
||||
printf 'Unexpected redaction plans environment:\n%s\nExpected:\n%s\n' "$actual" "$expected" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
off="$(printf '%s\n' \
|
||||
'hub-api REDACTION_PLANS_ENABLED "false"' \
|
||||
'hub-frontend FEATURE_REDACTION_PLANS_ENABLED "false"')"
|
||||
on="$(printf '%s\n' \
|
||||
'hub-api REDACTION_PLANS_ENABLED "true"' \
|
||||
'hub-frontend FEATURE_REDACTION_PLANS_ENABLED "true"')"
|
||||
|
||||
assert_plans "$(helm template hub "$CHART_DIR")" "$off"
|
||||
echo "OK: redaction plans are off by default on hub-api and the frontend"
|
||||
|
||||
assert_plans "$(helm template hub "$CHART_DIR" --set kerberoshub.api.redactionPlans.enabled=true)" "$on"
|
||||
echo "OK: one value switches hub-api and the frontend on together"
|
||||
|
||||
assert_plans "$(helm template hub "$CHART_DIR" --set-string kerberoshub.api.redactionPlans.enabled=true)" "$on"
|
||||
echo "OK: the value may be given as a string"
|
||||
|
||||
assert_plans "$(helm template hub "$CHART_DIR" --set kerberoshub.api.redactionPlans=null)" "$off"
|
||||
echo "OK: values files without a redactionPlans section keep it off"
|
||||
|
||||
# The face redaction flag of the frontend does not switch plans on.
|
||||
assert_plans "$(helm template hub "$CHART_DIR" --set kerberoshub.frontend.features.faceRedaction.enabled=true)" "$off"
|
||||
echo "OK: the face redaction flag alone leaves plans off"
|
||||
|
||||
assert_plans "$(helm template hub "$CHART_DIR" --set kerberoshub.api.redactionPlans.enabled=true \
|
||||
--set kerberoshub.frontend.demoEnabled=true)" "$(printf '%s\n' \
|
||||
'hub-api REDACTION_PLANS_ENABLED "true"' \
|
||||
'hub-frontend FEATURE_REDACTION_PLANS_ENABLED "true"' \
|
||||
'hub-frontend-demo FEATURE_REDACTION_PLANS_ENABLED "true"')"
|
||||
echo "OK: the demo frontend follows the same value"
|
||||
|
||||
[[ -z "$(helm template hub "$CHART_DIR" --set mode=pipeline --set kerberoshub.api.redactionPlans.enabled=true | extract_plans)" ]]
|
||||
echo "OK (pipeline): no redaction plans environment"
|
||||
|
||||
helm lint "$CHART_DIR" --quiet --set kerberoshub.api.redactionPlans.enabled=true
|
||||
echo "All Hub redaction plans checks passed."
|
||||
Reference in New Issue
Block a user