Skip to content

Commit 29e1b6c

Browse files
authored
chore: simplify configs for the rest of ai examples (supabase#30839)
* chore: simplify configs for the rest of ai examples * chore: document how to update project config * chore: link to config docs
1 parent aa586cf commit 29e1b6c

File tree

8 files changed

+69
-395
lines changed

8 files changed

+69
-395
lines changed

examples/ai/aws_bedrock_image_search/supabase/config.toml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,9 @@ shadow_port = 54320
1515
# server_version;` on the remote database to check.
1616
major_version = 15
1717

18-
[db.pooler]
18+
[db.seed]
19+
# If enabled, seeds the database after migrations during a db reset.
1920
enabled = false
20-
# Port to use for the local connection pooler.
21-
port = 54329
22-
# Specifies when a server connection can be reused by other clients.
23-
# Configure one of the supported pooler modes: `transaction`, `session`.
24-
pool_mode = "transaction"
25-
# How many server connections to allow per user/database pair.
26-
default_pool_size = 20
27-
# Maximum number of client connections allowed.
28-
max_client_conn = 100
21+
# Specifies an ordered list of seed files to load during db reset.
22+
# Supports glob patterns relative to supabase directory. For example:
23+
# sql_paths = ['./seeds/*.sql', '../project-src/seeds/*-load-testing.sql']

examples/ai/edge-functions/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This demo consists of three parts:
1414

1515
- Link your project: `supabase link`
1616
- Deploy Edge Functions: `supabase functions deploy`
17-
- Enable Database Webhooks in your [project dashboard](https://supabase.com/dashboard/project/_/database/hooks)
17+
- Update project config to [enable webhooks](https://supabase.com/docs/guides/local-development/cli/config#experimental.webhooks.enabled): `supabase config push`
1818
- Navigate to the [database-webhook](./supabase/migrations/20240410041607_database-webhook.sql) migration file and insert your `generate-embedding` function details.
1919
- Push up the database schema `supabase db push`
2020

examples/ai/edge-functions/supabase/config.toml

Lines changed: 22 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ enabled = true
77
# Port to use for the API URL.
88
port = 54321
99
# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API
10-
# endpoints. public and storage are always included.
11-
schemas = ["public", "storage", "graphql_public"]
12-
# Extra schemas to add to the search_path of every request. public is always included.
10+
# endpoints. `public` is always included.
11+
schemas = ["public", "graphql_public"]
12+
# Extra schemas to add to the search_path of every request. `public` is always included.
1313
extra_search_path = ["public", "extensions"]
1414
# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size
1515
# for accidental or malicious requests.
@@ -24,140 +24,29 @@ shadow_port = 54320
2424
# server_version;` on the remote database to check.
2525
major_version = 15
2626

27-
[db.pooler]
28-
enabled = false
29-
# Port to use for the local connection pooler.
30-
port = 54329
31-
# Specifies when a server connection can be reused by other clients.
32-
# Configure one of the supported pooler modes: `transaction`, `session`.
33-
pool_mode = "transaction"
34-
# How many server connections to allow per user/database pair.
35-
default_pool_size = 20
36-
# Maximum number of client connections allowed.
37-
max_client_conn = 100
38-
39-
[realtime]
40-
enabled = true
41-
# Bind realtime via either IPv4 or IPv6. (default: IPv6)
42-
# ip_version = "IPv6"
43-
# The maximum length in bytes of HTTP request headers. (default: 4096)
44-
# max_header_length = 4096
45-
46-
[studio]
47-
enabled = true
48-
# Port to use for Supabase Studio.
49-
port = 54323
50-
# External URL of the API server that frontend connects to.
51-
api_url = "http://127.0.0.1"
52-
# OpenAI API Key to use for Supabase AI in the Supabase Studio.
53-
openai_api_key = "env(OPENAI_API_KEY)"
54-
55-
# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they
56-
# are monitored, and you can view the emails that would have been sent from the web interface.
57-
[inbucket]
27+
[db.seed]
28+
# If enabled, seeds the database after migrations during a db reset.
5829
enabled = true
59-
# Port to use for the email testing server web interface.
60-
port = 54324
61-
# Uncomment to expose additional ports for testing user applications that send emails.
62-
# smtp_port = 54325
63-
# pop3_port = 54326
30+
# Specifies an ordered list of seed files to load during db reset.
31+
# Supports glob patterns relative to supabase directory, ie. './seeds/*.sql'
32+
sql_paths = ['./seed.sql']
6433

65-
[storage]
34+
[functions.generate-embedding]
6635
enabled = true
67-
# The maximum file size allowed (e.g. "5MB", "500KB").
68-
file_size_limit = "50MiB"
36+
# verify_jwt = true
37+
# import_map = "./functions/generate-embedding/deno.json"
38+
# Uncomment to specify a custom file path to the entrypoint.
39+
# Supported file extensions are: .ts, .js, .mjs, .jsx, .tsx
40+
# entrypoint = "./functions/generate-embedding/index.ts"
6941

70-
[auth]
42+
[functions.search]
7143
enabled = true
72-
# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used
73-
# in emails.
74-
site_url = "http://127.0.0.1:3000"
75-
# A list of *exact* URLs that auth providers are permitted to redirect to post authentication.
76-
additional_redirect_urls = ["https://127.0.0.1:3000"]
77-
# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week).
78-
jwt_expiry = 3600
79-
# If disabled, the refresh token will never expire.
80-
enable_refresh_token_rotation = true
81-
# Allows refresh tokens to be reused after expiry, up to the specified interval in seconds.
82-
# Requires enable_refresh_token_rotation = true.
83-
refresh_token_reuse_interval = 10
84-
# Allow/disallow new user signups to your project.
85-
enable_signup = true
86-
# Allow/disallow anonymous sign-ins to your project.
87-
enable_anonymous_sign_ins = false
88-
# Allow/disallow testing manual linking of accounts
89-
enable_manual_linking = false
90-
91-
[auth.email]
92-
# Allow/disallow new user signups via email to your project.
93-
enable_signup = true
94-
# If enabled, a user will be required to confirm any email change on both the old, and new email
95-
# addresses. If disabled, only the new email is required to confirm.
96-
double_confirm_changes = true
97-
# If enabled, users need to confirm their email address before signing in.
98-
enable_confirmations = false
99-
100-
# Uncomment to customize email template
101-
# [auth.email.template.invite]
102-
# subject = "You have been invited"
103-
# content_path = "./supabase/templates/invite.html"
104-
105-
[auth.sms]
106-
# Allow/disallow new user signups via SMS to your project.
107-
enable_signup = true
108-
# If enabled, users need to confirm their phone number before signing in.
109-
enable_confirmations = false
110-
# Template for sending OTP to users
111-
template = "Your code is {{ .Code }} ."
112-
113-
# Use pre-defined map of phone number to OTP for testing.
114-
[auth.sms.test_otp]
115-
# 4152127777 = "123456"
116-
117-
# This hook runs before a token is issued and allows you to add additional claims based on the authentication method used.
118-
[auth.hook.custom_access_token]
119-
# enabled = true
120-
# uri = "pg-functions://<database>/<schema>/<hook_name>"
121-
122-
123-
# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`.
124-
[auth.sms.twilio]
125-
enabled = false
126-
account_sid = ""
127-
message_service_sid = ""
128-
# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead:
129-
auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)"
130-
131-
# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`,
132-
# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin_oidc`, `notion`, `twitch`,
133-
# `twitter`, `slack`, `spotify`, `workos`, `zoom`.
134-
[auth.external.apple]
135-
enabled = false
136-
client_id = ""
137-
# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead:
138-
secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)"
139-
# Overrides the default auth redirectUrl.
140-
redirect_uri = ""
141-
# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure,
142-
# or any other third-party OIDC providers.
143-
url = ""
144-
145-
[analytics]
146-
enabled = false
147-
port = 54327
148-
vector_port = 54328
149-
# Configure one of the supported backends: `postgres`, `bigquery`.
150-
backend = "postgres"
44+
# verify_jwt = true
45+
# import_map = "./functions/search/deno.json"
46+
# Uncomment to specify a custom file path to the entrypoint.
47+
# Supported file extensions are: .ts, .js, .mjs, .jsx, .tsx
48+
# entrypoint = "./functions/search/index.ts"
15149

15250
# Experimental features may be deprecated any time
153-
[experimental]
154-
# Configures Postgres storage engine to use OrioleDB (S3)
155-
orioledb_version = ""
156-
# Configures S3 bucket URL, eg. <bucket_name>.s3-<region>.amazonaws.com
157-
s3_host = "env(S3_HOST)"
158-
# Configures S3 bucket region, eg. us-east-1
159-
s3_region = "env(S3_REGION)"
160-
# Configures AWS_ACCESS_KEY_ID for S3 bucket
161-
s3_access_key = "env(S3_ACCESS_KEY)"
162-
# Configures AWS_SECRET_ACCESS_KEY for S3 bucket
163-
s3_secret_key = "env(S3_SECRET_KEY)"
51+
[experimental.webhooks]
52+
enabled = true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Supabase
2+
.branches
3+
.temp
4+
.env
Lines changed: 12 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,23 @@
1-
# A string used to distinguish different Supabase projects on the same host. Defaults to the working
2-
# directory name when running `supabase init`.
3-
project_id = "image_search"
1+
# A string used to distinguish different Supabase projects on the same host. Defaults to the
2+
# working directory name when running `supabase init`.
3+
project_id = "aws_bedrock_image_search"
44

55
[api]
6-
# Port to use for the API URL.
7-
port = 54321
8-
# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API
9-
# endpoints. public and storage are always included.
10-
schemas = ["public", "storage", "graphql_public"]
11-
# Extra schemas to add to the search_path of every request. public is always included.
12-
extra_search_path = ["public", "extensions"]
13-
# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size
14-
# for accidental or malicious requests.
15-
max_rows = 1000
6+
# Disable data API since we are not using the PostgREST client in this example.
7+
enabled = false
168

179
[db]
1810
# Port to use for the local database URL.
1911
port = 54322
12+
# Port used by db diff command to initialize the shadow database.
13+
shadow_port = 54320
2014
# The database major version to use. This has to be the same as your remote database's. Run `SHOW
2115
# server_version;` on the remote database to check.
2216
major_version = 15
2317

24-
[studio]
25-
# Port to use for Supabase Studio.
26-
port = 54323
27-
28-
# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they
29-
# are monitored, and you can view the emails that would have been sent from the web interface.
30-
[inbucket]
31-
# Port to use for the email testing server web interface.
32-
port = 54324
33-
smtp_port = 54325
34-
pop3_port = 54326
35-
36-
[storage]
37-
# The maximum file size allowed (e.g. "5MB", "500KB").
38-
file_size_limit = "50MiB"
39-
40-
[auth]
41-
# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used
42-
# in emails.
43-
site_url = "http://localhost:3000"
44-
# A list of *exact* URLs that auth providers are permitted to redirect to post authentication.
45-
additional_redirect_urls = ["https://localhost:3000"]
46-
# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 seconds (one
47-
# week).
48-
jwt_expiry = 3600
49-
# Allow/disallow new user signups to your project.
50-
enable_signup = true
51-
52-
[auth.email]
53-
# Allow/disallow new user signups via email to your project.
54-
enable_signup = true
55-
# If enabled, a user will be required to confirm any email change on both the old, and new email
56-
# addresses. If disabled, only the new email is required to confirm.
57-
double_confirm_changes = true
58-
# If enabled, users need to confirm their email address before signing in.
59-
enable_confirmations = false
60-
61-
# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`,
62-
# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin`, `notion`, `twitch`,
63-
# `twitter`, `slack`, `spotify`, `workos`, `zoom`.
64-
[auth.external.apple]
65-
enabled = false
66-
client_id = ""
67-
secret = ""
68-
# Overrides the default auth redirectUrl.
69-
redirect_uri = ""
70-
# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure,
71-
# or any other third-party OIDC providers.
72-
url = ""
73-
74-
[analytics]
18+
[db.seed]
19+
# If enabled, seeds the database after migrations during a db reset.
7520
enabled = false
76-
port = 54327
77-
vector_port = 54328
78-
# Setup BigQuery project to enable log viewer on local development stack.
79-
# See: https://logflare.app/guides/bigquery-setup
80-
gcp_project_id = ""
81-
gcp_project_number = ""
82-
gcp_jwt_path = "supabase/gcloud.json"
21+
# Specifies an ordered list of seed files to load during db reset.
22+
# Supports glob patterns relative to supabase directory. For example:
23+
# sql_paths = ['./seeds/*.sql', '../project-src/seeds/*-load-testing.sql']

examples/ai/image_search/supabase/seed.sql

Whitespace-only changes.

0 commit comments

Comments
 (0)