changeset 262:cd927bb7dc0d

Move out custom application config
author nanaya <me@nanaya.net>
date Mon, 16 Dec 2024 01:39:38 +0900
parents 8c47a69cbfdb
children 2fc76c51e184
files config/application.rb config/initializers/00rsstweet.rb
diffstat 2 files changed, 16 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/config/application.rb	Sun Dec 15 23:01:58 2024 +0900
+++ b/config/application.rb	Mon Dec 16 01:39:38 2024 +0900
@@ -14,8 +14,6 @@
 # require "action_cable/engine"
 require "rails/test_unit/railtie"
 
-require_relative "config_init"
-
 # Require the gems listed in Gemfile, including any gems
 # you've limited to :test, :development, or :production.
 Bundler.require(*Rails.groups)
@@ -37,20 +35,5 @@
     #
     # config.time_zone = "Central Time (US & Canada)"
     # config.eager_load_paths << Rails.root.join("extras")
-
-    # this isn't actually used but railties *production* checks this variable during boot.
-    config.secret_key_base = "herp a derp"
-
-    config.middleware.delete ActionDispatch::HostAuthorization
-    config.middleware.delete ActionDispatch::Cookies
-    config.middleware.delete ActionDispatch::ContentSecurityPolicy::Middleware
-    config.middleware.delete ActionDispatch::PermissionsPolicy::Middleware
-    config.middleware.delete ActionDispatch::RemoteIp
-
-    config.session_store :disabled
-
-    if $cfg[:redis_server]
-      config.cache_store = :redis_cache_store, { url: "#{$cfg[:redis_server]}" }
-    end
   end
 end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/initializers/00rsstweet.rb	Mon Dec 16 01:39:38 2024 +0900
@@ -0,0 +1,16 @@
+require_relative "../config_init"
+
+# this isn't actually used but railties *production* checks this variable during boot.
+Rails.application.config.secret_key_base = "herp a derp"
+
+Rails.application.config.middleware.delete ActionDispatch::HostAuthorization
+Rails.application.config.middleware.delete ActionDispatch::Cookies
+Rails.application.config.middleware.delete ActionDispatch::ContentSecurityPolicy::Middleware
+Rails.application.config.middleware.delete ActionDispatch::PermissionsPolicy::Middleware
+Rails.application.config.middleware.delete ActionDispatch::RemoteIp
+
+Rails.application.config.session_store :disabled
+
+if $cfg[:redis_server]
+  Rails.application.config.cache_store = :redis_cache_store, { url: "#{$cfg[:redis_server]}" }
+end