fix: don't enable admin server /config by default

This now requires setting `admin-server-config-enabled`.
This commit is contained in:
steve-chavez
2025-05-01 20:24:08 -05:00
committed by Steve Chavez
parent 36eb72c2a0
commit 1f28efa9bd
18 changed files with 65 additions and 3 deletions
+5 -2
View File
@@ -56,8 +56,11 @@ admin appState req respond = do
in
respond $ Wai.responseLBS status [] mempty
["config"] -> do
config <- AppState.getConfig appState
respond $ Wai.responseLBS HTTP.status200 [] (LBS.fromStrict $ encodeUtf8 $ Config.toText config)
config@Config.AppConfig{configAdminServerConfigEnabled} <- AppState.getConfig appState
if configAdminServerConfigEnabled then
respond $ Wai.responseLBS HTTP.status200 [] (LBS.fromStrict $ encodeUtf8 $ Config.toText config)
else
respond $ Wai.responseLBS HTTP.status404 [] mempty
["schema_cache"] -> do
sCache <- AppState.getSchemaCache appState
respond $ Wai.responseLBS HTTP.status200 [] (maybe mempty JSON.encode sCache)