mirror of
https://github.com/penpot/penpot.git
synced 2026-06-29 10:42:06 +00:00
- Replace im4java Java library with direct 'magick' CLI calls via shell/exec! - Add PENPOT_IMAGEMAGICK_* config env vars for resource limits (thread, memory, map, area, disk, time, width, height) - Use configurable ImageMagick environment with sensible defaults matching policy.xml - Remove -Dim4java.useV7=true JVM flag from startup scripts - Remove org.im4java/im4java from deps.edn - All ImageMagick commands now use shell/exec! with 60s timeout and resource limits Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>
27 lines
793 B
Bash
27 lines
793 B
Bash
#!/usr/bin/env bash
|
|
|
|
if [[ ! -n "$JAVA_CMD" ]]; then
|
|
if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
|
|
JAVA_CMD="$JAVA_HOME/bin/java"
|
|
else
|
|
set +e
|
|
JAVA_CMD=$(type -p java)
|
|
set -e
|
|
if [[ ! -n "$JAVA_CMD" ]]; then
|
|
>&2 echo "Couldn't find 'java'. Please set JAVA_HOME."
|
|
exit 1
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
if [ -f ./environ ]; then
|
|
source ./environ
|
|
fi
|
|
|
|
export JAVA_OPTS="-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager -Dlog4j2.configurationFile=log4j2.xml -XX:-OmitStackTraceInFastThrow --sun-misc-unsafe-memory-access=allow --enable-native-access=ALL-UNNAMED --enable-preview $JVM_OPTS $JAVA_OPTS"
|
|
|
|
ENTRYPOINT=${1:-app.main};
|
|
|
|
set -ex
|
|
exec $JAVA_CMD $JAVA_OPTS -jar penpot.jar -m $ENTRYPOINT
|