From ed40dd95c02b6d0a987f6d3ff8e4da7e94d59cf3 Mon Sep 17 00:00:00 2001 From: thatguywob Date: Sat, 31 Oct 2026 06:25:28 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=96=20docs:=20document=20Matrix=20stre?= =?UTF-8?q?aming=20and=20add=20inactive=20overlay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a silent, zero-replica Matrix streamer with a separate namespace, workload selectors and Twitch secret reference. Document public-content safeguards and owner-only activation. Hive-Run: hivecommons/hive#15937 Hive-Plan: issue-15937-matrix-stream-documentation Hive-Spec: hivecommons/hive#15937#acceptance-criteria Signed-off-by: thatguywob --- changelog.d/added-matrix-stream-overlay.md | 1 + src/deploy/stream/README.md | 1 + .../hive-hosted-matrix/kustomization.yaml | 57 +++++++++++++++++++ src/docs/streaming-the-activity-monitor.md | 49 ++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 changelog.d/added-matrix-stream-overlay.md create mode 100644 src/deploy/stream/overlays/hive-hosted-matrix/kustomization.yaml diff --git a/changelog.d/added-matrix-stream-overlay.md b/changelog.d/added-matrix-stream-overlay.md new file mode 100644 index 0000000000..378d393ac0 --- /dev/null +++ b/changelog.d/added-matrix-stream-overlay.md @@ -0,0 +1 @@ +- Document Matrix's separate `hivecommonsmatrix` channel and add an inactive, silent streamer overlay with isolated deployment identity and zero replicas (#15937). diff --git a/src/deploy/stream/README.md b/src/deploy/stream/README.md index 8da3be582f..8947ddfa3d 100644 --- a/src/deploy/stream/README.md +++ b/src/deploy/stream/README.md @@ -13,6 +13,7 @@ Twitch stream. Operator guide, Twitch-side setup, and troubleshooting: | `docker-compose.yaml`, `.env.example` | Run the same image from a laptop. | | `k8s/` | Kustomize base: Namespace `hive-stream`, ConfigMap, Deployment (1 replica, non-root, 512 Mi `/dev/shm`, 1–3 CPU / 3–6 Gi), NetworkPolicy (DNS, dashboard Service, public RTMP/HTTPS only). `secret.yaml` is a **template** and is not in the kustomization. | | `overlays/hive-hosted/` | hive's own hosted spoke on `hive-oke`. | +| `overlays/hive-hosted-matrix/` | Inactive, silent Matrix instance for `twitch.tv/hivecommonsmatrix`: separate namespace and identity, `twitch-stream-matrix` secret reference, zero replicas; owner-only activation. | ## Environment diff --git a/src/deploy/stream/overlays/hive-hosted-matrix/kustomization.yaml b/src/deploy/stream/overlays/hive-hosted-matrix/kustomization.yaml new file mode 100644 index 0000000000..9de4bd3fdb --- /dev/null +++ b/src/deploy/stream/overlays/hive-hosted-matrix/kustomization.yaml @@ -0,0 +1,57 @@ +# INACTIVE: applying this overlay, creating twitch-stream-matrix, and scaling +# above 0 are owner-only actions. First enable dashboard.matrix with an explicit +# public repo allowlist and verify its author restriction and scrub/drop rules. +# Destination: twitch.tv/hivecommonsmatrix; never use the hivecommons stream key. +# A separate namespace and selectors isolate this instance from the main stream. +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: hive-stream-matrix +namePrefix: matrix- +resources: + - ../../k8s +images: + - name: ghcr.io/hivecommons/hive-stream + newTag: v5-latest +labels: + # Patch workload selectors explicitly below: includeSelectors would also + # rewrite the NetworkPolicy's dashboard destination selector (which stays hive). + - pairs: + app.kubernetes.io/name: hive-stream-matrix + includeTemplates: true +replicas: + - name: hive-stream + count: 0 +patches: + - target: + kind: ConfigMap + name: hive-stream + patch: |- + - op: replace + path: /data/DASHBOARD_URL + value: http://hive.hive-hosted-hosted-available-oke-11-placeholder-r05x.svc.cluster.local:3002 + - op: replace + path: /data/DASHBOARD_PATH + value: /?kiosk=1&view=matrix&sound=off + - op: replace + path: /data/STREAM_AUDIO + value: silent + - target: + kind: Deployment + name: hive-stream + patch: |- + - op: replace + path: /spec/selector/matchLabels/app.kubernetes.io~1name + value: hive-stream-matrix + - op: replace + path: /spec/template/spec/containers/0/envFrom/1/secretRef/name + value: twitch-stream-matrix + - target: + kind: NetworkPolicy + name: hive-stream + patch: |- + - op: replace + path: /spec/podSelector/matchLabels/app.kubernetes.io~1name + value: hive-stream-matrix + - op: replace + path: /spec/egress/1/to/0/namespaceSelector/matchLabels/kubernetes.io~1metadata.name + value: hive-hosted-hosted-available-oke-11-placeholder-r05x diff --git a/src/docs/streaming-the-activity-monitor.md b/src/docs/streaming-the-activity-monitor.md index 0b48940003..06e7d3e241 100644 --- a/src/docs/streaming-the-activity-monitor.md +++ b/src/docs/streaming-the-activity-monitor.md @@ -184,6 +184,55 @@ dashboard section, and renders dark regardless of any stored theme (append `&theme=light` for a light stream). Do not point the streamer at a hive tracking private repositories without reviewing what the tracker would show. +The main `twitch.tv/hivecommons` stream never shows Matrix; it remains the +full-screen Activity Monitor. + +## Matrix mode (separate channel) + +Matrix is an experimental, default-off code display for a separate channel, +[`twitch.tv/hivecommonsmatrix`](https://www.twitch.tv/hivecommonsmatrix). +It shows pushed added lines only, from positively identified hive identities, +on public repositories explicitly allowlisted in `dashboard.matrix.repos`. +Private patches, unverified authors and excluded paths are never shown. Lines +touched by scrubbing are dropped entirely rather than displayed with redactions; +the built-in secret/path filters and `dashboard.matrix.exclude_paths` apply. +Dashboard authentication alone does not make a code stream safe for public +Twitch broadcasting: the public allowlist, author restriction and scrub/drop +rules are required. + +[`overlays/hive-hosted-matrix/`](../deploy/stream/overlays/hive-hosted-matrix/kustomization.yaml) +reuses the streamer image and base as a separate instance. It renders Deployment, +ConfigMap and NetworkPolicy `matrix-hive-stream` in namespace `hive-stream-matrix`, +with separate pod selectors and secret references scoped to that namespace. +It opens `/?kiosk=1&view=matrix&sound=off` and sets `STREAM_AUDIO=silent`. +Its independent process and deployment isolate restarts and failures from the +existing stream. The `hive-hosted` overlay and `twitch.tv/hivecommons` are +unaffected. + +**Keep this broadcast OFF until the owner authorizes it and provisions the +channel.** The overlay has `replicas: 0`; applying it starts no streamer. +Channel availability alone does not authorize activation. The owner must: + +1. Enable `dashboard.matrix` with an explicit, reviewed public repo allowlist + and verify the Matrix display and its author restriction and scrub/drop rules + before any broadcast. An empty allowlist captures nothing. +2. Provision `hivecommonsmatrix` independently, create namespace + `hive-stream-matrix`, and create the out-of-band + `twitch-stream-matrix` Secret there with its + `TWITCH_STREAM_KEY`. Provision a separate `dashboard-token` Secret there + for the dashboard source. Never reuse the main channel's `twitch-stream` + Secret, or put key values in source, issues or documentation. +3. Apply the Matrix overlay and deliberately scale `matrix-hive-stream` above + zero only after authorization and readiness checks. Applying the overlay, + creating the Twitch Secret and scaling up are all owner-only actions; + this configuration does not authorize deployment or activation. + +Review the manifests without applying them: + +```sh +kubectl kustomize src/deploy/stream/overlays/hive-hosted-matrix +``` + ## Display mode and URL views For an attended screen (a wall monitor or TV someone can walk up to), use