Skip to content

Commit 6e96042

Browse files
authored
Make the drupal URI configurable
1 parent 1c04fa8 commit 6e96042

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

mergepdf/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RUN --mount=type=bind,from=leptonica,source=/packages,target=/packages \
4040
poppler-utils=="${POPPLER_VERSION}"
4141

4242
ENV \
43-
MAX_THREADS=5
43+
MAX_THREADS=5 \
44+
URI_SCHEME="private://"
4445

4546
COPY --link rootfs /

mergepdf/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ The drupal site requires a route available at `/term_from_term_name`. This View
2323
| Environment Variable | Default | Description |
2424
| :------------------- | :-------------------------------------------------------- | :---------------------------------------------------------------------- |
2525
| MAX_THREADS | 5 | How many images to download at once from a IIIF manifest |
26+
| URI_SCHEME | `public://` | The Drupal URI to store the generated PDF in |

mergepdf/rootfs/app/cmd.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,13 @@ TID=$(curl -sf \
9999
-H "Authorization: $SCYLLARIDAE_AUTH" \
100100
"$BASE_URL/term_from_term_name?vocab=islandora_media_use&name=Original+File&_format=json" \
101101
| jq '.[0].tid[0].value')
102+
103+
YEAR=$(date +"%Y")
104+
MONTH=$(date +"%m")
102105
curl \
103106
-H "Authorization: $SCYLLARIDAE_AUTH" \
104107
-H "Content-Type: application/pdf" \
105-
-H "Content-Location: private://derivatives/pc/pdf/$NID.pdf" \
108+
-H "Content-Location: $URI_SCHEME/derivatives/$YEAR/$MONTH/pc/$NID.pdf" \
106109
-T "$TMP_DIR/ocr.pdf" \
107110
"$1/media/document/$TID"
108111

0 commit comments

Comments
 (0)