added 260907 version of worker toolkit
This commit is contained in:
70
worker-toolkit-flaredown/repo/backend/config/application.rb
Normal file
70
worker-toolkit-flaredown/repo/backend/config/application.rb
Normal file
@@ -0,0 +1,70 @@
|
||||
require_relative "boot"
|
||||
|
||||
require "rails"
|
||||
# Pick the frameworks you want:
|
||||
require "active_model/railtie"
|
||||
require "active_job/railtie"
|
||||
require "active_record/railtie"
|
||||
# require "active_storage/engine"
|
||||
require "action_controller/railtie"
|
||||
require "action_mailer/railtie"
|
||||
require "sprockets/railtie"
|
||||
# require "action_mailbox/engine"
|
||||
# require "action_text/engine"
|
||||
require "action_view/railtie"
|
||||
# require "action_cable/engine"
|
||||
# require "rails/test_unit/railtie"
|
||||
|
||||
# Require the gems listed in Gemfile, including any gems
|
||||
# you've limited to :test, :development, or :production.
|
||||
Bundler.require(*Rails.groups)
|
||||
|
||||
module Flaredown
|
||||
class Application < Rails::Application
|
||||
# Initialize configuration defaults for originally generated Rails version.
|
||||
config.load_defaults 7.1
|
||||
config.add_autoload_paths_to_load_path = false
|
||||
config.active_support.cache_format_version = 7.1
|
||||
|
||||
# https://medium.com/@Nicholson85/handling-cors-issues-in-your-rails-api-120dfbcb8a24
|
||||
# fix CORS issues in staging?
|
||||
config.middleware.insert_before 0, Rack::Cors do
|
||||
allow do
|
||||
origins "*"
|
||||
resource "*", headers: :any, methods: [:get, :post, :put, :patch, :delete, :options, :head]
|
||||
end
|
||||
end
|
||||
|
||||
config.add_autoload_paths_to_load_path = false
|
||||
|
||||
# Please, add to the `ignore` list any other `lib` subdirectories that do
|
||||
# not contain `.rb` files, or that should not be reloaded or eager loaded.
|
||||
# Common ones are `templates`, `generators`, or `middleware`, for example.
|
||||
config.autoload_lib(ignore: %w[assets tasks])
|
||||
|
||||
# Configuration for the application, engines, and railties goes here.
|
||||
#
|
||||
# These settings can be overridden in specific environments using the files
|
||||
# in config/environments, which are processed later.
|
||||
#
|
||||
# config.time_zone = "Central Time (US & Canada)"
|
||||
# config.eager_load_paths << Rails.root.join("extras")
|
||||
|
||||
# Don't generate system test files.
|
||||
config.generators.system_tests = nil
|
||||
|
||||
# Only loads a smaller set of middleware suitable for API only apps.
|
||||
# Middleware like session, flash, cookies can be added back manually.
|
||||
# Skip views, helpers and assets when generating a new resource.
|
||||
config.api_only = false
|
||||
|
||||
config.generators.orm :active_record
|
||||
|
||||
config.active_record.schema_format = :sql
|
||||
|
||||
# Be sure to have the adapter's gem in your Gemfile
|
||||
# and follow the adapter's specific installation
|
||||
# and deployment instructions.
|
||||
config.active_job.queue_adapter = :sidekiq
|
||||
end
|
||||
end
|
||||
3
worker-toolkit-flaredown/repo/backend/config/boot.rb
Normal file
3
worker-toolkit-flaredown/repo/backend/config/boot.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
||||
|
||||
require "bundler/setup" # Set up gems listed in the Gemfile.
|
||||
5
worker-toolkit-flaredown/repo/backend/config/cronotab.rb
Normal file
5
worker-toolkit-flaredown/repo/backend/config/cronotab.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require "rake"
|
||||
|
||||
Rails.app_class.load_tasks
|
||||
|
||||
Crono.perform(NotificationDispatcher).every(3.minutes)
|
||||
22
worker-toolkit-flaredown/repo/backend/config/database.yml
Normal file
22
worker-toolkit-flaredown/repo/backend/config/database.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
default: &default
|
||||
adapter: postgresql
|
||||
encoding: unicode
|
||||
host: <%= ENV.fetch('PG_DATABASE_HOST') { 'localhost' } %>
|
||||
database: flaredown_development
|
||||
username: <%= ENV.fetch('PG_DATABASE_USERNAME') { 'postgres' } %>
|
||||
password: password
|
||||
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
||||
timeout: 5000
|
||||
|
||||
development:
|
||||
<<: *default
|
||||
database: flaredown_development
|
||||
|
||||
test:
|
||||
<<: *default
|
||||
database: flaredown_test
|
||||
|
||||
production:
|
||||
<<: *default
|
||||
host: <%= ENV.fetch('PG_DATABASE_HOST') { 'localhost' } %>
|
||||
pool: <%= ENV.fetch('DB_POOL') { 30 } %>
|
||||
@@ -0,0 +1,5 @@
|
||||
# Load the Rails application.
|
||||
require_relative "application"
|
||||
|
||||
# Initialize the Rails application.
|
||||
Rails.application.initialize!
|
||||
@@ -0,0 +1,83 @@
|
||||
require "active_support/core_ext/integer/time"
|
||||
|
||||
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 any time
|
||||
# it changes. 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.enable_reloading = true
|
||||
|
||||
# Do not eager load code on boot.
|
||||
config.eager_load = false
|
||||
|
||||
# Show full error reports.
|
||||
config.consider_all_requests_local = true
|
||||
|
||||
# Enable server timing
|
||||
config.server_timing = true
|
||||
|
||||
# Enable/disable caching. By default caching is disabled.
|
||||
# Run rails dev:cache to toggle caching.
|
||||
if Rails.root.join("tmp/caching-dev.txt").exist?
|
||||
config.action_controller.perform_caching = true
|
||||
config.action_controller.enable_fragment_cache_logging = 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 = :null_store
|
||||
end
|
||||
|
||||
# Don't care if the mailer can't send.
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
config.action_mailer.perform_caching = false
|
||||
|
||||
# Print deprecation notices to the Rails logger.
|
||||
config.active_support.deprecation = :log
|
||||
|
||||
# Raise exceptions for disallowed deprecations.
|
||||
config.active_support.disallowed_deprecation = :raise
|
||||
|
||||
# Tell Active Support which deprecation messages to disallow.
|
||||
config.active_support.disallowed_deprecation_warnings = []
|
||||
|
||||
# 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
|
||||
|
||||
# Highlight code that enqueued background job in logs.
|
||||
config.active_job.verbose_enqueue_logs = true
|
||||
|
||||
# Suppress logger output for asset requests.
|
||||
config.assets.quiet = true
|
||||
|
||||
# Raises error for missing translations.
|
||||
config.i18n.raise_on_missing_translations = true
|
||||
|
||||
# Annotate rendered view with file names.
|
||||
# config.action_view.annotate_rendered_view_with_filenames = true
|
||||
|
||||
# Raise error when a before_action's only/except options reference missing actions
|
||||
config.action_controller.raise_on_missing_callback_actions = true
|
||||
|
||||
# Delivery with letter opener
|
||||
config.action_mailer.delivery_method = :letter_opener
|
||||
|
||||
config.after_initialize do
|
||||
Bullet.enable = true
|
||||
Bullet.alert = true
|
||||
Bullet.bullet_logger = true
|
||||
Bullet.console = true
|
||||
# Bullet.growl = true
|
||||
Bullet.rails_logger = true
|
||||
Bullet.add_footer = true
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,89 @@
|
||||
require "active_support/core_ext/integer/time"
|
||||
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
# Code is not reloaded between requests.
|
||||
config.enable_reloading = false
|
||||
|
||||
# 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
|
||||
|
||||
# Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
|
||||
# key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
|
||||
# config.require_master_key = true
|
||||
|
||||
# Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
|
||||
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
|
||||
|
||||
# Compress CSS using a preprocessor.
|
||||
# config.assets.css_compressor = :sass
|
||||
|
||||
# Do not fall back to assets pipeline if a precompiled asset is missed.
|
||||
config.assets.compile = false
|
||||
|
||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||
# config.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
|
||||
|
||||
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
|
||||
# Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
|
||||
# config.assume_ssl = true
|
||||
|
||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||
config.force_ssl = true
|
||||
|
||||
# Log to STDOUT by default
|
||||
config.logger = ActiveSupport::Logger.new($stdout)
|
||||
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
|
||||
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
|
||||
|
||||
# Prepend all log lines with the following tags.
|
||||
config.log_tags = [:request_id]
|
||||
|
||||
# "info" includes generic and useful information about system operation, but avoids logging too much
|
||||
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
|
||||
# want to log everything, set the level to "debug".
|
||||
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "debug")
|
||||
|
||||
# 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 = :resque
|
||||
# config.active_job.queue_name_prefix = "flaredown_production"
|
||||
|
||||
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. (false by default)
|
||||
config.active_support.report_deprecations = :notify
|
||||
|
||||
# Do not dump schema after migrations.
|
||||
config.active_record.dump_schema_after_migration = false
|
||||
|
||||
# Enable DNS rebinding protection and other `Host` header attacks.
|
||||
# config.hosts = [
|
||||
# "example.com", # Allow requests from example.com
|
||||
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
|
||||
# ]
|
||||
# Skip DNS rebinding protection for the default health check endpoint.
|
||||
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
|
||||
end
|
||||
@@ -0,0 +1,67 @@
|
||||
require "active_support/core_ext/integer/time"
|
||||
|
||||
# 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!
|
||||
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
# While tests run files are not watched, reloading is not necessary.
|
||||
config.enable_reloading = false
|
||||
|
||||
# Eager loading loads your entire application. When running a single test locally,
|
||||
# this is usually not necessary, and can slow down your test suite. However, it's
|
||||
# recommended that you enable it in continuous integration systems to ensure eager
|
||||
# loading is working properly before deploying your code.
|
||||
config.eager_load = ENV["CI"].present?
|
||||
|
||||
# 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
|
||||
config.cache_store = :null_store
|
||||
|
||||
# Render exception templates for rescuable exceptions and raise for other exceptions.
|
||||
config.action_dispatch.show_exceptions = :rescuable
|
||||
|
||||
# Disable request forgery protection in test environment.
|
||||
config.action_controller.allow_forgery_protection = false
|
||||
|
||||
config.action_mailer.perform_caching = false
|
||||
|
||||
# Tell Action Mailer not to deliver emails to the real world.
|
||||
# The :test delivery method accumulates sent emails in the
|
||||
# ActionMailer::Base.deliveries array.
|
||||
config.action_mailer.delivery_method = :test
|
||||
|
||||
# Print deprecation notices to the stderr.
|
||||
config.active_support.deprecation = :stderr
|
||||
|
||||
# Raise exceptions for disallowed deprecations.
|
||||
config.active_support.disallowed_deprecation = :raise
|
||||
|
||||
# Tell Active Support which deprecation messages to disallow.
|
||||
config.active_support.disallowed_deprecation_warnings = []
|
||||
|
||||
# Raises error for missing translations.
|
||||
# config.i18n.raise_on_missing_translations = true
|
||||
|
||||
# Annotate rendered view with file names.
|
||||
# config.action_view.annotate_rendered_view_with_filenames = true
|
||||
|
||||
# Raise error when a before_action's only/except options reference missing actions
|
||||
config.action_controller.raise_on_missing_callback_actions = true
|
||||
|
||||
config.after_initialize do
|
||||
Bullet.enable = true
|
||||
Bullet.bullet_logger = true
|
||||
Bullet.raise = true # raise an error if n+1 query occurs
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,29 @@
|
||||
module Flaredown
|
||||
def self.config
|
||||
Flaredown::Settings.instance
|
||||
end
|
||||
|
||||
def self.pusher
|
||||
PusherClient.instance
|
||||
end
|
||||
|
||||
class Settings
|
||||
include Singleton
|
||||
|
||||
def redis_url
|
||||
ENV["REDISCLOUD_URL"].present? ? ENV["REDISCLOUD_URL"] : ENV["REDIS_URL"]
|
||||
end
|
||||
|
||||
def trackables_min_popularity
|
||||
3
|
||||
end
|
||||
|
||||
def discourse_enabled?
|
||||
Rails.env.production? || ENV.fetch("DISCOURSE_ENABLED") { false }
|
||||
end
|
||||
|
||||
def discourse_url
|
||||
ENV.fetch("DISCOURSE_URL")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,10 @@
|
||||
ActionMailer::Base.default_url_options = {host: ENV["BASE_URL"]}
|
||||
|
||||
ActionMailer::Base.smtp_settings = {
|
||||
port: ENV["SMTP_PORT"],
|
||||
address: ENV["SMTP_ADDRESS"],
|
||||
user_name: ENV["SMTP_USER"],
|
||||
password: ENV["SMTP_PASS"],
|
||||
domain: ENV["SMTP_DOMAIN"],
|
||||
authentication: :login
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
ActiveModel::Serializer.setup do |config|
|
||||
config.embed = :ids
|
||||
config.embed_in_root = false
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# ApplicationController.renderer.defaults.merge!(
|
||||
# http_host: 'example.org',
|
||||
# https: false
|
||||
# )
|
||||
@@ -0,0 +1,12 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Version of your assets, change this if you want to expire all your assets.
|
||||
Rails.application.config.assets.version = "1.0"
|
||||
|
||||
# Add additional assets to the asset load path.
|
||||
# Rails.application.config.assets.paths << Emoji.images_path
|
||||
|
||||
# Precompile additional assets.
|
||||
# application.js, application.css, and all non-JS/CSS in the app/assets
|
||||
# folder are already added.
|
||||
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
||||
@@ -0,0 +1,7 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
||||
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
||||
|
||||
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
||||
# Rails.backtrace_cleaner.remove_silencers!
|
||||
@@ -0,0 +1,4 @@
|
||||
Bugsnag.configure do |config|
|
||||
config.api_key = ENV["BUGSNAG_API_KEY"]
|
||||
config.release_stage = ENV["BUGSNAG_RELEASE_STAGE"] || ENV["RAILS_ENV"]
|
||||
end
|
||||
@@ -0,0 +1,25 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Define an application-wide content security policy.
|
||||
# See the Securing Rails Applications Guide for more information:
|
||||
# https://guides.rubyonrails.org/security.html#content-security-policy-header
|
||||
|
||||
# Rails.application.configure do
|
||||
# config.content_security_policy do |policy|
|
||||
# policy.default_src :self, :https
|
||||
# policy.font_src :self, :https, :data
|
||||
# policy.img_src :self, :https, :data
|
||||
# policy.object_src :none
|
||||
# policy.script_src :self, :https
|
||||
# policy.style_src :self, :https
|
||||
# # Specify URI for violation reports
|
||||
# # policy.report_uri "/csp-violation-report-endpoint"
|
||||
# end
|
||||
#
|
||||
# # Generate session nonces for permitted importmap, inline scripts, and inline styles.
|
||||
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
||||
# config.content_security_policy_nonce_directives = %w(script-src style-src)
|
||||
#
|
||||
# # Report violations without enforcing the policy.
|
||||
# # config.content_security_policy_report_only = true
|
||||
# end
|
||||
@@ -0,0 +1,275 @@
|
||||
# Use this hook to configure devise mailer, warden hooks and so forth.
|
||||
# Many of these configuration options can be set straight in your model.
|
||||
Devise.setup do |config|
|
||||
# The secret key used by Devise. Devise uses this key to generate
|
||||
# random tokens. Changing this key will render invalid all existing
|
||||
# confirmation, reset password and unlock tokens in the database.
|
||||
config.secret_key = ENV["DEVISE_SECRET_KEY"]
|
||||
|
||||
# ==> Mailer Configuration
|
||||
# Configure the e-mail address which will be shown in Devise::Mailer,
|
||||
# note that it will be overwritten if you use your own mailer class
|
||||
# with default "from" parameter.
|
||||
config.mailer_sender = ENV["SMTP_EMAIL_FROM"]
|
||||
|
||||
# Configure the class responsible to send e-mails.
|
||||
# config.mailer = 'Devise::Mailer'
|
||||
|
||||
# ==> ORM configuration
|
||||
# Load and configure the ORM. Supports :active_record (default) and
|
||||
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
||||
# available as additional gems.
|
||||
require "devise/orm/active_record"
|
||||
|
||||
# ==> Configuration for any authentication mechanism
|
||||
# Configure which keys are used when authenticating a user. The default is
|
||||
# just :email. You can configure it to use [:username, :subdomain], so for
|
||||
# authenticating a user, both parameters are required. Remember that those
|
||||
# parameters are used only when authenticating and not when retrieving from
|
||||
# session. If you need permissions, you should implement that in a before filter.
|
||||
# You can also supply a hash where the value is a boolean determining whether
|
||||
# or not authentication should be aborted when the value is not present.
|
||||
# config.authentication_keys = [:email]
|
||||
|
||||
# Configure parameters from the request object used for authentication. Each entry
|
||||
# given should be a request method and it will automatically be passed to the
|
||||
# find_for_authentication method and considered in your model lookup. For instance,
|
||||
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
||||
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
||||
# config.request_keys = []
|
||||
|
||||
# Configure which authentication keys should be case-insensitive.
|
||||
# These keys will be downcased upon creating or modifying a user and when used
|
||||
# to authenticate or find a user. Default is :email.
|
||||
config.case_insensitive_keys = [:email]
|
||||
|
||||
# Configure which authentication keys should have whitespace stripped.
|
||||
# These keys will have whitespace before and after removed upon creating or
|
||||
# modifying a user and when used to authenticate or find a user. Default is :email.
|
||||
config.strip_whitespace_keys = [:email]
|
||||
|
||||
# Tell if authentication through request.params is enabled. True by default.
|
||||
# It can be set to an array that will enable params authentication only for the
|
||||
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
||||
# enable it only for database (email + password) authentication.
|
||||
# config.params_authenticatable = true
|
||||
|
||||
# Tell if authentication through HTTP Auth is enabled. False by default.
|
||||
# It can be set to an array that will enable http authentication only for the
|
||||
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
||||
# enable it only for database authentication. The supported strategies are:
|
||||
# :database = Support basic authentication with authentication key + password
|
||||
# config.http_authenticatable = false
|
||||
|
||||
# If 401 status code should be returned for AJAX requests. True by default.
|
||||
# config.http_authenticatable_on_xhr = true
|
||||
|
||||
# The realm used in Http Basic Authentication. 'Application' by default.
|
||||
# config.http_authentication_realm = 'Application'
|
||||
|
||||
# It will change confirmation, password recovery and other workflows
|
||||
# to behave the same regardless if the e-mail provided was right or wrong.
|
||||
# Does not affect registerable.
|
||||
# config.paranoid = true
|
||||
|
||||
# By default Devise will store the user in session. You can skip storage for
|
||||
# particular strategies by setting this option.
|
||||
# Notice that if you are skipping storage for all authentication paths, you
|
||||
# may want to disable generating routes to Devise's sessions controller by
|
||||
# passing skip: :sessions to `devise_for` in your config/routes.rb
|
||||
config.skip_session_storage = [:http_auth]
|
||||
|
||||
# By default, Devise cleans up the CSRF token on authentication to
|
||||
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
||||
# requests for sign in and sign up, you need to get a new CSRF token
|
||||
# from the server. You can disable this option at your own risk.
|
||||
# config.clean_up_csrf_token_on_authentication = true
|
||||
|
||||
# ==> Configuration for :database_authenticatable
|
||||
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
||||
# using other encryptors, it sets how many times you want the password re-encrypted.
|
||||
#
|
||||
# Limiting the stretches to just one in testing will increase the performance of
|
||||
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
||||
# a value less than 10 in other environments. Note that, for bcrypt (the default
|
||||
# encryptor), the cost increases exponentially with the number of stretches (e.g.
|
||||
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
||||
config.stretches = Rails.env.test? ? 1 : 10
|
||||
|
||||
# Setup a pepper to generate the encrypted password.
|
||||
# config.pepper = 'ca92d5fa25e7593c7cf72566cd0cdea4ddd2a6ef63b776972f8e76eb286c82500fa98806f9a43a1530c6b9f2227664b'
|
||||
|
||||
# Send a notification email when the user's password is changed
|
||||
# config.send_password_change_notification = false
|
||||
|
||||
# ==> Configuration for :confirmable
|
||||
# A period that the user is allowed to access the website even without
|
||||
# confirming their account. For instance, if set to 2.days, the user will be
|
||||
# able to access the website for two days without confirming their account,
|
||||
# access will be blocked just in the third day. Default is 0.days, meaning
|
||||
# the user cannot access the website without confirming their account.
|
||||
# config.allow_unconfirmed_access_for = 2.days
|
||||
|
||||
# A period that the user is allowed to confirm their account before their
|
||||
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
||||
# their account within 3 days after the mail was sent, but on the fourth day
|
||||
# their account can't be confirmed with the token any more.
|
||||
# Default is nil, meaning there is no restriction on how long a user can take
|
||||
# before confirming their account.
|
||||
# config.confirm_within = 3.days
|
||||
|
||||
# If true, requires any email changes to be confirmed (exactly the same way as
|
||||
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
||||
# db field (see migrations). Until confirmed, new email is stored in
|
||||
# unconfirmed_email column, and copied to email column on successful confirmation.
|
||||
config.reconfirmable = true
|
||||
|
||||
# Defines which key will be used when confirming an account
|
||||
# config.confirmation_keys = [:email]
|
||||
|
||||
# ==> Configuration for :rememberable
|
||||
# The time the user will be remembered without asking for credentials again.
|
||||
# config.remember_for = 2.weeks
|
||||
|
||||
# Invalidates all the remember me tokens when the user signs out.
|
||||
config.expire_all_remember_me_on_sign_out = true
|
||||
|
||||
# If true, extends the user's remember period when remembered via cookie.
|
||||
# config.extend_remember_period = false
|
||||
|
||||
# Options to be passed to the created cookie. For instance, you can set
|
||||
# secure: true in order to force SSL only cookies.
|
||||
# config.rememberable_options = {}
|
||||
|
||||
# ==> Configuration for :validatable
|
||||
# Range for password length.
|
||||
config.password_length = 8..128
|
||||
|
||||
# Email regex used to validate email formats. It simply asserts that
|
||||
# one (and only one) @ exists in the given string. This is mainly
|
||||
# to give user feedback and not to assert the e-mail validity.
|
||||
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
||||
|
||||
# ==> Configuration for :timeoutable
|
||||
# The time you want to timeout the user session without activity. After this
|
||||
# time the user will be asked for credentials again. Default is 30 minutes.
|
||||
# config.timeout_in = 30.minutes
|
||||
|
||||
# ==> Configuration for :lockable
|
||||
# Defines which strategy will be used to lock an account.
|
||||
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
||||
# :none = No lock strategy. You should handle locking by yourself.
|
||||
# config.lock_strategy = :failed_attempts
|
||||
|
||||
# Defines which key will be used when locking and unlocking an account
|
||||
# config.unlock_keys = [:email]
|
||||
|
||||
# Defines which strategy will be used to unlock an account.
|
||||
# :email = Sends an unlock link to the user email
|
||||
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
||||
# :both = Enables both strategies
|
||||
# :none = No unlock strategy. You should handle unlocking by yourself.
|
||||
# config.unlock_strategy = :both
|
||||
|
||||
# Number of authentication tries before locking an account if lock_strategy
|
||||
# is failed attempts.
|
||||
# config.maximum_attempts = 20
|
||||
|
||||
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
||||
# config.unlock_in = 1.hour
|
||||
|
||||
# Warn on the last attempt before the account is locked.
|
||||
# config.last_attempt_warning = true
|
||||
|
||||
# ==> Configuration for :recoverable
|
||||
#
|
||||
# Defines which key will be used when recovering the password for an account
|
||||
# config.reset_password_keys = [:email]
|
||||
|
||||
# Time interval you can reset your password with a reset password key.
|
||||
# Don't put a too small interval or your users won't have the time to
|
||||
# change their passwords.
|
||||
config.reset_password_within = 6.hours
|
||||
|
||||
# When set to false, does not sign a user in automatically after their password is
|
||||
# reset. Defaults to true, so a user is signed in automatically after a reset.
|
||||
# config.sign_in_after_reset_password = true
|
||||
|
||||
# ==> Configuration for :encryptable
|
||||
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
||||
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
||||
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
||||
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
||||
# REST_AUTH_SITE_KEY to pepper).
|
||||
#
|
||||
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
||||
# config.encryptor = :sha512
|
||||
|
||||
# ==> Scopes configuration
|
||||
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
||||
# "users/sessions/new". It's turned off by default because it's slower if you
|
||||
# are using only default views.
|
||||
# config.scoped_views = false
|
||||
|
||||
# Configure the default scope given to Warden. By default it's the first
|
||||
# devise role declared in your routes (usually :user).
|
||||
# config.default_scope = :user
|
||||
|
||||
# Set this configuration to false if you want /users/sign_out to sign out
|
||||
# only the current scope. By default, Devise signs out all scopes.
|
||||
# config.sign_out_all_scopes = true
|
||||
|
||||
# ==> Navigation configuration
|
||||
# Lists the formats that should be treated as navigational. Formats like
|
||||
# :html, should redirect to the sign in page when the user does not have
|
||||
# access, but formats like :xml or :json, should return 401.
|
||||
#
|
||||
# If you have any extra navigational formats, like :iphone or :mobile, you
|
||||
# should add them to the navigational formats lists.
|
||||
#
|
||||
# The "*/*" below is required to match Internet Explorer requests.
|
||||
# config.navigational_formats = ['*/*', :html]
|
||||
|
||||
# The default HTTP method used to sign out a resource. Default is :delete.
|
||||
config.sign_out_via = :delete
|
||||
|
||||
# ==> OmniAuth
|
||||
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
||||
# up on your models and hooks.
|
||||
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
||||
config.omniauth :facebook, ENV["FACEBOOK_APP_ID"], ENV["FACEBOOK_APP_SECRET"], {}
|
||||
# ==> Warden configuration
|
||||
# If you want to use other strategies, that are not supported by Devise, or
|
||||
# change the failure app, you can configure them inside the config.warden block.
|
||||
#
|
||||
# config.warden do |manager|
|
||||
# manager.intercept_401 = false
|
||||
# manager.default_strategies(scope: :user).unshift :some_external_strategy
|
||||
# end
|
||||
|
||||
# ==> Mountable engine configurations
|
||||
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
||||
# is mountable, there are some extra configurations to be taken into account.
|
||||
# The following options are available, assuming the engine is mounted as:
|
||||
#
|
||||
# mount MyEngine, at: '/my_engine'
|
||||
#
|
||||
# The router that invoked `devise_for`, in the example above, would be:
|
||||
# config.router_name = :my_engine
|
||||
#
|
||||
# When using omniauth, Devise cannot automatically set Omniauth path,
|
||||
# so you need to do it manually. For the users scope, it would be:
|
||||
config.omniauth_path_prefix = "/api/auth"
|
||||
|
||||
# ==> Configuration for :invitable
|
||||
# The period the generated invitation token is valid, after
|
||||
# this period, the invited resource won't be able to accept the invitation.
|
||||
# When invite_for is 0 (the default), the invitation won't expire.
|
||||
# config.invite_for = 2.weeks
|
||||
end
|
||||
|
||||
OmniAuth.config.on_failure =
|
||||
proc do |env|
|
||||
env["devise.mapping"] = Devise.mappings[:user]
|
||||
Api::V1::OmniauthCallbacksController.action(:failure).call(env)
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
|
||||
# Use this to limit dissemination of sensitive information.
|
||||
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
|
||||
Rails.application.config.filter_parameters += [
|
||||
:password, :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
||||
]
|
||||
@@ -0,0 +1,16 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Add new inflection rules using the following format. Inflections
|
||||
# are locale specific, and you may define rules for as many different
|
||||
# locales as you wish. All of these examples are active by default:
|
||||
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||
# inflect.plural /^(ox)$/i, "\\1en"
|
||||
# inflect.singular /^(ox)en/i, "\\1"
|
||||
# inflect.irregular "person", "people"
|
||||
# inflect.uncountable %w( fish sheep )
|
||||
# end
|
||||
|
||||
# These inflection rules are supported but not enabled by default:
|
||||
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||
# inflect.acronym "RESTful"
|
||||
# end
|
||||
@@ -0,0 +1,4 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Add new mime types for use in respond_to blocks:
|
||||
# Mime::Type.register "text/richtext", :rtf
|
||||
@@ -0,0 +1,13 @@
|
||||
Mongoid.configure do |config|
|
||||
config.load_defaults 8.1
|
||||
end
|
||||
|
||||
Mongoid::Document.send(:include, ActiveModel::SerializerSupport)
|
||||
Mongoid::Criteria.delegate(:active_model_serializer, to: :to_a)
|
||||
|
||||
module BSON
|
||||
class ObjectId
|
||||
alias_method :to_json, :to_s
|
||||
alias_method :as_json, :to_s
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,288 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
#
|
||||
# This file eases your Rails 7.1 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.1`.
|
||||
#
|
||||
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
||||
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
|
||||
# https://guides.rubyonrails.org/configuring.html#default-values-for-target-version-7-1
|
||||
|
||||
###
|
||||
# No longer add autoloaded paths into `$LOAD_PATH`. This means that you won't be able
|
||||
# to manually require files that are managed by the autoloader, which you shouldn't do anyway.
|
||||
#
|
||||
# This will reduce the size of the load path, making `require` faster if you don't use bootsnap, or reduce the size
|
||||
# of the bootsnap cache if you use it.
|
||||
#
|
||||
# To set this configuration, add the following line to `config/application.rb` (NOT this file):
|
||||
# config.add_autoload_paths_to_load_path = false (DONE)
|
||||
|
||||
###
|
||||
# Remove the default X-Download-Options headers since it is used only by Internet Explorer.
|
||||
# If you need to support Internet Explorer, add back `"X-Download-Options" => "noopen"`.
|
||||
#++
|
||||
Rails.application.config.action_dispatch.default_headers = {
|
||||
"X-Frame-Options" => "SAMEORIGIN",
|
||||
"X-XSS-Protection" => "0",
|
||||
"X-Content-Type-Options" => "nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies" => "none",
|
||||
"Referrer-Policy" => "strict-origin-when-cross-origin"
|
||||
}
|
||||
|
||||
###
|
||||
# Do not treat an `ActionController::Parameters` instance
|
||||
# as equal to an equivalent `Hash` by default.
|
||||
#++
|
||||
Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false
|
||||
|
||||
###
|
||||
# Active Record Encryption now uses SHA-256 as its hash digest algorithm.
|
||||
#
|
||||
# There are 3 scenarios to consider.
|
||||
#
|
||||
# 1. If you have data encrypted with previous Rails versions, and you have
|
||||
# +config.active_support.key_generator_hash_digest_class+ configured as SHA1 (the default
|
||||
# before Rails 7.0), you need to configure SHA-1 for Active Record Encryption too:
|
||||
#++
|
||||
# Rails.application.config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA1
|
||||
#
|
||||
# 2. If you have +config.active_support.key_generator_hash_digest_class+ configured as SHA256 (the new default
|
||||
# in 7.0), then you need to configure SHA-256 for Active Record Encryption:
|
||||
#++
|
||||
# Rails.application.config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA256
|
||||
#
|
||||
# 3. If you don't currently have data encrypted with Active Record encryption, you can disable this setting to
|
||||
# configure the default behavior starting 7.1+:
|
||||
#++
|
||||
# - NOTE: I don't see `key_generator_hash_digest_class`` or `encrypts` used anywhwere
|
||||
# - If app is using Active Record Encryption, will need to do 1 or 2 above
|
||||
Rails.application.config.active_record.encryption.support_sha1_for_non_deterministic_encryption = false
|
||||
|
||||
###
|
||||
# No longer run after_commit callbacks on the first of multiple Active Record
|
||||
# instances to save changes to the same database row within a transaction.
|
||||
# Instead, run these callbacks on the instance most likely to have internal
|
||||
# state which matches what was committed to the database, typically the last
|
||||
# instance to save.
|
||||
#++
|
||||
Rails.application.config.active_record.run_commit_callbacks_on_first_saved_instances_in_transaction = false
|
||||
|
||||
###
|
||||
# Configures SQLite with a strict strings mode, which disables double-quoted string literals.
|
||||
#
|
||||
# SQLite has some quirks around double-quoted string literals.
|
||||
# It first tries to consider double-quoted strings as identifier names, but if they don't exist
|
||||
# it then considers them as string literals. Because of this, typos can silently go unnoticed.
|
||||
# For example, it is possible to create an index for a non existing column.
|
||||
# See https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted for more details.
|
||||
#++
|
||||
Rails.application.config.active_record.sqlite3_adapter_strict_strings_by_default = true
|
||||
|
||||
###
|
||||
# Disable deprecated singular associations names.
|
||||
#++
|
||||
Rails.application.config.active_record.allow_deprecated_singular_associations_name = false
|
||||
|
||||
###
|
||||
# Enable the Active Job `BigDecimal` argument serializer, which guarantees
|
||||
# roundtripping. Without this serializer, some queue adapters may serialize
|
||||
# `BigDecimal` arguments as simple (non-roundtrippable) strings.
|
||||
#
|
||||
# When deploying an application with multiple replicas, old (pre-Rails 7.1)
|
||||
# replicas will not be able to deserialize `BigDecimal` arguments from this
|
||||
# serializer. Therefore, this setting should only be enabled after all replicas
|
||||
# have been successfully upgraded to Rails 7.1.
|
||||
#++
|
||||
Rails.application.config.active_job.use_big_decimal_serializer = true
|
||||
|
||||
###
|
||||
# Specify if an `ArgumentError` should be raised if `Rails.cache` `fetch` or
|
||||
# `write` are given an invalid `expires_at` or `expires_in` time.
|
||||
# Options are `true`, and `false`. If `false`, the exception will be reported
|
||||
# as `handled` and logged instead.
|
||||
#++
|
||||
Rails.application.config.active_support.raise_on_invalid_cache_expiration_time = true
|
||||
|
||||
###
|
||||
# Specify whether Query Logs will format tags using the SQLCommenter format
|
||||
# (https://open-telemetry.github.io/opentelemetry-sqlcommenter/), or using the legacy format.
|
||||
# Options are `:legacy` and `:sqlcommenter`.
|
||||
#++
|
||||
Rails.application.config.active_record.query_log_tags_format = :sqlcommenter
|
||||
|
||||
###
|
||||
# Specify the default serializer used by `MessageEncryptor` and `MessageVerifier`
|
||||
# instances.
|
||||
#
|
||||
# The legacy default is `:marshal`, which is a potential vector for
|
||||
# deserialization attacks in cases where a message signing secret has been
|
||||
# leaked.
|
||||
#
|
||||
# In Rails 7.1, the new default is `:json_allow_marshal` which serializes and
|
||||
# deserializes with `ActiveSupport::JSON`, but can fall back to deserializing
|
||||
# with `Marshal` so that legacy messages can still be read.
|
||||
#
|
||||
# In Rails 7.2, the default will become `:json` which serializes and
|
||||
# deserializes with `ActiveSupport::JSON` only.
|
||||
#
|
||||
# Alternatively, you can choose `:message_pack` or `:message_pack_allow_marshal`,
|
||||
# which serialize with `ActiveSupport::MessagePack`. `ActiveSupport::MessagePack`
|
||||
# can roundtrip some Ruby types that are not supported by JSON, and may provide
|
||||
# improved performance, but it requires the `msgpack` gem.
|
||||
#
|
||||
# For more information, see
|
||||
# https://guides.rubyonrails.org/v7.1/configuring.html#config-active-support-message-serializer
|
||||
#
|
||||
# NOTE: Does rolling deploy apply here?
|
||||
# If you are performing a rolling deploy of a Rails 7.1 upgrade, wherein servers
|
||||
# that have not yet been upgraded must be able to read messages from upgraded
|
||||
# servers, first deploy without changing the serializer, then set the serializer
|
||||
# in a subsequent deploy.
|
||||
#++
|
||||
Rails.application.config.active_support.message_serializer = :json_allow_marshal
|
||||
|
||||
###
|
||||
# Enable a performance optimization that serializes message data and metadata
|
||||
# together. This changes the message format, so messages serialized this way
|
||||
# cannot be read by older versions of Rails. However, messages that use the old
|
||||
# format can still be read, regardless of whether this optimization is enabled.
|
||||
#
|
||||
# NOTE: Does rolling deploy apply here?
|
||||
# To perform a rolling deploy of a Rails 7.1 upgrade, wherein servers that have
|
||||
# not yet been upgraded must be able to read messages from upgraded servers,
|
||||
# leave this optimization off on the first deploy, then enable it on a
|
||||
# subsequent deploy.
|
||||
#++
|
||||
Rails.application.config.active_support.use_message_serializer_for_metadata = true
|
||||
|
||||
###
|
||||
# Set the maximum size for Rails log files.
|
||||
#
|
||||
# `config.load_defaults 7.1` does not set this value for environments other than
|
||||
# development and test.
|
||||
#++
|
||||
if Rails.env.local?
|
||||
Rails.application.config.log_file_size = 100 * 1024 * 1024
|
||||
end
|
||||
|
||||
###
|
||||
# Enable raising on assignment to attr_readonly attributes. The previous
|
||||
# behavior would allow assignment but silently not persist changes to the
|
||||
# database.
|
||||
#++
|
||||
Rails.application.config.active_record.raise_on_assign_to_attr_readonly = true
|
||||
|
||||
###
|
||||
# Enable validating only parent-related columns for presence when the parent is mandatory.
|
||||
# The previous behavior was to validate the presence of the parent record, which performed an extra query
|
||||
# to get the parent every time the child record was updated, even when parent has not changed.
|
||||
#++
|
||||
Rails.application.config.active_record.belongs_to_required_validates_foreign_key = false
|
||||
|
||||
###
|
||||
# Enable precompilation of `config.filter_parameters`. Precompilation can
|
||||
# improve filtering performance, depending on the quantity and types of filters.
|
||||
#++
|
||||
Rails.application.config.precompile_filter_parameters = true
|
||||
|
||||
###
|
||||
# Enable before_committed! callbacks on all enrolled records in a transaction.
|
||||
# The previous behavior was to only run the callbacks on the first copy of a record
|
||||
# if there were multiple copies of the same record enrolled in the transaction.
|
||||
#++
|
||||
Rails.application.config.active_record.before_committed_on_all_records = true
|
||||
|
||||
###
|
||||
# Disable automatic column serialization into YAML.
|
||||
# To keep the historic behavior, you can set it to `YAML`, however it is
|
||||
# recommended to explicitly define the serialization method for each column
|
||||
# rather than to rely on a global default.
|
||||
#++
|
||||
Rails.application.config.active_record.default_column_serializer = nil
|
||||
|
||||
###
|
||||
# Enable a performance optimization that serializes Active Record models
|
||||
# in a faster and more compact way.
|
||||
#
|
||||
# NOTE: Does rolling deploy apply here?
|
||||
# To perform a rolling deploy of a Rails 7.1 upgrade, wherein servers that have
|
||||
# not yet been upgraded must be able to read caches from upgraded servers,
|
||||
# leave this optimization off on the first deploy, then enable it on a
|
||||
# subsequent deploy.
|
||||
#++
|
||||
Rails.application.config.active_record.marshalling_format_version = 7.1
|
||||
|
||||
###
|
||||
# Run `after_commit` and `after_*_commit` callbacks in the order they are defined in a model.
|
||||
# This matches the behaviour of all other callbacks.
|
||||
# In previous versions of Rails, they ran in the inverse order.
|
||||
#++
|
||||
Rails.application.config.active_record.run_after_transaction_callbacks_in_order_defined = true
|
||||
|
||||
###
|
||||
# Whether a `transaction` block is committed or rolled back when exited via `return`, `break` or `throw`.
|
||||
#++
|
||||
Rails.application.config.active_record.commit_transaction_on_non_local_return = true
|
||||
|
||||
###
|
||||
# Controls when to generate a value for <tt>has_secure_token</tt> declarations.
|
||||
#++
|
||||
Rails.application.config.active_record.generate_secure_token_on = :initialize
|
||||
|
||||
###
|
||||
# ** Please read carefully, this must be configured in config/application.rb **
|
||||
# Change the format of the cache entry.
|
||||
#
|
||||
# Changing this default means that all new cache entries added to the cache
|
||||
# will have a different format that is not supported by Rails 7.0
|
||||
# applications.
|
||||
#
|
||||
# Only change this value after your application is fully deployed to Rails 7.1
|
||||
# and you have no plans to rollback.
|
||||
# When you're ready to change format, add this to `config/application.rb` (NOT
|
||||
# this file):
|
||||
# NOTE: Does rolling deploy apply here?
|
||||
# - TODO: If so, revert change in app config & create issue for this to be done after deploying?
|
||||
# config.active_support.cache_format_version = 7.1 (DOME)
|
||||
|
||||
###
|
||||
# Configure Action View to use HTML5 standards-compliant sanitizers when they are supported on your
|
||||
# platform.
|
||||
#
|
||||
# `Rails::HTML::Sanitizer.best_supported_vendor` will cause Action View to use HTML5-compliant
|
||||
# sanitizers if they are supported, else fall back to HTML4 sanitizers.
|
||||
#
|
||||
# In previous versions of Rails, Action View always used `Rails::HTML4::Sanitizer` as its vendor.
|
||||
#++
|
||||
Rails.application.config.action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
|
||||
|
||||
###
|
||||
# Configure Action Text to use an HTML5 standards-compliant sanitizer when it is supported on your
|
||||
# platform.
|
||||
#
|
||||
# `Rails::HTML::Sanitizer.best_supported_vendor` will cause Action Text to use HTML5-compliant
|
||||
# sanitizers if they are supported, else fall back to HTML4 sanitizers.
|
||||
#
|
||||
# In previous versions of Rails, Action Text always used `Rails::HTML4::Sanitizer` as its vendor.
|
||||
#++
|
||||
# NOTE: App is not using Action Text, this is ignored when load_defaults: 7.1 is enabled.
|
||||
# Rails.application.config.action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
|
||||
|
||||
###
|
||||
# Configure the log level used by the DebugExceptions middleware when logging
|
||||
# uncaught exceptions during requests.
|
||||
#++
|
||||
Rails.application.config.action_dispatch.debug_exception_log_level = :error
|
||||
|
||||
###
|
||||
# Configure the test helpers in Action View, Action Dispatch, and rails-dom-testing to use HTML5
|
||||
# parsers.
|
||||
#
|
||||
# Nokogiri::HTML5 isn't supported on JRuby, so JRuby applications must set this to :html4.
|
||||
#
|
||||
# In previous versions of Rails, these test helpers always used an HTML4 parser.
|
||||
#++
|
||||
Rails.application.config.dom_testing_default_html_version = :html5
|
||||
@@ -0,0 +1,13 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Define an application-wide HTTP permissions policy. For further
|
||||
# information see: https://developers.google.com/web/updates/2018/06/feature-policy
|
||||
|
||||
# Rails.application.config.permissions_policy do |policy|
|
||||
# policy.camera :none
|
||||
# policy.gyroscope :none
|
||||
# policy.microphone :none
|
||||
# policy.usb :none
|
||||
# policy.fullscreen :self
|
||||
# policy.payment :self, "https://secure.example.com"
|
||||
# end
|
||||
@@ -0,0 +1 @@
|
||||
ActionMailer::Base.register_preview_interceptor(ActionMailer::InlinePreviewInterceptor)
|
||||
@@ -0,0 +1 @@
|
||||
# Rack::Timeout.service_timeout = 25 # seconds
|
||||
@@ -0,0 +1,7 @@
|
||||
Sidekiq.configure_server do |config|
|
||||
config.redis = {url: Flaredown.config.redis_url, size: 4, db: ENV["REDIS_DB"]}
|
||||
end
|
||||
|
||||
Sidekiq.configure_client do |config|
|
||||
config.redis = {url: Flaredown.config.redis_url, size: 1, db: ENV["REDIS_DB"]}
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
Tomorrowiorb.api_key = Rails.application.secrets.tomorrow_io_key
|
||||
72
worker-toolkit-flaredown/repo/backend/config/locales/en.yml
Normal file
72
worker-toolkit-flaredown/repo/backend/config/locales/en.yml
Normal file
@@ -0,0 +1,72 @@
|
||||
en:
|
||||
|
||||
day_habit:
|
||||
lying_down:
|
||||
name: "Lying down"
|
||||
description: "bedridden"
|
||||
sitting_down:
|
||||
name: "Sitting down or at a computer"
|
||||
description: "e.g. student, programmer, architect"
|
||||
on_feet:
|
||||
name: "On your feet"
|
||||
description: "e.g. physician, retail salesperson, tour guide"
|
||||
driving:
|
||||
name: "Driving around"
|
||||
description: "e.g. pharmaceutical representative, taxi driver, truck driver"
|
||||
working_with_hands:
|
||||
name: "Working with your hands"
|
||||
description: "e.g. farmer, fishery worker, landscaper"
|
||||
|
||||
education_level:
|
||||
less_than_hi_school: "Less than high school"
|
||||
hi_school: "High school diploma"
|
||||
college_degree: "Some college or associate's degree"
|
||||
bachelors_degree: "Bachelor's degree"
|
||||
advanced_degree: "Advanced degree"
|
||||
|
||||
ethnicity:
|
||||
latino: "Latino or Hispanic"
|
||||
white: "European or White"
|
||||
east_asian: "East Asian"
|
||||
south_asian: "South Asian"
|
||||
black: "African American or Black"
|
||||
oceanian: "Pacific Islander or Oceanian"
|
||||
middle_eastern: "Middle Eastern or North African"
|
||||
native_american: "Native American or Alaska Native"
|
||||
african: "Sub-Saharan African"
|
||||
other: "Other"
|
||||
not_sure: "I'm not sure"
|
||||
|
||||
sex:
|
||||
male: "Male"
|
||||
female: "Female"
|
||||
other: "Other"
|
||||
doesnt_say: "Prefer not to say"
|
||||
|
||||
devise:
|
||||
mailer:
|
||||
invitation_instructions:
|
||||
subject: "You're invited to Flaredown Early Access"
|
||||
hello: "Hello %{email}"
|
||||
someone_invited_you: "Your Early Access invite to Flaredown is here! You can accept it through the link below. Right now, Flaredown is exclusively on the web. You will be invited to the mobile apps when they are ready."
|
||||
accept: "Accept invitation"
|
||||
accept_until: "This invitation will expire at %{due_date}."
|
||||
ignore: "If you don't want to accept the invitation, please ignore this email.<br />Your account won't be created until you access the link above and set your password."
|
||||
|
||||
user_data_mailer:
|
||||
trackings_csv:
|
||||
subject: "Your Flaredown data is here"
|
||||
|
||||
checkin_reminder_mailer:
|
||||
subject: "It's time to check in to Flaredown"
|
||||
body:
|
||||
text: 'Open your Flaredown app to check in or..'
|
||||
bottom: 'You opted to receive daily check-in reminders in Flaredown.'
|
||||
link:
|
||||
unsubscribe: 'Click here to turn this reminder off.'
|
||||
|
||||
promotion_rate:
|
||||
statistic:
|
||||
subject: 'Statistic for Promotion Rates'
|
||||
low_rate:
|
||||
subject: 'Low rate Promotion feedbacks'
|
||||
@@ -0,0 +1,6 @@
|
||||
it:
|
||||
sex:
|
||||
male: "Maschio"
|
||||
female: "Femmina"
|
||||
other: "Altro"
|
||||
doesnt_say: "Preferisco non dirlo"
|
||||
193
worker-toolkit-flaredown/repo/backend/config/mongoid.yml
Normal file
193
worker-toolkit-flaredown/repo/backend/config/mongoid.yml
Normal file
@@ -0,0 +1,193 @@
|
||||
development:
|
||||
# Configure available database clients. (required)
|
||||
clients:
|
||||
# Defines the default client. (required)
|
||||
default:
|
||||
# Mongoid can connect to a URI accepted by the driver:
|
||||
# uri: mongodb://user:password@mongodb.domain.com:27017/flaredown_development
|
||||
|
||||
# Otherwise define the parameters separately.
|
||||
# This defines the name of the default database that Mongoid can connect to.
|
||||
# (required).
|
||||
database: flaredown_development
|
||||
# Provides the hosts the default client can connect to. Must be an array
|
||||
# of host:port pairs. (required)
|
||||
hosts:
|
||||
- <%= ENV['MONGODB_HOST'] || "localhost" %>:27017
|
||||
options:
|
||||
# Note that all options listed below are Ruby driver client options (the mongo gem).
|
||||
# Please refer to the driver documentation of the version of the mongo gem you are using
|
||||
# for the most up-to-date list of options.
|
||||
#
|
||||
# Change the default write concern. (default = { w: 1 })
|
||||
# write:
|
||||
# w: 1
|
||||
|
||||
# Change the default read preference. Valid options for mode are: :secondary,
|
||||
# :secondary_preferred, :primary, :primary_preferred, :nearest
|
||||
# (default: primary)
|
||||
# read:
|
||||
# mode: :secondary_preferred
|
||||
# tag_sets:
|
||||
# - use: web
|
||||
|
||||
# The name of the user for authentication.
|
||||
# user: 'user'
|
||||
|
||||
# The password of the user for authentication.
|
||||
# password: 'password'
|
||||
|
||||
# The user's database roles.
|
||||
# roles:
|
||||
# - 'dbOwner'
|
||||
|
||||
# Change the default authentication mechanism. Valid options are: :scram,
|
||||
# :mongodb_cr, :mongodb_x509, and :plain. Note that all authentication
|
||||
# mechanisms require username and password, with the exception of :mongodb_x509.
|
||||
# Default on mongoDB 3.0 is :scram, default on 2.4 and 2.6 is :plain.
|
||||
# auth_mech: :scram
|
||||
|
||||
# The database or source to authenticate the user against.
|
||||
# (default: the database specified above or admin)
|
||||
# auth_source: admin
|
||||
|
||||
# Force a the driver cluster to behave in a certain manner instead of auto-
|
||||
# discovering. Can be one of: :direct, :replica_set, :sharded. Set to :direct
|
||||
# when connecting to hidden members of a replica set.
|
||||
# connect: :direct
|
||||
|
||||
# Changes the default time in seconds the server monitors refresh their status
|
||||
# via hello commands. (default: 10)
|
||||
# heartbeat_frequency: 10
|
||||
|
||||
# The time in seconds for selecting servers for a near read preference. (default: 0.015)
|
||||
# local_threshold: 0.015
|
||||
|
||||
# The timeout in seconds for selecting a server for an operation. (default: 30)
|
||||
# server_selection_timeout: 30
|
||||
|
||||
# The maximum number of connections in the connection pool. (default: 5)
|
||||
# max_pool_size: 5
|
||||
|
||||
# The minimum number of connections in the connection pool. (default: 1)
|
||||
# min_pool_size: 1
|
||||
|
||||
# The time to wait, in seconds, in the connection pool for a connection
|
||||
# to be checked in before timing out. (default: 5)
|
||||
# wait_queue_timeout: 5
|
||||
|
||||
# The time to wait to establish a connection before timing out, in seconds.
|
||||
# (default: 10)
|
||||
# connect_timeout: 10
|
||||
|
||||
# How long to wait for a response for each operation sent to the
|
||||
# server. This timeout should be set to a value larger than the
|
||||
# processing time for the longest operation that will be executed
|
||||
# by the application. Note that this is a client-side timeout;
|
||||
# the server may continue executing an operation after the client
|
||||
# aborts it with the SocketTimeout exception.
|
||||
# (default: nil, meaning no timeout)
|
||||
# socket_timeout: 5
|
||||
|
||||
# The name of the replica set to connect to. Servers provided as seeds that do
|
||||
# not belong to this replica set will be ignored.
|
||||
# replica_set: name
|
||||
|
||||
# Whether to connect to the servers via ssl. (default: false)
|
||||
# ssl: true
|
||||
|
||||
# The certificate file used to identify the connection against MongoDB.
|
||||
# ssl_cert: /path/to/my.cert
|
||||
|
||||
# The private keyfile used to identify the connection against MongoDB.
|
||||
# Note that even if the key is stored in the same file as the certificate,
|
||||
# both need to be explicitly specified.
|
||||
# ssl_key: /path/to/my.key
|
||||
|
||||
# A passphrase for the private key.
|
||||
# ssl_key_pass_phrase: password
|
||||
|
||||
# Whether to do peer certification validation. (default: true)
|
||||
# ssl_verify: true
|
||||
|
||||
# The file containing concatenated certificate authority certificates
|
||||
# used to validate certs passed from the other end of the connection.
|
||||
# ssl_ca_cert: /path/to/ca.cert
|
||||
|
||||
# Whether to truncate long log lines. (default: true)
|
||||
# truncate_logs: true
|
||||
|
||||
# Configure Mongoid specific options. (optional)
|
||||
options:
|
||||
# Application name that is printed to the mongodb logs upon establishing
|
||||
# a connection in server versions >= 3.4. Note that the name cannot
|
||||
# exceed 128 bytes. It is also used as the database name if the
|
||||
# database name is not explicitly defined. (default: nil)
|
||||
# app_name: MyApplicationName
|
||||
|
||||
# Mark belongs_to associations as required by default, so that saving a
|
||||
# model with a missing belongs_to association will trigger a validation
|
||||
# error. (default: true)
|
||||
# belongs_to_required_by_default: true
|
||||
|
||||
# Raise an exception when a field is redefined. (default: false)
|
||||
# duplicate_fields_exception: false
|
||||
|
||||
# Include the root model name in json serialization. (default: false)
|
||||
# include_root_in_json: false
|
||||
|
||||
# Include the _type field in serialization. (default: false)
|
||||
# include_type_for_serialization: false
|
||||
|
||||
# Whether to join nested persistence contexts for atomic operations
|
||||
# to parent contexts by default. (default: false)
|
||||
# join_contexts: false
|
||||
|
||||
# Set the Mongoid and Ruby driver log levels when Mongoid is not using
|
||||
# Ruby on Rails logger instance. (default: :info)
|
||||
# log_level: :info
|
||||
|
||||
# Preload all models in development, needed when models use
|
||||
# inheritance. (default: false)
|
||||
# preload_models: false
|
||||
|
||||
# Raise an error when performing a #find and the document is not found.
|
||||
# (default: true)
|
||||
# raise_not_found_error: true
|
||||
|
||||
# Raise an error when defining a scope with the same name as an
|
||||
# existing method. (default: false)
|
||||
# scope_overwrite_exception: false
|
||||
|
||||
# Use ActiveSupport's time zone in time operations instead of
|
||||
# the Ruby default time zone. See the time zone section below for
|
||||
# further information. (default: true)
|
||||
# use_activesupport_time_zone: true
|
||||
|
||||
# Return stored times as UTC. See the time zone section below for
|
||||
# further information. Most applications should not use this option.
|
||||
# (default: false)
|
||||
# use_utc: false
|
||||
|
||||
# (Deprecated) In MongoDB 4.0 and earlier, set whether to create
|
||||
# indexes in the background by default. (default: false)
|
||||
# background_indexing: false
|
||||
|
||||
test:
|
||||
clients:
|
||||
default:
|
||||
database: flaredown_test
|
||||
hosts:
|
||||
- <%= ENV['MONGODB_HOST'] %>:27017
|
||||
options:
|
||||
read:
|
||||
mode: :primary
|
||||
max_pool_size: 1
|
||||
|
||||
production:
|
||||
clients:
|
||||
default:
|
||||
uri: <%= ENV['MONGOLAB_URI'] %>
|
||||
options:
|
||||
# The maximum number of connections in the connection pool. (default: 5)
|
||||
max_pool_size: 50
|
||||
42
worker-toolkit-flaredown/repo/backend/config/puma.rb
Executable file
42
worker-toolkit-flaredown/repo/backend/config/puma.rb
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env puma
|
||||
|
||||
# Load "path" as a rackup file.
|
||||
#
|
||||
# The default is "config.ru".
|
||||
#
|
||||
rackup DefaultRackup
|
||||
|
||||
port Integer(ENV.fetch("PORT") { 3000 })
|
||||
environment ENV.fetch("RACK_ENV") { "development" }
|
||||
|
||||
# Configure "min" to be the minimum number of threads to use to answer
|
||||
# requests and "max" the maximum.
|
||||
#
|
||||
# The default is "0, 16".
|
||||
#
|
||||
threads_count = Integer(ENV.fetch("MAX_THREADS") { 16 })
|
||||
threads threads_count, threads_count
|
||||
|
||||
# Preload the application before starting the workers; this conflicts with
|
||||
# phased restart feature. (off by default)
|
||||
preload_app!
|
||||
|
||||
# === Cluster mode ===
|
||||
|
||||
# How many worker processes to run.
|
||||
#
|
||||
# The default is "0".
|
||||
#
|
||||
workers Integer(ENV.fetch("WEB_CONCURRENCY") { 0 })
|
||||
|
||||
before_fork do
|
||||
ActiveRecord::Base.connection_pool.disconnect!
|
||||
end
|
||||
|
||||
on_worker_boot do
|
||||
# Worker specific setup for Rails 4.1+
|
||||
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
|
||||
ActiveSupport.on_load(:active_record) do
|
||||
ActiveRecord::Base.establish_connection
|
||||
end
|
||||
end
|
||||
206
worker-toolkit-flaredown/repo/backend/config/routes.rb
Normal file
206
worker-toolkit-flaredown/repo/backend/config/routes.rb
Normal file
@@ -0,0 +1,206 @@
|
||||
# rubocop:disable Metrics/BlockLength
|
||||
|
||||
Rails.application.routes.draw do
|
||||
root "application#root"
|
||||
|
||||
# Authentication
|
||||
devise_for :users,
|
||||
skip: [:sessions, :passwords, :registrations, :confirmations, :invitation],
|
||||
skip_helpers: false,
|
||||
controllers: {
|
||||
omniauth_callbacks: "api/v1/omniauth_callbacks"
|
||||
}
|
||||
|
||||
#
|
||||
# API
|
||||
#
|
||||
get "/api/minimum-client", to: "application#root"
|
||||
|
||||
namespace :api, defaults: {format: "json"} do
|
||||
scope module: :v1 do
|
||||
#
|
||||
# Chart list
|
||||
#
|
||||
resource :chart_lists, only: [:show]
|
||||
|
||||
#
|
||||
# Charts
|
||||
#
|
||||
resource :charts, only: [:show]
|
||||
|
||||
#
|
||||
# Checkins
|
||||
#
|
||||
resources :checkins, only: [:index, :show, :create, :update]
|
||||
|
||||
#
|
||||
# Conditions
|
||||
#
|
||||
resources :conditions, only: [:index, :show, :create]
|
||||
|
||||
#
|
||||
# Comments
|
||||
#
|
||||
resources :comments, only: [:create, :show, :index]
|
||||
|
||||
#
|
||||
# Data Export Schedules
|
||||
#
|
||||
resources :data_export_schedules, only: :create
|
||||
|
||||
#
|
||||
# Day Habits
|
||||
#
|
||||
resources :day_habits, only: [:index, :show]
|
||||
|
||||
#
|
||||
# Discourse SSO
|
||||
#
|
||||
resource :discourse, only: [:create]
|
||||
|
||||
#
|
||||
# Education Levels
|
||||
#
|
||||
resources :education_levels, only: [:index, :show]
|
||||
|
||||
#
|
||||
# Ethnicities
|
||||
#
|
||||
resources :ethnicities, only: [:index, :show]
|
||||
|
||||
#
|
||||
# Foods
|
||||
#
|
||||
resources :foods, only: [:index, :show, :create]
|
||||
|
||||
#
|
||||
# Graphs
|
||||
#
|
||||
resources :countries, only: [:index, :show]
|
||||
|
||||
#
|
||||
# Harvey Bradshaw Indices
|
||||
#
|
||||
resources :harvey_bradshaw_indices, only: [:show, :create]
|
||||
|
||||
#
|
||||
# Promotion Rates
|
||||
#
|
||||
resources :promotion_rates, only: [:show, :create, :update]
|
||||
|
||||
#
|
||||
# Invitations
|
||||
#
|
||||
resources :invitations, only: [:show, :update]
|
||||
|
||||
#
|
||||
# Notifications
|
||||
#
|
||||
resources :notifications, only: [:index] do
|
||||
collection do
|
||||
delete ":notificateable_type/:notificateable_id", action: :destroy
|
||||
put ":notificateable_type/:notificateable_id", action: :update
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Oracle requests
|
||||
#
|
||||
resources :oracle_requests, only: [:show, :create, :update]
|
||||
|
||||
#
|
||||
# Passwords
|
||||
#
|
||||
resources :passwords, only: [:show, :create, :update]
|
||||
|
||||
#
|
||||
# Postables
|
||||
#
|
||||
resources :postables, only: [:index]
|
||||
|
||||
#
|
||||
# Posts
|
||||
#
|
||||
resources :posts, only: [:create, :show, :index]
|
||||
|
||||
#
|
||||
# Profiles
|
||||
#
|
||||
resources :profiles, only: [:index, :show, :update]
|
||||
|
||||
#
|
||||
# Activations
|
||||
#
|
||||
# resources :activations, only: [:edit]
|
||||
|
||||
get "/unsubscribe/:notify_token", to: "unsubscribes#update", as: :unsubscribe
|
||||
|
||||
# Pusher
|
||||
#
|
||||
resource :pusher, only: [:create]
|
||||
|
||||
#
|
||||
# Reactions
|
||||
#
|
||||
resources :reactions, only: [:create, :update, :destroy]
|
||||
|
||||
#
|
||||
# Registrations
|
||||
#
|
||||
resources :registrations, only: [:create] do
|
||||
put "destroy", on: :collection
|
||||
end
|
||||
|
||||
#
|
||||
# Searches
|
||||
#
|
||||
resource :searches, only: [:show]
|
||||
|
||||
#
|
||||
# Sessions
|
||||
#
|
||||
resources :sessions, only: [:create]
|
||||
|
||||
#
|
||||
# Sexes
|
||||
#
|
||||
resources :sexes, only: [:index, :show]
|
||||
|
||||
#
|
||||
# Symptoms
|
||||
#
|
||||
resources :symptoms, only: [:index, :show, :create]
|
||||
|
||||
#
|
||||
# Tags
|
||||
#
|
||||
resources :tags, only: [:index, :show, :create]
|
||||
|
||||
resources :topic_followings, only: [:show, :update]
|
||||
|
||||
#
|
||||
# Trackings
|
||||
#
|
||||
resources :trackings, only: [:index, :show, :create, :destroy]
|
||||
|
||||
#
|
||||
# Treatments
|
||||
#
|
||||
resources :treatments, only: [:index, :show, :create]
|
||||
|
||||
#
|
||||
# Users
|
||||
#
|
||||
resources :users, only: [:show, :update]
|
||||
|
||||
#
|
||||
# Weathers
|
||||
#
|
||||
resources :weathers, only: [:index]
|
||||
|
||||
resources :patterns
|
||||
resources :charts_pattern, only: [:index]
|
||||
post "/aws_ses/notification", to: "aws_ses#notification"
|
||||
end
|
||||
end
|
||||
end
|
||||
32
worker-toolkit-flaredown/repo/backend/config/secrets.yml
Normal file
32
worker-toolkit-flaredown/repo/backend/config/secrets.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Your secret key is used for verifying the integrity of signed cookies.
|
||||
# If you change this key, all old signed cookies will become invalid!
|
||||
|
||||
# Make sure the secret is at least 30 characters and all random,
|
||||
# no regular words or you'll be exposed to dictionary attacks.
|
||||
# You can use `rake secret` to generate a secure secret key.
|
||||
|
||||
# Make sure the secrets in this file are kept private
|
||||
# if you're sharing your code publicly.
|
||||
|
||||
common: &common
|
||||
tomorrow_io_key: <%= ENV['TOMORROW_IO_KEY'] %>
|
||||
smtp_email_from: <%= ENV['SMTP_EMAIL_FROM'] %>
|
||||
base_url: <%= ENV['BASE_URL'] %>
|
||||
|
||||
development:
|
||||
<<: *common
|
||||
secret_key_base: 27171ba40cad58521a51000b5e2f74f527a00765ce2041c7c9f903901d3d1dc57b19979e74ad9a46f9fb0044890bf7a6129f599718dfbceb66a569805da816fa
|
||||
|
||||
test:
|
||||
<<: *common
|
||||
tomorrow_io_key: 'MY_MEGA_TOMORROW_IO_KEY'
|
||||
secret_key_base: c72c35331a3c6ab7e521ee57c867bdb2a081150064e16f7e83f9455f135d1efe72db2d7a7cc43ff9d671de3ae2afd17fc9aee9d823a695940f7f3cbca8c67116
|
||||
smtp_email_from: 'from@some.email'
|
||||
|
||||
# Do not keep production secrets in the repository,
|
||||
# instead read values from the environment.
|
||||
production:
|
||||
<<: *common
|
||||
secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>
|
||||
25
worker-toolkit-flaredown/repo/backend/config/sidekiq.yml
Normal file
25
worker-toolkit-flaredown/repo/backend/config/sidekiq.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
default: &default
|
||||
:verbose: false
|
||||
:concurrency: 2
|
||||
|
||||
|
||||
# Set timeout to 8 on Heroku, longer if you manage your own systems.
|
||||
:timeout: 30
|
||||
|
||||
:pidfile: tmp/sidekiq.pid
|
||||
:queues:
|
||||
- default
|
||||
- mailers
|
||||
|
||||
development:
|
||||
<<: *default
|
||||
:verbose: true
|
||||
|
||||
test:
|
||||
<<: *default
|
||||
|
||||
staging:
|
||||
<<: *default
|
||||
|
||||
production:
|
||||
<<: *default
|
||||
@@ -0,0 +1,30 @@
|
||||
#
|
||||
# Symmetric Encryption for Ruby
|
||||
#
|
||||
---
|
||||
# For the development and test environments the test symmetric encryption keys
|
||||
# can be placed directly in the source code.
|
||||
# And therefore no RSA private key is required
|
||||
development: &development_defaults
|
||||
key: 1234567890ABCDEF
|
||||
iv: 1234567890ABCDEF
|
||||
cipher_name: aes-128-cbc
|
||||
encoding: :base64strict
|
||||
|
||||
test:
|
||||
<<: *development_defaults
|
||||
|
||||
production:
|
||||
private_rsa_key: <%= ENV['SYMMETRIC_ENCRYPTION_PRIVATE_RSA'] %>
|
||||
|
||||
# List Symmetric Key files in the order of current / latest first
|
||||
ciphers:
|
||||
-
|
||||
# Filename containing Symmetric Encryption Key encrypted using the
|
||||
# RSA public key derived from the private key above
|
||||
encrypted_key: <%= ENV['SYMMETRIC_ENCRYPTION_KEY_1'] %>
|
||||
iv: <%= ENV['SYMMETRIC_ENCRYPTION_KEY_1_IV'] %>
|
||||
cipher_name: aes-256-cbc
|
||||
encoding: :base64strict
|
||||
version: 1
|
||||
always_add_header: true
|
||||
Reference in New Issue
Block a user