diff options
| author | Joey Hess <joey@kitenet.net> | 2014-11-15 13:46:53 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-11-15 13:46:53 -0400 |
| commit | beb905be9231a903afd2e2228e89e7e047384ea7 (patch) | |
| tree | 543373fadb06aba5211f678695f8ab2b743f4c60 /src | |
| parent | 90a982fcb35e35fa2344003202b40192dc13fab4 (diff) | |
| parent | 269996e25d8f5481024f472a57debfd51dfcc703 (diff) | |
Merge branch 'joeyconfig'
Conflicts:
privdata.joey/keyring.gpg
privdata.joey/privdata.gpg
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/PrivData/Paths.hs | 2 | ||||
| -rw-r--r-- | src/Propellor/Property/Obnam.hs | 18 | ||||
| -rw-r--r-- | src/Propellor/Property/SiteSpecific/JoeySites.hs | 5 |
3 files changed, 17 insertions, 8 deletions
diff --git a/src/Propellor/PrivData/Paths.hs b/src/Propellor/PrivData/Paths.hs index 7c29f1bf..1922a31e 100644 --- a/src/Propellor/PrivData/Paths.hs +++ b/src/Propellor/PrivData/Paths.hs @@ -3,7 +3,7 @@ module Propellor.PrivData.Paths where import System.FilePath privDataDir :: FilePath -privDataDir = "privdata" +privDataDir = "privdata.joey" privDataFile :: FilePath privDataFile = privDataDir </> "privdata.gpg" diff --git a/src/Propellor/Property/Obnam.hs b/src/Propellor/Property/Obnam.hs index 1e7c2c25..e18ca3f9 100644 --- a/src/Propellor/Property/Obnam.hs +++ b/src/Propellor/Property/Obnam.hs @@ -3,6 +3,7 @@ module Propellor.Property.Obnam where import Propellor import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Cron as Cron +import qualified Propellor.Property.Gpg as Gpg import Utility.SafeCommand import Data.List @@ -31,15 +32,24 @@ data NumClients = OnlyClient | MultipleClients -- -- > & Obnam.backup "/srv/git" "33 3 * * *" -- > [ "--repository=sftp://2318@usw-s002.rsync.net/~/mygitrepos.obnam" --- > , "--encrypt-with=1B169BE1" -- > ] Obnam.OnlyClient --- > `requires` Gpg.keyImported "1B169BE1" "root" -- > `requires` Ssh.keyImported SshRsa "root" (Context hostname) -- -- How awesome is that? backup :: FilePath -> Cron.CronTimes -> [ObnamParam] -> NumClients -> Property -backup dir crontimes params numclients = backup' dir crontimes params numclients - `requires` restored dir params +backup dir crontimes params numclients = + backup' dir crontimes params numclients + `requires` restored dir params + +-- | Like backup, but the specified gpg key id is used to encrypt +-- the repository. +-- +-- The gpg secret key will be automatically imported +-- into root's keyring using Propellor.Property.Gpg.keyImported +backupEncrypted :: FilePath -> Cron.CronTimes -> [ObnamParam] -> NumClients -> Gpg.GpgKeyId -> Property +backupEncrypted dir crontimes params numclients keyid = + backup dir crontimes (("--encrypt-with=" ++ keyid):params) numclients + `requires` Gpg.keyImported keyid "root" -- | Does a backup, but does not automatically restore. backup' :: FilePath -> Cron.CronTimes -> [ObnamParam] -> NumClients -> Property diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index bd9e01e2..7b8216fb 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -142,12 +142,11 @@ obnamLowMem = combineProperties "obnam tuned for low memory use" gitServer :: [Host] -> Property gitServer hosts = propertyList "git.kitenet.net setup" [ Obnam.latestVersion - , Obnam.backup "/srv/git" "33 3 * * *" + , Obnam.backupEncrypted "/srv/git" "33 3 * * *" [ "--repository=sftp://2318@usw-s002.rsync.net/~/git.kitenet.net" , "--encrypt-with=1B169BE1" , "--client-name=wren" -- historical - ] Obnam.OnlyClient - `requires` Gpg.keyImported "1B169BE1" "root" + ] Obnam.OnlyClient "1B169BE1" `requires` Ssh.keyImported SshRsa "root" (Context "git.kitenet.net") `requires` Ssh.knownHost hosts "usw-s002.rsync.net" "root" `requires` Ssh.authorizedKeys "family" (Context "git.kitenet.net") |
