Add description field to settings

pull/11971/head
Oliver Günther 2 years ago
parent 10d7cc5c7c
commit 97e7a9605b
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 19
      config/constants/settings/definition.rb
  2. 142
      config/constants/settings/definitions.rb
  3. 3
      lib/tasks/setting.rake

@ -36,10 +36,12 @@ module Settings
:env_alias :env_alias
attr_writer :value, attr_writer :value,
:description,
:allowed :allowed
def initialize(name, def initialize(name,
default:, default:,
description: nil,
format: nil, format: nil,
writable: true, writable: true,
allowed: nil, allowed: nil,
@ -52,6 +54,7 @@ module Settings
self.writable = writable self.writable = writable
self.allowed = allowed self.allowed = allowed
self.env_alias = env_alias self.env_alias = env_alias
self.description = description.presence || :"setting_#{name}"
end end
def default def default
@ -62,6 +65,14 @@ module Settings
cast(@value) cast(@value)
end end
def description
if @description.is_a?(Symbol)
I18n.t(@description, default: nil)
else
@description
end
end
def serialized? def serialized?
%i[array hash].include?(format) %i[array hash].include?(format)
end end
@ -124,6 +135,7 @@ module Settings
# @param [Object] default The default value the setting has if not overridden. # @param [Object] default The default value the setting has if not overridden.
# @param [nil] format The format the value is in e.g. symbol, array, hash, string. If a value is present, # @param [nil] format The format the value is in e.g. symbol, array, hash, string. If a value is present,
# the format is deferred. # the format is deferred.
# @param [nil] description A human-readable description of this setting.
# @param [TrueClass] writable Whether the value can be set in the UI. In case the value is set via file or ENV var, # @param [TrueClass] writable Whether the value can be set in the UI. In case the value is set via file or ENV var,
# this will be set to false later on and UI elements that refer to the definition will be disabled. # this will be set to false later on and UI elements that refer to the definition will be disabled.
# @param [nil] allowed The array of allowed values that can be assigned to the definition. # @param [nil] allowed The array of allowed values that can be assigned to the definition.
@ -136,6 +148,7 @@ module Settings
def add(name, def add(name,
default:, default:,
format: nil, format: nil,
description: nil,
writable: true, writable: true,
allowed: nil, allowed: nil,
env_alias: nil) env_alias: nil)
@ -145,6 +158,7 @@ module Settings
definition = new(name, definition = new(name,
format:, format:,
description:,
default:, default:,
writable:, writable:,
allowed:, allowed:,
@ -274,8 +288,8 @@ module Settings
env_var_hash_part env_var_hash_part
.scan(/(?:[a-zA-Z0-9]|__)+/) .scan(/(?:[a-zA-Z0-9]|__)+/)
.map do |seg| .map do |seg|
unescape_underscores(seg.downcase) unescape_underscores(seg.downcase)
end end
end end
# takes the path provided and transforms it into a deeply nested hash # takes the path provided and transforms it into a deeply nested hash
@ -329,6 +343,7 @@ module Settings
env_name_alias(definition) env_name_alias(definition)
].compact ].compact
end end
public :possible_env_names public :possible_env_names
def env_name_nested(definition) def env_name_nested(definition)

@ -39,24 +39,29 @@ Settings::Definition.define do
add :after_first_login_redirect_url, add :after_first_login_redirect_url,
format: :string, format: :string,
description: 'URL users logging in for the first time will be redirected to (e.g., a help screen)',
default: nil, default: nil,
writable: false writable: false
add :after_login_default_redirect_url, add :after_login_default_redirect_url,
description: 'Override URL to which logged in users are redirected instead of the My page',
format: :string, format: :string,
default: nil, default: nil,
writable: false writable: false
add :apiv3_cors_enabled, add :apiv3_cors_enabled,
description: 'Enable CORS headers for APIv3 server responses',
default: false default: false
add :apiv3_cors_origins, add :apiv3_cors_origins,
default: [] default: []
add :apiv3_docs_enabled, add :apiv3_docs_enabled,
description: 'Enable interactive APIv3 documentation as part of the application',
default: true default: true
add :apiv3_enable_basic_auth, add :apiv3_enable_basic_auth,
description: 'Enable API token or global basic authentication for APIv3 requests',
default: true, default: true,
writable: false writable: false
@ -77,21 +82,25 @@ Settings::Definition.define do
# Carrierwave storage type. Possible values are, among others, :file and :fog. # Carrierwave storage type. Possible values are, among others, :file and :fog.
# The latter requires further configuration. # The latter requires further configuration.
add :attachments_storage, add :attachments_storage,
description: 'File storage configuration',
default: :file, default: :file,
format: :symbol, format: :symbol,
allowed: %i[file fog], allowed: %i[file fog],
writable: false writable: false
add :attachments_storage_path, add :attachments_storage_path,
description: 'File storage disk location (only applicable for local file storage)',
format: :string, format: :string,
default: nil, default: nil,
writable: false writable: false
add :attachments_grace_period, add :attachments_grace_period,
description: 'Time to wait before uploaded files not attached to any container are removed',
default: 180, default: 180,
writable: false writable: false
add :auth_source_sso, add :auth_source_sso,
description: 'Configuration for Header-based Single Sign-On',
format: :hash, format: :hash,
default: nil, default: nil,
writable: false writable: false
@ -104,6 +113,7 @@ Settings::Definition.define do
# user: admin # user: admin
# password: 123456 # password: 123456
add :authentication, add :authentication,
description: 'Configuration options for global basic auth',
format: :hash, format: :hash,
default: nil, default: nil,
writable: false writable: false
@ -117,14 +127,17 @@ Settings::Definition.define do
default: 0 default: 0
add :autologin_cookie_name, add :autologin_cookie_name,
description: 'Cookie name for autologin cookie',
default: 'autologin', default: 'autologin',
writable: false writable: false
add :autologin_cookie_path, add :autologin_cookie_path,
description: 'Cookie path for autologin cookie',
default: '/', default: '/',
writable: false writable: false
add :autologin_cookie_secure, add :autologin_cookie_secure,
description: 'Cookie secure mode for autologin cookie',
default: false, default: false,
writable: false writable: false
@ -134,32 +147,39 @@ Settings::Definition.define do
allowed: -> { Redmine::I18n.all_languages } allowed: -> { Redmine::I18n.all_languages }
add :avatar_link_expiry_seconds, add :avatar_link_expiry_seconds,
description: 'Cache duration for avatar image API responses',
default: 24.hours.to_i, default: 24.hours.to_i,
writable: false writable: false
# Allow users with the required permissions to create backups via the web interface or API. # Allow users with the required permissions to create backups via the web interface or API.
add :backup_enabled, add :backup_enabled,
description: 'Enable application backups through the UI',
default: true, default: true,
writable: false writable: false
add :backup_daily_limit, add :backup_daily_limit,
description: 'Maximum number of application backups allowed per day',
default: 3, default: 3,
writable: false writable: false
add :backup_initial_waiting_period, add :backup_initial_waiting_period,
description: 'Wait time before newly created backup tokens are usable',
default: 24.hours, default: 24.hours,
format: :integer, format: :integer,
writable: false writable: false
add :backup_include_attachments, add :backup_include_attachments,
description: 'Allow inclusion of attachments in application backups',
default: true, default: true,
writable: false writable: false
add :backup_attachment_size_max_sum_mb, add :backup_attachment_size_max_sum_mb,
description: 'Maximum limit of attachment size to include into application backups',
default: 1024, default: 1024,
writable: false writable: false
add :blacklisted_routes, add :blacklisted_routes,
description: 'Blocked routes to prevent access to certain modules or pages',
default: [], default: [],
writable: false writable: false
@ -167,15 +187,19 @@ Settings::Definition.define do
default: true default: true
add :boards_demo_data_available, add :boards_demo_data_available,
description: 'Internal setting determining availability of demo seed data',
default: false default: false
add :brute_force_block_minutes, add :brute_force_block_minutes,
description: 'Number of minutes to block users after presumed brute force attack',
default: 30 default: 30
add :brute_force_block_after_failed_logins, add :brute_force_block_after_failed_logins,
description: 'Number of login attempts per user before assuming brute force attack',
default: 20 default: 20
add :cache_expires_in_seconds, add :cache_expires_in_seconds,
description: 'Expiration time for memcache entries, empty for no expiry be default',
format: :integer, format: :integer,
default: nil, default: nil,
writable: false writable: false
@ -185,39 +209,47 @@ Settings::Definition.define do
# use dalli defaults for memcache # use dalli defaults for memcache
add :cache_memcache_server, add :cache_memcache_server,
description: 'The memcache server host and IP',
format: :string, format: :string,
default: nil, default: nil,
writable: false writable: false
add :cache_namespace, add :cache_namespace,
format: :string, format: :string,
description: 'Namespace for cache keys, useful when multiple applications use a single memcache server',
default: nil, default: nil,
writable: false writable: false
add :commit_fix_done_ratio, add :commit_fix_done_ratio,
description: 'Progress to apply when commit fixes work package',
default: 100 default: 100
add :commit_fix_keywords, add :commit_fix_keywords,
description: 'Keywords to look for in commit for fixing work packages',
default: 'fixes,closes' default: 'fixes,closes'
add :commit_fix_status_id, add :commit_fix_status_id,
description: 'Assigned status when fixing keyword is found',
format: :integer, format: :integer,
default: nil, default: nil,
allowed: -> { Status.pluck(:id) + [nil] } allowed: -> { Status.pluck(:id) + [nil] }
# encoding used to convert commit logs to UTF-8
add :commit_logs_encoding, add :commit_logs_encoding,
description: "Encoding used to convert commit logs to UTF-8",
default: 'UTF-8' default: 'UTF-8'
add :commit_logtime_activity_id, add :commit_logtime_activity_id,
description: :setting_commit_logtime_activity_id,
format: :integer, format: :integer,
default: nil, default: nil,
allowed: -> { TimeEntryActivity.pluck(:id) + [nil] } allowed: -> { TimeEntryActivity.pluck(:id) + [nil] }
add :commit_logtime_enabled, add :commit_logtime_enabled,
description: "Allow logging time through commit message",
default: false default: false
add :commit_ref_keywords, add :commit_ref_keywords,
description: "Keywords used in commits for referencing work packages",
default: 'refs,references,IssueID' default: 'refs,references,IssueID'
add :consent_decline_mail, add :consent_decline_mail,
@ -234,7 +266,7 @@ Settings::Definition.define do
add :consent_info, add :consent_info,
default: { default: {
en: "## Consent\n\nYou need to agree to the [privacy and security policy]" + en: "## Consent\n\nYou need to agree to the [privacy and security policy]" +
"(https://www.openproject.org/data-privacy-and-security/) of this OpenProject instance." "(https://www.openproject.org/data-privacy-and-security/) of this OpenProject instance."
} }
# Indicates whether or not users need to consent to something such as privacy policy. # Indicates whether or not users need to consent to something such as privacy policy.
@ -246,10 +278,12 @@ Settings::Definition.define do
# Allow in-context translations to be loaded with CSP # Allow in-context translations to be loaded with CSP
add :crowdin_in_context_translations, add :crowdin_in_context_translations,
description: 'Add crowdin in-context translations helper',
default: true, default: true,
writable: false writable: false
add :database_cipher_key, add :database_cipher_key,
description: 'Encryption key for repository credentials',
format: :string, format: :string,
default: nil, default: nil,
writable: false writable: false
@ -270,10 +304,12 @@ Settings::Definition.define do
].freeze ].freeze
add :default_auto_hide_popups, add :default_auto_hide_popups,
description: 'Whether to automatically hide success notifications by default',
default: true default: true
# user configuration # user configuration
add :default_comment_sort_order, add :default_comment_sort_order,
description: 'Default sort order for activities',
default: 'asc', default: 'asc',
writable: false writable: false
@ -299,55 +335,60 @@ Settings::Definition.define do
add :diff_max_lines_displayed, add :diff_max_lines_displayed,
default: 1500 default: 1500
# only applicable in conjunction with fog (effectively S3) attachments
# which will be uploaded directly to the cloud storage rather than via OpenProject's
# server process.
add :direct_uploads, add :direct_uploads,
description: 'Enable direct uploads to AWS S3. Only applicable with enabled Fog / AWS S3 configuration',
default: true, default: true,
writable: false writable: false
add :disable_browser_cache, add :disable_browser_cache,
description: 'Prevent browser from caching any logged-in responses for security reasons',
default: true, default: true,
writable: false writable: false
# allow to disable default modules # allow to disable default modules
add :disabled_modules, add :disabled_modules,
description: 'A list of module names to prevent access to in the application',
default: [], default: [],
allowed: -> { OpenProject::AccessControl.available_project_modules.map(&:to_s) },
writable: false writable: false
add :disable_password_choice, add :disable_password_choice,
description: "If enabled a user's password cannot be set to an arbitrary value, but can only be randomized.",
default: false, default: false,
writable: false writable: false
add :disable_password_login, add :disable_password_login,
description: 'Disable internal logins and instead only allow SSO through OmniAuth.',
default: false, default: false,
writable: false writable: false
add :display_subprojects_work_packages, add :display_subprojects_work_packages,
default: true default: true
# Destroy all sessions for current_user on logout
add :drop_old_sessions_on_logout, add :drop_old_sessions_on_logout,
description: 'Destroy all sessions for current_user on logout',
default: true, default: true,
writable: false writable: false
# Destroy all sessions for current_user on login
add :drop_old_sessions_on_login, add :drop_old_sessions_on_login,
description: 'Destroy all sessions for current_user on login',
default: false, default: false,
writable: false writable: false
add :edition, add :edition,
format: :string, format: :string,
default: 'standard', default: 'standard',
description: 'OpenProject edition mode',
writable: false, writable: false,
allowed: %w[standard bim] allowed: %w[standard bim]
add :ee_manager_visible, add :ee_manager_visible,
description: 'Show or hide the Enterprise configuration page and enterprise banners',
default: true, default: true,
writable: false writable: false
# Enable internal asset server
add :enable_internal_assets_server, add :enable_internal_assets_server,
description: 'Serve assets through the Rails internal asset server',
default: false, default: false,
writable: false writable: false
@ -386,14 +427,17 @@ Settings::Definition.define do
# Allow connections for trial creation and booking # Allow connections for trial creation and booking
add :enterprise_trial_creation_host, add :enterprise_trial_creation_host,
description: 'Host for EE trial service',
default: 'https://augur.openproject.com', default: 'https://augur.openproject.com',
writable: false writable: false
add :enterprise_chargebee_site, add :enterprise_chargebee_site,
description: 'Site name for EE trial service',
default: 'openproject-enterprise', default: 'openproject-enterprise',
writable: false writable: false
add :enterprise_plan, add :enterprise_plan,
description: 'Default EE selected plan',
default: 'enterprise-on-premises---euro---1-year', default: 'enterprise-on-premises---euro---1-year',
writable: false writable: false
@ -413,26 +457,30 @@ Settings::Definition.define do
format: :integer, format: :integer,
allowed: [1, 4] allowed: [1, 4]
# Configure fog, e.g. when using an S3 uploader
add :fog, add :fog,
description: 'Configure fog, e.g. when using an S3 uploader',
default: {} default: {}
add :fog_download_url_expires_in, add :fog_download_url_expires_in,
description: 'Expiration time in seconds of created shared presigned URLs',
default: 21600, # 6h by default as 6 hours is max in S3 when using IAM roles default: 21600, # 6h by default as 6 hours is max in S3 when using IAM roles
writable: false writable: false
# Additional / overridden help links # Additional / overridden help links
add :force_help_link, add :force_help_link,
description: 'You can set a custom URL for the help button in application header menu.',
format: :string, format: :string,
default: nil, default: nil,
writable: false writable: false
add :force_formatting_help_link, add :force_formatting_help_link,
description: 'You can set a custom URL for the help button in the WYSIWYG editor.',
format: :string, format: :string,
default: nil, default: nil,
writable: false writable: false
add :forced_single_page_size, add :forced_single_page_size,
description: 'Forced page size for manually sorted work package views',
default: 250 default: 250
add :host_name, add :host_name,
@ -440,6 +488,7 @@ Settings::Definition.define do
# Health check configuration # Health check configuration
add :health_checks_authentication_password, add :health_checks_authentication_password,
description: 'Add an authentication challenge for the /health_check endpoint',
format: :string, format: :string,
default: nil, default: nil,
writable: false writable: false
@ -447,18 +496,21 @@ Settings::Definition.define do
# Maximum number of backed up jobs (that are not yet executed) # Maximum number of backed up jobs (that are not yet executed)
# before health check fails # before health check fails
add :health_checks_jobs_queue_count_threshold, add :health_checks_jobs_queue_count_threshold,
description: 'Set threshold of backed up background jobs to fail health check',
format: :integer, format: :integer,
default: 50, default: 50,
writable: false writable: false
## Maximum number of minutes that jobs have not yet run after their designated 'run_at' time ## Maximum number of minutes that jobs have not yet run after their designated 'run_at' time
add :health_checks_jobs_never_ran_minutes_ago, add :health_checks_jobs_never_ran_minutes_ago,
description: 'Set threshold of outstanding background jobs to fail health check',
format: :integer, format: :integer,
default: 5, default: 5,
writable: false writable: false
## Maximum number of unprocessed requests in puma's backlog. ## Maximum number of unprocessed requests in puma's backlog.
add :health_checks_backlog_threshold, add :health_checks_backlog_threshold,
description: 'Set threshold of outstanding HTTP requests to fail health check',
format: :integer, format: :integer,
default: 20, default: 20,
writable: false writable: false
@ -466,15 +518,17 @@ Settings::Definition.define do
# Default gravatar image, set to something other than 404 # Default gravatar image, set to something other than 404
# to ensure a default is returned # to ensure a default is returned
add :gravatar_fallback_image, add :gravatar_fallback_image,
description: 'Set default gravatar image fallback',
default: '404', default: '404',
writable: false writable: false
add :hidden_menu_items, add :hidden_menu_items,
description: 'Hide menu items in the menu sidebar for each main menu (such as Administration and Projects).',
default: {}, default: {},
writable: false writable: false
# Impressum link to be set, nil by default (= hidden)
add :impressum_link, add :impressum_link,
description: 'Impressum link to be set, hidden by default',
format: :string, format: :string,
default: nil, default: nil,
writable: false writable: false
@ -488,6 +542,7 @@ Settings::Definition.define do
default: nil default: nil
add :internal_password_confirmation, add :internal_password_confirmation,
description: 'Require password confirmations for certain administrative actions',
default: true, default: true,
writable: false writable: false
@ -497,24 +552,24 @@ Settings::Definition.define do
add :journal_aggregation_time_minutes, add :journal_aggregation_time_minutes,
default: 5 default: 5
# Allow override of LDAP options
add :ldap_force_no_page, add :ldap_force_no_page,
description: 'Force LDAP to respond as a single page, in case paged responses do not work with your server.',
format: :string, format: :string,
default: nil, default: nil,
writable: false writable: false
# Allow users to manually sync groups in a different way
# than the provided job using their own cron
add :ldap_groups_disable_sync_job, add :ldap_groups_disable_sync_job,
description: 'Deactivate regular synchronization job for groups in case scheduled as a separate cronjob',
default: false, default: false,
writable: false writable: false
add :ldap_users_disable_sync_job, add :ldap_users_disable_sync_job,
description: 'Deactive user attributes synchronization from LDAP',
default: false, default: false,
writable: false writable: false
# Update users' status through the synchronization job
add :ldap_users_sync_status, add :ldap_users_sync_status,
description: 'Enable user status (locked/unlocked) synchronization from LDAP',
format: :boolean, format: :boolean,
default: false, default: false,
writable: false writable: false
@ -525,7 +580,9 @@ Settings::Definition.define do
writable: true writable: true
add :log_level, add :log_level,
description: 'Set the OpenProject logger level',
default: Rails.env.development? ? 'debug' : 'info', default: Rails.env.development? ? 'debug' : 'info',
allowed: %w[debug info warn error fatal],
writable: false writable: false
add :log_requesting_user, add :log_requesting_user,
@ -533,6 +590,7 @@ Settings::Definition.define do
# Use lograge to format logs, off by default # Use lograge to format logs, off by default
add :lograge_formatter, add :lograge_formatter,
description: 'Use lograge formatter for outputting logs',
default: nil, default: nil,
format: :string, format: :string,
writable: false writable: false
@ -541,6 +599,7 @@ Settings::Definition.define do
default: false default: false
add :lost_password, add :lost_password,
description: 'Activate or deactivate lost password form',
default: true default: true
add :mail_from, add :mail_from,
@ -564,10 +623,13 @@ Settings::Definition.define do
add :main_content_language, add :main_content_language,
default: 'english', default: 'english',
writable: false description: 'Main content language for PostgreSQL full text features',
writable: false,
allowed: %w[danish dutch english finnish french german hungarian
italian norwegian portuguese romanian russian simple spanish swedish turkish]
# Check for missing migrations in internal errors
add :migration_check_on_exceptions, add :migration_check_on_exceptions,
description: 'Check for missing migrations in internal errors',
default: true, default: true,
writable: false writable: false
@ -578,14 +640,18 @@ Settings::Definition.define do
allowed: -> { Role.pluck(:id) } allowed: -> { Role.pluck(:id) }
add :oauth_allow_remapping_of_existing_users, add :oauth_allow_remapping_of_existing_users,
description: 'When set to false, prevent users from other identity providers to take over accounts connected ' \
'to another identity provider.',
default: true default: true
add :omniauth_direct_login_provider, add :omniauth_direct_login_provider,
description: 'Clicking on login sends a login request to the specified OmniAuth provider.',
format: :string, format: :string,
default: nil, default: nil,
writable: false writable: false
add :override_bcrypt_cost_factor, add :override_bcrypt_cost_factor,
description: "Set a custom BCrypt cost factor for deriving a user's bcrypt hash.",
format: :string, format: :string,
default: nil, default: nil,
writable: false writable: false
@ -597,10 +663,12 @@ Settings::Definition.define do
default: '08:00' default: '08:00'
add :onboarding_video_url, add :onboarding_video_url,
description: 'Onboarding guide instructional video URL',
default: 'https://player.vimeo.com/video/163426858?autoplay=1', default: 'https://player.vimeo.com/video/163426858?autoplay=1',
writable: false writable: false
add :onboarding_enabled, add :onboarding_enabled,
description: 'Enable or disable onboarding guided tour for new users',
default: true, default: true,
writable: false writable: false
@ -634,30 +702,31 @@ Settings::Definition.define do
format: :string format: :string
add :rails_asset_host, add :rails_asset_host,
description: 'Custom asset hostname for serving assets (e.g., Cloudfront)',
format: :string, format: :string,
default: nil, default: nil,
writable: false writable: false
add :rails_cache_store, add :rails_cache_store,
description: 'Set cache store implemenation to use with OpenProject',
format: :symbol, format: :symbol,
default: :file_store, default: :file_store,
writable: false, writable: false,
allowed: %i[file_store memcache] allowed: %i[file_store memcache]
# url-path prefix
add :rails_relative_url_root, add :rails_relative_url_root,
description: 'Set a URL prefix / base path to run OpenProject under, e.g., host.tld/openproject',
default: '', default: '',
writable: false writable: false
# Assume we're running in an TLS terminated connection.
add :https, add :https,
description: 'Set assumed connection security for the Rails processes',
format: :boolean, format: :boolean,
default: -> { Rails.env.production? }, default: -> { Rails.env.production? },
writable: false writable: false
# Allow disabling of HSTS headers and http -> https redirects
# for non-localhost hosts
add :hsts, add :hsts,
description: 'Allow disabling of HSTS headers and http -> https redirects',
format: :boolean, format: :boolean,
default: true, default: true,
writable: false writable: false
@ -668,7 +737,9 @@ Settings::Definition.define do
}, },
writable: false writable: false
add :report_incoming_email_errors, default: true add :report_incoming_email_errors,
description: 'Respond to incoming mails with error details',
default: true
add :repositories_automatic_managed_vendor, add :repositories_automatic_managed_vendor,
default: nil, default: nil,
@ -726,6 +797,7 @@ Settings::Definition.define do
default: true default: true
add :security_badge_url, add :security_badge_url,
description: 'URL of the update check badge',
default: "https://releases.openproject.com/v1/check.svg", default: "https://releases.openproject.com/v1/check.svg",
writable: false writable: false
@ -733,11 +805,13 @@ Settings::Definition.define do
default: 2 default: 2
add :sendmail_arguments, add :sendmail_arguments,
description: 'Arguments to call sendmail with in case it is configured as outgoing email setup',
format: :string, format: :string,
default: "-i", default: "-i",
writable: false writable: false
add :sendmail_location, add :sendmail_location,
description: 'Location of sendmail to call if it is configured as outgoing email setup',
format: :string, format: :string,
default: "/usr/sbin/sendmail" default: "/usr/sbin/sendmail"
@ -745,14 +819,16 @@ Settings::Definition.define do
add :appsignal_frontend_key, add :appsignal_frontend_key,
format: :string, format: :string,
default: nil, default: nil,
description: 'Appsignal API key for JavaScript error reporting',
writable: false writable: false
add :session_cookie_name, add :session_cookie_name,
description: 'Set session cookie name',
default: '_open_project_session', default: '_open_project_session',
writable: false writable: false
# where to store session data
add :session_store, add :session_store,
description: 'Where to store session data',
default: :active_record_store, default: :active_record_store,
writable: false writable: false
@ -763,28 +839,28 @@ Settings::Definition.define do
default: 120 default: 120
add :show_community_links, add :show_community_links,
description: 'Enable or disable links to OpenProject community instances',
default: true, default: true,
writable: false writable: false
# Show pending migrations as warning bar
add :show_pending_migrations_warning, add :show_pending_migrations_warning,
description: 'Enable or disable warning bar in case of pending migrations',
default: true, default: true,
writable: false writable: false
# Show mismatched protocol/hostname warning
# in settings where they must differ this can be disabled
add :show_setting_mismatch_warning, add :show_setting_mismatch_warning,
description: 'Show mismatched protocol/hostname warning. In cases where they must differ this can be disabled',
default: true, default: true,
writable: false writable: false
# Render storage information # Render storage information
add :show_storage_information, add :show_storage_information,
description: 'Show available and taken storage information under administration / info',
default: true, default: true,
writable: false writable: false
# Render warning bars (pending migrations, deprecation, unsupported browsers)
# Set to false to globally disable this for all users!
add :show_warning_bars, add :show_warning_bars,
description: 'Render warning bars (pending migrations, deprecation, unsupported browsers)',
default: true, default: true,
writable: false writable: false
@ -799,6 +875,7 @@ Settings::Definition.define do
env_alias: 'SMTP_ENABLE_STARTTLS_AUTO' env_alias: 'SMTP_ENABLE_STARTTLS_AUTO'
add :smtp_openssl_verify_mode, add :smtp_openssl_verify_mode,
description: 'Globally set verify mode for OpenSSL. Careful: Setting to none will disable any SSL verification!',
format: :string, format: :string,
default: "peer", default: "peer",
allowed: %w[none peer client_once fail_if_no_peer_cert], allowed: %w[none peer client_once fail_if_no_peer_cert],
@ -835,13 +912,15 @@ Settings::Definition.define do
env_alias: 'SMTP_PASSWORD' env_alias: 'SMTP_PASSWORD'
add :software_name, add :software_name,
description: 'Override software application name',
default: 'OpenProject' default: 'OpenProject'
add :software_url, add :software_url,
description: 'Override software application URL',
default: 'https://www.openproject.org/' default: 'https://www.openproject.org/'
# Slow query logging threshold in ms
add :sql_slow_query_threshold, add :sql_slow_query_threshold,
description: 'Time limit in ms after which queries will be logged as slow queries',
default: 2000, default: 2000,
writable: false writable: false
@ -850,8 +929,8 @@ Settings::Definition.define do
format: :integer, format: :integer,
allowed: [1, 6, 7] allowed: [1, 6, 7]
# enable statsd metrics (currently puma only) by configuring host
add :statsd, add :statsd,
description: 'enable statsd metrics (currently puma only) by configuring host',
default: { default: {
'host' => nil, 'host' => nil,
'port' => 8125 'port' => 8125
@ -859,9 +938,11 @@ Settings::Definition.define do
writable: false writable: false
add :sys_api_enabled, add :sys_api_enabled,
description: 'Enable internal system API for setting up managed repositories',
default: false default: false
add :sys_api_key, add :sys_api_key,
description: 'Internal system API key for setting up managed repositories',
default: nil, default: nil,
format: :string format: :string
@ -889,6 +970,7 @@ Settings::Definition.define do
allowed: -> { User::USER_FORMATS_STRUCTURE.keys } allowed: -> { User::USER_FORMATS_STRUCTURE.keys }
add :web, add :web,
description: 'Web worker count and threads configuration',
default: { default: {
'workers' => 2, 'workers' => 2,
'timeout' => 120, 'timeout' => 120,
@ -936,11 +1018,13 @@ Settings::Definition.define do
default: false default: false
add :working_days, add :working_days,
description: 'Set working days of the week (Array of 1 to 7, where 1=Monday, 7=Sunday)',
format: :array, format: :array,
allowed: Array(1..7), allowed: Array(1..7),
default: Array(1..5) # Sat, Sun being non-working days default: Array(1..5) # Sat, Sun being non-working days
add :youtube_channel, add :youtube_channel,
description: 'Link to YouTube channel in help menu',
default: 'https://www.youtube.com/c/OpenProjectCommunity', default: 'https://www.youtube.com/c/OpenProjectCommunity',
writable: false writable: false
end end

@ -62,7 +62,8 @@ namespace :setting do
desc 'List the supported environment variables to override settings' desc 'List the supported environment variables to override settings'
task available_envs: :environment do task available_envs: :environment do
Settings::Definition.all.sort_by(&:name).each do |definition| Settings::Definition.all.sort_by(&:name).each do |definition|
puts "#{Settings::Definition.possible_env_names(definition).first} (default=#{definition.default.inspect})" puts "#{Settings::Definition.possible_env_names(definition).first}" \
" (default=#{definition.default.inspect}) #{definition.description}"
end end
end end
end end

Loading…
Cancel
Save