renamed environment variables
This commit is contained in:
parent
64d7e07f35
commit
1d7527bb08
@ -48,13 +48,13 @@ share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
|
||||
testUsers :: [User] -- TODO move to db
|
||||
testUsers =
|
||||
[ User "Fallback User" "foo@bar.com"
|
||||
, User "Tina Tester" "t@t.tt"
|
||||
, User "Tina Tester" "tester@campus.lmu.de"
|
||||
, User "Max Muster" "m@m.mm" ]
|
||||
|
||||
runDB :: ReaderT SqlBackend (NoLoggingT (ResourceT IO)) a -> IO a
|
||||
runDB action = do
|
||||
Just port <- lookupEnv "OAUTH2_DB_PORT" -- >>= \p -> return $ p <|> Just "9444"
|
||||
Just host <- lookupEnv "PGHOST"
|
||||
Just host <- lookupEnv "OAUTH2_PGHOST"
|
||||
let connStr = fromString @ConnectionString $ "host=" ++ host ++ " dbname=test_users user=oauth2mock password=0000 port=" ++ port
|
||||
runStderrLoggingT $ withPostgresqlPool connStr 10 $ \pool -> liftIO $ flip runSqlPersistMPool pool action
|
||||
|
||||
|
||||
4
mkDB.sh
4
mkDB.sh
@ -19,8 +19,8 @@ psql -h "${pgSockDir}" -p ${OAUTH2_DB_PORT} -f ./schema.sql postgres
|
||||
|
||||
printf "Postgres logfile is %s\nPostgres socket directory is %s\n" "${pgLogFile}" "${pgSockDir}"
|
||||
|
||||
export PGHOST="${pgSockDir}"
|
||||
export PGLOG="${pgLogFile}"
|
||||
export OAUTH2_PGHOST="${pgSockDir}"
|
||||
export OAUTH2_PGLOG="${pgLogFile}"
|
||||
|
||||
zsh
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user