fix baffle_host

This commit is contained in:
Dan Milne
2025-11-09 22:09:56 +11:00
parent 1bbea9bf67
commit ce2feb4180
5 changed files with 9 additions and 10 deletions

View File

@@ -13,7 +13,8 @@ class Dsn < ApplicationRecord
def full_dsn_url def full_dsn_url
# Generate a complete DSN URL like Sentry does # Generate a complete DSN URL like Sentry does
# Format: https://{key}@{domain}/api/events # Format: https://{key}@{domain}/api/events
domain = Rails.application.config.action_mailer.default_url_options[:host] || domain = ENV['BAFFLE_HOST'] ||
Rails.application.config.action_mailer.default_url_options[:host] ||
ENV['RAILS_HOST'] || ENV['RAILS_HOST'] ||
'localhost:3000' 'localhost:3000'
@@ -23,7 +24,8 @@ class Dsn < ApplicationRecord
def api_endpoint_url def api_endpoint_url
# Just the API endpoint URL (without key) # Just the API endpoint URL (without key)
domain = Rails.application.config.action_mailer.default_url_options[:host] || domain = ENV['BAFFLE_HOST'] ||
Rails.application.config.action_mailer.default_url_options[:host] ||
ENV['RAILS_HOST'] || ENV['RAILS_HOST'] ||
'localhost:3000' 'localhost:3000'

View File

@@ -111,11 +111,13 @@
<h3 class="text-lg leading-6 font-medium text-gray-900">Actions</h3> <h3 class="text-lg leading-6 font-medium text-gray-900">Actions</h3>
<div class="mt-5 space-x-3"> <div class="mt-5 space-x-3">
<% if @dsn.enabled? && policy(@dsn).disable? %> <% if @dsn.enabled? && policy(@dsn).disable? %>
<%= link_to "Disable DSN", disable_dsn_path(@dsn), method: :post, <%= button_to "Disable DSN", disable_dsn_path(@dsn),
data: { confirm: "Are you sure you want to disable this DSN? Agents will no longer be able to authenticate with this key." }, method: :post,
data: { turbo_confirm: "Are you sure you want to disable this DSN? Agents will no longer be able to authenticate with this key." },
class: "inline-flex items-center px-4 py-2 border border-red-300 rounded-md shadow-sm text-sm font-medium text-red-700 bg-white hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500" %> class: "inline-flex items-center px-4 py-2 border border-red-300 rounded-md shadow-sm text-sm font-medium text-red-700 bg-white hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500" %>
<% elsif !@dsn.enabled? && policy(@dsn).enable? %> <% elsif !@dsn.enabled? && policy(@dsn).enable? %>
<%= link_to "Enable DSN", enable_dsn_path(@dsn), method: :post, <%= button_to "Enable DSN", enable_dsn_path(@dsn),
method: :post,
class: "inline-flex items-center px-4 py-2 border border-green-300 rounded-md shadow-sm text-sm font-medium text-green-700 bg-white hover:bg-green-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500" %> class: "inline-flex items-center px-4 py-2 border border-green-300 rounded-md shadow-sm text-sm font-medium text-green-700 bg-white hover:bg-green-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500" %>
<% end %> <% end %>
</div> </div>

View File

@@ -1,2 +0,0 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# Empty fixtures - tests create their own data

View File

@@ -1,2 +0,0 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# Empty fixtures - tests create their own data

View File

@@ -1 +0,0 @@
# Empty fixtures