summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-05-14 14:05:57 -0500
committerKamil Trzcinski <ayufan@ayufan.eu>2016-05-14 14:05:57 -0500
commita77686d593347742d55995f1e0055a7a6f9da4ea (patch)
treee0b1479c664f54803df3d1bc2a7a917c7c5ec17c
parent9496f7a71ac40e2448dfeb132a105caf66301b93 (diff)
parent393459b2b24fe788764ee787552da055846b9a63 (diff)
downloadgitlab-ce-a77686d593347742d55995f1e0055a7a6f9da4ea.tar.gz
Merge branch 'docker-registry' into docker-registry-view
-rw-r--r--app/controllers/jwt_controller.rb7
-rw-r--r--config/gitlab.yml.example4
-rw-r--r--config/initializers/1_settings.rb38
3 files changed, 8 insertions, 41 deletions
diff --git a/app/controllers/jwt_controller.rb b/app/controllers/jwt_controller.rb
index 5b9a04c249a..e0e0a98a6c1 100644
--- a/app/controllers/jwt_controller.rb
+++ b/app/controllers/jwt_controller.rb
@@ -12,9 +12,8 @@ class JwtController < ApplicationController
head :not_found unless service
result = service.new(@project, @user, auth_params).execute
- return head result[:http_status] if result[:http_status]
- render json: result
+ render json: result, status: result[:http_status]
end
private
@@ -27,10 +26,8 @@ class JwtController < ApplicationController
@user = authenticate_user(login, password)
return if @user
- end
- if ActionController::HttpAuthentication::Basic.has_basic_credentials?(request)
- head :forbidden
+ render_403
end
end
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 37639e52e66..2e383bc90fa 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -179,9 +179,7 @@ production: &base
registry:
# enabled: true
# host: localhost
- # port: 5000
- # https: false
- # internal_host: localhost
+ # api_url: http://localhost:5000/
# key: config/registry.key
# issuer: omnibus-certificate
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index e46be3f420a..d1fcb053bee 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -27,30 +27,6 @@ class Settings < Settingslogic
].join('')
end
- def build_registry_api_url
- if registry.port.to_i == (registry.https ? 443 : 80)
- custom_port = nil
- else
- custom_port = ":#{registry.port}"
- end
- [ registry.protocol,
- "://",
- registry.internal_host,
- custom_port
- ].join('')
- end
-
- def build_registry_host_with_port
- if registry.port.to_i == (registry.https ? 443 : 80)
- custom_port = nil
- else
- custom_port = ":#{registry.port}"
- end
- [ registry.host,
- custom_port
- ].join('')
- end
-
def build_gitlab_shell_ssh_path_prefix
user_host = "#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}"
@@ -271,15 +247,11 @@ Settings.artifacts['max_size'] ||= 100 # in megabytes
# Registry
#
Settings['registry'] ||= Settingslogic.new({})
-Settings.registry['enabled'] = false if Settings.registry['enabled'].nil?
-Settings.registry['host'] ||= "example.com"
-Settings.registry['internal_host']||= "localhost"
-Settings.registry['key'] ||= nil
-Settings.registry['https'] = false if Settings.registry['https'].nil?
-Settings.registry['port'] ||= Settings.registry.https ? 443 : 80
-Settings.registry['protocol'] ||= Settings.registry.https ? "https" : "http"
-Settings.registry['api_url'] ||= Settings.send(:build_registry_api_url)
-Settings.registry['host_port'] ||= Settings.send(:build_registry_host_with_port)
+Settings.registry['enabled'] ||= false
+Settings.registry['host'] ||= "example.com"
+Settings.registry['api_url'] ||= "http://localhost:5000/"
+Settings.registry['key'] ||= nil
+Settings.registry['issuer'] ||= nil
#
# Git LFS