1 # Guard against deployments with old-style application.yml configurations
2 # Otherwise, admins might not be aware that they are now silently ignored
3 # and major problems could occur
4 # rubocop:disable Rails/Output, Rails/Exit
5 if Rails.root.join("config/application.yml").exist?
6 puts "The config/application.yml file is no longer supported."
8 puts "Default settings are now found in config/settings.yml and you"
9 puts "can override these in config/settings.local.yml."
11 puts "To prevent unexpected behaviour, please copy any custom"
12 puts "settings to config/settings.local.yml and then remove"
13 puts "your config/application.yml file."
16 # rubocop:enable Rails/Output, Rails/Exit
18 # Allowed status values
19 unless Object.const_defined?(:ALLOWED_STATUS)
21 "online", # online and operating normally
22 "api_readonly", # site online but API in read-only mode
23 "api_offline", # site online but API offline
24 "database_readonly", # database and site in read-only mode
25 "database_offline", # database offline with site in emergency mode
26 "gpx_offline" # gpx storage offline
30 Config.setup do |config|
31 # Name of the constant exposing loaded settings
32 config.const_name = "Settings"
34 # Ability to remove elements of the array set in earlier loaded settings file. For example value: '--'.
36 # config.knockout_prefix = nil
38 # Overwrite an existing value when merging a `nil` value.
39 # When set to `false`, the existing value is retained after merge.
41 # config.merge_nil_values = true
43 # Overwrite arrays found in previously loaded settings file. When set to `false`, arrays will be merged.
45 # config.overwrite_arrays = true
47 # Load environment variables from the `ENV` object and override any settings defined in files.
51 # Define ENV variable prefix deciding which variables to load into config.
53 config.env_prefix = "OPENSTREETMAP"
55 # What string to use as level separator for settings loaded from ENV variables. Default value of '.' works well
56 # with Heroku, but you might want to change it for example for '__' to easy override settings from command line, where
57 # using dots in variable names might not be allowed (eg. Bash).
59 config.env_separator = "_"
61 # Ability to process variables names:
63 # * :downcase - convert to lower case
65 config.env_converter = :downcase
67 # Parse numeric values as integers instead of strings.
69 # config.env_parse_values = true
71 # Validate presence and type of specific config values. Check https://github.com/dry-rb/dry-validation for details.
74 required(:api_version).filled(:str?)
75 required(:max_request_area).filled(:number?)
76 required(:max_note_request_area).filled(:number?)
77 required(:tracepoints_per_page).filled(:int?)
78 required(:max_number_of_way_nodes).filled(:int?)
79 required(:max_number_of_relation_members).filled(:int?)
80 required(:max_issues_count).filled(:int?)
81 required(:api_timeout).filled(:int?)
82 required(:imagery_blacklist).maybe(:array?)
83 required(:status).filled(:str?, :included_in? => ALLOWED_STATUS)
84 required(:avatar_storage).filled(:str?)
85 required(:trace_file_storage).filled(:str?)
86 required(:trace_image_storage).filled(:str?)
87 required(:trace_icon_storage).filled(:str?)