闭社主体 forked from https://github.com/tootsuite/mastodon
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.

18 lines
651 B

  1. # frozen_string_literal: true
  2. port = ENV.fetch('PORT') { 3000 }
  3. host = ENV.fetch('LOCAL_DOMAIN') { "localhost:#{port}" }
  4. https = ENV['LOCAL_HTTPS'] == 'true'
  5. Rails.application.configure do
  6. config.x.local_domain = host
  7. config.x.hub_url = ENV.fetch('HUB_URL') { 'https://pubsubhubbub.superfeedr.com' }
  8. config.x.use_https = https
  9. config.x.use_s3 = ENV['S3_ENABLED'] == 'true'
  10. config.action_mailer.default_url_options = { host: host, protocol: https ? 'https://' : 'http://', trailing_slash: false }
  11. if Rails.env.production?
  12. config.action_cable.allowed_request_origins = ["http#{https ? 's' : ''}://#{host}"]
  13. end
  14. end