Files
simple-aircraft-manager-rails/config/application.rb
T
rickyandClaude Opus 5.5 9662c7ae16 Time zones: each person's own, and TZ for the installation
- Requests run in the viewer's zone: Profile -> Time zone, else their
  device's (a tz cookie set from the browser), else the installation's;
  times show in it and "today" is the local date (a new flight's date)
- Docker's TZ sets the installation zone (default UTC): scheduled jobs run
  on its clock (recurring.yml), and it's used before a device's zone is known
- The weekly reminder email is worked out in the recipient's zone
- Signatures, record history and exports keep exact UTC timestamps
- users.time_zone; README, .env.example and guide updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 07:49:22 -05:00

50 lines
2.2 KiB
Ruby

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 SimpleAircraftManager
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 8.1
# Language: every config/locales/<locale>.yml is available; APP_LOCALE
# picks one (default English). Strings it lacks fall back to English.
config.i18n.available_locales = Dir[File.join(__dir__, "locales", "*.yml")].map { File.basename(_1, ".yml").to_sym }
config.i18n.default_locale = ENV.fetch("APP_LOCALE", "en").to_sym
config.i18n.fallbacks = [ :en ]
# 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[active_storage assets tasks])
# File links (rails_blob_path) stop working after this, so a link copied
# from a page, or seen before access was removed, doesn't work forever.
config.active_storage.urls_expire_in = 1.hour
config.action_dispatch.default_headers.merge!(
"Permissions-Policy" => "camera=(), microphone=(), geolocation=(), payment=(), usb=(), interest-cohort=()",
"Cross-Origin-Opener-Policy" => "same-origin"
)
# 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.
#
# The installation's time zone, from Docker's standard TZ (e.g.
# "America/New_York"): for scheduled jobs and for anyone whose device zone
# isn't known yet. Each person's own zone comes from Profile or their
# device (TimeZones). Not a zone name (unset, or e.g. ":/etc/localtime"): UTC.
config.time_zone = ActiveSupport::TimeZone[ENV["TZ"].to_s] ? ENV["TZ"] : "UTC"
# config.eager_load_paths << Rails.root.join("extras")
# Small resized copies of photos (squawk thumbnails), made with libvips.
config.active_storage.variant_processor = :vips
end
end