diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d005227..5d3cb957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ EdgeChat 从 `2.1.2` 起正式采用语义化版本。更早的版本号依据已经完成的主要里程碑补记,用于说明项目演进,不对应历史 Git 标签。 +## 2.6.0 - 2026-09-13 + +- 新增所有已登录用户可用的站内通讯录,默认仅展示头像和姓名,支持姓名/用户名搜索,并按需复用既有资料卡与私信打开流程。 +- 聊天与通讯录共享持久工作区和唯一 inbox 连接;切换时暂停隐藏房间连接,保留搜索、滚动位置与未发送草稿,不新增好友关系、数据库迁移或云资源。 + ## 2.5.0 - 2026-09-12 - 网页群聊与私聊正文统一支持安全 Markdown,保留结构化提及、HTTP(S) 自动链接、纯文本摘要和 Markdown 原文复制。 diff --git a/README.en.md b/README.en.md index d5f65fe6..5b3119a8 100644 --- a/README.en.md +++ b/README.en.md @@ -1,262 +1,274 @@ +
+📢 EdgeChat Partnerships and Advertising +
+ +EdgeChat serves developers, Cloudflare users, and the self-hosting community. The project currently has 666 Stars on GitHub, and its README receives sustained visibility. + +If your product or service is related to **developer tools, cloud services, self-hosted applications, or the open-source ecosystem**, you can advertise in the README: + +- **Sponsor — $5 / month** + Display your logo, name, and link in the Sponsors section. +- **Featured Sponsor — $10 / month** + Receive a higher placement, a larger logo, and a one-line description. + +Advertisements are limited to brands related to developer tools, cloud services, self-hosted products, and the open-source ecosystem to keep them relevant to readers. + +To place an advertisement, contact us through the [Telegram Community](https://t.me/EdgeChatlounge) or open an [Issue](https://github.com/aozorae/Edgechat/issues). + +
+
EdgeChat -

A modern team chat system built on the Cloudflare ecosystem

-

Accounts · Public/Private Groups · Direct Messages · Real-time Messaging · Voice Messages · File Uploads · Admin Dashboard

+

Your own chat space, without starting by maintaining a server.

+

Open-source, self-hosted team chat running on Cloudflare

+

Real-time group chats and DMs · Two-way Telegram bridging · Voice and files · Server-side encryption for messages and attachments

license stars forks - issues last commit -

-

- Vue 3 Cloudflare Workers - Hono - Durable Objects - GPL-3.0-or-later - Telegram Bridge

中文 · English · 日本語 · - Online Demo · - Project Documentation · + Live Demo · + Documentation · Telegram Community

- - > ***This might be the best Cloudflare chat room for teams under 10 million users***

-EdgeChat is a team chat system deployed on Cloudflare: accounts, public groups, private groups, direct messages, real-time messaging, voice messages, file uploads, and an admin dashboard — everything you need. The goal is straightforward: run a production-ready, in-site IM in the Cloudflare ecosystem with as little operational overhead as possible. - -## Latest Update - -> **Experimental WebMCP support**: EdgeChat is an early adopter of OpenAI's recently introduced experimental [Site tools (WebMCP)](https://learn.chatgpt.com/docs/webmcp) capability. Open and sign in to EdgeChat with ChatGPT Work or Codex in the ChatGPT desktop app's built-in browser, and the AI can discover and call the site's chat tools directly. Regular browsers, the existing interface, and the core Worker protocol remain unchanged. +**EdgeChat is an open-source team chat system running on Cloudflare.** Use it to build an independent chat space for your team, project, or small community: keep discussions in groups, private matters in direct messages, and share voice messages and files whenever you need. -| Tool | Capability | Status | -|---|---|---| -| `edgechat.login` | Sign in and establish the current browser session | ✅ | -| `edgechat.list_channels` | List channels visible to the user | ✅ | -| `edgechat.read_messages` | Read recent messages from a room | ✅ | -| `edgechat.send_message` | Send a message to a room | ✅ | -| `edgechat.open_dm` | Find or open a direct message | ✅ | +You do not need to maintain a permanently running server. The application and data resources are deployed in your own Cloudflare account, with GitHub Actions handling automatic deployment and updates. If your members already use Telegram, you can connect the groups on both sides and let everyone keep using the chat entry point they are familiar with. -The login tool reuses the existing authentication flow and browser safety confirmation. Its result never includes the password or session token. - -## Table of Contents - -- [Interface Preview](#interface-preview) -- [Online Demo](#online-demo) -- [Featured Feature: Telegram Two-Way Message Bridge](#featured-feature-telegram-two-way-message-bridge) -- [Why EdgeChat](#why-edgechat) -- [Features](#features) -- [Tech Stack](#tech-stack) -- *[Telegram Community](#telegram-community)* -- [Deployment](#deployment) -- [Quick Start](#quick-start) -- [Project Structure](#project-structure) -- [Contributing](#contributing) -- [Star History](#star-history) -- [License](#license) -- [Disclaimer](#disclaimer) +[Interface Preview](#interface-preview) · [Live Demo](#live-demo) · [Telegram Bridging](#telegram-two-way-bridging) · [Features](#features) · [Privacy and Encryption](#privacy-and-encryption) · [Deployment](#deployment) · [Local Development](#local-development) ## Interface Preview - + - +
Chat InterfaceAdmin DashboardAdmin Console
EdgeChat chat interface previewEdgeChat admin dashboard previewEdgeChat admin console preview
-## Online Demo +## Live Demo + +**[Open the EdgeChat live demo →](https://edgechat-demo.wcjxxgaq.workers.dev)** + +Take a look at the interface before deciding whether to deploy. + +The demo site reuses the production project's Vue pages, routes, state management, and real-time messaging logic. However, its API, WebSocket, file uploads, and Telegram relay are simulated in browser memory; it is not a multi-user chat room connected to a real backend. + +Refresh the page or click “Reset Demo Data” in the upper-right corner to restore the initial state. Demo actions do not access the production Worker or write to D1, KV, or R2. + +## Why EdgeChat -**[edgechat-demo.wcjxxgaq.workers.dev](https://edgechat-demo.wcjxxgaq.workers.dev)** +EdgeChat is for people who **want their own chat space without having to maintain a server, database, and complete runtime environment over the long term.** -The demo site reuses the production project's Vue pages, routing, state management, and real-time messaging logic, but all APIs, WebSocket, file uploads, and Telegram round trips are simulated in browser memory. Reload the page or click **“Reset demo data”** in the top-right corner to restore the initial state. It never contacts the production Worker, nor does it write to D1, KV, or R2. +| What you care about | How EdgeChat handles it | +|---|---| +| Deployment and maintenance | Built on Cloudflare Workers, with no permanently running server to maintain; supports automatic deployment through GitHub Actions | +| Members and administration | Provides independent accounts, public and private groups, direct messages, and an admin console | +| Existing Telegram groups | Uses two-way Bot bridging so members on both sides can keep using the entry point they prefer | +| Customization and extension | The source is open, so you can adapt the interface and features to your needs | -## Featured Feature: Telegram Two-Way Message Bridge +The project itself is free and open source. Cloud service costs depend on your Cloudflare plan, resource configuration, and actual usage. -Admins can bind any group in EdgeChat to a Telegram group. Once bound, messages on both sides are **forwarded in real time, in both directions** through the Telegram Bot — messages sent by EdgeChat members appear in the Telegram group, and messages from the Telegram group appear in EdgeChat. Members on both sides chat as if they were in the same group, with no need to switch apps or create duplicate groups. +## Telegram Two-Way Bridging + +**You do not have to move everyone into the same application.** + +Administrators can bind EdgeChat groups to Telegram groups and relay messages in both directions through a Telegram Bot: messages sent on the web can be synchronized to Telegram, and messages in the Telegram group return to EdgeChat. + +This suits teams and communities that already have Telegram groups but also need an independent web chat entry point.
EdgeChat to Telegram two-way message bridge demo
- Seamless real-time forwarding, two-way sync + Two chat entry points, one conversation.
-## Why EdgeChat - -| | EdgeChat | Self-hosted Rocket.Chat / Mattermost | Commercial SaaS IM | -|---|---|---|---| -| Deployment cost | Runs within Cloudflare's free tier | Requires an always-on server / container | Per-seat subscription fees | -| Ops burden | No server management, serverless | You maintain the database and cache yourself | No ops, but no control | -| Data ownership | Fully in your own Cloudflare account | Fully self-hosted | Data lives with a third party | -| Getting started | One-click auto-deploy via GitHub Actions | Manual / Docker Compose | Just sign up | - -> This table is only a rough reference for choosing a solution. Whether it actually fits depends on your team size and needs — feel free to discuss and correct it in the Issues. - ## Features -**💬 Messaging & Conversations** -- Public groups, private groups, and direct message conversations -- [Two-way Telegram group bridge](#featured-feature-telegram-two-way-message-bridge) — one Bot connects members on both sides -- Real-time messaging, paginated history, Telegram-style voice messages, and file messages -- Block or unblock contacts from the direct-message header; direct messages pause in both directions while blocked -- The web client supports Telegram-style replies, quoted-message navigation, and reply-aware direct-attention alerts -- The foreground web client shows Telegram Web-style bottom-right alerts for other conversations; the current conversation only alerts for mentions or replies, while background tabs continue to use browser system notifications -- Web and Android recording, waveform seeking, playback speed controls, and two-way Telegram voice/audio sync -- File uploads and avatar management -- Scheduled hard deletion of expired messages - -**🔐 Privacy & Security** -- Newly written messages and newly uploaded attachments are encrypted server-side with AES-256-GCM; historical data is not bulk-backfilled -- The admin dashboard offers no entry point for reading group or direct message contents -- Users are created by admins; self-registration is not available - -**🛠 Admin Dashboard** -- Top-level navigation for dashboard, user management, registration invites, and site settings -- Permanently ban users or apply temporary bans in days, hours, or minutes; expired bans lift automatically without scheduled jobs -- Compares the current deployment directly against the source repository from the browser to check for updates - -**🎨 Experience** -- Modern Liquid Glass-style interface -- Mobile-adapted, with basic accessibility support - -## Tech Stack - -

- frontend - backend -
- realtime - d1 - kv - r2 -
- deploy -

+### 💬 Chat and Conversations -## Telegram Community +- Public groups, private groups, and one-to-one direct messages. +- Real-time messages, paginated message history, voice messages, and file sharing. +- Message replies, quote navigation, @ mentions, and reply reminders. +- Block and unblock direct-message contacts; while blocked, neither party can continue sending DMs. +- Optional scheduled hard deletion of expired messages. -Join our [Telegram community](https://t.me/EdgeChatlounge) to discuss with other users and developers, share feedback, and stay up to date with the project. +### 🎨 Everyday Experience -## Deployment +- Liquid Glass-style interface adapted for desktop and mobile. +- Voice recording, waveform progress, and variable-speed playback. +- In-app message notifications in the web interface; browser system notifications are available in the background with user permission. +- File uploads, avatar management, and basic accessibility support. -### GitHub Actions Auto Deployment (Recommended) +### 🛠 Instance Administration -GitHub Actions deployment is recommended first — it suits long-term maintenance and production updates. The repository ships `.github/workflows/deploy-worker.yml`: pushing to `master` or `main`, or manually triggering `workflow_dispatch`, runs the automatic deployment. +- Dashboard, user management, registration invitations, and site settings. +- Supports permanent bans and temporary bans configured in days, hours, or minutes; temporary bans lift automatically when they expire, without an additional scheduled task. +- Compare directly with the source repository in the browser to check whether the current deployment has updates. -- Quick start: -- Detailed guide: +### 🔌 Connections and Extensions -### Android Clients +- Two-way Telegram group message bridging, including voice message synchronization. +- WebMCP site tools: in compatible client environments, provides login, conversation queries, message reading, sending, and related capabilities. -The primary Android release is now the `capacitor/` client. Its APK bundles the Vue Web UI, while a small Kotlin bridge handles system file selection, notifications, microphone permission, notification room opening, and external links. It uses the application ID `com.aozorae.edgechat.web`; users enter their own EdgeChat HTTPS origin on first sign-in, so the package is not tied to one deployment. +## Privacy and Encryption -- Installation: download `edgechat-*.apk` from GitHub Releases and verify `SHA256SUMS.txt` -- First use: enter the self-hosted EdgeChat HTTPS origin, username, and password on the sign-in screen -- Local build: install JDK 21 and Android SDK 36, then run `npm run build:capacitor` -- Debug APK: `capacitor/android/app/build/outputs/apk/debug/app-debug.apk` -- CI: `.github/workflows/capacitor-android-ci.yml` uploads `edgechat-capacitor-debug` -- Release: push an `android-v*` tag or run `Android Release`; the workflow uses the four `ANDROID_KEYSTORE_*` Secrets to build signed APK/AAB artifacts -- Server switching: sign out and edit the URL; changing instances clears the previous instance token -- Limitation: this client currently has no Room offline database, WorkManager outbox, or FCM, so instant background notifications are not guaranteed when the app stops receiving messages +EdgeChat uses AES-256-GCM server-side encryption at rest for **newly written message bodies and newly uploaded attachments**. Historical plaintext data remains unchanged; reads support both new and old data, and deployment or background jobs do not perform a bulk encryption backfill. -The native Kotlin + Jetpack Compose client in `android/` is temporarily deprecated and is no longer the default release. Its source, API v1 contract, and separate CI remain available for historical verification and future evaluation; use the Capacitor build for new installations and routine updates. +The admin console does not provide an entry point for viewing group or direct-message bodies, but administrators can still view aggregate statistics such as message counts. -Full guide: +> [!NOTE] +> **This is server-side encryption, not end-to-end encryption.** +> The Worker decrypts content after checking session permissions. The Cloudflare runtime and the party holding the keys must still be trusted. The absence of a message-viewing entry point in the admin console does not mean that the deployer is technically unable to access the content. +> +> When Telegram bridging is enabled, relayed messages also enter the corresponding Telegram conversation.
-🔐 Privacy & Server-Side Encryption (click to expand) +Key Management and Rotation
-GitHub Actions manages the server-side encryption Worker Secrets. On the first deployment, if the target Worker has no encryption Secret, the workflow automatically generates a random 32-byte AES key, injects it as an independent versioned Secret, and records the current active key ID. Subsequent normal deployments only check that these Secrets exist — they never regenerate, overwrite, or rotate them. An existing production `EDGECHAT_ENCRYPTION_KEYRING` JSON keyring is preserved as-is and remains compatible. +GitHub Actions manages the server-side encryption Worker Secrets. On the first deployment, if the target Worker has no encryption Secret, the workflow automatically generates a random 32-byte AES key, injects it as an independently versioned Secret, and records the current active key ID. Subsequent ordinary deployments only check that these Secrets exist; they do not regenerate, overwrite, or rotate them. -After deployment, newly written message bodies and newly uploaded attachments are encrypted automatically. Historical D1 messages and R2 attachments stay untouched, and reads remain compatible with both legacy plaintext and new ciphertext. The project never loops through all historical data via Cron, scheduled tasks, or deployment scripts to encrypt it. +An existing `EDGECHAT_ENCRYPTION_KEYRING` JSON keyring in production is preserved exactly and remains supported. -To provide a key manually, create a GitHub Repository Secret named `EDGECHAT_ENCRYPTION_KEYRING` in the following format: +To specify a key manually, create a GitHub Repository Secret named `EDGECHAT_ENCRYPTION_KEYRING`: ```json {"activeKeyId":"v1","keys":{"v1":"BASE64_ENCODED_32_BYTE_KEY"}} ``` -The first deployment uses this value directly. To rotate an existing Worker automatically and incrementally, manually run `Deploy Worker` and tick `rotate_encryption_key`: the workflow only adds one versioned key Secret and switches the active key ID to the new version, while every old Secret and the legacy JSON keyring stay unchanged. New messages use the new active key, and old ciphertext keeps being decrypted with the key ID in its own envelope. +The first deployment adopts this value directly. + +To enable automatic incremental rotation for an existing Worker, manually run `Deploy Worker` and check `rotate_encryption_key`. The workflow adds only one versioned key Secret and switches the active key ID to the new version; all old Secrets and the old JSON keyring remain unchanged. New messages use the new key, while old ciphertext continues to be decrypted with the key ID in its own envelope. -`apply_encryption_keyring` is a backup manual override. When using it, the Repository Secret must contain the complete JSON keyring: `keys` must keep every old key ID still referenced by historical ciphertext, then add the new key and update `activeKeyId`. Removing an old key makes the corresponding historical ciphertext permanently unreadable. `apply_encryption_keyring` and `rotate_encryption_key` cannot be enabled in the same run. +`apply_encryption_keyring` is a fallback manual override entry point. When using it, the Repository Secret must contain the complete JSON keyring. `keys` must retain every old key ID still referenced by historical ciphertext, then add the new key and update `activeKeyId`. -This is server-side encryption at rest, not end-to-end encryption. The Worker decrypts content only after session permission checks, so the Cloudflare Worker runtime and the deployer who holds the key remain inside the trust boundary. As a complementary privacy change, the admin message search and full-conversation viewing pages and their APIs have been removed; admins can still see aggregate statistics such as message counts. +**Deleting an old key makes the corresponding historical ciphertext permanently unreadable.** `apply_encryption_keyring` and `rotate_encryption_key` cannot be enabled in the same run.
-### Manual Deployment / Docker +## Technology Stack + +| Area | Technology | +|---|---| +| Frontend | Vue 3, Vue Router, Vite | +| Backend | Cloudflare Workers, Hono | +| Real-time communication | Durable Objects, WebSocket Hibernation | +| Database | Cloudflare D1 | +| Session storage | Cloudflare KV | +| File storage | Cloudflare R2 | +| Build and deployment | Wrangler, GitHub Actions | + +See [TECHNICAL.md](TECHNICAL.md) for more implementation details. + +## Deployment + +### Automatic Deployment with GitHub Actions + +Using the GitHub Actions workflow included in the repository is recommended for deployment and subsequent updates. + +After completing the Cloudflare authorization and repository configuration described in the documentation, you can manually run `Deploy Worker`, or trigger deployment by pushing code to the `master` or `main` branch. The workflow file is `.github/workflows/deploy-worker.yml`. + +**[Quick Start](https://echat.azora.top/guide/getting-started.html) · [GitHub Actions Deployment Guide](https://echat.azora.top/guide/actions-deploy.html)** + +### Manual Deployment and Docker + +See the [deployment documentation](https://echat.azora.top/guide/getting-started.html) for local manual deployment resource preparation, configuration, and notes. + +See [DOCKER.md](DOCKER.md) for Docker-related information. + +### Android Client
-Click to expand manual deployment and Docker notes +Client, installation, and build instructions
-If you prefer to deploy manually, see the documentation site for the full steps, resource preparation, and notes: +The `capacitor/` client bundles the Vue Web UI in its APK and uses a small amount of Kotlin to integrate with the system file picker, notifications, microphone permissions, notification conversation navigation, and external links. Its package name is `com.aozorae.edgechat.web`. On first login, enter your own EdgeChat HTTPS service address; it is not tied to a fixed deployment. + +- Package: download `edgechat-*.apk` from [GitHub Releases](https://github.com/aozorae/Edgechat/releases) and verify `SHA256SUMS.txt`. +- First use: enter your EdgeChat HTTPS service address, account, and password. +- Local build: prepare JDK 21 and Android SDK 36, then run `npm run build:capacitor`. +- Debug APK: `capacitor/android/app/build/outputs/apk/debug/app-debug.apk`. +- CI: `.github/workflows/capacitor-android-ci.yml` uploads `edgechat-capacitor-debug`. +- Release: push an `android-v*` tag or manually run `Android Release`, using the four `ANDROID_KEYSTORE_*` Secrets to build a signed APK/AAB. +- Service switching: you can change the address after signing out; switching instances automatically clears the old instance token. + +Room offline database, WorkManager Outbox, and FCM are not currently included; when the app stops receiving messages, background instant notifications are not guaranteed. + +The native `android/` Kotlin + Jetpack Compose client is temporarily deprecated and is no longer the default distribution. Its source, API v1 contract, and separate CI are temporarily retained. -- Manual deployment guide: -- Documentation home: -- Docker local deployment: [DOCKER.md](DOCKER.md) +See the [Android client documentation](https://echat.azora.top/guide/android.html) for complete details.
-## Quick Start +## Local Development ```bash +# Get the source +git clone https://github.com/aozorae/Edgechat.git +cd Edgechat + # Install dependencies npm install +# Start the frontend-only demo without deploying cloud resources first +npm run dev:demo +``` + +Before connecting to a real backend for development or deployment, prepare the required Cloudflare resources and configuration according to the documentation. + +```bash # Frontend development npm run dev:frontend -# Frontend-only demo (separate port and build directory) -npm run dev:demo - # Local build npm run build -# Local manual deployment +# Manual local deployment npm run deploy ```
-More scripts (demo build / deploy, CI environment variables) +Demo site build, deployment, and CI environment variables
```bash -# Build the standalone demo +# Build the demo site separately npm run build:demo # Deploy the standalone demo Worker npm run deploy:demo ``` -The demo uses `wrangler.demo.toml` and `.github/workflows/deploy-demo.yml`, with the Worker named `edgechat-demo`. Its GitHub Actions workflow is manual-trigger only and reads `DEMO_CLOUDFLARE_ACCOUNT_ID` and `DEMO_CLOUDFLARE_API_TOKEN`; it does not touch the existing production deployment workflow. +The demo site uses `wrangler.demo.toml` and `.github/workflows/deploy-demo.yml`; the Worker is named `edgechat-demo`. GitHub Actions supports manual triggers only and reads `DEMO_CLOUDFLARE_ACCOUNT_ID` and `DEMO_CLOUDFLARE_API_TOKEN`; it does not change the existing production deployment workflow. -In non-interactive environments, set `CLOUDFLARE_API_TOKEN` before deploying. +When deploying in a non-interactive environment, set `CLOUDFLARE_API_TOKEN` in advance. -The admin update check records the current GitHub repository, branch, and commit at build time. For accurate results, manual deployments should be built inside the Git repository from a clean commit that has already been pushed; the source repository must stay public so the browser can call the GitHub Compare API directly. The whole process creates no scheduled tasks. +The background update check automatically records the current GitHub repository, branch, and commit at build time. For accurate results, manual deployments should be built inside a Git repository from a clean commit that has already been pushed; the source repository must remain public so the browser can call the GitHub Compare API directly. This process does not create a scheduled task. PowerShell example: @@ -270,38 +282,19 @@ npm run deploy ## Project Structure
-Click to expand the directory tree +View the main directories ```text -edgechat/ -├─ assets/ -│ └─ previews/ -│ ├─ chat-home.png -│ └─ admin-dashboard.png -├─ frontend/ -│ ├─ src/ -│ │ ├─ api.js -│ │ ├─ router.js -│ │ ├─ store.js -│ │ ├─ ws.js -│ │ ├─ runtime.js -│ │ ├─ demo/ -│ │ ├─ styles.css -│ │ ├─ components/ui/ -│ │ └─ pages/ -│ ├─ vite.config.js -│ └─ vite.demo.config.js +Edgechat/ +├─ assets/previews/ # Interface previews +├─ frontend/ # Vue frontend and in-browser demo ├─ worker/ -│ ├─ schema.sql -│ ├─ migrations/ -│ └─ src/ -│ ├─ index.js -│ ├─ auth.js -│ ├─ db.js -│ ├─ middleware.js -│ ├─ utils.js -│ ├─ api/ -│ └─ do/ +│ ├─ schema.sql # Database schema +│ ├─ migrations/ # Database migrations +│ └─ src/ # APIs, authentication, and Durable Objects +├─ capacitor/ # Web UI-based Android client +├─ android/ # Temporarily retained native Android client +├─ .github/workflows/ # Automated deployment and CI ├─ wrangler.toml ├─ wrangler.demo.toml ├─ package.json @@ -313,42 +306,38 @@ edgechat/
-For more implementation details, see [TECHNICAL.md](TECHNICAL.md) and the documentation site: +## Community and Contributions -## Contributing +For questions, feature discussions, or to share how you use the project, open an [Issue](https://github.com/aozorae/Edgechat/issues) or join the [Telegram Community](https://t.me/EdgeChatlounge). -Issues and pull requests are welcome — let's improve EdgeChat together. +Code, documentation, translations, and issue reports all help improve the project. Pull Requests are welcome. -Thanks to everyone who has helped the project: +Thanks to everyone who has helped EdgeChat: [![Contributors](https://contrib.rocks/image?repo=aozorae/Edgechat)](https://github.com/aozorae/Edgechat/graphs/contributors) ## Star History - - - - Star History Chart - + + + + Star History Chart + -Give us a star! - ## License -This project is licensed under [`GNU GPL v3.0 or later`](LICENSE). - -You may use, modify, and distribute this project. If you distribute a modified version, you must continue to provide the corresponding source code and keep it GPL-compatible. +This project is licensed under **GNU GPL v3.0 or later**. See [LICENSE](LICENSE). ## Acknowledgements -Thanks to linux do for helping promote this project. +Thanks to [linux do](https://linux.do) for helping promote the project. ## Disclaimer -EdgeChat is a self-hosted open-source project. The project maintainers provide the software only and do not operate, control, or manage any instances users deploy themselves. +EdgeChat is a self-hosted open-source project. The maintainers provide the software itself only; they do not operate, control, or manage any instance deployed by users. -Deployers and users of each instance are solely responsible for how it is deployed and used, and for all content and data produced within it. +Deployers and users are responsible for their deployment methods, usage, and the content and data generated within their instances. -Project maintainers assume no responsibility for the use or misuse of any independently deployed EdgeChat instance. +The project maintainers assume no responsibility for the use or misuse of any independently deployed instance. diff --git a/README.ja.md b/README.ja.md index db07e6d2..e8eb789c 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,23 +1,35 @@ +
+📢 EdgeChat パートナーシップ・広告枠 +
+ +EdgeChat は開発者、Cloudflare ユーザー、セルフホストコミュニティを対象としており、現在 GitHub で 666 Star を獲得しています。README も継続的に多くの方に閲覧されています。 + +製品やサービスが **開発者ツール、クラウドサービス、セルフホストアプリ、オープンソースエコシステム** に関連する場合、README への広告掲載をご検討いただけます。 + +- **Sponsor — $5 / 月** + Sponsors セクションにロゴ、名称、リンクを掲載します。 +- **Featured Sponsor — $10 / 月** + より上位の掲載位置、大きなロゴ、1 行の紹介文をご利用いただけます。 + +読者との関連性を保つため、掲載内容は開発者ツール、クラウドサービス、セルフホスト製品、オープンソースエコシステムに関連するブランドに限定します。 + +掲載をご希望の場合は、[Telegram コミュニティ](https://t.me/EdgeChatlounge)または [Issue](https://github.com/aozorae/Edgechat/issues) からお問い合わせください。 + +
+
EdgeChat -

Cloudflare フルスタックで作られたモダンなチーム向けチャットシステム

-

アカウント体系 · 公開/プライベートグループ · ダイレクトメッセージ · リアルタイムメッセージ · ボイスメッセージ · ファイルアップロード · 管理ダッシュボード

+

自分のチャットスペースを、サーバーの保守から始める必要はありません。

+

Cloudflare を基盤としたオープンソースのセルフホスト型チームチャットシステム

+

リアルタイムのグループチャットとダイレクトメッセージ · Telegram 双方向ブリッジ · 音声とファイル · メッセージと添付ファイルのサーバーサイド暗号化

license stars forks - issues last commit -

-

- Vue 3 Cloudflare Workers - Hono - Durable Objects - GPL-3.0-or-later - Telegram Bridge

@@ -28,67 +40,59 @@ プロジェクトドキュメント · Telegram コミュニティ

- - > ***これは 1,000万人未満のチームに最適な Cloudflare チャットルームかもしれません***

-EdgeChat は Cloudflare 上にデプロイするチーム向けチャットシステムです。アカウント体系、公開グループ、プライベートグループ、ダイレクトメッセージ、リアルタイムメッセージ、ボイスメッセージ、ファイルアップロード、管理ダッシュボードをひととおり揃えています。目標は明確です。Cloudflare エコシステムの中で、できるだけ低い運用コストで、そのまま本番投入できるサイト内 IM を動かすことです。 - -## 最新アップデート - -> **実験的な WebMCP 対応**:EdgeChat は、OpenAI が最近公開した実験的な [Site tools(WebMCP)](https://learn.chatgpt.com/docs/webmcp) 機能にいち早く対応しました。ChatGPT デスクトップアプリの内蔵ブラウザで ChatGPT Work または Codex から EdgeChat を開いてログインすると、AI がサイトのチャットツールを直接検出して呼び出せます。通常のブラウザ、既存 UI、Worker のコアプロトコルには影響しません。 - -| ツール | 機能 | 状態 | -|---|---|---| -| `edgechat.login` | ログインして現在のブラウザセッションを作成 | ✅ | -| `edgechat.list_channels` | ユーザーが閲覧できるグループを取得 | ✅ | -| `edgechat.read_messages` | ルームの最近のメッセージを取得 | ✅ | -| `edgechat.send_message` | 指定したルームへメッセージを送信 | ✅ | -| `edgechat.open_dm` | ユーザーとの DM を検索または開始 | ✅ | +**EdgeChat は Cloudflare 上で動作するオープンソースのチームチャットシステムです。** チーム、プロジェクト、または小さなコミュニティのために独立したチャットスペースを構築できます。議論はグループに、個人的な話はダイレクトメッセージに、音声やファイルも手軽に共有できます。 -ログインツールは既存の認証フローとブラウザの安全確認を利用し、結果にパスワードや session token を含めません。 +常時稼働するサーバーを別途保守する必要はありません。アプリケーションとデータリソースは自分の Cloudflare アカウントにデプロイされ、GitHub Actions によって自動的にデプロイ・更新されます。メンバーがすでに Telegram を使っている場合は、両方のグループを接続し、それぞれ慣れたチャット入口を使い続けることもできます。 -## 目次 - -- [インターフェースプレビュー](#インターフェースプレビュー) -- [オンラインデモ](#オンラインデモ) -- [注目機能:Telegram 双方向メッセージブリッジ](#注目機能telegram-双方向メッセージブリッジ) -- [なぜ EdgeChat なのか](#なぜ-edgechat-なのか) -- [機能](#機能) -- [技術スタック](#技術スタック) -- *[Telegram コミュニティ](#telegram-コミュニティ)* -- [デプロイ](#デプロイ) -- [クイックスタート](#クイックスタート) -- [プロジェクト構成](#プロジェクト構成) -- [コントリビューション](#コントリビューション) -- [Star History](#star-history) -- [ライセンス](#ライセンス) -- [免責事項](#免責事項) +[インターフェースプレビュー](#インターフェースプレビュー) · [オンラインデモ](#オンラインデモ) · [Telegram ブリッジ](#telegram-双方向ブリッジ) · [機能](#機能) · [プライバシーと暗号化](#プライバシーと暗号化) · [デプロイ](#デプロイ) · [ローカル開発](#ローカル開発) ## インターフェースプレビュー - + - - + +
チャット画面管理ダッシュボード管理画面
EdgeChat チャット画面プレビューEdgeChat 管理ダッシュボードプレビューEdgeChat チャット画面のプレビューEdgeChat 管理画面のプレビュー
## オンラインデモ -**[edgechat-demo.wcjxxgaq.workers.dev](https://edgechat-demo.wcjxxgaq.workers.dev)** +**[EdgeChat オンラインデモを開く →](https://edgechat-demo.wcjxxgaq.workers.dev)** + +まず画面を確認してから、デプロイするか決めてください。 + +デモサイトは正式プロジェクトの Vue ページ、ルーティング、状態管理、リアルタイムメッセージ処理を再利用しています。ただし API、WebSocket、ファイルアップロード、Telegram からの転送はすべてブラウザー内のメモリ上でシミュレートされており、実際のバックエンドに接続するマルチユーザーチャットではありません。 + +ページを更新するか、右上の「デモデータをリセット」をクリックすると初期状態に戻ります。デモでの操作が正式 Worker にアクセスしたり、D1、KV、R2 に書き込んだりすることはありません。 + +## EdgeChat を選ぶ理由 + +EdgeChat は、**自分のチャットスペースを持ちたいが、そのためにサーバー、データベース、一式の実行環境を長期的に保守したくない**というニーズに応えます。 + +| 気になること | EdgeChat の方法 | +|---|---| +| デプロイと保守 | Cloudflare Workers を基盤とし、常時稼働サーバーの別途保守は不要。GitHub Actions による自動デプロイに対応 | +| メンバーと管理 | 独立したアカウント、公開・非公開グループ、ダイレクトメッセージ、管理画面を提供 | +| 既存の Telegram グループ | Bot による双方向ブリッジで、両側のメンバーが慣れた入口を使い続けられる | +| 自分で変更・拡張 | ソースコードを公開しており、ニーズに合わせて画面や機能を調整可能 | + +プロジェクト自体は無料のオープンソースです。クラウドサービスの料金は Cloudflare のプラン、リソース構成、実際の使用量によって異なります。 -デモサイトは本番プロジェクトの Vue ページ、ルーティング、状態管理、リアルタイムメッセージのロジックをそのまま再利用していますが、すべての API・WebSocket・ファイルアップロード・Telegram のやり取りはブラウザのメモリ内でシミュレーションされます。ページをリロードするか、右上の「**デモデータをリセット**」をクリックすると初期状態に戻ります。本番 Worker には一切アクセスせず、D1・KV・R2 への書き込みも発生しません。 +## Telegram 双方向ブリッジ -## 注目機能:Telegram 双方向メッセージブリッジ +**全員を同じアプリに移行させる必要はありません。** -管理者は EdgeChat 内の任意のグループを Telegram グループにバインドできます。バインドすると、Telegram Bot 経由で両側のメッセージが**双方向にリアルタイム転送**されます。EdgeChat のメンバーが送信したメッセージは Telegram グループにも表示され、Telegram グループのメッセージも EdgeChat に表示されます。両側のメンバーはあたかも同じグループで会話しているかのように使えるため、アプリを切り替えたりグループを二重に作ったりする必要はまったくありません。 +管理者は EdgeChat のグループと Telegram のグループを紐付け、Telegram Bot を介してメッセージを双方向に転送できます。Web 上で送信したメッセージは Telegram に同期され、Telegram グループのメッセージも EdgeChat に戻ってきます。 + +Telegram グループがすでにあり、同時に独立した Web チャット入口も必要とするチームやコミュニティに適しています。

- リアルタイムでシームレスに転送、双方向同期 + 2 つのチャット入口、1 つの議論。
-## なぜ EdgeChat なのか - -| | EdgeChat | 自前ホスティングの Rocket.Chat / Mattermost | 商用 SaaS IM | -|---|---|---|---| -| デプロイコスト | Cloudflare の無料枠で運用可能 | 常駐サーバー / コンテナが必要 | 人数単位のサブスク課金 | -| 運用負担 | サーバー管理不要、Serverless | データベースやキャッシュを自前で運用 | 運用不要だが制御不能 | -| データの帰属 | 完全に自分の Cloudflare アカウント内 | 完全に自前で保持 | データは第三者に | -| 導入方法 | GitHub Actions でワンクリック自動デプロイ | 手動 / Docker Compose | 登録するだけ | - -> この比較表はあくまで大まかな選定の参考です。実際に合うかどうかはチームの規模やニーズ次第です。Issue での議論・ご指摘をお待ちしています。 - ## 機能 -**💬 メッセージと会話** -- 公開グループ、プライベートグループ、ダイレクトメッセージの会話に対応 -- [Telegram グループ双方向メッセージブリッジ](#注目機能telegram-双方向メッセージブリッジ):1 つの Bot で両側のメンバーをつなぐ -- リアルタイムメッセージ、履歴のページング、Telegram 風ボイスメッセージ、ファイルメッセージ -- ダイレクトメッセージのヘッダーから相手をブロック/解除でき、ブロック中は双方の送信を停止 -- Web では Telegram 風の返信、引用元へのジャンプ、返信を含む「メンション」優先通知に対応 -- Web が前面にある場合、別の会話からのメッセージは Telegram Web 風の右下通知で表示し、現在の会話はメンションまたは返信時のみ通知する。バックグラウンドではブラウザのシステム通知を引き続き使用 -- Web / Android の録音、波形シーク、倍速再生、Telegram voice/audio の双方向同期 -- ファイルアップロードとアバター管理 -- 期限切れメッセージの定期ハード削除に対応 - -**🔐 プライバシーとセキュリティ** -- 新しく書き込まれたメッセージと新しくアップロードされた添付ファイルは AES-256-GCM でサーバー側暗号化。履歴データへの一括バックフィルは行わない -- 管理ダッシュボードにはグループやダイレクトメッセージの本文を閲覧する入口を用意しない -- ユーザーは管理者が作成し、自己登録は開放しない - -**🛠 管理ダッシュボード** -- ダッシュボード、ユーザー管理、登録招待、サイト設定のファーストレベルナビゲーション -- ユーザーを永久停止、または日・時間・分単位で一時停止可能。期限切れ後は定期ジョブなしで自動的に利用可能へ戻る -- ブラウザからソースリポジトリと直接比較し、現在のデプロイに更新があるか確認 - -**🎨 体験** -- モダンな Liquid Glass スタイルのインターフェース -- モバイル対応、基本的なアクセシビリティ対応 +### 💬 チャットと会話 -## 技術スタック +- 公開グループ、非公開グループ、一対一のダイレクトメッセージ。 +- リアルタイムメッセージ、履歴のページング、音声メッセージ、ファイル共有。 +- メッセージへの返信、引用ジャンプ、@ メンションと返信通知。 +- ダイレクトメッセージの連絡先のブロックと解除。ブロック中は双方ともダイレクトメッセージを送信できません。 +- 期限切れメッセージの定期的な完全削除に対応。 -

- frontend - backend -
- realtime - d1 - kv - r2 -
- deploy -

+### 🎨 日常の使いやすさ -## Telegram コミュニティ +- Liquid Glass スタイルのインターフェース。デスクトップとモバイルに対応。 +- 音声録音、波形による進捗表示、再生速度変更。 +- Web フロントエンドでサイト内メッセージ通知を提供。バックグラウンドではブラウザーのシステム通知を利用できますが、ユーザーの許可が必要です。 +- ファイルアップロード、アバター管理、基本的なアクセシビリティ対応。 -[Telegram コミュニティ](https://t.me/EdgeChatlounge) にぜひご参加ください。他のユーザーや開発者と交流し、フィードバックを共有し、プロジェクトの最新情報を受け取れます。 +### 🛠 インスタンス管理 -## デプロイ +- ダッシュボード、ユーザー管理、登録招待、サイト設定。 +- 永久 BAN と、日・時間・分単位の一時 BAN に対応。一時 BAN は期限切れ後に自動復旧し、追加の定期タスクは不要です。 +- ブラウザー上でソースコードリポジトリと直接比較し、現在のデプロイに更新があるか確認。 -### GitHub Actions 自動デプロイ(推奨) +### 🔌 接続と拡張 -GitHub Actions でのデプロイを優先的に推奨します。長期的なメンテナンスと本番環境の更新に適しています。リポジトリには `.github/workflows/deploy-worker.yml` が用意されており、`master` または `main` へのプッシュ、あるいは手動の `workflow_dispatch` トリガーで自動デプロイが実行されます。 +- Telegram グループとの双方向メッセージブリッジ。音声メッセージの同期にも対応。 +- WebMCP サイトツール:対応クライアント環境で、ログイン、会話の検索、メッセージの読み取り・送信などを提供。 -- クイックスタート: -- 詳細チュートリアル: +## プライバシーと暗号化 -### Android クライアント - -現在の Android 向け主要リリースは `capacitor/` クライアントです。APK に Vue Web UI を直接同梱し、システムのファイル選択、通知、マイク権限、通知から会話を開く処理、外部リンクだけを小さな Kotlin ブリッジで実装します。Application ID は `com.aozorae.edgechat.web` で、初回ログイン時に利用者自身の EdgeChat HTTPS サーバー URL を入力するため、特定のデプロイ先には固定されません。 +EdgeChat は**新たに書き込まれるメッセージ本文と新たにアップロードされる添付ファイル**に AES-256-GCM のサーバーサイド保存時暗号化を使用します。履歴の平文データはそのまま保持され、読み取り時には新旧データの両方に対応します。デプロイやバックグラウンドタスクで一括暗号化することはありません。 -- インストール:GitHub Releases から `edgechat-*.apk` を取得し、`SHA256SUMS.txt` を確認 -- 初回利用:ログイン画面で自分の EdgeChat HTTPS サーバー URL、ユーザー名、パスワードを入力 -- ローカルビルド:JDK 21 と Android SDK 36 を用意して `npm run build:capacitor` を実行 -- Debug APK:`capacitor/android/app/build/outputs/apk/debug/app-debug.apk` -- CI:`.github/workflows/capacitor-android-ci.yml` が `edgechat-capacitor-debug` をアップロード -- リリース:`android-v*` タグ、または手動の `Android Release` を使用し、4 つの `ANDROID_KEYSTORE_*` Secret から署名済み APK/AAB を生成 -- サーバー切替:ログアウト後に URL を変更でき、別インスタンスへ切り替えると以前のトークンを削除します -- 制限:現時点では Room オフライン DB、WorkManager Outbox、FCM を含まないため、アプリがメッセージを受信できない間の即時通知は保証しません +管理画面にはグループやダイレクトメッセージの本文を閲覧する入口はありませんが、メッセージ数などの集計統計は確認できます。 -`android/` の Kotlin + Jetpack Compose ネイティブクライアントは一時的に非推奨となり、既定のリリース対象ではありません。ソース、API v1 契約、独立 CI は過去の検証と将来の再評価のため残しますが、新規インストールと通常更新には Capacitor 版を使用してください。 - -詳細: +> [!NOTE] +> **これはサーバーサイド暗号化であり、エンドツーエンド暗号化ではありません。** +> Worker はセッション権限を検証した後に内容を復号します。Cloudflare の実行環境と鍵を管理するデプロイ担当者は、引き続き信頼する必要があります。管理画面にメッセージ閲覧入口がないことは、デプロイ担当者が技術的に内容へアクセスできないことを意味しません。 +> +> Telegram ブリッジを有効にすると、転送されたメッセージも対応する Telegram 会話に入ります。
-🔐 プライバシーとサーバー側暗号化の説明(クリックで展開) +鍵の管理とローテーションについて
-GitHub Actions がサーバー側暗号化の Worker Secrets を管理します。初回デプロイ時に、対象 Worker に暗号化 Secret が存在しない場合、ワークフローがランダムな 32 バイトの AES キーを自動生成し、独立したバージョン管理された Secret として注入して、現在の active key ID を記録します。以降の通常デプロイではこれらの Secret の存在を確認するだけで、再生成・上書き・ローテーションは行いません。本番環境に既存の `EDGECHAT_ENCRYPTION_KEYRING` JSON キーリングもそのまま保持され、引き続き互換性があります。 +GitHub Actions はサーバーサイド暗号化の Worker Secrets を管理します。初回デプロイ時に対象 Worker に暗号化 Secret が存在しない場合、ワークフローはランダムな 32 バイト AES 鍵を自動生成し、独立したバージョン付き Secret として注入し、現在の active key ID を記録します。その後の通常デプロイではこれらの Secret の存在だけを確認し、再生成、上書き、ローテーションは行いません。 -デプロイ後に新しく書き込まれたメッセージ本文と新しくアップロードされた添付ファイルは自動的に暗号化されます。過去の D1 メッセージと R2 添付ファイルはそのまま残り、読み取り時は過去の平文と新しい暗号文の両方に対応します。Cron や定期タスク、デプロイスクリプトで全履歴データを一括暗号化することはありません。 +本番環境にすでに存在する `EDGECHAT_ENCRYPTION_KEYRING` JSON 鍵リングはそのまま保持され、引き続き互換性があります。 -キーを手動で指定する場合は、以下の形式で `EDGECHAT_ENCRYPTION_KEYRING` という名前の GitHub Repository Secret を作成します: +鍵を手動で指定する場合は、`EDGECHAT_ENCRYPTION_KEYRING` という名前の GitHub Repository Secret を作成できます。 ```json {"activeKeyId":"v1","keys":{"v1":"BASE64_ENCODED_32_BYTE_KEY"}} ``` -初回デプロイではこの値がそのまま採用されます。既存の Worker を自動で段階的にローテーションする場合は、`Deploy Worker` を手動で実行し `rotate_encryption_key` にチェックを入れます。ワークフローはバージョン管理されたキー Secret を 1 つ追加して active key ID を新しいバージョンに切り替えるだけで、すべての古い Secret と旧 JSON キーリングは変わりません。新しいメッセージは新しい active key を使用し、古い暗号文は引き続きそれぞれのエンベロープ内の key ID で復号されます。 +初回デプロイではこの値がそのまま採用されます。 + +既存 Worker で自動的に増分ローテーションするには、`Deploy Worker` を手動実行し、`rotate_encryption_key` にチェックを入れます。ワークフローはバージョン付きの鍵 Secret を 1 つだけ追加し、active key ID を新しいバージョンへ切り替えます。すべての旧 Secret と旧 JSON 鍵リングは変更されません。新しいメッセージには新しい鍵を使用し、旧暗号文は各エンベロープの key ID に対応する鍵で復号します。 -`apply_encryption_keyring` は予備の手動上書き用エントリです。使用する場合は、Repository Secret に完全な JSON キーリングが必要で、`keys` には過去の暗号文から参照されている古い key ID をすべて残し、新しい key を追加して `activeKeyId` を更新します。古い key を削除すると、対応する過去の暗号文が永久に読み取れなくなります。`apply_encryption_keyring` と `rotate_encryption_key` を同じ実行で同時に有効にすることはできません。 +`apply_encryption_keyring` は手動で上書きするための予備の入口です。使用時は Repository Secret に完全な JSON 鍵リングを指定し、`keys` に履歴の暗号文から引き続き参照されるすべての旧 key ID を残したうえで、新しい鍵を追加し `activeKeyId` を更新する必要があります。 -これはサーバー側の保存時暗号化であり、エンドツーエンド暗号化ではありません。Worker はセッション権限チェックを通過した後に内容を復号するため、Cloudflare Worker の実行環境とキーを管理するデプロイ側は依然として信頼境界の内側にあります。それに伴うプライバシー調整として、管理ダッシュボードのメッセージ検索と完全な会話閲覧ページおよびその API は削除済みです。管理者は引き続きメッセージ数などの集計統計を確認できます。 +**旧 key を削除すると、対応する履歴の暗号文を永久に読み取れなくなります。** `apply_encryption_keyring` と `rotate_encryption_key` は同じ実行で同時に有効化できません。
-### 手動デプロイ / Docker +## 技術スタック + +| 部分 | 技術 | +|---|---| +| フロントエンド | Vue 3、Vue Router、Vite | +| バックエンド | Cloudflare Workers、Hono | +| リアルタイム通信 | Durable Objects、WebSocket Hibernation | +| データベース | Cloudflare D1 | +| セッションストレージ | Cloudflare KV | +| ファイルストレージ | Cloudflare R2 | +| ビルドとデプロイ | Wrangler、GitHub Actions | + +実装の詳細は [TECHNICAL.md](TECHNICAL.md) を参照してください。 + +## デプロイ + +### GitHub Actions による自動デプロイ + +デプロイとその後の更新には、リポジトリに組み込まれた GitHub Actions ワークフローの利用を推奨します。 + +ドキュメントに従って Cloudflare の認証とリポジトリ設定を完了すると、`Deploy Worker` を手動実行できます。また、`master` または `main` ブランチにコードをプッシュしてデプロイをトリガーすることもできます。ワークフローファイルは `.github/workflows/deploy-worker.yml` です。 + +**[クイックスタート](https://echat.azora.top/guide/getting-started.html) · [GitHub Actions デプロイチュートリアル](https://echat.azora.top/guide/actions-deploy.html)** + +### 手動デプロイと Docker + +ローカル手動デプロイのリソース準備、設定方法、注意事項は [デプロイドキュメント](https://echat.azora.top/guide/getting-started.html) を参照してください。 + +Docker の説明は [DOCKER.md](DOCKER.md) を参照してください。 + +### Android クライアント
-手動デプロイと Docker の説明をクリックして展開 +クライアント、インストール、ビルドの説明を見る
-ローカルで手動デプロイしたい場合は、手順・リソース準備・注意事項の詳細をドキュメントサイトでご覧ください: +`capacitor/` クライアントは APK に Vue Web UI を内蔵し、少量の Kotlin コードでシステムのファイル選択、通知、マイク権限、通知からの会話移動、外部リンクに接続します。パッケージ名は `com.aozorae.edgechat.web` で、初回ログイン時に自分の EdgeChat HTTPS サービスアドレスを入力します。特定のデプロイには紐付きません。 + +- インストールパッケージ:[GitHub Releases](https://github.com/aozorae/Edgechat/releases) から `edgechat-*.apk` をダウンロードし、`SHA256SUMS.txt` を確認。 +- 初回利用:自分の EdgeChat HTTPS サービスアドレス、アカウント、パスワードを入力。 +- ローカルビルド:JDK 21 と Android SDK 36 を準備し、`npm run build:capacitor` を実行。 +- Debug APK:`capacitor/android/app/build/outputs/apk/debug/app-debug.apk`。 +- CI:`.github/workflows/capacitor-android-ci.yml` が `edgechat-capacitor-debug` をアップロード。 +- リリース:`android-v*` タグをプッシュするか `Android Release` を手動実行し、4 つの `ANDROID_KEYSTORE_*` Secrets で署名済み APK/AAB をビルド。 +- サービス切り替え:ログアウト後にアドレスを変更できます。インスタンス切り替え時には旧インスタンスのトークンを自動消去します。 + +現在、Room オフラインデータベース、WorkManager Outbox、FCM は含まれていません。アプリが停止してメッセージを受信できない場合、バックグラウンドでの即時通知は保証されません。 -- 手動デプロイチュートリアル: -- ドキュメントトップ: -- Docker ローカルデプロイ:[DOCKER.md](DOCKER.md) +ネイティブ `android/` Kotlin + Jetpack Compose クライアントは一時的に廃止され、既定のリリース版ではありません。ソース、API v1 契約、独立した CI は一時的に保持しています。 + +詳細は [Android クライアントドキュメント](https://echat.azora.top/guide/android.html) を参照してください。
-## クイックスタート +## ローカル開発 ```bash -# 依存関係のインストール +# ソースコードを取得 +git clone https://github.com/aozorae/Edgechat.git +cd Edgechat + +# 依存関係をインストール npm install +# クラウドリソースを先にデプロイせず、フロントエンドのみのデモを起動 +npm run dev:demo +``` + +実際のバックエンドに接続して開発またはデプロイする前に、ドキュメントに従って対応する Cloudflare リソースと設定を準備してください。 + +```bash # フロントエンド開発 npm run dev:frontend -# フロントエンドのみのデモ(独立したポートとビルドディレクトリ) -npm run dev:demo - # ローカルビルド npm run build -# ローカル手動デプロイ +# ローカル手動リリース npm run deploy ```
-その他のスクリプトの説明(demo ビルド / デプロイ、CI 環境変数) +デモサイトのビルド、デプロイ、CI 環境変数
```bash -# demo を独立ビルド +# デモサイトを独立してビルド npm run build:demo -# 独立した demo Worker をデプロイ +# 独立したデモ Worker をデプロイ npm run deploy:demo ``` -demo は `wrangler.demo.toml` と `.github/workflows/deploy-demo.yml` を使用し、Worker 名は `edgechat-demo` です。GitHub Actions は手動トリガーのみ対応で、`DEMO_CLOUDFLARE_ACCOUNT_ID` と `DEMO_CLOUDFLARE_API_TOKEN` を読み取ります。既存の本番デプロイワークフローは変更されません。 +デモサイトは `wrangler.demo.toml` と `.github/workflows/deploy-demo.yml` を使用し、Worker 名は `edgechat-demo` です。GitHub Actions は手動トリガーのみをサポートし、`DEMO_CLOUDFLARE_ACCOUNT_ID`、`DEMO_CLOUDFLARE_API_TOKEN` を読み取ります。既存の本番デプロイワークフローは変更しません。 -非対話環境でデプロイする場合は、事前に `CLOUDFLARE_API_TOKEN` を設定する必要があります。 +非対話環境でデプロイする場合は、あらかじめ `CLOUDFLARE_API_TOKEN` を設定してください。 -管理画面の更新チェックは、ビルド時に現在の GitHub リポジトリ・ブランチ・コミットを自動記録します。正確な結果を得るには、手動デプロイは Git リポジトリ内で、すでにプッシュ済みのクリーンなコミットを基にビルドしてください。ブラウザから GitHub Compare API を直接呼び出せるよう、ソースリポジトリは公開のままにする必要があります。このプロセスで定期タスクが作成されることはありません。 +管理画面の更新チェックは、ビルド時に現在の GitHub リポジトリ、ブランチ、コミットを自動記録します。正確な結果を得るには、手動デプロイを、すでにプッシュされたクリーンなコミットに基づく Git リポジトリ内で実行してください。ソースコードリポジトリは公開状態である必要があり、ブラウザーが GitHub Compare API を直接呼び出せます。この処理で定期タスクが作成されることはありません。 PowerShell の例: @@ -270,38 +282,19 @@ npm run deploy ## プロジェクト構成
-ディレクトリツリーをクリックして展開 +主要ディレクトリを見る ```text -edgechat/ -├─ assets/ -│ └─ previews/ -│ ├─ chat-home.png -│ └─ admin-dashboard.png -├─ frontend/ -│ ├─ src/ -│ │ ├─ api.js -│ │ ├─ router.js -│ │ ├─ store.js -│ │ ├─ ws.js -│ │ ├─ runtime.js -│ │ ├─ demo/ -│ │ ├─ styles.css -│ │ ├─ components/ui/ -│ │ └─ pages/ -│ ├─ vite.config.js -│ └─ vite.demo.config.js +Edgechat/ +├─ assets/previews/ # インターフェースプレビュー +├─ frontend/ # Vue フロントエンドとブラウザー内デモ ├─ worker/ -│ ├─ schema.sql -│ ├─ migrations/ -│ └─ src/ -│ ├─ index.js -│ ├─ auth.js -│ ├─ db.js -│ ├─ middleware.js -│ ├─ utils.js -│ ├─ api/ -│ └─ do/ +│ ├─ schema.sql # データベーススキーマ +│ ├─ migrations/ # データベースマイグレーション +│ └─ src/ # API、認証、Durable Objects +├─ capacitor/ # Web UI ベースの Android クライアント +├─ android/ # 一時的に保持されるネイティブ Android クライアント +├─ .github/workflows/ # 自動デプロイと CI ├─ wrangler.toml ├─ wrangler.demo.toml ├─ package.json @@ -313,42 +306,38 @@ edgechat/
-実装の詳細は [TECHNICAL.md](TECHNICAL.md) とドキュメントサイトをご覧ください: +## 交流と貢献 -## コントリビューション +問題がある場合、機能について議論したい場合、または独自の使い方を共有したい場合は、[Issue](https://github.com/aozorae/Edgechat/issues) を提出してください。[Telegram コミュニティ](https://t.me/EdgeChatlounge) への参加も歓迎します。 -Issue と Pull Request を歓迎します。EdgeChat を一緒に育てていきましょう。 +コード、ドキュメント、翻訳、フィードバックはすべてプロジェクトの改善に役立ちます。Pull Request を歓迎します。 -プロジェクトに貢献してくださったすべての皆様に感謝します: +EdgeChat を支援してくださったすべての貢献者に感謝します: -[![Contributors](https://contrib.rocks/image?repo=aozorae/Edgechat)](https://github.com/aozorae/Edgechat/graphs/contributors) +[![貢献者](https://contrib.rocks/image?repo=aozorae/Edgechat)](https://github.com/aozorae/Edgechat/graphs/contributors) ## Star History - - - - Star History Chart - + + + + Star History Chart + -スターをよろしくお願いします! - ## ライセンス -このプロジェクトは [`GNU GPL v3.0 or later`](LICENSE) を採用しています。 - -本プロジェクトの使用・変更・再配布は自由です。変更版を再配布する場合は、対応するソースコードを引き続き提供し、GPL 互換を維持する必要があります。 +本プロジェクトは **GNU GPL v3.0 or later** を採用しています。詳細は [LICENSE](LICENSE) を参照してください。 ## 謝辞 -linux do による本プロジェクトのプロモーションへの貢献に感謝します。 +プロジェクトの普及にご協力くださった [linux do](https://linux.do) に感謝します。 ## 免責事項 -EdgeChat はセルフホスト型のオープンソースプロジェクトです。プロジェクトのメンテナーはソフトウェアのみを提供しており、ユーザーが自身でデプロイしたいかなるインスタンスについても、運営、管理、または統制を行いません。 +EdgeChat はセルフホスト型のオープンソースプロジェクトです。プロジェクトメンテナーはソフトウェア自体のみを提供し、ユーザーが自分でデプロイしたインスタンスの運用、管理、制御は行いません。 -各インスタンスのデプロイ者および利用者は、そのデプロイ方法、利用行為、ならびにそこで生じるコンテンツとデータについて、自ら責任を負うものとします。 +インスタンスのデプロイ担当者と利用者は、デプロイ方法、利用行為、そこで生成されるコンテンツとデータについて自ら責任を負うものとします。 -プロジェクトのメンテナーは、独立してデプロイされたインスタンスの利用または不正利用について責任を負いません。 +プロジェクトメンテナーは、個別にデプロイされたインスタンスの利用または悪用について責任を負いません。 diff --git a/README.md b/README.md index 37e62801..130e3ed5 100644 --- a/README.md +++ b/README.md @@ -1,72 +1,54 @@ +
+📢 EdgeChat 合作与广告位 +
+ +EdgeChat 面向开发者、Cloudflare 用户及自托管社区,目前 GitHub 已有 666 Star,README 长期保持较高曝光。 + +如果你的产品或服务面向 **开发者工具、云服务、自托管应用或开源生态**,可以考虑在 README 中投放展示位: + +- **Sponsor — $5 / 月** + 在 Sponsors 区域展示 Logo、名称及跳转链接。 +- **Featured Sponsor — $10 / 月** + 更靠前的展示位置,更大尺寸 Logo,附一句话简介。 + +投放内容仅限与开发者工具、云服务、自托管产品、开源生态相关的品牌,以保证读者体验的相关性。 + +如需投放,欢迎通过 [Telegram 社区](https://t.me/EdgeChatlounge)或提交 [Issue](https://github.com/aozorae/Edgechat/issues) 联系洽谈。 + +
+
EdgeChat -

基于 Cloudflare 全家桶打造的现代团队聊天系统

-

账号体系 · 公开/私有群组 · 私信 · 实时消息 · 语音消息 · 文件上传 · 管理后台

+

自己的聊天空间,不必从维护服务器开始。

+

基于 Cloudflare 的开源自部署团队聊天系统

+

实时群聊与私信 · Telegram 双向桥接 · 语音与文件 · 消息与附件服务端加密

license stars forks - issues last commit -

-

- Vue 3 Cloudflare Workers - Hono - Durable Objects - GPL-3.0-or-later - Telegram Bridge

中文 · English · 日本語 · - 在线 Demo · + 在线演示 · 项目文档 · Telegram 社区

- - > ***这可能是 1000 万人以下最好用的 Cloudflare 聊天室***

-EdgeChat 是一个部署在 Cloudflare 上的团队聊天系统:账号体系、公开群组、私有群组、私信、实时消息、语音消息、文件上传、管理员后台一应俱全。目标很直接——在 Cloudflare 生态里,用尽量低的运维成本,跑起一套能直接落地使用的站内 IM。 - -## 最近更新 - -> [!IMPORTANT] -> **实验性 WebMCP 支持**:EdgeChat 已率先接入 OpenAI 最近推出的实验性 [Site tools(WebMCP)](https://learn.chatgpt.com/docs/webmcp) 能力。在 ChatGPT 桌面应用的内置浏览器中使用 ChatGPT Work 或 Codex 打开并登录 EdgeChat 后,AI 可以直接发现并调用站点提供的聊天工具。 +**EdgeChat 是一个运行在 Cloudflare 上的开源团队聊天系统。** 你可以用它为团队、项目或小圈子搭建一个独立的聊天空间:讨论放进群组,私事留给私信,语音和文件也能随手分享。 -| 工具 | 功能 | 状态 | -|---|---|---| -| `edgechat.login` | 登录并建立当前浏览器会话 | ✅ | -| `edgechat.list_channels` | 查询用户可见群聊 | ✅ | -| `edgechat.read_messages` | 获取某聊天室最近消息 | ✅ | -| `edgechat.send_message` | 向指定房间发送消息 | ✅ | -| `edgechat.open_dm` | 找到或打开与某人的私聊 | ✅ | +它不需要你另外维护一台常驻服务器。应用与数据资源部署在你自己的 Cloudflare 账号下,通过 GitHub Actions 自动部署和更新。如果成员已经在使用 Telegram,也可以把两侧群组连接起来,继续使用各自习惯的聊天入口。 -登录工具沿用现有认证与浏览器安全确认,工具结果不会返回密码或 session token。 - -## 目录 - -- [界面预览](#界面预览) -- [在线 Demo](#在线-demo) -- [特色功能:Telegram 消息双向桥接](#特色功能telegram-消息双向桥接) -- [为什么是 EdgeChat](#为什么是-edgechat) -- [功能特性](#功能特性) -- [技术栈](#技术栈) -- *[Telegram 社区](#telegram-社区)* -- [部署](#部署) -- [快速开始](#快速开始) -- [项目结构](#项目结构) -- [贡献](#贡献) -- [Star History](#star-history) -- [协议说明](#协议说明) -- [免责声明](#免责声明) +[界面预览](#界面预览) · [在线演示](#在线演示) · [Telegram 桥接](#telegram-双向桥接) · [功能特性](#功能特性) · [隐私与加密](#隐私与加密) · [部署](#部署) · [本地开发](#本地开发) ## 界面预览 @@ -81,15 +63,36 @@ EdgeChat 是一个部署在 Cloudflare 上的团队聊天系统:账号体系 -## 在线 Demo +## 在线演示 + +**[打开 EdgeChat 在线演示 →](https://edgechat-demo.wcjxxgaq.workers.dev)** + +先看看界面,再决定是否部署。 + +演示站复用正式项目的 Vue 页面、路由、状态管理和实时消息逻辑,但 API、WebSocket、文件上传与 Telegram 回流均在浏览器内存中模拟,不是连接真实后端的多人聊天室。 -**[edgechat-demo.wcjxxgaq.workers.dev](https://edgechat-demo.wcjxxgaq.workers.dev)** +刷新页面或点击右上角「重置演示数据」即可恢复初始状态。演示操作不会访问正式 Worker,也不会写入 D1、KV 或 R2。 -演示站复用正式项目的 Vue 页面、路由、状态管理和实时消息逻辑,但所有 API、WebSocket、文件上传与 Telegram 回流都在浏览器内存中模拟。刷新页面或点击右上角「重置演示数据」即可恢复初始状态,不会访问正式 Worker,也不会写入 D1、KV 或 R2。 +## 为什么是 EdgeChat + +EdgeChat 面向这样一种需求:**想拥有一个自己的聊天空间,又不想为此长期维护服务器、数据库和一整套运行环境。** + +| 你关心的事情 | EdgeChat 的做法 | +|---|---| +| 部署和维护 | 基于 Cloudflare Workers,无需另行维护常驻服务器;支持 GitHub Actions 自动部署 | +| 成员与管理 | 提供独立账号、公开与私有群组、私信和管理后台 | +| 已有的 Telegram 群 | 通过 Bot 双向桥接,让两侧成员继续使用各自习惯的入口 | +| 自己修改与扩展 | 源码开放,可以按自己的需求调整界面和功能 | + +项目本身免费开源。云服务费用取决于 Cloudflare 的套餐、资源配置和实际用量。 + +## Telegram 双向桥接 -## 特色功能:Telegram 消息双向桥接 +**不用把所有人都搬进同一个应用。** -管理员可以把 EdgeChat 内的任意一个群组,与一个 Telegram 群组绑定。绑定后,通过 Telegram Bot,两侧的消息会**双向实时转发**——EdgeChat 成员发的消息会同步出现在 Telegram 群里,Telegram 群里的消息也会同步出现在 EdgeChat 里,两边成员就像在同一个群里聊天一样,完全不需要互相切换应用或重复建群。 +管理员可以将 EdgeChat 群组与 Telegram 群组绑定,通过 Telegram Bot 双向转发消息:在网页里发出的消息可以同步到 Telegram,Telegram 群里的消息也会回到 EdgeChat。 + +适合已经有 Telegram 群、同时又需要一个独立网页聊天入口的团队和社区。

- 实时无缝转发,双向同步 + 两个聊天入口,同一段讨论。
-## 为什么是 EdgeChat - -| | EdgeChat | 自建 Rocket.Chat / Mattermost | 商业 SaaS IM | -|---|---|---|---| -| 部署成本 | Cloudflare 免费额度内可跑 | 需要常驻服务器 / 容器 | 按人头订阅收费 | -| 运维负担 | 无需管理服务器,Serverless | 需要自行运维数据库、缓存 | 无需运维,但不可控 | -| 数据归属 | 完全在自己的 Cloudflare 账号 | 完全自持 | 数据在第三方 | -| 上线方式 | GitHub Actions 一键自动部署 | 手动 / Docker Compose | 直接注册 | - -> 这张对比表只是给出一个大致的选型参考,实际是否合适取决于你的团队规模和需求,欢迎在 Issue 里讨论指正。 - ## 功能特性 -**💬 消息与会话** -- 支持公开群组、私有群组与私信会话 -- [Telegram 群组双向消息桥接](#特色功能telegram-消息双向桥接),一个 Bot 打通两侧成员 -- 实时消息、历史消息分页、Telegram 风格语音消息与文件消息 -- 可在私信顶部拉黑或解除拉黑联系人,拉黑期间双方均无法继续发送私信 -- 网页支持 Telegram 风格消息回复、引用跳转,以及将回复纳入「有人@我」优先提醒 -- 网页前台收到其他会话消息时显示 Telegram Web 风格右下角通知;当前会话仅为 @提及或回复提示,网页后台继续使用浏览器系统通知 -- 网页和 Android 均支持录音、波形进度、倍速播放;Telegram voice/audio 可双向同步 -- 文件上传与头像管理 -- 支持定时硬删除过期消息 - -**🔐 隐私与安全** -- 新写入的消息与新上传的附件使用 AES-256-GCM 服务端加密,历史数据不做批量回填 -- 管理员后台不提供群组或私信消息正文的查看入口 -- 管理员创建用户,不开放自助注册 - -**🛠 管理后台** -- 仪表盘、用户管理、注册邀请、网站设置一级导航 -- 用户支持永久封禁,或按天、小时、分钟设置临时封禁;到期后无需定时任务即可自动恢复 -- 浏览器端直接比对源码仓库,检查当前部署是否有更新 - -**🎨 体验** -- 现代化 Liquid Glass 风格界面 -- 适配移动端,支持基础无障碍能力 +### 💬 聊天与会话 -## 技术栈 - -

- frontend - backend -
- realtime - d1 - kv - r2 -
- deploy -

- -## Telegram 社区 +- 公开群组、私有群组和一对一私信。 +- 实时消息、历史消息分页、语音消息与文件分享。 +- 消息回复、引用跳转、@ 提及与回复提醒。 +- 私信联系人拉黑与解除拉黑;拉黑期间双方均无法继续发送私信。 +- 支持定时硬删除过期消息。 -欢迎加入我们的 [Telegram 社区](https://t.me/EdgeChatlounge),与其他用户和开发者交流讨论、反馈问题,第一时间获取项目动态。 +### 🎨 日常使用体验 -## 部署 +- Liquid Glass 风格界面,适配桌面和移动端。 +- 语音录制、波形进度与倍速播放。 +- 网页前台提供站内消息通知;后台可使用浏览器系统通知,需要用户授权。 +- 文件上传、头像管理与基础无障碍支持。 -### GitHub Actions 自动部署(推荐) +### 🛠 实例管理 -推荐优先使用 GitHub Actions 部署,适合长期维护和生产环境更新。仓库内已提供 `.github/workflows/deploy-worker.yml`,推送到 `master` 或 `main`,或手动触发 `workflow_dispatch` 即可执行自动部署。 +- 仪表盘、用户管理、注册邀请与网站设置。 +- 支持永久封禁和按天、小时、分钟设置临时封禁;临时封禁到期后自动恢复,无需额外定时任务。 +- 在浏览器端直接比对源码仓库,检查当前部署是否有更新。 -- 快速开始: -- 详细教程: +### 🔌 连接与扩展 -### Android 客户端 +- Telegram 群组双向消息桥接,支持语音消息同步。 +- WebMCP 站点工具:在兼容的客户端环境中,提供登录、查询会话、读取与发送消息等能力。 -当前主要发行版是 `capacitor/` 客户端:APK 直接内置 Vue Web UI,以少量 Kotlin 对接系统文件选择、通知、麦克风权限、通知会话跳转和外部链接。它使用包名 `com.aozorae.edgechat.web`,首次登录时由用户填写自己的 EdgeChat HTTPS 服务地址,不绑定固定部署。 +## 隐私与加密 -- 安装包:从 GitHub Releases 下载 `edgechat-*.apk` 并核对 `SHA256SUMS.txt` -- 首次使用:登录页填写自己的 EdgeChat HTTPS 服务地址、账号和密码 -- 本地构建:准备 JDK 21 与 Android SDK 36 后运行 `npm run build:capacitor` -- Debug APK:`capacitor/android/app/build/outputs/apk/debug/app-debug.apk` -- CI:`.github/workflows/capacitor-android-ci.yml` 上传 `edgechat-capacitor-debug` -- 发布:推送 `android-v*` 标签或手动运行 `Android Release`,使用四个 `ANDROID_KEYSTORE_*` Secrets 构建签名 APK/AAB -- 服务切换:退出登录后可修改地址;切换实例时自动清理旧实例令牌 -- 限制:当前不包含 Room 离线数据库、WorkManager Outbox 或 FCM,应用停止接收消息时不承诺后台即时通知 +EdgeChat 对**新写入的消息正文和新上传的附件**使用 AES-256-GCM 服务端静态加密。历史明文数据保持原状,读取时兼容新旧数据,不会在部署或后台任务中批量回填加密。 -原生 `android/` Kotlin + Jetpack Compose 客户端暂时弃用,不再作为默认发行版。源码、API v1 契约和独立 CI 暂时保留,供历史验证与后续评估;新安装与日常更新请使用 Capacitor 版本。 +管理员后台不提供群组或私信消息正文的查看入口,仍可查看消息数量等聚合统计。 -完整说明: +> [!NOTE] +> **这是服务端加密,不是端到端加密。** +> Worker 在通过会话权限校验后解密内容,Cloudflare 运行环境和掌握密钥的部署方仍需要被信任。后台没有消息查看入口,不代表部署者在技术上无法访问内容。 +> +> 开启 Telegram 桥接后,被转发的消息也会进入对应的 Telegram 会话。
-🔐 隐私与服务端加密说明(点击展开) +密钥管理与轮换说明
-GitHub Actions 会管理服务端加密 Worker Secrets。首次部署时,如果目标 Worker 尚无加密 Secret,工作流会自动生成随机 32 字节 AES 密钥,以独立的版本化 Secret 注入,并记录当前 active key ID;后续普通部署只检查这些 Secret 是否存在,不会重新生成、覆盖或轮换。生产环境已经存在的 `EDGECHAT_ENCRYPTION_KEYRING` JSON 密钥环也会被原样保留并继续兼容。 +GitHub Actions 会管理服务端加密 Worker Secrets。首次部署时,如果目标 Worker 尚无加密 Secret,工作流会自动生成随机 32 字节 AES 密钥,以独立的版本化 Secret 注入,并记录当前 active key ID。后续普通部署只检查这些 Secret 是否存在,不会重新生成、覆盖或轮换。 -部署后新写入的消息正文和新上传的附件会自动加密。历史 D1 消息和 R2 附件保持原状,读取时同时兼容历史明文与新密文;项目不会通过 Cron、定时任务或部署脚本循环加密全部历史数据。 +生产环境已经存在的 `EDGECHAT_ENCRYPTION_KEYRING` JSON 密钥环会被原样保留并继续兼容。 -需要手动指定密钥时,可创建名为 `EDGECHAT_ENCRYPTION_KEYRING` 的 GitHub Repository Secret,格式如下: +需要手动指定密钥时,可创建名为 `EDGECHAT_ENCRYPTION_KEYRING` 的 GitHub Repository Secret: ```json {"activeKeyId":"v1","keys":{"v1":"BASE64_ENCODED_32_BYTE_KEY"}} ``` -首次部署会直接采用该值。已有 Worker 需要自动增量轮换时,手动运行 `Deploy Worker` 并勾选 `rotate_encryption_key`:工作流只新增一个版本化密钥 Secret,并把 active key ID 切换到新版本,所有旧 Secret 和旧 JSON 密钥环都保持不变。新消息会使用新 active key,旧密文继续使用各自信封中的 key ID 解密。 +首次部署会直接采用该值。 + +已有 Worker 需要自动增量轮换时,手动运行 `Deploy Worker` 并勾选 `rotate_encryption_key`。工作流只新增一个版本化密钥 Secret,并把 active key ID 切换到新版本;所有旧 Secret 和旧 JSON 密钥环都保持不变。新消息使用新密钥,旧密文继续使用各自信封中的 key ID 解密。 -`apply_encryption_keyring` 是备用的手动覆盖入口。使用它时,Repository Secret 中必须是完整 JSON 密钥环,`keys` 需要保留所有仍被历史密文引用的旧 key ID,再增加新 key 并更新 `activeKeyId`。删除旧 key 会导致对应历史密文永久无法读取。`apply_encryption_keyring` 与 `rotate_encryption_key` 不能在同一次运行中同时启用。 +`apply_encryption_keyring` 是备用的手动覆盖入口。使用时,Repository Secret 中必须是完整 JSON 密钥环,`keys` 需要保留所有仍被历史密文引用的旧 key ID,再增加新 key 并更新 `activeKeyId`。 -这属于服务端静态加密,不是端到端加密。Worker 会在通过会话权限校验后解密内容,因此 Cloudflare Worker 运行环境和掌握密钥的部署方仍位于信任边界内。作为配套隐私调整,管理员后台的消息搜索与完整会话查看页面及其 API 已移除;管理员仍可看到消息数量等聚合统计。 +**删除旧 key 会导致对应历史密文永久无法读取。** `apply_encryption_keyring` 与 `rotate_encryption_key` 不能在同一次运行中同时启用。
-### 手动部署 / Docker +## 技术栈 + +| 部分 | 技术 | +|---|---| +| 前端 | Vue 3、Vue Router、Vite | +| 后端 | Cloudflare Workers、Hono | +| 实时通信 | Durable Objects、WebSocket Hibernation | +| 数据库 | Cloudflare D1 | +| 会话存储 | Cloudflare KV | +| 文件存储 | Cloudflare R2 | +| 构建与部署 | Wrangler、GitHub Actions | + +更多实现说明见 [TECHNICAL.md](TECHNICAL.md)。 + +## 部署 + +### GitHub Actions 自动部署 + +推荐使用仓库内置的 GitHub Actions 工作流进行部署和后续更新。 + +按照文档完成 Cloudflare 授权与仓库配置后,可以手动运行 `Deploy Worker`,也可以通过向 `master` 或 `main` 分支推送代码触发部署。工作流文件为 `.github/workflows/deploy-worker.yml`。 + +**[快速开始](https://echat.azora.top/guide/getting-started.html) · [GitHub Actions 部署教程](https://echat.azora.top/guide/actions-deploy.html)** + +### 手动部署与 Docker + +本地手动部署的资源准备、配置方法和注意事项见 [部署文档](https://echat.azora.top/guide/getting-started.html)。 + +Docker 相关说明见 [DOCKER.md](DOCKER.md)。 + +### Android 客户端
-点击展开手动部署与 Docker 说明 +查看客户端、安装与构建说明
-如果你希望本地手动部署,完整步骤、资源准备和注意事项请查看文档站教程: +`capacitor/` 客户端的 APK 内置 Vue Web UI,并通过少量 Kotlin 对接系统文件选择、通知、麦克风权限、通知会话跳转和外部链接。包名为 `com.aozorae.edgechat.web`,首次登录时填写自己的 EdgeChat HTTPS 服务地址,不绑定固定部署。 + +- 安装包:从 [GitHub Releases](https://github.com/aozorae/Edgechat/releases) 下载 `edgechat-*.apk`,并核对 `SHA256SUMS.txt`。 +- 首次使用:填写自己的 EdgeChat HTTPS 服务地址、账号和密码。 +- 本地构建:准备 JDK 21 与 Android SDK 36 后,运行 `npm run build:capacitor`。 +- Debug APK:`capacitor/android/app/build/outputs/apk/debug/app-debug.apk`。 +- CI:`.github/workflows/capacitor-android-ci.yml` 上传 `edgechat-capacitor-debug`。 +- 发布:推送 `android-v*` 标签或手动运行 `Android Release`,使用四个 `ANDROID_KEYSTORE_*` Secrets 构建签名 APK/AAB。 +- 服务切换:退出登录后可以修改地址;切换实例时自动清理旧实例令牌。 + +当前不包含 Room 离线数据库、WorkManager Outbox 或 FCM;应用停止接收消息时,不承诺后台即时通知。 + +原生 `android/` Kotlin + Jetpack Compose 客户端暂时弃用,不再作为默认发行版。源码、API v1 契约与独立 CI 暂时保留。 -- 手动部署教程: -- 文档首页: -- Docker 本地部署:[DOCKER.md](DOCKER.md) +完整说明见 [Android 客户端文档](https://echat.azora.top/guide/android.html)。
-## 快速开始 +## 本地开发 ```bash +# 获取源码 +git clone https://github.com/aozorae/Edgechat.git +cd Edgechat + # 安装依赖 npm install +# 启动纯前端演示,无需先部署云端资源 +npm run dev:demo +``` + +连接实际后端进行开发或部署前,请先按照文档准备对应的 Cloudflare 资源与配置。 + +```bash # 前端开发 npm run dev:frontend -# 纯前端 demo(独立端口和构建目录) -npm run dev:demo - # 本地构建 npm run build @@ -241,19 +252,19 @@ npm run deploy ```
-更多脚本说明(demo 构建 / 部署、CI 环境变量) +演示站构建、部署与 CI 环境变量
```bash -# 独立构建 demo +# 独立构建演示站 npm run build:demo -# 部署独立 demo Worker +# 部署独立演示 Worker npm run deploy:demo ``` -demo 使用 `wrangler.demo.toml` 和 `.github/workflows/deploy-demo.yml`,Worker 名称为 `edgechat-demo`。GitHub Actions 仅支持手动触发,并读取 `DEMO_CLOUDFLARE_ACCOUNT_ID`、`DEMO_CLOUDFLARE_API_TOKEN`,不会改变现有生产部署工作流。 +演示站使用 `wrangler.demo.toml` 和 `.github/workflows/deploy-demo.yml`,Worker 名称为 `edgechat-demo`。GitHub Actions 仅支持手动触发,并读取 `DEMO_CLOUDFLARE_ACCOUNT_ID`、`DEMO_CLOUDFLARE_API_TOKEN`,不会改变现有生产部署工作流。 在非交互环境下部署时,需要提前设置 `CLOUDFLARE_API_TOKEN`。 @@ -271,38 +282,19 @@ npm run deploy ## 项目结构
-点击展开目录树 +查看主要目录 ```text -edgechat/ -├─ assets/ -│ └─ previews/ -│ ├─ chat-home.png -│ └─ admin-dashboard.png -├─ frontend/ -│ ├─ src/ -│ │ ├─ api.js -│ │ ├─ router.js -│ │ ├─ store.js -│ │ ├─ ws.js -│ │ ├─ runtime.js -│ │ ├─ demo/ -│ │ ├─ styles.css -│ │ ├─ components/ui/ -│ │ └─ pages/ -│ ├─ vite.config.js -│ └─ vite.demo.config.js +Edgechat/ +├─ assets/previews/ # 界面预览 +├─ frontend/ # Vue 前端与浏览器内演示 ├─ worker/ -│ ├─ schema.sql -│ ├─ migrations/ -│ └─ src/ -│ ├─ index.js -│ ├─ auth.js -│ ├─ db.js -│ ├─ middleware.js -│ ├─ utils.js -│ ├─ api/ -│ └─ do/ +│ ├─ schema.sql # 数据库结构 +│ ├─ migrations/ # 数据库迁移 +│ └─ src/ # API、认证与 Durable Objects +├─ capacitor/ # 基于 Web UI 的 Android 客户端 +├─ android/ # 暂时保留的原生 Android 客户端 +├─ .github/workflows/ # 自动部署与 CI ├─ wrangler.toml ├─ wrangler.demo.toml ├─ package.json @@ -314,13 +306,13 @@ edgechat/
-更多实现说明可查看 [TECHNICAL.md](TECHNICAL.md) 和文档站: +## 交流与贡献 -## 贡献 +遇到问题、想讨论功能,或者有自己的使用方式,欢迎提交 [Issue](https://github.com/aozorae/Edgechat/issues),也欢迎加入 [Telegram 社区](https://t.me/EdgeChatlounge)。 -欢迎提交 Issue 和 Pull Request,一起完善 EdgeChat。 +代码、文档、翻译与问题反馈都可以帮助项目继续完善。欢迎提交 Pull Request。 -感谢所有为项目提供帮助的贡献者: +感谢所有为 EdgeChat 提供帮助的贡献者: [![贡献者](https://contrib.rocks/image?repo=aozorae/Edgechat)](https://github.com/aozorae/Edgechat/graphs/contributors) @@ -334,17 +326,41 @@ edgechat/ -[![Typing SVG](https://readme-typing-svg.demolab.com?font=Fira+Code&size=24&duration=2500&pause=1000&color=F7D747&width=435&lines=%E2%AD%90+star+%E7%82%B9%E8%B5%B7%E6%9D%A5%EF%BC%81)](https://git.io/typing-svg) - ## 协议说明 -本项目采用 [`GNU GPL v3.0 or later`](LICENSE)。 - -你可以使用、修改和分发本项目;如果你分发修改版本,需要继续提供对应源代码,并保持 GPL 兼容。 +本项目采用 **GNU GPL v3.0 or later**,详见 [LICENSE](LICENSE)。 ## 鸣谢 -感谢 linux do 在推广方面为本项目做出的贡献。 +
+ +### ✨ 特别鸣谢 + + + + + + +
+ +VenLac + + + +**[VenLac](https://github.com/VenLac)**(Venlacy) + +[![GitHub](https://img.shields.io/badge/GitHub-VenLac-181717?style=flat-square&logo=github)](https://github.com/VenLac) + +项目早期贡献了大量核心代码,为 EdgeChat 的整体架构奠定了基础; +同时凭借自身在社区中的影响力,为项目推广做出了突出贡献。让更多开发者认识并使用了 EdgeChat。 + +
+ +
+ +
+ +感谢 [linux do](https://linux.do) 在推广方面为本项目做出的贡献。 ## 免责声明 diff --git a/frontend/src/App.vue b/frontend/src/App.vue index d2ebf47d..a7479eed 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -9,7 +9,7 @@ const DemoNavigator = globalThis.__EDGECHAT_DEMO__