From b806bced5cc96bb0ae4a23f80b9b5e15c1be4c82 Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Mon, 28 Aug 2023 12:16:30 -0500 Subject: [PATCH 01/22] Dynamic cantaloupe sidecar. --- .gitlab-ci.yml | 10 ++++++++++ Dockerfile | 2 +- nginx-vhost.conf | 31 ++++++++++++++++++++++++------- settings.cfg | 14 ++++++++++++++ start.sh | 11 +++++++++++ 5 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 settings.cfg create mode 100755 start.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..e2c15ac --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,10 @@ +variables: + NOMAD_VAR_PORTS: '{ 8080 = "http", 8182 = "cantaloupe" }' + NOMAD_VAR_CHECK_PATH: '/static/images/ia.png' + NOMAD_VAR_MULTI_CONTAINER: 'true' + NOMAD_VAR_COUNT_CANARIES: 0 + NOMAD_VAR_COUNT: 1 + NOMAD_VAR_HEALTH_TIMEOUT: '30m' + +include: + - remote: 'https://gitlab.com/internetarchive/nomad/-/raw/master/.gitlab-ci.yml' diff --git a/Dockerfile b/Dockerfile index ea460f3..63fa9e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,4 +5,4 @@ COPY ./requirements.txt /app/requirements.txt RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt COPY . /app -COPY ./nginx-vhost.conf /etc/nginx/conf.d/nginx.conf +CMD /app/start.sh diff --git a/nginx-vhost.conf b/nginx-vhost.conf index 579eee4..23e2d7d 100644 --- a/nginx-vhost.conf +++ b/nginx-vhost.conf @@ -11,22 +11,39 @@ server { alias /app/iiify/static; } - location ~ /iiif/image/([23])/(.*)$ { - rewrite ^ $request_uri; - rewrite ^/iiif/image/(2|3)/(.*)$ $2; + location ~ /iiif/image/2/(.*)$ { add_header 'Access-Control-Allow-Origin' '*' always; add_header 'Access-Control-Allow-Methods' 'GET, HEAD, POST, PUT, PATCH, DELETE' always; add_header 'Access-Control-Expose-Headers' '*' always; - return 302 https://services-ia-iiif-cantaloupe-experiment.dev.archive.org/iiif/$1/$2; + + rewrite ^ $request_uri; + rewrite ^/iiif/image/2/(.*)$ /iiif/2/$1 break; + + return 400; + proxy_pass http://${NOMAD_HOST_ADDR_cantaloupe}$uri; } - location ~ /iiif/image/(.*)$ { + location ~ /iiif/image/3/(.*)$ { + add_header 'Access-Control-Allow-Origin' '*' always; + add_header 'Access-Control-Allow-Methods' 'GET, HEAD, POST, PUT, PATCH, DELETE' always; + add_header 'Access-Control-Expose-Headers' '*' always; + rewrite ^ $request_uri; - rewrite ^/iiif/image/(.*)$ $1; + rewrite ^/iiif/image/3/(.*)$ /iiif/3/$1 break; + + return 400; + proxy_pass http://${NOMAD_HOST_ADDR_cantaloupe}$uri; + } + location ~ /iiif/image/(.*)$ { add_header 'Access-Control-Allow-Origin' '*' always; add_header 'Access-Control-Allow-Methods' 'GET, HEAD, POST, PUT, PATCH, DELETE' always; add_header 'Access-Control-Expose-Headers' '*' always; - return 302 https://services-ia-iiif-cantaloupe-experiment.dev.archive.org/iiif/3/$1; + + rewrite ^ $request_uri; + rewrite ^/iiif/image/(.*)$ /iiif/3/$1 break; + + return 400; + proxy_pass http://${NOMAD_HOST_ADDR_cantaloupe}$uri; } } diff --git a/settings.cfg b/settings.cfg new file mode 100644 index 0000000..5599a3f --- /dev/null +++ b/settings.cfg @@ -0,0 +1,14 @@ +[media] +root = /media + +[cache] +root = /tmp/cache + +[api] +url = https://api.archivelab.org + +[server] +domain = https://iiif.archivelab.org + +[cantaloupe] +server = http://{$NOMAD_HOST_ADDR_cantaloupe}/iiif diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..d13daca --- /dev/null +++ b/start.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +export + +envsubst '$NOMAD_HOST_ADDR_cantaloupe' < nginx-vhost.conf > /etc/nginx/conf.d/nginx.conf + +envsubst '$NOMAD_HOST_ADDR_cantaloupe' < settings.cfg > iiify/configs/settings.cfg + +# Call the regular start.sh for the uwsgi container.. + +/start.sh From c0a24b385e7f0a9f5757d56cf81ab8dd303f2fea Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 10:08:30 -0500 Subject: [PATCH 02/22] Adding group.nomad, can't believe I missed that in the copy over to the new repo. Also some notes in readme. --- README.md | 4 + group.nomad | 419 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 423 insertions(+) create mode 100644 group.nomad diff --git a/README.md b/README.md index a8cd664..a1c8ae1 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,10 @@ This service replaces the iiif.archivelab.org unofficial labs API. The service uses a manifest/API service written in python3 flask and makes image processing calls to cantaloupe in both iiif 3.0 and 2.0 format. +Note that this repository contains a `Dockerfile` used to build the previously mentioned `python3 flask` application. The [nomad](https://gitlab.com/internetarchive/nomad) repository is used for automated testing and deployment; In particular `.github/workflows/cicd.yml` and `.gitlab-ci.yml` relate to that system. + +Note also that `start.sh` is run on container startup, and that it makes assumptions about what environment variables exist at this point; In particular `NOMAD_HOST_ADDR_cantaloupe` is assumed to exist, which is created dynamically based on the `nomad` repository handling `group.nomad` and the configuration in the relevant yaml file. + ## Installation & Setup ``` git clone https://github.com/internetarchive/iiif.git diff --git a/group.nomad b/group.nomad new file mode 100644 index 0000000..13ce22f --- /dev/null +++ b/group.nomad @@ -0,0 +1,419 @@ +task "cantaloupe" { + driver = "docker" + + lifecycle { + hook = "prestart" + sidecar = true + } + + config { + image = "uclalibrary/cantaloupe:5.0.5-7" + ports = [ "cantaloupe" ] + mount { + type = "bind" + target = "/etc/cantaloupe/cantaloupe.properties" + source = "local/cantaloupe.properties" + readonly = true + bind_options { + propagation = "rshared" + } + } + } + + template { +data = < Date: Tue, 5 Sep 2023 10:55:25 -0500 Subject: [PATCH 03/22] Removing debugging line to kick github actions. --- start.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/start.sh b/start.sh index d13daca..4991cca 100755 --- a/start.sh +++ b/start.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -export - envsubst '$NOMAD_HOST_ADDR_cantaloupe' < nginx-vhost.conf > /etc/nginx/conf.d/nginx.conf envsubst '$NOMAD_HOST_ADDR_cantaloupe' < settings.cfg > iiify/configs/settings.cfg From 1f79480093ed96542dbb485fd40b7dec827f5323 Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 11:33:18 -0500 Subject: [PATCH 04/22] Modifying cicd.yml to facilitate github actions pulling in secret.. --- .github/workflows/cicd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index d93c06e..59275e3 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -25,11 +25,11 @@ jobs: deploy: environment: name: development - url: https://archivelabs-iiif-archivelab-org-${{ env.BRANCH_NAME }}.ux-fnf-misc.archive.org + url: https://iiif-${{ env.BRANCH_NAME }}.ux-fnf-misc.archive.org runs-on: ubuntu-latest needs: cicd steps: - name: Checkout # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it uses: actions/checkout@v2 - name: Export BRANCH_NAME # store branch name in $BRANCH_NAME - run: echo BRANCH_NAME=`git rev-parse --abbrev-ref HEAD` >> $GITHUB_ENV \ No newline at end of file + run: echo BRANCH_NAME=`git rev-parse --abbrev-ref HEAD` >> $GITHUB_ENV From 091a4828f6e395c107aa1b9d69c792001ed54b7f Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 12:18:50 -0500 Subject: [PATCH 05/22] Whitespace change to kick github pipelines with change to secrets in repository.. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a1c8ae1..807d90c 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Note that this repository contains a `Dockerfile` used to build the previously m Note also that `start.sh` is run on container startup, and that it makes assumptions about what environment variables exist at this point; In particular `NOMAD_HOST_ADDR_cantaloupe` is assumed to exist, which is created dynamically based on the `nomad` repository handling `group.nomad` and the configuration in the relevant yaml file. + ## Installation & Setup ``` git clone https://github.com/internetarchive/iiif.git From 18b4100016bb1da334a56f5aea762b6b44f8d4a8 Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 13:19:37 -0500 Subject: [PATCH 06/22] Adding variables to github action. --- .github/workflows/cicd.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 59275e3..63d55f3 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -18,7 +18,10 @@ jobs: NOMAD_VAR_CHECK_PROTOCOL: 'http' NOMAD_ADDR: 'https://ux-fnf-misc.archive.org/' NOMAD_VAR_COUNT_CANARIES: 0 - # NOMAD_VAR_CHECK_TIMEOUT: '10m' + NOMAD_VAR_PORTS: '{ 8080 = "http", 8182 = "cantaloupe" }' + NOMAD_VAR_COUNT: 1 + NOMAD_VAR_MULTI_CONTAINER: 'true' + NOMAD_VAR_HEALTH_TIMEOUT: '30m' NOMAD_VAR_HOSTNAMES: '["iiif.ux-fnf-misc.archive.org"]' NOMAD_VAR_PORTS: '{8080 = "http"}' NOMAD_VAR_FORCE_PULL: 'true' From 184c1128ed5e8eecde673d32a7eb7f15bb56cd02 Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 13:31:02 -0500 Subject: [PATCH 07/22] Helps if I don't overwrite the variable I just want to set. --- .github/workflows/cicd.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 63d55f3..d5419f5 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -23,7 +23,6 @@ jobs: NOMAD_VAR_MULTI_CONTAINER: 'true' NOMAD_VAR_HEALTH_TIMEOUT: '30m' NOMAD_VAR_HOSTNAMES: '["iiif.ux-fnf-misc.archive.org"]' - NOMAD_VAR_PORTS: '{8080 = "http"}' NOMAD_VAR_FORCE_PULL: 'true' deploy: environment: From 32cb6fbb9fadd77c0da3bae800024cfb161eebca Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 13:54:55 -0500 Subject: [PATCH 08/22] Attempting a different mechanism of getting the config file in to avoid nomad task starting order of operations. --- group.nomad | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/group.nomad b/group.nomad index 13ce22f..13d2ebe 100644 --- a/group.nomad +++ b/group.nomad @@ -9,19 +9,13 @@ task "cantaloupe" { config { image = "uclalibrary/cantaloupe:5.0.5-7" ports = [ "cantaloupe" ] - mount { - type = "bind" - target = "/etc/cantaloupe/cantaloupe.properties" - source = "local/cantaloupe.properties" - readonly = true - bind_options { - propagation = "rshared" - } - } + volumes = [ + "local/cantaloupe.properties:/etc/cantaloupe/cantaloupe.properties" + ] } template { -data = < Date: Tue, 5 Sep 2023 14:01:50 -0500 Subject: [PATCH 09/22] Testing this.. --- group.nomad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group.nomad b/group.nomad index 13d2ebe..c22f971 100644 --- a/group.nomad +++ b/group.nomad @@ -10,7 +10,7 @@ task "cantaloupe" { image = "uclalibrary/cantaloupe:5.0.5-7" ports = [ "cantaloupe" ] volumes = [ - "local/cantaloupe.properties:/etc/cantaloupe/cantaloupe.properties" + "cantaloupe/local/cantaloupe.properties:/etc/cantaloupe/cantaloupe.properties" ] } From 3e3c1163bc34daabe826e1f64276ffdaa4994b93 Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 14:04:08 -0500 Subject: [PATCH 10/22] And trying this.. --- group.nomad | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/group.nomad b/group.nomad index c22f971..10baa9c 100644 --- a/group.nomad +++ b/group.nomad @@ -9,9 +9,15 @@ task "cantaloupe" { config { image = "uclalibrary/cantaloupe:5.0.5-7" ports = [ "cantaloupe" ] - volumes = [ - "cantaloupe/local/cantaloupe.properties:/etc/cantaloupe/cantaloupe.properties" - ] + mount { + type = "bind" + target = "/etc/cantaloupe/cantaloupe.properties" + source = "cantaloupe/local/cantaloupe.properties" + readonly = true + bind_options { + propagation = "rshared" + } + } } template { From 64b4abf893c570e60a5a90ed9b7175992136bef9 Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 14:10:32 -0500 Subject: [PATCH 11/22] Manually uploaded the cantaloupe.properties to test.. --- group.nomad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group.nomad b/group.nomad index 10baa9c..0196fd0 100644 --- a/group.nomad +++ b/group.nomad @@ -12,7 +12,7 @@ task "cantaloupe" { mount { type = "bind" target = "/etc/cantaloupe/cantaloupe.properties" - source = "cantaloupe/local/cantaloupe.properties" + source = "/tmp/cantaloupe.properties" readonly = true bind_options { propagation = "rshared" From 2e180ebbd75d29b922d2d9bcff6e2f8a5041682c Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 14:15:43 -0500 Subject: [PATCH 12/22] Checking if local was the issue.. --- group.nomad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/group.nomad b/group.nomad index 0196fd0..ae8b455 100644 --- a/group.nomad +++ b/group.nomad @@ -12,7 +12,7 @@ task "cantaloupe" { mount { type = "bind" target = "/etc/cantaloupe/cantaloupe.properties" - source = "/tmp/cantaloupe.properties" + source = "cantaloupe.properties" readonly = true bind_options { propagation = "rshared" @@ -409,7 +409,7 @@ log.access.SyslogAppender.port = 514 log.access.SyslogAppender.facility = LOCAL0 EOF - destination = "local/cantaloupe.properties" + destination = "cantaloupe.properties" change_mode = "signal" change_signal = "SIGHUP" } From 9a2a14307a32ee4c01488d7c112ff70be6c9f62d Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 14:21:57 -0500 Subject: [PATCH 13/22] Specifying env so that we get absolute in docker mount.. --- group.nomad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/group.nomad b/group.nomad index ae8b455..e88cde9 100644 --- a/group.nomad +++ b/group.nomad @@ -12,7 +12,7 @@ task "cantaloupe" { mount { type = "bind" target = "/etc/cantaloupe/cantaloupe.properties" - source = "cantaloupe.properties" + source = "{{env NOMAD_TASK_DIR}}/cantaloupe.properties" readonly = true bind_options { propagation = "rshared" @@ -409,7 +409,7 @@ log.access.SyslogAppender.port = 514 log.access.SyslogAppender.facility = LOCAL0 EOF - destination = "cantaloupe.properties" + destination = "local/cantaloupe.properties" change_mode = "signal" change_signal = "SIGHUP" } From 045ff49f3aa4b299e76ca1f9e7c863830a1ee7c9 Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 14:27:58 -0500 Subject: [PATCH 14/22] Looking at newer template definitions and docker docs.. --- group.nomad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/group.nomad b/group.nomad index e88cde9..8bac2ea 100644 --- a/group.nomad +++ b/group.nomad @@ -11,8 +11,8 @@ task "cantaloupe" { ports = [ "cantaloupe" ] mount { type = "bind" - target = "/etc/cantaloupe/cantaloupe.properties" - source = "{{env NOMAD_TASK_DIR}}/cantaloupe.properties" + target = "/etc/cantaloupe" + source = "local" readonly = true bind_options { propagation = "rshared" From 4502a87604a2292d3d0dc9877e990a413ab6ca8e Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 14:38:43 -0500 Subject: [PATCH 15/22] Non-absolute path back again. --- group.nomad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group.nomad b/group.nomad index 8bac2ea..8435353 100644 --- a/group.nomad +++ b/group.nomad @@ -12,7 +12,7 @@ task "cantaloupe" { mount { type = "bind" target = "/etc/cantaloupe" - source = "local" + source = "local/cantaloupe.properties" readonly = true bind_options { propagation = "rshared" From baca2cd08e0cdfb795944de3ba3fece594b3a35a Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 14:45:27 -0500 Subject: [PATCH 16/22] Ideal.. but not going to work. --- group.nomad | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/group.nomad b/group.nomad index 8435353..7455807 100644 --- a/group.nomad +++ b/group.nomad @@ -11,7 +11,7 @@ task "cantaloupe" { ports = [ "cantaloupe" ] mount { type = "bind" - target = "/etc/cantaloupe" + target = "/etc/cantaloupe/cantaloupe.properties" source = "local/cantaloupe.properties" readonly = true bind_options { @@ -410,8 +410,6 @@ log.access.SyslogAppender.facility = LOCAL0 EOF destination = "local/cantaloupe.properties" - change_mode = "signal" - change_signal = "SIGHUP" } resources { From a2c94164c22ab857d970a7b8a69119845d6633dc Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 14:49:41 -0500 Subject: [PATCH 17/22] Using absolute to confirm.. --- group.nomad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/group.nomad b/group.nomad index 7455807..f48edd9 100644 --- a/group.nomad +++ b/group.nomad @@ -12,7 +12,7 @@ task "cantaloupe" { mount { type = "bind" target = "/etc/cantaloupe/cantaloupe.properties" - source = "local/cantaloupe.properties" + source = "/tmp/cantaloupe.properties" readonly = true bind_options { propagation = "rshared" @@ -409,7 +409,7 @@ log.access.SyslogAppender.port = 514 log.access.SyslogAppender.facility = LOCAL0 EOF - destination = "local/cantaloupe.properties" + destination = "/tmp/cantaloupe.properties" } resources { From 5295c3e9f17077dc1cb8673075179fbb46e6ac85 Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 14:51:57 -0500 Subject: [PATCH 18/22] Lets try this.. --- group.nomad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/group.nomad b/group.nomad index f48edd9..7e9b32e 100644 --- a/group.nomad +++ b/group.nomad @@ -12,7 +12,7 @@ task "cantaloupe" { mount { type = "bind" target = "/etc/cantaloupe/cantaloupe.properties" - source = "/tmp/cantaloupe.properties" + source = "cantaloupe/local/cantaloupe.properties" readonly = true bind_options { propagation = "rshared" @@ -409,7 +409,7 @@ log.access.SyslogAppender.port = 514 log.access.SyslogAppender.facility = LOCAL0 EOF - destination = "/tmp/cantaloupe.properties" + destination = "local/cantaloupe.properties" } resources { From 09b068ed63302e853a39d6d94111603bd5b42c3e Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 14:59:34 -0500 Subject: [PATCH 19/22] Functional, shitty but functional. Absolute path in /tmp for basic functional. --- group.nomad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/group.nomad b/group.nomad index 7e9b32e..f48edd9 100644 --- a/group.nomad +++ b/group.nomad @@ -12,7 +12,7 @@ task "cantaloupe" { mount { type = "bind" target = "/etc/cantaloupe/cantaloupe.properties" - source = "cantaloupe/local/cantaloupe.properties" + source = "/tmp/cantaloupe.properties" readonly = true bind_options { propagation = "rshared" @@ -409,7 +409,7 @@ log.access.SyslogAppender.port = 514 log.access.SyslogAppender.facility = LOCAL0 EOF - destination = "local/cantaloupe.properties" + destination = "/tmp/cantaloupe.properties" } resources { From 70a2dde1504157b62c6f5fb8c1b86731bb0bdc04 Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 15:10:46 -0500 Subject: [PATCH 20/22] Testing a variable interpolation. --- group.nomad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/group.nomad b/group.nomad index f48edd9..640c169 100644 --- a/group.nomad +++ b/group.nomad @@ -12,7 +12,7 @@ task "cantaloupe" { mount { type = "bind" target = "/etc/cantaloupe/cantaloupe.properties" - source = "/tmp/cantaloupe.properties" + source = "${NOMAD_TASK_DIR}/local/cantaloupe.properties" readonly = true bind_options { propagation = "rshared" @@ -409,7 +409,7 @@ log.access.SyslogAppender.port = 514 log.access.SyslogAppender.facility = LOCAL0 EOF - destination = "/tmp/cantaloupe.properties" + destination = "local/cantaloupe.properties" } resources { From dbe2569074fc05ee46f3ed2a1115d0212f8141a8 Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Tue, 5 Sep 2023 15:22:56 -0500 Subject: [PATCH 21/22] Should work but doesnt. --- group.nomad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group.nomad b/group.nomad index 640c169..7455807 100644 --- a/group.nomad +++ b/group.nomad @@ -12,7 +12,7 @@ task "cantaloupe" { mount { type = "bind" target = "/etc/cantaloupe/cantaloupe.properties" - source = "${NOMAD_TASK_DIR}/local/cantaloupe.properties" + source = "local/cantaloupe.properties" readonly = true bind_options { propagation = "rshared" From 56bb944c176e38e9c4e47adfecff1d05197f6e9b Mon Sep 17 00:00:00 2001 From: Robert Keizer Date: Fri, 8 Sep 2023 09:22:44 -0500 Subject: [PATCH 22/22] Tossing in some headers. --- nginx-vhost.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nginx-vhost.conf b/nginx-vhost.conf index 23e2d7d..c3e5c24 100644 --- a/nginx-vhost.conf +++ b/nginx-vhost.conf @@ -16,6 +16,10 @@ server { add_header 'Access-Control-Allow-Methods' 'GET, HEAD, POST, PUT, PATCH, DELETE' always; add_header 'Access-Control-Expose-Headers' '*' always; + proxy_set_header X-Forwarded-Host iiif.archive.org; + proxy_set_header X-Forwarded-Path /image; + proxy_set_header X-Forwarded-For $remote_addr; + rewrite ^ $request_uri; rewrite ^/iiif/image/2/(.*)$ /iiif/2/$1 break; @@ -27,6 +31,9 @@ server { add_header 'Access-Control-Allow-Origin' '*' always; add_header 'Access-Control-Allow-Methods' 'GET, HEAD, POST, PUT, PATCH, DELETE' always; add_header 'Access-Control-Expose-Headers' '*' always; + proxy_set_header X-Forwarded-Host iiif.archive.org; + proxy_set_header X-Forwarded-Path /image; + proxy_set_header X-Forwarded-For $remote_addr; rewrite ^ $request_uri; rewrite ^/iiif/image/3/(.*)$ /iiif/3/$1 break; @@ -38,6 +45,9 @@ server { add_header 'Access-Control-Allow-Origin' '*' always; add_header 'Access-Control-Allow-Methods' 'GET, HEAD, POST, PUT, PATCH, DELETE' always; add_header 'Access-Control-Expose-Headers' '*' always; + proxy_set_header X-Forwarded-Host iiif.archive.org; + proxy_set_header X-Forwarded-Path /image; + proxy_set_header X-Forwarded-For $remote_addr; rewrite ^ $request_uri; rewrite ^/iiif/image/(.*)$ /iiif/3/$1 break;