mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
create-pull-request/patch
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
95cf9a78a7 |
docs(cli): show config examples in TOML and JSONC (#53449)
## Problem The CLI reads `supabase/config.jsonc` (and `config.json`) since v3.1.0, but every docs page still shows `config.toml` only. There's also no page explaining the formats, how to switch, the `$schema` / `#:schema` declaration, or editor setup, and no reference pages for the new `supabase config convert` and `supabase config validate` commands. Linear: CLI-2871 ## Solution - **Dual-format examples from one source.** A new directive (`features/directives/ConfigFormats.ts`) picks up any ```` ```toml ```` fence with `name=supabase/config.toml` and renders it as `supabase/config.toml` / `supabase/config.jsonc` tabs. The JSONC is generated at build time with `convertCliConfigTomlToJsonc` from `@supabase/config`, the same converter `supabase config convert` uses, so authors only write TOML and the JSONC matches what the CLI would produce (comments included). Inside `<$CodeTabs>` the JSONC is added as an extra tab. - **The format choice sticks.** `ConfigCodeTabs` keeps the selected format in `localStorage`, so choosing JSONC switches every config example on the page and on later pages. - **Config reference.** The `usage` examples on `/guides/local-development/cli/config` use the same tabs (they were highlighted as Python before), and the intro mentions `config.jsonc`. The `remotes.<branch_name>` example now uses `[remotes.staging]`, since `<branch_name>` isn't a valid TOML key. - **New guide, "Config file formats"** (`/guides/local-development/cli/config-formats`): which file wins, minimum CLI version, `convert` and `validate`, schema declaration and versioning, and editor setup (VS Code trusted domains, Even Better TOML, Tombi, SchemaStore). - **CLI reference.** Adds `supabase-config-convert` and `supabase-config-validate` to the CLI reference nav. `cli_v1_commands.yaml` is the generated v3.2.0 reference, identical to the release bot's update in #53463, so the two PRs don't conflict. - **Content.** About 60 existing config examples across the guides, including the Branching configuration page, are tagged `name=supabase/config.toml`. Branching reads `config.json` and `config.jsonc` as well, and the Branching configuration page now says so. Non-Supabase TOML (`pyproject.toml`, `bunfig.toml`) and the v2-era `[inbucket]` before/after snippet stay TOML-only. - **Format-neutral prose.** Sentences that described the config as `config.toml` now say "your config file", naming `supabase/config.toml` and `supabase/config.jsonc` once per page. TOML section syntax in prose (`max_frequency` under `[auth.email]`) is written as key paths (`auth.email.max_frequency`), which read the same in both formats. Headings that named `config.toml` keep their old anchors. Sentences about what `supabase init` creates still say `config.toml`. - **Markdown export for agents.** `internals/generate-guides-markdown.ts` runs the same transform, so the `.md` pages served to AI agents include the JSONC example after each TOML one. - A test converts every tagged example under `content/`, so a broken TOML example fails tests instead of the build. New dependencies for `apps/docs`: `@supabase/config` (^1.8.0) and `effect` (the same `effect` version Studio pins). `config convert` and `config validate` ship in CLI v3.2.0, which is now stable. ## Review instructions 1. Open `/docs/guides/local-development/seeding-your-database` on the preview. Switch an example to `supabase/config.jsonc` and check the other examples on the page switch too. 2. Open `/docs/guides/local-development/cli/config` and check the usage examples open on JSONC. 3. Read `/docs/guides/local-development/cli/config-formats`. 4. Open `/docs/reference/cli/supabase-config-convert` and `/docs/reference/cli/supabase-config-validate`. ## Self-review Ran the `review-the-docs` local self-review (content, pipeline, and component checks) over the 54 changed pages. - No blockers. Fixed the nits it found: leftover TOML section syntax in prose (diff engines, declarative schemas, Branching, the common settings table on Local and hosted projects), a few long or ungrammatical sentences, and the conversion follow-up steps on Config file formats, now a list. - Links, custom anchors, nav wiring, and frontmatter check out. - The `.md` export on the preview shows each TOML example followed by its JSONC version. - `test-the-docs` deferred: the changed fences are config snippets, and `ConfigFormats.test.ts` already converts every tagged example. No procedural steps changed apart from the `config convert` and `config validate` commands on the new page. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] 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) |
||
|
|
ceae23e199 |
docs: add cross-links in guides (AI, API, Auth, Database, Functions, deployment) (#53560)
## What Adds internal cross-links to docs guides ## Testing - Prettier passes on the changed lines. - Docs build passes (`pnpm build --filter=docs`). - Docs link e2e run locally against the production build for every changed page across this PR --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
86848fc036 |
docs: move the production security checklist to its own page (#52466)
Closes DOCS-1494 ## Problem The Security section of the Production checklist is split out as a part of the Information Architecture plan laid out in Option 1 of the [Docs navigation architecture proposal](https://app.notion.com/p/supabase/Q4-2027-Proposal-Docs-navigation-architecture-3f25004b775f81f49dbad710a732ef61). ## Solution - **Structure:** move `## Security` to `guides/security/production-checklist`. The production checklist keeps the heading, and its `#security` anchor, with a one-sentence pointer. The page is in the Security sidebar under Guides, after Production Checklist. - **Option 1 navigation:** the "Production security checklist" entry in Run and manage, Security and compliance, points to the new page. The Option 1 test no longer expects the anchor. - **Page shape:** a value-statement opener with the situations that call for the checklist, then the items grouped under Database, Account and organization, Auth, and Threat review. Each group opens with a lead-in that says what its checks protect. - **Inbound links:** two Studio linter entries for OTP settings, the Studio Auth providers form, and `auth/auth-email-passwordless` now point to `production-checklist#auth`. The password length lint points to the password security guide instead, since the checklist has no password item. They used to land on `going-into-prod#security`, which is a pointer now. - **Claim fixes:** - The replication item told readers to enable replication on sensitive tables. It now says to enable RLS on replicated tables that hold sensitive data. - The Auth items named **Authentication > Providers**. The Dashboard label is **Sign In / Providers**. - **Terminal path:** the Auth group links the Management API endpoint for its settings. The Database items link to guides that carry CLI or SQL paths. - **Review fixes:** a note that RLS doesn't filter Postgres Changes `DELETE` events, a SQL path for publications, and the other email links the OTP expiry controls. - **Agent prompt:** after the opener, a copyable `AiPrompt` that has an agent audit the project read-only and report each item as pass, fail, or can't check. It reads Security Advisor and the tables through the Supabase MCP server, and SSL, network restrictions, Auth settings, and org members through Management API GET endpoints. `includeInMarkdown` is on, so the `.md` carries the prompt as a fenced text block. - **Cross-links:** Testing auth flows points to the checklist's Auth group, and the Security overview and Product configuration pages link the checklist. The custom SMTP item links the SMTP guide. ### Not verified - **Deferred samples:** none. The page has no code samples. - **Agent prompt:** its endpoints and fields match `api_v1_openapi.json`, and `Owner` matches Studio's role name. No agent has run it against a hosted project. - **Studio:** the link changes are strings only. Studio tests and build run on this PR because it touches `apps/studio`. ## Manual testing 1. Open [Production security checklist](https://docs-git-docs-production-security-checklist-supabase.vercel.app/docs/guides/security/production-checklist). See the agent prompt below the opener and four groups of checks. Click **Copy** and see the prompt text. 2. Open [Production checklist](https://docs-git-docs-production-security-checklist-supabase.vercel.app/docs/guides/deployment/going-into-prod#security). See the Security heading with a one-sentence pointer to the new page. 3. In the Security sidebar under Guides, click **Production security checklist**. See the new page open. |
||
|
|
28d9157aab |
docs: stop guide subtitles from repeating the first sentence (#52568)
Closes DOCS-1553 ## Problem Some guides set a subtitle that says almost exactly what the first sentence of the page says, so the reader reads the same line twice. ## Solution - Add a **Write good frontmatter** section to the style guide, with **Title**, **Subtitle**, and **Description** subsections. A title is 35 characters or fewer, in sentence case, and follows the Google developer style guide's title rules. A subtitle is optional and decorative. If it matches the first sentence, leave it out. A description is 150–160 characters, with relevant keywords. - Remove the subtitle on 12 guides where it repeated the first sentence. On the 6 of those with no description, move the subtitle to `description` so the meta description doesn't change. - Change the Vault subtitle to `Manage secrets in Postgres` to match the rule's example. - In `CONTRIBUTING.md`, mark `description` as required and link to the new section. ## Manual testing 1. Open [Creating a client](https://docs-git-docs-guide-subtitles-supabase.vercel.app/docs/guides/auth/server-side/creating-a-client). See no subtitle under the title. 2. Open [Vault](https://docs-git-docs-guide-subtitles-supabase.vercel.app/docs/guides/database/vault). See `Manage secrets in Postgres` under the title. 3. Read [Write good frontmatter](https://github.com/supabase/supabase/blob/docs/guide-subtitles/apps/docs/style-guide/03-page-structure.md#write-good-frontmatter). |
||
|
|
fe599e8c0e |
docs(auth): add guide for testing auth flows without email and SMS limits (#52118)
Found during my dogfooding project :) ## Problem Testing magic-link sign-in on a hosted project can hit the built-in email limit after two sign-ins. A quick workaround is to turn off **Confirm email**, which is risky if it stays off at launch. The docs that would help are spread out: Mailpit appears only in the Passwords guide and the CLI pages, and test phone numbers appear only in the self-hosted phone MFA guide. Resolves [DOCS-1460](https://linear.app/supabase/issue/DOCS-1460/document-how-to-test-auth-flows-without-hitting-email-rate-limits) and [FDBKIN-16338](https://linear.app/supabase/issue/FDBKIN-16338/clarify-built-in-email-rate-limits-and-custom-smtp-requirement-for). The second is feedback from a user who hit the built-in email limit during sign-up testing and didn't know custom SMTP was needed. ## Solution A new guide, **Test auth flows**, explains how to test each sign-in method without real email or SMS limits. It opens with a link to the Supabase CLI setup that the local steps need: - **Test email flows locally:** Mailpit captures every email from local Auth, so the hosted email limit and address restriction don't apply. The steps have the reader copy the Project URL, publishable key, and Mailpit URL from `supabase status`, then swap the app's environment variables from the hosted project to the local stack. The guide also covers turning on email confirmation locally to test that flow. - **Test email flows on a hosted project:** the built-in email service's limits and the error it returns, how custom SMTP or the Send Email hook raises them, and a caution that turning off **Confirm email** also removes the hourly email limit, so it needs to be back on before launch. - **Test phone sign-in with test numbers:** fixed one-time passwords for chosen phone numbers, set in the Dashboard, `config.toml`, or the Management API. The local steps include the SMS provider settings that test numbers need, with placeholder credentials. The guide covers what test numbers skip, what still applies, and the risk of leaving them in production. The page sits under **Auth > Configuration** in the navigation. The magic link, passwords, email templates, phone sign-in, and rate limits guides link to it. The Production checklist gains an item to remove test phone numbers. The Passwords guide's Mailpit section becomes a link to the new page and keeps its heading, so existing links to it still work. ## Verification Local behavior was tested against a local stack with Supabase CLI 2.114.0: - 10 magic links to 10 addresses all arrived in Mailpit. A second request for the same address within one second returned `429 over_email_send_rate_limit`. - A test number signed in with its fixed code, and the code worked again without a new request. A second request within the wait returned `429 over_sms_send_rate_limit`. - With the project SMS limit set to 1, four requests for a test number all succeeded. - Test numbers failed with `phone_provider_disabled` until an SMS provider was enabled. With a provider enabled, Auth sent nothing to test numbers. - A key without the country code didn't match a number sent with `+1`, and the request went to the SMS provider. - A phone MFA challenge for a test number went to the SMS provider. Hosted behavior was tested on a Free plan project through the Dashboard, and the project's settings were restored afterward: - The Phone provider form doesn't save test numbers until the SMS provider's required fields and **Test OTPs Valid Until** are filled in. - With test number `14155552671=123456` saved, the number signed in with its fixed code and no SMS was sent. The same code worked a second time. - A second request for the test number right after the first returned `429 over_sms_send_rate_limit` with "after 4 seconds", so the hosted wait between codes is 5 seconds. - With the Phone provider turned off again, the test number returned `phone_provider_disabled`. Hosted projects require email confirmation by default. A `supabase config push` diff against a new project showed `enable_confirmations = true` on the remote, and the platform source sets `MAILER_AUTOCONFIRM` to `false` by default. On a second Free plan project, `supabase config push` with one `[auth.sms.test_otp]` entry stored the number as `14155552671=123456`, with **Test OTPs Valid Until** set 10 years ahead. The Management API spec defines `sms_test_otp` and `sms_test_otp_valid_until` on `PATCH /v1/projects/{ref}/config/auth`, with `sms_test_otp` limited to `<digits>=<digits>` pairs. Three magic links to a team member's address all sent within two minutes, with no `429`. The test project had **Confirm email** turned off. In the Auth source, `sendEmail` in `internal/api/mail.go` checks the hourly email limit only when `Mailer.Autoconfirm` is false, that is, when **Confirm email** is on. A comment there marks this behavior for deprecation. With **Confirm email** on, the built-in service returns `429` with `over_email_send_rate_limit` after two emails, which matches the original dogfooding report. The page states the limit applies while **Confirm email** is on, and the caution says turning it off removes the limit. The guide's `config.toml` snippet was run as written on a local stack, with `placeholder` Twilio credentials. The test number got `test-otp`, signed in with its code, and could request again after 5 seconds. The page renders on the local docs server, the navigation entry appears, and the section anchors that other guides link to resolve. `pnpm build:guides-markdown` generates the page with its admonitions and tabs. ### Self-review A `review-the-docs` pass covered the new guide and the six linked pages against the style guide and word list. While testing, the `config.toml` template's test OTP example turned out to be missing a country code. That's tracked for the CLI team in [CLI-2820](https://linear.app/supabase/issue/CLI-2820/fix-the-authsmstest-otp-example-in-configtoml-to-include-the-country). ## Follow-up The [Phone sign-in guide](https://supabase.com/docs/guides/auth/phone-login) says a user can request an OTP once every 60 seconds. The hosted test showed a 5-second wait for SMS codes. This PR leaves that sentence as is. |