Compare commits
22
Commits
206417c024
..
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 |
@@ -1,6 +1,13 @@
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on: [push]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
paths:
|
||||
- 'dockerfile'
|
||||
tags-ignore:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
Explore-Gitea-Actions:
|
||||
@@ -29,5 +36,8 @@ jobs:
|
||||
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,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
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
|
||||
@@ -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
|
||||
@@ -2,18 +2,7 @@ FROM debian
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
#COPY requirements.txt ./
|
||||
#RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
RUN apt -y update
|
||||
RUN apt -y install npm
|
||||
RUN npm -y install -g @bitwarden/cli
|
||||
#RUN bw config server https://bitwarden.tryton.geeraert.eu/
|
||||
#RUN export BW_key=$(bw login valvankart@orange.fr Impreza555 --raw)
|
||||
|
||||
#COPY . .
|
||||
|
||||
#RUN echo "nameserver 8.8.8.8" >> /etc/resolv.conf
|
||||
#CMD [ "python", "./nextcloud_ics_sync.py",">>","/var/log/nextcloud-ics-sync.log"]
|
||||
#CMD [ "sleep","3600" ]
|
||||
#CMD echo "==================================================================================" >> /var/log/nextcloud-ics-sync.log 2>&1 ; echo $(date) >> /var/log/nextcloud-ics-sync.log 2>&1 ; python ./nextcloud_ics_sync.py >> /var/log/nextcloud-ics-sync.log 2>&1 ; echo "==================================================================================" >> /var/log/nextcloud-ics-sync.log 2>&1
|
||||
|
||||
@@ -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
|
||||
@@ -3,10 +3,9 @@ data:
|
||||
export_bitwarden.sh: |
|
||||
#!/usr/bin/env bash
|
||||
bw config server https://bitwarden.tryton.geeraert.eu/
|
||||
echo $BITWARDEN_USERNAME
|
||||
echo $BITWARDEN_PASSWORD
|
||||
# export BW_key=$(bw login valvankart@orange.fr Impreza555 --raw)
|
||||
# bw list items --session $BW_key >> /backup/backup_$(date "+%Y-%m-%d_%Hh-%m").json
|
||||
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
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
FROM debian
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
#COPY requirements.txt ./
|
||||
#RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
RUN apt -y update
|
||||
RUN apt -y update && apt install -y curl unzip libsecret-1-0 jq
|
||||
|
||||
RUN export VER=$(curl -H "Accept: application/vnd.github+json" https://api.github.com/repos/bitwarden/clients/releases | jq -r .[4].name | sed 's:.*v::') && \
|
||||
curl -LO "https://github.com/bitwarden/clients/releases/download/cli-v{$VER}/bw-linux-{$VER}.zip" \
|
||||
&& unzip bw-linux-*.zip && chmod +x ./bw
|
||||
|
||||
RUN rm bw-linux-*.zip
|
||||
|
||||
RUN mv /bw /usr/local/bin
|
||||
|
||||
RUN bw --version
|
||||
|
||||
#COPY . .
|
||||
|
||||
#RUN echo "nameserver 8.8.8.8" >> /etc/resolv.conf
|
||||
#CMD [ "python", "./nextcloud_ics_sync.py",">>","/var/log/nextcloud-ics-sync.log"]
|
||||
CMD [ "sleep","3600" ]
|
||||
#CMD echo "==================================================================================" >> /var/log/nextcloud-ics-sync.log 2>&1 ; echo $(date) >> /var/log/nextcloud-ics-sync.log 2>&1 ; python ./nextcloud_ics_sync.py >> /var/log/nextcloud-ics-sync.log 2>&1 ; echo "==================================================================================" >> /var/log/nextcloud-ics-sync.log 2>&1
|
||||
@@ -1,62 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: bwbackup
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: debian
|
||||
namespace: bwbackup
|
||||
spec:
|
||||
containers:
|
||||
- image: gitea.tryton.geeraert.eu/pi-ux-ce/bitwarden_cli:1.0.1
|
||||
command:
|
||||
- /bin/sh
|
||||
- "-c"
|
||||
- "/config/export_bitwarden.sh"
|
||||
env:
|
||||
- name: BITWARDEN_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: bitwarden-credentials
|
||||
key: BITWARDEN_USERNAME
|
||||
- name: BITWARDEN_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: bitwarden-credentials
|
||||
key: BITWARDEN_PASSWORD
|
||||
volumeMounts:
|
||||
- name: scripts
|
||||
mountPath: /config
|
||||
- name: bitwarden-vault-backup
|
||||
mountPath: /backup
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: debian
|
||||
restartPolicy: Always
|
||||
volumes:
|
||||
- name: scripts
|
||||
configMap:
|
||||
name: bitwarden-export-scripts
|
||||
defaultMode: 0555
|
||||
- name: bitwarden-vault-backup
|
||||
persistentVolumeClaim:
|
||||
claimName: bitwarden-vault-backup
|
||||
|
||||
|
||||
---
|
||||
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
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
FROM vaultwarden/server:latest
|
||||
|
||||
RUN apt update && apt install -y curl unzip libsecret-1-0 jq
|
||||
|
||||
RUN export VER=$(curl -H "Accept: application/vnd.github+json" https://api.github.com/repos/bitwarden/clients/releases | jq -r .[4].name | sed 's:.*v::') && \
|
||||
curl -LO "https://github.com/bitwarden/clients/releases/download/cli-v{$VER}/bw-linux-{$VER}.zip" \
|
||||
&& unzip bw-linux-*.zip && chmod +x ./bw
|
||||
|
||||
RUN rm bw-linux-*.zip
|
||||
|
||||
RUN mv /bw /usr/local/bin
|
||||
|
||||
RUN bw --version
|
||||
|
||||
|
||||
|
||||
https://www.reddit.com/r/Bitwarden/comments/xhir0q/how_to_install_bw_cli_in_docker/
|
||||
|
||||
|
||||
$sessionkey = bw login valvankart@orange.fr Impreza555 --raw
|
||||
/bin/sh: 37: =: not found
|
||||
# export BW_key=$(bw login valvankart@orange.fr Impreza555 --raw)
|
||||
# echo $BW_key
|
||||
Q8lQlXFuQKxxYz5UXr+JcU1oM7F53S6AkmTnPFEh5+I2khV1w77hBaDUGvsHcbdqH+tIUEE+r5FZboVNyHMgNg==
|
||||
# bw list items --session $BW_key
|
||||
@@ -1,57 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: bwbackup
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: node
|
||||
namespace: bwbackup
|
||||
spec:
|
||||
containers:
|
||||
- image: node:22-alpine
|
||||
command:
|
||||
# - "npm install -g @bitwarden/cli@1.0.1"
|
||||
- "/bin/sh"
|
||||
- "-c"
|
||||
- "sleep 60m"
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: alpine
|
||||
restartPolicy: Always
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: node
|
||||
namespace: bwbackup
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: node
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: node
|
||||
spec:
|
||||
hostNetwork: false
|
||||
containers:
|
||||
- name: node-d
|
||||
image: node:22-alpine
|
||||
imagePullPolicy: Always
|
||||
command:
|
||||
# - "npm install -g @bitwarden/cli@1.0.1"
|
||||
- "/bin/sh"
|
||||
- "-c"
|
||||
- "sleep 60m"
|
||||
securityContext:
|
||||
# sysctls:
|
||||
# - name: net.ipv4.conf.all.src_valid_mark
|
||||
# value: "1"
|
||||
# - name: net.ipv6.conf.all.disable_ipv6
|
||||
# value: "1"
|
||||
privileged: true
|
||||
capabilities:
|
||||
add: ["NET_ADMIN", "NET_RAW"]
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user