Skip to content

Commit 363e3ee

Browse files
committed
Enable configurable media source paths in Shoebox.
Introduced a toggle (`config.mediaSourcePaths.enabled`) to enable or disable media source paths and updated relevant templates and manifests for conditional rendering. Improved PVC and StatefulSet configurations to handle media sources dynamically, enhancing flexibility in defining storage options.
1 parent 2989684 commit 363e3ee

File tree

7 files changed

+22
-8
lines changed

7 files changed

+22
-8
lines changed

.github/workflows/helm-release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
wait: 120s
5959

6060
- name: Run chart-testing (install)
61-
run: ct install --target-branch ${{ github.event.repository.default_branch }} --charts charts/shoebox --helm-extra-set-args "--set persistence.data.enabled=false --set persistence.thumbnails.enabled=false --set persistence.exports.enabled=false --set persistence.media.enabled=false"
61+
run: ct install --target-branch ${{ github.event.repository.default_branch }} --charts charts/shoebox --helm-extra-set-args "--set persistence.data.enabled=false --set persistence.thumbnails.enabled=false --set persistence.exports.enabled=false --set config.mediaSourcePaths.enabled=false"
6262

6363
release:
6464
needs: lint-test
@@ -92,4 +92,3 @@ jobs:
9292
pages_branch: main
9393
env:
9494
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
95-

charts/shoebox/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: shoebox
33
description: A Helm chart for the Shoebox application - a digital shoebox for your videos
44
type: application
5-
version: 0.0.15
5+
version: 0.0.16
66
appVersion: "main"
77
keywords:
88
- video

charts/shoebox/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ The following table lists the configurable parameters of the Shoebox chart and t
6464
| `config.serverHost` | Host to bind the server | `0.0.0.0` |
6565
| `config.serverPort` | Port to bind the server | `3000` |
6666
| `config.databaseUrl` | Database URL (SQLite) | `sqlite:/app/data/videos.db` |
67-
| `config.mediaSourcePaths` | Paths to scan for videos (supports named sections, see docs) | `/mnt/videos` |
67+
| `config.mediaSourcePaths.enabled` | Enable media source paths | `true` |
68+
| `config.mediaSourcePaths.sources` | List of media source paths to scan for videos | See values.yaml |
6869
| `config.thumbnailPath` | Path to store thumbnails | `/app/thumbnails` |
6970
| `config.exportBasePath` | Path for exported files | `/app/exports` |
7071
| `config.rustLog` | Rust log level | `info` |
@@ -79,9 +80,9 @@ The following table lists the configurable parameters of the Shoebox chart and t
7980
| `persistence.thumbnails.size` | Size of thumbnails PVC | `5Gi` |
8081
| `persistence.exports.enabled` | Enable persistence for exports | `true` |
8182
| `persistence.exports.size` | Size of exports PVC | `10Gi` |
82-
| `persistence.media.enabled` | Enable persistence for media | `true` |
83-
| `persistence.media.existingClaim` | Use existing PVC for media | `""` |
84-
| `persistence.media.size` | Size of media PVC | `100Gi` |
83+
| `config.mediaSourcePaths.enabled` | Enable media source paths | `true` |
84+
| `config.mediaSourcePaths.sources[].pathExistingClaim` | Use existing PVC for media source path | `""` |
85+
| `config.mediaSourcePaths.sources[].originalExistingClaim` | Use existing PVC for original media source path | `""` |
8586

8687
### PostgreSQL Configuration
8788

@@ -124,7 +125,7 @@ helm install shoebox . \
124125
--set persistence.data.enabled=false \
125126
--set persistence.thumbnails.enabled=false \
126127
--set persistence.exports.enabled=false \
127-
--set persistence.media.enabled=false
128+
--set config.mediaSourcePaths.enabled=false
128129
```
129130

130131
## Upgrading

charts/shoebox/templates/_helpers.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Create the name of the service account to use
6565
Convert structured mediaSourcePaths to string format
6666
*/}}
6767
{{- define "shoebox.mediaSourcePathsString" -}}
68+
{{- if .Values.config.mediaSourcePaths.enabled -}}
6869
{{- $paths := list -}}
6970
{{- range .Values.config.mediaSourcePaths.sources -}}
7071
{{- $path := printf "%s:%s" .name .path -}}
@@ -77,4 +78,7 @@ Convert structured mediaSourcePaths to string format
7778
{{- $paths = append $paths $path -}}
7879
{{- end -}}
7980
{{- join "," $paths -}}
81+
{{- else -}}
82+
{{- "" -}}
83+
{{- end -}}
8084
{{- end }}

charts/shoebox/templates/pvc.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ spec:
5252
{{- end }}
5353
---
5454
{{- end }}
55+
{{- if .Values.config.mediaSourcePaths.enabled }}
5556
{{- range .Values.config.mediaSourcePaths.sources }}
5657
{{- if not .pathExistingClaim }}
5758
---
@@ -72,7 +73,9 @@ spec:
7273
{{- end }}
7374
{{- end }}
7475
{{- end }}
76+
{{- end }}
7577

78+
{{- if .Values.config.mediaSourcePaths.enabled }}
7679
{{- range .Values.config.mediaSourcePaths.sources }}
7780
{{- if and .originalPath (not .originalExistingClaim) }}
7881
---
@@ -93,3 +96,4 @@ spec:
9396
{{- end }}
9497
{{- end }}
9598
{{- end }}
99+
{{- end }}

charts/shoebox/templates/statefulset.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ spec:
8585
readOnly: true
8686
{{- end }}
8787
{{- end }}
88+
{{- if .Values.config.mediaSourcePaths.enabled }}
8889
{{- range .Values.config.mediaSourcePaths.sources }}
8990
- name: media-{{ .name | lower }}
9091
mountPath: {{ .path }}
@@ -101,6 +102,7 @@ spec:
101102
{{- end }}
102103
{{- end }}
103104
{{- end }}
105+
{{- end }}
104106
{{- with .Values.nodeSelector }}
105107
nodeSelector:
106108
{{- toYaml . | nindent 8 }}
@@ -141,6 +143,7 @@ spec:
141143
claimName: {{ include "shoebox.fullname" . }}-exports
142144
{{- end }}
143145
{{- end }}
146+
{{- if .Values.config.mediaSourcePaths.enabled }}
144147
{{- range .Values.config.mediaSourcePaths.sources }}
145148
- name: media-{{ .name | lower }}
146149
persistentVolumeClaim:
@@ -161,3 +164,4 @@ spec:
161164
{{- end }}
162165
{{- end }}
163166
{{- end }}
167+
{{- end }}

charts/shoebox/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ config:
9595
# Media source paths configuration
9696
# You can configure multiple media sources with different settings
9797
mediaSourcePaths:
98+
# Set to false to disable all media source paths
99+
enabled: true
98100
sources:
99101
- name: bmpcc
100102
path: /mnt/videos

0 commit comments

Comments
 (0)