-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20e389a
commit 6e95cfa
Showing
17 changed files
with
238 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env ruby | ||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
ARGV.unshift("--ensure-latest") | ||
|
||
load Gem.bin_path("brakeman", "brakeman") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env ruby | ||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
# explicit rubocop config increases performance slightly while avoiding config confusion. | ||
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) | ||
|
||
load Gem.bin_path("rubocop", "rubocop") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# frozen_string_literal: true | ||
|
||
# Be sure to restart your server when you modify this file. | ||
# | ||
# This file eases your Rails 7.2 framework defaults upgrade. | ||
# | ||
# Uncomment each configuration one by one to switch to the new default. | ||
# Once your application is ready to run with all new defaults, you can remove | ||
# this file and set the `config.load_defaults` to `7.2`. | ||
# | ||
# Read the Guide for Upgrading Ruby on Rails for more info on each option. | ||
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html | ||
|
||
### | ||
# Controls whether Active Job's `#perform_later` and similar methods automatically defer | ||
# the job queuing to after the current Active Record transaction is committed. | ||
# | ||
# Example: | ||
# Topic.transaction do | ||
# topic = Topic.create(...) | ||
# NewTopicNotificationJob.perform_later(topic) | ||
# end | ||
# | ||
# In this example, if the configuration is set to `:never`, the job will | ||
# be enqueued immediately, even though the `Topic` hasn't been committed yet. | ||
# Because of this, if the job is picked up almost immediately, or if the | ||
# transaction doesn't succeed for some reason, the job will fail to find this | ||
# topic in the database. | ||
# | ||
# If `enqueue_after_transaction_commit` is set to `:default`, the queue adapter | ||
# will define the behaviour. | ||
# | ||
# Note: Active Job backends can disable this feature. This is generally done by | ||
# backends that use the same database as Active Record as a queue, hence they | ||
# don't need this feature. | ||
#++ | ||
# Rails.application.config.active_job.enqueue_after_transaction_commit = :default | ||
|
||
### | ||
# Adds image/webp to the list of content types Active Storage considers as an image | ||
# Prevents automatic conversion to a fallback PNG, and assumes clients support WebP, as they support gif, jpeg, and png. | ||
# This is possible due to broad browser support for WebP, but older browsers and email clients may still not support | ||
# WebP. Requires imagemagick/libvips built with WebP support. | ||
#++ | ||
# Rails.application.config.active_storage.web_image_content_types = %w[image/png image/jpeg image/gif image/webp] | ||
|
||
### | ||
# Enable validation of migration timestamps. When set, an ActiveRecord::InvalidMigrationTimestampError | ||
# will be raised if the timestamp prefix for a migration is more than a day ahead of the timestamp | ||
# associated with the current time. This is done to prevent forward-dating of migration files, which can | ||
# impact migration generation and other migration commands. | ||
# | ||
# Applications with existing timestamped migrations that do not adhere to the | ||
# expected format can disable validation by setting this config to `false`. | ||
#++ | ||
# Rails.application.config.active_record.validate_migration_timestamps = true | ||
|
||
### | ||
# Controls whether the PostgresqlAdapter should decode dates automatically with manual queries. | ||
# | ||
# Example: | ||
# ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.select_value("select '2024-01-01'::date") #=> Date | ||
# | ||
# This query used to return a `String`. | ||
#++ | ||
# Rails.application.config.active_record.postgresql_adapter_decode_dates = true | ||
|
||
### | ||
# Enables YJIT as of Ruby 3.3, to bring sizeable performance improvements. If you are | ||
# deploying to a memory constrained environment you may want to set this to `false`. | ||
#++ | ||
# Rails.application.config.yjit = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,35 @@ | ||
# frozen_string_literal: true | ||
|
||
# Puma can serve each request in a thread from an internal thread pool. | ||
# The `threads` method setting takes two numbers: a minimum and maximum. | ||
# Any libraries that use thread pools should be configured to match | ||
# the maximum value specified for Puma. Default is set to 5 threads for minimum | ||
# and maximum; this matches the default thread size of Active Record. | ||
# | ||
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } | ||
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } | ||
threads min_threads_count, max_threads_count | ||
# This configuration file will be evaluated by Puma. The top-level methods that | ||
# are invoked here are part of Puma's configuration DSL. For more information | ||
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. | ||
|
||
# Specifies the `worker_timeout` threshold that Puma will use to wait before | ||
# terminating a worker in development environments. | ||
# Puma starts a configurable number of processes (workers) and each process | ||
# serves each request in a thread from an internal thread pool. | ||
# | ||
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" | ||
|
||
# Specifies the `port` that Puma will listen on to receive requests; default is 3000. | ||
# The ideal number of threads per worker depends both on how much time the | ||
# application spends waiting for IO operations and on how much you wish to | ||
# to prioritize throughput over latency. | ||
# | ||
port ENV.fetch("PORT") { 3000 } | ||
|
||
# Specifies the `environment` that Puma will run in. | ||
# As a rule of thumb, increasing the number of threads will increase how much | ||
# traffic a given process can handle (throughput), but due to CRuby's | ||
# Global VM Lock (GVL) it has diminishing returns and will degrade the | ||
# response time (latency) of the application. | ||
# | ||
environment ENV.fetch("RAILS_ENV") { "development" } | ||
|
||
# Specifies the `pidfile` that Puma will use. | ||
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } | ||
|
||
# Specifies the number of `workers` to boot in clustered mode. | ||
# Workers are forked web server processes. If using threads and workers together | ||
# the concurrency of the application would be max `threads` * `workers`. | ||
# Workers do not work on JRuby or Windows (both of which do not support | ||
# processes). | ||
# The default is set to 3 threads as it's deemed a decent compromise between | ||
# throughput and latency for the average Rails application. | ||
# | ||
# workers ENV.fetch("WEB_CONCURRENCY") { 2 } | ||
# Any libraries that use a connection pool or another resource pool should | ||
# be configured to provide at least as many connections as the number of | ||
# threads. This includes Active Record's `pool` parameter in `database.yml`. | ||
threads_count = ENV.fetch("RAILS_MAX_THREADS", 3) | ||
threads threads_count, threads_count | ||
|
||
# Use the `preload_app!` method when specifying a `workers` number. | ||
# This directive tells Puma to first boot the application and load code | ||
# before forking the application. This takes advantage of Copy On Write | ||
# process behavior so workers use less memory. | ||
# | ||
# preload_app! | ||
# Specifies the `port` that Puma will listen on to receive requests; default is 3000. | ||
port ENV.fetch("PORT", 3000) | ||
|
||
# Allow puma to be restarted by `rails restart` command. | ||
# Allow puma to be restarted by `bin/rails restart` command. | ||
plugin :tmp_restart | ||
|
||
# Only use a pidfile when requested | ||
pidfile ENV["PIDFILE"] if ENV["PIDFILE"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.