ssl option for each app

This commit is contained in:
Michael 2012-09-14 06:29:03 +03:00
parent 1e271d81e7
commit da1b03b1d3
2 changed files with 4 additions and 1 deletions

View File

@ -31,6 +31,7 @@ data Config = Config
, configArgs :: [Text]
, configHost :: String
, configPostgres :: Bool
, configSsl :: Bool
}
instance FromJSON Config where
@ -39,6 +40,7 @@ instance FromJSON Config where
<*> o .:? "args" .!= []
<*> o .: "host"
<*> o .:? "postgres" .!= False
<*> o .:? "ssl" .!= False
parseJSON _ = fail "Wanted an object"
data Command = Reload | Terminate
@ -103,7 +105,7 @@ start tf portman postgres logger appname bundle removeFromList = do
]
Nothing -> []
let env = ("PORT", show port)
: ("APPROOT", "http://" ++ configHost config)
: ("APPROOT", (if configSsl then "https://" else "http://") ++ configHost config)
: otherEnv
run
("config" </> configExec config)

View File

@ -54,6 +54,7 @@ exec: ../dist/build/yesodweb/yesodweb
args:
- production
host: www.yesodweb.com
ssl: false # true would use https scheme for approot
```
A sample Bash script for producing a Keter bundle is: