Commit Graph

5290 Commits

Author SHA1 Message Date
Eric Dubé 05b047c8b9 Revert "perf(core): very simplistic minifier for homepage (#2630)" (#2641)
This reverts commit ae96912699.
2026-03-10 21:36:14 -04:00
Eric Dubé ae96912699 perf(core): very simplistic minifier for homepage (#2630) 2026-03-10 21:24:13 -04:00
Daniel Salazar e96221b0b6 feat: phase 2 enforce index url ownership and uniqueness (#2625)
* feat: phase 2 enforce index url ownership and uniqueness

Adds write-time index URL uniqueness checks, expands hosted subdomain ownership enforcement to private hosting domains, and updates AppService tests for duplicate-index behavior.

* test: align app service comp fixtures with index url uniqueness

Updates regression test fixtures that intentionally exercise name conflicts and selection paths to use unique index_url values under the new one-index-per-app constraint.

* fix: exempt placeholder index url from uniqueness checks

Skips index_url uniqueness enforcement for the shared dev-center coming-soon URL in both AppService and AppES, and adds unit/comp regressions to keep one-index-per-app behavior for all other URLs.
2026-03-10 18:18:01 -07:00
jelveh 1052d4d51d Avoid reload when embedded in popup
Set reload_on_success explicitly when invoking UIWindowLogin so the UI does not trigger a page reload if the GUI is embedded in a popup. Previously the call forwarded a reload_on_success variable; now it uses !window.embedded_in_popup to prevent unwanted reloads in popup embeds.
2026-03-10 18:10:23 -07:00
Daniel Salazar 156d571b10 feat: limit concurrent request for ai chat (#2640) 2026-03-10 16:13:20 -07:00
ProgrammerIn-wonderland 14f218ef72 fix assets_url bug in GUI buildstep (#2638)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
* fix assets_url bug in GUI buildstep

* add await
2026-03-10 13:55:06 -07:00
ProgrammerIn-wonderland 26a7ae9d4c s/mv/cp/ for gui buildstep (#2637) 2026-03-10 13:47:40 -07:00
ProgrammerIn-wonderland 031a3da7f1 s/icons/assets/ for building GUI (#2636) 2026-03-10 13:38:32 -07:00
ProgrammerIn-wonderland c297715875 add support for building with custom icons (#2635) 2026-03-10 13:21:05 -07:00
Eric Dubé c9787c1d4b devex(core): avoid email verification on dev (#2634)
Add guard to check if `env` in the backend configuration is set to
`'dev'`. When it is set to `'dev'`, do not invoke email verification
extensions.
2026-03-10 15:56:00 -04:00
Eric Dubé cc70e49472 Fix missing password entry (#2632)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
* Revert "dev(oidc): hide unnecessary div"

This reverts commit 468558f8dc.

* fix(oidc): remove the "You will be asked to..." box properly

Earlier this was removed with a simple `display: none` in CSS to avoid
changing any logic, and the reason for that was OIDC had already gone
through significant testing, re-testing, and bug fixes; it became clear
that changes to the auth flow are fragile and the test surface is very
large. Now unfortunately what seemed like a smart decision to fix a
cosmetic issue with CSS instead of updating logic actually wound up
breaking the change username/password flow for non-OIDC users. This
commit removes this box properly and hopefully does not introduce a
subsequent terrible bug. Why would it? There's absolutely no reason I
can see that it would, but it would seem that nothing is safe, not even
CSS.

* temp: disable LRU cache of homepage for now

This is working fine but we're disabling it temporarily so we can test
specific future changes in isolation without managing two separate
branches.

* fix: put verify password text in the box

There's always something...
2026-03-10 03:08:29 -04:00
ProgrammerIn-wonderland 9d82f333e5 revert puterjs gui ordering (#2631)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-03-09 21:41:53 -07:00
Eric Dubé 34d4f491b3 perf(core): LRU cache PuterHomepageService (#2627)
LRU cache the output of PuterHomepageService with a cache key based on
metadata that affects the output of the homepage (if an app was
specified, and if so what app was specified).

With this change in place we can afford more time processing this
output, for example to minify the output and reduce outbound bandwidth.
2026-03-09 22:11:48 -04:00
ProgrammerIn-wonderland b687ba0456 Ns/configurable gui bundle (#2629)
* add configurable GUI bundle

* also support CSS and puterjs custom location

* simplify ternary

* used bundled instead of use_bundled_gui

* Quote the string

* close script tag
2026-03-09 19:08:24 -07:00
Daniel Salazar 57a29999e3 feat: phase 1 canonical app origin resolution (#2624)
* feat: phase 1 canonical app origin resolution

Adds cache-first canonical app uid resolution for origin-based auth flows with oldest-app selection and deterministic fallback, plus regression tests for hosted/non-hosted canonicalization behavior.

* refactor: use kv singleton for origin local cache

Replaces AuthService app-origin local canonicalization Map cache with kvjs singleton keys, applies TTL via EX on writes, and rotates local cache namespace on version bumps to avoid broad clears.

* refactor: target origin cache invalidation

Removes global app-origin cache version bumps and invalidates canonical origin cache entries by affected app index URLs from app.changed payloads. Also emits app and old_app data on update events for targeted invalidation.

* fix: avoid invalid old_app owner field in app change event

Removes owner_user_id access from AppES old_entity event payload because the entity model does not expose that property, fixing AppService comp upsert regression tests.
2026-03-09 16:32:32 -07:00
Daniel Salazar e4a52947fe fix: private app token (#2623)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-03-09 12:49:14 -07:00
eshwar 5e7c2c3ddd Update Hosting API description #2612 (#2620)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
* Update Hosting API description #2612

* Update copy and fix minor formatting

* Update copy 'deployment'

---------

Co-authored-by: artyz <90192969+artysking@users.noreply.github.com>
Co-authored-by: Reynaldi Chernando <reynaldichernando@gmail.com>
2026-03-09 14:19:24 +07:00
Michael Lip 19df50bcba Add Networking examples to docs index page (#2613)
* Add Networking examples to docs index page

Fixes #2611

* Add icons and fix playground link

---------

Co-authored-by: Reynaldi Chernando <reynaldichernando@gmail.com>
2026-03-09 13:52:19 +07:00
Shruc 06b66719fe fix gemini image provider implementation (#2569)
* implement proper calls to gemini image

* remove hardcoded image prices

* fix model selection

* add flash 3.1 image, fix pricing

* also handle uris with data prefix

* more efficient uri parsing

* fix token calculation

* re-add some costs for models page
2026-03-08 23:25:11 -07:00
jelveh 62df3df6a9 Add nl2br Handlebars helper and use in template
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
Convert newline characters in email reason text to <br /> tags and ensure proper escaping. Replaced {{reason}} with {{{nl2br reason}}} in the rejection template and registered an nl2br Handlebars helper that escapes HTML entities, transforms newlines to <br /> and returns a SafeString so line breaks render correctly in emails.
2026-03-08 15:51:54 -07:00
ProgrammerIn-wonderland 004777824d use openrouter provided USD cost when present (#2619)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-03-08 12:12:24 -07:00
Eric Dubé 0fa0340ca2 clean(apps): merge fns only called by get_app_icon_url (#2617)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
Each of these methods is only being called by get_app_icon_url. By
changing that ternary operator into an `if` block with an early return
we can move the bodies of these functions here. If one of the former
functions ever needs to be used in more than one place, it's easy to
extract it out of here agian - for now though let's not pay the cost of
jumping to another function definition while trying to understand this
code if we're not gaining anything from it.
2026-03-06 20:07:14 -05:00
Eric Dubé 2a027ed410 fix(puterfs): await queue items for fsentry action (#2616)
* style(puterfs): update adherence to linter rules

* fix(puterfs): await queue items for fsentry actions

This will ensure some operations always function as expected in a
sequence, although it may incur some performance costs.
2026-03-06 20:04:18 -05:00
ProgrammerIn-wonderland a0fc1bca30 add gpt 5.3 codex and gpt 5.4 (#2618)
* add gpt 5.3 codex and gpt 5.4

* add gemini 3.1 pro preview
2026-03-06 16:59:39 -08:00
Daniel Salazar a861c3e27a chore: typeFixes (#2615)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-03-06 00:04:39 -08:00
Miika Kuisma 8e794faf06 Merge pull request #2595 from HeyPuter/miika/put-611
Fix border colors in Settings panel
2026-03-06 10:03:25 +02:00
Eric Dubé f167da9a0a clean: remove a log (#2610)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-03-04 22:02:36 -05:00
Daniel Salazar 4aab06611e feat: redirect away cookie (#2609) 2026-03-04 17:54:58 -08:00
ProgrammerIn-wonderland 9a6178e66f Make credentialless false by default 2026-03-04 20:54:04 -05:00
Daniel Salazar 237973f227 fix: fetching user from session token (#2607)
old bug was causing issues trying to use sessions as auth checks for tighter security for private apps. missed it without more detailed logs
2026-03-04 17:29:52 -08:00
Daniel Salazar 3f0b0bfd1d feat: more robust error logs (#2605) 2026-03-04 16:47:01 -08:00
Daniel Salazar d28cc46e02 fix: add logs to debug on prod (#2604) 2026-03-04 16:20:52 -08:00
Eric Dubé 0864b9ece1 dev(apps): add configuration to not use app icon subdomain (#2603)
* dev(apps): add configuration to not use app icon subdomain

For some local configurations of Puter, such as using ngrok or a hosting
service that has limited subdomains or limited subdomain depth, the
static hosting subdomain for app icons is difficult to configure and may
not be viable. Since this is only done so an external geo-replicated
cache can be used, and it's always possible for Puter's backend to
generate an app icon, it should be possible to configure Puter's backend
to use icons from a URL hosted on the default subdomain.

Add a configuration parameter to the service "app-icon" called
"no_subdomain" which prevents Puter's backend from sending puter-icons
subdomain URLs or redirecting to them.

Also perform some small cleanup changes to make the existing code easier
to understand, including:
- rename `buildAppIconUrl` to `buildAppIconSubdomainUrl` to make it
  clear which of the two types of icon URLs are being generated.
- replace `withAppIconUrl` with `get_app_icon_url` so it is possible to
  get an icon URL without mutating an app object.
- make the `get_taskbar_items` helper use the same code for getting app
  icons as the `get_apps` helper.

* fix(apps): test initializes a service with no config
2026-03-04 19:10:32 -05:00
jelveh d802d12a05 Add UI notify API and notification handling 2026-03-04 15:29:50 -08:00
Daniel Salazar 9721943040 fix: prioritize new token thant anything outdated stored in localstorage (#2600) 2026-03-04 14:49:05 -08:00
KernelDeimos fc29e57730 fix(oidc): request object reference in oidc signup
The request object was not being passed to OIDC signup because it is
called by createUserFromOIDC which doesn't take a request object as a
parameter. It was decided to have `create_user` take the request object
from context if it's not specified rather than change the signature of
createUserFromOIDC.
2026-03-04 14:33:36 -05:00
Daniel Salazar 1720c97851 fix: origin canonization (#2597) 2026-03-04 11:09:25 -08:00
Daniel Salazar 8a14871dde fix: bad token generation for private apps (#2596)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-03-04 10:09:16 -08:00
Miika Kuisma f887c56e61 Restored previously used border colors 2026-03-04 10:32:39 +02:00
jelveh 6248a89a59 Add autoplay to iframe allow list
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-03-03 22:20:31 -08:00
Daniel Salazar 6b6f9b4743 fix: puter site middleware host (#2594) 2026-03-03 22:18:47 -08:00
Daniel Salazar 8380b28d8a fix: reset subdomain if empty (#2593) 2026-03-03 21:07:55 -08:00
Daniel Salazar adf034b120 feat: add subdomain to private asset tokens (#2591) 2026-03-03 20:37:17 -08:00
KernelDeimos 468558f8dc dev(oidc): hide unnecessary div
I decided not to remove it because I really don't want to introduce a
bug right now while everything is finally working smoothly... I'm making
a note to properly clean this up later when it can be more easily tested
in isolation from everything else.
2026-03-03 23:08:05 -05:00
Daniel Salazar dbdead9ad1 fix: remove redis cache scan in favour of direct key invalidation (#2589) 2026-03-03 19:55:41 -08:00
jelveh 80cabca7ad Add Google SVG icon to sign-in button 2026-03-03 19:31:39 -08:00
Baptiste Lyet f0d0e1d8ca docs : udpdate current year (#2585) 2026-03-04 10:30:42 +07:00
Daniel Salazar 911c163fc8 feat: private app config to use app urls + app routing (#2587)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
* feat: private app config to use app urls

* fix: launch app

* fix: cookie origin
2026-03-03 18:34:33 -08:00
KernelDeimos 3cd5268379 fix(oidc): login flow with puter.ui.authenticateWithPuter
It turns out there are nuances between `puter.ui.authenticateWithPuter`
vs `puter.auth.signIn` - these don't do the same thing. The primary
difference is that `puter.ui.authenticateWithPuter` will display an
override if it's not triggered by a user action, whereas
`puter.auth.signIn` will not. This definitely suggests
`puter.ui.authenticateWithPuter` should be a caller of
`puter.auth.signIn` instead of implementing its own logic for handling
the popup - that makes this part of the code more fagile - but that
refactor is out-of-scope for this bug fix.
2026-03-03 21:20:46 -05:00
Daniel Salazar 1f975b9d19 fix: private app config to use app urls (#2586) 2026-03-03 15:49:33 -08:00