feat(chart): set the Deezer ARL from values
- new deezer.arl value rendered as DEEZER_ARL - existingSecret and arl are mutually exclusive - values.local.yaml is gitignored; README documents both options - chart 0.4.1 and a chart check for the new value
This commit is contained in:
1 parent
26c41cc7d9
commit
de1e95bfc6
6 files changed
+67
-5
No files matched your search
@@ -23,4 +23,8 @@ test-media/
|
||||
|
||||
# Packaged Helm charts
|
||||
dist/
|
||||
|
||||
# Local Helm overrides (may contain the Deezer ARL)
|
||||
values.local.yaml
|
||||
charts/*/values.local.yaml
|
||||
.kotlin/
|
||||
@@ -95,7 +95,7 @@ Everything is environment variables:
|
||||
| `YTDLP_PATH` | `yt-dlp` | YouTube Music downloader / search binary |
|
||||
| `STREAMRIP_PATH` | `rip` | Deezer downloader (`streamrip`) |
|
||||
| `DEFAULT_SOURCE` | `deezer` | Source for new moods: `deezer` or `youtube` |
|
||||
| `DEEZER_ARL` | empty | Deezer account cookie used for downloads |
|
||||
| `DEEZER_ARL` | empty | Deezer account cookie used for downloads (chart: `deezer.arl` or `deezer.existingSecret`) |
|
||||
| `DEEZER_QUALITY` | `0` | `0` = 128 kbps MP3, `1` = 320 kbps MP3 |
|
||||
| `DEEZER_API_BASE` | `https://api.deezer.com` | Public Deezer API base |
|
||||
|
||||
@@ -277,6 +277,33 @@ helm upgrade --install audiomanager charts/audiomanager \
|
||||
upgrade. CI builds `:latest` and `:sha-<commit>` on every push to `main`, and
|
||||
publishes the packaged chart.
|
||||
|
||||
### Setting the Deezer ARL in a values file
|
||||
|
||||
`deezer.arl` takes the cookie directly, so no Secret is needed:
|
||||
|
||||
```yaml
|
||||
# values.local.yaml (gitignored)
|
||||
image:
|
||||
tag: sha-<commit>
|
||||
users:
|
||||
existingSecret: audiomanager-users
|
||||
defaultSource: deezer
|
||||
deezer:
|
||||
arl: "<arl>"
|
||||
quality: 0
|
||||
```
|
||||
|
||||
```bash
|
||||
helm upgrade --install audiomanager charts/audiomanager \
|
||||
--namespace audiomanager --create-namespace \
|
||||
-f values.local.yaml
|
||||
```
|
||||
|
||||
Set only one of `deezer.arl` and `deezer.existingSecret`; the chart fails
|
||||
otherwise. A plain value is stored in clear text in your values file, in
|
||||
`helm get values` and in the release Secret, so use `deezer.existingSecret` on a
|
||||
shared cluster or an untracked `values.local.yaml` here.
|
||||
|
||||
Before deploying the mood-first version over an old instance, wipe the old
|
||||
database and media: V8 drops the content, but the old mounted files are no
|
||||
longer referenced and should be removed by the operator. The old chart used the
|
||||
|
||||
@@ -2,5 +2,5 @@ apiVersion: v2
|
||||
name: audiomanager
|
||||
description: Mood-first self-hosted music server
|
||||
type: application
|
||||
version: 0.4.0
|
||||
version: 0.4.1
|
||||
appVersion: "0.1.0"
|
||||
@@ -4,6 +4,9 @@
|
||||
{{- if not (has (int .Values.deezer.quality) (list 0 1)) }}
|
||||
{{- fail "deezer.quality must be 0 (128 kbps) or 1 (320 kbps)" }}
|
||||
{{- end }}
|
||||
{{- if and .Values.deezer.arl .Values.deezer.existingSecret }}
|
||||
{{- fail "set only one of deezer.arl and deezer.existingSecret" }}
|
||||
{{- end }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -65,6 +68,9 @@ spec:
|
||||
name: {{ .Values.deezer.existingSecret }}
|
||||
key: {{ .Values.deezer.key }}
|
||||
optional: true
|
||||
{{- else if .Values.deezer.arl }}
|
||||
- name: DEEZER_ARL
|
||||
value: {{ .Values.deezer.arl | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.env }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
|
||||
@@ -21,13 +21,21 @@ users:
|
||||
key: users.yaml
|
||||
|
||||
# Default catalog for new moods. Users can switch each mood between Deezer and
|
||||
# YouTube Music. Deezer needs an ARL cookie in a secret.
|
||||
# YouTube Music. Deezer needs an ARL cookie: either `deezer.arl` below or a
|
||||
# Secret referenced by `deezer.existingSecret`. Leave both empty to use
|
||||
# YouTube Music only.
|
||||
defaultSource: deezer
|
||||
deezer:
|
||||
# Create this secret with `kubectl create secret generic audiomanager-deezer
|
||||
# --from-literal=arl=...`. Leave it empty to use YouTube Music only.
|
||||
# Option A (recommended on a shared machine): a Secret you manage separately.
|
||||
# kubectl -n audiomanager create secret generic audiomanager-deezer \
|
||||
# --from-literal=arl='<arl>'
|
||||
existingSecret: ""
|
||||
key: arl
|
||||
# Option B: the ARL directly in values. It is stored in plaintext in this
|
||||
# file, in `helm get values` and in the release Secret, so keep this file out
|
||||
# of git (or pass it as `--set deezer.arl="$DEEZER_ARL"` instead).
|
||||
# Set only one of `arl` and `existingSecret`.
|
||||
arl: ""
|
||||
# 0 = 128 kbps MP3 (Deezer Free), 1 = 320 kbps MP3 (Deezer Premium).
|
||||
quality: 0
|
||||
apiBase: https://api.deezer.com
|
||||
|
||||
@@ -77,4 +77,21 @@ helm template "$RELEASE" "$CHART_DIR" \
|
||||
--set users.existingSecret=test \
|
||||
--set allowDefaultNamespace=true >/dev/null
|
||||
|
||||
echo "render with deezer.arl"
|
||||
helm template "$RELEASE" "$CHART_DIR" \
|
||||
--namespace "$NAMESPACE" \
|
||||
--set users.existingSecret=test \
|
||||
--set deezer.arl=test-arl > "$workdir/arl.yaml"
|
||||
grep -A1 'name: DEEZER_ARL' "$workdir/arl.yaml" | grep -q 'value: "test-arl"'
|
||||
|
||||
echo "deezer.arl and deezer.existingSecret are mutually exclusive"
|
||||
if helm template "$RELEASE" "$CHART_DIR" \
|
||||
--namespace "$NAMESPACE" \
|
||||
--set users.existingSecret=test \
|
||||
--set deezer.arl=test-arl \
|
||||
--set deezer.existingSecret=test-secret >/dev/null 2>&1; then
|
||||
echo "FAIL: the chart accepted both deezer.arl and deezer.existingSecret" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "chart check passed"
|
||||
Reference in new issue
Block a user