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.
 
 
 
 

96 lines
2.7 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. require_relative '../lib/paperclip/video_transcoder'
  9. require_relative '../lib/mastodon/snowflake'
  10. require_relative '../lib/mastodon/version'
  11. Dotenv::Railtie.load
  12. require_relative '../lib/mastodon/redis_config'
  13. module Mastodon
  14. class Application < Rails::Application
  15. # Settings in config/environments/* take precedence over those specified here.
  16. # Application configuration should go into files in config/initializers
  17. # -- all .rb files in that directory are automatically loaded.
  18. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
  19. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
  20. # config.time_zone = 'Central Time (US & Canada)'
  21. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
  22. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
  23. config.i18n.available_locales = [
  24. :en,
  25. :ar,
  26. :bg,
  27. :ca,
  28. :de,
  29. :eo,
  30. :es,
  31. :fa,
  32. :fi,
  33. :fr,
  34. :gl,
  35. :he,
  36. :hr,
  37. :hu,
  38. :id,
  39. :io,
  40. :it,
  41. :ja,
  42. :ko,
  43. :nl,
  44. :no,
  45. :oc,
  46. :pl,
  47. :pt,
  48. :'pt-BR',
  49. :ru,
  50. :sk,
  51. :sr,
  52. :'sr-Latn',
  53. :sv,
  54. :th,
  55. :tr,
  56. :uk,
  57. :'zh-CN',
  58. :'zh-HK',
  59. :'zh-TW',
  60. ]
  61. config.i18n.default_locale = :en
  62. # config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb')
  63. # config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')]
  64. config.active_job.queue_adapter = :sidekiq
  65. config.middleware.insert_before 0, Rack::Cors do
  66. allow do
  67. origins '*'
  68. resource '/@:username', headers: :any, methods: [:get], credentials: false
  69. resource '/api/*', headers: :any, methods: [:post, :put, :delete, :get, :patch, :options], credentials: false, expose: ['Link', 'X-RateLimit-Reset', 'X-RateLimit-Limit', 'X-RateLimit-Remaining', 'X-Request-Id']
  70. resource '/oauth/token', headers: :any, methods: [:post], credentials: false
  71. end
  72. end
  73. config.middleware.use Rack::Attack
  74. config.middleware.use Rack::Deflater
  75. config.to_prepare do
  76. Doorkeeper::AuthorizationsController.layout 'modal'
  77. Doorkeeper::AuthorizedApplicationsController.layout 'admin'
  78. Doorkeeper::Application.send :include, ApplicationExtension
  79. end
  80. end
  81. end