1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-29 00:04:52 +09:00

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(/|$) ^yesod-devel(/|$)
### vervis ### vervis
^config/ssh-private-key$
^config/ssh-private-key\.pub$
^repos(/|$) ^repos(/|$)

View file

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

View file

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