From ec59eb2be2c74a7eebb495d29a595e3a1055831a Mon Sep 17 00:00:00 2001 From: olegphenomenon Date: Mon, 13 Dec 2021 15:08:37 +0200 Subject: [PATCH] added demo env to registry --- config/cable.yml | 5 ++ config/database.yml.sample | 4 ++ config/database_development.yml.sample | 4 ++ config/database_registrant.yml.sample | 7 ++ config/database_travis.yml | 4 ++ config/environments/demo.rb | 89 ++++++++++++++++++++++++++ config/newrelic.yml | 3 + config/secrets.yml | 3 + 8 files changed, 119 insertions(+) create mode 100644 config/environments/demo.rb diff --git a/config/cable.yml b/config/cable.yml index 858bb1f14..bf6cd91f1 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -8,3 +8,8 @@ production: adapter: redis url: redis://localhost:6379/1 channel_prefix: domain_name_registry_production + +demo: + adapter: redis + url: redis://localhost:6379/1 + channel_prefix: domain_name_registry_demo diff --git a/config/database.yml.sample b/config/database.yml.sample index a3eab11ed..54c01fa6b 100644 --- a/config/database.yml.sample +++ b/config/database.yml.sample @@ -19,6 +19,10 @@ staging: <<: *default database: registry_staging +demo: + <<: *default + database: registry_demo + whois_staging: <<: *default database: registry_whois_staging diff --git a/config/database_development.yml.sample b/config/database_development.yml.sample index ba798d7e0..06b433e69 100644 --- a/config/database_development.yml.sample +++ b/config/database_development.yml.sample @@ -29,3 +29,7 @@ whois_test: api_log_test: <<: *default database: registry_api_log_test + +demo: + <<: *default + database: registry_demo diff --git a/config/database_registrant.yml.sample b/config/database_registrant.yml.sample index 7aaaf9216..9d4aec67f 100644 --- a/config/database_registrant.yml.sample +++ b/config/database_registrant.yml.sample @@ -35,3 +35,10 @@ production: host: localhost # registry production mirror location username: registrant_read_only password: registrant_read_only_pwd + +demo: + <<: *default + database: registry_demo # registry production mirror database name + host: localhost # registry production mirror location + username: registrant_read_only + password: registrant_read_only_pwd diff --git a/config/database_travis.yml b/config/database_travis.yml index 48ffd5e27..6170007df 100644 --- a/config/database_travis.yml +++ b/config/database_travis.yml @@ -10,6 +10,10 @@ test: <<: *default database: registry_test +demo: + <<: *default + database: registry_demo + whois_test: <<: *default database: registry_whois_test diff --git a/config/environments/demo.rb b/config/environments/demo.rb new file mode 100644 index 000000000..2825185d0 --- /dev/null +++ b/config/environments/demo.rb @@ -0,0 +1,89 @@ +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 + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. + # config.action_dispatch.rack_cache = true + + config.public_file_server.enabled = false + + # Compress JavaScripts and CSS. + config.assets.js_compressor = Uglifier.new(harmony: true) + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # 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 + + # Mount Action Cable outside main process or domain + # config.action_cable.mount_path = nil + # config.action_cable.url = 'wss://example.com/cable' + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + config.force_ssl = false + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + config.log_tags = [:request_id, :subdomain, :remote_ip] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment) + config.active_job.queue_adapter = :sidekiq + # config.active_job.queue_name_prefix = "domain_name_registry_#{Rails.env}" + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # 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 = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + require 'syslog/logger' + config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new(ENV['app_name'] || 'registry')) + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/config/newrelic.yml b/config/newrelic.yml index 7f9f556cf..02eb5c701 100644 --- a/config/newrelic.yml +++ b/config/newrelic.yml @@ -45,6 +45,9 @@ staging: app_name: Registry (Staging) monitor_mode: false +demo: + <<: *default_settings + monitor_mode: false production: <<: *default_settings diff --git a/config/secrets.yml b/config/secrets.yml index 5a3114b22..46432763b 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -20,3 +20,6 @@ test: # instead read values from the environment. production: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> + +demo: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>