In order to mitigate against the brute force attacks against Gitlab accounts, we are moving to all edu-ID Logins. We would like to remind you to link your account with your edu-id. Login will be possible only by edu-ID after November 30, 2021. Here you can find the instructions for linking your account.

If you don't have a SWITCH edu-ID, you can create one with this guide here

kind regards

Unverified Commit 29d8c8bc authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

merge with branch 4.1.5-http

parent a36a5ea4
Pipeline #21686 passed with stage
in 6 minutes and 28 seconds
......@@ -46,7 +46,7 @@ base_uri =
# you can define an alternate character or character sequence to substitute
# for a slash. Supply the non-percent-encoded version here, and use the
# percent-encoded version in URLs.
slash_substitute =
# slash_substitute = $
# Maximum number of pixels to return in a response, to prevent overloading
# the server. Requests for more pixels than this will receive an error
......@@ -64,7 +64,7 @@ print_stack_trace_on_error_pages = true
# Enables the delegate script: a Ruby script containing various delegate
# methods. (See the user manual.)
delegate_script.enabled = false
delegate_script.enabled = true
# !! This can be an absolute path, or a filename; if only a filename is
# specified, it will be searched for in the same folder as this file, and
......@@ -73,7 +73,7 @@ delegate_script.pathname = delegates.rb
# Enables the invocation cache, which caches method invocations and return
# values in memory. See the user manual for more information.
delegate_script.cache.enabled = false
delegate_script.cache.enabled = true
###########################################################################
# ENDPOINTS
......@@ -119,11 +119,11 @@ endpoint.api.secret =
# Uses one source for all requests. Available values are `FilesystemSource`,
# `HttpSource`, `JdbcSource`, `S3Source`, and `AzureStorageSource`.
source.static = FilesystemSource
# source.static = HttpSource
# If true, `source.static` will be overridden, and the `source()` delegate
# method will be used to select a source per-request.
source.delegate = false
source.delegate = true
#----------------------------------------
# FilesystemSource
......@@ -132,11 +132,11 @@ source.delegate = false
# How to look up files. Allowed values are `BasicLookupStrategy` and
# `ScriptLookupStrategy`. ScriptLookupStrategy uses the delegate script for
# dynamic lookups; see the user manual.
FilesystemSource.lookup_strategy = BasicLookupStrategy
FilesystemSource.lookup_strategy = ScriptLookupStrategy
# Server-side path that will be prefixed to the identifier in the URL.
# Trailing slash is important!
FilesystemSource.BasicLookupStrategy.path_prefix = /home/cantaloupe/images/
FilesystemSource.BasicLookupStrategy.path_prefix =
# Server-side path or extension that will be suffixed to the identifier in
# the URL.
......@@ -155,11 +155,11 @@ HttpSource.request_timeout =
# Tells HttpSource how to look up resources. Allowed values are
# `BasicLookupStrategy` and `ScriptLookupStrategy`. ScriptLookupStrategy
# uses a delegate method for dynamic lookups; see the user manual.
HttpSource.lookup_strategy = BasicLookupStrategy
HttpSource.lookup_strategy = ScriptLookupStrategy
# URL that will be prefixed to the identifier in the request URL.
# Trailing slash is important!
HttpSource.BasicLookupStrategy.url_prefix = http://localhost/images/
HttpSource.BasicLookupStrategy.url_prefix =
# Path, extension, query string, etc. that will be suffixed to the
# identifier in the request URL.
......
class CustomDelegate
attr_accessor :context
def deserialize_meta_identifier(meta_identifier)
end
def pre_authorize(options = {})
true
end
def authorize(options = {})
true
end
def extra_iiif2_information_response_keys(options = {})
{}
end
def extra_iiif3_information_response_keys(options = {})
{}
end
def azurestoragesource_blob_key(options = {})
end
def httpsource_resource_info(option = {})
return context['identifier'].gsub('$','/').gsub('"', '%22')
end
def jdbcsource_database_identifier(options = {})
end
def jdbcsource_media_type(options = {})
end
def jdbcsource_lookup_sql(options = {})
end
def s3source_object_info(options = {})
end
def overlay(options = {})
end
def redactions(options = {})
[]
end
def metadata(options = {})
end
def source(options = {})
uri = context['identifier']
if uri.start_with?("file:")
return 'FilesystemSource'
else
return 'HttpSource'
end
end
def filesystemsource_pathname(options = {})
return "/home/cantaloupe/images/#{context['identifier'].split("$").last}"
end
end
......@@ -5,6 +5,7 @@ metadata:
name: imageserver-ingress
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/rewrite-target: /
labels:
......
apiVersion: apps/v1
kind: Deployment
metadata:
name: cantaloupe-test-deployment
namespace: memobase
labels:
app: imageserver-test-app
spec:
selector:
matchLabels:
app: imageserver-test-app
replicas: 1
template:
metadata:
labels:
app: imageserver-test-app
tier: web
spec:
containers:
- name: cantaloupe-test-container
image: cr.gitlab.switch.ch/memoriav/memobase-2020/services/cantaloupe-docker:4.1.5-http-jp2
ports:
- containerPort: 8182
name: http
protocol: TCP
resources:
requests:
cpu: "0.5"
memory: "1Gi"
limits:
cpu: "2"
memory: "4Gi"
imagePullPolicy: Always
volumeMounts:
- name: media-volume
mountPath: /home/cantaloupe/images
env:
- name: CACHE_SERVER_DERIVATIVE_ENABLED
value: 'true'
- name: CACHE_SERVER_DERIVATIVE
value: 'RedisCache'
- name: REDISCACHE_HOST
value: 'redis-test-service'
restartPolicy: Always
volumes:
- name: media-volume
persistentVolumeClaim:
claimName: media-volume-claim
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
namespace: memobase
name: imageserver-test-ingress
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/rewrite-target: /
labels:
app: imageserver-test-app
spec:
tls:
- hosts:
- images-test.memobase.k8s.unibas.ch
secretName: images-test.memobase.k8s.unibas.ch-tls
rules:
- host: images-test.memobase.k8s.unibas.ch
http:
paths:
- path: /
backend:
serviceName: imageserver-test-service
servicePort: 8182
apiVersion: v1
kind: Service
metadata:
namespace: memobase
name: imageserver-test-service
labels:
app: imageserver-test-app
spec:
ports:
- port: 8182
selector:
app: imageserver-test-app
tier: web
clusterIP: None
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-test-deployment
namespace: memobase
labels:
app: redis-test-app
spec:
selector:
matchLabels:
app: redis-test-app
replicas: 1
template:
metadata:
labels:
app: redis-test-app
tier: web
spec:
containers:
- name: redis-test-container
image: redis:5-buster
resources:
requests:
cpu: "0.2"
memory: "2Gi"
limits:
cpu: "1.0"
memory: "8Gi"
imagePullPolicy: Always
ports:
- containerPort: 6379
name: http
protocol: TCP
restartPolicy: Always
apiVersion: v1
kind: Service
metadata:
namespace: memobase
name: redis-test-service
labels:
app: redis-test-app
spec:
ports:
- port: 6379
selector:
app: redis-test-app
tier: web
clusterIP: None
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