Permalink
Browse files

Create initial version based on snaplet-postgresql-simple

Adapt https://github.com/mightybyte/snaplet-postgresql-simple to work
with the sqlite-simple library.
  • Loading branch information...
0 parents commit 10cfeaac8a9980e807f6b6ba45139e80fcf9d53e @nurpax committed Aug 19, 2012
@@ -0,0 +1,3 @@
+import Distribution.Simple
+
+main = defaultMain
@@ -0,0 +1,21 @@
+# Currently this option is not enforced. See current auth documentation for
+# more information.
+minPasswordLen = 8
+
+# Name of the cookie to use for remembering the logged in user.
+rememberCookie = "_remember"
+
+# Number of seconds of inactivity before the user is logged out. If ommitted,
+# the user will remain logged in until the end of the session.
+rememberPeriod = 1209600 # 2 weeks
+
+# Lockout strategy. The first value is the max number of invalid login
+# attempts before lockout. The second value is how long the locked lasts. If
+# ommitted, then incorrect passwords will never result in lockout.
+# lockout = [5, 86400]
+
+# File where the auth encryption key is stored.
+siteKey = "site_key.txt"
+
+# Name of the table where the user data is stored.
+authTable = "snap_auth_user"
@@ -0,0 +1,13 @@
+db = "test.db"
+
+# Nmuber of distinct connection pools to maintain. The smallest acceptable
+# value is 1.
+numStripes = 1
+
+# Number of seconds an unused resource is kept open. The smallest acceptable
+# value is 0.5 seconds.
+idleTime = 5
+
+# Maximum number of resources to keep open per stripe. The smallest
+# acceptable value is 1.
+maxResourcesPerStripe = 20
@@ -0,0 +1,53 @@
+name: snaplet-postgresql-simple
+version: 0.1.0
+synopsis: sqlite-simple snaplet for the Snap Framework
+description: This snaplet contains support for using the SQLite
+ database with a Snap Framework application via the
+ sqlite-simple package. It also includes an
+ authentication backend.
+license: BSD3
+license-file: LICENSE
+author: Janne Hellsten, Doug Beardsley
+maintainer: Janne Hellsten <jjhellst@gmail.com>
+build-type: Simple
+cabal-version: >= 1.6
+homepage: https://github.com/nurpax/snaplet-sqlite-simple
+category: Web, Snap
+
+extra-source-files: LICENSE
+
+data-files:
+ resources/db/devel.cfg
+ resources/auth/devel.cfg
+
+source-repository head
+ type: git
+ location: https://github.com/nurpax/snaplet-sqlite-simple.git
+
+Library
+ hs-source-dirs: src
+
+ exposed-modules:
+ Snap.Snaplet.SqliteSimple
+ Snap.Snaplet.Auth.Backends.SqliteSimple
+
+ other-modules:
+ Paths_snaplet_sqlite_simple
+
+ build-depends:
+ base >= 4 && < 5,
+ bytestring >= 0.9.1 && < 0.10,
+ clientsession >= 0.7.2 && < 0.8,
+ configurator >= 0.2 && < 0.3,
+ MonadCatchIO-transformers >= 0.3 && < 0.4,
+ mtl >= 2 && < 3,
+ sqlite-simple >= 0.1 && < 1.0,
+ resource-pool-catchio >= 0.2 && < 0.3,
+ snap >= 0.9 && < 0.10,
+ text >= 0.11 && < 0.12,
+ transformers >= 0.2 && < 0.4,
+ unordered-containers >= 0.2 && < 0.3
+
+
+ ghc-options: -Wall -fwarn-tabs -funbox-strict-fields
+ -fno-warn-orphans -fno-warn-unused-do-bind
Oops, something went wrong.

0 comments on commit 10cfeaa

Please sign in to comment.