diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 9d358f717e..ded406bbfa 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -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" \ No newline at end of file + CHAIN_ID: "77" + ADMIN_PANEL_ENABLED: "true" \ No newline at end of file diff --git a/apps/block_scout_web/config/config.exs b/apps/block_scout_web/config/config.exs index 836b27814e..51d2db9ba8 100644 --- a/apps/block_scout_web/config/config.exs +++ b/apps/block_scout_web/config/config.exs @@ -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" diff --git a/apps/block_scout_web/lib/block_scout_web/router.ex b/apps/block_scout_web/lib/block_scout_web/router.ex index 00c2682c22..e287d05ab5 100644 --- a/apps/block_scout_web/lib/block_scout_web/router.ex +++ b/apps/block_scout_web/lib/block_scout_web/router.ex @@ -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"])