# Signature provided, but verify_signature did not like it.
logger.warn "Invalid signature on locator #{tok}"
raise ArvadosModel::PermissionDeniedError
- elsif Rails.configuration.Collections["BlobSigning"]
+ elsif !Rails.configuration.Collections.BlobSigning
# No signature provided, but we are running in insecure mode.
logger.debug "Missing signature on locator #{tok} ignored"
elsif Blob.new(tok).empty?
end
def should_preserve_version?
- return false unless (Rails.configuration.Collections["CollectionVersioning"] && versionable_updates?(self.changes.keys))
+ return false unless (Rails.configuration.Collections.CollectionVersioning && versionable_updates?(self.changes.keys))
- idle_threshold = Rails.configuration.Collections["PreserveVersionIfIdle"]
+ idle_threshold = Rails.configuration.Collections.PreserveVersionIfIdle
if !self.preserve_version_was &&
(idle_threshold < 0 ||
(idle_threshold > 0 && self.modified_at_was > db_current_time-idle_threshold.seconds))
return manifest_text
else
token = Thread.current[:token]
- exp = [db_current_time.to_i + Rails.configuration.Collections["BlobSigningTTL"],
+ exp = [db_current_time.to_i + Rails.configuration.Collections.BlobSigningTTL,
trash_at].compact.map(&:to_i).min
self.class.sign_manifest manifest_text, token, exp
end
def self.sign_manifest manifest, token, exp=nil
if exp.nil?
- exp = db_current_time.to_i + Rails.configuration.Collections["BlobSigningTTL"]
+ exp = db_current_time.to_i + Rails.configuration.Collections.BlobSigningTTL
end
signing_opts = {
api_token: token,
#
# If filter_compatible_format is true (the default), only return image
# collections which are support by the installation as indicated by
- # Rails.configuration.Containers["SupportedDockerImageFormats"]. Will follow
+ # Rails.configuration.Containers.SupportedDockerImageFormats. Will follow
# 'docker_image_migration' links if search_term resolves to an incompatible
# image, but an equivalent compatible image is available.
def self.find_all_for_docker_image(search_term, search_tag=nil, readers=nil, filter_compatible_format: true)
joins("JOIN collections ON links.head_uuid = collections.uuid").
order("links.created_at DESC")
- docker_image_formats = Rails.configuration.Containers["SupportedDockerImageFormats"]
+ docker_image_formats = Rails.configuration.Containers.SupportedDockerImageFormats
if (docker_image_formats.include? 'v1' and
docker_image_formats.include? 'v2') or filter_compatible_format == false
if loc = Keep::Locator.parse(search_term)
loc.strip_hints!
coll_match = readable_by(*readers).where(portable_data_hash: loc.to_s).limit(1)
- if coll_match.any? or Rails.configuration.remote_hosts.length == 0
+ rc = Rails.configuration.RemoteClusters.select{ |k|
+ k != :"*" && k != Rails.configuration.ClusterID}
+ if coll_match.any? or rc.length == 0
return get_compatible_images(readers, pattern, coll_match)
else
# Allow bare pdh that doesn't exist in the local database so