summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-26 14:44:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-26 14:44:07 -0400
commit500e71e8f61224cc7777e87c53b0f0a280a0e5c6 (patch)
tree7e804c1640a7d59d0687931217e81a0a6e399f90
parent3034bea385d32ec2ee63f53f33dd208ce77195db (diff)
add a configurator for S3
-rw-r--r--Assistant/MakeRemote.hs26
-rw-r--r--Assistant/Threads/WebApp.hs1
-rw-r--r--debian/changelog3
3 files changed, 19 insertions, 11 deletions
diff --git a/Assistant/MakeRemote.hs b/Assistant/MakeRemote.hs
index 8e9867b2c..73efcdaed 100644
--- a/Assistant/MakeRemote.hs
+++ b/Assistant/MakeRemote.hs
@@ -55,13 +55,10 @@ addRemote a = do
void remoteListRefresh
maybe (error "failed to add remote") return =<< Remote.byName (Just name)
-{- Inits a rsync special remote, and returns the name of the remote. -}
+{- Inits a rsync special remote, and returns its name. -}
makeRsyncRemote :: String -> String -> Annex String
-makeRsyncRemote name location = makeRemote name location $ const $ do
- (u, c) <- Command.InitRemote.findByName name
- c' <- R.setup Rsync.remote u $ M.union config c
- describeUUID u name
- configSet u c'
+makeRsyncRemote name location = makeRemote name location $
+ const $ void $ makeSpecialRemote name Rsync.remote config
where
config = M.fromList
[ ("encryption", "shared")
@@ -69,6 +66,15 @@ makeRsyncRemote name location = makeRemote name location $ const $ do
, ("type", "rsync")
]
+{- Inits a special remote, and returns its name. -}
+makeSpecialRemote :: String -> RemoteType -> R.RemoteConfig -> Annex String
+makeSpecialRemote name remotetype config = do
+ (u, c) <- Command.InitRemote.findByName name
+ c' <- R.setup remotetype u $ M.union config c
+ describeUUID u name
+ configSet u c'
+ return name
+
{- Returns the name of the git remote it created. If there's already a
- remote at the location, returns its name. -}
makeGitRemote :: String -> String -> Annex String
@@ -86,7 +92,7 @@ makeRemote basename location a = do
r <- fromRepo id
if not (any samelocation $ Git.remotes r)
then do
- let name = uniqueRemoteName r basename 0
+ let name = uniqueRemoteName basename 0 r
a name
return name
else return basename
@@ -95,10 +101,10 @@ makeRemote basename location a = do
{- Generate an unused name for a remote, adding a number if
- necessary. -}
-uniqueRemoteName :: Git.Repo -> String -> Int -> String
-uniqueRemoteName r basename n
+uniqueRemoteName :: String -> Int -> Git.Repo -> String
+uniqueRemoteName basename n r
| null namecollision = name
- | otherwise = uniqueRemoteName r basename (succ n)
+ | otherwise = uniqueRemoteName basename (succ n) r
where
namecollision = filter samename (Git.remotes r)
samename x = Git.remoteName x == Just name
diff --git a/Assistant/Threads/WebApp.hs b/Assistant/Threads/WebApp.hs
index 8a5ab4ec6..cb5f58b2d 100644
--- a/Assistant/Threads/WebApp.hs
+++ b/Assistant/Threads/WebApp.hs
@@ -20,6 +20,7 @@ import Assistant.WebApp.Configurators
import Assistant.WebApp.Configurators.Local
import Assistant.WebApp.Configurators.Ssh
import Assistant.WebApp.Configurators.Pairing
+import Assistant.WebApp.Configurators.S3
import Assistant.WebApp.Documentation
import Assistant.WebApp.OtherRepos
import Assistant.ThreadedMonad
diff --git a/debian/changelog b/debian/changelog
index e378311e8..976b70903 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,7 +14,8 @@ git-annex (3.20120925) UNRELEASED; urgency=low
Closes: #688833
* S3: When using a shared cipher, S3 credentials are not stored encrypted
in the git repository, as that would allow anyone with access to
- the repository access to the S3 account.
+ the repository access to the S3 account. Instead, they're stored
+ in a 600 mode file in the local git repo.
-- Joey Hess <joeyh@debian.org> Mon, 24 Sep 2012 19:58:07 -0400