Compare commits
35
Commits
1c01516b95
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
167e3795f5 | ||
|
|
df03cd85f0 | ||
|
|
6aae17706b | ||
|
|
418badf14c | ||
|
|
a194812377 | ||
|
|
99328a29f6 | ||
|
|
7b619b7355 | ||
|
|
60a8bd0d00 | ||
|
|
be1a4a6588 | ||
|
|
340faf3f1b | ||
|
|
1abefc0e28 | ||
|
|
7617cc89fb | ||
|
|
2ea001148f | ||
|
|
80fa5859a5 | ||
|
|
65e448218c | ||
|
|
09c09794f4 | ||
|
|
cff45d361a | ||
|
|
57b82e55db | ||
|
|
6434494fe3 | ||
|
|
86caf7e734 | ||
|
|
28513528f2 | ||
|
|
0d5b703fbf | ||
|
|
206417c024 | ||
|
|
0109b3cd6f | ||
|
|
cb6ac10932 | ||
|
|
0bcf765c4c | ||
|
|
c5bf712f35 | ||
|
|
f8c5043c3e | ||
|
|
0b41dcf8b4 | ||
|
|
927434fa7f | ||
|
|
5a16e2eb0d | ||
|
|
236dc62bc9 | ||
|
|
d663cdb266 | ||
|
|
6f768ffedc | ||
|
|
cd9166744a |
@@ -0,0 +1,43 @@
|
|||||||
|
name: Gitea Actions Demo
|
||||||
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "*"
|
||||||
|
paths:
|
||||||
|
- 'dockerfile'
|
||||||
|
tags-ignore:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Explore-Gitea-Actions:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||||
|
- name: List files in the repository
|
||||||
|
run: |
|
||||||
|
ls ${{ gitea.workspace }}
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to gitea
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: gitea.tryton.geeraert.eu
|
||||||
|
username: ${{ secrets.USERNAME_GITEA }}
|
||||||
|
password: ${{ secrets.PASSWORD_GITEA }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: "{{defaultContext}}:bitwarden"
|
||||||
|
push: true
|
||||||
|
tags: gitea.tryton.geeraert.eu/pi-ux-ce/bitwarden_cli:latest
|
||||||
|
cache-from: type=registry,ref=gitea.tryton.geeraert.eu/pi-ux-ce/bitwarden_cli:buildcache
|
||||||
|
cache-to: type=registry,ref=gitea.tryton.geeraert.eu/pi-ux-ce/bitwarden_cli:buildcache,mode=max
|
||||||
|
|
||||||
|
|
||||||
|
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
name: Gitea Actions Demo
|
||||||
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Explore-Gitea-Actions:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||||
|
- name: List files in the repository
|
||||||
|
run: |
|
||||||
|
ls ${{ gitea.workspace }}
|
||||||
|
|
||||||
|
- name: Perform kubectl tasks for Bitwarden
|
||||||
|
uses: actions-hub/kubectl@master
|
||||||
|
env:
|
||||||
|
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
|
||||||
|
with:
|
||||||
|
args: apply -f bitwarden
|
||||||
|
- name: Perform kubectl tasks for Gitea
|
||||||
|
uses: actions-hub/kubectl@master
|
||||||
|
env:
|
||||||
|
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
|
||||||
|
with:
|
||||||
|
args: apply -f Gitea
|
||||||
|
- name: Perform kubectl tasks for Nextcloud
|
||||||
|
uses: actions-hub/kubectl@master
|
||||||
|
env:
|
||||||
|
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
|
||||||
|
with:
|
||||||
|
args: apply -f Nextcloud
|
||||||
|
- name: Perform kubectl tasks for Paperless
|
||||||
|
uses: actions-hub/kubectl@master
|
||||||
|
env:
|
||||||
|
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
|
||||||
|
with:
|
||||||
|
args: apply -f Paperless
|
||||||
|
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: backup-service-account
|
||||||
|
namespace: gitea
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: role:service-acc
|
||||||
|
namespace: gitea
|
||||||
|
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources:
|
||||||
|
- pods
|
||||||
|
- pods/exec
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- list
|
||||||
|
- apiGroups: ["apps"]
|
||||||
|
resources:
|
||||||
|
- deployments
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: rolebinding:service-acc
|
||||||
|
namespace: gitea
|
||||||
|
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: role:service-acc
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: backup-service-account
|
||||||
|
namespace: gitea
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: gitea-documents-backup
|
||||||
|
namespace: gitea
|
||||||
|
spec:
|
||||||
|
schedule: "0 0 * * *"
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 100
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: "backup-service-account"
|
||||||
|
containers:
|
||||||
|
- name: export-attachements
|
||||||
|
command:
|
||||||
|
- "/bin/sh"
|
||||||
|
- "-c"
|
||||||
|
args: ['
|
||||||
|
echo "start the export";
|
||||||
|
kubectl exec -it deploy/gitea-webserver -- su -c "/app/gitea/gitea dump -c /data/gitea/conf/app.ini -f /backup/backup_$(date "+%Y-%m-%d_%Hh-%m").zip" git
|
||||||
|
echo "Export done"
|
||||||
|
']
|
||||||
|
image: "bitnami/kubectl:latest"
|
||||||
|
restartPolicy: Never
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: gitea-documents-backup
|
||||||
|
namespace: gitea
|
||||||
|
annotations:
|
||||||
|
fileType: Backup
|
||||||
|
spec:
|
||||||
|
storageClassName: nfs-storage-fastaccess
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
name: nfs-provisioner-backup
|
name: backup
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: rsync-glacier-job
|
||||||
|
namespace: backup
|
||||||
|
spec:
|
||||||
|
backoffLimit: 6
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- command:
|
||||||
|
- /bin/sh
|
||||||
|
- /config/rsync.sh
|
||||||
|
image: alpine
|
||||||
|
imagePullPolicy: Always
|
||||||
|
name: rsync-glacier
|
||||||
|
volumeMounts:
|
||||||
|
- name: glacier-backup
|
||||||
|
mountPath: /destination
|
||||||
|
- name: ssd
|
||||||
|
mountPath: /source
|
||||||
|
- mountPath: /config
|
||||||
|
name: scripts
|
||||||
|
restartPolicy: Never
|
||||||
|
terminationGracePeriodSeconds: 30
|
||||||
|
volumes:
|
||||||
|
- name: ssd
|
||||||
|
hostPath:
|
||||||
|
path: /ssd/
|
||||||
|
type: Directory
|
||||||
|
- name: glacier-backup
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: openmediavault-backup
|
||||||
|
- configMap:
|
||||||
|
defaultMode: 365
|
||||||
|
name: rsync-scripts
|
||||||
|
name: scripts
|
||||||
|
ttlSecondsAfterFinished: 100
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: synology-backup
|
||||||
|
namespace: backup
|
||||||
|
annotations:
|
||||||
|
fileType: Backup
|
||||||
|
spec:
|
||||||
|
storageClassName: nfs-storage-infrequentaccess
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 20Gi
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: openmediavault-backup
|
||||||
|
namespace: backup
|
||||||
|
annotations:
|
||||||
|
fileType: Backup
|
||||||
|
spec:
|
||||||
|
storageClassName: nfs-storage-glacier
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 20Gi
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
rsync.sh: |
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#sleep 3600
|
||||||
|
apk update
|
||||||
|
apk add rsync
|
||||||
|
chown -R pi-ux-ce:pi-ux-ce /source/Backup
|
||||||
|
chown -R pi-ux-ce:pi-ux-ce /source/Image
|
||||||
|
rsync -avvt /source/Backup /destination
|
||||||
|
rsync -avvt /source/Image /destination
|
||||||
|
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
name: rsync-scripts
|
||||||
|
namespace: backup
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: rsync-synology-job
|
||||||
|
namespace: backup
|
||||||
|
spec:
|
||||||
|
backoffLimit: 6
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- command:
|
||||||
|
- /bin/sh
|
||||||
|
- /config/rsync.sh
|
||||||
|
image: alpine
|
||||||
|
imagePullPolicy: Always
|
||||||
|
name: rsync-synology
|
||||||
|
volumeMounts:
|
||||||
|
- name: synology-backup
|
||||||
|
mountPath: /destination
|
||||||
|
- name: ssd
|
||||||
|
mountPath: /source
|
||||||
|
- mountPath: /config
|
||||||
|
name: scripts
|
||||||
|
restartPolicy: Never
|
||||||
|
terminationGracePeriodSeconds: 30
|
||||||
|
volumes:
|
||||||
|
- name: ssd
|
||||||
|
hostPath:
|
||||||
|
path: /ssd/
|
||||||
|
type: Directory
|
||||||
|
- name: synology-backup
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: synology-backup
|
||||||
|
- configMap:
|
||||||
|
defaultMode: 365
|
||||||
|
name: rsync-scripts
|
||||||
|
name: scripts
|
||||||
|
ttlSecondsAfterFinished: 100
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
data:
|
|
||||||
export_calendar.sh: |
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
apk update
|
|
||||||
apk add curl
|
|
||||||
list='capgemini birmingham cesi papa blueberry personal-1 prometheus birthday maman capgemini_ca-gip shared_shared_by_calendar_sync'
|
|
||||||
for element in $list;do
|
|
||||||
curl -u $PI_USER_USERNAME:$PI_USER_PASSWORD https://nextcloud.tryton.geeraert.eu/remote.php/dav/calendars/pi/$element/\?export -o /backup/calendar_$element.ics
|
|
||||||
done
|
|
||||||
#curl -u $PI_USER_USERNAME:$PI_USER_PASSWORD https://nextcloud.tryton.geeraert.eu/remote.php/dav/calendars/pi/capgemini_ca-gip/\?export -o /backup/calendar.ics
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: nextcloud-calendar-export-script
|
|
||||||
@@ -21,19 +21,24 @@ spec:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: nextcloud-credentials
|
name: nextcloud-credentials
|
||||||
key: PI_USER_PASSWORD
|
key: PI_USER_PASSWORD
|
||||||
command: ["/bin/sh","/config/export_calendar.sh"]
|
command: ["/bin/sh","/config/export_notes.sh"]
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: calendar
|
- name: nextcloud-webserver
|
||||||
|
mountPath: /var/www/html
|
||||||
|
- name: notes
|
||||||
mountPath: /backup
|
mountPath: /backup
|
||||||
- name: scripts
|
- name: scripts
|
||||||
mountPath: /config
|
mountPath: /config
|
||||||
volumes:
|
volumes:
|
||||||
- name: calendar
|
- name: notes
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: calendar
|
claimName: notes
|
||||||
|
- name: nextcloud-webserver
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: nextcloud-webserver
|
||||||
- name: scripts
|
- name: scripts
|
||||||
configMap:
|
configMap:
|
||||||
name: nextcloud-calendar-export-script
|
name: nextcloud-export-scripts
|
||||||
defaultMode: 0555
|
defaultMode: 0555
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
backoffLimit: 4
|
backoffLimit: 4
|
||||||
@@ -41,7 +46,7 @@ spec:
|
|||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: calendar
|
name: notes
|
||||||
namespace: nextcloud
|
namespace: nextcloud
|
||||||
spec:
|
spec:
|
||||||
storageClassName: nfs-backup-storage-intelligent
|
storageClassName: nfs-backup-storage-intelligent
|
||||||
|
|||||||
@@ -31,9 +31,12 @@ spec:
|
|||||||
- name: scripts
|
- name: scripts
|
||||||
mountPath: /config
|
mountPath: /config
|
||||||
volumes:
|
volumes:
|
||||||
|
# - name: calendar
|
||||||
|
# persistentVolumeClaim:
|
||||||
|
# claimName: calendar
|
||||||
- name: calendar
|
- name: calendar
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: calendar
|
claimName: nextcloud-calendar-backup
|
||||||
- name: scripts
|
- name: scripts
|
||||||
configMap:
|
configMap:
|
||||||
name: nextcloud-export-scripts
|
name: nextcloud-export-scripts
|
||||||
@@ -53,3 +56,18 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 2Gi
|
storage: 2Gi
|
||||||
|
---
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: nextcloud-calendar-backup
|
||||||
|
namespace: nextcloud
|
||||||
|
annotations:
|
||||||
|
fileType: Backup
|
||||||
|
spec:
|
||||||
|
storageClassName: nfs-storage-fastaccess
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
|
|||||||
@@ -31,9 +31,12 @@ spec:
|
|||||||
- name: scripts
|
- name: scripts
|
||||||
mountPath: /config
|
mountPath: /config
|
||||||
volumes:
|
volumes:
|
||||||
|
# - name: contact
|
||||||
|
# persistentVolumeClaim:
|
||||||
|
# claimName: contact
|
||||||
- name: contact
|
- name: contact
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: contact
|
claimName: nextcloud-contact-backup
|
||||||
- name: scripts
|
- name: scripts
|
||||||
configMap:
|
configMap:
|
||||||
name: nextcloud-export-scripts
|
name: nextcloud-export-scripts
|
||||||
@@ -53,3 +56,18 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 2Gi
|
storage: 2Gi
|
||||||
|
---
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: nextcloud-contact-backup
|
||||||
|
namespace: nextcloud
|
||||||
|
annotations:
|
||||||
|
fileType: Backup
|
||||||
|
spec:
|
||||||
|
storageClassName: nfs-storage-fastaccess
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
apiVersion: batch/v1
|
|
||||||
kind: CronJob
|
|
||||||
metadata:
|
|
||||||
name: nextcloud-contact-backup
|
|
||||||
namespace: nextcloud
|
|
||||||
spec:
|
|
||||||
schedule: "0 0 * * *"
|
|
||||||
jobTemplate:
|
|
||||||
spec:
|
|
||||||
ttlSecondsAfterFinished: 100
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: contact-backup
|
|
||||||
image: alpine/curl
|
|
||||||
env:
|
|
||||||
- name: PI_USER_USERNAME
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: nextcloud-credentials
|
|
||||||
key: PI_USER_USERNAME
|
|
||||||
- name: PI_USER_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: nextcloud-credentials
|
|
||||||
key: PI_USER_PASSWORD
|
|
||||||
args:
|
|
||||||
- -u
|
|
||||||
- $(PI_USER_USERNAME):$(PI_USER_PASSWORD)
|
|
||||||
- https://nextcloud.tryton.geeraert.eu/remote.php/dav/addressbooks/users/pi/contacts/?export
|
|
||||||
- -o
|
|
||||||
- /backup/contact.vcf
|
|
||||||
volumeMounts:
|
|
||||||
- name: contact
|
|
||||||
mountPath: /backup
|
|
||||||
volumes:
|
|
||||||
- name: contact
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: contact
|
|
||||||
restartPolicy: Never
|
|
||||||
---
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
apiVersion: v1
|
|
||||||
metadata:
|
|
||||||
name: contact
|
|
||||||
namespace: nextcloud
|
|
||||||
spec:
|
|
||||||
storageClassName: nfs-backup-storage-intelligent
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteMany
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 2Gi
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: nextcloud-notes-backup
|
||||||
|
namespace: nextcloud
|
||||||
|
spec:
|
||||||
|
schedule: "0 0 * * *"
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 100
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: notes-backup
|
||||||
|
image: alpine
|
||||||
|
env:
|
||||||
|
- name: PI_USER_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: nextcloud-credentials
|
||||||
|
key: PI_USER_USERNAME
|
||||||
|
- name: PI_USER_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: nextcloud-credentials
|
||||||
|
key: PI_USER_PASSWORD
|
||||||
|
command: ["/bin/sh","/config/export_notes.sh"]
|
||||||
|
volumeMounts:
|
||||||
|
- name: notes
|
||||||
|
mountPath: /backup
|
||||||
|
- name: nextcloud-webserver
|
||||||
|
mountPath: /var/www/html
|
||||||
|
- name: scripts
|
||||||
|
mountPath: /config
|
||||||
|
volumes:
|
||||||
|
# - name: notes
|
||||||
|
# persistentVolumeClaim:
|
||||||
|
# claimName: notes
|
||||||
|
- name: notes
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: nextcloud-notes-backup
|
||||||
|
- name: nextcloud-webserver
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: nextcloud-webserver
|
||||||
|
- name: scripts
|
||||||
|
configMap:
|
||||||
|
name: nextcloud-export-scripts
|
||||||
|
defaultMode: 0555
|
||||||
|
restartPolicy: Never
|
||||||
|
---
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: notes
|
||||||
|
namespace: nextcloud
|
||||||
|
spec:
|
||||||
|
storageClassName: nfs-backup-storage-intelligent
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
|
---
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: nextcloud-notes-backup
|
||||||
|
namespace: nextcloud
|
||||||
|
annotations:
|
||||||
|
fileType: Backup
|
||||||
|
spec:
|
||||||
|
storageClassName: nfs-storage-fastaccess
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
@@ -17,6 +17,13 @@ data:
|
|||||||
today_date=$(date "+%Y-%m-%d")
|
today_date=$(date "+%Y-%m-%d")
|
||||||
mkdir /backup/$today_date
|
mkdir /backup/$today_date
|
||||||
curl -u $PI_USER_USERNAME:$PI_USER_PASSWORD https://nextcloud.tryton.geeraert.eu/remote.php/dav/addressbooks/users/pi/contacts/?export -o /backup/$today_date/contact_$today_date.vcf
|
curl -u $PI_USER_USERNAME:$PI_USER_PASSWORD https://nextcloud.tryton.geeraert.eu/remote.php/dav/addressbooks/users/pi/contacts/?export -o /backup/$today_date/contact_$today_date.vcf
|
||||||
|
export_notes.sh: |
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
today_date=$(date "+%Y-%m-%d")
|
||||||
|
mkdir /backup/$today_date
|
||||||
|
cp /var/www/html/data/pi/files/Notes/*.md /backup/$today_date/
|
||||||
|
# curl -u $PI_USER_USERNAME:$PI_USER_PASSWORD https://nextcloud.tryton.geeraert.eu/remote.php/dav/addressbooks/users/pi/contacts/?export -o /backup/$today_date/contact_$today_date.vcf
|
||||||
|
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
|
|||||||
@@ -83,9 +83,12 @@ spec:
|
|||||||
- name: paperless-export
|
- name: paperless-export
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: paperless-export
|
claimName: paperless-export
|
||||||
|
# - name: documents
|
||||||
|
# persistentVolumeClaim:
|
||||||
|
# claimName: documents
|
||||||
- name: documents
|
- name: documents
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: documents
|
claimName: paperless-documents-backup
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -101,3 +104,18 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 10Gi
|
storage: 10Gi
|
||||||
|
---
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: paperless-documents-backup
|
||||||
|
namespace: paperless
|
||||||
|
annotations:
|
||||||
|
fileType: Backup
|
||||||
|
spec:
|
||||||
|
storageClassName: nfs-storage-fastaccess
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: bwbackup
|
||||||
|
---
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: bitwarden-backup
|
||||||
|
namespace: bwbackup
|
||||||
|
spec:
|
||||||
|
schedule: "0 0 * * *"
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 100
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: bitwarden-backup
|
||||||
|
image: gitea.tryton.geeraert.eu/pi-ux-ce/bitwarden_cli:1.0.1
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- "-c"
|
||||||
|
- "/config/export_bitwarden.sh"
|
||||||
|
env:
|
||||||
|
- name: BW_CLIENTID
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: bitwarden-credentials
|
||||||
|
key: BW_CLIENTID
|
||||||
|
- name: BW_CLIENTSECRET
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: bitwarden-credentials
|
||||||
|
key: BW_CLIENTSECRET
|
||||||
|
- name: BW_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: bitwarden-credentials
|
||||||
|
key: BW_PASSWORD
|
||||||
|
volumeMounts:
|
||||||
|
- name: scripts
|
||||||
|
mountPath: /config
|
||||||
|
- name: bitwarden-vault-backup
|
||||||
|
mountPath: /backup
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- name: scripts
|
||||||
|
configMap:
|
||||||
|
name: bitwarden-export-scripts
|
||||||
|
defaultMode: 0555
|
||||||
|
- name: bitwarden-vault-backup
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: bitwarden-vault-backup
|
||||||
|
restartPolicy: Never
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: bitwarden-vault-backup
|
||||||
|
namespace: bwbackup
|
||||||
|
annotations:
|
||||||
|
fileType: Backup
|
||||||
|
spec:
|
||||||
|
storageClassName: nfs-storage-fastaccess
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
FROM debian
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
|
||||||
|
RUN apt -y update
|
||||||
|
RUN apt -y install npm
|
||||||
|
RUN npm -y install -g @bitwarden/cli
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
BW_CLIENTID: dXNlci43MGVmNGYxNi1kM2MwLTRmYWItYWI3OC1hZjg5MDEwNmE2ZDk=
|
||||||
|
BW_CLIENTSECRET: UlJZVGd3R0pUSjlHVDQwc3dZTklobzlrNUVYYTJv
|
||||||
|
BW_PASSWORD: V2luc3RvbkNodXJjaGlsbGlzMTAwJWhhbmRzb21l
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
name: bitwarden-credentials
|
||||||
|
namespace: bwbackup
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
BW_CLIENTID: dXNlci43MGVmNGYxNi1kM2MwLTRmYWItYWI3OC1hZjg5MDEwNmE2ZDk=
|
||||||
|
BW_CLIENTSECRET: UlJZVGd3R0pUSjlHVDQwc3dZTklobzlrNUVYYTJv
|
||||||
|
BW_PASSWORD: V2luc3RvbkNodXJjaGlsbGlzMTAwJWhhbmRzb21l
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2024-10-29T14:50:23Z"
|
||||||
|
name: bitwarden-credentials
|
||||||
|
namespace: bwbackup
|
||||||
|
resourceVersion: "59808090"
|
||||||
|
uid: 7b213bf5-9143-4d4d-9987-07ec41e2caf2
|
||||||
|
type: Opaque
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
export_bitwarden.sh: |
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
bw config server https://bitwarden.tryton.geeraert.eu/
|
||||||
|
bw login --apikey
|
||||||
|
export BW_key=$(bw unlock $BW_PASSWORD --raw)
|
||||||
|
bw list items --session $BW_key >> /backup/backup_$(date "+%Y-%m-%d_%Hh-%m").json
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
name: bitwarden-export-scripts
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
namespace: nfs-provisioner-backup
|
|
||||||
bases:
|
|
||||||
- github.com/kubernetes-sigs/nfs-subdir-external-provisioner//deploy
|
|
||||||
resources:
|
|
||||||
- namespace.yaml
|
|
||||||
patchesStrategicMerge:
|
|
||||||
- patch_nfs_details.yaml
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
apiVersion: storage.k8s.io/v1
|
|
||||||
kind: StorageClass
|
|
||||||
metadata:
|
|
||||||
name: nfs-backup-storage-intelligent
|
|
||||||
parameters:
|
|
||||||
pathPattern: "Backup/${.PVC.namespace}/${.PVC.name}"
|
|
||||||
archiveOnDelete: "false"
|
|
||||||
provisioner: k8s-sigs.io/nfs-subdir-external-provisioner
|
|
||||||
reclaimPolicy: Delete
|
|
||||||
volumeBindingMode: Immediate
|
|
||||||
Submodule nfs-subdir-external-provisioner/nfs-subdir-external-provisioner deleted from 59a3ca2cd1
@@ -1,22 +0,0 @@
|
|||||||
# patch_nfs_details.yaml
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: nfs-client-provisioner
|
|
||||||
name: nfs-client-provisioner
|
|
||||||
spec:
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: nfs-client-provisioner
|
|
||||||
env:
|
|
||||||
- name: NFS_SERVER
|
|
||||||
value: 192.168.88.50
|
|
||||||
- name: NFS_PATH
|
|
||||||
value: /data/kubernetes/
|
|
||||||
volumes:
|
|
||||||
- name: nfs-client-root
|
|
||||||
nfs:
|
|
||||||
server: 192.168.88.50
|
|
||||||
path: /data/kubernetes/
|
|
||||||
Reference in New Issue
Block a user