Websites/config/application.rb

52 lines
2.0 KiB
Ruby
Raw Normal View History

2024-05-03 03:04:43 +00:00
# frozen_string_literal: true
require_relative "boot"
require_relative "../lib/middleware/custom_static_middleware"
require_relative "../lib/middleware/dev_host_middleware"
2024-05-03 03:04:43 +00:00
require "rails/all"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
require_relative "default_config"
require_relative "local_config"
module Websites
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults(7.1)
# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
# Common ones are `templates`, `generators`, or `middleware`, for example.
config.autoload_lib(ignore: %w[assets tasks])
# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
# in config/environments, which are processed later.
#
config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
#
config.autoload_paths += Dir[Rails.root.join(Rails.root.join("config/routes/**/"))]
config.action_controller.action_on_unpermitted_parameters = :raise
config.action_dispatch.default_headers.clear
config.middleware.insert_before(0, DevHostMiddleware) if Rails.env.development?
2024-05-03 03:04:43 +00:00
config.middleware.insert_before(ActionDispatch::Static, CustomStaticMiddleware, {
/^i\.furry\.cool/ => "/furry.cool/images",
/^i\.maidboye\.cafe/ => "/maidboye.cafe/images",
2024-05-03 05:14:00 +00:00
%r{^maidboye\.cafe/images} => "/maidboye.cafe",
2024-05-03 03:04:43 +00:00
%r{^maidboye\.cafe/screenshots} => "/maidboye.cafe",
/^assets\.maidboye\.cafe/ => "/maidboye.cafe/assets",
/^i\.oceanic\.ws/ => "/oceanic.ws/images",
%r{^yiff\.rest/Blep\.png$} => "/yiff.rest",
%r{^yiff\.rocks/mascots} => "/yiff.rocks",
})
end
end