packages feed

darcsden-1.1.1: src/DarcsDen/Settings.hs

{-# OPTIONS_GHC -F -pgmF trhsx #-}
{-# LANGUAGE CPP #-}

module DarcsDen.Settings where
import HSP
import qualified Database.Redis.Redis as R

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


-- 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 = "localhost"
#ifndef DEBUG
basePort = ":8900"
#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 = "webmaster@"++hostname
adminName = "admin"

-- 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.1"
#ifndef DEBUG
version' = version
#else
version' = version ++ " DEV"
#endif
buildDate = __DATE__
buildTime = __TIME__

siteLink = <a class="name" href=(baseUrl)><% hostname %></a>

siteFooter =
  <ul>
    <li>darcsden <% version' %> built <% buildDate %> <% buildTime %></li>
    <% if null adminEmail
        then <% "" %>
        else <% <li>report problems to <a href=("mailto:"++adminEmail++"?subject=darcsden:%20")><% adminName %></a></li> %>
     %>
  </ul>

frontPageContent =
   <p class="blurb">
   </p>