]> cat aescling's git repositories - mastodon.git/blob - config/application.rb
i18n: Update Polish translation (#4613)
[mastodon.git] / config / application.rb
1 require_relative 'boot'
2
3 require 'rails/all'
4
5 # Require the gems listed in Gemfile, including any gems
6 # you've limited to :test, :development, or :production.
7 Bundler.require(*Rails.groups)
8
9 require_relative '../app/lib/exceptions'
10 require_relative '../lib/paperclip/gif_transcoder'
11 require_relative '../lib/paperclip/video_transcoder'
12 require_relative '../lib/mastodon/version'
13
14 Dotenv::Railtie.load
15
16 require_relative '../lib/mastodon/redis_config'
17
18 module Mastodon
19 class Application < Rails::Application
20 # Settings in config/environments/* take precedence over those specified here.
21 # Application configuration should go into files in config/initializers
22 # -- all .rb files in that directory are automatically loaded.
23
24 # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25 # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26 # config.time_zone = 'Central Time (US & Canada)'
27
28 # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29 # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30 config.i18n.available_locales = [
31 :en,
32 :ar,
33 :bg,
34 :ca,
35 :de,
36 :eo,
37 :es,
38 :fa,
39 :fi,
40 :fr,
41 :he,
42 :hr,
43 :hu,
44 :id,
45 :io,
46 :it,
47 :ja,
48 :ko,
49 :nl,
50 :no,
51 :oc,
52 :pl,
53 :pt,
54 :'pt-BR',
55 :ru,
56 :th,
57 :tr,
58 :uk,
59 :'zh-CN',
60 :'zh-HK',
61 :'zh-TW',
62 ]
63
64 config.i18n.default_locale = :en
65
66 # config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb')
67 # config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')]
68
69 config.active_job.queue_adapter = :sidekiq
70
71 config.middleware.insert_before 0, Rack::Cors do
72 allow do
73 origins '*'
74 resource '/@:username', headers: :any, methods: [:get], credentials: false
75 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']
76 resource '/oauth/token', headers: :any, methods: [:post], credentials: false
77 end
78 end
79
80 config.middleware.use Rack::Attack
81 config.middleware.use Rack::Deflater
82
83 config.to_prepare do
84 Doorkeeper::AuthorizationsController.layout 'modal'
85 Doorkeeper::AuthorizedApplicationsController.layout 'admin'
86 Doorkeeper::Application.send :include, ApplicationExtension
87 end
88 end
89 end
This page took 0.069232 seconds and 4 git commands to generate.