diff --git a/CHANGELOG.md b/CHANGELOG.md
index a266e9945..82511e64b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## Unreleased
### Fixed
+- Improved usage screen - @begriffs
- Reject non-POSTs to rpc endpoints - @begriffs
- Throw an error for OPTIONS on nonexistent tables - @calebmer
diff --git a/docs/install/server.md b/docs/install/server.md
index e5aa4663d..14d8dfcc8 100644
--- a/docs/install/server.md
+++ b/docs/install/server.md
@@ -65,7 +65,7 @@ If you want to run the test suite, stack can do that too: `stack test`.
### Running the Server
```bash
-postgrest postgres://user:pass@host:port/db [flags]
+postgrest postgres://user:pass@host:port/db -a anon_user [other flags]
```
The user in the connection string is the "authenticator role," i.e.
@@ -73,14 +73,14 @@ a role which is used temporarily to switch into other roles depending
on the authentication request JWT. For simple API's you can use the
same role for authenticator and anonymous.
-The possible flags are:
+The complete list of options:
- -p, --port
- The port on which the server will listen for HTTP requests.
Defaults to 3000.
-- -a, --anonymous
+- -a, --anonymous (required)
- The database role used to execute commands for those requests
which provide no JWT authorization.
diff --git a/src/PostgREST/Config.hs b/src/PostgREST/Config.hs
index f7392335e..5aaccf9a7 100644
--- a/src/PostgREST/Config.hs
+++ b/src/PostgREST/Config.hs
@@ -37,9 +37,9 @@ import Prelude
-- | Data type to store all command line options
data AppConfig = AppConfig {
configDatabase :: String
- , configPort :: Int
, configAnonRole :: String
, configSchema :: String
+ , configPort :: Int
, configJwtSecret :: Secret
, configPool :: Int
, configMaxRows :: Maybe Integer
@@ -47,11 +47,10 @@ data AppConfig = AppConfig {
argParser :: Parser AppConfig
argParser = AppConfig
- <$> argument str (help "database connection string" <> metavar "STRING")
-
- <*> option auto (long "port" <> short 'p' <> help "port number on which to run HTTP server" <> metavar "PORT" <> value 3000 <> showDefault)
- <*> strOption (long "anonymous" <> short 'a' <> help "postgres role to use for non-authenticated requests" <> metavar "ROLE")
+ <$> 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)
+ <*> 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))
<*> option auto (long "pool" <> short 'o' <> help "max connections in database pool" <> metavar "COUNT" <> value 10 <> showDefault)
diff --git a/test/SpecHelper.hs b/test/SpecHelper.hs
index 886aaf1e0..22b80ee3c 100644
--- a/test/SpecHelper.hs
+++ b/test/SpecHelper.hs
@@ -30,7 +30,7 @@ dbString :: String
dbString = "postgres://postgrest_test_authenticator@localhost:5432/postgrest_test"
cfg :: String -> Maybe Integer -> AppConfig
-cfg conStr = AppConfig conStr 3000 "postgrest_test_anonymous" "test" (secret "safe") 10
+cfg conStr = AppConfig conStr "postgrest_test_anonymous" "test" 3000 (secret "safe") 10
cfgDefault :: AppConfig
cfgDefault = cfg dbString Nothing