Skip to content
Merged
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
1 change: 1 addition & 0 deletions changelog.d/added-matrix-stream-overlay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Document Matrix's separate `hivecommonsmatrix` channel and add an inactive, silent streamer overlay with isolated deployment identity and zero replicas (#15937).
1 change: 1 addition & 0 deletions src/deploy/stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
49 changes: 49 additions & 0 deletions src/docs/streaming-the-activity-monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading