Auth token

This commit is contained in:
Kamil Trzcinski 2016-04-19 13:57:35 -04:00
parent 0ca8db25f0
commit 72611f9cfa
3 changed files with 13 additions and 1 deletions

View File

@ -176,6 +176,16 @@ production: &base
repository_archive_cache_worker:
cron: "0 * * * *"
registry:
# enabled: true
# host: localhost
# port: 5000
# https: false
# internal_host: localhost
# key: config/registry.key
# issuer: omnibus-certificate
# path: shared/registry
#
# 2. GitLab CI settings
# ==========================

View File

@ -275,6 +275,7 @@ Settings.registry['registry'] = false if Settings.registry['enabled'].nil?
Settings.registry['path'] = File.expand_path(Settings.registry['path'] || File.join(Settings.shared['path'], "registry"), Rails.root)
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"

View File

@ -119,12 +119,13 @@ module API
name: @path,
actions: @actions
],
iss: Gitlab.config.registry.issuer,
exp: Time.now.to_i + 3600
}
end
def private_key
@private_key ||= OpenSSL::PKey::RSA.new File.read 'config/registry.key'
@private_key ||= OpenSSL::PKey::RSA.new File.read Gitlab.config.registry.key
end
def encode(payload)