Skip to content

Commit

Permalink
chore: log pat error, add supabase cli, add smee-client
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Sep 30, 2024
1 parent c8b3325 commit 2d030cd
Show file tree
Hide file tree
Showing 12 changed files with 434 additions and 120 deletions.
2 changes: 1 addition & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "./src/adapters/supabase/**/**.ts"],
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "./src/adapters/supabase/**/**.ts", "supabase/config.toml"],
"useGitignore": true,
"language": "en",
"words": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/worker-delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
- name: Output Deletion Result
run: |
echo "### Deployment URL" >> $GITHUB_STEP_SUMMARY
echo 'Deployment `${{ env.full_worker_name }}` has been deleted.' >> $GITHUB_STEP_SUMMARY
echo 'Deployment `${{ env.full_worker_name }}` has been deleted.' >> $GITHUB_STEP_SUMMARY
2 changes: 1 addition & 1 deletion .github/workflows/worker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:
- name: Write Deployment URL to Summary
run: |
echo "### Deployment URL" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.wrangler_deploy.outputs.deployment-url }}" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.wrangler_deploy.outputs.deployment-url }}" >> $GITHUB_STEP_SUMMARY
41 changes: 13 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,37 +137,22 @@ plugins:
2. Run the migration or copypaste the SQL migration file from `./supabase/migrations` in the Supabase dashboard.
3. Add your `SUPABASE_URL` and `SUPABASE_SERVICE_KEY` to your environment variables.

##### Running the Migration
##### Supabase Commands

1. Install the Supabase CLI. If you don't have it installed yet, you can install it via npm:

```bash
npm install -g supabase
```

2. Make sure your Supabase project is initialized. If not, initialize it:

```bash
supabase init
```

3. Set up your `.env` file with your Supabase credentials (or make sure you have already logged in using `supabase login`).

4. To run the migrations on your local environment, use:

```bash
supabase db reset
```

This command will reset your local database and apply all migrations.

5. To push migrations to your remote database, use:
- To start the Supabase database locally, run the following command:
```bash
yarn supabase db start
```

```bash
supabase db push
```
- To reset the Supabase database, run the following command:
```bash
yarn supabase db reset
```

This will apply all migrations to the remote Supabase database.
- To stop the Supabase database, run the following command:
```bash
yarn supabase stop
```

For more detailed information, refer to the official [Supabase documentation](https://supabase.com/docs).

Expand Down
8 changes: 2 additions & 6 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"name": "ubiquity-os/kernel-telegram",
"description": "Part kernel plugin, part Telegram kernel. This bot is designed to be a bridge between UbiquityOS and Telegram.",
"ubiquity:listeners": [
"issues.labeled",
"issues.closed",
"issues.reopened"
]
}
"ubiquity:listeners": ["issues.labeled", "issues.closed", "issues.reopened"]
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@
"lint-staged": "15.2.9",
"npm-run-all": "4.1.5",
"prettier": "3.3.3",
"smee-client": "2.0.3",
"supabase": "^1.200.3",
"ts-jest": "29.2.5",
"tsc-watch": "^6.2.0",
"tsx": "4.18.0",
"typescript": "5.5.4",
"typescript-eslint": "8.3.0",
"wrangler": "3.72.2"
"wrangler": "^3.78.12"
},
"lint-staged": {
"*.ts": [
Expand Down
3 changes: 2 additions & 1 deletion src/bot/mtproto-api/bot/scripts/sms-auth/setup-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ class SetUpHandler {
});

return true;
} catch {
} catch (e) {
logger.error("Error testing access token", { e });
return false;
}
}
Expand Down
4 changes: 4 additions & 0 deletions supabase/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Supabase
.branches
.temp
.env
42 changes: 42 additions & 0 deletions supabase/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
project_id = "supabase"

[api]
enabled = true
port = 54321
schemas = ["public", "graphql_public"]
extra_search_path = ["public", "extensions"]
max_rows = 1000

[api.tls]
enabled = false

[db]
port = 54322
shadow_port = 54320
major_version = 15

[db.pooler]
enabled = false
port = 54329
pool_mode = "transaction"
default_pool_size = 20
max_client_conn = 100

[realtime]
enabled = true

[studio]
enabled = true
port = 54323
api_url = "http://127.0.0.1"
openai_api_key = "env(OPENAI_API_KEY)"

[edge_runtime]
enabled = true
policy = "oneshot"
inspector_port = 8083

[analytics]
enabled = false
port = 54327
backend = "postgres"
File renamed without changes.
Empty file added supabase/seed.sql
Empty file.
Loading

0 comments on commit 2d030cd

Please sign in to comment.