Álvaro Tejero Cantero 4cb0e452ff
Merge branch 'develop' into iop-vc-preview
Bring iop-vc-preview up to develop b438676d6c.

Conflicts:
- migrations.clj: develop's 0157-migrate-legacy-file-data and
  0158-del-forbidden-file-library-rels keep develop's order, and the
  branch's 0800-0808 follow them. No file names collide, so nothing
  is renumbered.
- files_update.clj: develop's save-path rewrite wins (commit-by-commit
  rejection, page-scoped validation, the file carrying ::changes and
  ::rejected). The branch's op-log save is ported onto it instead of
  the earlier [file op-changes media-index] triple:
  process-changes-and-validate attaches the media fix-up remap as
  ::media-index, and update-file* builds the op-log vector from the
  accepted changes (remapped) behind the repair changes. A branch
  save persists only when develop's saved? holds, and its audit and
  log outcome is "rejected" when the first commit is refused.
  The tpoint threading, persist-branch-file!, the public
  invalidate-caches!, and the branch audit props are kept.
- Repair and validation timing tests: take develop's calls, since
  process-changes-and-validate returns a file again.
- binfile_test.clj: keep the branch import-overwrite test and
  develop's library relation tests.
- dashboard.cljs, dashboard_test.cljs: union of requires and tests.
- viewer.cljs: develop's optional page-id plus the branch's pr-id.
- left_header.cljs: develop's raw-svg logo, recent-files href and
  project link, inside the branch's wrapper with the review badge,
  branch title and branch bar. The unused deprecated-icon require
  and nav-to-project go.
- en.po, es.po: three-way merge by msgid. Every entry of both sides
  is kept, develop's removals of a duplicate errors.save-retrying and
  of integrations.mcp-server.title.beta stand, and labels.retry
  carries develop's references plus the branch's.

Adaptations to develop:
- email.clj, files_pull_request.clj: the review request email joins
  develop's template registry and goes through send-template, as the
  comment emails it mirrors now do. The registry coverage test lists
  it, and the rollback test of the pull request commands injects its
  failure into send-template, the function the create path now calls.
- rpc_file_pull_request_test.clj: pr-flags is read at test time
  instead of at namespace load. The loaded value held the production
  defaults, which now enable the admin console (#12475), and it
  replaced th/state-init's test flags, so creating a profile called
  nitrate and failed with :nitrate-not-configured.

AI-assisted-by: claude-opus-5-5
Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>
2026-11-11 17:51:20 +01:00

132 lines
4.4 KiB
Bash

#!/usr/bin/env bash
export PENPOT_ADMIN_CONSOLE_SHARED_KEY=super-secret-nitrate-api-key
export PENPOT_EXPORTER_SHARED_KEY=super-secret-exporter-api-key
export PENPOT_NEXUS_SHARED_KEY=super-secret-nexus-api-key
export PENPOT_SECRET_KEY=super-secret-devenv-key
export PENPOT_MEDIA_PROCESSOR_SHARED_KEY=super-secret-media-processor-key
# DEPRECATED: only used for subscriptions
export PENPOT_MANAGEMENT_API_KEY=super-secret-management-api-key
# Runtime config that varies per devenv instance (PENPOT_HOST, PENPOT_PUBLIC_URI,
# PENPOT_DATABASE_*, PENPOT_REDIS_URI, PENPOT_OBJECTS_STORAGE_*, AWS_*) is owned by
# docker/devenv/defaults.env and injected via the main service's env block.
if [ -f /home/selfsigned.crt ]; then
export NODE_EXTRA_CA_CERTS=/home/selfsigned.crt;
fi
# Background worker flag is per-instance. Defaults to enabled (ws0); ws1+
# overlays set PENPOT_BACKEND_WORKER=false so scheduled and async tasks only
# run on ws0, keeping notification Pub/Sub bound to a single Valkey. See
# mem:devenv/core for the rationale.
__worker_flag=""
if [[ "${PENPOT_BACKEND_WORKER:-true}" == "true" ]]; then
__worker_flag="enable-backend-worker"
fi
export PENPOT_MEDIA_PROCESSING_SERVICE_URI=http://localhost:6065
export PENPOT_FLAGS="\
$PENPOT_FLAGS \
enable-login-with-password \
enable-login-with-ldap \
disable-login-with-oidc \
disable-login-with-google \
disable-login-with-github \
disable-login-with-gitlab \
disable-telemetry \
$__worker_flag \
enable-backend-asserts \
disable-feature-fdata-pointer-map \
enable-feature-fdata-objects-map \
enable-audit-log \
enable-transit-readable-response \
disable-remote-media-processing \
enable-demo-users \
enable-user-feedback \
disable-secure-session-cookies \
enable-smtp \
enable-account-lockout \
enable-prepl-server \
enable-urepl-server \
enable-nrepl-server \
enable-rpc-climit \
enable-rpc-rlimit \
enable-quotes \
enable-soft-rpc-rlimit \
enable-auto-file-snapshot \
enable-webhooks \
enable-access-tokens \
disable-tiered-file-data-storage \
enable-file-validation \
enable-file-schema-validation \
enable-debug-save-faults \
enable-redis-cache \
enable-link-preview \
enable-branching \
enable-subscriptions";
# Uncomment for nexus integration testing
# export PENPOT_FLAGS="$PENPOT_FLAGS enable-nexus";
# export PENPOT_NEXUS_URI="http://localhost:6070/";
# Default deletion delay for devenv
export PENPOT_DELETION_DELAY="24h"
# Setup default upload media file size to 100MiB
export PENPOT_MEDIA_MAX_FILE_SIZE=104857600
# Setup default multipart upload size to 300MiB
export PENPOT_HTTP_SERVER_MAX_MULTIPART_BODY_SIZE=314572800
export PENPOT_USER_FEEDBACK_DESTINATION="support@example.com"
export PENPOT_ADMIN_CONSOLE_URI=http://localhost:3000/admin-console
export JAVA_OPTS="\
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager \
-Djdk.attach.allowAttachSelf \
-Dlog4j2.configurationFile=log4j2-devenv.xml \
-Djdk.tracePinnedThreads=full \
-XX:+UnlockExperimentalVMOptions \
-XX:+UseShenandoahGC \
-XX:+UseCompactObjectHeaders \
-XX:ShenandoahGCMode=generational \
-XX:NativeMemoryTracking=summary \
-XX:-OmitStackTraceInFastThrow \
--sun-misc-unsafe-memory-access=allow \
--enable-preview \
--enable-native-access=ALL-UNNAMED \
--add-opens=java.base/java.nio=ALL-UNNAMED";
function setup_s3_bucket() {
if [ "${PENPOT_OBJECTS_STORAGE_BACKEND}" != "s3" ]; then
return 0
fi
local attempts=0
local endpoint="${PENPOT_OBJECTS_STORAGE_S3_ENDPOINT}"
local bucket="${PENPOT_OBJECTS_STORAGE_S3_BUCKET}"
local region="${PENPOT_OBJECTS_STORAGE_S3_REGION}"
until aws s3api head-bucket \
--endpoint-url "$endpoint" \
--region "$region" \
--bucket "$bucket" >/dev/null 2>&1; do
if aws s3 mb "s3://${bucket}" \
--endpoint-url "$endpoint" \
--region "$region" >/dev/null 2>&1; then
return 0
fi
attempts=$((attempts + 1))
if [ "$attempts" -ge 30 ]; then
echo "setup_s3_bucket: unable to create s3://${bucket} after ${attempts} attempts" >&2
return 1
fi
sleep 1
done
}