chore: Update manifests after change
This commit is contained in:
@@ -14,9 +14,83 @@ data:
|
||||
echo "curl could not be found, installing";
|
||||
apk add curl;
|
||||
fi;
|
||||
|
||||
if ! command -v jq 2>&1 >/dev/null
|
||||
then
|
||||
echo "jq could not be found, installing";
|
||||
apk add jq;
|
||||
fi;
|
||||
|
||||
API_ENDPOINT="http://localhost:8080/api/v2";
|
||||
|
||||
# echo " ";
|
||||
# echo ">> Authentication ...";
|
||||
# curl -i --silent --header 'Referer: http://localhost:8080' --output response_body_auth.json --data 'username=admin&password=adminadmin' "${API_ENDPOINT}/auth/login" -c cookie;
|
||||
|
||||
echo " ";
|
||||
echo ">> Test access ...";
|
||||
HTTP_STATUS=$(curl -i -X GET --silent --write-out '%{http_code}' --output response_body_test.json -b cookie -c cookie "${API_ENDPOINT}/app/version");
|
||||
echo ">> HTTP Status Code: $HTTP_STATUS"
|
||||
|
||||
VERSION=$(tail -n 1 ./test/response_body_test.json)
|
||||
|
||||
if [ "$HTTP_STATUS" == "200" ]; then
|
||||
echo ">> Access confirmed, qBittorrent version: ${VERSION}"
|
||||
HTTP_STATUS=""
|
||||
else
|
||||
echo ">> ERROR: HTTP status code: $HTTP_STATUS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PAYLOAD=$( jq -n \
|
||||
--arg random_port "true" \
|
||||
'{random_port: $random_port' );
|
||||
|
||||
echo " ";
|
||||
echo ">> Setting port to random ...";
|
||||
curl -i -X POST --silent --write-out '%{http_code}' -d "json={\"random_port\": \"true\"}" "http://localhost:8080/api/v2/app/setPreferences";
|
||||
HTTP_STATUS=$(curl -i -X POST --silent -b cookie -c cookie --write-out '%{http_code}' --output response_body_random.json --data "$PAYLOAD" "${API_ENDPOINT}/app/setPreferences");
|
||||
|
||||
if [ "$HTTP_STATUS" == "200" ]; then
|
||||
echo ">> Random port set"
|
||||
HTTP_STATUS=""
|
||||
else
|
||||
echo ">> ERROR: HTTP status code: $HTTP_STATUS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo " ";
|
||||
echo ">> Sleeping for changes to take effect";
|
||||
sleep 10;
|
||||
echo ">> Updating port with $1 ...";
|
||||
curl -i -X POST --silent --write-out '%{http_code}' -d "json={\"listen_port\": \"${1}\"}" "http://localhost:8080/api/v2/app/setPreferences";
|
||||
sleep 5;
|
||||
|
||||
PAYLOAD=$( jq -n \
|
||||
--arg listen_port "${1}" \
|
||||
'{listen_port: $listen_port' );
|
||||
|
||||
echo " ";
|
||||
echo ">> Updating port with ${1} ...";
|
||||
curl -i -X POST --silent -b cookie -c cookie --write-out '%{http_code}' --output response_body_update.json --data "$PAYLOAD" "${API_ENDPOINT}/app/setPreferences";
|
||||
|
||||
if [ "$HTTP_STATUS" == "200" ]; then
|
||||
echo ">> Port set"
|
||||
HTTP_STATUS=""
|
||||
else
|
||||
echo ">> ERROR: HTTP status code: $HTTP_STATUS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo " ";
|
||||
echo ">> Sleeping for changes to take effect";
|
||||
sleep 5;
|
||||
|
||||
echo " ";
|
||||
echo ">> Qbittorrent's post is now:";
|
||||
curl -i -X GET --silent -b cookie -c cookie --write-out '%{http_code}' --output response_body_check.json "${API_ENDPOINT}/app/preferences";
|
||||
|
||||
LISTEN_PORT=$(cat response_body_check.json | jq -r .listen_port)
|
||||
|
||||
[[ "$HTTP_STATUS" == "200" || "$LISTEN_PORT" == "${1}" ]];
|
||||
echo ">> Port updated successfully!"
|
||||
else
|
||||
echo ">> ERROR: HTTP status code: $HTTP_STATUS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -128,16 +128,11 @@ spec:
|
||||
cpu: 500m
|
||||
memory: 1Gi
|
||||
volumeMounts:
|
||||
- mountPath: /config-old
|
||||
name: config
|
||||
- mountPath: /config/qBittorrent
|
||||
name: config-data
|
||||
- mountPath: /mnt/store
|
||||
name: storage
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: qbittorrent-config
|
||||
- name: config-data
|
||||
persistentVolumeClaim:
|
||||
claimName: qbittorrent-config-data
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
apiVersion: external-secrets.io/v1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: qbittorrent-config-data-backup-secret-external
|
||||
namespace: qbittorrent
|
||||
labels:
|
||||
helm.sh/chart: volsync-target-config-0.5.0
|
||||
app.kubernetes.io/instance: qbittorrent
|
||||
app.kubernetes.io/part-of: qbittorrent
|
||||
app.kubernetes.io/version: "0.5.0"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: qbittorrent-config-data-backup-secret-external
|
||||
spec:
|
||||
secretStoreRef:
|
||||
kind: ClusterSecretStore
|
||||
name: vault
|
||||
target:
|
||||
template:
|
||||
mergePolicy: Merge
|
||||
engineVersion: v2
|
||||
data:
|
||||
RESTIC_REPOSITORY: "{{ .BUCKET_ENDPOINT }}/qbittorrent/qbittorrent-config-data"
|
||||
data:
|
||||
- secretKey: BUCKET_ENDPOINT
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /volsync/restic/digital-ocean
|
||||
metadataPolicy: None
|
||||
property: BUCKET_ENDPOINT
|
||||
- secretKey: RESTIC_PASSWORD
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /volsync/restic/digital-ocean
|
||||
metadataPolicy: None
|
||||
property: RESTIC_PASSWORD
|
||||
- secretKey: AWS_DEFAULT_REGION
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /digital-ocean/home-infra/volsync-backups
|
||||
metadataPolicy: None
|
||||
property: AWS_DEFAULT_REGION
|
||||
- secretKey: AWS_ACCESS_KEY_ID
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /digital-ocean/home-infra/volsync-backups
|
||||
metadataPolicy: None
|
||||
property: AWS_ACCESS_KEY_ID
|
||||
- secretKey: AWS_SECRET_ACCESS_KEY
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /digital-ocean/home-infra/volsync-backups
|
||||
metadataPolicy: None
|
||||
property: AWS_SECRET_ACCESS_KEY
|
||||
@@ -0,0 +1,58 @@
|
||||
apiVersion: external-secrets.io/v1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: qbittorrent-config-data-backup-secret-local
|
||||
namespace: qbittorrent
|
||||
labels:
|
||||
helm.sh/chart: volsync-target-config-0.5.0
|
||||
app.kubernetes.io/instance: qbittorrent
|
||||
app.kubernetes.io/part-of: qbittorrent
|
||||
app.kubernetes.io/version: "0.5.0"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: qbittorrent-config-data-backup-secret-local
|
||||
spec:
|
||||
secretStoreRef:
|
||||
kind: ClusterSecretStore
|
||||
name: vault
|
||||
target:
|
||||
template:
|
||||
mergePolicy: Merge
|
||||
engineVersion: v2
|
||||
data:
|
||||
RESTIC_REPOSITORY: "{{ .BUCKET_ENDPOINT }}/qbittorrent/qbittorrent-config-data"
|
||||
data:
|
||||
- secretKey: BUCKET_ENDPOINT
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /volsync/restic/garage-local
|
||||
metadataPolicy: None
|
||||
property: BUCKET_ENDPOINT
|
||||
- secretKey: RESTIC_PASSWORD
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /volsync/restic/garage-local
|
||||
metadataPolicy: None
|
||||
property: RESTIC_PASSWORD
|
||||
- secretKey: AWS_DEFAULT_REGION
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /garage/home-infra/volsync-backups
|
||||
metadataPolicy: None
|
||||
property: ACCESS_REGION
|
||||
- secretKey: AWS_ACCESS_KEY_ID
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /garage/home-infra/volsync-backups
|
||||
metadataPolicy: None
|
||||
property: ACCESS_KEY_ID
|
||||
- secretKey: AWS_SECRET_ACCESS_KEY
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /garage/home-infra/volsync-backups
|
||||
metadataPolicy: None
|
||||
property: ACCESS_SECRET_KEY
|
||||
@@ -0,0 +1,58 @@
|
||||
apiVersion: external-secrets.io/v1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: qbittorrent-config-data-backup-secret-remote
|
||||
namespace: qbittorrent
|
||||
labels:
|
||||
helm.sh/chart: volsync-target-config-0.5.0
|
||||
app.kubernetes.io/instance: qbittorrent
|
||||
app.kubernetes.io/part-of: qbittorrent
|
||||
app.kubernetes.io/version: "0.5.0"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: qbittorrent-config-data-backup-secret-remote
|
||||
spec:
|
||||
secretStoreRef:
|
||||
kind: ClusterSecretStore
|
||||
name: vault
|
||||
target:
|
||||
template:
|
||||
mergePolicy: Merge
|
||||
engineVersion: v2
|
||||
data:
|
||||
RESTIC_REPOSITORY: "{{ .BUCKET_ENDPOINT }}/qbittorrent/qbittorrent-config-data"
|
||||
data:
|
||||
- secretKey: BUCKET_ENDPOINT
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /volsync/restic/garage-remote
|
||||
metadataPolicy: None
|
||||
property: BUCKET_ENDPOINT
|
||||
- secretKey: RESTIC_PASSWORD
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /volsync/restic/garage-remote
|
||||
metadataPolicy: None
|
||||
property: RESTIC_PASSWORD
|
||||
- secretKey: AWS_DEFAULT_REGION
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /garage/home-infra/volsync-backups
|
||||
metadataPolicy: None
|
||||
property: ACCESS_REGION
|
||||
- secretKey: AWS_ACCESS_KEY_ID
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /garage/home-infra/volsync-backups
|
||||
metadataPolicy: None
|
||||
property: ACCESS_KEY_ID
|
||||
- secretKey: AWS_SECRET_ACCESS_KEY
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /garage/home-infra/volsync-backups
|
||||
metadataPolicy: None
|
||||
property: ACCESS_SECRET_KEY
|
||||
@@ -1,23 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: qbittorrent-config
|
||||
namespace: qbittorrent
|
||||
labels:
|
||||
app.kubernetes.io/name: qbittorrent-config
|
||||
app.kubernetes.io/instance: qbittorrent
|
||||
app.kubernetes.io/part-of: qbittorrent
|
||||
spec:
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: nfs-client
|
||||
capacity:
|
||||
storage: 1Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
nfs:
|
||||
path: /volume2/Storage/Torrent/QBITTORRENT
|
||||
server: synologybond.alexlebens.net
|
||||
mountOptions:
|
||||
- vers=4
|
||||
- minorversion=1
|
||||
- noac
|
||||
@@ -1,17 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: qbittorrent-config
|
||||
namespace: qbittorrent
|
||||
labels:
|
||||
app.kubernetes.io/name: qbittorrent-config
|
||||
app.kubernetes.io/instance: qbittorrent
|
||||
app.kubernetes.io/part-of: qbittorrent
|
||||
spec:
|
||||
volumeName: qbittorrent-config
|
||||
storageClassName: nfs-client
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
@@ -0,0 +1,34 @@
|
||||
apiVersion: volsync.backube/v1alpha1
|
||||
kind: ReplicationSource
|
||||
metadata:
|
||||
name: qbittorrent-config-data-backup-source-external
|
||||
namespace: qbittorrent
|
||||
labels:
|
||||
helm.sh/chart: volsync-target-config-0.5.0
|
||||
app.kubernetes.io/instance: qbittorrent
|
||||
app.kubernetes.io/part-of: qbittorrent
|
||||
app.kubernetes.io/version: "0.5.0"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: qbittorrent-config-data-backup
|
||||
spec:
|
||||
sourcePVC: qbittorrent-config-data
|
||||
trigger:
|
||||
schedule: 0 4 * * *
|
||||
restic:
|
||||
pruneIntervalDays: 7
|
||||
repository: qbittorrent-config-data-backup-secret-external
|
||||
retain:
|
||||
daily: 3
|
||||
hourly: 1
|
||||
monthly: 2
|
||||
weekly: 2
|
||||
yearly: 4
|
||||
moverSecurityContext:
|
||||
fsGroup: 1000
|
||||
fsGroupChangePolicy: OnRootMismatch
|
||||
runAsGroup: 1000
|
||||
runAsUser: 1000
|
||||
copyMethod: Snapshot
|
||||
storageClassName: ceph-block
|
||||
volumeSnapshotClassName: ceph-blockpool-snapshot
|
||||
cacheCapacity: 1Gi
|
||||
@@ -0,0 +1,34 @@
|
||||
apiVersion: volsync.backube/v1alpha1
|
||||
kind: ReplicationSource
|
||||
metadata:
|
||||
name: qbittorrent-config-data-backup-source-local
|
||||
namespace: qbittorrent
|
||||
labels:
|
||||
helm.sh/chart: volsync-target-config-0.5.0
|
||||
app.kubernetes.io/instance: qbittorrent
|
||||
app.kubernetes.io/part-of: qbittorrent
|
||||
app.kubernetes.io/version: "0.5.0"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: qbittorrent-config-data-backup
|
||||
spec:
|
||||
sourcePVC: qbittorrent-config-data
|
||||
trigger:
|
||||
schedule: 0 2 * * *
|
||||
restic:
|
||||
pruneIntervalDays: 7
|
||||
repository: qbittorrent-config-data-backup-secret-local
|
||||
retain:
|
||||
daily: 3
|
||||
hourly: 1
|
||||
monthly: 2
|
||||
weekly: 2
|
||||
yearly: 4
|
||||
moverSecurityContext:
|
||||
fsGroup: 1000
|
||||
fsGroupChangePolicy: OnRootMismatch
|
||||
runAsGroup: 1000
|
||||
runAsUser: 1000
|
||||
copyMethod: Snapshot
|
||||
storageClassName: ceph-block
|
||||
volumeSnapshotClassName: ceph-blockpool-snapshot
|
||||
cacheCapacity: 1Gi
|
||||
@@ -0,0 +1,34 @@
|
||||
apiVersion: volsync.backube/v1alpha1
|
||||
kind: ReplicationSource
|
||||
metadata:
|
||||
name: qbittorrent-config-data-backup-source-remote
|
||||
namespace: qbittorrent
|
||||
labels:
|
||||
helm.sh/chart: volsync-target-config-0.5.0
|
||||
app.kubernetes.io/instance: qbittorrent
|
||||
app.kubernetes.io/part-of: qbittorrent
|
||||
app.kubernetes.io/version: "0.5.0"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: qbittorrent-config-data-backup
|
||||
spec:
|
||||
sourcePVC: qbittorrent-config-data
|
||||
trigger:
|
||||
schedule: 0 3 * * *
|
||||
restic:
|
||||
pruneIntervalDays: 7
|
||||
repository: qbittorrent-config-data-backup-secret-remote
|
||||
retain:
|
||||
daily: 3
|
||||
hourly: 1
|
||||
monthly: 2
|
||||
weekly: 2
|
||||
yearly: 4
|
||||
moverSecurityContext:
|
||||
fsGroup: 1000
|
||||
fsGroupChangePolicy: OnRootMismatch
|
||||
runAsGroup: 1000
|
||||
runAsUser: 1000
|
||||
copyMethod: Snapshot
|
||||
storageClassName: ceph-block
|
||||
volumeSnapshotClassName: ceph-blockpool-snapshot
|
||||
cacheCapacity: 1Gi
|
||||
Reference in New Issue
Block a user