Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Analytics configuration section is working

Chase Granberry74578f704224
diff --git a/apps/docs/lib/mdx/getConfig.tsx b/apps/docs/lib/mdx/getConfig.tsx
index 8a014486212..d208d4243cc 100644
--- a/apps/docs/lib/mdx/getConfig.tsx
+++ b/apps/docs/lib/mdx/getConfig.tsx
@@ -4,6 +4,8 @@ import specStorageV0 from '~/../../spec/storage_v0_config.yaml' assert { type: '
import specRealtimeV0 from '~/../../spec/realtime_v0_config.yaml' assert { type: 'yml' }
// @ts-expect-error
import specAuthV1 from '~/../../spec/gotrue_v1_config.yaml' assert { type: 'yml' }
+// @ts-expect-error
+import specAnalyticsV0 from '~/../../spec/analytics_v0_config.yaml' assert { type: 'yml' }
function getStorageConfigV0() {
return { ...specStorageV0 }
@@ -17,4 +19,8 @@ function getAuthConfigV1() {
return { ...specAuthV1 }
}
-export { getStorageConfigV0, getRealtimeConfigV0, getAuthConfigV1 }
+function getAnalyticsConfigV0() {
+ return { ...specAnalyticsV0 }
+}
+
+export { getStorageConfigV0, getRealtimeConfigV0, getAuthConfigV1, getAnalyticsConfigV0 }
diff --git a/apps/docs/pages/guides/self-hosting/analytics/config.mdx b/apps/docs/pages/guides/self-hosting/analytics/config.mdx
new file mode 100644
index 00000000000..8267f6a913e
--- /dev/null
+++ b/apps/docs/pages/guides/self-hosting/analytics/config.mdx
@@ -0,0 +1,38 @@
+import Layout from '~/layouts/DefaultGuideLayout'
+import { getAnalyticsConfigV0 } from '~/lib/mdx/getConfig'
+import Param from '~/components/Params'
+
+export const spec = getAnalyticsConfigV0()
+
+export const meta = {
+ title: 'Analytics Self-hosting Config',
+ description: 'How to configure and deploy Supabase Analytics.',
+}
+
+<div>{spec.info.description}</div>
+
+<div>
+{spec.info.tags.map(tag => {
+ return (
+ <>
+ <h2 className="text-scale-1200">{tag.title}</h2>
+ <p className="text-scale-1000">{tag.description}</p>
+ <div className="not-prose">
+ <h5 className="text-base text-scale-1200 mb-3">Parameters</h5>
+ <ul>
+ {spec.parameters.filter(param => param.tags.includes(tag.id)).map((param) => {
+ return <Param name={param.title} type={param.type} description={param.description} required={param.required} />
+ })}
+
+ </ul>
+ </div>
+ </>
+ )
+
+})}
+
+</div>
+
+export const Page = ({ children }) => <Layout meta={meta} children={children} />
+
+export default Page
diff --git a/spec/analytics_v0_config.yaml b/spec/analytics_v0_config.yaml
index 366943a0547..5475e56bb5b 100644
--- a/spec/analytics_v0_config.yaml
+++ b/spec/analytics_v0_config.yaml
@@ -9,220 +9,56 @@ info:
bugs: 'https://github.com/supabase/realtime/issues' # {string} Where developers can file bugs.
spec: 'https://github.com/supabase/supabase/blob/master/spec/realtime_v0_config.yml' # {string} Where developers can find this spec (to link directly in the docs).
description: |
- You can use Environment Variables to configure your Realtime Server.
+ You can use Environment Variables to configure your Analytics Server.
tags:
- id: general
title: General Settings
description: General server settings.
- - id: database
- title: Database Settings
- description: Connecting to your database.
# This section is an array of public functions which a user might need to execute.
parameters:
- - id: 'PORT' # {string} A unique identifier for this param.
- title: 'PORT' # {string} Any name.
+ - id: 'LOGFLARE_SINGLE_TENANT' # {string} A unique identifier for this param.
+ title: 'LOGFLARE_SINGLE_TENANT' # {string} Any name.
tags: ['general'] # {string[]} These tags are useful for grouping parameters
links: [] # {string[]} These tags are useful for grouping parameters
required: true
- default: '4000'
- description: |
- Port which you can connect your client/listeners
-
- - id: 'DB_HOST' # {string} A unique identifier for this param.
- title: 'DB_HOST' # {string} Any name.
- tags: ['database'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: 'localhost'
- description: |
- Database host URL
-
- - id: 'DB_NAME' # {string} A unique identifier for this param.
- title: 'DB_NAME' # {string} Any name.
- tags: ['database'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: 'postgres'
- description: |
- Database name
-
- - id: 'DB_USER' # {string} A unique identifier for this param.
- title: 'DB_USER' # {string} Any name.
- tags: ['database'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: 'postgres'
- description: |
- Database user
-
- - id: 'DB_PASSWORD' # {string} A unique identifier for this param.
- title: 'DB_PASSWORD' # {string} Any name.
- tags: ['database'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: 'postgres'
- description: |
- Database password
-
- - id: 'DB_PORT' # {string} A unique identifier for this param.
- title: 'DB_PORT' # {string} Any name.
- tags: ['database'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: '5432'
- description: |
- Database port
-
- - id: 'DB_SSL' # {string} A unique identifier for this param.
- title: 'DB_SSL' # {string} Any name.
- tags: ['database'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
default: 'true'
+ type: 'boolean'
description: |
- Database SSL connection
-
- - id: 'DB_IP_VERSION' # {string} A unique identifier for this param.
- title: 'DB_IP_VERSION' # {string} Any name.
- tags: ['database'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: 'IPv4'
- description: |
- Connect to database via either IPv4 or IPv6. Disregarded if database host is an IP address (e.g. '127.0.0.1') and recommended if database host is a name (e.g. 'db.abcd.supabase.co') to prevent potential non-existent domain (NXDOMAIN) errors.
-
- - id: 'REPLICATION_MODE' # {string} A unique identifier for this param.
- title: 'REPLICATION_MODE' # {string} Any name.
+ This is will seed a singular user into the database, and will disable browser authentication. All browser usage will default to this user. Inviting team users and other team-related functionality is currently not supported for self-hosted. Logflare self-hosted is currently intended for single-user experience only.
+ - id: 'LOGFLARE_API_KEY' # {string} A unique identifier for this param.
+ title: 'LOGFLARE_API_KEY' # {string} Any name.
tags: ['general'] # {string[]} These tags are useful for grouping parameters
links: [] # {string[]} These tags are useful for grouping parameters
required: true
- default: 'RLS'
+ default: ''
+ type: 'string'
description: |
- Connect to database via either IPv4 or IPv6. Disregarded if database host is an IP address (e.g. '127.0.0.1') and recommended if database host is a name (e.g. 'db.abcd.supabase.co') to prevent potential non-existent domain (NXDOMAIN) errors.
-
- - id: 'SLOT_NAME' # {string} A unique identifier for this param.
- title: 'SLOT_NAME' # {string} Any name.
- tags: ['general'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: 'realtime_rls'
- description: |
- A unique name for Postgres to track the Write-Ahead Logging (WAL). If the Realtime server dies then this slot can keep the changes since the last committed position.
-
- - id: 'TEMPORARY_SLOT' # {string} A unique identifier for this param.
- title: 'TEMPORARY_SLOT' # {string} Any name.
+ Allows you to pass in an API key that will used for authentication. This is intended for programmatic usage where an external program sets the API key. It is advised to use the UI to configure the access tokens instead. If this value is not provided, the default API key will be automatically generated.
+ - id: 'LOGFLARE_SUPABASE_MODE' # {string} A unique identifier for this param.
+ title: 'LOGFLARE_SUPABASE_MODE' # {string} Any name.
tags: ['general'] # {string[]} These tags are useful for grouping parameters
links: [] # {string[]} These tags are useful for grouping parameters
required: true
default: 'false'
+ type: 'boolean'
description: |
- Start logical replication slot as either temporary or permanent
-
- - id: 'REALTIME_IP_VERSION' # {string} A unique identifier for this param.
- title: 'REALTIME_IP_VERSION' # {string} Any name.
+ This is a special mode for Logflare which will seed additional resources for usage with Supabase self-hosted.
+ - id: 'PHX_HTTP_PORT' # {string} A unique identifier for this param.
+ title: 'PHX_HTTP_PORT' # {string} Any name.
tags: ['general'] # {string[]} These tags are useful for grouping parameters
links: [] # {string[]} These tags are useful for grouping parameters
required: true
- default: 'IPV6'
- description: |
- Bind realtime via either IPv4 or IPv6
-
- - id: 'PUBLICATIONS' # {string} A unique identifier for this param.
- title: 'PUBLICATIONS' # {string} Any name.
- tags: ['general'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: '[\"supabase_realtime\"]'
- description: |
- JSON encoded array of publication names. Realtime RLS currently accepts one publication.
-
- - id: 'SECURE_CHANNELS' # {string} A unique identifier for this param.
- title: 'SECURE_CHANNELS' # {string} Any name.
- tags: ['general'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: 'true'
- description: |
- Enable/Disable channels authorization via JWT verification
-
- - id: 'JWT_SECRET' # {string} A unique identifier for this param.
- title: 'JWT_SECRET' # {string} Any name.
- tags: ['general'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: '""'
- description: |
- HS algorithm octet key (e.g. "95x0oR8jq9unl9pOIx")
-
- - id: 'JWT_CLAIM_VALIDATORS' # {string} A unique identifier for this param.
- title: 'JWT_CLAIM_VALIDATORS' # {string} Any name.
- tags: ['general'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: '{}'
- description: |
- Expected claim key/value pairs compared to JWT claims via equality checks in order to validate JWT. e.g. '{"iss": "Issuer", "nbf": 1610078130}'.
-
- - id: 'EXPOSE_METRICS' # {string} A unique identifier for this param.
- title: 'EXPOSE_METRICS' # {string} Any name.
- tags: ['general'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: 'false'
- description: |
- Expose Prometheus metrics at '/metrics' endpoint.
-
- - id: 'DB_RECONNECT_BACKOFF_MIN' # {string} A unique identifier for this param.
- title: 'DB_RECONNECT_BACKOFF_MIN' # {string} Any name.
- tags: ['general'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: '100'
- description: |
- Specify the minimum amount of time to wait before reconnecting to database
-
- - id: 'DB_RECONNECT_BACKOFF_MAX' # {string} A unique identifier for this param.
- title: 'DB_RECONNECT_BACKOFF_MAX' # {string} Any name.
- tags: ['general'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: '120000'
- description: |
- Specify the maximum amount of time to wait before reconnecting to database
-
- - id: 'REPLICATION_POLL_INTERVAL' # {string} A unique identifier for this param.
- title: 'REPLICATION_POLL_INTERVAL' # {string} Any name.
- tags: ['general'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: '300'
- description: |
- Specify how often Realtime RLS should poll the replication slot for changes
-
- - id: 'SUBSCRIPTION_SYNC_INTERVAL' # {string} A unique identifier for this param.
- title: 'SUBSCRIPTION_SYNC_INTERVAL' # {string} Any name.
- tags: ['general'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: '60000'
- description: |
- Specify how often Realtime RLS should confirm connected subscribers and the tables they're listening to
-
- - id: 'MAX_CHANGES' # {string} A unique identifier for this param.
- title: 'MAX_CHANGES' # {string} Any name.
- tags: ['general'] # {string[]} These tags are useful for grouping parameters
- links: [] # {string[]} These tags are useful for grouping parameters
- required: true
- default: '100'
+ default: '4000'
+ type: 'string'
description: |
- Soft limit for the number of database changes to fetch per replication poll
-
- - id: 'MAX_RECORD_BYTES' # {string} A unique identifier for this param.
- title: 'MAX_RECORD_BYTES' # {string} Any name.
+ Port which serves HTTP requests
+ - id: 'DB_SCHEMA' # {string} A unique identifier for this param.
+ title: 'DB_SCHEMA' # {string} Any name.
tags: ['general'] # {string[]} These tags are useful for grouping parameters
links: [] # {string[]} These tags are useful for grouping parameters
required: true
- default: '1048576' # bytes or 1MB
+ default: ''
+ type: 'string'
description: |
- Controls the maximum size of a WAL record
+ This ENV variable sets the search path to a custom database schema. This allows you to customize the schema used on the database.
\ No newline at end of file