fix use of mangled ssh hostname
However, this is not working for gcrypt repos with a mangled hostname. Problem is that the locked down key is installed before the repo is initialized, so git-annex-shell refuses to allow the gcrypt special remote to do its setup.
This commit is contained in:
parent
5f9f7024e9
commit
245d5590c9
1 changed files with 8 additions and 6 deletions
|
@ -335,21 +335,23 @@ prepSsh gcrypt sshdata a
|
||||||
| otherwise = prepSsh' gcrypt sshdata sshdata Nothing a
|
| otherwise = prepSsh' gcrypt sshdata sshdata Nothing a
|
||||||
|
|
||||||
prepSsh' :: Bool -> SshData -> SshData -> Maybe SshKeyPair -> (SshData -> Handler Html) -> Handler Html
|
prepSsh' :: Bool -> SshData -> SshData -> Maybe SshKeyPair -> (SshData -> Handler Html) -> Handler Html
|
||||||
prepSsh' gcrypt origsshdata sshdata keypair a =
|
prepSsh' gcrypt origsshdata sshdata keypair a = sshSetup
|
||||||
sshSetup ["-p", show (sshPort origsshdata), sshhost, remoteCommand] "" (a origsshdata)
|
[ "-p", show (sshPort origsshdata)
|
||||||
|
, genSshHost (sshHostName origsshdata) (sshUserName origsshdata)
|
||||||
|
, remoteCommand
|
||||||
|
] "" (a sshdata)
|
||||||
where
|
where
|
||||||
sshhost = genSshHost (sshHostName origsshdata) (sshUserName origsshdata)
|
|
||||||
remotedir = T.unpack $ sshDirectory sshdata
|
remotedir = T.unpack $ sshDirectory sshdata
|
||||||
remoteCommand = shellWrap $ intercalate "&&" $ catMaybes
|
remoteCommand = shellWrap $ intercalate "&&" $ catMaybes
|
||||||
[ Just $ "mkdir -p " ++ shellEscape remotedir
|
[ Just $ "mkdir -p " ++ shellEscape remotedir
|
||||||
, Just $ "cd " ++ shellEscape remotedir
|
, Just $ "cd " ++ shellEscape remotedir
|
||||||
, if rsynconly then Nothing else Just "if [ ! -d .git ]; then git init --bare --shared; fi"
|
, if rsynconly then Nothing else Just "if [ ! -d .git ]; then git init --bare --shared; fi"
|
||||||
, if (rsynconly || gcrypt) then Nothing else Just "git annex init"
|
, if (rsynconly || gcrypt) then Nothing else Just "git annex init"
|
||||||
, if needsPubKey sshdata
|
, if needsPubKey origsshdata
|
||||||
then addAuthorizedKeysCommand (hasCapability sshdata GitAnnexShellCapable) remotedir . sshPubKey <$> keypair
|
then addAuthorizedKeysCommand (hasCapability origsshdata GitAnnexShellCapable) remotedir . sshPubKey <$> keypair
|
||||||
else Nothing
|
else Nothing
|
||||||
]
|
]
|
||||||
rsynconly = onlyCapability sshdata RsyncCapable
|
rsynconly = onlyCapability origsshdata RsyncCapable
|
||||||
|
|
||||||
makeSshRepo :: SshData -> Handler Html
|
makeSshRepo :: SshData -> Handler Html
|
||||||
makeSshRepo sshdata = setupCloudRemote TransferGroup Nothing $
|
makeSshRepo sshdata = setupCloudRemote TransferGroup Nothing $
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue