mirror of
https://github.com/zoriya/snow.git
synced 2026-08-15 18:44:14 +00:00
Add smartrss
This commit is contained in:
@@ -14,3 +14,4 @@ resources:
|
||||
- ./pv-medias.yaml
|
||||
- ./pv-config.yaml
|
||||
- ./flood
|
||||
- ./smartrss
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user