6 Commits
Author SHA1 Message Date
supabase-vercel-tedd[bot]andIvan Vasilov c8748c7c26 chore: pin Node.js to v24 across the repository (#53287)
## Problem

`engines.node` used open-ended ranges (`>=22.23.4` at the root,
`>=22.12.0` in `apps/kb`). Vercel resolves an open-ended range to the
newest Node.js major, so it overrides the project's configured version
and warns that future majors will be picked automatically. The other
apps declared no engine at all, and `.nvmrc` (used by local dev and CI)
still pointed at Node 22.

## Solution

Pin Node.js 24 everywhere the repo declares a Node version:

- `.nvmrc`: `22.23.4` -> `24.22.3` (latest v24 LTS). CI workflows read
`node-version-file: .nvmrc`, so they follow.
- Root `package.json` and `apps/kb/package.json`: `engines.node` ->
`24.x`.
- Every other app (`design-system`, `docs`, `learn`, `lite-studio`,
`studio`, `ui-library`, `www`): add `engines.node: "24.x"`. Vercel reads
the Node.js version from `engines.node` in the project's `package.json`;
`vercel.json` has no setting for it, so this is how each Vercel project
gets an explicit version.
- `.agents/skills/test-the-docs/sandbox/Dockerfile`:
`node:22-bookworm-slim` -> `node:24-bookworm-slim`.
- `AGENTS.md`: update the stated Node requirement.

Notes:

- `engineStrict: true` is set in `pnpm-workspace.yaml`, so `pnpm
install` now requires Node 24 locally.
- `.github/workflows/self-host-tests-smoke.yml` hardcodes `node-version:
'22'` and is not changed here.
- No builds or tests were run for this change. Checked that all changed
`package.json` files parse and that Prettier passes on the changed
files.

## Review instructions

1. Open the Vercel build logs for this PR's deployments (studio, docs,
www, kb, and so on).
2. Confirm each build uses Node.js 24.x.
3. Confirm the logs no longer show the warning that the `engines` field
overrides the project's Node.js version, or the warning about automatic
upgrades to new major versions.
4. Confirm CI jobs that use `.nvmrc` set up Node 24.22.3.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)


[FE-5004](https://linear.app/supabase/issue/FE-5004/bump-the-nodejs-version-across-the-repository)

---------

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-11-13 15:30:34 +01:00
Alaister YoungandAlaister Young 31711c0762 fix(studio): validate edge function test proxy target url (#53256)
The edge function test proxy (`pages/api/edge-functions/test.ts`, also
served by `routes/api/edge-functions/test.ts`) fetched the URL from the
request body after checking it only with the regexes in
`isValidEdgeFunctionURL`, and on self-hosted any
`http(s)://<host>/functions/vN/...` URL passed. It now fetches only a
URL rebuilt from parts it has validated.

**Changed:**
- `apps/studio/lib/api/edgeFunctions.ts` – replaced
`isValidEdgeFunctionURL` with `getEdgeFunctionTestUrl`, which parses the
URL, rejects non-http(s) schemes and credentials, requires a
`/functions/vN/` path, checks the host (platform:
`<ref>.supabase.co|red` over https; the Nimbus apex domain when
`NIMBUS_PROD_PROJECTS_URL` is set; self-hosted: the `SUPABASE_URL` or
`SUPABASE_PUBLIC_URL` host) and returns the fetch target rebuilt from
the validated origin, path and query. Self-hosted requests always go to
the `SUPABASE_URL` origin, replacing the old `SUPABASE_PUBLIC_URL`
string rewrite.
- `apps/studio/pages/api/edge-functions/test.ts` – fetches the URL
returned by `getEdgeFunctionTestUrl` and returns 400 when there is none.
`redirect: 'manual'` is unchanged.

**Added:**
- `apps/studio/lib/api/edgeFunctions.test.ts` – allowed platform,
`.red`, Nimbus and self-hosted URLs, and rejected cases: other hosts,
lookalike hosts, userinfo, ports, non-http schemes, paths outside
`/functions/vN/`.
- `apps/studio/tests/pages/api/edge-functions/test.test.ts` – handler
rejects userinfo and non-functions paths, and on self-hosted calls the
public URL through `SUPABASE_URL` and rejects other hosts.

## To test
- [ ] On platform (including staging `.red`), open an edge function,
click **Test**, and send a request with a query parameter: the response
shows as before.
- [ ] On self-hosted (`docker compose`), do the same from the edge
function tester: the response shows as before.
- [ ] `POST /api/edge-functions/test` with `{ "url":
"https://example.com/functions/v1/hello", "method": "GET" }`: the
response is 400 with "Provided URL is not a valid Supabase edge function
URL".

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-11 16:34:02 +09:00
Vaibhav 05d8dd356c fix: selfhost edge URLs (#47861) 2026-07-16 14:06:40 +01:00
Etienne Stalmans b79a645f4f fix: escape regex control character (#43806)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES
## What kind of change does this PR introduce?

Bug fix

## What is the current behavior?

regex control character, `.` is not escaped.

## What is the new behavior?

Escapes control characters and makes regex a little stricter. Use regex
literal
2026-03-17 16:28:38 +01:00
Kalleby SantosandCharis Lam 70510acf5b feat(studio-local): functions management api - test functions (#42350)
Feature

## What is the current behavior?

Functions page on self-hosted differs from Platform

## What is the new behavior?

Adds the possibility to try/test functions in Self-Host version.

## Summary by CodeRabbit

* **Bug Fixes**
* Improved edge function URL validation so testing works reliably both
on-platform and off-platform, including proper URL handling for local
setups.

* **UI Improvements**
* Moved the Test button in the edge functions interface for more
consistent layout while preserving its behavior.

* **Tests**
  * Expanded tests to cover platform-aware URL validation scenarios.

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2026-02-11 21:26:42 +00:00
Jordi EnricandJoshen Lim 9e72050658 Add regex guard for edge functions test endpoint (#35688)
* Add regex guard for edge functions test endpoint

* Remove conosle log

* add tests

* empty

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-05-15 08:57:06 +00:00