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
2 changes: 1 addition & 1 deletion README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Capturas de una instalación aislada de Doca 0.3.0 con la interfaz y los documen
Necesitas Docker Engine, Docker Compose y una dirección HTTP(S) para el sitio. Descarga el archivo Compose, configura `DOCA_ORIGIN` y genera una clave maestra de credenciales exclusiva antes de arrancar. El primer arranque inicializa la cuenta de administración.

```sh
curl -fL https://github.com/workhold/doca/releases/download/v0.3.1/doca-compose-v0.3.1.yaml -o compose.yaml
curl -fL https://github.com/workhold/doca/releases/download/v0.3.2/doca-compose-v0.3.2.yaml -o compose.yaml
```

```sh
Expand Down
2 changes: 1 addition & 1 deletion README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Captures réalisées dans une instance isolée de Doca 0.3.0. L’interface et l
Prévoyez Docker Engine, Docker Compose et une URL HTTP(S) pour le site. Téléchargez le fichier Compose, renseignez `DOCA_ORIGIN` et générez une clé maîtresse dédiée pour les identifiants avant de démarrer. Le premier démarrage initialise le compte administrateur.

```sh
curl -fL https://github.com/workhold/doca/releases/download/v0.3.1/doca-compose-v0.3.1.yaml -o compose.yaml
curl -fL https://github.com/workhold/doca/releases/download/v0.3.2/doca-compose-v0.3.2.yaml -o compose.yaml
```

```sh
Expand Down
2 changes: 1 addition & 1 deletion README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Doca は、個人や小規模チーム向けのオープンソースのドキュ
Docker Engine、Docker Compose、サイトを公開する HTTP(S) の URL を用意します。Compose ファイルをダウンロードし、`DOCA_ORIGIN` と専用に生成した資格情報用のマスターキーを設定してから起動します。初回起動時に管理者が初期化されます。

```sh
curl -fL https://github.com/workhold/doca/releases/download/v0.3.1/doca-compose-v0.3.1.yaml -o compose.yaml
curl -fL https://github.com/workhold/doca/releases/download/v0.3.2/doca-compose-v0.3.2.yaml -o compose.yaml
```

```sh
Expand Down
2 changes: 1 addition & 1 deletion README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Doca는 개인과 소규모 팀을 위한 오픈 소스 문서 및 지식 관리
Docker Engine, Docker Compose 및 사이트의 HTTP(S) 주소를 준비합니다. Compose 파일을 내려받고 `DOCA_ORIGIN`과 새로 생성한 자격 증명용 마스터 키를 설정한 뒤 실행합니다. 처음 실행할 때 관리자 계정이 초기화됩니다.

```sh
curl -fL https://github.com/workhold/doca/releases/download/v0.3.1/doca-compose-v0.3.1.yaml -o compose.yaml
curl -fL https://github.com/workhold/doca/releases/download/v0.3.2/doca-compose-v0.3.2.yaml -o compose.yaml
```

```sh
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ Installers are available from [GitHub Releases](https://github.com/workhold/doca

## Quick start with Docker

Requires Docker Engine, Docker Compose, and an HTTP(S) origin served by a reverse proxy. A fresh SQLite/local-storage installation needs only one YAML file: no Git, no source checkout, no seccomp JSON, and no external initialization scripts. Existing installations must read the [release requirements](https://workhold.github.io/doca/#/en/releases/0.3.1) and retain their project name, volumes, databases, attachments and master key.
Requires Docker Engine, Docker Compose, and an HTTP(S) origin served by a reverse proxy. A fresh SQLite/local-storage installation needs only one YAML file: no Git, no source checkout, no seccomp JSON, and no external initialization scripts. Existing installations must read the [release requirements](https://workhold.github.io/doca/#/en/releases/0.3.2) and retain their project name, volumes, databases, attachments and master key.

```sh
# 1. Download the standalone configuration into a permanent deployment directory
mkdir doca && cd doca
curl -fL https://github.com/workhold/doca/releases/download/v0.3.1/doca-compose-v0.3.1.yaml -o compose.yaml
curl -fL https://github.com/workhold/doca/releases/download/v0.3.2/doca-compose-v0.3.2.yaml -o compose.yaml

# 2. Generate the master key with openssl rand -hex 32
# Edit compose.yaml: fill in DOCA_ORIGIN and DOCA_CREDENTIAL_MASTER_KEY
Expand Down Expand Up @@ -168,7 +168,7 @@ Open `http://127.0.0.1:39130`. Initialize the administrator with `bash scripts/b
- [Deployment and configuration](https://workhold.github.io/doca/#/en/operations/deployment)
- [Plugin development](https://workhold.github.io/doca/#/en/plugins/plugin-development)
- [HTTP API](https://workhold.github.io/doca/#/en/reference/api); the running application also provides `/api/openapi.json`.
- [Release notes](https://workhold.github.io/doca/#/en/releases/0.3.1)
- [Release notes](https://workhold.github.io/doca/#/en/releases/0.3.2)
- [Documentation source](docs/README.md)

For a documentation preview, run `pnpm docs:dev` and open `http://127.0.0.1:39140/#/en/`. `pnpm docs:check` verifies language editions and local links. See the GitHub Pages setup in [documentation maintenance](docs/documentation.md).
Expand Down
2 changes: 1 addition & 1 deletion README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Doca — рабочее пространство с открытым исход
Подготовьте Docker Engine, Docker Compose и адрес сайта по HTTP(S). Скачайте файл Compose, задайте `DOCA_ORIGIN` и сгенерируйте отдельный мастер-ключ учётных данных. Затем запустите сервис. Учётная запись администратора инициализируется при первом запуске.

```sh
curl -fL https://github.com/workhold/doca/releases/download/v0.3.1/doca-compose-v0.3.1.yaml -o compose.yaml
curl -fL https://github.com/workhold/doca/releases/download/v0.3.2/doca-compose-v0.3.2.yaml -o compose.yaml
```

```sh
Expand Down
6 changes: 3 additions & 3 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ Doca 桌面客户端(Windows、macOS)连接你部署的 Doca 服务:工作

## Docker 快速开始

需要 Docker Engine、Docker Compose,以及通过反向代理访问的 HTTP(S) 地址。全新 SQLite/本地存储安装只需一个 YAML,无需 Git、源码、seccomp JSON 或外部初始化脚本。已有部署更换版本前,先阅读[发行要求](https://workhold.github.io/doca/#/zh-cn/releases/0.3.1),保留原项目名、持久卷、数据库、附件和主密钥。
需要 Docker Engine、Docker Compose,以及通过反向代理访问的 HTTP(S) 地址。全新 SQLite/本地存储安装只需一个 YAML,无需 Git、源码、seccomp JSON 或外部初始化脚本。已有部署更换版本前,先阅读[发行要求](https://workhold.github.io/doca/#/zh-cn/releases/0.3.2),保留原项目名、持久卷、数据库、附件和主密钥。

```sh
# 1. 在固定部署目录下载单文件配置
mkdir doca && cd doca
curl -fL https://github.com/workhold/doca/releases/download/v0.3.1/doca-compose-v0.3.1.yaml -o compose.yaml
curl -fL https://github.com/workhold/doca/releases/download/v0.3.2/doca-compose-v0.3.2.yaml -o compose.yaml

# 2. 用 openssl rand -hex 32 生成主密钥
# 编辑 compose.yaml,填写 DOCA_ORIGIN 和 DOCA_CREDENTIAL_MASTER_KEY
Expand Down Expand Up @@ -166,7 +166,7 @@ pnpm dev
- [部署与配置](https://workhold.github.io/doca/#/zh-cn/operations/deployment)
- [插件开发](https://workhold.github.io/doca/#/zh-cn/plugins/plugin-development)
- [HTTP API](https://workhold.github.io/doca/#/zh-cn/reference/api),运行中的应用还提供 `/api/openapi.json`。
- [发行记录](https://workhold.github.io/doca/#/zh-cn/releases/0.3.1)
- [发行记录](https://workhold.github.io/doca/#/zh-cn/releases/0.3.2)
- [文档源码](docs/README.zh-CN.md)

预览文档时,执行 `pnpm docs:dev` 并打开 `http://127.0.0.1:39140/#/zh-cn/`。`pnpm docs:check` 校验语言版本和本地链接。GitHub Pages 设置见[文档维护](docs/documentation.zh-CN.md)。
Expand Down
2 changes: 1 addition & 1 deletion README.zh-Hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Doca 是面向個人和小型團隊的開放原始碼文件與知識管理工作
請準備 Docker Engine、Docker Compose 以及網站的 HTTP(S) 公開位址。下載 Compose 檔案,填寫 `DOCA_ORIGIN` 並產生專用的憑證主金鑰,再啟動服務。首次啟動會初始化管理員。

```sh
curl -fL https://github.com/workhold/doca/releases/download/v0.3.1/doca-compose-v0.3.1.yaml -o compose.yaml
curl -fL https://github.com/workhold/doca/releases/download/v0.3.2/doca-compose-v0.3.2.yaml -o compose.yaml
```

```sh
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@doca/desktop",
"version": "0.3.3",
"version": "0.3.4",
"license": "MIT",
"private": true,
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "doca-desktop"
version = "0.3.3"
version = "0.3.4"
description = "Doca desktop client"
authors = ["Doca"]
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Doca",
"version": "0.3.3",
"version": "0.3.4",
"identifier": "com.smartdoca.desktop",
"build": {
"beforeDevCommand": "pnpm exec vite --host 127.0.0.1 --port 1420 --strictPort",
Expand Down
12 changes: 8 additions & 4 deletions apps/mobile/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
"name": "Doca",
"slug": "zhangxiaojia",
"scheme": "doca",
"version": "0.1.0",
"version": "0.1.1",
"orientation": "portrait",
"userInterfaceStyle": "light",
"developmentClient": {
"silentLaunch": true
},
"newArchEnabled": true,
"ios": {
"supportsTablet": true,
Expand All @@ -14,11 +17,12 @@
"NSAppTransportSecurity": {
"NSAllowsArbitraryLoads": true
},
"NSCameraUsageDescription": "允许 Doca 扫描网页登录二维码。"
"NSCameraUsageDescription": "允许 Doca 扫描网页登录二维码或拍照上传。"
}
},
"android": {
"package": "app.doca.mobile",
"versionCode": 2,
"usesCleartextTraffic": true,
"adaptiveIcon": {
"backgroundColor": "#f7f4ee"
Expand All @@ -36,13 +40,13 @@
"expo-image-picker",
{
"photosPermission": "允许 Doca 读取相册,以便上传图片。",
"cameraPermission": "允许 Doca 拍摄图片,以便发送给 AI 助手。"
"cameraPermission": "允许 Doca 拍摄图片,以便上传或发送给 AI 助手。"
}
],
[
"expo-camera",
{
"cameraPermission": "允许 Doca 扫描网页登录二维码。"
"cameraPermission": "允许 Doca 扫描网页登录二维码或拍照上传。"
}
]
],
Expand Down
145 changes: 96 additions & 49 deletions apps/mobile/app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,68 +1,115 @@
import { MobileNavigationArea } from "../../src/plugins/navigation";
import { Tabs } from "expo-router";
import { BookOpen, FolderOpen, Home, Sparkles } from "lucide-react-native";
import { Tabs, useRouter, useSegments } from "expo-router";
import { BookOpen, MessageSquare, Sparkles, UserRound } from "lucide-react-native";
import { useEffect, useState } from "react";
import { Keyboard, Platform, Pressable, StyleSheet, Text, View } from "react-native";
import { IconButton } from "react-native-paper";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { useAppDrawer } from "../../src/app-drawer";
import { useAuth } from "../../src/auth";
import { colors } from "../../src/chrome";
import { useI18n } from "../../src/locale";
import {
mobilePluginMessage,
mobilePluginRegistry,
} from "../../src/plugins/registry";
import { MobileNavigationArea } from "../../src/plugins/navigation";
import { mobilePluginMessage, mobilePluginRegistry } from "../../src/plugins/registry";

const homeToolbarExclusions = ["doca.search"];

export default function TabsLayout() {
const drawer = useAppDrawer();
const { locale } = useI18n();
const librariesTab =
mobilePluginRegistry.tabs.getByConflictKey("libraries");
const [keyboardVisible, setKeyboardVisible] = useState(false);
const isAi = useSegments().includes("ai");
const { locale, t } = useI18n();
const { session } = useAuth();
const router = useRouter();
const insets = useSafeAreaInsets();
const libraryTab = mobilePluginRegistry.tabs.getByConflictKey("libraries");
const filesTab = mobilePluginRegistry.tabs.getByConflictKey("files");
const avatar = session?.name.trim().slice(0, 1);
useEffect(() => {
const showing = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow", () => setKeyboardVisible(true));
const hiding = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide", () => setKeyboardVisible(false));
return () => {
showing.remove();
hiding.remove();
};
}, []);

function headerRight(home = false, showHistory = false) {
return (
<View style={styles.headerActions}>
<MobileNavigationArea slot="mobile.topRight" horizontal exclude={home ? homeToolbarExclusions : undefined} />
{showHistory ? (
<Pressable accessibilityRole="button" accessibilityLabel={t("chat.sessionList")} style={styles.headerButton} onPress={drawer.open}>
<MessageSquare size={20} color={colors.secondary} />
</Pressable>
) : null}
<Pressable accessibilityRole="button" accessibilityLabel={t("mobile.me.title")} onPress={() => router.push("/me")} style={styles.headerButton}>
<View style={styles.avatar}>
{avatar ? <Text style={styles.avatarText}>{avatar}</Text> : <UserRound size={18} color={colors.accent} />}
</View>
</Pressable>
</View>
);
}

return (
<Tabs
tabBar={() => null}
tabBar={() => drawer.hasBrowseRail || (isAi && keyboardVisible) ? null : (
<View style={[styles.tabBar, { paddingBottom: Math.max(insets.bottom, 6) }]}>
<MobileNavigationArea slot="mobile.bottom" horizontal />
</View>
)}
screenOptions={{
headerTitleAlign: "left",
headerTintColor: colors.ink,
headerStyle: { backgroundColor: "#fff" },
headerStyle: { backgroundColor: colors.card },
headerShadowVisible: false,
sceneStyle: { backgroundColor: colors.bg },
tabBarActiveTintColor: colors.accent,
tabBarInactiveTintColor: colors.muted,
tabBarStyle: { backgroundColor: "#fff", borderTopColor: colors.lineSoft },
headerRight: () => <MobileNavigationArea slot="mobile.topRight" horizontal />,
headerLeft: () => <IconButton icon="menu" onPress={drawer.open} />,
headerRight: () => headerRight(),
headerLeft: drawer.hasBrowseRail
? () => <IconButton icon="menu" accessibilityLabel={t("navigation.more")} onPress={drawer.open} />
: undefined,
}}
>
<Tabs.Screen
name="index"
options={{
title: "首页",
tabBarIcon: ({ color, size }) => <Home color={color} size={size} />,
}}
/>
<Tabs.Screen
name="libraries"
options={{
title: librariesTab
? mobilePluginMessage(locale, librariesTab.labelKey)
: "知识库",
tabBarIcon: ({ color, size }) => <BookOpen color={color} size={size} />,
}}
/>
<Tabs.Screen
name="files"
options={{
title: filesTab
? mobilePluginMessage(locale, filesTab.labelKey)
: "文件",
tabBarIcon: ({ color, size }) => <FolderOpen color={color} size={size} />,
}}
/>
<Tabs.Screen
name="ai"
options={{
title: "AI",
tabBarIcon: ({ color, size }) => <Sparkles color={color} size={size} />,
}}
/>
<Tabs.Screen name="index" options={{
title: t("mobile.home.title"),
headerTitle: () => (
<View style={styles.brand}>
<View style={styles.brandMark}><BookOpen size={21} color={colors.onAccent} /></View>
<View style={styles.brandCopy}>
<Text style={styles.brandName}>Doca</Text>
{session ? <Text numberOfLines={1} style={styles.brandOrigin}>{session.origin.replace(/^https?:\/\//, "")}</Text> : null}
</View>
</View>
),
headerRight: () => headerRight(true),
}} />
<Tabs.Screen name="libraries" options={{ title: libraryTab ? mobilePluginMessage(locale, libraryTab.labelKey) : t("nav.libraries") }} />
<Tabs.Screen name="files" options={{ title: filesTab ? mobilePluginMessage(locale, filesTab.labelKey) : t("search.files") }} />
<Tabs.Screen name="ai" options={{
title: t("nav.assistant"),
headerTitle: () => (
<View style={styles.brand}>
<View style={styles.assistantMark}><Sparkles size={18} color={colors.assistantInk} /></View>
<Text style={styles.assistantTitle} numberOfLines={1}>{t("nav.assistant")}</Text>
</View>
),
headerRight: () => headerRight(false, true),
}} />
</Tabs>
);
}

const styles = StyleSheet.create({
tabBar: { backgroundColor: colors.card, borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: colors.line, paddingTop: 3, paddingHorizontal: 8 },
headerActions: { flexDirection: "row", alignItems: "center", marginRight: 8 },
headerButton: { minWidth: 46, minHeight: 46, justifyContent: "center", alignItems: "center" },
avatar: { width: 35, height: 35, borderRadius: 18, backgroundColor: colors.selected, alignItems: "center", justifyContent: "center" },
avatarText: { color: colors.accent, fontSize: 15, fontWeight: "700" },
brand: { flexDirection: "row", alignItems: "center", gap: 9 },
brandMark: { width: 37, height: 37, borderRadius: 10, borderCurve: "continuous", backgroundColor: colors.accent, alignItems: "center", justifyContent: "center" },
brandCopy: { minWidth: 0 },
brandName: { color: colors.ink, fontSize: 22, fontWeight: "800", letterSpacing: -0.6 },
brandOrigin: { color: colors.secondary, fontSize: 11 },
assistantMark: { width: 32, height: 32, borderRadius: 9, borderCurve: "continuous", backgroundColor: colors.assistantSoft, alignItems: "center", justifyContent: "center" },
assistantTitle: { color: colors.ink, fontSize: 17, fontWeight: "700", flexShrink: 1 },
});
Loading
Loading