Add smartrss

This commit is contained in:
2025-08-04 00:19:22 +02:00
parent a341eead5e
commit a91bd7550d
5 changed files with 90 additions and 0 deletions
+1
View File
@@ -14,3 +14,4 @@ resources:
- ./pv-medias.yaml
- ./pv-config.yaml
- ./flood
- ./smartrss
+50
View File
@@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: smartrss
spec:
template:
spec:
securityContext:
fsGroup: 1001
runAsUser: 1001
runAsGroup: 1001
runAsNonRoot: true
fsGroupChangePolicy: OnRootMismatch
containers:
- name: smartrss
image: nixery.dev/shell/rsstail-py
command: [/app/smartrss.sh]
env:
- name: URL
valueFrom:
secretKeyRef:
name: smartrss
key: url
- name: TRURL
value: "http://transmission:9091/transmission/rpc"
- name: TRUSER
valueFrom:
secretKeyRef:
name: transmission
key: username
- name: TRPASS
valueFrom:
secretKeyRef:
name: transmission
key: password
volumeMounts:
- name: scripts
mountPath: /app
readOnly: true
- name: medias
mountPath: /medias
readOnly: true
volumes:
- name: scripts
configMap:
name: smartrss-scripts
- name: medias
persistentVolumeClaim:
# TODO: use medias once i actually have some :c
claimName: downloads
@@ -0,0 +1,16 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: true
pairs:
app.kubernetes.io/component: smartrss
configMapGenerator:
- name: smartrss-scripts
files:
- ./smartrss.sh
resources:
- ./deploy.yaml
- ./secret.yaml
+13
View File
@@ -0,0 +1,13 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: smartrss
spec:
refreshInterval: 24h
secretStoreRef:
name: bitwarden
kind: ClusterSecretStore
data:
- secretKey: url
remoteRef:
key: smartrss-url
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
rsstail -f '{title}---{link}\n' "$URL" | while IFS="---" read -r title link; do
name=$(guessit "$title" -P title | tr -d "[:punct:]")
# shellcheck disable=SC2012
if ls /medias | tr -d "[:punct:]" | grep -qix "$name"; then
transmission-remote "$TRURL" --auth "$TRUSER:$TRPASS" -a "$link"
fi
done