-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathapplication.rb
58 lines (48 loc) · 2.24 KB
/
application.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
require_relative "boot"
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
# require "active_record/railtie"
# require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
# require "action_mailbox/engine"
# require "action_text/engine"
require "action_view/railtie"
# require "action_cable/engine"
require "sprockets/railtie"
require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module SingleCellPortal
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version
config.load_defaults 6.1
config.time_zone = 'Eastern Time (US & Canada)'
config.middleware.use Rack::Brotli
# Docker image for file parsing via scp-ingest-pipeline
config.ingest_docker_image = 'gcr.io/broad-singlecellportal-staging/scp-ingest-pipeline:1.40.1'
# Docker image for image pipeline jobs
config.image_pipeline_docker_image = 'gcr.io/broad-singlecellportal-staging/image-pipeline:0.1.0_c2b090043'
config.autoload_paths << Rails.root.join('lib')
# for all non-prod environments, use the development mixpanel API
config.mixpanel_service_account = 'scp_terra_dev.f25a4f.mp-service-account'
config.mixpanel_project_id = 2085496
# custom exceptions handling to render responses based on controller
# uncaught API errors will now render as JSON responses w/ 500 status
# normal controller errors will show 500 page, except in development environment (will show normal error page)
# lambda allows for inspecting environment, which will include request parameters
config.exceptions_app = lambda do |env|
if env['action_dispatch.original_path']&.include?('api/v1')
Api::V1::ExceptionsController.action(:render_error).call(env)
else
ExceptionsController.action(:render_error).call(env)
end
end
# Google OAuth2 Scopes
# basic scopes are user profile, email, and openid, and do not require user consent to request during auth handshake
BASIC_GOOGLE_SCOPES = %w(email profile userinfo.email userinfo.profile openid)
end
end