send remote-daemon a RELOAD after making a ssh remote
This doesn't work yet, because RELOAD is buggy and does not notice the new remote.
This commit is contained in:
parent
1a4c3caa96
commit
512da29273
4 changed files with 24 additions and 10 deletions
|
@ -24,6 +24,7 @@ import Git.Types (RemoteName)
|
|||
import qualified Remote.GCrypt as GCrypt
|
||||
import Annex.UUID
|
||||
import Logs.UUID
|
||||
import Assistant.RemoteControl
|
||||
|
||||
#ifdef mingw32_HOST_OS
|
||||
import Utility.Tmp
|
||||
|
@ -405,12 +406,19 @@ prepSsh' newgcrypt origsshdata sshdata keypair a = sshSetup
|
|||
makeSshRepo :: SshData -> Handler Html
|
||||
makeSshRepo sshdata
|
||||
| onlyCapability sshdata RsyncCapable = setupCloudRemote TransferGroup Nothing go
|
||||
| otherwise = setupRemote EditNewRepositoryR TransferGroup Nothing go
|
||||
| otherwise = makeSshRepoConnection go
|
||||
where
|
||||
go = makeSshRemote sshdata
|
||||
|
||||
makeSshRepoConnection :: Annex RemoteName -> Handler Html
|
||||
makeSshRepoConnection a = setupRemote postsetup TransferGroup Nothing a
|
||||
where
|
||||
postsetup u = do
|
||||
liftAssistant $ sendRemoteControl RELOAD
|
||||
redirect $ EditNewRepositoryR u
|
||||
|
||||
makeGCryptRepo :: KeyId -> SshData -> Handler Html
|
||||
makeGCryptRepo keyid sshdata = setupRemote EditNewRepositoryR TransferGroup Nothing $
|
||||
makeGCryptRepo keyid sshdata = makeSshRepoConnection $
|
||||
makeGCryptRemote (sshRepoName sshdata) (genSshUrl sshdata) keyid
|
||||
|
||||
getAddRsyncNetR :: Handler Html
|
||||
|
|
|
@ -31,13 +31,13 @@ import Utility.Yesod
|
|||
- This includes displaying the connectionNeeded nudge if appropariate.
|
||||
-}
|
||||
setupCloudRemote :: StandardGroup -> Maybe Cost -> Annex RemoteName -> Handler a
|
||||
setupCloudRemote = setupRemote EditNewCloudRepositoryR
|
||||
setupCloudRemote = setupRemote $ redirect . EditNewCloudRepositoryR
|
||||
|
||||
setupRemote :: (UUID -> Route WebApp) -> StandardGroup -> Maybe Cost -> Annex RemoteName -> Handler a
|
||||
setupRemote redirto defaultgroup mcost getname = do
|
||||
setupRemote :: (UUID -> Handler a) -> StandardGroup -> Maybe Cost -> Annex RemoteName -> Handler a
|
||||
setupRemote postsetup defaultgroup mcost getname = do
|
||||
r <- liftAnnex $ addRemote getname
|
||||
liftAnnex $ do
|
||||
setStandardGroup (Remote.uuid r) defaultgroup
|
||||
maybe noop (Config.setRemoteCost (Remote.repo r)) mcost
|
||||
liftAssistant $ syncRemote r
|
||||
redirect $ redirto $ Remote.uuid r
|
||||
postsetup $ Remote.uuid r
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue