renamed environment variables

This commit is contained in:
David Mosbach 2024-01-19 00:37:06 +00:00
parent 64d7e07f35
commit 1d7527bb08
2 changed files with 4 additions and 4 deletions

View File

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

View File

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