Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build/scripts/orchestrated/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ export NODE_CONFIG='{
"FileConverter": {
"converter": {
"maxprocesscount": 0.001,
"maxDownloadBytes": '${FILECONVERTER_MAX_DOWNLOAD_BYTES:-524288000}',
"inputLimits": [
{ "type": "docx;dotx;docm;dotm", "zip": { "uncompressed": "'${FILECONVERTER_INPUT_LIMIT_UNCOMPRESSED:-500MB}'", "template": "*.xml" } },
{ "type": "xlsx;xltx;xlsm;xltm", "zip": { "uncompressed": "'${FILECONVERTER_INPUT_LIMIT_UNCOMPRESSED:-500MB}'", "template": "*.xml" } },
{ "type": "pptx;ppsx;potx;pptm;ppsm;potm", "zip": { "uncompressed": "'${FILECONVERTER_INPUT_LIMIT_UNCOMPRESSED:-500MB}'", "template": "*.xml" } },
{ "type": "vsdx;vstx;vssx;vsdm;vstm;vssm", "zip": { "uncompressed": "'${FILECONVERTER_INPUT_LIMIT_UNCOMPRESSED:-500MB}'", "template": "*.xml" } }
],
"signingKeyStorePath": "/var/www/'${COMPANY_NAME}'/config/signing-keystore.p12"
}
},
Expand Down
22 changes: 22 additions & 0 deletions build/scripts/standalone/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,26 @@ if [ "$METRICS_ENABLED" = "true" ]; then
jq_set '.statsd.prefix = $metricsPrefix'
fi

# FileConverter limits (max upload/conversion size).
# Both are optional overrides; when unset the built-in default.json values apply.
# maxDownloadBytes: max size in bytes of the file the converter will download.
if [ -n "${FILECONVERTER_MAX_DOWNLOAD_BYTES:-}" ]; then
case "$FILECONVERTER_MAX_DOWNLOAD_BYTES" in
''|*[!0-9]*) >&2 echo "WARN: FILECONVERTER_MAX_DOWNLOAD_BYTES is not a plain byte count, ignoring" ;;
*) jq_set '.FileConverter.converter.maxDownloadBytes = ($maxDownloadBytes | tonumber)' ;;
esac
fi
# inputLimits: max *uncompressed* size of the office file's zip (e.g. "500MB").
# Replaces the whole inputLimits array (node-config replaces arrays, not merges).
if [ -n "${FILECONVERTER_INPUT_LIMIT_UNCOMPRESSED:-}" ]; then
jq_set '.FileConverter.converter.inputLimits = [
{ "type": "docx;dotx;docm;dotm", "zip": { "uncompressed": $inputLimitUncompressed, "template": "*.xml" } },
{ "type": "xlsx;xltx;xlsm;xltm", "zip": { "uncompressed": $inputLimitUncompressed, "template": "*.xml" } },
{ "type": "pptx;ppsx;potx;pptm;ppsm;potm", "zip": { "uncompressed": $inputLimitUncompressed, "template": "*.xml" } },
{ "type": "vsdx;vstx;vssx;vsdm;vstm;vssm", "zip": { "uncompressed": $inputLimitUncompressed, "template": "*.xml" } }
]'
fi

# Construct the AMQP URI value (may be unused if AMQP_HOST=localhost and AMQP_URI unset).
# AMQP_VHOST is a vhost name (e.g. "myvhost"); normalize to a leading slash before
# appending to the URI so values without it still produce a valid amqp:// URI.
Expand Down Expand Up @@ -282,6 +302,8 @@ jq \
--arg metricsHost "$METRICS_HOST" \
--arg metricsPort "$METRICS_PORT" \
--arg metricsPrefix "$METRICS_PREFIX" \
--arg maxDownloadBytes "${FILECONVERTER_MAX_DOWNLOAD_BYTES:-}" \
--arg inputLimitUncompressed "${FILECONVERTER_INPUT_LIMIT_UNCOMPRESSED:-}" \
"$jq_filter" \
"$CONFIG_FILE" > "${CONFIG_FILE}.tmp"
mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE"
Expand Down
2 changes: 1 addition & 1 deletion server
Loading