Deploys matszwe02/ytdlp_web_player, a Flask app that fetches videos with
yt-dlp, transcodes them with ffmpeg and serves them as HLS. It ships no
authentication of any kind, so the chart carries a preconfigured oauth2-proxy
as an optional subchart, in the data path in front of the app.
This is the first chart in the repo with a dependency, so the rule "charts
have no dependencies" falls here. It is replaced in CLAUDE.md and README.md by
a bar: a dependency has to be optional and off by default, upstream's chart is
consumed as it comes (documented where it falls short of our conventions,
never patched), and the price is written down - above all that a subchart is
invisible to everything downstream watching Helm release versions, so a new
proxy release only reaches a cluster when this chart is republished.
CI learns the dependency in five places, not the three the plan expected:
helm lint, package, template and install all exit 1 while charts/ is unfilled,
so ci/helm-dependencies.sh runs before lint and package in validate-charts.yml,
before package in publish-helm-chart.yml, and inside run-install-test.sh,
run-trivy-config.sh and run-quantity-render-test.sh - the last of which renders
every chart on every PR and would have gone red first.
Notable chart decisions, each measured rather than assumed:
- The image has no USER and runs as root by default, but not by necessity: it
runs under an arbitrary uid with readOnlyRootFilesystem and the full
hardening baseline. Only the pinned uid is a deviation, and it is documented.
- Two emptyDirs, each justified separately. /data holds the video cache
(DATA_PATH). /tmp is NOT mounted - measured across metadata extraction, HLS
transcoding, sprite generation and audio extraction, the image never writes
there. What it does write is $HOME/.cache, so /cache is mounted with HOME and
XDG_CACHE_HOME pointed at it; without it yt-dlp re-downloads its JavaScript
challenge-solver from github.com on every extraction.
- The proxy is wired through config.configFile, the only value the subchart
passes through tpl - config.upstreams is emitted with toJson and would carry
a literal {{ .Release.Name }} into the manifest.
- Rendering aborts when this chart's Ingress and the proxy's claim the same
host: ingress-nginx rejects the second one and a Fleet bundle then sits in
ErrApplied until forceSyncGeneration is bumped.
Fixes #214
27 lines
1.6 KiB
YAML
27 lines
1.6 KiB
YAML
{{- $proxy := (index .Values "oauth2-proxy") | default dict -}}
|
|
{{- $config := $proxy.config | default dict -}}
|
|
{{- $ownSecret := printf "%s-%s-oauth2-proxy-secret" .Release.Name .Chart.Name -}}
|
|
{{- if and $proxy.enabled (eq (tpl ($config.existingSecret | default "") .) $ownSecret) }}
|
|
# The three credentials the proxy needs, as a 1Password item (README, guideline
|
|
# 8). This chart renders the CR itself rather than only expecting a Secret name,
|
|
# for the same reason every other chart here does: the operator is the repo's
|
|
# secret mechanism, and a chart that only names a Secret leaves the operator
|
|
# half of the wiring to a second, undocumented place.
|
|
#
|
|
# It is rendered only while the subchart still points at THIS name. Set
|
|
# oauth2-proxy.config.existingSecret to a Secret of your own and the chart
|
|
# creates nothing here - your Secret then has to carry the same three keys.
|
|
#
|
|
# Note what the operator does and does not do: it copies the item's FIELD NAMES
|
|
# into the Secret's keys. A field spelled differently produces a Secret without
|
|
# that key, the install stays green, and the proxy pod sits in
|
|
# CreateContainerConfigError. See values.yaml for the three names and for the
|
|
# URL-safe base64 trap on cookie-secret.
|
|
apiVersion: onepassword.com/v1
|
|
kind: OnePasswordItem
|
|
metadata:
|
|
name: {{ $ownSecret }}
|
|
spec:
|
|
itemPath: {{ required "The oauth2-proxy needs its credentials: set secrets.oauth2ProxySecretRef to the op:// path of an item carrying client-id, client-secret and cookie-secret - or point oauth2-proxy.config.existingSecret at a Secret you manage yourself." .Values.secrets.oauth2ProxySecretRef }}
|
|
{{- end }}
|