Skip to content

Commit

Permalink
Merge branch 'fix/rollbar-configuration' into deployment-portage
Browse files Browse the repository at this point in the history
  • Loading branch information
lagoan committed Oct 27, 2020
2 parents 841caaa + b841f9c commit 0ec78e6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
7 changes: 7 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,13 @@ def merge(to_be_merged)
to_be_merged.destroy
end

# For masking the ID that we send to rollbar
#
# Returns string
def id_as_hash
Digest::SHA2.hexdigest("#{Rails.application.secrets.secret_key_base}_#{id}")
end

private

# ============================
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

# Use syslog for logging
config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new('dmp_assistant'))

# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

Expand Down
2 changes: 1 addition & 1 deletion config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config.log_level = :debug
config.log_level = :warn

# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
Expand Down
21 changes: 13 additions & 8 deletions config/initializers/rollbar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
# to fetch the logged-in user object, and then call that object's `id`
# method to fetch this property. To customize:
config.person_method = "current_user"
config.person_id_method = "id"
config.person_id_method = 'id_as_hash'
config.person_username_method = 'id_as_hash'
config.person_email_method = 'id_as_hash'


# Read GDPR guidelines here: https://docs.rollbar.com/docs/ruby#section-gdpr-hipaa
config.collect_user_ip = true
Expand All @@ -27,7 +30,7 @@
# config.person_email_method = "email"

# Additionally, you may specify the following:
config.person_username_method = "name"
# config.person_username_method = "name"
# config.person_email_method = "email"

# If you want to attach custom data to all exception and message reports,
Expand Down Expand Up @@ -66,12 +69,14 @@
# The :host key is mandatory and must include the URL scheme (e.g. 'http://'), all other fields
# are optional.
#
# config.proxy = {
# host: 'http://some.proxy.server',
# port: 80,
# user: 'username_if_auth_required',
# password: 'password_if_auth_required'
# }
if Rails.application.secrets.http_proxy.present?
config.proxy = {
host: Rails.application.secrets.http_proxy,
port: Rails.application.secrets.http_proxy_port
# user: 'username_if_auth_required',
# password: 'password_if_auth_required'
}
end

# If you run your staging application instance in production environment then
# you'll want to override the environment reported by `Rails.env` with an
Expand Down
7 changes: 6 additions & 1 deletion config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ staging:
omniauth_full_host: <%= ENV['OMNIAUTH_FULL_HOST'] %>
google_analytics_token: <%= ENV['GOOGLE_ANALYTICS_TOKEN'] %>
wicked_pdf_proxy: <%= ENV['WICKED_PDF_PROXY'] %>
http_proxy: <%= ENV['HTTP_PROXY'] %>
http_proxy_port: <%= ENV['HTTP_PROXY_PORT'] %>

uat:
secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>
Expand All @@ -85,6 +87,8 @@ uat:
omniauth_full_host: <%= ENV['OMNIAUTH_FULL_HOST'] %>
google_analytics_token: <%= ENV['GOOGLE_ANALYTICS_TOKEN'] %>
wicked_pdf_proxy: <%= ENV['WICKED_PDF_PROXY'] %>
http_proxy: <%= ENV['HTTP_PROXY'] %>
http_proxy_port: <%= ENV['HTTP_PROXY_PORT'] %>

production:
secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>
Expand All @@ -104,4 +108,5 @@ production:
omniauth_full_host: <%= ENV['OMNIAUTH_FULL_HOST'] %>
google_analytics_token: <%= ENV['GOOGLE_ANALYTICS_TOKEN'] %>
wicked_pdf_proxy: <%= ENV['WICKED_PDF_PROXY'] %>

http_proxy: <%= ENV['HTTP_PROXY'] %>
http_proxy_port: <%= ENV['HTTP_PROXY_PORT'] %>

0 comments on commit 0ec78e6

Please sign in to comment.