Created
January 9, 2011 20:03
-
-
Save pbrisbin/771958 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //blue/0/~/ ll /srv/http/ | |
| total 30M | |
| drwxr-xr-x 2 patrick http 4.0K Oct 22 14:51 cassius | |
| drwxr-xr-x 2 patrick http 4.0K Nov 16 17:01 hamlet | |
| drwxr-xr-x 2 patrick http 4.0K Jan 9 14:20 pandoc | |
| drwxr-xr-x 7 patrick http 4.0K Dec 13 14:10 static | |
| drwxr-xr-x 3 patrick http 4.0K Oct 23 23:01 xmonad | |
| -rwxr-xr-x 1 http http 29M Jan 9 14:32 app.cgi | |
| -rw-r--r-- 1 http http 16 Oct 22 14:51 client_session_key.aes | |
| -rw-r--r-- 1 patrick http 1.4K Oct 27 10:50 favicon.ico | |
| -rw-r--r-- 1 http http 19K Jan 9 14:33 posts.db3 | |
| //blue/0/~/ ll http-test/ | |
| total 30M | |
| drwxr-xr-x 2 patrick patrick 4.0K Jan 9 14:35 cassius | |
| drwxr-xr-x 2 patrick patrick 4.0K Jan 9 14:35 hamlet | |
| drwxr-xr-x 2 patrick patrick 4.0K Jan 9 14:35 pandoc | |
| drwxr-xr-x 7 patrick patrick 4.0K Jan 9 14:35 static | |
| drwxr-xr-x 3 patrick patrick 4.0K Jan 9 14:35 xmonad | |
| -rwxr-xr-x 1 patrick patrick 29M Jan 9 14:35 app.cgi | |
| srwxr-xr-x 1 patrick patrick 0 Jan 9 14:35 app.socket-0 | |
| srwxr-xr-x 1 patrick patrick 0 Jan 9 14:35 app.socket-1 | |
| srwxr-xr-x 1 patrick patrick 0 Jan 9 14:35 app.socket-2 | |
| srwxr-xr-x 1 patrick patrick 0 Jan 9 14:35 app.socket-3 | |
| srwxr-xr-x 1 patrick patrick 0 Jan 9 14:35 app.socket-4 | |
| srwxr-xr-x 1 patrick patrick 0 Jan 9 14:35 app.socket-5 | |
| srwxr-xr-x 1 patrick patrick 0 Jan 9 14:35 app.socket-6 | |
| srwxr-xr-x 1 patrick patrick 0 Jan 9 14:35 app.socket-7 | |
| srwxr-xr-x 1 patrick patrick 0 Jan 9 14:35 app.socket-8 | |
| srwxr-xr-x 1 patrick patrick 0 Jan 9 14:35 app.socket-9 | |
| -rw-r--r-- 1 patrick patrick 16 Jan 9 14:35 client_session_key.aes | |
| -rw-r--r-- 1 patrick patrick 348 Jan 9 14:35 dev.conf | |
| -rw-r--r-- 1 patrick patrick 19K Jan 9 14:35 dev-posts.db3 | |
| -rw-r--r-- 1 patrick patrick 1.4K Jan 9 14:35 favicon.ico | |
| //blue/0/~/ cat /etc/lighttpd/lighttpd.conf | |
| # | |
| # prod settings | |
| # | |
| server.port = 80 | |
| server.username = "http" | |
| server.groupname = "http" | |
| server.document-root = "/srv/http" | |
| server.pid-file = "/var/run/lighttpd/lighttpd.pid" | |
| server.errorlog = "/var/log/lighttpd/error.log" | |
| accesslog.filename = "/var/log/lighttpd/access.log" | |
| auth.debug = 2 | |
| auth.backend = "plain" | |
| auth.backend.plain.userfile = "/etc/lighttpd/password" | |
| # includes | |
| include "common.conf" | |
| include "redirects.conf" | |
| # password protected | |
| auth.require = ( | |
| "/static/private" => ( | |
| "method" => "basic", | |
| "realm" => "Password protected storage", | |
| "require" => "user=patrick|user=guest" | |
| ) | |
| ) | |
| # fastcgi | |
| fastcgi.server = ( | |
| "/app" => (( | |
| "socket" => "/tmp/app.socket", | |
| "check-local" => "disable", | |
| "bin-path" => "/srv/http/app.cgi", | |
| "min-procs" => 1, | |
| "max-procs" => 10, | |
| "idle-timeout" => 30 | |
| )) | |
| ) | |
| //blue/0/~/ cat /etc/lighttpd/dev.conf | |
| # | |
| # dev settings | |
| # | |
| server.port = 3000 | |
| server.document-root = "." | |
| include "/etc/lighttpd/common.conf" | |
| # fastcgi | |
| fastcgi.server = ( | |
| "/app" => (( | |
| "socket" => "./app.socket", | |
| "check-local" => "disable", | |
| "bin-path" => "./app.cgi", | |
| "min-procs" => 1, | |
| "max-procs" => 10, | |
| "idle-timeout" => 30 | |
| )) | |
| ) | |
| //blue/0/~/ cat Code/haskell/devsite/Settings.hs | |
| {-# LANGUAGE CPP #-} | |
| ------------------------------------------------------------------------------- | |
| -- | | |
| -- Module : Settings | |
| -- Copyright : (c) Patrick Brisbin 2010 | |
| -- License : as-is | |
| -- | |
| -- Maintainer : pbrisbin@gmail.com | |
| -- Stability : unstable | |
| -- Portability : unportable | |
| -- | |
| -- Static settings used in all modules. | |
| -- | |
| ------------------------------------------------------------------------------- | |
| module Settings | |
| ( approot | |
| , hamletFile | |
| , cassiusFile | |
| , withConnectionPool | |
| ) where | |
| import qualified Text.Hamlet as H | |
| import qualified Text.Cassius as C | |
| import Language.Haskell.TH.Syntax | |
| import Yesod hiding (approot) | |
| import Database.Persist.Sqlite | |
| approot :: String | |
| #ifdef PROD | |
| approot = "http://pbrisbin.com" | |
| #else | |
| approot = "http://localhost:3000" | |
| #endif | |
| hamletFile :: FilePath -> Q Exp | |
| #ifdef PROD | |
| hamletFile x = H.hamletFile $ "hamlet/" ++ x ++ ".hamlet" | |
| #else | |
| hamletFile x = H.hamletFileDebug $ "hamlet/" ++ x ++ ".hamlet" | |
| #endif | |
| cassiusFile :: FilePath -> Q Exp | |
| #ifdef PROD | |
| cassiusFile x = C.cassiusFile $ "cassius/" ++ x ++ ".cassius" | |
| #else | |
| cassiusFile x = C.cassiusFileDebug $ "cassius/" ++ x ++ ".cassius" | |
| #endif | |
| dataBase :: String | |
| #ifdef PROD | |
| dataBase = "posts.db3" | |
| #else | |
| dataBase = "dev-posts.db3" | |
| #endif | |
| withConnectionPool :: MonadInvertIO m => (ConnectionPool -> m a) -> m a | |
| withConnectionPool = withSqlitePool dataBase 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment