3392 Commits

Author SHA1 Message Date
María Valderrama 2de08f00e8 🐛 Fix teams' inactive status for nitrate (#10763) 2026-07-21 10:23:03 +02:00
Marina López 27392abd49 🐛 Increase team name abbreviation limit in invitation emails 2026-07-21 09:54:06 +02:00
Andrey Antukh c6de3ce47b 📎 Do not drop uuid-ossp extension on migrations
Requires specific permissions
2026-07-20 14:05:04 +02:00
Andrey Antukh 5f35fdf217 ♻️ Replace uuid-ossp defaults with gen_random_uuid() and add missing :id on insert (#10591)
* 📎 Add postgresql client tool wrapper for devenv

* ♻️ Replace uuid-ossp defaults with gen_random_uuid() and add missing :id on insert

- Switch all DEFAULT uuid_generate_v4() to gen_random_uuid()
  (built-in PG 13+, no extension required)
- Add explicit :id (uuid/next) to 4 db/insert! calls that were
  relying on the DB default (team-profile-rel, project-profile-rel,
  team-project-profile-rel)
- Drop uuid-ossp extension (no longer needed)
- Add missing uuid require to projects.clj and srepl/binfile.clj

AI-assisted-by: deepseek-v4-flash

---------

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
2026-07-20 12:14:44 +02:00
Andrey Antukh 5acc3aac99 Merge remote-tracking branch 'origin/staging' into develop 2026-07-20 11:48:26 +02:00
Andrey Antukh fc6b3ee7f0 🐛 Demote OIDC userinfo 401 errors to warning and add comprehensive test coverage (#10636)
* 🐛 Demote unable-to-retrieve-user-info OIDC error to warning level

401 responses from the OIDC userinfo endpoint (e.g. expired/revoked GitHub
token) are normal auth failures, not server errors. Logging at :error level
triggers the database and Mattermost error reporters unnecessarily.

AI-assisted-by: deepseek-v4-flash

*  Add pure function tests for OIDC auth module

Add tests for: int-in-range?, valid-info?, qualify-prop-key, qualify-props,
provider-has-email-verified?, profile-has-provider-props?, redirect-response,
redirect-with-error, redirect-to-verify-token, and build-redirect-uri.

AI-assisted-by: deepseek-v4-flash

*  Add HTTP-mock tests for fetch-user-info and fetch-access-token

Replace with-redefs with binding (cf/config is ^:dynamic).
Add tests for: fetch-user-info (success, 401, 500, request structure),
fetch-access-token (success, 400 error).

AI-assisted-by: deepseek-v4-flash

*  Add get-info integration tests with partial mocking

Test all branches: token/userinfo/auto info sources, incomplete info,
role checks (satisfied and insufficient), state props merge,
sso-session-id from claims, and sso-provider-id for uuid providers.

AI-assisted-by: deepseek-v4-flash

*  Add callback-handler integration tests with real tokens and session

Tests all main branches: error param, no profile (registration disabled),
profile blocked, provider mismatch, inactive profile, success flow,
and graceful handling of unable-to-retrieve-user-info exception.
Uses real tokens/generate, tokens/verify, and session/inmemory-manager.

AI-assisted-by: deepseek-v4-flash
2026-07-20 11:46:20 +02:00
Marina López 33d478b532 ♻️ Rename org to organization 2026-07-17 11:36:08 +02:00
Andrey Antukh a4347451d0 Merge remote-tracking branch 'origin/staging' into develop 2026-07-16 16:57:32 +02:00
Andrey Antukh 779983d38e 📎 Standardize test scripts and add execution discipline docs
- Remove conditional build from test scripts (frontend, common)
- Remove test:jvm from common package.json (JVM tests via clojure directly)
- Remove test from backend package.json (JVM tests via clojure directly)
- Unify common/scripts/test-quiet.js with frontend's BUILD_STEPS pattern
- Add execution discipline section to mem:testing (no piping, tee to file)
- Add READ mem:testing FIRST directives to module testing docs

AI-assisted-by: deepseek-v4-flash
2026-07-16 14:57:05 +00:00
María Valderrama bdc078d5ea 🐛 Fix mismatched subscription in social login (#10703) 2026-07-15 14:47:44 +02:00
María Valderrama 792d88dc4f 🐛 Fix invalid org invitation show toast (#10693)
* 🐛 Fix invalid org invitation show toast

* 📎 Code review
2026-07-15 12:30:20 +02:00
Andrey Antukh f84a8687f6 Merge remote-tracking branch 'origin/staging' into develop 2026-07-09 19:37:16 +02:00
Andrey Antukh 23a9b4bdd9 🐛 Fix backend util shell tests 2026-07-09 19:34:15 +02:00
Andrey Antukh 8e9df0c515 Add insert-multi chunked variant to app.db 2026-07-09 09:25:59 +02:00
Pablo Alba cc454de9ce 🐛 Fix wrap nitrate sso when there is no profile (#10592) 2026-07-08 14:21:34 +02:00
Pablo Alba 0de8bce895 Add ignore sso flag to nitrate management api endpoints (#10579) 2026-07-08 12:51:03 +02:00
Juanfran ac31edab14 🐛 Skip end-user SSO gate on nitrate org management endpoints (#10559)
get-teams-detail, get-org-invitations and delete-org-invitations lacked
::rpc/auth false, so wrap-nitrate-sso ran on them whenever params carried
an organization-id. For SSO-active orgs this rejected the org owner's
admin-console reads with a 401, since their Penpot session has no SSO
grant for the org. These are shared-key protected management calls made
on the org owner's behalf and never use profile-id, so they should not
require an end-user SSO session — matching their sibling endpoints.
2026-07-07 12:22:17 +02:00
Juanfran 0182f239ae Add Nitrate bulk profile creation endpoint (#10491)
Add a Nitrate-only management RPC method to create active Penpot profiles in
bulk through the existing shared-key protected management API.
2026-07-03 09:45:44 +02:00
Andrey Antukh c4e72fd7f9 Merge remote-tracking branch 'origin/staging' into develop 2026-06-30 16:23:23 +02:00
Andrey Antukh e2b52d88fc ⬆️ Update dependencies 2026-06-30 16:15:30 +02:00
Pablo Alba 6e61e3304b Add and endpoint for nitrate to check the SSO configuration for an organization (#10432) 2026-06-26 11:38:18 +02:00
Juanfran d328cb4a9e Enable org owners to view organization teams (#10388) 2026-06-25 13:07:20 +02:00
Andrey Antukh adbb5a8b5f Merge remote-tracking branch 'origin/staging' into develop 2026-06-25 10:44:07 +02:00
Andrey Antukh a668702982 Merge remote-tracking branch 'origin/main' into staging 2026-06-25 10:43:33 +02:00
Andrés Moya 4d1706f71c 🐛 Fix error when sending user feedback form (#10419)
If the smtp-default-from is something like "Penpot
<no-reply@penpot.app>", the schema validation fails because
it expects a simple email without < >
2026-06-25 10:37:50 +02:00
Pablo Alba 2a5b6a69ad Send warning for email about nitrate orgs with sso (#10413) 2026-06-25 09:53:07 +02:00
María Valderrama 15a336a249 Allow nitrate to view org teams (#10365)
*  Allow nitrate to view org teams

* 📎 Code review

* 📎 Code review 2
2026-06-25 09:28:23 +02:00
Miguel de Benito Delgado a6c7bd28e8 💄 Fix some malli schemas (#7733)
* 🐛 Add missing fields to schema:profile

* 🐛 Add missing fields to schema:dissolve-animation

* 📎 Add minor changes

Signed-off-by: Andrey Antukh <niwi@niwi.nz>

---------

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
Co-authored-by: Andrey Antukh <niwi@niwi.nz>
2026-06-24 13:16:25 +02:00
Pablo Alba 8fa15f240f Check for nitrate sso on move team to another organization (#10379) 2026-06-24 10:02:13 +02:00
Andrey Antukh 9259b596dc Merge remote-tracking branch 'origin/main' into staging 2026-06-23 12:26:17 +02:00
Andrey Antukh d8434cbffb 🐛 Add missing migrations (#10363) 2026-06-22 13:26:21 +02:00
Pablo Alba b984e7bbe8 Add nitrate sso wards to organization navigation 2026-06-19 12:03:21 +02:00
Andrey Antukh 9e52bb40d0 Add process-level resource limits to font processing tools (#10274)
*  Add font processing resource limits via prlimit

Font processing tools (fontforge, sfnt2woff, woff2sfnt, woff2_decompress)
were invoked via clojure.java.shell/sh with no timeouts or resource limits.
This adds process-level resource limits using prlimit(1) and the shell/exec!
infrastructure from the ImageMagick hardening work.

shell/exec! changes:
- Add :prlimit parameter that prepends prlimit(1) to the command
- :prlimit takes {:mem <MiB> :cpu <seconds>} for address space and CPU time
  limits, enforced by the kernel's RLIMIT subsystem
- prlimit-cmd builds the prlimit command prefix (private helper)

Font processing changes:
- Replace all clojure.java.shell/sh calls with shell/exec! via exec-font!
- exec-font! applies font-prlimit (512 MiB, 30s CPU, 60s wall-clock)
- All 5 conversion functions (ttf->otf, otf->ttf, ttf-or-otf->woff,
  woff->sfnt, woff2->sfnt) use try/finally for explicit temp file cleanup
- Remove clojure.java.shell require from media.clj

Tests:
- Add exec-prlimit-normal, exec-prlimit-cpu, exec-prlimit-memory tests

Closes #10234

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>

*  Make font processing resource limits configurable

Replace hardcoded font-prlimit map and wall-clock timeout with
config-driven values under the PENPOT_FONT_PROCESS_* namespace.
The prlimit implementation detail is not exposed in config keys.

Co-authored-by: deepseek-v4-flash <deepseek-v4-flash@penpot.app>

---------

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>
Co-authored-by: deepseek-v4-flash <deepseek-v4-flash@penpot.app>
2026-06-19 11:30:48 +02:00
Luis de Dios 4a41b2e5e0 ♻️ Update in-app onboarding slides (#10086)
* ♻️ Modify social media icons in verification email

* ♻️ Update verify email

* ♻️ Update copies in 'check your email'

* ♻️ Update onboarding images

* ♻️ Refurbish create team slide

* ♻️ Refactor SCSS for in-app onboarding

* 🐛 Fix replace old uxbox with penpot image for all email HTMLs

* 🐛 Fix use of link component
2026-06-18 22:49:29 +02:00
Miguel de Benito Delgado 93b9f5c567 🐛 Follow 302 redirects when downloading templates (#10308)
* 💄 Update URIs for templates to avoid redirects

* 🐛 Follow 302 redirects when downloading templates
2026-06-18 18:14:56 +02:00
Andrey Antukh 196e47fa93 Backport MCP related changes from develop (#10315)
* ♻️ Add mcp integration state management refactor (#10226)

* ♻️ Add mcp integration state management refactor

* 🐛 Fix access tokens do not appear

* ♻️ Refactor some names

* ♻️ Refactor token deletion

---------

Co-authored-by: Luis de Dios <luis.dedios@kaleidos.net>

* 🐛 Fix stale MCP token data after create/regenerate (#10280)

Fix the root cause in profile.cljs: remove the optimistic conj from
access-token-created and instead chain a fetch-access-tokens after the
create-access-token API call succeeds. This ensures all callers get a
fresh, server-consistent token list automatically.

Suggested-by: niwinz

Signed-off-by: kapilvus <kapil69265@gmail.com>
Co-authored-by: kapilvus <kapilvus@gmail.com>

*  Remove non-recoverable mcp key warning from regenerated modal (#10298)

---------

Signed-off-by: kapilvus <kapil69265@gmail.com>
Co-authored-by: Luis de Dios <luis.dedios@kaleidos.net>
Co-authored-by: kapil971390 <kapil69265@gmail.com>
Co-authored-by: kapilvus <kapilvus@gmail.com>
2026-06-18 18:08:40 +02:00
Andrey Antukh b4532486e3 Add configurable resource usage limits for imagemagick (#10240)
* 🐳 Add ImageMagick policy.xml resource limits to backend Docker image

Add a restrictive policy.xml to the backend Docker image that caps
ImageMagick resource usage: 256MiB memory, 512MiB map, 128MP area,
30s time limit, 16KP max dimensions. Blocks PS/EPS/PDF/XPS coders
to prevent Ghostscript attack surface.

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>

*  Add timeout support to shell/exec!

Add optional :timeout parameter (in seconds) that uses
Process.waitFor(long, TimeUnit). On timeout, the process is
destroyed forcibly and an :internal/:process-timeout exception
is raised. Stdout/stderr readers handle IOException from closed
streams when the process is killed.

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>

* ♻️ Rename ::wrk/netty-executor to ::wrk/executor with cached pool

Replace DefaultEventExecutorGroup (fixed Netty thread pool) with a
cached thread pool (px/cached-executor) for general async task
offloading. The cached pool creates threads on demand and reuses
idle ones, which is more appropriate for blocking I/O workloads
(shell commands, message bus, rate limiting, etc.).

Changes:
- Rename ::wrk/netty-executor to ::wrk/executor in worker/executor.clj
- Switch implementation from DefaultEventExecutorGroup to px/cached-executor
- Update all ig/ref wiring in main.clj (msgbus, tmp cleaner, climit, rlimit, rpc)
- Remove ::wrk/netty-executor from redis.clj (let lettuce create its own
  eventExecutorGroup instead of sharing a Netty executor)
- Assert executor is present in shell/exec! to prevent silent nil usage
- Remove executor-threads config (no longer needed for cached pool)

The ::wrk/netty-io-executor (NioEventLoopGroup) remains unchanged as it
handles actual non-blocking network I/O for Redis and S3.

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>

* 🔥 Remove im4java dependency and replace with direct ImageMagick CLI calls

- 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>

* 💄 Rename imagemagick env functions and optimize config reads

- Rename imagemagick-defaults -> imagemagick-default-env
- Rename imagemagick-env -> get-imagemagick-env
- Optimize to avoid double cf/get calls per config key

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>

*  Add tests for shell/exec! timeout and media processing

- Add shell_test.clj: tests for exec! timeout, env vars, stdin, stderr
- Add media_test.clj: tests for info, generic-thumbnail, profile-thumbnail
- Fix generic-process to prefer explicit format over input mtype
- Fix shell/exec! to use cached executor when system has no executor
- Fix reduce-kv accumulator in set-env (must return penv)

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>

* ♻️ Refactor media/process to take system as first argument

- Change (defmulti process :cmd) -> (defmulti process (fn [_system params] (:cmd params)))
- Change (run params) -> (run system params)
- All process methods now receive [system params]
- Update all callers: rpc/commands/media, profile, auth, fonts
- Revert shell/exec! to require system with executor (no fallback)
- Fix lint warnings and formatting

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>

* 🔥 Remove unused app.svgo namespace

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>

* 🔥 Remove Node.js from backend Docker image

- Delete unused svgo-cli.js script
- Remove Node.js installation from Dockerfile.backend
- Remove svgo-cli.js copy from backend build script

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>

* 🔥 Remove unused process-error multimethod

- Remove process-error multimethod and its default handler
- Simplify media/run to directly call process
- Fix alignment in main.clj

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>

* 📚 Add ImageMagick resource limits configuration to technical guide

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>

---------

Co-authored-by: mimo-v2.5-pro <mimo-v2.5-pro@penpot.app>
2026-06-18 17:52:01 +02:00
Marina López 785ab53f8c Cancel subscription when user deletes account 2026-06-18 12:09:12 +02:00
Andrey Antukh b391a4c8d3 ♻️ Add mcp integration state management refactor (#10226)
* ♻️ Add mcp integration state management refactor

* 🐛 Fix access tokens do not appear

* ♻️ Refactor some names

* ♻️ Refactor token deletion

---------

Co-authored-by: Luis de Dios <luis.dedios@kaleidos.net>
2026-06-16 18:35:30 +02:00
Juanfran 09db565bc2 🐛 Skip org membership lookup for anonymous invite recipients
When an organization invitation token is verified by a logged-out recipient
(e.g. an unregistered invitee opening the emailed link), profile-id is nil.
The team-invitation branch still evaluated get-org-membership eagerly, calling
nitrate with that nil profile-id. That request fails and surfaces as a generic
error, masking the clean :invalid-token response and dropping the user on the
login screen instead of the dedicated "Invite invalid" page.

Only query membership when a logged-in profile is present, so a canceled or
otherwise invalid org invite reaches the :invalid-token path as intended.
2026-06-16 15:01:47 +02:00
Andrey Antukh 03341ed857 ⬆️ Update npm deps and pnpm on all subpackages (#10183) 2026-06-15 13:57:29 +02:00
Andrey Antukh d44c6250ea Merge remote-tracking branch 'origin/staging' into develop 2026-06-15 13:04:19 +02:00
Andrey Antukh 79227c4de8 Batch multiple thumbnail deletions into a single RPC call (#9943)
*  Batch multiple thumbnail deletions into a single RPC call

Replace the old per-object immediate thumbnail deletion with a
debounced batched approach. The frontend queues object-ids in state
and waits 200ms before sending a single RPC request with up to 200
object-ids. The backend deletes all matching thumbnails in one SQL
statement with a single RETURNING clause, then touches the affected
media objects.

This reduces RPC overhead when rapidly clearing thumbnails (e.g.
navigating pages) and makes deletions more efficient.

Signed-off-by: Andrey Antukh <niwi@niwi.nz>

* 📎 Fix missing issues

---------

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
2026-06-15 12:01:32 +02:00
María Valderrama 68d4238277 🐛 Fix license not loading in theme change 2026-06-12 12:13:50 +02:00
Alonso Torres f5c258b868 🐛 Activate inactive profile when re-registering with disable-email-verification (#9999) 2026-06-11 12:52:07 +02:00
Andrey Antukh 12e7ea038f Merge remote-tracking branch 'origin/staging' into develop 2026-06-11 10:58:19 +02:00
Andrey Antukh ba9b03268a ⬆️ Update backend and common dependencies (#10108)
* 🐛 Fix incorrect valkey uri on backend tests

* ⬆️ Update backend dependencies

* ⬆️ Update pnpm dependencies

* 📎 Fix minor linter issues
2026-06-11 10:11:23 +02:00
Andrey Antukh 9f5a0f767e Merge remote-tracking branch 'origin/staging' into develop 2026-06-10 11:26:48 +02:00
Andrey Antukh 0ac092d177 🐛 Make set-file-shared idempotent to fix race condition with optimistic updates (#10093) 2026-06-10 10:58:50 +02:00
Andrey Antukh 51a9eed02e Backport from develop AGENTS.md changes 2026-06-08 14:35:19 +02:00