about summary refs log tree commit diff
path: root/config/environments/development.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-03-16 23:12:59 +0100
committerClaire <claire.github-309c@sitedethib.com>2023-03-16 23:12:59 +0100
commit193250556cb4e6b1b3e2f9bd1ac023b290176fd4 (patch)
tree3bd6148ff028b8fe089cae9d805a7e587eaeec11 /config/environments/development.rb
parentf5daa20f2a90098c9d689c5ec9d95ce9887b3a33 (diff)
parent681dcd3fa35e886a21853ca829ff1be7f220e83a (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Upstream changed their README, we have our own.
  Kept ours.
- `app/helpers/application_helper.rb`:
  Minor code style fix upstream, on a line that is different in glitch-soc
  due to the different theming system.
  Applied the code style fix to our own code.
- `app/views/settings/preferences/appearance/show.html.haml`:
  Code style fix on a line next to lines exclusive to glitch-soc.
  Applied upstream changes.
- `yarn.lock`:
  Upstream updated a dependency textually close to a glitch-soc-only
  dependency.
  Updated the dependency like upstream did.
Diffstat (limited to 'config/environments/development.rb')
-rw-r--r--config/environments/development.rb31
1 files changed, 6 insertions, 25 deletions
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 29b17a350..a633dfce5 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -16,15 +16,9 @@ Rails.application.configure do
   # Run rails dev:cache to toggle caching.
   if Rails.root.join('tmp/caching-dev.txt').exist?
     config.action_controller.perform_caching = true
-
     config.cache_store = :redis_cache_store, REDIS_CACHE_PARAMS
-
-    config.public_file_server.headers = {
-      'Cache-Control' => "public, max-age=#{2.days.to_i}",
-    }
   else
     config.action_controller.perform_caching = false
-
     config.cache_store = :null_store
   end
 
@@ -34,9 +28,10 @@ Rails.application.configure do
   end
 
   # Generate random VAPID keys
-  vapid_key = Webpush.generate_key
-  config.x.vapid_private_key = vapid_key.private_key
-  config.x.vapid_public_key = vapid_key.public_key
+  Webpush.generate_key.tap do |vapid_key|
+    config.x.vapid_private_key = vapid_key.private_key
+    config.x.vapid_public_key = vapid_key.public_key
+  end
 
   # Don't care if the mailer can't send.
   config.action_mailer.raise_delivery_errors = false
@@ -76,23 +71,9 @@ Rails.application.configure do
   # Otherwise, use letter_opener, which launches a browser window to view sent mail.
   config.action_mailer.delivery_method = (ENV['HEROKU'] || ENV['VAGRANT'] || ENV['REMOTE_DEV']) ? :letter_opener_web : :letter_opener
 
-  config.after_initialize do
-    Bullet.enable        = true
-    Bullet.bullet_logger = true
-    Bullet.rails_logger  = false
-
-    Bullet.add_safelist type: :n_plus_one_query, class_name: 'User', association: :account
-  end
-
+  # We provide a default secret for the development environment here.
+  # This value should not be used in production environments!
   config.x.otp_secret = ENV.fetch('OTP_SECRET', '1fc2b87989afa6351912abeebe31ffc5c476ead9bf8b3d74cbc4a302c7b69a45b40b1bbef3506ddad73e942e15ed5ca4b402bf9a66423626051104f4b5f05109')
 end
 
 Redis.raise_deprecations = true
-
-ActiveRecordQueryTrace.enabled = ENV['QUERY_TRACE_ENABLED'] == 'true'
-
-module PrivateAddressCheck
-  def self.private_address?(*)
-    false
-  end
-end