webapp: Avoid illegal characters in hostname when creating S3 or Glacier remote.
This commit is contained in:
parent
529f698960
commit
0d2ac184b5
3 changed files with 11 additions and 1 deletions
|
@ -25,6 +25,7 @@ import Logs.PreferredContent
|
||||||
|
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
|
import Data.Char
|
||||||
|
|
||||||
awsConfigurator :: Widget -> Handler RepHtml
|
awsConfigurator :: Widget -> Handler RepHtml
|
||||||
awsConfigurator = page "Add an Amazon repository" (Just Configuration)
|
awsConfigurator = page "Add an Amazon repository" (Just Configuration)
|
||||||
|
@ -175,8 +176,14 @@ makeAWSRemote remotetype (AWSCreds ak sk) name setup config = do
|
||||||
remotename <- runAnnex name $ fromRepo $ uniqueRemoteName name 0
|
remotename <- runAnnex name $ fromRepo $ uniqueRemoteName name 0
|
||||||
liftIO $ AWS.setCredsEnv (T.unpack ak, T.unpack sk)
|
liftIO $ AWS.setCredsEnv (T.unpack ak, T.unpack sk)
|
||||||
r <- liftAssistant $ liftAnnex $ addRemote $ do
|
r <- liftAssistant $ liftAnnex $ addRemote $ do
|
||||||
makeSpecialRemote name remotetype config
|
makeSpecialRemote hostname remotetype config
|
||||||
return remotename
|
return remotename
|
||||||
setup r
|
setup r
|
||||||
liftAssistant $ syncNewRemote r
|
liftAssistant $ syncNewRemote r
|
||||||
redirect $ EditNewCloudRepositoryR $ Remote.uuid r
|
redirect $ EditNewCloudRepositoryR $ Remote.uuid r
|
||||||
|
where
|
||||||
|
{- AWS services use the remote name as the basis for a host
|
||||||
|
- name, so filter it to contain valid characters. -}
|
||||||
|
hostname = case filter isAlphaNum name of
|
||||||
|
[] -> "aws"
|
||||||
|
n -> n
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -17,6 +17,8 @@ git-annex (3.20130108) UNRELEASED; urgency=low
|
||||||
* In direct mode, files with the same key are no longer hardlinked, as
|
* In direct mode, files with the same key are no longer hardlinked, as
|
||||||
that would cause a surprising behavior if modifying one, where the other
|
that would cause a surprising behavior if modifying one, where the other
|
||||||
would also change.
|
would also change.
|
||||||
|
* webapp: Avoid illegal characters in hostname when creating S3 or
|
||||||
|
Glacier remote.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Tue, 08 Jan 2013 12:37:38 -0400
|
-- Joey Hess <joeyh@debian.org> Tue, 08 Jan 2013 12:37:38 -0400
|
||||||
|
|
||||||
|
|
|
@ -15,3 +15,4 @@ What version of git-annex are you using? On what operating system?
|
||||||
|
|
||||||
Please provide any additional information below.
|
Please provide any additional information below.
|
||||||
|
|
||||||
|
> [[done]], the name will now be sanitized. --[[Joey]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue