2020-11-09 08:45:29 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# This script submits a job to regenerate all preview images. This may
|
|
|
|
# be necessary if you change the dpi setting that affects the size of
|
|
|
|
# the preview.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2021-01-22 21:32:02 +00:00
|
|
|
CURL_CMD="curl"
|
|
|
|
JQ_CMD="jq"
|
|
|
|
|
|
|
|
|
2020-11-09 08:45:29 +00:00
|
|
|
BASE_URL="${1:-http://localhost:7880}"
|
2021-07-04 19:37:34 +00:00
|
|
|
TRIGGER_URL="$BASE_URL/api/v1/admin/attachments/generatePreviews"
|
2020-11-09 08:45:29 +00:00
|
|
|
|
|
|
|
echo "Login to trigger regenerating preview images."
|
|
|
|
echo "Using url: $BASE_URL"
|
2021-07-04 19:37:34 +00:00
|
|
|
echo -n "Admin Secret: "
|
|
|
|
read -s ADMIN_SECRET
|
2020-11-09 08:45:29 +00:00
|
|
|
echo
|
|
|
|
|
2021-07-04 19:37:34 +00:00
|
|
|
curl --fail -XPOST -H "Docspell-Admin-Secret: $ADMIN_SECRET" "$TRIGGER_URL"
|