mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Add RailsPulse monitoring tool with basic HTTP authentication
This commit is contained in:
parent
be5307f963
commit
1164bc8695
1 changed files with 9 additions and 9 deletions
|
|
@ -139,14 +139,14 @@ RailsPulse.configure do |config|
|
||||||
config.authentication_enabled = true
|
config.authentication_enabled = true
|
||||||
|
|
||||||
# Where to redirect unauthorized users
|
# Where to redirect unauthorized users
|
||||||
# config.authentication_redirect_path = "/"
|
config.authentication_redirect_path = '/'
|
||||||
|
|
||||||
# Custom authentication method - choose one of the examples below:
|
# Custom authentication method - choose one of the examples below:
|
||||||
|
|
||||||
# Example 1: Devise with admin role check
|
# Example 1: Devise with admin role check
|
||||||
config.authentication_method = proc {
|
# config.authentication_method = proc {
|
||||||
redirect_to main_app.root_path, alert: 'Access denied' unless user_signed_in? && current_user.admin?
|
# redirect_to main_app.root_path, alert: 'Access denied' unless user_signed_in? && current_user.admin?
|
||||||
}
|
# }
|
||||||
|
|
||||||
# Example 2: Custom session-based authentication
|
# Example 2: Custom session-based authentication
|
||||||
# config.authentication_method = proc {
|
# config.authentication_method = proc {
|
||||||
|
|
@ -161,11 +161,11 @@ RailsPulse.configure do |config|
|
||||||
# }
|
# }
|
||||||
|
|
||||||
# Example 4: Basic HTTP authentication
|
# Example 4: Basic HTTP authentication
|
||||||
# config.authentication_method = proc {
|
config.authentication_method = proc {
|
||||||
# authenticate_or_request_with_http_basic do |username, password|
|
authenticate_or_request_with_http_basic do |username, password|
|
||||||
# username == ENV['RAILS_PULSE_USERNAME'] && password == ENV['RAILS_PULSE_PASSWORD']
|
username == ENV['RAILS_PULSE_USERNAME'] && password == ENV['RAILS_PULSE_PASSWORD']
|
||||||
# end
|
end
|
||||||
# }
|
}
|
||||||
|
|
||||||
# Example 5: Custom authorization check
|
# Example 5: Custom authorization check
|
||||||
# config.authentication_method = proc {
|
# config.authentication_method = proc {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue