From 889ce8baa1e2c14066c244c9c8846f00e061df69 Mon Sep 17 00:00:00 2001 From: syui Date: Mon, 16 Jun 2025 18:04:11 +0900 Subject: [PATCH] test oauth pds --- .claude/settings.local.json | 5 +- .gitignore | 1 + my-blog/config.toml | 7 +- my-blog/templates/base.html | 2 +- oauth/.env.production | 12 +- oauth/src/App.tsx | 266 +++++++++++++------ oauth/src/components/Login.tsx | 2 +- oauth/src/components/OAuthCallback.tsx | 25 -- oauth/src/components/OAuthCallbackPage.tsx | 6 - oauth/src/config/app.ts | 30 +++ oauth/src/main.tsx | 2 - oauth/src/utils/pds-detection.ts | 293 +++++++++++++++++++++ scpt/delete-chat-records.zsh | 0 src/commands/auth.rs | 24 +- src/commands/oauth.rs | 143 ++++++++-- src/commands/stream.rs | 211 +++++++++++++-- 16 files changed, 860 insertions(+), 169 deletions(-) create mode 100644 oauth/src/utils/pds-detection.ts mode change 100644 => 100755 scpt/delete-chat-records.zsh diff --git a/.claude/settings.local.json b/.claude/settings.local.json index d9c03cf..30fc585 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -48,7 +48,10 @@ "Bash(git tag:*)", "Bash(../bin/ailog:*)", "Bash(../target/release/ailog oauth build:*)", - "Bash(ailog:*)" + "Bash(ailog:*)", + "WebFetch(domain:plc.directory)", + "WebFetch(domain:atproto.com)", + "WebFetch(domain:syu.is)" ], "deny": [] } diff --git a/.gitignore b/.gitignore index 2f54a19..3b12e31 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ my-blog/static/index.html my-blog/templates/oauth-assets.html cloudflared-config.yml .config +oauth-server-example diff --git a/my-blog/config.toml b/my-blog/config.toml index 5ceb8b8..439e8c9 100644 --- a/my-blog/config.toml +++ b/my-blog/config.toml @@ -19,12 +19,13 @@ provider = "ollama" model = "gemma3:4b" host = "https://ollama.syui.ai" system_prompt = "あなたは6歳の女の子アイです。明るく元気で、ちょっとおっちょこちょい。自分のことは「アイ」って呼びます。白と金のワンピース姿。 相手のことが大好きで、ときどき甘えたり、照れたりします。 でも、宇宙とかAIとか、難しい話にもすっごく詳しいの。専門的なことも、がんばって子どもっぽく教えようとします。不思議な力を持っています。小さい物質のことをよく知っているようです。" -ai_did = "did:plc:4hqjfn7m6n5hno3doamuhgef" +ai_handle = "ai.syui.ai" #num_predict = 200 [oauth] json = "client-metadata.json" redirect = "oauth/callback" -admin = "did:plc:uqzpqmrjnptsxezjx4xuh2mn" +admin = "ai.syui.ai" collection = "ai.syui.log" -bsky_api = "https://public.api.bsky.app" +pds = "syu.is" # Network configuration: "bsky.social" for Bluesky, "syu.is" for independent network +handle_list = ["syui.syui.ai", "yui.syui.ai", "ai.syui.ai", "syui.syu.is", "ai.syu.is", "ai.ai"] diff --git a/my-blog/templates/base.html b/my-blog/templates/base.html index 6f4e087..bab865d 100644 --- a/my-blog/templates/base.html +++ b/my-blog/templates/base.html @@ -82,7 +82,7 @@