summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
diff options
context:
space:
mode:
authorJoey Hess2014-05-20 13:37:03 -0400
committerJoey Hess2014-05-20 13:37:03 -0400
commit7eeb58dab91eeb73d9491a89313bb28aa00ee833 (patch)
treec8587589131bd36f28da543b7641932cc42d37fb /src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
parent5ace43fb4ad8b01bbff011ee307667d52ae71eba (diff)
fix ssh authorizied_keys
Diffstat (limited to 'src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs')
-rw-r--r--src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
index 9754d4f7..ddb61381 100644
--- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
+++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
@@ -72,9 +72,15 @@ cabalDeps = flagFile go cabalupdated
go = userScriptProperty builduser ["cabal update && cabal install git-annex --only-dependencies || true"]
cabalupdated = homedir </> ".cabal" </> "packages" </> "hackage.haskell.org" </> "00-index.cache"
--- Ensure a ssh key is set up.
+-- Ensure a ssh key is set up, and allow it to be used to ssh in
sshKeyGen :: Property
-sshKeyGen = flagFile gen f
+sshKeyGen = combineProperties "sshkeygen"
+ [ flagFile gen privkey
+ , flagFile auth authkeys
+ ]
where
gen = userScriptProperty builduser ["ssh-keygen -t RSA -N '' -f " ++ f]
- f = homedir </> ".ssh" </> "id_rsa"
+ auth = userScriptProperty builduser ["cp " ++ pubkey ++ " " ++ authkeys]
+ privkey = homedir </> ".ssh" </> "id_rsa"
+ pubkey = privkey ++ ".pub"
+ authkeys = homedir </> ".ssh" </> "authorized_keys"