Merge pull request #5208 from blockscout/np-disable-admin-panel

Add ADMIN_PANEL_ENABLED
pull/4862/head
Victor Baranov 3 years ago committed by GitHub
commit 73b9bf135c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .github/workflows/config.yml
  2. 3
      apps/block_scout_web/config/config.exs
  3. 4
      apps/block_scout_web/lib/block_scout_web/router.ex

@ -580,4 +580,5 @@ jobs:
PGUSER: postgres
ETHEREUM_JSONRPC_CASE: "EthereumJSONRPC.Case.Parity.Mox"
ETHEREUM_JSONRPC_WEB_SOCKET_CASE: "EthereumJSONRPC.WebSocket.Case.Mox"
CHAIN_ID: "77"
CHAIN_ID: "77"
ADMIN_PANEL_ENABLED: "true"

@ -52,7 +52,8 @@ config :block_scout_web,
max_size_to_show_array_as_is: Integer.parse(System.get_env("MAX_SIZE_UNLESS_HIDE_ARRAY", "50")),
max_length_to_show_string_without_trimming: System.get_env("MAX_STRING_LENGTH_WITHOUT_TRIMMING", "2040"),
re_captcha_secret_key: System.get_env("RE_CAPTCHA_SECRET_KEY", nil),
re_captcha_client_key: System.get_env("RE_CAPTCHA_CLIENT_KEY", nil)
re_captcha_client_key: System.get_env("RE_CAPTCHA_CLIENT_KEY", nil),
admin_panel_enabled: System.get_env("ADMIN_PANEL_ENABLED", "") == "true"
global_api_rate_limit_value =
"API_RATE_LIMIT"

@ -8,7 +8,9 @@ defmodule BlockScoutWeb.Router do
forward("/wobserver", Wobserver.Web.Router)
end
forward("/admin", BlockScoutWeb.AdminRouter)
if Application.get_env(:block_scout_web, :admin_panel_enabled) do
forward("/admin", BlockScoutWeb.AdminRouter)
end
pipeline :browser do
plug(:accepts, ["html"])

Loading…
Cancel
Save