Use EFF wordlist. Embed wordlist into executable. Move views/public to assets/public. Move wordlist into assets.
This commit is contained in:
@ -16,7 +16,7 @@ app :: PurrApp ()
|
||||
app = do
|
||||
-- Middleware definition
|
||||
middleware logStdoutDev
|
||||
middleware $ staticPolicy (noDots >-> addBase "views/public")
|
||||
middleware $ staticPolicy (noDots >-> addBase "assets/public")
|
||||
|
||||
-- Core Routes
|
||||
get "/" $ do
|
||||
|
@ -1,3 +1,5 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Feature.Generation.Passwords
|
||||
( Password
|
||||
, Random
|
||||
@ -12,6 +14,7 @@ import Feature.Generation.Shared (camelCase, rCharSym, rIndex,
|
||||
validChars, validNumbers,
|
||||
validSymbols)
|
||||
|
||||
import Data.FileEmbed
|
||||
import Data.List (singleton)
|
||||
|
||||
suggestedScheme :: Int -> Random Password
|
||||
@ -53,7 +56,7 @@ rNum :: Random Int
|
||||
rNum = rIndex validNumbers
|
||||
|
||||
rWord :: Random String
|
||||
rWord = wordList >>= rIndex
|
||||
rWord = rIndex wordList
|
||||
|
||||
rSym :: Random Char
|
||||
rSym = rIndex validSymbols
|
||||
@ -61,5 +64,5 @@ rSym = rIndex validSymbols
|
||||
rCamel :: Random String
|
||||
rCamel = camelCase <$> rWord
|
||||
|
||||
wordList :: Random [String]
|
||||
wordList = fmap lines (readFile "./src/Feature/Generation/wordlist.txt")
|
||||
wordList :: [String]
|
||||
wordList = lines $(embedStringFile "./assets/wordlist.txt")
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user