2024-12-14 17:26:09 +00:00
|
|
|
#!/usr/bin/env bb
|
|
|
|
|
|
|
|
(require '[dda.backup.cred-rot :as cr])
|
|
|
|
|
|
|
|
(def restic-repo {:password-file "/restic-pwd"
|
2024-12-24 14:50:17 +00:00
|
|
|
:restic-repository "/restic-repo"
|
|
|
|
:debug true})
|
2024-12-14 17:26:09 +00:00
|
|
|
|
|
|
|
(def file-config (merge restic-repo {:backup-path "files"
|
|
|
|
:files ["/test-backup"]
|
|
|
|
:restore-target-directory "/test-restore"}))
|
|
|
|
|
|
|
|
(def cred-config (merge file-config
|
|
|
|
{:restic-repository "/restic-repo/files"
|
|
|
|
:new-password-config {:new-password-file "/new-pw"
|
2024-12-24 14:50:17 +00:00
|
|
|
:valid-from "2024-12-17 00:00:00"}}))
|
2024-12-14 17:26:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
(def dry-run {:dry-run true :debug true})
|
|
|
|
|
|
|
|
(defn prepare!
|
|
|
|
[]
|
|
|
|
(spit "/restic-pwd" "ThePassword")
|
|
|
|
(spit "/new-pw" "newPassword"))
|
|
|
|
|
|
|
|
|
|
|
|
(defn change-password!
|
|
|
|
[]
|
|
|
|
(println "change-password!")
|
|
|
|
(cr/change-password! cred-config))
|
|
|
|
|
|
|
|
|
|
|
|
(prepare!)
|
|
|
|
(change-password!)
|