From 3c8c06751cab946e05785be6985c4c23b4cfbb02 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Wed, 6 Nov 2013 13:10:59 +0100 Subject: Enable rack_attack by default. --- config/application.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'config/application.rb') diff --git a/config/application.rb b/config/application.rb index d85bcab7885..82e74e7250d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -78,7 +78,6 @@ module Gitlab # # config.relative_url_root = "/gitlab" - # Uncomment to enable rack attack middleware - # config.middleware.use Rack::Attack + config.middleware.use Rack::Attack end end -- cgit v1.2.3 From 22d3aa4e32ec9204c8ceeed8e4c0492bb1a5a6bb Mon Sep 17 00:00:00 2001 From: Sytse Sijbrandij Date: Thu, 28 Nov 2013 07:57:56 +0100 Subject: Unsupported is unclear. --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/application.rb') diff --git a/config/application.rb b/config/application.rb index 82e74e7250d..0dd632d04bb 100644 --- a/config/application.rb +++ b/config/application.rb @@ -70,7 +70,7 @@ module Gitlab config.assets.version = '1.0' # Uncomment and customize the last line to run in a non-root path - # WARNING: This feature is known to work, but unsupported + # WARNING: We recommend creating a FQDN to host GitLab in a root path. # Note that three settings need to be changed for this to work. # 1) In your application.rb file: config.relative_url_root = "/gitlab" # 2) In your gitlab.yml file: relative_url_root: /gitlab -- cgit v1.2.3 From b8cb7df76102db12a11bca81674882911fcfbcd8 Mon Sep 17 00:00:00 2001 From: Sytse Sijbrandij Date: Fri, 29 Nov 2013 08:57:45 +0100 Subject: Add warning back. --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/application.rb') diff --git a/config/application.rb b/config/application.rb index 0dd632d04bb..c46ff289cf8 100644 --- a/config/application.rb +++ b/config/application.rb @@ -70,7 +70,7 @@ module Gitlab config.assets.version = '1.0' # Uncomment and customize the last line to run in a non-root path - # WARNING: We recommend creating a FQDN to host GitLab in a root path. + # WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this. # Note that three settings need to be changed for this to work. # 1) In your application.rb file: config.relative_url_root = "/gitlab" # 2) In your gitlab.yml file: relative_url_root: /gitlab -- cgit v1.2.3 From 6edb4c0634740e4231e5939b13fd696b6823b3de Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 5 Dec 2013 10:29:45 +0200 Subject: Allow Cross-origin resource sharing for GitLab API It will allow to write web applications on other domains to interact with GitLab instances Signed-off-by: Dmitriy Zaporozhets --- config/application.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'config/application.rb') diff --git a/config/application.rb b/config/application.rb index c46ff289cf8..d160e181ec3 100644 --- a/config/application.rb +++ b/config/application.rb @@ -79,5 +79,13 @@ module Gitlab # config.relative_url_root = "/gitlab" config.middleware.use Rack::Attack + + # Allow access to GitLab API from other domains + config.middleware.use Rack::Cors do + allow do + origins '*' + resource '/api/*', headers: :any, methods: [:get, :post, :options, :put] + end + end end end -- cgit v1.2.3