Change server-proxy-uri 2 openapi-server-proxy-uri

The server-proxy-uri config option mislead into thinking it was a
web server global setting when it's only related to OpenAPI.
This commit is contained in:
steve-chavez
2020-02-02 15:23:32 -05:00
committed by Steve Chavez
parent 9b1224827a
commit b75e7cef90
7 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -311,7 +311,7 @@ app dbStructure proc cols conf apiRequest =
(ActionInspect headersOnly, TargetDefaultSpec tSchema, Nothing) -> do
let host = configHost conf
port = toInteger $ configPort conf
proxy = pickProxy $ toS <$> configProxyUri conf
proxy = pickProxy $ toS <$> configOpenAPIProxyUri conf
uri Nothing = ("http", host, port, "/")
uri (Just Proxy { proxyScheme = s, proxyHost = h, proxyPort = p, proxyPath = b }) = (s, h, p, b)
uri' = uri proxy
+3 -3
View File
@@ -70,7 +70,7 @@ import Protolude hiding (concat, hPutStrLn, intercalate, null,
data AppConfig = AppConfig {
configDatabase :: Text
, configAnonRole :: Text
, configProxyUri :: Maybe Text
, configOpenAPIProxyUri :: Maybe Text
, configSchema :: Text
, configHost :: Text
, configPort :: Int
@@ -154,7 +154,7 @@ readOptions = do
AppConfig
<$> reqString "db-uri"
<*> reqString "db-anon-role"
<*> optString "server-proxy-uri"
<*> optString "openapi-server-proxy-uri"
<*> reqString "db-schema"
<*> (fromMaybe "!4" <$> optString "server-host")
<*> (fromMaybe 3000 <$> optInt "server-port")
@@ -271,7 +271,7 @@ readOptions = do
|# server-unix-socket-mode = "660"
|
|## base url for swagger output
|# server-proxy-uri = ""
|# openapi-server-proxy-uri = ""
|
|## choose a secret, JSON Web Key (or set) to enable JWT auth
|## (use "@filename" to load from separate file)