cinny

by lola.2lannoy

Helm chartv0.1.0App 4.12.7AGPL-3.0-onlyVerified publisher

Cinny, a Matrix web client, as a hardened stateless Deployment serving its static app

About this chart

cinny

Cinny, a Matrix web client, as a hardened stateless Deployment serving its static app

Runs Cinny, a Matrix web client, as a stateless Deployment of two replicas. The image is built from spnngl/images: scratch, static-web-server, non-root, no shell.

Cinny runs in the browser: the pods only serve its static files. The browser talks to the homeservers directly, so they must be reachable from your users, not from the cluster.

Install

helm install cinny oci://ghcr.io/spnngl/charts/cinny --version <version> -n cinny --create-namespace

Settings

config is Cinny's config.json, rendered into a ConfigMap and mounted over the image's file; a change rolls the pods (checksum/config). It is served to every browser: keep secrets out. Keys Cinny reads:

KeyMeaning
homeserverListHomeservers offered at login (server names or https:// URLs)
defaultHomeserverIndex of the preselected one in homeserverList
allowCustomHomeserversLet users type another homeserver
featuredCommunitiesopenAsDefault, spaces, rooms, servers shown in Explore
hashRouterenabled, basename: route with #/ URLs

For example, a client locked to your homeserver:

config:
  allowCustomHomeservers: false
  homeserverList:
    - example.com

Maps merge with the chart defaults, lists replace them; set a key to null to drop it. Cinny looks each entry up at https://<name>/.well-known/matrix/client (CORS headers needed: Access-Control-Allow-Origin: *) to find the homeserver URL; when that file is missing or unreachable, it uses https://<name> itself.

gracePeriodSeconds (default 5) is how long a pod keeps serving after SIGTERM, while Services and proxies stop routing to it; it then drains open requests.

Other static-web-server settings (SERVER_* variables) go in extraEnv; the names the chart sets or relies on are rejected (see the value).

The server sends no security headers, on purpose: Cinny frames its bundled Element Call from its own origin, which X-Frame-Options: DENY would block. Set the headers you want at your ingress or gateway (for clickjacking, Content-Security-Policy: frame-ancestors 'self' instead of X-Frame-Options).

Access

kubectl -n cinny port-forward service/cinny 8080:8080

then http://localhost:8080/. ingress (Ingress) and httpRoute (Gateway API HTTPRoute) expose it publicly; both need explicit hosts (and parentRefs for the route). Cinny is built for the root path: serve it on its own host, not under a prefix. Every unknown path answers index.html, so deep links work.

The image serves plain HTTP: terminate TLS in front.

Image

The default image is appVersion, pinned by the digest recorded in the artifacthub.io/images annotation of Chart.yaml (Renovate updates tag and digest together). Setting image.tag drops that digest; add image.digest to pin the tag again (a digest without a tag is an error).

The image is signed with cosign (keyless, GitHub Actions OIDC). Verify a digest with:

cosign verify \
  --certificate-identity-regexp 'https://github.com/spnngl/images/.*' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  ghcr.io/spnngl/images/cinny@sha256:<digest>

Security

Defaults satisfy the restricted Pod Security Standard: non-root uid/gid 65532, read-only root filesystem, all capabilities dropped, no privilege escalation, RuntimeDefault seccomp, no ServiceAccount token, no Service environment variables. The server writes nothing to disk.

User namespaces

hostUsers: false (default) runs the pod in a user namespace: uid 65532 in the pod maps to an unprivileged host uid, which limits what a container escape gains. Nodes need a container runtime with user namespace support (containerd 2.0+ or CRI-O), runc 1.2+ or crun, and a Linux kernel 6.3+. On other nodes the pod sandbox cannot be created: set hostUsers: true.

Network

The NetworkPolicy (networkPolicy.enabled, on by default) allows the HTTP port (8080). Restrict the sources with networkPolicy.http.from (your ingress controller or Gateway, and Prometheus with metrics); empty means any source. networkPolicy.egress.enabled (off by default) allows only extraEgress: the server opens no connection and resolves no name, so an empty list denies all egress safely.

Metrics

metrics.enabled serves Prometheus metrics (sws_http_requests_total, sws_http_request_duration_seconds, ...) on /metrics, on the app port and without authentication: an Ingress or HTTPRoute publishes them too, so block the path in your proxy. metrics.serviceMonitor or metrics.podMonitor (one of them) creates the Prometheus Operator scrape object.

Autoscaling and resources

Two replicas, spread over nodes (preferred pod anti-affinity) and zones (ScheduleAnyway), rolled one at a time without dropping below the replica count. podDisruptionBudget (off by default) keeps node drains from evicting both at once.

autoscaling (off by default) creates a HorizontalPodAutoscaler on CPU; the target is a percentage of resources.requests.cpu, so size requests first. verticalPodAutoscaler (off by default) supports Off, Initial, Recreate and InPlaceOrRecreate (in-place resize needs Kubernetes 1.33+); it must not act on a resource the HPA scales. A recommender started with another --recommender-name than default ignores the VPA unless verticalPodAutoscaler.recommender names it. The default requests (10m CPU, 16Mi memory) are scheduling floors, not a sizing: measure then tune.

Compatibility

The values schema is strict: unknown keys fail the install. A breaking change to values bumps the chart MAJOR version; deprecations are announced one MINOR version ahead. Requires Kubernetes 1.33 or later.

Maintainers

NameEmailUrl
spnnglhttps://github.com/spnngl

Source Code

Requirements

Kubernetes: >=1.33.0-0

Values

KeyTypeDefaultDescription
affinityobject{}Affinity, merged over the chart default: a preferred pod anti-affinity that spreads the replicas over nodes (set podAntiAffinity to replace it).
autoscaling.behaviorobject{"scaleDown":{"stabilizationWindowSeconds":300}}HPA behavior. Slow scale-down: traffic of a web client comes in bursts (page loads).
autoscaling.enabledboolfalseCreate a HorizontalPodAutoscaler. Enabling it drops replicas from the Deployment: it falls to 1 until the HPA reacts.
autoscaling.maxReplicasint10HPA maximum replicas.
autoscaling.metricslist[{"resource":{"name":"cpu","target":{"averageUtilization":75,"type":"Utilization"}},"type":"Resource"}]Raw autoscaling/v2 MetricSpec list. CPU Utilization is a percentage of resources.requests.cpu: with the 10m floor, 75% fires at ~8m, so size requests first.
autoscaling.minReplicasint2HPA minimum replicas.
configobject{"allowCustomHomeservers":true,"defaultHomeserver":0,"homeserverList":["matrix.org"]}Cinny config.json, served to the browser as is (keep secrets out). Keys read by Cinny: defaultHomeserver (index in homeserverList), homeserverList, allowCustomHomeservers, featuredCommunities (openAsDefault, spaces, rooms, servers), hashRouter (enabled, basename). homeserverList entries are server names or https:// URLs: Cinny reads /.well-known/matrix/client there (CORS needed) for the homeserver URL, and uses https://<name> (or the URL) itself when that file is missing or unreachable. Maps merge with these defaults, lists replace them; set a key to null to drop it.
extraEnvlist[]Extra environment variables (EnvVar list), for the other static-web-server SERVER_* settings. Rejected names: those the chart sets (use gracePeriodSeconds and metrics.enabled); the port, listening socket, health endpoint, root and fallback page, which the probes, Service, NetworkPolicy and config.json mount rely on; security headers and HTTP/2 (which turns them on and needs TLS files), whose X-Frame-Options: DENY breaks the Element Call Cinny frames from its own origin. SERVER_HOST must not be a loopback address: probes and Service reach the pod IP.
fullnameOverridestring""Override the full resource name (default <release>-<chart>).
gracePeriodSecondsint5Seconds the server keeps serving after SIGTERM (SERVER_GRACE_PERIOD), while Services and proxies stop sending it traffic; then it drains open requests. terminationGracePeriodSeconds is this plus 10.
hostUsersboolfalseRun the pod in a user namespace (false: uid 65532 maps to an unprivileged host uid). Needs node support (containerd 2.0+ or CRI-O, runc 1.2+, kernel 6.3+); pods fail to start otherwise. true uses host users.
httpRoute.annotationsobject{}HTTPRoute annotations.
httpRoute.enabledboolfalseCreate a Gateway API HTTPRoute (path prefix /: Cinny cannot be served under a prefix).
httpRoute.hostnameslist[]Host names (empty: any host of the Gateway listener).
httpRoute.labelsobject{}Extra HTTPRoute labels.
httpRoute.parentRefslist[]Gateways (parentRefs). Required when enabled.
image.digeststring""Image digest, only valid together with image.tag.
image.pullPolicystring"IfNotPresent"Image pull policy.
image.repositorystring"ghcr.io/spnngl/images/cinny"Image repository.
image.tagstring""Image tag. Empty: the tag and digest recorded for image.repository in the artifacthub.io/images annotation of Chart.yaml. When set, the chart digest is not applied; add image.digest to pin it.
imagePullSecretslist[]Image pull secrets (list of {name: <secret>}).
ingress.annotationsobject{}Ingress annotations.
ingress.classNamestring""Ingress class name (empty: cluster default).
ingress.enabledboolfalseCreate an Ingress (path /: Cinny is built for the root path, it cannot be served under a prefix).
ingress.hostslist[]Host names. Required when enabled.
ingress.labelsobject{}Extra Ingress labels (for example the label an external-dns --label-filter selects).
ingress.tlslist[]Ingress TLS blocks (secretName, hosts).
livenessProbeobject{"failureThreshold":3,"periodSeconds":10,"timeoutSeconds":2}Liveness probe (GET /health; the handler is fixed, set timings only).
metrics.enabledboolfalseServe Prometheus metrics on /metrics (SERVER_METRICS). Same port as the app and unauthenticated: an Ingress or HTTPRoute publishes them too, unless your proxy blocks the path.
metrics.podMonitor.enabledboolfalseCreate a Prometheus Operator PodMonitor. Needs metrics.enabled; exclusive with serviceMonitor.
metrics.podMonitor.intervalstring""Scrape interval (empty: Prometheus default).
metrics.podMonitor.labelsobject{}Extra labels.
metrics.podMonitor.metricRelabelingslist[]Metric relabelings.
metrics.podMonitor.relabelingslist[]Relabelings.
metrics.podMonitor.scrapeTimeoutstring""Scrape timeout (empty: Prometheus default).
metrics.serviceMonitor.enabledboolfalseCreate a Prometheus Operator ServiceMonitor (scrapes the app Service). Needs metrics.enabled; exclusive with podMonitor.
metrics.serviceMonitor.intervalstring""Scrape interval (empty: Prometheus default).
metrics.serviceMonitor.labelsobject{}Extra labels (for example release: kube-prometheus-stack).
metrics.serviceMonitor.metricRelabelingslist[]Metric relabelings.
metrics.serviceMonitor.relabelingslist[]Relabelings.
metrics.serviceMonitor.scrapeTimeoutstring""Scrape timeout (empty: Prometheus default).
minReadySecondsint10Seconds a new pod must be ready before it counts as available, so a rolling update replaces the next pod only once the new one is serving.
nameOverridestring""Override the chart name used in resource names and labels.
networkPolicy.egress.enabledboolfalseRestrict egress to extraEgress. The server opens no connection and resolves no name, so an empty list (deny all) is enough.
networkPolicy.egress.extraEgresslist[]Extra NetworkPolicyEgressRules.
networkPolicy.enabledbooltrueCreate a NetworkPolicy (ingress: the HTTP port).
networkPolicy.http.fromlist[]NetworkPolicyPeer list allowed to reach the HTTP port (your ingress controller or Gateway, and Prometheus with metrics.enabled). Empty: any source.
nodeSelectorobject{"kubernetes.io/os":"linux"}Node selector.
podAnnotationsobject{}Pod annotations.
podDisruptionBudget.enabledboolfalseCreate a PodDisruptionBudget (unhealthyPodEvictionPolicy: AlwaysAllow).
podDisruptionBudget.maxUnavailableint1Pods that may be unavailable at once (a number or a percentage).
podLabelsobject{}Extra pod labels.
podSecurityContextobject{"fsGroup":65532,"runAsGroup":65532,"runAsNonRoot":true,"runAsUser":65532,"seccompProfile":{"type":"RuntimeDefault"}}Pod security context. Overrides are merged onto these defaults.
priorityClassNamestring""Priority class name.
readinessProbeobject{"failureThreshold":3,"periodSeconds":10,"timeoutSeconds":2}Readiness probe (GET /health; the handler is fi

Deploy cinny with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cinny on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcinny is pinned at v0.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply