Class: RailsErrorDashboard::Configuration
- Inherits:
-
Object
- Object
- RailsErrorDashboard::Configuration
- Defined in:
- lib/rails_error_dashboard/configuration.rb
Instance Attribute Summary collapse
-
#dashboard_base_url ⇒ Object
Returns the value of attribute dashboard_base_url.
-
#dashboard_password ⇒ Object
Returns the value of attribute dashboard_password.
-
#dashboard_username ⇒ Object
Dashboard authentication.
-
#discord_webhook_url ⇒ Object
Discord notifications.
-
#enable_discord_notifications ⇒ Object
Returns the value of attribute enable_discord_notifications.
-
#enable_email_notifications ⇒ Object
Returns the value of attribute enable_email_notifications.
-
#enable_error_subscriber ⇒ Object
Enable/disable Rails.error subscriber.
-
#enable_middleware ⇒ Object
Enable/disable error catching middleware.
-
#enable_pagerduty_notifications ⇒ Object
Returns the value of attribute enable_pagerduty_notifications.
-
#enable_slack_notifications ⇒ Object
Returns the value of attribute enable_slack_notifications.
-
#enable_webhook_notifications ⇒ Object
Returns the value of attribute enable_webhook_notifications.
-
#notification_email_from ⇒ Object
Returns the value of attribute notification_email_from.
-
#notification_email_recipients ⇒ Object
Returns the value of attribute notification_email_recipients.
-
#pagerduty_integration_key ⇒ Object
PagerDuty notifications (critical errors only).
-
#require_authentication ⇒ Object
Returns the value of attribute require_authentication.
-
#require_authentication_in_development ⇒ Object
Returns the value of attribute require_authentication_in_development.
-
#retention_days ⇒ Object
Retention policy (days to keep errors).
-
#slack_webhook_url ⇒ Object
Notifications.
-
#use_separate_database ⇒ Object
Separate database configuration.
-
#user_model ⇒ Object
User model (for associations).
-
#webhook_urls ⇒ Object
Generic webhook notifications.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/rails_error_dashboard/configuration.rb', line 46 def initialize # Default values @dashboard_username = ENV.fetch("ERROR_DASHBOARD_USER", "admin") @dashboard_password = ENV.fetch("ERROR_DASHBOARD_PASSWORD", "password") @require_authentication = true @require_authentication_in_development = false @user_model = "User" # Notification settings @slack_webhook_url = ENV["SLACK_WEBHOOK_URL"] @notification_email_recipients = ENV.fetch("ERROR_NOTIFICATION_EMAILS", "").split(",").map(&:strip) @notification_email_from = ENV.fetch("ERROR_NOTIFICATION_FROM", "errors@example.com") @dashboard_base_url = ENV["DASHBOARD_BASE_URL"] @enable_slack_notifications = true @enable_email_notifications = true # Discord notification settings @discord_webhook_url = ENV["DISCORD_WEBHOOK_URL"] @enable_discord_notifications = false # PagerDuty notification settings (critical errors only) @pagerduty_integration_key = ENV["PAGERDUTY_INTEGRATION_KEY"] @enable_pagerduty_notifications = false # Generic webhook settings (array of URLs) @webhook_urls = ENV.fetch("WEBHOOK_URLS", "").split(",").map(&:strip).reject(&:empty?) @enable_webhook_notifications = false @use_separate_database = ENV.fetch("USE_SEPARATE_ERROR_DB", "false") == "true" @retention_days = 90 @enable_middleware = true @enable_error_subscriber = true end |
Instance Attribute Details
#dashboard_base_url ⇒ Object
Returns the value of attribute dashboard_base_url.
18 19 20 |
# File 'lib/rails_error_dashboard/configuration.rb', line 18 def dashboard_base_url @dashboard_base_url end |
#dashboard_password ⇒ Object
Returns the value of attribute dashboard_password.
7 8 9 |
# File 'lib/rails_error_dashboard/configuration.rb', line 7 def dashboard_password @dashboard_password end |
#dashboard_username ⇒ Object
Dashboard authentication
6 7 8 |
# File 'lib/rails_error_dashboard/configuration.rb', line 6 def dashboard_username @dashboard_username end |
#discord_webhook_url ⇒ Object
Discord notifications
23 24 25 |
# File 'lib/rails_error_dashboard/configuration.rb', line 23 def discord_webhook_url @discord_webhook_url end |
#enable_discord_notifications ⇒ Object
Returns the value of attribute enable_discord_notifications.
24 25 26 |
# File 'lib/rails_error_dashboard/configuration.rb', line 24 def enable_discord_notifications @enable_discord_notifications end |
#enable_email_notifications ⇒ Object
Returns the value of attribute enable_email_notifications.
20 21 22 |
# File 'lib/rails_error_dashboard/configuration.rb', line 20 def enable_email_notifications @enable_email_notifications end |
#enable_error_subscriber ⇒ Object
Enable/disable Rails.error subscriber
44 45 46 |
# File 'lib/rails_error_dashboard/configuration.rb', line 44 def enable_error_subscriber @enable_error_subscriber end |
#enable_middleware ⇒ Object
Enable/disable error catching middleware
41 42 43 |
# File 'lib/rails_error_dashboard/configuration.rb', line 41 def enable_middleware @enable_middleware end |
#enable_pagerduty_notifications ⇒ Object
Returns the value of attribute enable_pagerduty_notifications.
28 29 30 |
# File 'lib/rails_error_dashboard/configuration.rb', line 28 def enable_pagerduty_notifications @enable_pagerduty_notifications end |
#enable_slack_notifications ⇒ Object
Returns the value of attribute enable_slack_notifications.
19 20 21 |
# File 'lib/rails_error_dashboard/configuration.rb', line 19 def enable_slack_notifications @enable_slack_notifications end |
#enable_webhook_notifications ⇒ Object
Returns the value of attribute enable_webhook_notifications.
32 33 34 |
# File 'lib/rails_error_dashboard/configuration.rb', line 32 def enable_webhook_notifications @enable_webhook_notifications end |
#notification_email_from ⇒ Object
Returns the value of attribute notification_email_from.
17 18 19 |
# File 'lib/rails_error_dashboard/configuration.rb', line 17 def notification_email_from @notification_email_from end |
#notification_email_recipients ⇒ Object
Returns the value of attribute notification_email_recipients.
16 17 18 |
# File 'lib/rails_error_dashboard/configuration.rb', line 16 def notification_email_recipients @notification_email_recipients end |
#pagerduty_integration_key ⇒ Object
PagerDuty notifications (critical errors only)
27 28 29 |
# File 'lib/rails_error_dashboard/configuration.rb', line 27 def pagerduty_integration_key @pagerduty_integration_key end |
#require_authentication ⇒ Object
Returns the value of attribute require_authentication.
8 9 10 |
# File 'lib/rails_error_dashboard/configuration.rb', line 8 def require_authentication @require_authentication end |
#require_authentication_in_development ⇒ Object
Returns the value of attribute require_authentication_in_development.
9 10 11 |
# File 'lib/rails_error_dashboard/configuration.rb', line 9 def require_authentication_in_development @require_authentication_in_development end |
#retention_days ⇒ Object
Retention policy (days to keep errors)
38 39 40 |
# File 'lib/rails_error_dashboard/configuration.rb', line 38 def retention_days @retention_days end |
#slack_webhook_url ⇒ Object
Notifications
15 16 17 |
# File 'lib/rails_error_dashboard/configuration.rb', line 15 def slack_webhook_url @slack_webhook_url end |
#use_separate_database ⇒ Object
Separate database configuration
35 36 37 |
# File 'lib/rails_error_dashboard/configuration.rb', line 35 def use_separate_database @use_separate_database end |
#user_model ⇒ Object
User model (for associations)
12 13 14 |
# File 'lib/rails_error_dashboard/configuration.rb', line 12 def user_model @user_model end |
#webhook_urls ⇒ Object
Generic webhook notifications
31 32 33 |
# File 'lib/rails_error_dashboard/configuration.rb', line 31 def webhook_urls @webhook_urls end |