Commit Graph

5044 Commits

Author SHA1 Message Date
Neal Shah e3db664690 Ns/opus 4.6 (#2420)
* add opus 4.6

* remove log from webserver service
2026-02-05 10:08:52 -08:00
Neal Shah f8f134412f web-cdn-test (#2414)
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
* web-cdn-test

* fix tests
2026-02-04 16:29:27 -08:00
Daniel Salazar e9d0bdf19b feat: add alerting for usage abuse (#2413)
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-02-04 13:08:18 -08:00
KernelDeimos b8bdc16a03 fix: move readdir-subdomains to ESM
This also causes the filename to have the extension `.mjs` instead of
`.js`, as well as an await added in FilesystemAPIService. Luckily
lifecycle events are async so this didn't cause any problems.

I add this change somewhat reluctantly because this _should_ be a
non-functional change. Technically adding the `await` in
FilesystemAPIService makes it possible (albiet incredibly unlikely) for
some subtle bug or change in behavior to be introduced.
2026-02-04 14:13:43 -05:00
KernelDeimos acb5fa512c clean: log removal and formatting changes 2026-02-04 14:13:43 -05:00
KernelDeimos 13fc737ca0 clean: remove debug logs added to /readdir-subdomains 2026-02-04 14:13:43 -05:00
KernelDeimos 1cda9b7ba8 dev: implement GUI behavior to fetch subdomains later
This change makes GUI invoke readdir without fetching subdomains, and
then fetch subdomains after. This allows displaying the directory items
sooner and then later populating the icons with glyphs to indicate if
there is an associated subdomain.

This was AI-assisted with manual modifications and bug fixes as
necessary.
2026-02-04 14:13:43 -05:00
KernelDeimos 0a694154b1 dev: add /readdir-subdomains endpoint
This endpoint can be called to get subdomain information after
performing a readdir without fetching subdomains.

This was AI-assisted with modifications and bug fixes as necessary.
2026-02-04 14:13:43 -05:00
KernelDeimos d94e3f45ac dev: add readdirSubdomains 2026-02-04 14:13:43 -05:00
KernelDeimos a4088023a3 dev: add parameter to exclude fetching subdomains
This parameter will allow readdir requests to not include subdomain
fetching, which will allow for the later effort of fetching subdomains
for directory listings in the gui with a separate request.
2026-02-04 14:13:43 -05:00
Daniel Salazar eead0fdfa9 fix: redis cache for user (#2409)
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-02-03 17:47:43 -08:00
KernelDeimos 5433dde6d7 dev(extensions): [+] dev-socket
This extensions brings back the dev-socket functionality, which is
really important when testing things like broadcast, alarms, events, etc
; it saves a lot of time if you can invoke a command directly to the
backend.

This is an optional extension that will not be included in production
deployments. This is for development purposes only.
2026-02-03 19:39:07 -05:00
KernelDeimos de7fbced6b log: add debug logs for BroadcastService
These will be more important now that we're changing the transport for
broadcast messages between instances from websockets to webhooks.
2026-02-03 19:39:07 -05:00
KernelDeimos 3a7314d119 dev(backend): add send support for webhook broadcast
This still needs to be tested. I was going to test this using the `test`
command registered by BroadcastService that exists for this purpose but
`dev.sock` doesn't seem to be working anymore.

Why wasn't `dev.sock` working? Well... we deleted all the code that
makes it work. Why did we delete it? That question isn't a setup for my
next statement; I genuinely do not know. The whole point of dev.sock was
so we could remove the dev console but still maintain support for this
commandline interface that's absolutely needed for testing things that
aren't accesible directly from Puter's GUI.
2026-02-03 19:39:07 -05:00
KernelDeimos a40ec79d66 dev(tools): script to manually test broadcast webhooks
This tool makes it possible to manually test webhook support in
BroadcastService without running multiple Puter instances. This helps to
verify the functionality without setting up multiple Puter peers
locally.
2026-02-03 19:39:07 -05:00
KernelDeimos 47432853c4 dev(backend): add broadcast webhook endpoint
This commit adds the "receive" side of webhook support for
BroadcastService, which will eventually make broadcasting stateless and
not requiring of persistent connections.

Some specific considerations taken into account include:
- incremental nonce to prevent replay attacks
- request timestamp to prevent nonce-reuse after restarting
- HMAC signature to ensure authorized peer

Known limitations:
- if instances run indefinitely, eventually the nonce value would wrap
  around to zero and broadcasts would stop working. It is assumed that
  9 quintillion requests in the lifetime of an instance is reasonably
  impossible.
2026-02-03 19:39:07 -05:00
Daniel Salazar e938d5183a fix: limit open router expensive models for now (#2407)
* fix: limit open router expensive models for now

* fix: import extension
2026-02-03 14:43:15 -08:00
Neal Shah 665aee735b dav.puter.com CORS headers (#2406)
* webdav cors stuff

* if OPTIONS request just let it through
2026-02-03 14:13:42 -08:00
KernelDeimos cbde123aa1 fix(backend): undo part of 35461a0
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
It turns out this part of `35461a0` was not necessary to fix this issue,
and the code is still more correct if it falls true when the token's
authorizor has a permission granted.
2026-02-03 15:46:30 -05:00
KernelDeimos 8cd0a7f76b dev(backend): clear cache when revoking tokens 2026-02-03 15:46:30 -05:00
KernelDeimos 5fd1e9b6a6 dev(puter.js): add revokeReadURL 2026-02-03 15:46:30 -05:00
KernelDeimos 3ffe8eaf30 dev(backend): add revoke_access_token endpoint 2026-02-03 15:46:30 -05:00
Daniel Salazar 0234e34b46 Reapply: reverted redis migration changes (#2403) 2026-02-03 11:25:28 -08:00
Daniel Salazar baceb05b48 Revert "feat: replace serializible caches with redis instead of kvjs 🚀 (#2381)"
This reverts commit 7a47047c0d.
2026-02-03 12:43:00 -05:00
Daniel Salazar a4b90083e0 Revert "fix: missing redis changes (#2401)"
This reverts commit 07a389798d.
2026-02-03 12:43:00 -05:00
Daniel Salazar 07a389798d fix: missing redis changes (#2401)
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-02-03 02:55:44 -08:00
Daniel Salazar 7a47047c0d feat: replace serializible caches with redis instead of kvjs 🚀 (#2381)
* wip: redis move

* fix: redis in extensions

* fix: bad isEMpty assignment

* fix: bad redis client config

* wip

* fix: redis keys cache

* fix: redis batch delete

* fix: change bulk cache times to allow for more instaces

* fix: broken tests
2026-02-03 02:18:31 -08:00
KernelDeimos 5250671b01 fix: range headers in file.js
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
Range header support was mostly incorrect, which brought to surface
undefined behavior in OnlyOffice which resulted in a request hanging.
This was the cause of the `pdf-editor` app hanging for a while when
opening it with a new file.
2026-02-02 20:08:02 -05:00
Daniel Salazar e2e4794bbc fix: alerting for metering (#2399) 2026-02-02 15:38:45 -08:00
Neal Shah fa76c21300 WebDAV post migration fixes (#2398)
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-02-02 11:48:16 -08:00
jelveh 7aedeae991 Pass redirect_url to UIWindowSessionList 2026-02-02 09:24:21 -08:00
Neal Shah bf233c8fe0 Add X-EXPECTED-ENTITY-LENGTH for HTTP/2 connections on webdav for predictive file length (#2396) 2026-02-02 07:52:56 -08:00
Neal Shah 3d34b36159 Add more coersions to responses toolcalling support (#2395) 2026-02-02 07:45:56 -08:00
jelveh 6bd64808df Add redirect_url handling and adjust auth flow
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
Set and propagate a redirect_url for auth flows and use it when navigating after login/signup to avoid leaking sensitive data.
2026-02-02 00:16:35 -08:00
Neal Shah 7cce0705d3 Add back worker redeploy notification (#2394) 2026-02-01 21:57:23 -08:00
Daniel Salazar afbb76f95f fix: ai metering (#2393)
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: expose getUserService in extension typings

* fix: ai metering
2026-02-01 18:14:14 -08:00
Nariman Jelveh b15b466d36 Update TabAccount.js 2026-02-01 17:48:57 -08:00
Neal Shah 5216cccbce More Anthropic tool calling coercions (#2392) 2026-02-01 17:29:22 -08:00
Neal Shah 9e9a7b4dcf Fix tests for ChatAPIService (#2391)
* Fix tests for chatapiservice

* Anthropic Claude Provider fixes for toolcalling in OpenAI completions compatible service
2026-02-01 17:04:16 -08:00
Neal Shah 3a0f466ef6 OpenAI chat interface API concept (#2390) 2026-02-01 15:46:23 -08:00
Nariman Jelveh 6fbe83d982 Show cancelled state in auth window
When the user clicks Cancel in the authorization window, the code now disables action buttons and replaces the window body with a cancellation UI (header with icon, title, description and a message). Added corresponding English i18n keys (authorization_cancelled, authorization_cancelled_desc, authorization_cancelled_message) to provide localized text for the new cancelled state.
2026-02-01 15:34:02 -08:00
Neal Shah be290e2d3c fix typo gemini service (#2389) 2026-02-01 14:24:48 -08:00
Nariman Jelveh a92bbc4ec2 Disable dragging for AuthMe window 2026-02-01 13:43:46 -08:00
Nariman Jelveh 1e6521927f Add UIWindowAuthMe authorization dialog
Introduce a new UIWindowAuthMe component that displays a security-focused consent dialog for redirecting to third-party URLs with the user's auth token. Adds related i18n strings and integrates the dialog into initgui, replacing the previous UIAlert confirm flows; when approved (resolves true) the token is appended to the redirect URL and navigation proceeds. Changes: adds src/gui/src/UI/UIWindowAuthMe.js, updates src/gui/src/i18n/translations/en.js, and imports/uses the new dialog in src/gui/src/initgui.js.
2026-02-01 13:26:13 -08:00
Nariman Jelveh 4b8c46efc8 Add UI to view and copy auth token
Introduce a new UIWindowCopyToken component to display the user's auth token with a copy-to-clipboard button and confirmation message. Integrate the token UI into the account dashboard (TabAccount) by adding an auth token card and click handler to open the window. Add corresponding i18n keys (auth_token, token_copied, copy_token_message, copy_token_description) and import the new window in initgui. Also wire the global action 'copyauth' to show the token dialog and adjust session/login flow so the session list/login windows respect the action (avoid auto-reload when showing the token dialog). Minor UI string cleanup to use i18n('approve') directly.
2026-02-01 13:02:25 -08:00
Nariman Jelveh bfea66a1d6 Serve HTML success page on auth callback
Replace the plain text response with a styled HTML confirmation page for the local authentication callback. The handler now sets Content-Type to text/html and returns a responsive, animated "Authentication Successful" page (with checkmark graphic and Puter branding) while preserving the existing token extraction from the callback URL's search params.
2026-02-01 12:34:26 -08:00
Neal Shah 22606f29b2 getAuthToken on node package (#2388) 2026-02-01 12:03:30 -08:00
Nariman Jelveh 97cf80b068 Support authme action from URL query
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
Read the 'action' value from URL query params and handle a new 'authme' action. When 'authme' is present, prompt the user to approve redirecting to the provided redirectURL; if approved, append the current auth token as a 'token' query parameter and navigate to that URL. The prompt is shown in two places (after auth data is updated and before loading the desktop) to cover different entry flows. Also removed a stray blank line.
2026-02-01 11:51:29 -08:00
Daniel Salazar 114fbff2cd fix: expose getUserService in extension typings (#2385)
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-01-31 13:19:28 -08:00
Daniel Salazar 7a9302f479 [PUT-487] fix: set max-min on app-user-count queries 🐛 (#2384)
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-01-31 00:52:53 -08:00