2021-11-03 07:06:46 -05:00
|
|
|
#!/usr/bin/env bash
|
2019-12-09 10:29:26 -05:00
|
|
|
|
2022-04-04 03:52:50 -05:00
|
|
|
export PENPOT_HOST=devenv
|
|
|
|
export PENPOT_TENANT=dev
|
2023-03-16 13:36:18 -05:00
|
|
|
export PENPOT_FLAGS="\
|
|
|
|
$PENPOT_FLAGS \
|
|
|
|
enable-prepl-server \
|
|
|
|
enable-urepl-server \
|
2023-11-09 12:32:37 -05:00
|
|
|
enable-nrepl-server \
|
2023-03-16 13:36:18 -05:00
|
|
|
enable-webhooks \
|
|
|
|
enable-backend-asserts \
|
|
|
|
enable-audit-log \
|
|
|
|
enable-transit-readable-response \
|
|
|
|
enable-demo-users \
|
2023-11-10 05:40:52 -05:00
|
|
|
enable-feature-fdata-pointer-map \
|
|
|
|
enable-feature-fdata-objects-map \
|
2023-03-16 13:36:18 -05:00
|
|
|
disable-secure-session-cookies \
|
|
|
|
enable-smtp \
|
2023-09-26 07:54:10 -05:00
|
|
|
enable-access-tokens \
|
2023-11-20 10:15:09 -05:00
|
|
|
disable-feature-components-v2 \
|
2023-11-23 08:00:39 -05:00
|
|
|
enable-file-validation \
|
|
|
|
enable-file-schema-validation \
|
|
|
|
disable-soft-file-schema-validation \
|
|
|
|
disable-soft-file-validation";
|
2021-01-29 05:00:54 -05:00
|
|
|
|
2023-12-05 07:16:13 -05:00
|
|
|
export OPTIONS="
|
|
|
|
-A:jmx-remote -A:dev \
|
|
|
|
-J-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager \
|
|
|
|
-J-Djdk.attach.allowAttachSelf \
|
|
|
|
-J-Dpolyglot.engine.WarnInterpreterOnly=false \
|
2024-02-14 09:16:05 -05:00
|
|
|
-J-Dlog4j2.configurationFile=log4j2-devenv.xml \
|
2023-12-05 07:16:13 -05:00
|
|
|
-J-XX:+EnableDynamicAgentLoading \
|
|
|
|
-J-XX:-OmitStackTraceInFastThrow \
|
|
|
|
-J-XX:+UnlockDiagnosticVMOptions \
|
|
|
|
-J-XX:+DebugNonSafepoints"
|
|
|
|
|
2024-01-10 07:44:00 -05:00
|
|
|
# Setup default upload media file size to 100MiB
|
|
|
|
export PENPOT_MEDIA_MAX_FILE_SIZE=104857600
|
|
|
|
|
2023-12-05 07:16:13 -05:00
|
|
|
# Setup HEAP
|
|
|
|
# export OPTIONS="$OPTIONS -J-Xms50m -J-Xmx1024m"
|
|
|
|
# export OPTIONS="$OPTIONS -J-Xms1100m -J-Xmx1100m -J-XX:+AlwaysPreTouch"
|
|
|
|
|
|
|
|
# Increase virtual thread pool size
|
|
|
|
# export OPTIONS="$OPTIONS -J-Djdk.virtualThreadScheduler.parallelism=16"
|
|
|
|
|
|
|
|
# Disable C2 Compiler
|
|
|
|
# export OPTIONS="$OPTIONS -J-XX:TieredStopAtLevel=1"
|
|
|
|
|
|
|
|
# Disable all compilers
|
|
|
|
# export OPTIONS="$OPTIONS -J-Xint"
|
|
|
|
|
|
|
|
# Setup GC
|
|
|
|
# export OPTIONS="$OPTIONS -J-XX:+UseG1GC"
|
|
|
|
|
|
|
|
# Setup GC
|
|
|
|
# export OPTIONS="$OPTIONS -J-XX:+UseZGC"
|
|
|
|
|
|
|
|
# Enable ImageMagick v7.x support
|
|
|
|
# export OPTIONS="-J-Dim4java.useV7=true $OPTIONS";
|
|
|
|
|
2023-11-28 11:20:28 -05:00
|
|
|
|
2023-11-09 12:32:37 -05:00
|
|
|
# Initialize MINIO config
|
2023-11-28 11:20:28 -05:00
|
|
|
mc alias set penpot-s3/ http://minio:9000 minioadmin minioadmin -q
|
|
|
|
mc admin user add penpot-s3 penpot-devenv penpot-devenv -q
|
2023-12-04 05:13:52 -05:00
|
|
|
mc admin user info penpot-s3 penpot-devenv |grep -F -q "readwrite"
|
2023-11-28 11:20:28 -05:00
|
|
|
if [ "$?" = "1" ]; then
|
|
|
|
mc admin policy attach penpot-s3 readwrite --user=penpot-devenv -q
|
|
|
|
fi
|
|
|
|
mc mb penpot-s3/penpot -p -q
|
2023-11-09 12:32:37 -05:00
|
|
|
|
|
|
|
export AWS_ACCESS_KEY_ID=penpot-devenv
|
|
|
|
export AWS_SECRET_ACCESS_KEY=penpot-devenv
|
|
|
|
export PENPOT_ASSETS_STORAGE_BACKEND=assets-s3
|
|
|
|
export PENPOT_STORAGE_ASSETS_S3_ENDPOINT=http://minio:9000
|
|
|
|
export PENPOT_STORAGE_ASSETS_S3_BUCKET=penpot
|
2019-12-09 10:29:26 -05:00
|
|
|
|
2021-10-20 04:18:28 -05:00
|
|
|
if [ "$1" = "--watch" ]; then
|
2023-11-09 12:32:37 -05:00
|
|
|
trap "exit" INT TERM ERR
|
|
|
|
trap "kill 0" EXIT
|
|
|
|
|
2021-10-20 04:18:28 -05:00
|
|
|
echo "Start Watch..."
|
|
|
|
|
2023-12-05 07:16:13 -05:00
|
|
|
clojure $OPTIONS -A:dev -M -m app.main &
|
2021-10-20 04:18:28 -05:00
|
|
|
|
|
|
|
npx nodemon \
|
|
|
|
--watch src \
|
|
|
|
--watch ../common \
|
|
|
|
--ext "clj" \
|
|
|
|
--signal SIGKILL \
|
2023-11-09 12:32:37 -05:00
|
|
|
--exec 'echo "(app.main/stop)\n\r(repl/refresh)\n\r(app.main/start)\n" | nc -N localhost 6062'
|
|
|
|
|
|
|
|
wait;
|
2021-10-20 04:18:28 -05:00
|
|
|
|
|
|
|
else
|
2023-12-05 07:16:13 -05:00
|
|
|
set -x
|
|
|
|
clojure $OPTIONS -A:dev -M -m app.main;
|
2021-10-20 04:18:28 -05:00
|
|
|
fi
|