2019-08-18 14:51:37 +02:00
|
|
|
require_relative 'boot'
|
|
|
|
|
|
|
|
|
|
require 'rails/all'
|
|
|
|
|
|
|
|
|
|
# Require the gems listed in Gemfile, including any gems
|
|
|
|
|
# you've limited to :test, :development, or :production.
|
|
|
|
|
Bundler.require(*Rails.groups)
|
|
|
|
|
|
|
|
|
|
module App
|
|
|
|
|
class Application < Rails::Application
|
|
|
|
|
# Initialize configuration defaults for originally generated Rails version.
|
|
|
|
|
config.load_defaults 6.0
|
|
|
|
|
|
|
|
|
|
# Settings in config/environments/* take precedence over those specified here.
|
|
|
|
|
# Application configuration can go into files in config/initializers
|
|
|
|
|
# -- all .rb files in that directory are automatically loaded after loading
|
|
|
|
|
# the framework and any gems in your application.
|
2019-09-23 12:14:35 +02:00
|
|
|
|
2024-03-24 18:06:36 +01:00
|
|
|
# If configured, add trusted proxy to the list of trusted proxies
|
|
|
|
|
config.middleware.insert_after ActionDispatch::RemoteIp, Rack::Attack
|
|
|
|
|
if ENV["TRUSTED_PROXY"]
|
|
|
|
|
config.action_dispatch.trusted_proxies = ActionDispatch::RemoteIp::TRUSTED_PROXIES + [IPAddr.new(ENV["TRUSTED_PROXY"])]
|
|
|
|
|
end
|
|
|
|
|
|
2022-08-05 18:15:17 +02:00
|
|
|
def base_url
|
|
|
|
|
ENV["BASE_URL"]
|
|
|
|
|
end
|
|
|
|
|
|
2022-07-18 10:47:54 +02:00
|
|
|
def multi_tenancy?
|
|
|
|
|
ENV["MULTI_TENANCY"] == "true"
|
2019-09-23 12:14:35 +02:00
|
|
|
end
|
2019-09-23 15:52:00 +02:00
|
|
|
|
2019-09-23 16:10:25 +02:00
|
|
|
def posts_per_page
|
2022-07-18 10:47:54 +02:00
|
|
|
15
|
2019-09-23 16:10:25 +02:00
|
|
|
end
|
2024-05-03 18:11:07 +02:00
|
|
|
|
|
|
|
|
def trial_period_days
|
|
|
|
|
ENV.key?("TRIAL_PERIOD_DAYS") ? ENV["TRIAL_PERIOD_DAYS"].to_i.days : 7.days
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def stripe_secret_key
|
|
|
|
|
ENV["STRIPE_SECRET_KEY"]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def stripe_public_key
|
|
|
|
|
ENV["STRIPE_PUBLIC_KEY"]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def stripe_endpoint_secret
|
|
|
|
|
ENV["STRIPE_ENDPOINT_SECRET"]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def stripe_manage_subscription_url
|
|
|
|
|
ENV["STRIPE_MANAGE_SUBSCRIPTION_URL"]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def stripe_monthly_lookup_key
|
|
|
|
|
ENV["STRIPE_MONTHLY_LOOKUP_KEY"]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def stripe_yearly_lookup_key
|
|
|
|
|
ENV["STRIPE_YEARLY_LOOKUP_KEY"]
|
|
|
|
|
end
|
2019-08-18 14:51:37 +02:00
|
|
|
end
|
|
|
|
|
end
|