chore: use supabase public url

This commit is contained in:
Qiao Han committed 2022-11-16 16:29:25 +08:00
1 parent 89b6828e5a
commit 9c63fc53bb
10 files changed
+26 -19

No files matched your search

+1 -1
View File
@@ -74,4 +74,4 @@ STUDIO_DEFAULT_ORGANIZATION=Default Organization
STUDIO_DEFAULT_PROJECT=Default Project
STUDIO_PORT=3000
SUPABASE_PUBLIC_URL=http://localhost:8000 # replace if you intend to use Studio outside of localhost
SUPABASE_PUBLIC_URL=https://localhost:8443 # replace if you intend to use Studio outside of localhost
+7 -4
View File
@@ -21,7 +21,9 @@ services:
DEFAULT_PROJECT: ${STUDIO_DEFAULT_PROJECT}
SUPABASE_URL: http://kong:8000
SUPABASE_REST_URL: ${SUPABASE_PUBLIC_URL}
SUPABASE_PUBLIC_URL: ${SUPABASE_PUBLIC_URL}
# Kept for backwards compatibility with studio:0.22.08
SUPABASE_REST_URL: ${API_EXTERNAL_URL}/rest/v1/
SUPABASE_ANON_KEY: ${ANON_KEY}
SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY}
@@ -45,7 +47,7 @@ services:
auth:
container_name: supabase-auth
image: supabase/gotrue:v2.19.4
image: supabase/gotrue:v2.25.1
depends_on:
db: # Disable this if you are using an external Postgres database
condition: service_healthy
@@ -122,7 +124,8 @@ services:
SLOT_NAME: supabase_realtime_rls
TEMPORARY_SLOT: "true"
command: >
bash -c "./prod/rel/realtime/bin/realtime eval Realtime.Release.migrate && ./prod/rel/realtime/bin/realtime start"
bash -c "./prod/rel/realtime/bin/realtime eval Realtime.Release.migrate
&& ./prod/rel/realtime/bin/realtime start"
storage:
container_name: supabase-storage
@@ -167,7 +170,7 @@ services:
# Comment out everything below this point if you are using an external Postgres database
db:
container_name: supabase-db
image: supabase/postgres:14.1.0.82
image: supabase/postgres:14.1.0.89
healthcheck:
test: pg_isready -U postgres -h localhost
interval: 5s
+1 -2
View File
@@ -5,7 +5,6 @@ DEFAULT_ORGANIZATION_NAME=Default Organization
DEFAULT_PROJECT_NAME=Default Project
SUPABASE_URL=http://localhost:8000
SUPABASE_REST_URL=http://localhost:8000
SUPABASE_PUBLIC_URL=https://localhost:8443
SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q
@@ -18,7 +18,6 @@ import {
import ProductMenuItem from 'components/ui/ProductMenu/ProductMenuItem'
import { STORAGE_ROW_STATUS } from 'components/to-be-cleaned/Storage/Storage.constants'
import { useStorageStore } from 'localStores/storageExplorer/StorageExplorerStore'
import { IS_PLATFORM } from 'lib/constants'
interface Props {}
@@ -112,7 +112,7 @@ class StorageExplorerStore {
/* Methods which are commonly used + For better readability */
initializeSupabaseClient = (serviceKey, serviceEndpoint) => {
this.supabaseClient = createClient(`${serviceEndpoint}`, serviceKey, {
this.supabaseClient = createClient(`https://${serviceEndpoint}`, serviceKey, {
auth: {
persistSession: false,
autoRefreshToken: false,
@@ -478,7 +478,6 @@ class StorageExplorerStore {
fetchBuckets = async () => {
const { data: buckets, error } = await this.supabaseClient.storage.listBuckets()
if (error) return this.ui.setNotification({ message: error.message, category: 'error' })
const formattedBuckets = buckets.map((bucket) => {
+1 -1
View File
@@ -3,7 +3,7 @@
"version": "0.0.9",
"private": true,
"scripts": {
"dev": "next dev -p 3000",
"dev": "next dev -p 8082",
"build": "next build",
"start": "next start",
"test": "jest",
+4
View File
@@ -0,0 +1,4 @@
const PUBLIC_URL = new URL(process.env.SUPABASE_PUBLIC_URL || 'https://localhost:8443')
export const PROJECT_REST_URL = `${PUBLIC_URL.origin}/rest/v1/`
export const PROJECT_ENDPOINT = PUBLIC_URL.host
+2 -1
View File
@@ -1,6 +1,7 @@
import { NextApiRequest, NextApiResponse } from 'next'
import apiWrapper from 'lib/api/apiWrapper'
import { PROJECT_REST_URL } from 'pages/api/constants'
export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler)
@@ -35,7 +36,7 @@ const handleGet = async (req: NextApiRequest, res: NextApiResponse) => {
db_ssl: false,
}),
kpsVersion: 'kps-v1.0.0',
restUrl: `${process.env.SUPABASE_REST_URL}/rest/v1/` || 'http://localhost:8000/rest/v1/',
restUrl: PROJECT_REST_URL,
}
return res.status(200).json(response)
+7 -6
View File
@@ -1,6 +1,7 @@
import { NextApiRequest, NextApiResponse } from 'next'
import apiWrapper from 'lib/api/apiWrapper'
import { PROJECT_ENDPOINT, PROJECT_REST_URL } from 'pages/api/constants'
export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler)
@@ -39,11 +40,11 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
app: { id: 1, name: 'Auto API' },
app_config: {
db_schema: 'public',
endpoint: process.env.SUPABASE_URL,
endpoint: PROJECT_ENDPOINT,
realtime_enabled: true,
},
endpoint: process.env.SUPABASE_URL || 'http://localhost:8000',
restUrl: `${process.env.SUPABASE_REST_URL}/rest/v1/` || 'http://localhost:8000/rest/v1/',
endpoint: PROJECT_ENDPOINT,
restUrl: PROJECT_REST_URL,
defaultApiKey: process.env.SUPABASE_ANON_KEY,
serviceApiKey: process.env.SUPABASE_SERVICE_KEY,
service_api_keys: [
@@ -68,11 +69,11 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
app: { id: 1, name: 'Auto API' },
app_config: {
db_schema: 'public',
endpoint: process.env.SUPABASE_URL,
endpoint: PROJECT_ENDPOINT,
realtime_enabled: true,
},
endpoint: process.env.SUPABASE_URL,
restUrl: `${process.env.SUPABASE_REST_URL}/rest/v1/`,
endpoint: PROJECT_ENDPOINT,
restUrl: PROJECT_REST_URL,
defaultApiKey: process.env.SUPABASE_ANON_KEY,
serviceApiKey: process.env.SUPABASE_SERVICE_KEY,
service_api_keys: [
@@ -1,6 +1,7 @@
import { NextApiRequest, NextApiResponse } from 'next'
import apiWrapper from 'lib/api/apiWrapper'
import { PROJECT_ENDPOINT } from 'pages/api/constants'
export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler)
@@ -56,7 +57,7 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
app: { id: 1, name: 'Auto API' },
app_config: {
db_schema: 'public',
endpoint: process.env.SUPABASE_URL,
endpoint: PROJECT_ENDPOINT,
realtime_enabled: true,
},
},