You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
749 B

  1. # frozen_string_literal: true
  2. port = ENV.fetch('PORT') { 3000 }
  3. host = ENV.fetch('LOCAL_DOMAIN') { "localhost:#{port}" }
  4. web_host = ENV.fetch('WEB_DOMAIN') { host }
  5. https = ENV['LOCAL_HTTPS'] == 'true'
  6. Rails.application.configure do
  7. config.x.local_domain = host
  8. config.x.web_domain = web_host
  9. config.x.use_https = https
  10. config.x.use_s3 = ENV['S3_ENABLED'] == 'true'
  11. config.action_mailer.default_url_options = { host: web_host, protocol: https ? 'https://' : 'http://', trailing_slash: false }
  12. config.x.streaming_api_base_url = 'ws://localhost:4000'
  13. if Rails.env.production?
  14. config.x.streaming_api_base_url = ENV.fetch('STREAMING_API_BASE_URL') { "ws#{https ? 's' : ''}://#{web_host}" }
  15. end
  16. end