This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
access_key_id: 123 | |
secret_access_key: 456 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Honeybadger from "@honeybadger-io/js"; | |
const honeybadger = Honeybadger.configure({ | |
apiKey: "your-api-key", | |
}); | |
// Function to generate a SHA-256 hash in pure JavaScript | |
async function generateFingerprint(stackFrame) { | |
const { file, line, method } = stackFrame; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/honeybadger.rb | |
Honeybadger.configure do |config| | |
config.before_event do |event| | |
event[:dyno] = ENV['DYNO'] if ENV['DYNO'].present? | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Amazon ECS release | |
on: | |
workflow_run: | |
workflows: ["Tests"] | |
branches: [master] | |
types: [completed] | |
concurrency: | |
group: production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_codedeploy_app" "web" { | |
compute_platform = "ECS" | |
name = "honeybadger-web-${var.environment}" | |
} | |
resource "aws_codedeploy_deployment_group" "web" { | |
app_name = aws_codedeploy_app.web.name | |
deployment_config_name = "CodeDeployDefault.ECSAllAtOnce" | |
deployment_group_name = var.environment | |
service_role_arn = aws_iam_role.web-deployer.arn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "http/server" | |
require "honeybadger" | |
Honeybadger.configure do |config| | |
config.api_key = "replaceme" | |
config.environment = "production" | |
end | |
server = HTTP::Server.new do |context| | |
context.response.content_type = "text/plain" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
# Caddy is running behind an application load balancer hosted at AWS, so this configures Caddy to trust the headers set by it | |
servers { | |
trusted_proxies static private_ranges | |
} | |
# Avoid DoS attacks by confirming with a backend app that a requested domain should have an on-demand certificate generated | |
on_demand_tls { | |
ask http://web.internal:5000/confirm_domain | |
interval 1m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
# ... | |
private | |
def append_info_to_payload(payload) | |
super | |
payload[:user_id] = current_user&.id | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
events: | |
ignore: | |
- !ruby/regexp '/(send_file|redirect_to|halted_callback|unpermitted_parameters)\.action_controller/' | |
- !ruby/regexp '/(write_fragment|read_fragment|expire_fragment|exist_fragment\?)\.action_controller/' | |
- !ruby/regexp '/cache_(read|generate|fetch_hit|write|increment|decrement|delete|cleanup|prune|exist\?)\.active_support/' | |
- !ruby/regexp '/cache_(read_multi|write_multi|delete_multi\?)\.active_support/' | |
- !ruby/regexp '/^render_(template|partial|collection)\.action_view/' | |
- !ruby/regexp '/sql.active_record/' | |
- !ruby/regexp '/process.action_mailer/' | |
- !ruby/regexp '/(service_upload|service_download)\.active_storage/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/honeybadger.rb | |
Honeybadger.configure do |config| | |
config.before_event do |event| | |
if (environment = ENV["HONEYBADGER_ENV"].presence || ENV["RAILS_ENV"].presence) | |
event[:environment] = environment | |
end | |
event[:user] = { name: Current.user.name, email: Current.user.email } if Current.user | |
end | |
end |
NewerOlder