From c89748678f41a713341498b2deebc9be0338eba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=97=AA=D1=94=CE=BD=CE=B9=CE=B7=20=E1=97=B7=CF=85=D0=BD?= =?UTF-8?q?=CA=9F?= Date: Sun, 25 Apr 2021 15:14:18 -0400 Subject: [PATCH] [transmission] use env config (#830) * feat: use env config * fix: update common yaml to remove configmap --- charts/stable/transmission/Chart.yaml | 2 +- charts/stable/transmission/README.md | 23 +++- .../transmission/README_CHANGELOG.md.gotmpl | 7 ++ .../transmission/README_CONFIG.md.gotmpl | 2 +- .../stable/transmission/templates/common.yaml | 30 ----- .../transmission/templates/configmap.yaml | 9 -- charts/stable/transmission/values.yaml | 108 ++++-------------- 7 files changed, 47 insertions(+), 134 deletions(-) delete mode 100644 charts/stable/transmission/templates/configmap.yaml diff --git a/charts/stable/transmission/Chart.yaml b/charts/stable/transmission/Chart.yaml index 40c8aafc..1c0be68f 100644 --- a/charts/stable/transmission/Chart.yaml +++ b/charts/stable/transmission/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: v3.00 description: Transmission is a cross-platform BitTorrent client name: transmission -version: 5.0.0 +version: 6.0.0 kubeVersion: ">=1.16.0-0" keywords: - transmission diff --git a/charts/stable/transmission/README.md b/charts/stable/transmission/README.md index 6fb6826f..1b3ad005 100644 --- a/charts/stable/transmission/README.md +++ b/charts/stable/transmission/README.md @@ -1,6 +1,6 @@ # transmission -![Version: 5.0.0](https://img.shields.io/badge/Version-5.0.0-informational?style=flat-square) ![AppVersion: v3.00](https://img.shields.io/badge/AppVersion-v3.00-informational?style=flat-square) +![Version: 6.0.0](https://img.shields.io/badge/Version-6.0.0-informational?style=flat-square) ![AppVersion: v3.00](https://img.shields.io/badge/AppVersion-v3.00-informational?style=flat-square) Transmission is a cross-platform BitTorrent client @@ -68,7 +68,7 @@ helm install transmission k8s-at-home/transmission -f values.yaml ## Custom configuration -N/A +To view more environment variables [see here](https://github.com/k8s-at-home/container-images/tree/main/apps/transmission/settings.json.tmpl) ## Values @@ -76,8 +76,14 @@ N/A | Key | Type | Default | Description | |-----|------|---------|-------------| -| config | string | string | Transmission's settings.json configuration | -| env | object | `{}` | | +| env.TRANSMISSION_DOWNLOAD_DIR | string | `"/downloads/complete"` | Torrent download directory | +| env.TRANSMISSION_INCOMPLETE_DIR | string | `"/downloads/incomplete"` | Incomplete download directory | +| env.TRANSMISSION_INCOMPLETE_DIR_ENABLED | bool | `false` | Enable incomplete download directory | +| env.TRANSMISSION_RPC_PASSWORD | string | `"CHANGEME"` | Password to access the Web UI | +| env.TRANSMISSION_WATCH_DIR | string | `"/watch"` | Watch directory | +| env.TRANSMISSION_WATCH_DIR_ENABLED | bool | `false` | Enable watch directory | +| env.TRANSMISSION_WEB_HOME | string | `"/web"` | Path in container where the Web UI is located | +| env.TZ | string | `"UTC"` | Container timezone | | image.pullPolicy | string | `"IfNotPresent"` | | | image.repository | string | `"ghcr.io/k8s-at-home/transmission"` | | | image.tag | string | `"v3.00"` | | @@ -103,6 +109,12 @@ All notable changes to this application Helm chart will be documented in this fi The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [6.0.0] + +#### Changed + +- **Breaking**: `.Values.config` is deprecated in favor of using environment variables for configuration. See [here](https://github.com/k8s-at-home/container-images/tree/main/apps/transmission/settings.json.tmpl) for more options. + ### [5.0.0] #### Added @@ -111,7 +123,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), #### Changed -- **Breaking**: `transmissionConfig` became `config` and is now a string not a object +- **Breaking**: `transmissionConfig` became `config` and is now a string not an object ### [4.0.0] @@ -131,6 +143,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Initial commit +[6.0.0]: #6.0.0 [5.0.0]: #5.0.0 [4.0.0]: #4.0.0 [1.0.0]: #1.0.0 diff --git a/charts/stable/transmission/README_CHANGELOG.md.gotmpl b/charts/stable/transmission/README_CHANGELOG.md.gotmpl index 5420cea4..c6cc70d9 100644 --- a/charts/stable/transmission/README_CHANGELOG.md.gotmpl +++ b/charts/stable/transmission/README_CHANGELOG.md.gotmpl @@ -9,6 +9,12 @@ All notable changes to this application Helm chart will be documented in this fi The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [6.0.0] + +#### Changed + +- **Breaking**: `.Values.config` is deprecated in favor of using environment variables for configuration. See [here](https://github.com/k8s-at-home/container-images/tree/main/apps/transmission/settings.json.tmpl) for more options. + ### [5.0.0] #### Added @@ -37,6 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Initial commit +[6.0.0]: #6.0.0 [5.0.0]: #5.0.0 [4.0.0]: #4.0.0 [1.0.0]: #1.0.0 diff --git a/charts/stable/transmission/README_CONFIG.md.gotmpl b/charts/stable/transmission/README_CONFIG.md.gotmpl index e93d80bf..a036d535 100644 --- a/charts/stable/transmission/README_CONFIG.md.gotmpl +++ b/charts/stable/transmission/README_CONFIG.md.gotmpl @@ -5,5 +5,5 @@ {{- define "custom.custom.configuration" -}} {{ template "custom.custom.configuration.header" . }} -N/A +To view more environment variables [see here](https://github.com/k8s-at-home/container-images/tree/main/apps/transmission/settings.json.tmpl) {{- end -}} diff --git a/charts/stable/transmission/templates/common.yaml b/charts/stable/transmission/templates/common.yaml index e0195d0d..a6613c2c 100644 --- a/charts/stable/transmission/templates/common.yaml +++ b/charts/stable/transmission/templates/common.yaml @@ -1,31 +1 @@ -{{/* Make sure all variables are set properly */}} -{{- include "common.values.setup" . }} - -{{/* Append the configMap to the additionalVolumes */}} -{{- define "transmission.configmap.volume" -}} -name: transmission-settings -configMap: - name: {{ template "common.names.fullname" . }}-config -{{- end -}} - -{{- $volume := include "transmission.configmap.volume" . | fromYaml -}} -{{- if $volume -}} - {{- $additionalVolumes := append .Values.additionalVolumes $volume }} - {{- $_ := set .Values "additionalVolumes" (deepCopy $additionalVolumes) -}} -{{- end -}} - -{{/* Append the configMap volume to the additionalVolumeMounts */}} -{{- define "transmission.configmap.volumeMount" -}} -name: transmission-settings -mountPath: /config/settings.json -subPath: settings.json -{{- end -}} - -{{- $volumeMount := include "transmission.configmap.volumeMount" . | fromYaml -}} -{{- if $volumeMount -}} - {{- $additionalVolumeMounts := append .Values.additionalVolumeMounts $volumeMount }} - {{- $_ := set .Values "additionalVolumeMounts" (deepCopy $additionalVolumeMounts) -}} -{{- end -}} - -{{/* Render the templates */}} {{ include "common.all" . }} diff --git a/charts/stable/transmission/templates/configmap.yaml b/charts/stable/transmission/templates/configmap.yaml deleted file mode 100644 index 62040f65..00000000 --- a/charts/stable/transmission/templates/configmap.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "common.names.fullname" . }}-config - labels: - {{- include "common.labels" . | nindent 4 }} -data: - settings.json: | - {{- .Values.config | nindent 4 }} diff --git a/charts/stable/transmission/values.yaml b/charts/stable/transmission/values.yaml index 48c0163f..d39a735b 100644 --- a/charts/stable/transmission/values.yaml +++ b/charts/stable/transmission/values.yaml @@ -27,9 +27,26 @@ image: strategy: type: Recreate -env: {} - # TZ: UTC - # TRANSMISSION_WEB_HOME: /config/flood +# To view more enviornment variables see here: +# https://github.com/k8s-at-home/container-images/tree/main/apps/transmission/settings.json.tmpl +env: + # -- Container timezone + TZ: UTC + # -- Path in container where the Web UI is located + TRANSMISSION_WEB_HOME: /web + # -- Password to access the Web UI + TRANSMISSION_RPC_PASSWORD: CHANGEME + # -- Torrent download directory + TRANSMISSION_DOWNLOAD_DIR: /downloads/complete + # -- Enable incomplete download directory + TRANSMISSION_INCOMPLETE_DIR_ENABLED: false + # -- Incomplete download directory + TRANSMISSION_INCOMPLETE_DIR: /downloads/incomplete + # -- Enable watch directory + TRANSMISSION_WATCH_DIR_ENABLED: false + # -- Watch directory + TRANSMISSION_WATCH_DIR: /watch + service: port: @@ -65,19 +82,8 @@ probes: spec: timeoutSeconds: 30 - ingress: enabled: false - # annotations: {} - # hosts: - # - host: example.com - # paths: - # - path: / - # pathType: Prefix - # tls: - # - secretName: example.com - # hosts: - # - example.com persistence: ## Directory for storing active torrent files, resume list, @@ -111,77 +117,3 @@ persistence: emptyDir: enabled: false mountPath: /watch - -# -- Transmission's settings.json configuration -# @default -- string -config: | - { - "alt-speed-down": 50, - "alt-speed-enabled": false, - "alt-speed-time-begin": 540, - "alt-speed-time-day": 127, - "alt-speed-time-enabled": false, - "alt-speed-time-end": 1020, - "alt-speed-up": 50, - "bind-address-ipv4": "0.0.0.0", - "bind-address-ipv6": "::", - "blocklist-enabled": true, - "blocklist-url": "http://john.bitsurge.net/public/biglist.p2p.gz", - "cache-size-mb": 4, - "dht-enabled": true, - "download-dir": "/downloads/complete", - "download-queue-enabled": true, - "download-queue-size": 5, - "encryption": 1, - "idle-seeding-limit": 30, - "idle-seeding-limit-enabled": false, - "incomplete-dir": "/downloads/incomplete", - "incomplete-dir-enabled": true, - "lpd-enabled": false, - "message-level": 2, - "peer-congestion-algorithm": "", - "peer-id-ttl-hours": 6, - "peer-limit-global": 200, - "peer-limit-per-torrent": 50, - "peer-port": 51413, - "peer-port-random-high": 65535, - "peer-port-random-low": 49152, - "peer-port-random-on-start": false, - "peer-socket-tos": "default", - "pex-enabled": true, - "port-forwarding-enabled": false, - "preallocation": 1, - "prefetch-enabled": true, - "queue-stalled-enabled": true, - "queue-stalled-minutes": 30, - "ratio-limit": 2, - "ratio-limit-enabled": false, - "rename-partial-files": true, - "rpc-authentication-required": false, - "rpc-bind-address": "0.0.0.0", - "rpc-enabled": true, - "rpc-host-whitelist": "", - "rpc-host-whitelist-enabled": false, - "rpc-password": "CHANGEME", - "rpc-port": 9091, - "rpc-url": "/transmission/", - "rpc-username": "", - "rpc-whitelist": "", - "rpc-whitelist-enabled": false, - "scrape-paused-torrents-enabled": true, - "script-torrent-done-enabled": false, - "script-torrent-done-filename": "", - "seed-queue-enabled": false, - "seed-queue-size": 10, - "speed-limit-down": 100, - "speed-limit-down-enabled": false, - "speed-limit-up": 100, - "speed-limit-up-enabled": false, - "start-added-torrents": true, - "trash-original-torrent-files": false, - "umask": 2, - "upload-slots-per-torrent": 14, - "utp-enabled": true, - "watch-dir": "/watch", - "watch-dir-enabled": false - }