The code powering m.abunchtell.com https://m.abunchtell.com
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

137 рядки
3.4 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 '../app/middleware/handle_bad_encoding_middleware'
  8. require_relative '../lib/paperclip/lazy_thumbnail'
  9. require_relative '../lib/paperclip/gif_transcoder'
  10. require_relative '../lib/paperclip/video_transcoder'
  11. require_relative '../lib/paperclip/type_corrector'
  12. require_relative '../lib/mastodon/snowflake'
  13. require_relative '../lib/mastodon/version'
  14. require_relative '../lib/devise/two_factor_ldap_authenticatable'
  15. require_relative '../lib/devise/two_factor_pam_authenticatable'
  16. require_relative '../lib/chewy/strategy/custom_sidekiq'
  17. Dotenv::Railtie.load
  18. Bundler.require(:pam_authentication) if ENV['PAM_ENABLED'] == 'true'
  19. require_relative '../lib/mastodon/redis_config'
  20. module Mastodon
  21. class Application < Rails::Application
  22. # Initialize configuration defaults for originally generated Rails version.
  23. config.load_defaults 5.2
  24. # Settings in config/environments/* take precedence over those specified here.
  25. # Application configuration should go into files in config/initializers
  26. # -- all .rb files in that directory are automatically loaded.
  27. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
  28. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
  29. # config.time_zone = 'Central Time (US & Canada)'
  30. # All translations from config/locales/*.rb,yml are auto loaded.
  31. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
  32. config.i18n.available_locales = [
  33. :ar,
  34. :ast,
  35. :bg,
  36. :bn,
  37. :br,
  38. :ca,
  39. :co,
  40. :cs,
  41. :cy,
  42. :da,
  43. :de,
  44. :el,
  45. :en,
  46. :eo,
  47. :'es-AR',
  48. :es,
  49. :et,
  50. :eu,
  51. :fa,
  52. :fi,
  53. :fr,
  54. :ga,
  55. :gl,
  56. :he,
  57. :hi,
  58. :hr,
  59. :hu,
  60. :hy,
  61. :id,
  62. :io,
  63. :is,
  64. :it,
  65. :ja,
  66. :ka,
  67. :kk,
  68. :kn,
  69. :ko,
  70. :lt,
  71. :lv,
  72. :mk,
  73. :ml,
  74. :mr,
  75. :ms,
  76. :nl,
  77. :nn,
  78. :no,
  79. :oc,
  80. :pl,
  81. :'pt-BR',
  82. :'pt-PT',
  83. :ro,
  84. :ru,
  85. :sk,
  86. :sl,
  87. :sq,
  88. :'sr-Latn',
  89. :sr,
  90. :sv,
  91. :ta,
  92. :te,
  93. :th,
  94. :tr,
  95. :uk,
  96. :ur,
  97. :'zh-CN',
  98. :'zh-HK',
  99. :'zh-TW',
  100. ]
  101. config.i18n.default_locale = ENV['DEFAULT_LOCALE']&.to_sym
  102. unless config.i18n.available_locales.include?(config.i18n.default_locale)
  103. config.i18n.default_locale = :en
  104. end
  105. # config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb')
  106. # config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')]
  107. config.active_job.queue_adapter = :sidekiq
  108. config.middleware.insert_before Rack::Runtime, HandleBadEncodingMiddleware
  109. config.middleware.use Rack::Attack
  110. config.middleware.use Rack::Deflater
  111. config.to_prepare do
  112. Doorkeeper::AuthorizationsController.layout 'modal'
  113. Doorkeeper::AuthorizedApplicationsController.layout 'admin'
  114. Doorkeeper::Application.send :include, ApplicationExtension
  115. Devise::FailureApp.send :include, AbstractController::Callbacks
  116. Devise::FailureApp.send :include, HttpAcceptLanguage::EasyAccess
  117. Devise::FailureApp.send :include, Localized
  118. end
  119. end
  120. end