Add app settings for SSH server

This commit is contained in:
fr33domlover 2016-03-05 03:56:25 +00:00
parent 0ab77db612
commit 062fb5539a
3 changed files with 14 additions and 5 deletions

View file

@ -123,4 +123,6 @@
^yesod-devel(/|$)
### vervis
^config/ssh-private-key$
^config/ssh-private-key\.pub$
^repos(/|$)

View file

@ -8,7 +8,7 @@ host: "_env:HOST:*4"
# The port `yesod devel` uses is distinct from this value. Set the
# `yesod devel` port from the command line.
port: "_env:PORT:3000"
http-port: "_env:PORT:3000"
ip-from-header: "_env:IP_FROM_HEADER:false"
@ -38,5 +38,7 @@ database:
database: "_env:PGDATABASE:vervis_dev"
poolsize: "_env:PGPOOLSIZE:10"
repo-dir: repos
copyright: Insert your statement against copyright here
repo-dir: repos
ssh-port: 5022
ssh-key-file: config/ssh-private-key
copyright: Insert your statement against copyright here

View file

@ -69,9 +69,12 @@ data AppSettings = AppSettings
, appSkipCombining :: Bool
-- ^ Perform no stylesheet/script combining
-- Example app-specific configuration values.
, appRepoDir :: FilePath
-- ^ Path to the directory under which git repos are placed
, appSshPort :: Int
-- ^ Port for the SSH server component to listen on
, appSshKeyFile :: FilePath
-- ^ Path to the server's SSH private key file
, appCopyright :: Text
-- ^ Copyright text to appear in the footer of the page
}
@ -88,7 +91,7 @@ instance FromJSON AppSettings where
appDatabaseConf <- o .: "database"
appRoot <- o .:? "approot"
appHost <- fromString <$> o .: "host"
appPort <- o .: "port"
appPort <- o .: "http-port"
appIpFromHeader <- o .: "ip-from-header"
appDetailedRequestLogging <- o .:? "detailed-logging" .!= defaultDev
@ -98,6 +101,8 @@ instance FromJSON AppSettings where
appSkipCombining <- o .:? "skip-combining" .!= defaultDev
appRepoDir <- o .: "repo-dir"
appSshPort <- o .: "ssh-port"
appSshKeyFile <- o .: "ssh-key-file"
appCopyright <- o .: "copyright"
return AppSettings {..}