mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 18:35:07 +03:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## Problem The Docs E2E link checker found broken links throughout docs, starting with `phone-login.mdx` pointing to `/docs/guides/cli/config` (404). Old links like `/docs/guides/cli/config` still work on the live site because `supabase.com` has redirects set up for them, but these links break on the docs preview site, which is what the E2E check tests against. These issues look clean on the live site, and I didn't catch them in my first pass because I was testing production instead of the preview. The E2E check only tests the ~20 pages a given PR happens to touch, so fixing the pages it flagged kept exposing more of the same problem one page at a time as each fix pulled in a new file. To stop chasing this incrementally, I cross-referenced every `/docs/guides/*` and `/docs/reference/*` redirect source in `apps/www/lib/redirects.js` against actual usage across all of `apps/docs`, and verified each candidate against the live preview. ## Solution Rather than updating the Docs E2E link checker, this PR resolves the links. **Why:** we own these docs, so keeping the links clean without redirects is keeping the house maintained. See [Broken Window Theory](https://blog.codinghorror.com/the-broken-window-theory/). Updated every link still using an old path to point straight at the current page instead of relying on a redirect. This covers old links like: - `/docs/guides/cli/config` → `/docs/guides/local-development/cli/config` - `/docs/guides/cli/getting-started` → `/docs/guides/local-development/cli/getting-started` - `/docs/guides/cli/local-development` → `/docs/guides/local-development/database-migrations` - `/docs/guides/cli/managing-environments` → `/docs/guides/deployment/managing-environments` - `/docs/guides/cli/seeding-your-database` → `/docs/guides/local-development/seeding-your-database` - bare `/docs/guides/cli` → `/docs/guides/local-development` - `/docs/guides/platform/compute-add-ons` → `/docs/guides/platform/compute-and-disk` - `/docs/guides/platform/shared-responsibility-model` → `/docs/guides/deployment/shared-responsibility-model` - `/docs/guides/database` → `/docs/guides/database/overview` - `/docs/reference/javascript`, `/docs/reference/dart`, `/docs/reference/kotlin`, `/docs/reference/python`, `/docs/reference/csharp` → their `/introduction` pages (the redirect's own destination, `/start`, turned out to be dead even on production — a separate bug in `redirects.js` I didn't touch here) - and about 35 more of the same pattern, listed in the commit messages Also fixed a handful of dead heading anchors found along the way (links that resolve to the right page but point at a `#section` that got renamed or moved), including the original `#bigquery` anchor and a few in `connecting-to-postgres.mdx` where content moved to its own dedicated page. Left alone on purpose: - `content/guides/cli.mdx` — this page has no route in the docs app at all (no `app/guides/cli/` directory), so it 404s even in production before the `www` redirect ever fires. Fixing its internal link wouldn't change that; it needs an actual routing/content decision, not a link fix. - A few candidates that already resolve fine as-is (`pg_partman`, bare `/docs/reference/api`, bare `/docs/reference/cli`) — confirmed via curl, left untouched. ## Manual testing 1. Confirmed every new link target actually exists by checking the destination file/page and matching heading anchors. 2. Cross-referenced every `/docs/guides/*` and `/docs/reference/*` redirect source in `apps/www/lib/redirects.js` against real usage in `apps/docs`, and curl-verified each old path (404) and new path (200) against the live PR preview before fixing it. 3. Ran the Docs E2E link checker locally against changed pages. 4. Spot-checked the original broken link from CI (`/docs/guides/cli/config`) to confirm it now points to a working page.
69 lines
2.4 KiB
Plaintext
69 lines
2.4 KiB
Plaintext
---
|
|
id: 'managing-config'
|
|
title: 'Managing config and secrets'
|
|
description: 'Managing local configuration using config.toml.'
|
|
---
|
|
|
|
The Supabase CLI uses a `config.toml` file to manage local configuration. This file is located in the `supabase` directory of your project.
|
|
|
|
## Config reference
|
|
|
|
The `config.toml` file is automatically created when you run `supabase init`.
|
|
|
|
There are a wide variety of options available, which can be found in the [CLI Config Reference](/docs/guides/local-development/cli/config).
|
|
|
|
For example, to enable the "Apple" OAuth provider for local development, you can append the following information to `config.toml`:
|
|
|
|
```toml
|
|
[auth.external.apple]
|
|
enabled = false
|
|
client_id = ""
|
|
secret = ""
|
|
redirect_uri = "" # Overrides the default auth redirectUrl.
|
|
```
|
|
|
|
## Using secrets inside config.toml
|
|
|
|
You can reference environment variables within the `config.toml` file using the `env()` function. This will detect any values stored in an `.env` file at the root of your project directory. This is particularly useful for storing sensitive information like API keys, and any other values that you don't want to check into version control.
|
|
|
|
```
|
|
.
|
|
├── .env
|
|
├── .env.example
|
|
└── supabase
|
|
└── config.toml
|
|
```
|
|
|
|
<Admonition type="danger">
|
|
|
|
Do NOT commit your `.env` into git. Be sure to configure your `.gitignore` to exclude this file.
|
|
|
|
</Admonition>
|
|
|
|
For example, if your `.env` contained the following values:
|
|
|
|
```bash
|
|
GITHUB_CLIENT_ID=""
|
|
GITHUB_SECRET=""
|
|
```
|
|
|
|
Then you would reference them inside of our `config.toml` like this:
|
|
|
|
```toml
|
|
[auth.external.github]
|
|
enabled = true
|
|
client_id = "env(GITHUB_CLIENT_ID)"
|
|
secret = "env(GITHUB_SECRET)"
|
|
redirect_uri = "" # Overrides the default auth redirectUrl.
|
|
```
|
|
|
|
### Going further
|
|
|
|
For more advanced secrets management workflows, including:
|
|
|
|
- **Using dotenvx for encrypted secrets**: Learn how to securely manage environment variables across different branches and environments
|
|
- **Branch-specific secrets**: Understand how to manage secrets for different deployment environments
|
|
- **Encrypted configuration values**: Use encrypted values directly in your `config.toml`
|
|
|
|
See the [Managing secrets for branches](/docs/guides/deployment/branching#managing-secrets-for-branches) section in our branching documentation, or check out the [dotenvx example repository](https://github.com/supabase/supabase/blob/master/examples/slack-clone/nextjs-slack-clone-dotenvx/README.md) for a complete implementation.
|