Initial commit

This commit is contained in:
Yaser
2026-08-13 19:50:53 +03:30
commit 38084458fe
879 changed files with 95198 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
# encoding: UTF-8
# frozen_string_literal: true
require File.expand_path('../shared', __FILE__)
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports.
config.consider_all_requests_local = true
# Enable/disable caching. By default caching is disabled.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
config.action_controller.perform_caching = true
config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{2.days.to_i}"
}
else
config.action_controller.perform_caching = false
config.cache_store = :redis_cache_store, { driver: :hiredis, url: ENV.fetch('REDIS_URL', 'redis://localhost:6379/1') }
end
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
# Bullet gem config.
config.after_initialize do
Bullet.enable = true if ENV['BULLET'] == 'true'
Bullet.bullet_logger = true
Bullet.add_footer = true
end
end

View File

@@ -0,0 +1,70 @@
# encoding: UTF-8
# frozen_string_literal: true
require File.expand_path('../shared', __FILE__)
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Attempt to read encrypted secrets from `config/secrets.yml.enc`.
# Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
# `config/secrets.yml.key`.
# config.read_encrypted_secrets = true
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = true
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = ENV['FORCE_SECURE_CONNECTION'] == 'true'
# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::JSONLogFormatter.new
# Use a different logger for distributed setups.
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
config.logger = ActiveSupport::TaggedLogging.new(logger)
end
config.logger.formatter = config.log_formatter
# Disable colorize logging in production
config.colorize_logging = false
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
end

View File

@@ -0,0 +1,4 @@
# encoding: UTF-8
# frozen_string_literal: true
Dir[Rails.root.join('config/environments/shared/**/*.rb')].each { |p| require p }

View File

@@ -0,0 +1,10 @@
# encoding: UTF-8
# frozen_string_literal: true
Rails.application.configure do
if ENV.true?("REDIS_CLUSTER")
config.cache_store = :redis_cache_store, { driver: :hiredis, cluster: [ENV.fetch('REDIS_URL')], password: ENV.fetch('REDIS_PASSWORD') }
else
config.cache_store = :redis_cache_store, { driver: :hiredis, url: ENV.fetch('REDIS_URL') }
end
end

View File

@@ -0,0 +1,29 @@
# encoding: UTF-8
# frozen_string_literal: true
Rails.application.configure do
# Available levels (verbosity goes from high to less): debug, info, warn, error, fatal.
# Default level for production is warn, otherwise debug.
log_level = ENV['LOG_LEVEL'].presence || (Rails.env.production? ? :info : :debug)
config.log_formatter = Logger::Formatter.new
# In non-test environments logging always goes to STDOUT since this is the most appropriate way
# to get logs in Docker environment.
unless Rails.env.test?
config.logger = ActiveSupport::Logger.new STDERR, level: log_level
config.logger.formatter = config.log_formatter
end
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# The configuration variables below will be used in case config.logger hasn't been set yet.
# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config.log_level = log_level
end

View File

@@ -0,0 +1,52 @@
# encoding: UTF-8
# frozen_string_literal: true
require File.expand_path('../shared', __FILE__)
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
}
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
routes.default_url_options = { host: 'test.host' }
# Randomize the order test cases are executed.
config.active_support.test_order = :random
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
# Bullet gem config.
config.after_initialize do
Bullet.enable = true if ENV['BULLET'] == 'true'
Bullet.bullet_logger = true
end
end