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.
 
 
 
 

136 lines
3.3 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/lazy_thumbnail'
  8. require_relative '../lib/paperclip/gif_transcoder'
  9. require_relative '../lib/paperclip/video_transcoder'
  10. require_relative '../lib/paperclip/type_corrector'
  11. require_relative '../lib/mastodon/snowflake'
  12. require_relative '../lib/mastodon/version'
  13. require_relative '../lib/devise/two_factor_ldap_authenticatable'
  14. require_relative '../lib/devise/two_factor_pam_authenticatable'
  15. require_relative '../lib/chewy/strategy/custom_sidekiq'
  16. Dotenv::Railtie.load
  17. Bundler.require(:pam_authentication) if ENV['PAM_ENABLED'] == 'true'
  18. require_relative '../lib/mastodon/redis_config'
  19. module Mastodon
  20. class Application < Rails::Application
  21. # Initialize configuration defaults for originally generated Rails version.
  22. config.load_defaults 5.2
  23. # Settings in config/environments/* take precedence over those specified here.
  24. # Application configuration should go into files in config/initializers
  25. # -- all .rb files in that directory are automatically loaded.
  26. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
  27. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
  28. # config.time_zone = 'Central Time (US & Canada)'
  29. # All translations from config/locales/*.rb,yml are auto loaded.
  30. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
  31. config.i18n.available_locales = [
  32. :ar,
  33. :ast,
  34. :bg,
  35. :bn,
  36. :br,
  37. :ca,
  38. :co,
  39. :cs,
  40. :cy,
  41. :da,
  42. :de,
  43. :el,
  44. :en,
  45. :eo,
  46. :'es-AR',
  47. :es,
  48. :et,
  49. :eu,
  50. :fa,
  51. :fi,
  52. :fr,
  53. :ga,
  54. :gl,
  55. :he,
  56. :hi,
  57. :hr,
  58. :hu,
  59. :hy,
  60. :id,
  61. :io,
  62. :is,
  63. :it,
  64. :ja,
  65. :ka,
  66. :kab,
  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.use Rack::Attack
  109. config.middleware.use Rack::Deflater
  110. config.to_prepare do
  111. Doorkeeper::AuthorizationsController.layout 'modal'
  112. Doorkeeper::AuthorizedApplicationsController.layout 'admin'
  113. Doorkeeper::Application.send :include, ApplicationExtension
  114. Devise::FailureApp.send :include, AbstractController::Callbacks
  115. Devise::FailureApp.send :include, HttpAcceptLanguage::EasyAccess
  116. Devise::FailureApp.send :include, Localized
  117. end
  118. end
  119. end