Add deployment helpers and environment config
- Add manual deployment instructions for self-hosted Supabase - Add schema refresh SQL scripts - Add deployment helper scripts - Add Supabase environment configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
114
manual-deploy-instructions.md
Normal file
114
manual-deploy-instructions.md
Normal file
@@ -0,0 +1,114 @@
|
||||
# Manual Deployment Instructions for Self-Hosted Supabase
|
||||
|
||||
Since you're using self-hosted Supabase, here's how to deploy the edge function:
|
||||
|
||||
## Option 1: Via Supabase CLI (Recommended)
|
||||
|
||||
If you have Supabase CLI installed:
|
||||
|
||||
```bash
|
||||
# Link to your self-hosted instance
|
||||
supabase link --project-ref your-project-id
|
||||
|
||||
# Deploy the function
|
||||
supabase functions deploy create-google-meet-event --verify-jwt
|
||||
```
|
||||
|
||||
## Option 2: Direct File Upload to Supabase Container
|
||||
|
||||
For self-hosted Supabase, you need to:
|
||||
|
||||
1. **SSH into your Supabase container** or access via dashboard
|
||||
|
||||
2. **Copy the function file** to the correct location:
|
||||
```bash
|
||||
# Path in Supabase: /var/lib/postgresql/functions/create-google-meet-event/index.ts
|
||||
# Or wherever your functions are stored
|
||||
```
|
||||
|
||||
3. **Restart the Supabase functions service**
|
||||
|
||||
## Option 3: Use Docker Exec (If running in Docker)
|
||||
|
||||
```bash
|
||||
# Find the Supabase container
|
||||
docker ps | grep supabase
|
||||
|
||||
# Copy function file into container
|
||||
docker cp supabase/functions/create-google-meet-event/index.ts \
|
||||
<container-id>:/home/deno/functions/create-google-meet-event/index.ts
|
||||
|
||||
# Restart the functions service
|
||||
docker exec <container-id> supervisorctl restart functions:*
|
||||
```
|
||||
|
||||
## Option 4: Update via Supabase Dashboard (If Available)
|
||||
|
||||
1. Access your Supabase dashboard at `https://lovable.backoffice.biz.id`
|
||||
2. Navigate to **Edge Functions**
|
||||
3. Click **New Function** or edit existing
|
||||
4. Paste the code from `supabase/functions/create-google-meet-event/index.ts`
|
||||
5. Set **Verify JWT** to `true`
|
||||
6. Save
|
||||
|
||||
## Quick Test to Verify Function Exists
|
||||
|
||||
```bash
|
||||
curl -X GET "https://lovable.backoffice.biz.id/functions/v1/create-google-meet-event" \
|
||||
-H "Authorization: Bearer YOUR_ANON_KEY"
|
||||
```
|
||||
|
||||
Expected: Should get a method not allowed error (which means function exists)
|
||||
|
||||
---
|
||||
|
||||
## Schema Cache Fix
|
||||
|
||||
For the schema cache issue with the `google_service_account_json` column:
|
||||
|
||||
### Run this in Supabase SQL Editor:
|
||||
|
||||
```sql
|
||||
-- Step 1: Verify column exists
|
||||
SELECT column_name, data_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 'platform_settings'
|
||||
AND column_name = 'google_service_account_json';
|
||||
|
||||
-- Step 2: Force cache refresh
|
||||
NOTIFY pgrst, 'reload schema';
|
||||
|
||||
-- Step 3: Test query
|
||||
SELECT google_service_account_json FROM platform_settings;
|
||||
```
|
||||
|
||||
### Or restart PostgREST:
|
||||
|
||||
If you have access:
|
||||
```bash
|
||||
# In Supabase container/system
|
||||
supervisorctl restart postgrest
|
||||
```
|
||||
|
||||
### Frontend workaround:
|
||||
|
||||
If the schema cache persists, you can bypass the type-safe client and use raw SQL:
|
||||
|
||||
```typescript
|
||||
// In IntegrasiTab.tsx, temporary bypass
|
||||
const { data } = await supabase
|
||||
.rpc('exec_sql', {
|
||||
sql: `UPDATE platform_settings SET google_service_account_json = '${JSON.stringify(settings.integration_google_service_account_json)}'::jsonb`
|
||||
});
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. Deploy the function using one of the methods above
|
||||
2. Run the schema refresh SQL
|
||||
3. Try saving the settings again
|
||||
4. Test the connection
|
||||
|
||||
Let me know which deployment method works for your setup!
|
||||
Reference in New Issue
Block a user