Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/scripts/d1-migration-manifest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,32 @@ export const D1_MIGRATIONS = [
file: "worker/migrations/2026-08-20-user-ban-expiry.sql",
artifacts: ["column:users.disabled_until"],
},
{
id: "2026-08-30-mobile-client-v1",
file: "worker/migrations/2026-08-30-mobile-client-v1.sql",
artifacts: [
"column:messages.client_message_id",
"column:uploaded_files.client_upload_id",
"table:device_sessions",
"table:realtime_tickets",
"table:message_events",
"index:idx_messages_client_message",
"index:idx_uploaded_files_client_upload",
"index:idx_device_sessions_refresh_token",
"index:idx_device_sessions_user_installation_active",
"index:idx_device_sessions_user_active",
"index:idx_realtime_tickets_expiry",
"index:idx_message_events_channel_sequence",
"trigger:record_message_created_event",
"trigger:record_message_deleted_event",
],
},
{
id: "2026-08-30-native-client-hardening",
file: "worker/migrations/2026-08-30-native-client-hardening.sql",
artifacts: [
"index:idx_messages_channel_client_message",
"table:message_event_compaction",
],
},
];
55 changes: 55 additions & 0 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Android CI
on:
push:
branches: [master, main]
paths:
- "android/**"
- "docs/api/**"
- "worker/src/api/v1.js"
- "worker/src/mobile-session.js"
- "worker/src/realtime-tickets.js"
- "worker/migrations/2026-08-30-mobile-client-v1.sql"
- "worker/schema.sql"
- ".github/workflows/android-ci.yml"
pull_request:
paths:
- "android/**"
- "docs/api/**"
- "worker/src/api/v1.js"
- "worker/src/mobile-session.js"
- "worker/src/realtime-tickets.js"
- "worker/migrations/2026-08-30-mobile-client-v1.sql"
- "worker/schema.sql"
- ".github/workflows/android-ci.yml"
workflow_dispatch:

concurrency:
group: android-ci-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Test, lint and build debug APK
working-directory: android
run: ./gradlew testDebugUnitTest lintDebug assembleDebug --stacktrace
- name: Upload debug APK
uses: actions/upload-artifact@v4
with:
name: edgechat-debug
path: android/app/build/outputs/apk/debug/app-debug.apk
if-no-files-found: error
115 changes: 115 additions & 0 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Android Release
on:
push:
tags:
- "android-v*"
workflow_dispatch:
inputs:
version:
description: Version without the android-v prefix
required: true
type: string
prerelease:
description: Publish as a prerelease
required: true
default: true
type: boolean

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Resolve release version
id: version
shell: bash
env:
INPUT_VERSION: ${{ inputs.version }}
run: |
if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then
version="${GITHUB_REF_NAME#android-v}"
tag="$GITHUB_REF_NAME"
else
version="$INPUT_VERSION"
tag="android-v${INPUT_VERSION}"
fi
[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- name: Configure release signing
shell: bash
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
run: |
for name in ANDROID_KEYSTORE_BASE64 ANDROID_KEYSTORE_PASSWORD ANDROID_KEY_ALIAS ANDROID_KEY_PASSWORD; do
test -n "${!name}"
done
printf '%s' "$ANDROID_KEYSTORE_BASE64" | base64 --decode > android/release.keystore
cat > android/signing.properties <<EOF
storeFile=release.keystore
storePassword=$ANDROID_KEYSTORE_PASSWORD
keyAlias=$ANDROID_KEY_ALIAS
keyPassword=$ANDROID_KEY_PASSWORD
EOF
- name: Test, lint and build signed artifacts
working-directory: android
run: >-
./gradlew testDebugUnitTest lintRelease assembleRelease bundleRelease
-PedgechatVersionName=${{ steps.version.outputs.version }}
-PedgechatVersionCode=${{ github.run_number }}
--stacktrace
- name: Prepare checksums
shell: bash
run: |
mkdir -p android/release-artifacts
cp android/app/build/outputs/apk/release/app-release.apk android/release-artifacts/edgechat-${{ steps.version.outputs.version }}.apk
cp android/app/build/outputs/bundle/release/app-release.aab android/release-artifacts/edgechat-${{ steps.version.outputs.version }}.aab
cd android/release-artifacts
sha256sum *.apk *.aab > SHA256SUMS.txt
- name: Verify APK signature
shell: bash
run: |
apksigner_path="$(find "$ANDROID_HOME/build-tools" -type f -name apksigner | sort -V | tail -n 1)"
test -n "$apksigner_path"
"$apksigner_path" verify --verbose --print-certs android/release-artifacts/*.apk
jarsigner -verify -strict android/release-artifacts/*.aab
- name: Publish GitHub Release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ steps.version.outputs.tag }}
PRERELEASE: ${{ github.event_name == 'workflow_dispatch' && inputs.prerelease || contains(steps.version.outputs.version, '-') }}
run: |
prerelease_flag=""
if [[ "$PRERELEASE" == "true" ]]; then prerelease_flag="--prerelease"; fi
if ! git rev-parse "$RELEASE_TAG" >/dev/null 2>&1; then
git tag "$RELEASE_TAG" "$GITHUB_SHA"
git push origin "$RELEASE_TAG"
fi
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
gh release upload "$RELEASE_TAG" android/release-artifacts/* --clobber
else
gh release create "$RELEASE_TAG" android/release-artifacts/* \
--title "EdgeChat Android ${{ steps.version.outputs.version }}" \
--generate-notes $prerelease_flag
fi
- name: Remove signing material
if: always()
run: rm -f android/release.keystore android/signing.properties
4 changes: 2 additions & 2 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: "20"
cache: npm
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/deploy-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ on:
branches:
- master
- main
paths:
- "worker/**"
- "frontend/**"
- "test/**"
- ".github/scripts/**"
- ".github/workflows/deploy-worker.yml"
- "package.json"
- "package-lock.json"
- "biome.json"
- "wrangler.example.toml"
workflow_dispatch:
inputs:
apply_encryption_keyring:
Expand All @@ -26,9 +36,9 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: "20"
cache: npm
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ frontend/dist/
frontend/demo-dist/
.playwright-cli/
.tmp/

# Android local/build outputs
android/.gradle/
android/**/build/
android/local.properties
android/signing.properties
android/*.jks
android/*.keystore
11 changes: 11 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ GitHub Actions deployment is recommended first — it suits long-term maintenanc
- Quick start: <https://echat.azora.top/guide/getting-started.html>
- Detailed guide: <https://echat.azora.top/guide/actions-deploy.html>

### Native Android Client

The repository's `android/` directory is an independent Kotlin + Jetpack Compose client for Android 8 / API 26 and newer. It depends only on the stable `/api/v1` contract and never packages Vue components or CSS. On first launch, paste a valid HTTPS server origin or open `edgechat://connect?server=https%3A%2F%2Fchat.example.com`; the app validates server capabilities before sign-in.

- Installation: download `edgechat-*.apk` from GitHub Releases and verify `SHA256SUMS.txt`
- CI: `.github/workflows/android-ci.yml` runs unit tests, Lint, and a Debug APK build
- Release: push an `android-v*` tag or run `Android Release` manually after configuring `ANDROID_KEYSTORE_BASE64`, `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS`, and `ANDROID_KEY_PASSWORD`
- Limitation: the first release has no FCM. WebSockets close in the background and incremental sync catches up after returning to the foreground, so background instant notifications are not promised

Full guide: <https://echat.azora.top/en/guide/android.html>

<details>
<summary><strong>🔐 Privacy & Server-Side Encryption (click to expand)</strong></summary>

Expand Down
11 changes: 11 additions & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ GitHub Actions でのデプロイを優先的に推奨します。長期的な
- クイックスタート:<https://echat.azora.top/guide/getting-started.html>
- 詳細チュートリアル:<https://echat.azora.top/guide/actions-deploy.html>

### ネイティブ Android クライアント

リポジトリの `android/` は Android 8 / API 26 以降向けの独立した Kotlin + Jetpack Compose クライアントです。安定した `/api/v1` 契約だけを共有し、Vue コンポーネントや CSS は APK に含めません。初回起動時に有効な HTTPS サーバー URL を入力するか、`edgechat://connect?server=https%3A%2F%2Fchat.example.com` を開くと、ログイン前にサーバー機能を確認します。

- インストール:GitHub Releases から `edgechat-*.apk` を取得し、`SHA256SUMS.txt` を確認
- CI:`.github/workflows/android-ci.yml` が単体テスト、Lint、Debug APK ビルドを実行
- リリース:`android-v*` タグ、または手動の `Android Release` を使用し、4 つの `ANDROID_KEYSTORE_*` Secret を設定
- 制限:初版は FCM 非対応です。バックグラウンドでは WebSocket を閉じ、フォアグラウンド復帰時に差分同期するため、バックグラウンド即時通知は保証しません

詳細:<https://echat.azora.top/en/guide/android.html>

<details>
<summary><strong>🔐 プライバシーとサーバー側暗号化の説明(クリックで展開)</strong></summary>

Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ EdgeChat 是一个部署在 Cloudflare 上的团队聊天系统:账号体系
- 快速开始:<https://echat.azora.top/guide/getting-started.html>
- 详细教程:<https://echat.azora.top/guide/actions-deploy.html>

### 原生 Android 客户端

仓库内的 `android/` 是独立的 Kotlin + Jetpack Compose 客户端(Android 8 / API 26 起),只依赖稳定的 `/api/v1` 协议,不复用网页组件或 CSS。首次启动粘贴有效 HTTPS 服务器地址,或打开 `edgechat://connect?server=https%3A%2F%2Fchat.example.com`,客户端会先校验服务器能力再登录。

- 安装包:从 GitHub Releases 下载 `edgechat-*.apk` 并核对 `SHA256SUMS.txt`
- CI:`.github/workflows/android-ci.yml` 运行单元测试、Lint 和 Debug APK 构建
- 发布:推送 `android-v*` 标签或手动运行 `Android Release`,需要配置 `ANDROID_KEYSTORE_BASE64`、`ANDROID_KEYSTORE_PASSWORD`、`ANDROID_KEY_ALIAS`、`ANDROID_KEY_PASSWORD`
- 限制:首版不接入 FCM,应用进入后台后会关闭 WebSocket;恢复前台时通过增量同步补齐消息,不承诺后台即时通知

完整说明:<https://echat.azora.top/guide/android.html>

<details>
<summary><strong>🔐 隐私与服务端加密说明(点击展开)</strong></summary>

Expand Down
Loading
Loading