Use EFF wordlist. Embed wordlist into executable. Move views/public to assets/public. Move wordlist into assets.

This commit is contained in:
2023-01-11 15:23:01 -06:00
parent cb45c4ce1d
commit 2889c7e9e7
12 changed files with 7786 additions and 1619 deletions

View File

@ -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

View File

@ -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