From d4f6e1f21c40c729d5ed3a3f02d6a84777a40163 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Wed, 20 Jun 2018 14:18:16 +1100 Subject: [Rails5] Fix ActionCable '/cable' mountpoint conflict Since Rails 5.0 the new framework has been added. It's called ActionCable. It brings WebSockets support to rails applications. By default the mountpoint of WebSocket requests is `/cable` [1]. GitLab allows using top level names as namespaces or usernames. For example, `gitlab.com/cable` at this moment leads to a user with the nickname `cable`. This commit changes ActionCable's mountpoint to a reserved top level word `-`. This is just a stub and should not be be used in real work. Please set correct mountpoints for each environments when configuring ActionCable for real using. [1]: https://github.com/rails/rails/blob/5-0-stable/actioncable/lib/action_cable.rb#L38 --- config/application.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'config') diff --git a/config/application.rb b/config/application.rb index 95f6d2c9af1..385eb65e7f4 100644 --- a/config/application.rb +++ b/config/application.rb @@ -57,6 +57,13 @@ module Gitlab # Configure the default encoding used in templates for Ruby 1.9. config.encoding = "utf-8" + # ActionCable mount point. + # The default Rails' mount point is `/cable` which may conflict with existing + # namespaces/users. + # https://github.com/rails/rails/blob/5-0-stable/actioncable/lib/action_cable.rb#L38 + # Please change this value when configuring ActionCable for real usage. + config.action_cable.mount_path = "-" if rails5? + # Configure sensitive parameters which will be filtered from the log file. # # Parameters filtered: -- cgit v1.2.1 From e9e9da822ac49cc857158c4ecc777b077a963280 Mon Sep 17 00:00:00 2001 From: "Jacob Vosmaer (GitLab)" Date: Wed, 20 Jun 2018 09:33:50 +0000 Subject: More gitaly disk access blocks --- config/initializers/1_settings.rb | 1 + config/initializers/6_validations.rb | 1 + 2 files changed, 2 insertions(+) (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 12d09150127..3d3448cb4d6 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -394,6 +394,7 @@ repositories_storages = Settings.repositories.storages.values repository_downloads_path = Settings.gitlab['repository_downloads_path'].to_s.gsub(%r{/$}, '') repository_downloads_full_path = File.expand_path(repository_downloads_path, Settings.gitlab['user_home']) +# Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/1237 Gitlab::GitalyClient::StorageSettings.allow_disk_access do if repository_downloads_path.blank? || repositories_storages.any? { |rs| [repository_downloads_path, repository_downloads_full_path].include?(rs.legacy_disk_path.gsub(%r{/$}, '')) } Settings.gitlab['repository_downloads_path'] = File.join(Settings.shared['path'], 'cache/archive') diff --git a/config/initializers/6_validations.rb b/config/initializers/6_validations.rb index 362a23164ab..ff6865608f0 100644 --- a/config/initializers/6_validations.rb +++ b/config/initializers/6_validations.rb @@ -37,6 +37,7 @@ def validate_storages_config end end +# Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/1237 def validate_storages_paths Gitlab::GitalyClient::StorageSettings.allow_disk_access do Gitlab.config.repositories.storages.each do |name, repository_storage| -- cgit v1.2.1