Compare commits

..
Author SHA1 Message Date
Cédric Verstraeten 906aaf39ac Merge pull request #263 from kerberos-io/feat/hub-registration-signal
feat(hub): mqtt.signals for hub-api's registration signal (0.205.0)
2026-11-24 17:17:03 +01:00
cedricveandClaude Opus 5.5 7e1822c707 feat(hub): mqtt.signals.enabled master switch (0.205.0)
hub-api#899 now reads MQTT_SIGNALS_ENABLED (default false) as the
master switch for its MQTT signals; a topic only says where its event
goes. Add mqtt.signals.enabled to set it, so an environment can keep
its topics configured with signals off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:13:46 +00:00
cedricveandClaude Opus 5.5 0d332eaed9 feat(hub): mqtt.signals for hub-api's registration signal (0.205.0)
hub-api (uug-ai/hub-api#899) can publish a content-free MQTT message after
a successful /register, for listeners such as cha-ching that play a
sound. It reads MQTT_URI and MQTT_REGISTRATION_TOPIC, which the chart did
not set. Add mqtt.signals:

- uri sets MQTT_URI: the broker hub-api publishes on, e.g.
  tcp://mqtt.kerberos.io:1883; the login is mqtt.username/password.
- registrationTopic sets MQTT_REGISTRATION_TOPIC: an opaque topic such as
  sound/a31dc38882fd5460.

Both default to empty, which keeps signals off; existing installs render
unchanged apart from the two empty variables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:05:40 +00:00
Kilian f680e3f1a1 Merge pull request #262 from kerberos-io/feat/custom-email-templates
feat(hub): email.customTemplates mounted at /mail/templates (0.204.0)
2026-11-24 15:59:08 +01:00
Kilian BouteandClaude Opus 5.5 051fd8101e chore(hub): release email.customTemplates as 0.204.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 14:56:17 +00:00
Kilian BouteandClaude Opus 5.5 f7bc305d93 feat(hub): email.customTemplates mounted at /mail/templates (0.205.0)
Each deployment can carry its own email templates in its values:
email.customTemplates maps <template>.html / <template>.txt to content.
The chart renders them into the hub-email-templates ConfigMap and mounts
it read-only at /mail/templates on hub-api, pipe-notify and
hub-monitor-device, where each file replaces the service's built-in
template of that name. Other file names fail the render.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 12:25:09 +00:00
7 changed files with 90 additions and 44 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.204.0
version: 0.205.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
+5 -5
View File
@@ -836,6 +836,9 @@ kerberospipeline:
| `mqtt.password` | MQTT (Vernemq) password, by default `'yourpassword'`. | `"yourpassword"` |
| `mqtt.legacy.host` | Legacy MQTT broker host used for backward-compatible clients. | `""` |
| `mqtt.legacy.port` | Legacy MQTT broker port used for backward-compatible clients. | `""` |
| `mqtt.signals.enabled` | Switches hub-api's MQTT signals on (sets `MQTT_SIGNALS_ENABLED`). Signals are content-free messages (only `{"at": time}`, not retained) on opaque topics, for listeners such as cha-ching that play a sound. A signal is sent only when this is `true`, `uri` is set and its event has a topic, so an environment can keep its topics configured with signals off. Needs hub-api with MQTT signals (uug-ai/hub-api#899). | `false` |
| `mqtt.signals.uri` | Broker hub-api publishes signals on (sets `MQTT_URI`), for example `tcp://mqtt.kerberos.io:1883` or `wss://mqtt.kerberos.io:8443/mqtt`; the login is `mqtt.username` / `mqtt.password`. | `""` |
| `mqtt.signals.registrationTopic` | Topic signalled after a successful `/register` (sets `MQTT_REGISTRATION_TOPIC`). Use an opaque identifier such as `sound/a31dc38882fd5460`: on a public broker the topic is visible to anyone subscribed to it. Without a topic, registrations are not signalled. | `""` |
| `queueProvider` | The queue we are using for the [pipeline](https://doc.kerberos.io/hub/pipeline/): 'SQS', 'KAFKA' or `RABBITMQ`. | `"RABBITMQ"` |
| `queueName` | The event queue which is propagating messages in the [Kerberos Hub pipeline](https://doc.kerberos.io/hub/pipeline/). | `"kcloud-event-queue"` |
| `rabbitmq.host` | RabbitMQ host, by default `'rabbitmq.yourdomain.com:5671'` | `"rabbitmq.rabbitmq:5672"` |
@@ -856,10 +859,6 @@ kerberospipeline:
| `turn.host` | TURN/STUN hostname, by default `'turn:turn.yourdomain.com:8443'` | `"turn:turn.yourdomain.com:8443"` |
| `turn.username` | TURN/STUN username, by default `'username1'` | `"username1"` |
| `turn.password` | TURN/STUN password, by default `'password1'` | `"password1"` |
| `pusher.appId` | Pusher app ID for in-app browser notifications from hub-api and the device monitor, rendered as `PUSHER_APP_ID` (hub-api and hub-monitor-device built on github.com/uug-ai/integrations). | `""` |
| `pusher.key` | Pusher app key, rendered as `PUSHER_KEY`. | `""` |
| `pusher.secret` | Pusher app secret, rendered as `PUSHER_SECRET`. | `""` |
| `pusher.cluster` | Pusher cluster, rendered as `PUSHER_CLUSTER`. | `"eu"` |
| `opentelemetry.enabled` | Enable or disable OpenTelemetry instrumentation. | `false` |
| `opentelemetry.routingEnabled` | Enable or disable OpenTelemetry routing/export behavior. | `false` |
| `opentelemetry.collector.endpoint` | OpenTelemetry collector endpoint used for trace export. | `"http://otel-collector:4317"` |
@@ -1324,6 +1323,7 @@ kerberospipeline:
| `email.templates.deviceGroupTitle` | Email subject title for the `device_group` template. | `"[Device] Several cameras changed status"` |
| `email.templates.recording` | The template for recording check alerts (a continuously recording camera that is online but uploads no recordings, and again when it records). Empty uses `recording` with SMTP; for SendGrid or Mailgun set the template id, otherwise they use `device`. See *Camera recordings* below. | `""` |
| `email.templates.recordingTitle` | Email subject for recording check alerts. Empty uses "[Device] A camera stopped recording", "[Device] A camera is recording again" and their forms for several cameras. | `""` |
| `email.customTemplates` | Email templates of this deployment, by file name (`<template>.html` / `<template>.txt`). Mounted read-only at `/mail/templates` on hub-api, pipe-notify and hub-monitor-device from the `hub-email-templates` ConfigMap; each replaces the built-in template with the same name when sending with SMTP. Other file names fail the render. | `{}` |
| `email.mailgun.apiKey` | The Mailgun API key linked to your Mailgun domain. | `""` |
| `imagePullSecrets.name` | Docker registry secret name, which is also granted with the license. This allows you to download the Docker images. | `""` |
| `kerberoshub.frontend.ssoDomain` | The domain that's being used to activate SSO from the login page. | `""` |
@@ -1336,7 +1336,7 @@ Every email Hub sends is a template: an HTML file, plus a plain-text `.txt` vers
#### Which template is used
- `email.templates.<name>` sets the template name for each email (for example `email.templates.detection: "detection"`).
- With `email.provider: smtp`, Hub reads `/mail/templates/<name>.html` and `/mail/templates/<name>.txt` from the container. If the files are not there, it uses its built-in template with that name. To use your own, mount a volume at `/mail` (see the commented `custom-email-templates` volume in `values.yaml`). The [`custom-layout/templates`](custom-layout/templates) folder holds a complete set to start from.
- With `email.provider: smtp`, Hub reads `/mail/templates/<name>.html` and `/mail/templates/<name>.txt` from the container. If the files are not there, it uses its built-in template with that name. Each service has built-in templates for the emails it sends: hub-api for welcome, activate, forgot, share, share_case, share_case_otp, assign_task and invitation; pipe-notify for detection; hub-monitor-device for device, device_group and recording. To use your own, set them in `email.customTemplates` (file name → content). The chart puts them in the `hub-email-templates` ConfigMap and mounts it read-only at `/mail/templates` on those three services. A volume mounted at `/mail` (the commented `custom-email-templates` volume in `values.yaml`) still works when `email.customTemplates` is empty. The [`custom-layout/templates`](custom-layout/templates) folder holds a complete set to start from.
- With `email.provider: mailgun`, `<name>` is a template stored in your Mailgun account. Mailgun receives `user`, `text`, `link`, `numberOfMedia`, `dataUsage` and the email-specific values below as template variables. The computed values (dates, camera, sites, groups, thumbnail) are only filled in with `smtp`.
- Alert emails (`detection`) are only sent when `email.provider` is `smtp`.
- A placeholder that has no value for that email stays in the email as literal text, so only use the placeholders listed for it. The bundled templates contain `{{tab1_href}}`, `{{tab1_title}}`, `{{tab2_href}}` and `{{tab2_title}}`; these are not filled in.
@@ -0,0 +1,17 @@
{{- with .Values.email.customTemplates }}
apiVersion: v1
kind: ConfigMap
metadata:
name: hub-email-templates
namespace: {{ $.Release.Namespace }}
data:
# email.customTemplates, mounted at /mail/templates on hub-api, pipe-notify
# and hub-monitor-device. Each file replaces the built-in template with the
# same name when the services send with SMTP.
{{- range $file, $content := . }}
{{- if not (regexMatch "^[a-z0-9_]+\\.(html|txt)$" $file) }}
{{- fail (printf "email.customTemplates: %q must be named <template>.html or <template>.txt" $file) }}
{{- end }}
{{ $file }}: {{ $content | quote }}
{{- end }}
{{- end }}
+22 -12
View File
@@ -158,7 +158,7 @@ spec:
{{- $mongodbTLS := .Values.mongodb.tls }}
{{- $classificationCatalogEnabled := .Values.classificationCatalogEnabled }}
{{- $deviceSystemTagsEnabled := include "kerberoshub.deviceTags.system.enabled" . }}
{{- if or $workflowConfiguration.enabled $classificationCatalogEnabled $deviceSystemTagsEnabled .Values.subscriptions.plans.enabled .Values.kerberoshub.api.volumes (and $serverTLS.enabled $serverTLS.secretName) (and $mongodbTLS.enabled $mongodbTLS.existingSecret) }}
{{- if or $workflowConfiguration.enabled $classificationCatalogEnabled $deviceSystemTagsEnabled .Values.subscriptions.plans.enabled .Values.email.customTemplates .Values.kerberoshub.api.volumes (and $serverTLS.enabled $serverTLS.secretName) (and $mongodbTLS.enabled $mongodbTLS.existingSecret) }}
volumes:
{{- if $workflowConfiguration.enabled }}
- name: workflow-configuration
@@ -221,6 +221,11 @@ spec:
configMap:
name: hub-plans
{{- end }}
{{- if .Values.email.customTemplates }}
- name: email-templates
configMap:
name: hub-email-templates
{{- end }}
{{- with .Values.kerberoshub.api.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -252,7 +257,7 @@ spec:
ports:
- containerPort: 80
name: http
{{- if or $workflowConfiguration.enabled $classificationCatalogEnabled $deviceSystemTagsEnabled .Values.subscriptions.plans.enabled .Values.kerberoshub.api.volumeMounts (and $serverTLS.enabled $serverTLS.secretName) (and $mongodbTLS.enabled $mongodbTLS.existingSecret) }}
{{- if or $workflowConfiguration.enabled $classificationCatalogEnabled $deviceSystemTagsEnabled .Values.subscriptions.plans.enabled .Values.email.customTemplates .Values.kerberoshub.api.volumeMounts (and $serverTLS.enabled $serverTLS.secretName) (and $mongodbTLS.enabled $mongodbTLS.existingSecret) }}
volumeMounts:
{{- if $workflowConfiguration.enabled }}
- name: workflow-configuration
@@ -274,6 +279,11 @@ spec:
mountPath: /etc/kerberos/plans
readOnly: true
{{- end }}
{{- if .Values.email.customTemplates }}
- name: email-templates
mountPath: /mail/templates
readOnly: true
{{- end }}
{{- with .Values.kerberoshub.api.volumeMounts}}
{{- toYaml . | nindent 12 }}
{{- end }}
@@ -392,6 +402,16 @@ spec:
value: "{{ .Values.mqtt.username }}"
- name: MQTT_PASSWORD
value: "{{ .Values.mqtt.password }}"
# MQTT signals: a content-free message on an opaque topic after a
# registration (cha-ching plays a sound); off unless enabled, with
# a uri and the event's topic.
{{- $signals := (.Values.mqtt | default dict).signals | default dict }}
- name: MQTT_SIGNALS_ENABLED
value: {{ $signals.enabled | default false | quote }}
- name: MQTT_URI
value: {{ $signals.uri | default "" | quote }}
- name: MQTT_REGISTRATION_TOPIC
value: {{ $signals.registrationTopic | default "" | quote }}
# TURN credentials (served via /runtime/config to authenticated
# frontend clients; no longer exposed in the public env.js).
@@ -602,16 +622,6 @@ spec:
- name: SLACK_USERNAME
value: "{{ .Values.kerberoshub.api.slack.username }}"
# Pusher (in-app notifications)
- name: PUSHER_APP_ID
value: {{ .Values.pusher.appId | quote }}
- name: PUSHER_KEY
value: {{ .Values.pusher.key | quote }}
- name: PUSHER_SECRET
value: {{ .Values.pusher.secret | quote }}
- name: PUSHER_CLUSTER
value: {{ .Values.pusher.cluster | quote }}
# Mail settings
- name: MAIL_PROVIDER
value: "{{ .Values.email.provider }}"
@@ -34,8 +34,13 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- $mongodbTLS := .Values.mongodb.tls }}
{{- if or .Values.kerberoshub.monitordevice.volumes (and $mongodbTLS.enabled $mongodbTLS.existingSecret) }}
{{- if or .Values.kerberoshub.monitordevice.volumes .Values.email.customTemplates (and $mongodbTLS.enabled $mongodbTLS.existingSecret) }}
volumes:
{{- if .Values.email.customTemplates }}
- name: email-templates
configMap:
name: hub-email-templates
{{- end }}
{{- with .Values.kerberoshub.monitordevice.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -65,8 +70,13 @@ spec:
containerPort: 8080
protocol: TCP
{{- end }}
{{- if or .Values.kerberoshub.monitordevice.volumeMounts (and $mongodbTLS.enabled $mongodbTLS.existingSecret) }}
{{- if or .Values.kerberoshub.monitordevice.volumeMounts .Values.email.customTemplates (and $mongodbTLS.enabled $mongodbTLS.existingSecret) }}
volumeMounts:
{{- if .Values.email.customTemplates }}
- name: email-templates
mountPath: /mail/templates
readOnly: true
{{- end }}
{{- with .Values.kerberoshub.monitordevice.volumeMounts}}
{{- toYaml . | nindent 12 }}
{{- end }}
@@ -129,16 +139,6 @@ spec:
value: "{{ .Values.email.mailgun.domain }}"
- name: MAILGUN_API_KEY
value: "{{ .Values.email.mailgun.apikey }}"
# Pusher (in-app notifications)
- name: PUSHER_APP_ID
value: {{ .Values.pusher.appId | quote }}
- name: PUSHER_KEY
value: {{ .Values.pusher.key | quote }}
- name: PUSHER_SECRET
value: {{ .Values.pusher.secret | quote }}
- name: PUSHER_CLUSTER
value: {{ .Values.pusher.cluster | quote }}
{{- if .Values.kerberoshub.extraEnv }}
{{- toYaml .Values.kerberoshub.extraEnv | nindent 12 }}
{{- end }}
@@ -38,8 +38,13 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- $mongodbTLS := .Values.mongodb.tls }}
{{- if or .Values.kerberospipeline.notify.volumes (and $mongodbTLS.enabled $mongodbTLS.existingSecret) }}
{{- if or .Values.kerberospipeline.notify.volumes .Values.email.customTemplates (and $mongodbTLS.enabled $mongodbTLS.existingSecret) }}
volumes:
{{- if .Values.email.customTemplates }}
- name: email-templates
configMap:
name: hub-email-templates
{{- end }}
{{- with .Values.kerberospipeline.notify.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -63,8 +68,13 @@ spec:
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if or .Values.kerberospipeline.notify.volumeMounts (and $mongodbTLS.enabled $mongodbTLS.existingSecret) }}
{{- if or .Values.kerberospipeline.notify.volumeMounts .Values.email.customTemplates (and $mongodbTLS.enabled $mongodbTLS.existingSecret) }}
volumeMounts:
{{- if .Values.email.customTemplates }}
- name: email-templates
mountPath: /mail/templates
readOnly: true
{{- end }}
{{- with .Values.kerberospipeline.notify.volumeMounts}}
{{- toYaml . | nindent 12 }}
{{- end }}
+21 -12
View File
@@ -198,6 +198,16 @@ mqtt:
legacy:
host: ""
port: ""
# Signals: hub-api publishes a content-free message (only {"at": time}, not
# retained) on an opaque topic when something happens, for listeners such as
# cha-ching that play a sound on a speaker. The broker login is
# mqtt.username / mqtt.password. Off unless enabled is true, uri is set and
# the event has a topic: enabled switches every event at once, each topic
# only says where its event goes.
signals:
enabled: false # Sets MQTT_SIGNALS_ENABLED on hub-api.
uri: "" # Broker for hub-api, e.g. tcp://mqtt.kerberos.io:1883 or wss://mqtt.kerberos.io:8443/mqtt (MQTT_URI).
registrationTopic: "" # Signalled after a successful /register: an opaque identifier, e.g. sound/a31dc38882fd5460 (MQTT_REGISTRATION_TOPIC).
################################################################
# AMQP configuration (asynchronous processing for microservices)
#
@@ -248,18 +258,6 @@ turn:
username: "username1"
password: "password1"
############################################
# Pusher (in-app notifications)
#
# Usecases:
# - Browser notifications: hub-api (a new camera was added) and the device
# monitor (a camera changed status) trigger an event on the user's channel.
############################################
pusher:
appId: ""
key: ""
secret: ""
cluster: "eu"
############################################
# OpenTelemetry is used for distributed tracing and monitoring.
# More information can be found at https://opentelemetry.io/docs/
############################################
@@ -1749,3 +1747,14 @@ email:
# Empty uses "[Device] A camera stopped recording", "[Device] A camera is
# recording again" and their forms for several cameras.
recordingTitle: ""
# Email templates of this deployment, by file name: <template>.html and
# <template>.txt, for example detection.html. They are mounted at
# /mail/templates on hub-api, pipe-notify and hub-monitor-device, and each
# replaces the built-in template with the same name when sending with SMTP.
# Templates not listed keep the built-in version. Start from
# custom-layout/templates.
customTemplates: {}
# detection.html: |
# <html>...{{text}}...{{link}}...</html>
# detection.txt: |
# {{text}} {{link}}