-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from ant-xuexiao/refactor/and-add-github-callback
refactor: router and add github callback urls
- Loading branch information
Showing
17 changed files
with
656 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,106 +3,9 @@ | |
# YOU MUST CHANGE THESE BEFORE GOING INTO PRODUCTION | ||
############ | ||
|
||
POSTGRES_PASSWORD=your-super-secret-and-long-postgres-password | ||
JWT_SECRET=your-super-secret-jwt-token-with-at-least-32-characters-long | ||
ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE | ||
SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q | ||
DASHBOARD_USERNAME=supabase | ||
DASHBOARD_PASSWORD=this_password_is_insecure_and_should_be_updated | ||
|
||
############ | ||
# Database - You can change these to any PostgreSQL database that has logical replication enabled. | ||
############ | ||
|
||
POSTGRES_HOST=db | ||
POSTGRES_DB=postgres | ||
POSTGRES_PORT=5432 | ||
# default user is postgres | ||
|
||
############ | ||
# API Proxy - Configuration for the Kong Reverse proxy. | ||
############ | ||
|
||
KONG_HTTP_PORT=8000 | ||
KONG_HTTPS_PORT=8443 | ||
|
||
|
||
############ | ||
# API - Configuration for PostgREST. | ||
############ | ||
|
||
PGRST_DB_SCHEMAS=public,storage,graphql_public | ||
|
||
|
||
############ | ||
# Auth - Configuration for the GoTrue authentication server. | ||
############ | ||
|
||
## General | ||
SITE_URL=http://localhost:3000 | ||
ADDITIONAL_REDIRECT_URLS= | ||
JWT_EXPIRY=3600 | ||
DISABLE_SIGNUP=false | ||
API_EXTERNAL_URL=http://localhost:8000 | ||
|
||
## Mailer Config | ||
MAILER_URLPATHS_CONFIRMATION="/auth/v1/verify" | ||
MAILER_URLPATHS_INVITE="/auth/v1/verify" | ||
MAILER_URLPATHS_RECOVERY="/auth/v1/verify" | ||
MAILER_URLPATHS_EMAIL_CHANGE="/auth/v1/verify" | ||
|
||
## Email auth | ||
ENABLE_EMAIL_SIGNUP=true | ||
ENABLE_EMAIL_AUTOCONFIRM=false | ||
SMTP_ADMIN_EMAIL=[email protected] | ||
SMTP_HOST=supabase-mail | ||
SMTP_PORT=2500 | ||
SMTP_USER=fake_mail_user | ||
SMTP_PASS=fake_mail_password | ||
SMTP_SENDER_NAME=fake_sender | ||
|
||
## Phone auth | ||
ENABLE_PHONE_SIGNUP=true | ||
ENABLE_PHONE_AUTOCONFIRM=true | ||
|
||
|
||
############ | ||
# Studio - Configuration for the Dashboard | ||
############ | ||
|
||
STUDIO_DEFAULT_ORGANIZATION=Default Organization | ||
STUDIO_DEFAULT_PROJECT=Default Project | ||
|
||
STUDIO_PORT=3000 | ||
# replace if you intend to use Studio outside of localhost | ||
SUPABASE_PUBLIC_URL=http://localhost:8000 | ||
|
||
# Enable webp support | ||
IMGPROXY_ENABLE_WEBP_DETECTION=true | ||
|
||
############ | ||
# Functions - Configuration for Functions | ||
############ | ||
# NOTE: VERIFY_JWT applies to all functions. Per-function VERIFY_JWT is not supported yet. | ||
FUNCTIONS_VERIFY_JWT=false | ||
|
||
############ | ||
# Logs - Configuration for Logflare | ||
# Please refer to https://supabase.com/docs/reference/self-hosting-analytics/introduction | ||
############ | ||
|
||
LOGFLARE_LOGGER_BACKEND_API_KEY=your-super-secret-and-long-logflare-key | ||
|
||
# Change vector.toml sinks to reflect this change | ||
LOGFLARE_API_KEY=your-super-secret-and-long-logflare-key | ||
|
||
# Docker socket location - this value will differ depending on your OS | ||
DOCKER_SOCKET_LOCATION=/var/run/docker.sock | ||
|
||
# Google Cloud Project details | ||
GOOGLE_PROJECT_ID=GOOGLE_PROJECT_ID | ||
GOOGLE_PROJECT_NUMBER=GOOGLE_PROJECT_NUMBER | ||
|
||
|
||
#TAVILY_API_KEY | ||
TAVILY_API_KEY=TAVILY_API_KEY | ||
|
||
GITHUB_APP_CLIENT_ID=Iv1.c2e88b429e541264 | ||
GITHUB_APP_CLIENT_SECRET=xxx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from supabase.client import Client, create_client | ||
from uilts.env import get_env_variable | ||
|
||
supabase_url = get_env_variable("SUPABASE_URL") | ||
supabase_key = get_env_variable("SUPABASE_SERVICE_KEY") | ||
|
||
def get_client(): | ||
supabase: Client = create_client(supabase_url, supabase_key) | ||
return supabase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
from typing import Any, Dict, Union | ||
from typing_extensions import NotRequired, TypedDict | ||
from github import GithubObject, PullRequest, Repository, Organization, Installation, PullRequestComment | ||
from github import Github, Auth | ||
|
||
class PullRequestEventHandler(): | ||
event: Any | ||
auth: Auth.AppAuth | ||
g: Github | ||
|
||
def __init__(self, payload, auth: Auth.AppAuth) -> None: | ||
self.event = payload | ||
self.auth = auth | ||
self.g = Github(auth=auth) | ||
|
||
def execute(self): | ||
match self.event['action']: | ||
case 'opened': | ||
repo = self.g.get_repo(self.event['repository']["full_name"]) | ||
pr = repo.get_pull(self.event["pull_request"]["number"]) | ||
comment = pr.create_issue_comment("This is a comment from PeterCat") | ||
|
||
print(repo, pr, comment) | ||
return { "success": True } | ||
case _: | ||
return { "success": True } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,6 @@ python-multipart | |
httpx[socks] | ||
load_dotenv | ||
supabase | ||
boto3>=1.26.79 | ||
boto3>=1.34.84 | ||
pyjwt>=2.4.0 | ||
pydantic>=2.7.0 |
Oops, something went wrong.