The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

55 lines
2.1 KiB

  1. require_relative 'boot'
  2. require 'rails/all'
  3. # Require the gems listed in Gemfile, including any gems
  4. # you've limited to :test, :development, or :production.
  5. Bundler.require(*Rails.groups)
  6. require_relative '../app/lib/exceptions'
  7. require_relative '../lib/paperclip/gif_transcoder'
  8. Dotenv::Railtie.load
  9. module Mastodon
  10. class Application < Rails::Application
  11. # Settings in config/environments/* take precedence over those specified here.
  12. # Application configuration should go into files in config/initializers
  13. # -- all .rb files in that directory are automatically loaded.
  14. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
  15. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
  16. # config.time_zone = 'Central Time (US & Canada)'
  17. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
  18. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
  19. config.i18n.available_locales = [:en, :de, :es, :pt, :fr, :hu, :uk]
  20. config.i18n.default_locale = :en
  21. # config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb')
  22. # config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')]
  23. config.active_job.queue_adapter = :sidekiq
  24. config.middleware.insert_before 0, Rack::Cors do
  25. allow do
  26. origins '*'
  27. resource '/api/*', headers: :any, methods: [:post, :put, :delete, :get, :options], credentials: false, expose: ['Link', 'X-RateLimit-Reset', 'X-RateLimit-Limit', 'X-RateLimit-Remaining', 'X-Request-Id']
  28. resource '/oauth/token', headers: :any, methods: [:post], credentials: false
  29. end
  30. end
  31. config.middleware.use Rack::Attack
  32. config.middleware.use Rack::Deflater
  33. config.browserify_rails.commandline_options = '--transform [ babelify --presets [ es2015 react ] ] --extension=".jsx"'
  34. config.to_prepare do
  35. Doorkeeper::AuthorizationsController.layout 'public'
  36. Doorkeeper::AuthorizedApplicationsController.layout 'admin'
  37. Doorkeeper::Application.send :include, ApplicationExtension
  38. end
  39. end
  40. end