diff --git a/main/Main.hs b/main/Main.hs index b9b8723bd..f0fe92de1 100644 --- a/main/Main.hs +++ b/main/Main.hs @@ -19,7 +19,6 @@ import qualified Hasql.Decoders as HD import qualified Hasql.Encoders as HE import qualified Hasql.Pool as P import Network.Wai.Handler.Warp -import Network.BSD (getHostName) import System.IO (BufferMode (..), hSetBuffering, stderr, stdin, stdout) @@ -47,9 +46,7 @@ main = do hSetBuffering stdin LineBuffering hSetBuffering stderr NoBuffering - conf' <- readOptions - host <- getHostName - let conf = conf'{configHost = host} + conf <- readOptions let port = configPort conf pgSettings = cs (configDatabase conf) appSettings = setPort port diff --git a/postgrest.cabal b/postgrest.cabal index ee5a412d8..e6f754ace 100644 --- a/postgrest.cabal +++ b/postgrest.cabal @@ -68,7 +68,6 @@ executable postgrest , insert-ordered-containers >= 0.1.0.1 , http-media >= 0.6.3 , swagger2 >= 2.1 - , network >= 2.6.2.1 , HTTP , Ranged-sets if !os(windows) @@ -116,7 +115,6 @@ library , insert-ordered-containers >= 0.1.0.1 , http-media >= 0.6.3 , swagger2 >= 2.1 - , network >= 2.6.2.1 Other-Modules: Paths_postgrest Exposed-Modules: PostgREST.App @@ -198,6 +196,5 @@ Test-Suite spec , insert-ordered-containers , http-media , swagger2 - , network , HTTP , Ranged-sets diff --git a/src/PostgREST/Config.hs b/src/PostgREST/Config.hs index 6f91e3b8f..d8d840c41 100644 --- a/src/PostgREST/Config.hs +++ b/src/PostgREST/Config.hs @@ -52,7 +52,7 @@ argParser = AppConfig <$> argument str (help "(REQUIRED) database connection string, e.g. postgres://user:pass@host:port/db" <> metavar "DB_URL") <*> strOption (long "anonymous" <> short 'a' <> help "(REQUIRED) postgres role to use for non-authenticated requests" <> metavar "ROLE") <*> strOption (long "schema" <> short 's' <> help "schema to use for API routes" <> metavar "NAME" <> value "public" <> showDefault) - <*> pure "localhost" + <*> strOption (long "hostname" <> short 'n' <> help "hostname on which the HTTP server is running" <> metavar "HOSTNAME" <> value "localhost" <> showDefault) <*> option auto (long "port" <> short 'p' <> help "port number on which to run HTTP server" <> metavar "PORT" <> value 3000 <> showDefault) <*> (secret . cs <$> strOption (long "jwt-secret" <> short 'j' <> help "secret used to encrypt and decrypt JWT tokens" <> metavar "SECRET" <> value "secret" <> showDefault)) diff --git a/stack.yaml b/stack.yaml index 5a4acbecf..8ba4393b0 100644 --- a/stack.yaml +++ b/stack.yaml @@ -20,7 +20,6 @@ extra-deps: - insert-ordered-containers-0.1.0.1 - swagger2-2.1 - http-media-0.6.3 - - network-2.6.2.1 ghc-options: postgrest: -O2 -Werror -Wall -fwarn-identities