Commit Graph

56 Commits

Author SHA1 Message Date
Alaister Young
5f6060197e [COM-205] feat(studio): add logs:all flag to hide all logs (#45202)
Adds a top-level `logs:all` flag (default `true`) so self-hosted and
local setups can hide the logs pages in Studio when Logflare isn't
configured — no separate Studio build required. The flag itself works
everywhere; the additional `ENABLED_FEATURES_LOGS_ALL` env-var override
(from FE-3036) is the self-hosted escape hatch so deployers can flip it
without a custom build — that part is a no-op on `IS_PLATFORM` because
hosted feature gating flows through `profile.disabled_features` instead.

Addresses
[COM-205](https://linear.app/supabase/issue/COM-205/add-feature-flag-to-disable-all-logs-in-studio).

**Added:**
- `logs:all` feature flag in `enabled-features.json` + schema

**Changed:**
- Sidebar "Logs" nav entry is hidden when `logs:all` is off (same
pattern as `reports:all` / `billing:all`)
- Cmd-K "Logs Explorer" / "Auth Logs" / etc. routes are hidden when the
flag is off
- `LogsLayout` renders `<UnknownInterface />` (soft-404) when the flag
is off — covers all ~18 logs pages in one spot
- `/logs/index.tsx` applies the same soft-404 for the unified-logs entry
point

## To test

Needs to be tested locally (preview doesn't let you flip the flag —
hosted gating is profile-driven, not env-driven). Two ways:
- Temporarily edit `"logs:all": false` in
`packages/common/enabled-features/enabled-features.json` and run `pnpm
dev:studio`, or
- Run Studio locally with `ENABLED_FEATURES_LOGS_ALL=false` (env-var
path, same as how self-hosted deployers would use it)

With the flag **off**:
- Sidebar "Logs" entry is hidden
- Cmd-K search for "Logs" / "Auth Logs" / "Postgres Logs" etc. returns
nothing
- Direct navigation to `/project/<ref>/logs`,
`/project/<ref>/logs/explorer`, `/project/<ref>/logs/auth-logs`,
`/project/<ref>/logs/postgres-logs` (etc.) all render the "Looking for
something?" soft-404 with a Head back button

With the flag **on** (default): everything works as it does today.
**Check on the preview deploy too** — nothing should change, no
behaviour difference on hosted.

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-04-27 23:13:42 +08:00
Alaister Young
19027e73f8 [FE-3036] feat(studio): runtime env var overrides for enabled features (#45049)
Lets self-hosted Studio toggle flags in `enabled-features.json` at
container start time via `ENABLED_FEATURES_*` env vars, without
rebuilding the prebuilt image. Addresses
[FE-3036](https://linear.app/supabase/issue/FE-3036/allow-enabled-featuresjson-flags-to-be-overridden-via-env-vars)
and is a prerequisite for
[COM-205](https://linear.app/supabase/issue/COM-205/add-feature-flag-to-disable-all-logs-in-studio).

**Added:**
- `packages/common/enabled-features/overrides.ts` — pure parser that
maps `ENABLED_FEATURES_*` env vars to a disabled-features list
(forward-only key mapping, boolean validation, typo warnings) + 10
vitest tests
- `apps/studio/pages/api/enabled-features-overrides.ts` — Next.js API
route reading `process.env` at request time; no-op (`{
disabled_features: [] }`) when `IS_PLATFORM`
- `apps/studio/data/misc/enabled-features-override-query.ts` — React
Query hook with `staleTime: Infinity`, `enabled: !IS_PLATFORM`
- `packages/common/enabled-features/README.md` — docs the env var
convention, resolution order, `IS_PLATFORM` gating, and the
`Support.constants.ts` build-time caveat

**Changed:**
- `apps/studio/hooks/misc/useIsFeatureEnabled.ts` — merges the
override's `disabled_features` with `profile.disabled_features`

### Env var shape

One var per flag, prefixed `ENABLED_FEATURES_`. Feature key → env name:
uppercase with every non-alphanumeric char replaced by `_`.

```bash
ENABLED_FEATURES_LOGS_ALL=false
ENABLED_FEATURES_BRANDING_LARGE_LOGO=true
```

Values are `true`/`false` case-insensitively. Other values and prefixed
vars that don't match a known feature are logged and ignored.

### Resolution order (runtime, Studio only)

1. `ENABLED_FEATURES_*` (self-hosted, via API route → React Query →
hook)
2. `profile.disabled_features` (hosted, from `/platform/profile`)
3. `enabled-features.json` static value
4. Default (enabled)

`ENABLED_FEATURES_OVERRIDE_DISABLE_ALL` still short-circuits everything.

### Known limitation

`apps/studio/components/interfaces/Support/Support.constants.ts:4` calls
`isFeatureEnabled('billing:all')` at module load to build
`CATEGORY_OPTIONS`, which is spread into Zod form schemas. That call
site stays resolved from the JSON — documented in the package README.
`billing:all` isn't on the radar for self-hosted runtime toggling.

## To test

- `cd packages/common && pnpm exec vitest run enabled-features` — 10 new
tests pass
- `pnpm --filter studio run typecheck` clean
- Spin Studio locally with `NEXT_PUBLIC_IS_PLATFORM=false` and
`ENABLED_FEATURES_LOGS_TEMPLATES=false`;
`/project/[ref]/logs/explorer/templates` should reflect the flag after
the override fetch resolves
- Confirm the API route returns `{ disabled_features: [] }` when
`NEXT_PUBLIC_IS_PLATFORM=true`
- Set a typo like `ENABLED_FEATURES_LOGS_TMEPLATES=false` and check the
warning in container logs; flag stays enabled

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Runtime feature-flag overrides for self-hosted deployments (env var
driven), new API endpoint and client-side hook to fetch overrides, and
client logic now merges profile and runtime overrides.

* **Documentation**
* Added comprehensive README describing the feature-flag system and
override configuration.

* **Tests**
* Added unit tests for override parsing and E2E tests covering runtime
override behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-04-20 22:28:56 +08:00
Francesco Sansalvadore
b69a145403 feat: custom oauth providers (#43094)
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Ali Waseem <waseema393@gmail.com>
2026-03-16 17:13:08 +01:00
Ivan Vasilov
1cd1ebfc7f chire: Sort imports in all packages, cms, design-system and ui-library apps (#41610)
Sorted all imports in all packages, `cms`, `design-system` and
`ui-library` apps by running `pnpm format` on them.

All changes in this PR are done by the script.
2026-02-05 13:54:10 +01:00
Joshen Lim
cbeb0912a2 Joshen/fe 2195 rework project api overview section with connect button (#41485)
* Update API keys panel

* Dnywh/chore/fe 2195 design pass (#41484)

* first pass

* fancy

* fixes

* text

* lang

* lang

---------

Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>

* Clean up

* Clean

* Nit

* Update enabled features

---------

Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
2025-12-19 16:51:58 +08:00
Stephen Morgan
48b372d29b Feature/private link (#41094)
* privatelink integration

* mock queries

* add integration endpoints

* poll for updates on transition states

* prevent ui for multiple posts

* changes to copy for existing accounts

* update privatelink documentation

* hide privatelink for customer under Team plan

* added connected state tip

* linting fixes

* fixed issue due to merge

* Add cc feature flag

* Nit clean up

* Small revert

* Nudge UI a little

* Update react queries to fit new structure

* Fix

* Clean up

* nit

* revert padding

* Fix

* fix: tanstack changes

* added feature to pricing page

* Update apps/docs/content/guides/platform/privatelink.mdx

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix: dropdown copy change

* Update apps/docs/content/guides/platform/privatelink.mdx

Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>

* Update apps/docs/content/guides/platform/privatelink.mdx

Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>

* Smol clean up

---------

Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
2025-12-18 07:28:38 +13:00
Stojan Dimitrovski
6a45bb35ca feat: auth advanced page renamed to performance, support for percent db connections (#39852)
* feat: auth advanced page renamed to performance, support for percent db connections

* rename page and form

* make it compile

* fix types?

* one more update

* use master types

* restore from source

* fix prettier

* fix compilation

* minor adjustments

* wording

* change pro plan check

* fix prettier

* nit fixes

* Update next config

* update copy + align upgrade to pro language

* Update

* Clean up

* Nit improve loading time

* Update docs

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-12-04 11:35:14 +08:00
Joshen Lim
b374628216 Chore/small fix vectors (#40693)
* Flip vectors enabled features to true

* Fix enabled logic
2025-11-22 02:19:04 +08:00
Joshen Lim
2209d72990 Update UI to de-couple ETL replication context from Analytics Buckets (#40645)
* Update UI to de-couple ETL replication context from Analytics Buckets

* Nit

* Nit

* nit

* Address all feedback

* Address feedback

* Add enabled feature check for analytics and vector buckets

* FIXX

* Update apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/TableRowComponent.tsx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2025-11-21 16:28:31 +08:00
Alaister Young
4abe188ec6 [FE-2099] chore(docs): top nav homepage link toggleable for nimbus (#40235)
* chore(docs): top nav homepage link toggleable for nimbus

* reenable dropdown link by default
2025-11-07 15:54:31 +08:00
Chris Chinchilla
d158e7142a docs: Allow for customisable CLI profiles in ref docs (#40181)
* Allow for customisable CLI profiles in ref docs

* Prettier

* Type fix

* Prettier

* Changes from review

* Set default config

* Handle empty values
2025-11-06 08:51:15 +01:00
Alaister Young
c6a09b3fcf chore: hideable legal org documents tab (#39531) 2025-10-14 10:49:51 -04:00
Alaister Young
2d986e5b7f chore: hideable TOS link on sign in/up page (#39530) 2025-10-14 10:48:12 -04:00
Alaister Young
09d5b8a18f chore: branding customisation (#39425) 2025-10-10 15:25:33 +08:00
Alaister Young
0ea541938c chore: disable account security page (#39319) 2025-10-08 18:43:58 +08:00
Joshen Lim
57256efaaa Add flag for logs explorer showing metadata (#39171)
* Add flag for logs explorer showing metadata

* Simplify

* Flip

* Check logs metadata in useSingleLog

* Update unified logs

* remove comment

* Shortcircuit earlier on logsMetadata boolean

---------

Co-authored-by: Matt Linkous <matthew.linkous@gmail.com>
Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-10-01 18:53:54 +00:00
Joshen Lim
933329b30c Add flag for restarting project (#39153)
Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-10-01 18:40:23 +00:00
Joshen Lim
a7a097ef4e Add flag for database upgrades (#39164) 2025-10-02 02:29:21 +08:00
Joshen Lim
2025acb30a Add flag for network restrictions section (#39161)
Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-10-01 18:28:11 +00:00
Joshen Lim
da2fef0413 Chore/add flag for restore to new project (#39155)
* Add flag for restore to new project

* Refactor restore to new project components

* Fixy
2025-10-02 02:12:32 +08:00
Joshen Lim
89e7abd7ca Add flag for read replicas (#39158)
* Add flag for read replicas

* nit
2025-10-02 02:08:41 +08:00
Joshen Lim
80529c8107 Add flag for metadata IP logs explorer template (#39152)
* Add flag for metadata IP logs explorer template

* Flip true

* fix(log explorer): also remove metadata ip template from templates page when
flag disabled

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-10-02 01:42:23 +08:00
Joshen Lim
579332fda3 Add flag to disable wrappers UI (#39150) 2025-10-02 01:34:20 +08:00
Joshen Lim
843234e153 Add flag to hide email and phone columns in auth users (#39151)
* add flag to hide email and phone columns in auth users

* fix: add authentication:show_email_phone_columns to required schema

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-10-02 01:26:14 +08:00
Alaister Young
3f0c689724 chore: disable client libraries in support form (#39143)
* chore: disable client libraries in support form

* Nit

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-01 14:03:56 +08:00
Alaister Young
715006c4a1 chore: hide edge function examples (#39142)
* chore: hide edge function examples

* Nit

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-01 13:51:33 +08:00
Alaister Young
941ce7be59 chore: disable org security tab (#39141) 2025-10-01 11:07:04 +08:00
Chris Chinchilla
e01699cce5 docs: Further toggles for Nimbus project (#39010)
chore: feature flag footer and fdw section

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-09-25 14:26:46 +00:00
Alaister Young
84cf676bc0 chore: edge function examples filter stripe example (enabled features) (#38746)
* chore: edge function examples filter stripe example (enabled features)

* nit

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-09-25 16:11:09 +08:00
Chris Chinchilla
765aac4f2f docs: further finesse nimbus toggles (#38954)
* Finesse toggles

* Prettier

* fix

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-09-23 16:55:48 +00:00
Charis
bcb809df8e chore: add feature-flagged placeholder for CLI profiles (#38922)
- new feature flag: `docs:hide_cli_profiles`
- this must be implemented as a "negative" flag (hide instead of
  enable), because our current temporary hack for creating the Nimbus
  search index requires that the default state for all flags be true
2025-09-22 13:01:15 -04:00
Charis
3fe03d07ab feat: negate feature flags in $Show (#38871)
Previous behavior: $Show component only works with enabled feature
flags: if feature flag is on, content is shown

New behavior: $Show component also works with negated feature flags: if
feature flag is off, content is shown

Required for enabling custom content in forked builds
2025-09-22 09:04:19 -04:00
Chris Chinchilla
9795b76431 docs: Add further toggles to content (#38870)
* Implement futher changes for Nimbus

* fixes

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-09-19 16:53:20 +00:00
Charis
b4c6c414a8 fix: feature flag command menu & ingerations section (#38794)
- Disabled pages were still showing up as navigation items on the command
menu, removing those as well.
- Integrations section was also not fully disabled, removing that.
2025-09-18 14:02:26 -04:00
Charis
8cd5e10038 feat: alternate search index for nimbus (#38662)
* feat: alternate search index for nimbus

Create an alternate search index for Nimbus that filters out
feature-flagged pages (equivalent to setting all feature flags to
false).

Notes:
- Creates two new DB tables, `page_nimbus` and `page_section_nimbus`,
  which are filtered versions of `page` and `page_section`
- Makes `nimbus` versions of all the DB search functions
- Refactored the embedding upload script. Changes to make it faster (got
  annoyed by how slow it was when testing...), incorporate retries, and
  produce better summary logs.
- Upload script, when run with the environment variable
  ENABLED_FEATURES_OVERRIDE_DISABLE_ALL, produces and uploads the
  alternate search index
- Changed all the search calls in frontend/API to check for
  `isFeatureEnabled('search:fullIndex')` to determine whether to search
  the full or alternate index

* ci: produce nimbus search indexes on merge

* fix: turn full search index on
2025-09-16 12:37:53 -04:00
Alaister Young
7f0fbe378d chore: add compute price to enabled features (#38696) 2025-09-16 03:13:34 +00:00
Alaister Young
62ac8d9eb0 chore: move connect modal custom content to enabled features (#38695)
* chore: move connect modal custom content to enabled features

* smol

* Smol nit

* Flip back flags

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-09-15 16:59:38 +08:00
Alaister Young
de3eacda5b chore: add sso settings to enabled features (#38694)
* chore: add sso settings to enabled features

* mark as required

* Smol tweaks

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-09-15 16:58:54 +08:00
Alaister Young
92587df2e0 chore: add show testimonial as an enabled feature (#38651) 2025-09-12 13:56:24 +08:00
Alaister Young
104569ea86 chore: use custom content for client libraries (#38633) 2025-09-11 23:41:07 +08:00
Charis
b65a0aefb9 fix: turn compliance docs back on for main site (#38567) 2025-09-09 22:33:11 +00:00
Charis
3c3f85a06b chore(docs): feature flag compliance content (#38527)
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
2025-09-09 10:52:48 -04:00
Alaister Young
774825c1cc chore: customizable dashboard auth (#38516)
* chore: customizable dashboard auth

* minor fixes

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-09-09 07:04:27 +00:00
Charis
67c14215ef chore(docs): put feedback form behind feature flag (#38471) 2025-09-05 17:02:42 -04:00
Chris Chinchilla
6821c07811 docs: feature toggle tests (#38282)
* Docs feature toggle tests

* Prettier

* Types fix

* Hide unsupported languages

* Fix import

* Add unsupported code warning

* Further SDK toggling

* Temp intro text

* Auth toggles

* clean up conditional visibility code

* fix: typecheck, tests, tiny bug

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-09-04 16:46:08 +02:00
Joshen Lim
7b1ac2a66e Chore/disable more sections 04 (#38064)
* Add flags for policies, third party auth, and manual linking + providers in sign in page

* Add flag for rate limitm page

* Add UnknownInterface components

* Update comment

* Flip flags to true

* Add flags for realtime policies and reports page

* Temp

* Add flag for sign in providers page

* Add flag for stripe wrapper

* Add flag for custom domains

* Add flag for dedicated ipv4 address addon

* Add empty state for realtime policies

* Add empty state for reports page

* Add flag for disable legacy JWT keys section

* Add flag for legacy jwt keys

* nit

* Remove ConnectionStringMoved call out

* Add flag for project settings log drains

* Add flag for subscription link in project settings

* Deprecate settings/auth page and redirect directly to auth page

* Flip back flags

* Add flags for account preferences analytics marketing and account deleetion

* Remove 'table_editor:enable_rls_toggle' flag and revert UI changes

* Remove 'authentication:policies' flag and revert UI changes

* Add flags for cmd K routes

* Add flags for instance size in infra settings

* Small refactor to DisplayApiSettings, decouple ToggleLegacyApiKeysPanel from it

* Have project_connection:javascript_example toggle code example title to TS

* add flag for templates dropdown in logs explorer

* UsesOverview only show link to providers page if providers is enabled

* API Docs UserManagement to only include docs on third party auth if providers is enabled

* Hide instance size on project card if flag is off

* Fix cmd k for roles, update redirect link from settings/auth to auth/providers
2025-08-22 16:17:43 +08:00
Joshen Lim
39639a4073 chore/disable-more-sections-03 (#38060)
* Add flags for policies, third party auth, and manual linking + providers in sign in page

* Add flag for rate limitm page

* Add UnknownInterface components

* Update comment

* Flip flags to true

* Add flags for realtime policies and reports page

* Temp

* Add flag for sign in providers page

* Add flag for stripe wrapper

* Add flag for custom domains

* Add flag for dedicated ipv4 address addon

* Add empty state for realtime policies

* Add empty state for reports page

* Add flag for disable legacy JWT keys section

* Add flag for legacy jwt keys

* nit

* Remove ConnectionStringMoved call out

* Add flag for project settings log drains

* Add flag for subscription link in project settings

* Deprecate settings/auth page and redirect directly to auth page

* Flip back flags

* Add flags for account preferences analytics marketing and account deleetion

* Remove 'table_editor:enable_rls_toggle' flag and revert UI changes

* Remove 'authentication:policies' flag and revert UI changes

* Update flags

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2025-08-20 21:50:53 +08:00
Joshen Lim
6a8836f968 Chore/disable more sections 02 (#38058)
* Add flags for policies, third party auth, and manual linking + providers in sign in page

* Add flag for rate limitm page

* Add UnknownInterface components

* Update comment

* Flip flags to true

* Add flags for realtime policies and reports page

* Temp

* Add flag for sign in providers page

* Add flag for stripe wrapper

* Add flag for custom domains

* Add flag for dedicated ipv4 address addon

* Add empty state for realtime policies

* Add empty state for reports page

* Add flag for disable legacy JWT keys section

* Add flag for legacy jwt keys

* nit

* Remove ConnectionStringMoved call out

* Add flag for project settings log drains

* Add flag for subscription link in project settings

* Deprecate settings/auth page and redirect directly to auth page

* Flip back flags
2025-08-20 20:17:34 +08:00
Joshen Lim
c4b36d9ab0 Chore/disable more sections 01 (#38057)
* Add flags for policies, third party auth, and manual linking + providers in sign in page

* Add flag for rate limitm page

* Add UnknownInterface components

* Update comment

* Flip flags to true

* Add flags for realtime policies and reports page

* Temp

* Add flag for sign in providers page

* Add flag for stripe wrapper

* Add empty state for realtime policies

* Add empty state for reports page

* nit

* Hide realtime configuration section in side nav if neither policies nor settings are visible
2025-08-20 19:59:43 +08:00
Joshen Lim
78fab83aee Chore/disable authentication segments (#38029)
* Add flags for policies, third party auth, and manual linking + providers in sign in page

* Add flag for rate limitm page

* Add UnknownInterface components

* Update comment

* Flip flags to true

* Add flag for sign in providers page
2025-08-20 19:34:41 +08:00