Commit a77686d5 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Merge branch 'docker-registry' into docker-registry-view

parents 9496f7a7 393459b2
...@@ -12,9 +12,8 @@ class JwtController < ApplicationController ...@@ -12,9 +12,8 @@ class JwtController < ApplicationController
head :not_found unless service head :not_found unless service
result = service.new(@project, @user, auth_params).execute 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 end
private private
...@@ -27,10 +26,8 @@ class JwtController < ApplicationController ...@@ -27,10 +26,8 @@ class JwtController < ApplicationController
@user = authenticate_user(login, password) @user = authenticate_user(login, password)
return if @user return if @user
end
if ActionController::HttpAuthentication::Basic.has_basic_credentials?(request) render_403
head :forbidden
end end
end end
......
...@@ -179,9 +179,7 @@ production: &base ...@@ -179,9 +179,7 @@ production: &base
registry: registry:
# enabled: true # enabled: true
# host: localhost # host: localhost
# port: 5000 # api_url: http://localhost:5000/
# https: false
# internal_host: localhost
# key: config/registry.key # key: config/registry.key
# issuer: omnibus-certificate # issuer: omnibus-certificate
......
...@@ -27,30 +27,6 @@ class Settings < Settingslogic ...@@ -27,30 +27,6 @@ class Settings < Settingslogic
].join('') ].join('')
end 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 def build_gitlab_shell_ssh_path_prefix
user_host = "#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}" user_host = "#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}"
...@@ -271,15 +247,11 @@ Settings.artifacts['max_size'] ||= 100 # in megabytes ...@@ -271,15 +247,11 @@ Settings.artifacts['max_size'] ||= 100 # in megabytes
# Registry # Registry
# #
Settings['registry'] ||= Settingslogic.new({}) Settings['registry'] ||= Settingslogic.new({})
Settings.registry['enabled'] = false if Settings.registry['enabled'].nil? Settings.registry['enabled'] ||= false
Settings.registry['host'] ||= "example.com" Settings.registry['host'] ||= "example.com"
Settings.registry['internal_host']||= "localhost" Settings.registry['api_url'] ||= "http://localhost:5000/"
Settings.registry['key'] ||= nil Settings.registry['key'] ||= nil
Settings.registry['https'] = false if Settings.registry['https'].nil? Settings.registry['issuer'] ||= 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)
# #
# Git LFS # Git LFS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment