diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-16 09:48:39 -0500 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-16 09:48:39 -0500 |
commit | 623102d4556c42fd386e37724e638156dabca277 (patch) | |
tree | f621b38f0db3a81434bb3a50dfd22b6fe1ed2e9b | |
parent | 38b63393bb2841e471942a09b2fd188ca5df066b (diff) | |
download | gitlab-ce-623102d4556c42fd386e37724e638156dabca277.tar.gz |
Use registry.port to construct the registry host
-rw-r--r-- | app/models/project.rb | 6 | ||||
-rw-r--r-- | app/views/projects/container_registry/index.html.haml | 2 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index ed7719ed31c..a3eb7d83e49 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -332,15 +332,15 @@ class Project < ActiveRecord::Base @container_registry_repository ||= begin token = Auth::ContainerRegistryAuthenticationService.full_access_token(path_with_namespace) url = Gitlab.config.registry.api_url - host = Gitlab.config.registry.host - registry = ContainerRegistry::Registry.new(url, token: token, path: host) + host_port = Gitlab.config.registry.host_port + registry = ContainerRegistry::Registry.new(url, token: token, path: host_port) registry[path_with_namespace] end end def container_registry_repository_url if Gitlab.config.registry.enabled - "#{Gitlab.config.registry.host}/#{path_with_namespace}" + "#{Gitlab.config.registry.host_port}/#{path_with_namespace}" end end diff --git a/app/views/projects/container_registry/index.html.haml b/app/views/projects/container_registry/index.html.haml index f3b2881ce09..6a1e46b14b9 100644 --- a/app/views/projects/container_registry/index.html.haml +++ b/app/views/projects/container_registry/index.html.haml @@ -16,7 +16,7 @@ To start using container images hosted on GitLab you first need to login: %pre %code - docker login #{Gitlab.config.registry.host} + docker login #{Gitlab.config.registry.host_port} %br Then you are free to create and upload a container image with build and push commands: %pre diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index d1fcb053bee..20f920ea854 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -249,9 +249,11 @@ Settings.artifacts['max_size'] ||= 100 # in megabytes Settings['registry'] ||= Settingslogic.new({}) Settings.registry['enabled'] ||= false Settings.registry['host'] ||= "example.com" +Settings.registry['port'] ||= nil Settings.registry['api_url'] ||= "http://localhost:5000/" Settings.registry['key'] ||= nil Settings.registry['issuer'] ||= nil +Settings.registry['host_port'] ||= [Settings.registry['host'], Settings.registry['port']].join(':') # # Git LFS |