diff options
Diffstat (limited to 'config/application.rb')
-rw-r--r-- | config/application.rb | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/config/application.rb b/config/application.rb index 8753d3304a5..552a68f6046 100644 --- a/config/application.rb +++ b/config/application.rb @@ -41,7 +41,6 @@ module Gitlab config.active_support.executor_around_test_case = nil # New default is true config.active_support.isolation_level = nil # New default is thread config.active_support.key_generator_hash_digest_class = nil # New default is OpenSSL::Digest::SHA256 - config.active_support.remove_deprecated_time_with_zone_name = nil # New default is true config.active_support.use_rfc4122_namespaced_uuids = nil # New default is true # Rails 6.1 @@ -214,7 +213,7 @@ module Gitlab /^title$/, /^hook$/ ] - config.filter_parameters += %i( + config.filter_parameters += %i[ certificate encrypted_key import_url @@ -230,7 +229,8 @@ module Gitlab content sharedSecret redirect - ) + question + ] # This config option can be removed after Rails 7.1 by https://gitlab.com/gitlab-org/gitlab/-/issues/416270 config.active_support.use_rfc4122_namespaced_uuids = true @@ -258,6 +258,9 @@ module Gitlab # Enable the asset pipeline config.assets.enabled = true + # Disable adding field_with_errors wrapper to form elements + config.action_view.field_error_proc = proc { |html_tag, instance| html_tag } + # Support legacy unicode file named img emojis, `1F939.png` config.assets.paths << TanukiEmoji.images_path config.assets.paths << "#{config.root}/vendor/assets/fonts" @@ -279,7 +282,6 @@ module Gitlab config.assets.precompile << "page_bundles/admin/elasticsearch_form.css" config.assets.precompile << "page_bundles/admin/geo_sites.css" config.assets.precompile << "page_bundles/admin/geo_replicable.css" - config.assets.precompile << "page_bundles/admin/jobs_index.css" config.assets.precompile << "page_bundles/alert_management_details.css" config.assets.precompile << "page_bundles/alert_management_settings.css" config.assets.precompile << "page_bundles/billings.css" @@ -337,7 +339,6 @@ module Gitlab config.assets.precompile << "page_bundles/profiles/preferences.css" config.assets.precompile << "page_bundles/project.css" config.assets.precompile << "page_bundles/projects_edit.css" - config.assets.precompile << "page_bundles/projects_usage_quotas.css" config.assets.precompile << "page_bundles/promotions.css" config.assets.precompile << "page_bundles/releases.css" config.assets.precompile << "page_bundles/remote_development.css" @@ -457,30 +458,30 @@ module Gitlab allow do origins { |source, env| source == Gitlab::CurrentSettings.jira_connect_proxy_url } - resource '/-/jira_connect/oauth_application_id', headers: :any, credentials: false, methods: %i(get options) + resource '/-/jira_connect/oauth_application_id', headers: :any, credentials: false, methods: %i[get options] end allow do origins { |source, env| source == Gitlab::CurrentSettings.jira_connect_proxy_url } - resource '/-/jira_connect/subscriptions.json', headers: :any, credentials: false, methods: %i(get options) + resource '/-/jira_connect/subscriptions.json', headers: :any, credentials: false, methods: %i[get options] end allow do origins { |source, env| source == Gitlab::CurrentSettings.jira_connect_proxy_url } - resource '/-/jira_connect/subscriptions/*', headers: :any, credentials: false, methods: %i(delete options) + resource '/-/jira_connect/subscriptions/*', headers: :any, credentials: false, methods: %i[delete options] end # Cross-origin requests must be enabled for the Authorization code with PKCE OAuth flow when used from a browser. - %w(/oauth/token /oauth/revoke).each do |oauth_path| + %w[/oauth/token /oauth/revoke].each do |oauth_path| allow do origins '*' resource oauth_path, # These headers are added as defaults to axios. # See: https://gitlab.com/gitlab-org/gitlab/-/blob/dd1e70d3676891025534dc4a1e89ca9383178fe7/app/assets/javascripts/lib/utils/axios_utils.js#L8) # It's added to declare that this is a XHR request and add the CSRF token without which Rails may reject the request from the frontend. - headers: %w(Authorization X-CSRF-Token X-Requested-With), + headers: %w[Authorization X-CSRF-Token X-Requested-With], credentials: false, - methods: %i(post options) + methods: %i[post options] end end @@ -489,19 +490,28 @@ module Gitlab allow do origins '*' resource '/oauth/userinfo', - headers: %w(Authorization), + headers: %w[Authorization], credentials: false, - methods: %i(get head post options) + methods: %i[get head post options] end - %w(/oauth/discovery/keys /.well-known/openid-configuration /.well-known/webfinger).each do |openid_path| + %w[/oauth/discovery/keys /.well-known/openid-configuration /.well-known/webfinger].each do |openid_path| allow do origins '*' resource openid_path, credentials: false, - methods: %i(get head) + methods: %i[get head] end end + + # Allow assets to be loaded to web-ide + # https://gitlab.com/gitlab-org/gitlab/-/issues/421177 + allow do + origins 'https://*.web-ide.gitlab-static.net' + resource '/assets/webpack/*', + credentials: false, + methods: %i[get head] + end end # Use caching across all environments |