Tighten up monitoring routes configuration
This commit is contained in:
+1
-1
@@ -67,7 +67,7 @@ config :music_library, MusicLibraryWeb.Endpoint,
|
||||
]
|
||||
|
||||
# Enable dev routes for dashboard and mailbox
|
||||
config :music_library, dev_routes: true
|
||||
config :music_library, monitoring_routes: true
|
||||
|
||||
config :music_library, LastFm,
|
||||
refresh_interval: System.convert_time_unit(500, :second, :millisecond)
|
||||
|
||||
+1
-2
@@ -11,8 +11,7 @@ config :music_library, MusicLibraryWeb.Endpoint,
|
||||
# Do not print debug messages in production
|
||||
config :logger, level: :info
|
||||
|
||||
# We enable dev routes in production as they're protected behind auth
|
||||
config :music_library, dev_routes: true
|
||||
config :music_library, monitoring_routes: true
|
||||
|
||||
# Runtime production configuration, including reading
|
||||
# of environment variables, is done on config/runtime.exs.
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ config :phoenix, :plug_init_mode, :runtime
|
||||
config :phoenix_live_view,
|
||||
enable_expensive_runtime_checks: true
|
||||
|
||||
config :music_library, dev_routes: true
|
||||
config :music_library, monitoring_routes: true
|
||||
|
||||
config :music_library, LastFm, auto_refresh: false
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
defmodule MusicLibraryWeb.Router do
|
||||
use MusicLibraryWeb, :router
|
||||
use ErrorTracker.Web, :router
|
||||
|
||||
import MusicLibraryWeb.Auth, only: [require_logged_in: 2, require_api_token: 2]
|
||||
|
||||
@@ -62,13 +61,8 @@ defmodule MusicLibraryWeb.Router do
|
||||
get "/covers/:record_id", CoverController, :show
|
||||
end
|
||||
|
||||
# Enable LiveDashboard in development
|
||||
if Application.compile_env(:music_library, :dev_routes) do
|
||||
# If you want to use the LiveDashboard in production, you should put
|
||||
# it behind authentication and allow only admins to access it.
|
||||
# If your application does not have an admins-only section yet,
|
||||
# you can use Plug.BasicAuth to set up some basic authentication
|
||||
# as long as you are also using SSL (which you should anyway).
|
||||
if Application.compile_env(:music_library, :monitoring_routes) do
|
||||
use ErrorTracker.Web, :router
|
||||
import Phoenix.LiveDashboard.Router
|
||||
|
||||
scope "/dev" do
|
||||
|
||||
Reference in New Issue
Block a user