Commit 72611f9c authored by Kamil Trzcinski's avatar Kamil Trzcinski

Auth token

parent 0ca8db25
......@@ -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
# ==========================
......
......@@ -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"
......
......@@ -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)
......
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