소스 검색

Add credentials dir

jherve 1 개월 전
부모
커밋
531713f1e1
3개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 0
      .gitignore
  2. 2 3
      data/borgmatic.d/config.yaml
  3. 2 0
      start.sh

+ 1 - 0
.gitignore

@@ -1,2 +1,3 @@
 data/source/*/
 data/.bash_history
+data/credentials/*

+ 2 - 3
data/borgmatic.d/config.yaml

@@ -1,13 +1,12 @@
 source_directories:
   - /mnt/source/
 repositories:
-    - path: ssh://u505981@u505981.your-storagebox.de:23/./borg-repo
+  - path: ssh://${STORAGE_BOX_USER}@${STORAGE_BOX_MAIN_USER}.your-storagebox.de:23/${STORAGE_BOX_REPO_PATH}
 
 one_file_system: true
 remote_path: borg-1.4
 
-#   Passphase is set in varibable $BORG_PASSPHRASE
-#   encryption_passphrase: "DoNotForgetToChangeYourPassphrase"
+encryption_passphrase: "{credential file /credentials/borg_passphrase}"
 compression: lz4
 archive_name_format: 'backup-{hostname}-{now}'
 

+ 2 - 0
start.sh

@@ -10,6 +10,7 @@ HOSTNAME=$(hostname)
 CONTAINER_NAME="borgmatic"
 HISTFILE=./data/.bash_history
 SOURCE_DIR=./data/source
+CREDENTIALS_DIR=./data/credentials
 
 touch ${HISTFILE}
 
@@ -25,6 +26,7 @@ podman run \
   $(to_volume /home/theenglishway/Documents/formations/5_jours/) \
   -v ./data/borgmatic.d:/etc/borgmatic.d/ \
   -v /home/theenglishway/.ssh:/root/.ssh \
+  -v ${CREDENTIALS_DIR}:/credentials:ro \
   -v ${HISTFILE}:/root/.bash_history \
   -v borg_config:/root/.config/borg \
   -v borg_cache:/root/.cache/borg \