{-# OPTIONS_GHC -F -pgmF trhsx #-} {-# LANGUAGE CPP #-} module DarcsDen.Settings where import HSP import qualified Database.Redis.Redis as R import Control.Monad.Trans (liftIO) import DarcsDen.Util (doMarkdown') multiuser, issuetrackers, deletefiles :: Bool adminEmail, adminName, sendEmail, sendName, hostname, basePort, basePath, baseUrl, version, version', buildDate, buildTime, couchHost, redisHost, redisPort, githubAppIdVarName, githubAppPwdVarName, googleAppIdVarName, googleAppPwdVarName :: String maxRequestTime, maxFileDisplaySize, maxPatchDisplaySize, couchPort :: Int homeDir, usersDir, accessLog, errorLog, xdgMimePath :: FilePath siteLink, siteFooter, frontPageContent :: HSP XML -- hub.darcs.net settings: -- optional features multiuser = True -- Enable user registration ? issuetrackers = True -- Enable optional issue trackers ? deletefiles = True -- Delete repos from the filesystem when deleted in the web UI ? -- app url baseUrl = "http://" ++ hostname ++ basePort ++ basePath hostname = "hub.darcs.net" #ifndef DEBUG basePort = "" #else basePort = ":8901" #endif basePath = "/" -- must end with a slash -- To enable github integration, register an application at github. -- Store the client id and client secret as environment variables githubAppIdVarName = "GITHUB_CLIENT_ID" githubAppPwdVarName = "GITHUB_CLIENT_SECRET" -- To enable google integration, register an application at google. -- Store the client id and client secret as environment variables googleAppIdVarName = "GOOGLE_CLIENT_ID" googleAppPwdVarName = "GOOGLE_CLIENT_SECRET" -- contact info adminEmail = "simon@joyful.com" adminName = "Simon" -- send address: you need to be able to send mails from -- this address using the default sendmail executable sendEmail = "darcsden@"++hostname sendName = "darcsden" -- resource limits maxRequestTime = 30 -- granularity is 5s, precision is +/-5s maxFileDisplaySize = 200000 maxPatchDisplaySize = 200000 -- filesystem homeDir = "/home/darcsden" usersDir = homeDir ++ "/users" #ifndef DEBUG accessLog = homeDir ++ "/log/access.log" errorLog = homeDir ++ "/log/error.log" #else accessLog = "access.log" errorLog = "" #endif xdgMimePath = "xdg-mime" -- databases couchHost = "127.0.0.1" couchPort = 5984 redisHost = "127.0.0.1" redisPort = R.defaultPort -- content version = "1.1" #ifndef DEBUG version' = version #else version' = version ++ " DEV" #endif buildDate = __DATE__ buildTime = __TIME__ siteLink = <% hostname %> siteFooter = frontPageContent = -- read front page content on each request for easy tweaking do h <- liftIO $ doMarkdown' `fmap` (readFile $ homeDir ++ "/docs/README.md")
<% cdata h %>