diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a095fa9c..78bc29da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,41 @@ jobs: echo "Skip GitHub Release for $GITHUB_REF_NAME. Official tags look like v1.2.3." fi + native: + needs: official + if: needs.official.outputs.release == 'true' + permissions: + contents: read + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + runner: ubuntu-24.04 + - arch: arm64 + runner: ubuntu-24.04-arm + runs-on: ${{ matrix.runner }} + timeout-minutes: 40 + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - name: Export the native Linux runtime + env: + ARCH: ${{ matrix.arch }} + run: | + docker buildx build --platform "linux/$ARCH" --target native-distribution \ + --output type=local,dest=artifacts/native-payload . + bash scripts/pack-native-release.sh artifacts/native-payload artifacts/native-release "$ARCH" + - name: Smoke test the archive on Debian 12 + env: + ARCH: ${{ matrix.arch }} + run: bash scripts/qa-native-release.sh "artifacts/native-release/doca-linux-$ARCH-$GITHUB_REF_NAME.tar.gz" "$ARCH" "$GITHUB_REF_NAME" + - uses: actions/upload-artifact@v4 + with: + name: native-release-${{ matrix.arch }} + path: artifacts/native-release/ + if-no-files-found: error + release: needs: official if: needs.official.outputs.release == 'true' @@ -79,6 +114,7 @@ jobs: echo "Image-only deployment files and initialization instructions are attached as doca-deploy-${GITHUB_REF_NAME}.tar.gz with a SHA-256 checksum." echo "The built plugin SDK and its SHA-256 checksum are also attached for rebuilding plugins against this release's public contract; this does not publish an npm package." echo "Transfer this bundle to servers without GitHub access; no source checkout is needed." + echo "Native Debian 12 release assets are attached by the Linux build jobs after their smoke tests pass. See the deployment guide for the install command." echo "The container image is separate. Pull the matching smartdoca/doca image or transfer it with docker save/load." echo @@ -87,3 +123,25 @@ jobs: --title "$GITHUB_REF_NAME" \ --verify-tag \ --notes-file "$notes" + + native-assets: + needs: [release, native] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + pattern: native-release-* + path: artifacts/native-release + - name: Publish both native bundles and their installer + env: + GH_TOKEN: ${{ github.token }} + run: | + amd64="artifacts/native-release/native-release-amd64" + arm64="artifacts/native-release/native-release-arm64" + cmp "$amd64/doca-install.sh" "$arm64/doca-install.sh" + gh release upload "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --clobber \ + "$amd64/doca-linux-amd64-$GITHUB_REF_NAME.tar.gz" \ + "$amd64/doca-linux-amd64-$GITHUB_REF_NAME.tar.gz.sha256" \ + "$arm64/doca-linux-arm64-$GITHUB_REF_NAME.tar.gz" \ + "$arm64/doca-linux-arm64-$GITHUB_REF_NAME.tar.gz.sha256" + gh release upload "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --clobber "$amd64/doca-install.sh" diff --git a/Dockerfile b/Dockerfile index 2301714c..2358307b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,10 +47,24 @@ COPY packages ./packages COPY docker/prune-runtime-modules.mjs docker/prune-runtime-build-inputs.mjs docker/split-runtime-modules.mjs docker/split-runtime-web.mjs ./docker/ RUN pnpm build \ && node docker/prune-runtime-modules.mjs --apply /app \ - && node docker/prune-runtime-build-inputs.mjs --apply /app \ - && node docker/split-runtime-modules.mjs /app \ + && node docker/prune-runtime-build-inputs.mjs --apply /app + +FROM build AS container-layers +RUN node docker/split-runtime-modules.mjs /app \ && node docker/split-runtime-web.mjs /app +# Export with buildx --target native-distribution --output type=local. +FROM scratch AS native-distribution +COPY --from=build /usr/local/bin/node /bin/node +COPY --from=build /usr/local/LICENSE /LICENSE.node +COPY --from=build /app/package.json /app/tsconfig.json /app/ +COPY --from=build /app/node_modules /app/node_modules +COPY --from=build /app/packages /app/packages +COPY --from=build /app/apps/server /app/apps/server +COPY --from=build /app/apps/browser-extension /app/apps/browser-extension +COPY --from=build /app/apps/web/dist /app/apps/web/dist +COPY LICENSE docker/pdf-requirements.txt docker/doca.service / + FROM ${NODE_IMAGE} AS render-runtime WORKDIR /app @@ -91,44 +105,44 @@ FROM render-runtime AS runtime # AI's SQLite file defaults to ai.db alongside DOCA_SQLITE_PATH. # Supply the browser-facing HTTP(S) DOCA_ORIGIN at runtime, behind a proxy. COPY --link --from=build /app/package.json /app/tsconfig.json ./ -COPY --link --from=build /app/artifacts/runtime-layers/common/node_modules ./node_modules -COPY --link --from=build /app/artifacts/runtime-layers/canvas/node_modules ./node_modules -COPY --link --from=build /app/artifacts/runtime-layers/markdown/node_modules ./node_modules -COPY --link --from=build /app/artifacts/runtime-layers/sheet/node_modules ./node_modules -COPY --link --from=build /app/artifacts/runtime-layers/slate/node_modules ./node_modules -COPY --link --from=build /app/artifacts/runtime-layers/slides/node_modules ./node_modules -COPY --link --from=build /app/artifacts/runtime-layers/metadata/node_modules ./node_modules +COPY --link --from=container-layers /app/artifacts/runtime-layers/common/node_modules ./node_modules +COPY --link --from=container-layers /app/artifacts/runtime-layers/canvas/node_modules ./node_modules +COPY --link --from=container-layers /app/artifacts/runtime-layers/markdown/node_modules ./node_modules +COPY --link --from=container-layers /app/artifacts/runtime-layers/sheet/node_modules ./node_modules +COPY --link --from=container-layers /app/artifacts/runtime-layers/slate/node_modules ./node_modules +COPY --link --from=container-layers /app/artifacts/runtime-layers/slides/node_modules ./node_modules +COPY --link --from=container-layers /app/artifacts/runtime-layers/metadata/node_modules ./node_modules COPY --link --from=build /app/packages ./packages COPY --link --from=build /app/apps/server ./apps/server COPY --link docker/admin.sh ./docker/admin.sh COPY --link --from=build /app/apps/browser-extension ./apps/browser-extension -COPY --link --from=build /app/artifacts/runtime-web-layers/cad ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/fonts ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/large-00 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/large-01 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/large-02 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/large-03 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/large-04 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/large-05 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/large-06 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/large-07 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-00 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-01 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-02 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-03 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-04 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-05 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-06 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-07 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-08 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-09 ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-0a ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-0b ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-0c ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-0d ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-0e ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/code-0f ./apps/web/dist -COPY --link --from=build /app/artifacts/runtime-web-layers/entry ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/cad ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/fonts ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/large-00 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/large-01 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/large-02 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/large-03 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/large-04 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/large-05 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/large-06 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/large-07 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-00 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-01 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-02 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-03 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-04 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-05 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-06 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-07 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-08 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-09 ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-0a ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-0b ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-0c ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-0d ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-0e ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/code-0f ./apps/web/dist +COPY --link --from=container-layers /app/artifacts/runtime-web-layers/entry ./apps/web/dist # Mount a persistent volume here for SQLite, AI memory and local file storage. diff --git a/README.es.md b/README.es.md index 7a9c2b00..714b1fa0 100644 --- a/README.es.md +++ b/README.es.md @@ -29,7 +29,7 @@ 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. ```sh -curl -fL https://github.com/workhold/doca/releases/download/v0.3.10/doca-compose-v0.3.10.yaml -o compose.yaml +curl -fL https://github.com/workhold/doca/releases/download/v0.3.11/doca-compose-v0.3.11.yaml -o compose.yaml ``` ```sh diff --git a/README.fr.md b/README.fr.md index c1007356..af9f67b7 100644 --- a/README.fr.md +++ b/README.fr.md @@ -29,7 +29,7 @@ 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. ```sh -curl -fL https://github.com/workhold/doca/releases/download/v0.3.10/doca-compose-v0.3.10.yaml -o compose.yaml +curl -fL https://github.com/workhold/doca/releases/download/v0.3.11/doca-compose-v0.3.11.yaml -o compose.yaml ``` ```sh diff --git a/README.ja.md b/README.ja.md index 623604d8..f5be71b5 100644 --- a/README.ja.md +++ b/README.ja.md @@ -29,7 +29,7 @@ Docker Engine、Docker Compose、サイトを公開する HTTP(S) の URL を用意します。Compose ファイルをダウンロードし、`DOCA_ORIGIN` と専用に生成した資格情報用のマスターキーを設定してから起動します。 ```sh -curl -fL https://github.com/workhold/doca/releases/download/v0.3.10/doca-compose-v0.3.10.yaml -o compose.yaml +curl -fL https://github.com/workhold/doca/releases/download/v0.3.11/doca-compose-v0.3.11.yaml -o compose.yaml ``` ```sh diff --git a/README.ko.md b/README.ko.md index d15d2110..93277ef6 100644 --- a/README.ko.md +++ b/README.ko.md @@ -29,7 +29,7 @@ Docker Engine, Docker Compose 및 사이트의 HTTP(S) 주소를 준비합니다. Compose 파일을 내려받고 `DOCA_ORIGIN`과 새로 생성한 자격 증명용 마스터 키를 설정한 뒤 실행합니다. ```sh -curl -fL https://github.com/workhold/doca/releases/download/v0.3.10/doca-compose-v0.3.10.yaml -o compose.yaml +curl -fL https://github.com/workhold/doca/releases/download/v0.3.11/doca-compose-v0.3.11.yaml -o compose.yaml ``` ```sh diff --git a/README.md b/README.md index 87306c42..df00ea63 100644 --- a/README.md +++ b/README.md @@ -25,14 +25,16 @@ ![Doca workspace with recent documents, a team knowledge library, and the AI assistant entry](docs/images/en/workspace.jpg) +For native Debian 12 setup, see the [interactive Linux installer](docs/deployment.md#native-linux-installation). + ## 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.10) 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.11) 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.10/doca-compose-v0.3.10.yaml -o compose.yaml +curl -fL https://github.com/workhold/doca/releases/download/v0.3.11/doca-compose-v0.3.11.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 @@ -173,7 +175,7 @@ Map out a process on an infinite board. - [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.10) +- [Release notes](https://workhold.github.io/doca/#/en/releases/0.3.11) - [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). diff --git a/README.ru.md b/README.ru.md index 23a9e682..90b6fdf5 100644 --- a/README.ru.md +++ b/README.ru.md @@ -29,7 +29,7 @@ Подготовьте Docker Engine, Docker Compose и адрес сайта по HTTP(S). Скачайте файл Compose, задайте `DOCA_ORIGIN` и сгенерируйте отдельный мастер-ключ учётных данных. Затем запустите сервис. ```sh -curl -fL https://github.com/workhold/doca/releases/download/v0.3.10/doca-compose-v0.3.10.yaml -o compose.yaml +curl -fL https://github.com/workhold/doca/releases/download/v0.3.11/doca-compose-v0.3.11.yaml -o compose.yaml ``` ```sh diff --git a/README.zh-CN.md b/README.zh-CN.md index 367c77df..550b0d87 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -25,14 +25,16 @@ ![Doca 工作台:最近访问的文档、团队知识库与 AI 助手入口](docs/images/zh-cn/workspace.jpg) +使用 Debian 12 的服务器可查看[原生一键安装向导](docs/deployment.zh-CN.md#linux-原生一键安装)。 + ## Docker 快速开始 -需要 Docker Engine、Docker Compose,以及通过反向代理访问的 HTTP(S) 地址。全新 SQLite/本地存储安装只需一个 YAML,无需 Git、源码、seccomp JSON 或外部初始化脚本。已有部署更换版本前,先阅读[发行要求](https://workhold.github.io/doca/#/zh-cn/releases/0.3.10),保留原项目名、持久卷、数据库、附件和主密钥。 +需要 Docker Engine、Docker Compose,以及通过反向代理访问的 HTTP(S) 地址。全新 SQLite/本地存储安装只需一个 YAML,无需 Git、源码、seccomp JSON 或外部初始化脚本。已有部署更换版本前,先阅读[发行要求](https://workhold.github.io/doca/#/zh-cn/releases/0.3.11),保留原项目名、持久卷、数据库、附件和主密钥。 ```sh # 1. 在固定部署目录下载单文件配置 mkdir doca && cd doca -curl -fL https://github.com/workhold/doca/releases/download/v0.3.10/doca-compose-v0.3.10.yaml -o compose.yaml +curl -fL https://github.com/workhold/doca/releases/download/v0.3.11/doca-compose-v0.3.11.yaml -o compose.yaml # 2. 用 openssl rand -hex 32 生成主密钥 # 编辑 compose.yaml,填写 DOCA_ORIGIN 和 DOCA_CREDENTIAL_MASTER_KEY @@ -173,7 +175,7 @@ Doca 提供 Streamable HTTP MCP 服务,让支持 MCP 的客户端发现已授 - [部署与配置](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.10) +- [发行记录](https://workhold.github.io/doca/#/zh-cn/releases/0.3.11) - [文档源码](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)。 diff --git a/README.zh-Hant.md b/README.zh-Hant.md index 877f03f7..0f0a47b0 100644 --- a/README.zh-Hant.md +++ b/README.zh-Hant.md @@ -29,7 +29,7 @@ 請準備 Docker Engine、Docker Compose 以及網站的 HTTP(S) 公開位址。下載 Compose 檔案,填寫 `DOCA_ORIGIN` 並產生專用的憑證主金鑰,再啟動服務。 ```sh -curl -fL https://github.com/workhold/doca/releases/download/v0.3.10/doca-compose-v0.3.10.yaml -o compose.yaml +curl -fL https://github.com/workhold/doca/releases/download/v0.3.11/doca-compose-v0.3.11.yaml -o compose.yaml ``` ```sh diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 30b1b001..95b5d21f 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@doca/desktop", - "version": "0.3.10", + "version": "0.3.11", "license": "MIT", "private": true, "type": "module", diff --git a/apps/desktop/src-tauri/Cargo.lock b/apps/desktop/src-tauri/Cargo.lock index be3a4898..17a638bb 100644 --- a/apps/desktop/src-tauri/Cargo.lock +++ b/apps/desktop/src-tauri/Cargo.lock @@ -1020,7 +1020,7 @@ dependencies = [ [[package]] name = "doca-desktop" -version = "0.3.10" +version = "0.3.11" dependencies = [ "aes-gcm", "axum", diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index ab23c370..edb8ccc7 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "doca-desktop" -version = "0.3.10" +version = "0.3.11" description = "Doca desktop client" authors = ["Doca"] edition = "2021" diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index 16f86275..df872be9 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Doca", - "version": "0.3.10", + "version": "0.3.11", "identifier": "com.smartdoca.desktop", "build": { "beforeDevCommand": "pnpm exec vite --host 127.0.0.1 --port 1420 --strictPort", diff --git a/apps/mobile/app.json b/apps/mobile/app.json index 7694cabf..85cbc126 100644 --- a/apps/mobile/app.json +++ b/apps/mobile/app.json @@ -3,7 +3,7 @@ "name": "Doca", "slug": "zhangxiaojia", "scheme": "doca", - "version": "0.3.10", + "version": "0.3.11", "icon": "./assets/icon.png", "orientation": "portrait", "userInterfaceStyle": "light", @@ -23,7 +23,7 @@ }, "android": { "package": "app.doca.mobile", - "versionCode": 9, + "versionCode": 10, "usesCleartextTraffic": true, "adaptiveIcon": { "foregroundImage": "./assets/adaptive-icon.png", diff --git a/apps/mobile/app/(tabs)/index.tsx b/apps/mobile/app/(tabs)/index.tsx index 10e81620..295cff0c 100644 --- a/apps/mobile/app/(tabs)/index.tsx +++ b/apps/mobile/app/(tabs)/index.tsx @@ -7,6 +7,7 @@ import { Text } from "react-native-paper"; import { colors } from "../../src/chrome"; import { useI18n } from "../../src/locale"; import { MobileNavigationArea } from "../../src/plugins/navigation"; +import { CreateResourceButton } from "../../src/resource-forms"; import { ResourceList } from "../../src/resource-list"; const filters = [ @@ -25,15 +26,18 @@ export default function Home() { return ( - [styles.search, pressed && styles.pressed]} - onPress={() => router.push("/search")} - > - - {t("mobile.home.search")} - + + [styles.search, pressed && styles.pressed]} + onPress={() => router.push("/search")} + > + + {t("mobile.home.search")} + + + } /> ); } + +const styles = StyleSheet.create({ + actions: { alignItems: "flex-end", paddingHorizontal: 18, paddingTop: 10 }, +}); diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx index f568342a..f6b9255e 100644 --- a/apps/mobile/app/_layout.tsx +++ b/apps/mobile/app/_layout.tsx @@ -272,7 +272,12 @@ function RootShell() { + + + + + diff --git a/apps/mobile/app/create-resource.tsx b/apps/mobile/app/create-resource.tsx new file mode 100644 index 00000000..b1a4ac5e --- /dev/null +++ b/apps/mobile/app/create-resource.tsx @@ -0,0 +1,102 @@ +import { useMutation, useQueryClient } from "@tanstack/react-query"; +import { Stack, useLocalSearchParams, useRouter } from "expo-router"; +import { useState } from "react"; +import { Keyboard } from "react-native"; +import { HelperText, Text, TextInput } from "react-native-paper"; +import { api, type Resource } from "../src/api"; +import { useAuth } from "../src/auth"; +import { colors, EmptyState, LoadingState } from "../src/chrome"; +import { canCreateLibraryDocument, refreshResources, useLibrary } from "../src/library-data"; +import { useI18n } from "../src/locale"; +import { FormButton, FormChoices, FormFeedback, FormSection, ResourceForm } from "../src/resource-forms"; +import { formatMessage, ResourceIcon } from "../src/resource-icon"; + +const formats = ["rich_text", "spreadsheet", "markdown", "canvas", "presentation"] as const; + +export default function CreateResource() { + const params = useLocalSearchParams<{ kind?: string; libraryId?: string }>(); + const kind = params.kind === "library" ? "library" : "document"; + const libraryId = kind === "document" ? params.libraryId : undefined; + const router = useRouter(); + const client = useQueryClient(); + const { session } = useAuth(); + const { t } = useI18n(); + const [title, setTitle] = useState(""); + const [touched, setTouched] = useState(false); + const [format, setFormat] = useState("rich_text"); + const library = useLibrary(libraryId); + const canCreate = !libraryId || canCreateLibraryDocument(library.data); + const creation = useMutation({ + mutationFn: () => api>("/resources", { + session, + body: { kind, title: title.trim(), format: kind === "library" ? "rich_text" : format, ...(libraryId ? { libraryId } : {}) }, + }), + onSuccess: () => session ? refreshResources(client, session.origin, libraryId) : undefined, + }); + const label = t(kind === "library" ? "library.libraryName" : "library.documentName"); + const missingName = touched && !title.trim(); + + function create() { + setTouched(true); + if (!session || !title.trim() || !canCreate || creation.isPending) return; + Keyboard.dismiss(); + creation.mutate(undefined, { + onSuccess: (item) => router.replace({ + pathname: kind === "library" ? "/library/[id]" : "/document/[id]", + params: { id: item.id, title: item.title }, + }), + }); + } + + return ( + <> + + {libraryId && library.isPending ? ( + + ) : libraryId && library.isError ? ( + + + void library.refetch()}>{t("shell.retry")} + + ) : !canCreate ? ( + + ) : ( + + {libraryId && library.data ? ( + + {library.data.title}{"\n"}{t("shell.inheritAccess")} + + ) : null} + setTouched(true)} + onChangeText={setTitle} + /> + {missingName ? {t("fields.required")} : null} + {kind === "document" ? ( + + ({ value, label: t(formatMessage[value]) }))} + onChange={setFormat} + disabled={creation.isPending} + leading={(value) => } + /> + + ) : null} + + + {t("workspace.create")} + + + )} + + ); +} diff --git a/apps/mobile/app/document/[id].tsx b/apps/mobile/app/document/[id].tsx index b149263e..680efac3 100644 --- a/apps/mobile/app/document/[id].tsx +++ b/apps/mobile/app/document/[id].tsx @@ -1,5 +1,5 @@ import { useQuery } from "@tanstack/react-query"; -import { useLocalSearchParams, useNavigation } from "expo-router"; +import { useLocalSearchParams, useNavigation, useRouter } from "expo-router"; import { useLayoutEffect, useState } from "react"; import { StyleSheet, View } from "react-native"; import { IconButton, Text } from "react-native-paper"; @@ -11,26 +11,28 @@ import { colors } from "../../src/chrome"; import { DocumentPanel } from "../../src/document-panel"; import { useI18n } from "../../src/locale"; import { mobileEditorScript } from "../../src/mobile-editor-css"; +import { accessRoute } from "../../src/permissions/api"; export default function Document() { const { id, title, find } = useLocalSearchParams<{ id: string; title?: string; find?: string }>(); const navigation = useNavigation(); + const router = useRouter(); const { session } = useAuth(); const { t } = useI18n(); const [heading, setHeading] = useState(title); - const [panel, setPanel] = useState<"info" | "access" | null>(null); + const [panel, setPanel] = useState(false); useLayoutEffect(() => { navigation.setOptions({ title: heading || t("mobile.screen.document"), headerShadowVisible: true, headerRight: () => ( - setPanel("access")} /> - setPanel("info")} /> + router.push(accessRoute({ kind: "document", id }))} /> + setPanel(true)} /> ), }); - }, [heading, navigation, t]); + }, [heading, id, navigation, router, t]); const ticket = useQuery({ queryKey: ["webview-ticket", session?.origin, id], enabled: !!session && !!id, @@ -73,7 +75,7 @@ export default function Document() { } }} /> - {panel && setPanel(null)} />} + {panel && setPanel(false)} />} ); } diff --git a/apps/mobile/app/group-access.tsx b/apps/mobile/app/group-access.tsx new file mode 100644 index 00000000..c13fb312 --- /dev/null +++ b/apps/mobile/app/group-access.tsx @@ -0,0 +1,78 @@ +import { useQuery } from "@tanstack/react-query"; +import { Stack, useLocalSearchParams, useRouter } from "expo-router"; +import { StyleSheet, View } from "react-native"; +import { api, isAccessDenied } from "../src/api"; +import { useAuth } from "../src/auth"; +import { EmptyState, LoadingState } from "../src/chrome"; +import { useI18n } from "../src/locale"; +import { idPattern, roleText, useAccessWrite } from "../src/permissions/api"; +import { usePull } from "../src/query-cache"; +import { FormButton, FormFeedback, FormRow, FormSection, ResourceForm } from "../src/resource-forms"; + +type Group = { id: string; name: string; role: "owner" | "admin" | "member" }; +type GroupDetail = Group & { resourceInvitations: { id: string; title: string; role: string }[] }; + +export default function GroupAccess() { + const { groupId } = useLocalSearchParams<{ groupId?: string }>(); + const { t } = useI18n(); + if (groupId && !idPattern.test(groupId)) return ; + return ; +} + +function GroupInvitations({ groupId }: { groupId?: string }) { + const { session } = useAuth(); + const { t } = useI18n(); + const router = useRouter(); + const path = groupId ? `/groups/${groupId}` : "/groups"; + const query = useQuery({ + queryKey: ["group-access", session?.origin, groupId], + enabled: !!session, + staleTime: 0, + queryFn: ({ signal }) => api(path, { session, signal }), + }); + const pull = usePull(query.refetch); + const write = useAccessWrite(); + const reply = (id: string, accept: boolean) => write.mutate({ path: `${path}/resource-invitations/${id}`, method: "POST", body: { accept } }); + const last = write.variables?.body as { accept: boolean } | undefined; + const data = query.data; + if (!session) return ; + if (query.isPending) return ; + if (!data || isAccessDenied(query.error)) { + return void query.refetch()}>{t("shell.retry")}; + } + if ("items" in data) { + const groups = data.items.filter((group) => group.role !== "member"); + return ( + + + {groups.length ? groups.map((group) => ( + router.push({ pathname: "/group-access", params: { groupId: group.id } })} /> + )) : } + + ); + } + if (data.role === "member") return ; + + return ( + + + + + {data.resourceInvitations.length ? data.resourceInvitations.map((invitation) => ( + + + + reply(invitation.id, true)}>{t("groups.accept")} + reply(invitation.id, false)}>{t("groups.reject")} + + + )) : } + + + ); +} + +const styles = StyleSheet.create({ + invitation: { gap: 8 }, + actions: { flexDirection: "row", flexWrap: "wrap", gap: 8 }, +}); diff --git a/apps/mobile/app/library/[id].tsx b/apps/mobile/app/library/[id].tsx index 5ec95bb3..e281efca 100644 --- a/apps/mobile/app/library/[id].tsx +++ b/apps/mobile/app/library/[id].tsx @@ -1,12 +1,62 @@ -import { useLocalSearchParams, useNavigation } from "expo-router"; -import { useLayoutEffect } from "react"; +import { Stack, useLocalSearchParams, useRouter } from "expo-router"; +import { Settings2, Shield } from "lucide-react-native"; +import { StyleSheet, View } from "react-native"; +import { isAccessDenied } from "../../src/api"; +import { canCreateLibraryDocument, canManageLibrary, useLibrary } from "../../src/library-data"; import { LibraryTree } from "../../src/library-tree"; +import { useI18n } from "../../src/locale"; +import { accessRoute, useAccessOverview } from "../../src/permissions/api"; +import { CreateResourceButton, FormButton, FormFeedback } from "../../src/resource-forms"; +import { colors } from "../../src/chrome"; export default function Library() { const { id, title } = useLocalSearchParams<{ id: string; title?: string }>(); - const navigation = useNavigation(); - useLayoutEffect(() => { - navigation.setOptions({ title: title || "知识库" }); - }, [navigation, title]); - return ; + const router = useRouter(); + const { t } = useI18n(); + const library = useLibrary(id); + const target = { kind: "library" as const, id }; + const denied = isAccessDenied(library.error); + const access = useAccessOverview(target, denied); + const accessData = access.data?.type === "resource" ? access.data.data : undefined; + const requestable = denied && !access.isError && accessData?.effectiveRequestsEnabled && accessData.requestRoles.length > 0; + const create = !library.isError && canCreateLibraryDocument(library.data); + const manage = !library.isError && canManageLibrary(library.data); + const canViewAccess = !library.isError && library.data?.kind === "library"; + + return ( + + + {create || canViewAccess ? ( + + {create ? : null} + {manage ? ( + } + onPress={() => router.push({ pathname: "/library/[id]/settings", params: { id } })} + > + {t("nav.librarySettings")} + + ) : canViewAccess ? ( + } onPress={() => router.push(accessRoute(target))}> + {t("share.title")} + + ) : null} + + ) : null} + {library.isError ? ( + + + {requestable ? router.push(accessRoute(target, "request"))}>{t("share.request")} : null} + void library.refetch()}>{t("shell.retry")} + + ) : null} + + + ); } + +const styles = StyleSheet.create({ + page: { flex: 1, backgroundColor: colors.card }, + actions: { flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8, paddingHorizontal: 16, paddingVertical: 12, borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: colors.line }, +}); diff --git a/apps/mobile/app/library/[id]/settings.tsx b/apps/mobile/app/library/[id]/settings.tsx new file mode 100644 index 00000000..6f56e11d --- /dev/null +++ b/apps/mobile/app/library/[id]/settings.tsx @@ -0,0 +1,184 @@ +import { useMutation, useQueryClient } from "@tanstack/react-query"; +import * as FileSystem from "expo-file-system"; +import { Image } from "expo-image"; +import * as ImagePicker from "expo-image-picker"; +import { useLocalSearchParams, useRouter } from "expo-router"; +import { ImagePlus, Shield } from "lucide-react-native"; +import { useState } from "react"; +import { Keyboard, StyleSheet, View } from "react-native"; +import { HelperText, Text, TextInput } from "react-native-paper"; +import { ApiError, api, isAccessDenied } from "../../../src/api"; +import { assetImageSource } from "../../../src/asset-image"; +import { useAuth } from "../../../src/auth"; +import { colors, EmptyState, LoadingState } from "../../../src/chrome"; +import { canManageLibrary, refreshResources, useLibrary, type LibraryResource } from "../../../src/library-data"; +import { useI18n } from "../../../src/locale"; +import { accessRoute } from "../../../src/permissions/api"; +import { FormButton, FormFeedback, FormSection, ResourceForm } from "../../../src/resource-forms"; +import type { Session } from "../../../src/session"; +import { apiErrorMessage } from "../../../src/system-errors"; + +type CoverDraft = { uri: string; filename: string; assetId?: string }; +type Change = + | { kind: "name"; title: string; version: number } + | { kind: "cover"; cover: CoverDraft | null; version: number }; + +export default function LibrarySettings() { + const { id } = useLocalSearchParams<{ id: string }>(); + const { session } = useAuth(); + const { t } = useI18n(); + const library = useLibrary(id); + + if (library.isPending) return ; + if (library.isError && (!library.data || isAccessDenied(library.error))) { + return ( + + + void library.refetch()}>{t("shell.retry")} + + ); + } + if (!session || !library.data || !canManageLibrary(library.data)) return ; + return ; +} + +function SettingsForm({ library, session }: { library: LibraryResource; session: Session }) { + const { t } = useI18n(); + const router = useRouter(); + const client = useQueryClient(); + const [nameDraft, setNameDraft] = useState(); + const [coverDraft, setCoverDraft] = useState(); + const [picking, setPicking] = useState(false); + const [pickError, setPickError] = useState(null); + const name = nameDraft ?? library.title; + const invalidName = nameDraft !== undefined && !name.trim(); + const coverId = library.cover_asset_id; + const preview = coverDraft === undefined && coverId ? assetImageSource(session, coverId) + : coverDraft ? { uri: coverDraft.uri } : undefined; + const refresh = () => refreshResources(client, session.origin, library.id); + const resourcePath = `/resources/${encodeURIComponent(library.id)}`; + const save = useMutation({ + mutationFn: async (change: Change) => { + if (change.kind === "name") { + return api(resourcePath, { session, method: "PATCH", body: { title: change.title, version: change.version } }); + } + let assetId = change.cover?.assetId ?? null; + if (change.cover && !assetId) { + assetId = await uploadCover(session, library.id, change.cover, t("fileManager.uploadFailed")); + setCoverDraft({ ...change.cover, assetId }); + } + return api(`${resourcePath}/cover`, { session, method: "PUT", body: { assetId, version: change.version } }); + }, + onSuccess: refresh, + onError: (error) => error instanceof ApiError && [403, 404, 409].includes(error.status) ? refresh() : undefined, + }); + const busy = picking || save.isPending; + + async function pickCover() { + setPicking(true); + setPickError(null); + try { + const photo = await ImagePicker.launchImageLibraryAsync({ + mediaTypes: ["images"], + preferredAssetRepresentationMode: ImagePicker.UIImagePickerPreferredAssetRepresentationMode.Compatible, + }); + if (photo.canceled) return; + const image = photo.assets[0]; + if (!image) throw new Error(t("library.coverReadFailed")); + if (image.fileSize !== undefined && (image.fileSize === 0 || image.fileSize > 5 * 1024 * 1024)) { + throw new Error(t("library.coverHelp")); + } + save.reset(); + setCoverDraft({ uri: image.uri, filename: (image.fileName || "cover").slice(0, 255) }); + } catch (error) { + setPickError(error instanceof Error ? error : new Error(t("library.coverReadFailed"))); + } finally { + setPicking(false); + } + } + + const notice = save.isSuccess ? t("common.settingsSaved") : undefined; + return ( + + } + onPress={() => router.push(accessRoute({ kind: "library", id: library.id }))} + > + {t("share.title")} + + + + {invalidName ? {t("fields.required")} : null} + {save.variables?.kind === "name" ? : null} + { + Keyboard.dismiss(); + save.mutate({ kind: "name", title: name.trim(), version: library.version }, { onSuccess: () => setNameDraft(undefined) }); + }} + > + {t("shell.rename")} + + + + + {preview ? ( + + ) : } + + {t("library.coverHelp")} + + + void pickCover()}>{t("library.chooseCover")} + {preview ? ( + { setPickError(null); save.reset(); setCoverDraft(null); }}> + {t("library.removeCover")} + + ) : null} + + {coverDraft !== undefined && (coverDraft || coverId) ? ( + save.mutate({ kind: "cover", cover: coverDraft, version: library.version }, { onSuccess: () => setCoverDraft(undefined) })} + > + {t("library.saveCover")} + + ) : null} + + + ); +} + +async function uploadCover(session: Session, id: string, draft: CoverDraft, fallback: string) { + const params = new URLSearchParams({ purpose: "cover", resourceId: id, filename: draft.filename }); + const result = await FileSystem.uploadAsync(`${session.origin}/api/v1/assets?${params}`, draft.uri, { + httpMethod: "POST", + uploadType: FileSystem.FileSystemUploadType.BINARY_CONTENT, + headers: { authorization: `Bearer ${session.token}`, "content-type": "application/octet-stream" }, + }); + let body: { id?: string; message?: string } = {}; + try { body = JSON.parse(result.body); } catch { /* The connection may return a non-JSON response. */ } + if (result.status >= 200 && result.status < 300 && body.id) return body.id; + throw new ApiError(result.status, body.message ? apiErrorMessage(body.message) : fallback); +} + +const styles = StyleSheet.create({ + preview: { height: 128, backgroundColor: colors.bg, borderRadius: 12, overflow: "hidden", alignItems: "center", justifyContent: "center" }, + help: { color: colors.secondary }, + actions: { flexDirection: "row", flexWrap: "wrap", gap: 8 }, +}); diff --git a/apps/mobile/app/me.tsx b/apps/mobile/app/me.tsx index c8272a9c..9fa7d035 100644 --- a/apps/mobile/app/me.tsx +++ b/apps/mobile/app/me.tsx @@ -1,6 +1,6 @@ import { localeLabel } from "@doca/i18n"; import { Redirect, Stack, useRouter } from "expo-router"; -import { Bell, ChevronRight, Ellipsis, Languages, LogOut, ScanLine, Server, Settings, UserRound } from "lucide-react-native"; +import { Bell, ChevronRight, ClipboardList, Ellipsis, Languages, LogOut, ScanLine, Server, Settings, UserRound, Users } from "lucide-react-native"; import { Alert, Pressable, ScrollView, StyleSheet, View } from "react-native"; import { Button, Text } from "react-native-paper"; import { AccountAvatar, useAccountProfile } from "../src/account-avatar"; @@ -74,6 +74,10 @@ export default function MyAccount() { router.push("/notifications")} /> + router.push("/tickets")} /> + + router.push("/group-access")} /> + new QueryClient({ defaultOptions: { queries: { retry: 1 } } })); const query = useInfiniteQuery({ queryKey: ["notifications", session.origin], + gcTime: 0, + staleTime: 0, initialPageParam: 0, queryFn: ({ pageParam, signal }) => api(`/notifications?offset=${pageParam}`, { session, signal }), getNextPageParam: (page) => page.nextOffset ?? undefined, - }, client); + }); const [busy, setBusy] = useState(false); const marking = useRef(false); const focused = useRef(false); + const refetch = query.refetch; useFocusEffect(useCallback(() => { focused.current = true; + void refetch({ cancelRefetch: false }); return () => { focused.current = false; }; - }, [])); + }, [refetch])); const [error, setError] = useState(""); const rows = query.data?.pages.flatMap((page) => page.items) ?? []; const unread = query.data?.pages[0]?.unread ?? 0; function openNotice(item: Notice) { + if (!focused.current) return; + const ticketId = ticketTarget(item, session.origin); + if (ticketId) { + router.push({ pathname: "/tickets", params: { ticketId } }); + return; + } const id = documentTarget(item); - if (id && focused.current) router.push({ pathname: "/document/[id]", params: { id, title: item.title ?? "" } }); + if (id) router.push({ pathname: "/document/[id]", params: { id, title: item.title ?? "" } }); } async function mark(item?: Notice) { @@ -115,7 +131,7 @@ function NoticeList({ session }: { session: Session }) { ) : null} renderItem={({ item }) => { - const linked = !!documentTarget(item); + const linked = !!(documentTarget(item) || ticketTarget(item, session.origin)); const description = item.description || item.actorName; return ( (); + const { share, folderShare } = useLocalSearchParams<{ share?: string; folderShare?: string }>(); const { session } = useAuth(); + const client = useQueryClient(); const { t } = useI18n(); const { bottom } = useSafeAreaInsets(); const [value, setValue] = useState(""); - const [token, setToken] = useState(() => share && /^[A-Za-z0-9_-]{43}$/.test(share) ? share : ""); + const [selection, setSelection] = useState(() => { + const token = folderShare ?? share; + return token && /^[A-Za-z0-9_-]{43}$/.test(token) ? { kind: folderShare ? "folder" : "resource", token } : null; + }); const [error, setError] = useState(""); const [accepting, setAccepting] = useState(false); const result = useQuery({ - queryKey: ["share-preview", session?.origin, session?.token, token], - enabled: !!session && !!token, + queryKey: ["share-preview", session?.origin, selection?.kind, selection?.token], + enabled: !!session && !!selection, retry: false, gcTime: 0, - queryFn: ({ signal }) => api("/share/redeem", { session, signal, body: { token, accept: false } }), + queryFn: ({ signal }) => api(selection?.kind === "folder" ? "/files/share/redeem" : "/share/redeem", { session, signal, body: { token: selection?.token, accept: false } }), }); const resource = result.data; - useEffect(() => { - if (token && resource && !resource.pending) { - router.replace({ pathname: resource.kind === "library" ? "/library/[id]" : "/document/[id]", params: { id: resource.id } }); + const openShared = useCallback((item: SharePreview) => { + if ("name" in item) { + if (session) void refreshAccess(client, session.origin, "folder"); + router.replace({ pathname: "/folder/[id]", params: { id: item.id, rootFolderId: item.id, title: item.name } }); + } else { + if (session) void refreshAccess(client, session.origin, item.kind); + router.replace({ pathname: item.kind === "library" ? "/library/[id]" : "/document/[id]", params: { id: item.id } }); } - }, [resource, router, token]); + }, [client, router, session]); + useEffect(() => { + if (selection && resource && !resource.pending) openShared(resource); + }, [openShared, resource, selection]); function open() { if (!session || !value.trim()) return; @@ -43,20 +56,22 @@ export default function OpenLink() { setError(""); if (link.type === "document") { router.replace({ pathname: "/document/[id]", params: { id: link.id, ...(link.find ? { find: link.find } : {}) } }); - } else if (link.type === "share") { - setToken(link.token); + } else if (link.type === "share" || link.type === "folder-share") { + setSelection({ kind: link.type === "folder-share" ? "folder" : "resource", token: link.token }); + } else if (link.type === "ticket") { + router.replace({ pathname: "/tickets", params: { ticketId: link.id } }); } else { setError(t(link.type === "otherServer" ? "mobile.link.otherServer" : "mobile.link.invalid")); } } async function accept() { - if (!session || !token || accepting) return; + if (!session || !selection || accepting) return; setAccepting(true); setError(""); try { - const shared = await api("/share/redeem", { session, body: { token, accept: true } }); - router.replace({ pathname: shared.kind === "library" ? "/library/[id]" : "/document/[id]", params: { id: shared.id } }); + const shared = await api(selection.kind === "folder" ? "/files/share/redeem" : "/share/redeem", { session, body: { token: selection.token, accept: true } }); + openShared(shared); } catch (reason) { setError(reason instanceof Error ? reason.message : t("common.failed")); } finally { @@ -67,11 +82,12 @@ export default function OpenLink() { return ( - {!token ? ( + {!selection ? ( <> {t("shell.inviteTitle")} - {t("shell.inviteBody", { title: resource.title, role: resource.role, kind: t(resource.kind === "library" ? "shell.inviteKind.library" : "shell.inviteKind.document") })} + {t("shell.inviteBody", { title: "name" in resource ? resource.name : resource.title ?? "", role: roleText(t, resource.role), kind: t("name" in resource ? "nav.sharedFiles" : resource.kind === "library" ? "shell.inviteKind.library" : "shell.inviteKind.document") })} {t("shell.inviteHint")} @@ -92,7 +108,7 @@ export default function OpenLink() { ) : result.isError ? ( <> {result.error.message} - + ) : {t("common.loading")}} {error ? {error} : null} diff --git a/apps/mobile/app/permissions.tsx b/apps/mobile/app/permissions.tsx new file mode 100644 index 00000000..78a09b4a --- /dev/null +++ b/apps/mobile/app/permissions.tsx @@ -0,0 +1,114 @@ +import type { MessageKey } from "@doca/i18n"; +import { useQuery, useQueryClient } from "@tanstack/react-query"; +import { Stack, useLocalSearchParams, useRouter } from "expo-router"; +import { AccessSummary } from "../src/access-summary"; +import { isAccessDenied } from "../src/api"; +import { useAuth } from "../src/auth"; +import { EmptyState, LoadingState } from "../src/chrome"; +import { sharedFolderScope, sharedFoldersOptions } from "../src/file-browser-data"; +import { useI18n } from "../src/locale"; +import { accessPath, accessRoute, idPattern, roleText, useAccessOverview, useAccessWrite, visibilityLabel, type AccessOverview, type PermissionTarget, type PermissionView } from "../src/permissions/api"; +import { AccessInvite } from "../src/permissions/invite"; +import { FolderLinks, ResourceLinks } from "../src/permissions/links"; +import { AccessGroup, AccessMember, AccessMembers } from "../src/permissions/members"; +import { AccessRequestForm, FolderPublication, ResourcePolicy } from "../src/permissions/policies"; +import { usePull } from "../src/query-cache"; +import { FormButton, FormFeedback, FormRow, FormSection, FormToggle, ResourceForm } from "../src/resource-forms"; + +const sections: Record = { + main: "share.title", settings: "share.settings", members: "share.members", invite: "share.invite", + member: "share.sources", group: "groups.authorize", links: "sharingUi.linkSharing", request: "share.request", +}; + +export default function Permissions() { + const { id, kind, view, subject } = useLocalSearchParams<{ id?: string; kind?: string; view?: string; subject?: string }>(); + const { t } = useI18n(); + if (!(kind === "document" || kind === "library" || kind === "folder") || !id || !idPattern.test(id)) { + return ; + } + const section = view && Object.hasOwn(sections, view) ? view as PermissionView : "main"; + return ( + <> + + + + ); +} + +function AccessScreen({ target, section, subject }: { target: PermissionTarget; section: PermissionView; subject?: string }) { + const { session } = useAuth(); + const { t } = useI18n(); + const query = useAccessOverview(target); + const client = useQueryClient(); + const refresh = usePull(() => client.invalidateQueries({ queryKey: ["access", session?.origin, target.kind, target.id] })); + if (!session) return ; + if (query.isPending) return ; + const overview = query.data; + if (!overview || isAccessDenied(query.error)) { + return void query.refetch()}>{t("shell.retry")}; + } + return ( + + + + + ); +} + +function AccessSection({ target, overview, section, subject }: { target: PermissionTarget; overview: AccessOverview; section: PermissionView; subject?: string }) { + const { t } = useI18n(); + if (section === "main") return ; + if (section === "request" && overview.type === "resource" && overview.data.rank < 4) return ; + if (!overview.data.canManage) return ; + switch (section) { + case "settings": return overview.type === "folder" ? : ; + case "members": return ; + case "invite": return ; + case "member": return ; + case "group": return ; + case "links": return overview.type === "folder" ? : ; + default: return ; + } +} + +function AccessMain({ target, overview }: { target: PermissionTarget; overview: AccessOverview }) { + const { t } = useI18n(); + const { session } = useAuth(); + const router = useRouter(); + const write = useAccessWrite(target.kind); + const folders = useQuery({ ...sharedFoldersOptions(session), enabled: !!session && overview.type === "folder" }); + const folder = folders.data?.items.find((item) => item.id === target.id); + const data = overview.type === "resource" ? overview.data : null; + const scope = data ? visibilityLabel[data.effectiveVisibility] : folder ? sharedFolderScope(folder) : undefined; + const open = (section: PermissionView) => router.push(accessRoute(target, section)); + return ( + <> + + {overview.data.currentUser ? : null} + + {data?.hasParent ? write.mutate({ path: `${accessPath(target)}/permissions`, method: "PUT", body: { version: data.version, accessMode: inherit ? "inherit" : "custom" } })} + /> : null} + + {data && data.rank < 4 && data.effectiveRequestsEnabled && data.requestRoles.length > 0 ? open("request")} /> : null} + + {overview.data.canManage ? ( + + open("members")} /> + open("invite")} /> + open("settings")} /> + open("links")} /> + + ) : overview.type === "folder" || (data && data.rank >= 3) ? ( + member.display_name).join(" · ")} + /> + ) : null} + router.push({ pathname: "/tickets", params: { resourceKind: target.kind, resourceId: target.id } })} /> + + ); +} diff --git a/apps/mobile/app/scan.tsx b/apps/mobile/app/scan.tsx index d2e6cf74..00d774f3 100644 --- a/apps/mobile/app/scan.tsx +++ b/apps/mobile/app/scan.tsx @@ -95,6 +95,14 @@ export default function ScanLogin() { working.current = true; router.replace({ pathname: "/open-link", params: { share: link.token } }); break; + case "folder-share": + working.current = true; + router.replace({ pathname: "/open-link", params: { folderShare: link.token } }); + break; + case "ticket": + working.current = true; + router.replace({ pathname: "/tickets", params: { ticketId: link.id } }); + break; default: setError(t(link.type === "otherServer" ? "mobile.link.otherServer" : "mobile.scan.invalid")); } diff --git a/apps/mobile/app/tickets.tsx b/apps/mobile/app/tickets.tsx new file mode 100644 index 00000000..ce12294d --- /dev/null +++ b/apps/mobile/app/tickets.tsx @@ -0,0 +1,195 @@ +import { htmlLang, type MessageKey } from "@doca/i18n"; +import { useInfiniteQuery, useQuery } from "@tanstack/react-query"; +import { useLocalSearchParams, useRouter } from "expo-router"; +import { useState } from "react"; +import { Clipboard, StyleSheet, View } from "react-native"; +import { Text, TextInput } from "react-native-paper"; +import { api, isAccessDenied } from "../src/api"; +import { useAuth } from "../src/auth"; +import { colors, EmptyState, LoadingState } from "../src/chrome"; +import { useI18n } from "../src/locale"; +import { idPattern, roleText, useAccessWrite, type PermissionKind, type Person } from "../src/permissions/api"; +import { usePull } from "../src/query-cache"; +import { FormButton, FormChoices, FormFeedback, FormRow, FormSection, FormToggle, ResourceForm } from "../src/resource-forms"; + +const kindLabels = { access: "ticket.access", invitation: "ticket.invitation" } as const; +const stateLabels = { + pending: "ticket.pending", completed: "ticket.completed", approved: "ticket.approved", accepted: "ticket.accepted", + rejected: "ticket.rejected", cancelled: "ticket.cancelled", expired: "ticket.expired", +} as const; +const actionLabels = { approve: "ticket.approve", reject: "ticket.reject", accept: "ticket.accept", cancel: "ticket.cancel", remind: "ticket.remind" } as const; +const resourceLabels = { document: "mobile.screen.document", library: "shell.kind.library", folder: "discovery.kind.folder" } as const satisfies Record; +const statusFilters = ["pending", "completed", "rejected", "cancelled", "expired"] as const; + +type Ticket = { + id: string; + kind: keyof typeof kindLabels; + status: keyof typeof stateLabels; + role: string | null; + message: string; + createdAt: string; + expiresAt: string | null; + resourceKind: PermissionKind; + resourceId: string; + resource: { id: string; kind: PermissionKind; title: string } | null; + subject: Person | null; + initiator: Person | null; + processors: Person[]; + processorsHidden: boolean; + steps: string[]; + operation: { role?: string; includeDescendants?: boolean; grantMode?: string }; + events: { id: string; status: keyof typeof stateLabels; message: string; createdAt: string; actor: Person | null; operation: { role?: string; includeDescendants?: boolean } }[]; + approvalRoles: string[]; + actions: (keyof typeof actionLabels)[]; +}; + +export default function Tickets() { + const { resourceId, resourceKind, ticketId } = useLocalSearchParams<{ resourceId?: string; resourceKind?: string; ticketId?: string }>(); + const { t } = useI18n(); + if (ticketId) return idPattern.test(ticketId) ? : ; + const kind = resourceKind && Object.hasOwn(resourceLabels, resourceKind) ? resourceKind as PermissionKind : ""; + return ; +} + +function TicketList({ resourceKind, resourceId }: { resourceKind: PermissionKind | ""; resourceId?: string }) { + const { session } = useAuth(); + const { t, locale } = useI18n(); + const router = useRouter(); + const [filters, setFilters] = useState(false); + const [resource, setResource] = useState(resourceKind); + const [scope, setScope] = useState(resourceId); + const [type, setType] = useState(""); + const [states, setStates] = useState([]); + const [mine, setMine] = useState(false); + const params = new URLSearchParams(); + if (resource) params.set("resourceKind", resource); + if (scope) params.set("resourceId", scope); + if (type) params.set("kind", type); + if (states.length) params.set("status", states.join(",")); + if (mine) params.set("onlyMine", "true"); + const query = useInfiniteQuery({ + queryKey: ["tickets", session?.origin, params.toString()], + enabled: !!session, + staleTime: 0, + initialPageParam: 0, + queryFn: ({ pageParam, signal }) => api<{ items: Ticket[]; nextOffset: number | null }>(`/tickets?${params}&offset=${pageParam}`, { session, signal }), + getNextPageParam: (page) => page.nextOffset ?? undefined, + }); + const refresh = usePull(query.refetch); + const items = query.data?.pages.flatMap((page) => page.items) ?? []; + if (!session) return ; + return ( + + setFilters(!filters)}>{t("search.filters")} + {scope ? setScope(undefined)}>{t("ticket.clearResource")} : null} + {filters ? ( + + {!scope ? ({ value, label: t(label) }))]} onChange={setResource} /> : null} + ({ value, label: t(label) }))]} onChange={setType} /> + {statusFilters.map((state) => setStates((values) => enabled ? [...values, state] : values.filter((item) => item !== state))} />)} + + + ) : null} + {query.isPending ? : null} + + {query.isError ? void query.refetch()}>{t("shell.retry")} : null} + {!items.length && query.isSuccess ? : null} + {items.map((ticket) => ( + router.push({ pathname: "/tickets", params: { ticketId: ticket.id } })} /> + ))} + {query.hasNextPage ? void query.fetchNextPage()}>{t("navigation.more")} : null} + + ); +} + +function TicketDetail({ id }: { id: string }) { + const { session } = useAuth(); + const { t, locale } = useI18n(); + const router = useRouter(); + const [message, setMessage] = useState(""); + const [grantRole, setGrantRole] = useState(""); + const [scope, setScope] = useState(true); + const [copyStatus, setCopyStatus] = useState<"copied" | "manual">(); + const path = `/tickets/${id}`; + const query = useQuery({ + queryKey: ["tickets", session?.origin, id], + enabled: !!session, + staleTime: 0, + refetchInterval: 15_000, + queryFn: ({ signal }) => api(path, { session, signal }), + }); + const ticket = query.data; + const write = useAccessWrite(ticket?.resourceKind); + const resource = ticket?.resource; + const selectedRole = ticket?.approvalRoles.includes(grantRole) ? grantRole : ticket?.approvalRoles.includes(ticket.role ?? "") ? ticket.role! : ticket?.approvalRoles[0]; + const fmt = (time: string) => new Date(time).toLocaleString(htmlLang(locale)); + const link = session ? `${session.origin}/#/tickets/${id}` : ""; + if (!session) return ; + if (query.isPending) return ; + if (!ticket || isAccessDenied(query.error)) { + return void query.refetch()}>{t("shell.retry")}; + } + const steps = ticket.operation.grantMode === "direct" ? [t("ticket.submitted"), t("ticket.directGrant"), t("ticket.grantedRole")] : ticket.steps; + + return ( + + + {t(kindLabels[ticket.kind])} · {t(stateLabels[ticket.status])} + {t("ticket.number", { id })} + {resource && idPattern.test(resource.id) && Object.hasOwn(resourceLabels, resource.kind) ? ( + { + const params = { id: resource.id, title: resource.title }; + if (resource.kind === "folder") router.push({ pathname: "/folder/[id]", params: { ...params, rootFolderId: resource.id } }); + else router.push({ pathname: resource.kind === "library" ? "/library/[id]" : "/document/[id]", params }); + }} /> + ) : null} + + { try { Clipboard.setString(link); setCopyStatus("copied"); } catch { setCopyStatus("manual"); } }}>{t("ticket.copyLink")} + void query.refetch()}>{t("admin.refresh")} + + {copyStatus === "copied" ? : copyStatus === "manual" ? {link} : null} + + + {ticket.processorsHidden ? t("ticket.handlersHidden") : ticket.processors.length ? ticket.processors.map((person) => person.display_name).join(" · ") : t("ticket.noHandler")} + {ticket.role ? : null} + {ticket.expiresAt ? : null} + {ticket.message ? : null} + + + {ticket.actions.length ? ( + + {ticket.actions.includes("approve") && selectedRole ? ( + <> + {t("ticket.grantLabel")} + ({ value: role, label: roleText(t, role) }))} disabled={write.isPending} onChange={setGrantRole} /> + + + ) : null} + {ticket.actions.some((action) => action !== "remind") ? : null} + + + {ticket.actions.map((action) => write.mutate({ path: `${path}/actions`, method: "POST", body: { action, message: action === "remind" ? "" : message.trim(), ...(action === "approve" ? { role: selectedRole, includeDescendants: scope } : {}) } }, { onSuccess: () => { if (action !== "remind") setMessage(""); } })} + >{t(actionLabels[action])})} + + + ) : write.error ? : null} + + {steps.length ? {steps.join(" · ")} : null} + {ticket.events.map((event) => )} + + + ); +} + +const styles = StyleSheet.create({ + actions: { flexDirection: "row", flexWrap: "wrap", gap: 8 }, + muted: { color: colors.secondary }, +}); diff --git a/apps/mobile/package.json b/apps/mobile/package.json index f7b5056c..2dc3596a 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -1,6 +1,6 @@ { "name": "@doca/mobile", - "version": "0.3.10", + "version": "0.3.11", "license": "MIT", "private": true, "main": "expo-router/entry", diff --git a/apps/mobile/src/api.ts b/apps/mobile/src/api.ts index 3702bdce..ece60283 100644 --- a/apps/mobile/src/api.ts +++ b/apps/mobile/src/api.ts @@ -10,6 +10,10 @@ export class ApiError extends Error { } } +export function isAccessDenied(error: Error | null) { + return error instanceof ApiError && [401, 403, 404].includes(error.status); +} + type Options = { method?: string; body?: unknown; diff --git a/apps/mobile/src/document-link.ts b/apps/mobile/src/document-link.ts index bb1f391d..0abffbe2 100644 --- a/apps/mobile/src/document-link.ts +++ b/apps/mobile/src/document-link.ts @@ -1,9 +1,12 @@ const documentHash = /^#\/(?:m\/)?r\/([a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12})(?:\?([^#]*))?$/i; const shareHash = /^#\/s\/([A-Za-z0-9_-]{43})$/; +const ticketHash = /^#\/tickets\/([a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12})$/i; type DocumentLink = | { type: "document"; id: string; find?: string } | { type: "share"; token: string } + | { type: "folder-share"; token: string } + | { type: "ticket"; id: string } | { type: "invalid" } | { type: "otherServer" }; @@ -22,6 +25,11 @@ export function parseDocumentLink(value: string, origin: string): DocumentLink { } const share = shareHash.exec(link.hash); if (share) return { type: "share", token: share[1]! }; + const ticket = ticketHash.exec(link.hash); + if (ticket) return { type: "ticket", id: ticket[1]!.toLowerCase() }; + const folder = /^#\/shared-files\/join\?([^#]+)$/.exec(link.hash); + const token = folder ? new URLSearchParams(folder[1]).get("token") : null; + if (token && /^[A-Za-z0-9_-]{43}$/.test(token)) return { type: "folder-share", token }; } catch { return { type: "invalid" }; } diff --git a/apps/mobile/src/document-panel.tsx b/apps/mobile/src/document-panel.tsx index a4ca7ac0..9f8f64ac 100644 --- a/apps/mobile/src/document-panel.tsx +++ b/apps/mobile/src/document-panel.tsx @@ -1,17 +1,15 @@ -import type { MessageKey } from "@doca/i18n"; -import { useQuery, useQueryClient } from "@tanstack/react-query"; +import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { Modal, Pressable, ScrollView, StyleSheet, View } from "react-native"; -import { Button, Text, TextInput } from "react-native-paper"; +import { Button, Text } from "react-native-paper"; import { useSafeAreaInsets } from "react-native-safe-area-context"; -import { AccessSummary } from "./access-summary"; import { api } from "./api"; -import { useAuth } from "./auth"; import { colors } from "./chrome"; import { relativeTime } from "./format"; import { useI18n } from "./locale"; +import { useAccessOverview } from "./permissions/api"; -type Tab = "info" | "history" | "access"; +type Tab = "info" | "history"; type InfoTab = "stats" | "visits" | "audit"; type Stats = { title: string; @@ -35,42 +33,6 @@ type VersionPreview = { canRestore?: boolean; surface?: unknown; }; -type Member = { - id: string; - display_name: string; - role: string; - directRole: string | null; - canAdjust: boolean; - includeDescendants: boolean; -}; -type Overview = { - rank: number; - role: string; - authzRevision: number; - effectiveVisibility: "invited" | "requestable" | "authenticated" | "public"; - effectiveRequestsEnabled: boolean; - inheritedFields: string[]; - canManage: boolean; - isOwner: boolean; - members: Member[]; -}; -type Person = { id: string; display_name: string; public_id?: string }; - -const roles = ["reader", "commenter", "editor", "manager"] as const; -const roleLabel: Record = { - none: "role.none", - reader: "role.reader", - commenter: "role.commenter", - editor: "role.editor", - manager: "role.manager", - owner: "role.owner", -}; -const visibilityLabel = { - invited: "permissionsUi.privateHelp", - requestable: "permissionsUi.privateHelp", - authenticated: "policy.authenticated", - public: "policy.public", -} as const; const widthLabel: Record = { a4: "A4", a3: "A3", fluid: "全宽" }; function eventLabel(action: string) { @@ -100,26 +62,16 @@ function eventLabel(action: string) { return labels[action] ?? action; } -export function DocumentPanel({ id, initialTab, close }: { id: string; initialTab: Tab; close: () => void }) { +export function DocumentPanel({ id, close }: { id: string; close: () => void }) { const insets = useSafeAreaInsets(); - const client = useQueryClient(); - const { session } = useAuth(); const { t } = useI18n(); - const [tab, setTab] = useState(initialTab); + const [tab, setTab] = useState("info"); const [infoTab, setInfoTab] = useState("stats"); const [preview, setPreview] = useState(null); const [notice, setNotice] = useState(""); const [busy, setBusy] = useState(false); - const [query, setQuery] = useState(""); - const [people, setPeople] = useState([]); - const [inviteRole, setInviteRole] = useState<(typeof roles)[number]>("reader"); - const access = useQuery({ - queryKey: ["permission-overview", session?.origin, id], - enabled: !!session && !!id, - staleTime: 0, - queryFn: ({ signal }) => api(`/resources/${id}/permission-overview`, { session, signal }), - }); - const rank = access.data?.rank ?? 0; + const access = useAccessOverview({ kind: "document", id }); + const rank = access.data?.type === "resource" ? access.data.data.rank : 0; const info = useQuery({ queryKey: ["document-info", id, infoTab], enabled: tab === "info" && (infoTab === "stats" || rank >= 4), @@ -131,16 +83,6 @@ export function DocumentPanel({ id, initialTab, close }: { id: string; initialTa queryFn: () => api(`/resources/${id}/versions`), }); - async function reloadAccess() { - await Promise.all([ - client.invalidateQueries({ queryKey: ["permission-overview", session?.origin, id] }), - client.invalidateQueries({ queryKey: ["resources", session?.origin] }), - client.invalidateQueries({ queryKey: ["library-tree", session?.origin] }), - ]); - } - - const roleName = (role: string) => roleLabel[role] ? t(roleLabel[role]) : role; - async function saveSnapshot() { setBusy(true); setNotice(""); @@ -184,39 +126,6 @@ export function DocumentPanel({ id, initialTab, close }: { id: string; initialTa } } - async function setRole(userId: string, role: string | null, includeDescendants: boolean) { - if (!access.data) return; - setBusy(true); - setNotice(""); - try { - await api(`/resources/${id}/members/${userId}`, { - method: "PUT", - body: { revision: access.data.authzRevision, role, includeDescendants }, - }); - await reloadAccess(); - setNotice(role ? "权限已更新" : "已移除协作者"); - } catch (reason) { - setNotice(reason instanceof Error ? reason.message : "无法更新权限"); - } finally { - setBusy(false); - } - } - - async function lookup() { - const text = query.trim(); - if (text.length < 2) { - setPeople([]); - return; - } - try { - const result = await api<{ items: Person[] }>(`/users/lookup?q=${encodeURIComponent(text)}`); - setPeople(result.items); - setNotice(result.items.length ? "" : "没有找到用户"); - } catch (reason) { - setNotice(reason instanceof Error ? reason.message : "查找失败"); - } - } - const stats = infoTab === "stats" ? (info.data as Stats | undefined) : undefined; const records = infoTab === "stats" ? undefined : (info.data as RecordPage | undefined); const previewText = preview?.markdown || preview?.text || ""; @@ -225,7 +134,7 @@ export function DocumentPanel({ id, initialTab, close }: { id: string; initialTa - {tab === "access" ? t("sharingUi.title") : t("mobile.screen.document")} + {t("mobile.screen.document")} @@ -233,7 +142,6 @@ export function DocumentPanel({ id, initialTab, close }: { id: string; initialTa [ ["info", "信息"], ["history", t("doc.history")], - ["access", t("resourceAccess.column")], ] as const ).map(([key, label]) => ( setTab(key)} style={[styles.chip, tab === key && styles.chipActive]}> @@ -332,79 +240,6 @@ export function DocumentPanel({ id, initialTab, close }: { id: string; initialTa ) ) : null} - {tab === "access" ? ( - <> - {access.isLoading ? {t("common.loading")} : null} - {access.isError ? ( - - {access.error.message} - - - ) : null} - {access.data ? ( - <> - - {access.data.members.length ? {t("permissionsUi.collaborators")} : null} - {access.data.members.map((member) => ( - - {member.display_name} - {roleName(member.role)}{member.includeDescendants ? ` · ${t("role.scope.descendants")}` : ""} - {member.canAdjust ? ( - - {roles - .filter((role) => role !== "manager" || access.data?.isOwner) - .map((role) => ( - void setRole(member.id, role, member.includeDescendants)} - style={[styles.chip, member.directRole === role && styles.chipActive]} - > - {roleName(role)} - - ))} - void setRole(member.id, null, member.includeDescendants)}> - 移除 - - - ) : null} - - ))} - {access.data.canManage ? ( - <> - 邀请协作者 - void lookup()} /> - - {roles - .filter((role) => role !== "manager" || access.data.isOwner) - .map((role) => ( - setInviteRole(role)} style={[styles.chip, inviteRole === role && styles.chipActive]}> - {roleName(role)} - - ))} - - - {people.map((person) => ( - void setRole(person.id, inviteRole, true)}> - {person.display_name} - {person.public_id || "邀请"} - - ))} - - ) : null} - - ) : null} - - ) : null} @@ -452,5 +287,4 @@ const styles = StyleSheet.create({ }, rowTitle: { color: colors.ink, fontSize: 15, fontWeight: "600" }, snapshot: { color: colors.ink, fontSize: 15, lineHeight: 22 }, - remove: { color: colors.danger, fontSize: 13, paddingVertical: 6 }, }); diff --git a/apps/mobile/src/folder-browser.tsx b/apps/mobile/src/folder-browser.tsx index 011b8688..0f9e350c 100644 --- a/apps/mobile/src/folder-browser.tsx +++ b/apps/mobile/src/folder-browser.tsx @@ -21,6 +21,7 @@ import { fileSize, relativeTime } from "./format"; import { useI18n } from "./locale"; import { usePull } from "./query-cache"; import { SharedFolderAccess } from "./shared-folder-access"; +import { accessRoute } from "./permissions/api"; import { apiErrorMessage } from "./system-errors"; import type { Session } from "./session"; @@ -368,7 +369,7 @@ export function FolderBrowser({ ? : } onOpen={() => open(item)} - onMenu={!folder || canManage(item) ? () => showDialog({ kind: "actions", target: item }) : undefined} + onMenu={!folder || item.parent_id === "shared" || canManage(item) ? () => showDialog({ kind: "actions", target: item }) : undefined} disabled={busy} /> ); @@ -402,6 +403,12 @@ export function FolderBrowser({ }); }} /> ) : null} + {actionTarget?.kind === "folder" && actionTarget.parent_id === "shared" ? ( + { + showDialog(null); + router.push(accessRoute({ kind: "folder", id: actionTarget.id })); + }} /> + ) : null} {actionTarget && canManage(actionTarget) ? ( <> showDialog({ kind: "rename", target: actionTarget })} /> diff --git a/apps/mobile/src/library-data.ts b/apps/mobile/src/library-data.ts new file mode 100644 index 00000000..d496aa16 --- /dev/null +++ b/apps/mobile/src/library-data.ts @@ -0,0 +1,37 @@ +import { useQuery, type QueryClient } from "@tanstack/react-query"; +import { ranks, type Role } from "../../../packages/core/src/modules/access/roles"; +import { api, type Resource } from "./api"; +import { useAuth } from "./auth"; + +export type LibraryResource = Resource & { knowledgeBook: boolean }; + +export function useLibrary(id = "") { + const { session } = useAuth(); + return useQuery({ + queryKey: ["library-detail", session?.origin, id], + enabled: !!session && !!id, + staleTime: 0, + queryFn: async ({ signal }) => { + const detail = await api<{ resource: LibraryResource }>(`/resources/${encodeURIComponent(id)}`, { session, signal }); + return detail.resource; + }, + }); +} + +export function canCreateLibraryDocument(resource?: LibraryResource) { + return resource?.kind === "library" && !resource.knowledgeBook && ranks[resource.role as Role] >= ranks.editor; +} + +export function canManageLibrary(resource?: LibraryResource) { + return resource?.kind === "library" && ranks[resource.role as Role] >= ranks.manager; +} + +export async function refreshResources(client: QueryClient, origin: string, libraryId?: string) { + await Promise.all([ + client.invalidateQueries({ queryKey: ["resources", origin] }), + ...(libraryId ? [ + client.invalidateQueries({ queryKey: ["library-detail", origin, libraryId] }), + client.invalidateQueries({ queryKey: ["library-tree", origin, libraryId] }), + ] : []), + ]); +} diff --git a/apps/mobile/src/library-tree.tsx b/apps/mobile/src/library-tree.tsx index 81236b60..9a1e7207 100644 --- a/apps/mobile/src/library-tree.tsx +++ b/apps/mobile/src/library-tree.tsx @@ -21,7 +21,7 @@ type Row = { expanded: boolean; }; -export function LibraryTree({ libraryId }: { libraryId: string }) { +export function LibraryTree({ libraryId, refreshLibrary }: { libraryId: string; refreshLibrary: () => Promise }) { const router = useRouter(); const { session } = useAuth(); const { locale, t } = useI18n(); @@ -35,7 +35,7 @@ export function LibraryTree({ libraryId }: { libraryId: string }) { { session, signal }, ), }); - const pull = usePull(() => query.refetch()); + const pull = usePull(() => Promise.all([query.refetch(), refreshLibrary()])); const rows = useMemo(() => flatten(query.data?.items ?? [], expanded), [expanded, query.data?.items]); if (query.isLoading) return ; diff --git a/apps/mobile/src/permissions/api.ts b/apps/mobile/src/permissions/api.ts new file mode 100644 index 00000000..e69c7464 --- /dev/null +++ b/apps/mobile/src/permissions/api.ts @@ -0,0 +1,144 @@ +import type { MessageKey } from "@doca/i18n"; +import { useMutation, useQuery, useQueryClient, type QueryClient } from "@tanstack/react-query"; +import { ApiError, api } from "../api"; +import { useAuth } from "../auth"; + +export type PermissionKind = "document" | "library" | "folder"; +export type PermissionTarget = { kind: PermissionKind; id: string }; +export type PermissionView = "main" | "settings" | "members" | "invite" | "member" | "group" | "links" | "request"; +export type Visibility = "invited" | "requestable" | "authenticated" | "public"; +export type Person = { id: string; display_name: string; public_id?: string | null }; +export type ResourceSource = { + type: "owner" | "direct" | "link" | "parent_override" | "parent_inherited" | "group"; + id: string | null; + role: string; + status: string; + includeDescendants: boolean; + groupName?: string; +}; +export type ResourceMember = Person & { + role: string; + personalRole: string | null; + personalIncludeDescendants: boolean; + canAdjust: boolean; + sources: string[]; + sourceDetails: ResourceSource[]; +}; +export type FolderMember = Omit & { + user_id: string; + role: string; + personalRole: string | null; + canAdjust: boolean; + sources: { type: string; role: string; groupName?: string }[]; +}; + +type AccessIdentity = { + role: string; + currentUser: Person | null; + canManage: boolean; + isOwner: boolean; +}; +export type ResourceOverview = AccessIdentity & { + rank: number; + version: number; + authzRevision: number; + accessMode: "inherit" | "custom"; + hasParent: boolean; + supportsDescendants: boolean; + inheritedFields: string[]; + effectiveVisibility: Visibility; + effectiveRequestsEnabled: boolean; + internetPublication: boolean; + publicRole: string; + historyReaders: boolean; + publicContainerId: string | null; + requestRoles: string[]; + administrators: (Person & { role?: string })[]; + members: ResourceMember[]; +}; +export type FolderOverview = AccessIdentity & { owner: Person | null; members: FolderMember[] }; +export type AccessOverview = { type: "resource"; data: ResourceOverview } | { type: "folder"; data: FolderOverview }; +export type GroupGrant = { + groupId: string; + name: string; + role: string; + status: string; + includeDescendants: boolean; + inherited: boolean; + canAdjust: boolean; +}; +export type GroupGrants = { items: GroupGrant[]; revision: number }; + +export const idPattern = /^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/i; +export const publicRoles = ["reader", "commenter", "editor"] as const; +export const visibilityLabel: Record = { + invited: "permissionsUi.privateHelp", + requestable: "permissionsUi.requestHelp", + authenticated: "policy.authenticated", + public: "policy.public", +}; +const roleLabels: Readonly>> = { + none: "role.none", reader: "role.reader", commenter: "role.commenter", editor: "role.editor", + manager: "role.manager", admin: "role.manager", owner: "role.owner", +}; + +export function roleText(t: (key: MessageKey) => string, role: string) { + const label = roleLabels[role]; + return label ? t(label) : role; +} + +export function memberRoles(kind: PermissionKind, isOwner: boolean): string[] { + if (kind === "folder") return isOwner ? ["reader", "admin"] : ["reader"]; + return isOwner ? [...publicRoles, "manager"] : [...publicRoles]; +} + +export function accessPath(target: PermissionTarget) { + return `${target.kind === "folder" ? "/files/folders" : "/resources"}/${encodeURIComponent(target.id)}`; +} + +export function accessRoute(target: PermissionTarget, view: PermissionView = "main", subject?: string) { + return { pathname: "/permissions" as const, params: { ...target, view, ...(subject ? { subject } : {}) } }; +} + +export function useAccessOverview(target: PermissionTarget, enabled = true) { + const { session } = useAuth(); + const path = accessPath(target); + return useQuery({ + queryKey: ["access", session?.origin, target.kind, target.id, "overview"], + enabled: !!session && enabled && idPattern.test(target.id), + staleTime: 0, + queryFn: async ({ signal }): Promise => target.kind === "folder" + ? { type: "folder", data: await api(`${path}/shares`, { session, signal }) } + : { type: "resource", data: await api(`${path}/permission-overview`, { session, signal }) }, + }); +} + +export function useAccessQuery(target: PermissionTarget, suffix: string, enabled = true) { + const { session } = useAuth(); + return useQuery({ + queryKey: ["access", session?.origin, target.kind, target.id, suffix], + enabled: !!session && enabled, + staleTime: 0, + queryFn: ({ signal }) => api(`${accessPath(target)}/${suffix}`, { session, signal }), + }); +} + +export async function refreshAccess(client: QueryClient, origin: string, kind?: PermissionKind) { + const keys = ["access", "tickets", "notifications", "group-access"]; + if (!kind || kind === "folder") keys.push("files"); + if (kind !== "folder") keys.push("resources", "library-detail", "library-tree"); + await Promise.all(keys.map((key) => client.invalidateQueries({ queryKey: [key, origin] }))); +} + +export type AccessWrite = { path: string; method: "PUT" | "POST" | "DELETE"; body?: unknown }; + +export function useAccessWrite(kind?: PermissionKind) { + const { session } = useAuth(); + const client = useQueryClient(); + const refresh = () => session ? refreshAccess(client, session.origin, kind) : undefined; + return useMutation({ + mutationFn: ({ path, method, body }: AccessWrite) => api(path, { session, method, body }), + onSuccess: refresh, + onError: (error) => error instanceof ApiError && [403, 404, 409].includes(error.status) ? refresh() : undefined, + }); +} diff --git a/apps/mobile/src/permissions/invite.tsx b/apps/mobile/src/permissions/invite.tsx new file mode 100644 index 00000000..30313070 --- /dev/null +++ b/apps/mobile/src/permissions/invite.tsx @@ -0,0 +1,116 @@ +import { useInfiniteQuery } from "@tanstack/react-query"; +import { useRouter } from "expo-router"; +import { useState } from "react"; +import { Keyboard } from "react-native"; +import { Text, TextInput } from "react-native-paper"; +import { api } from "../api"; +import { useAuth } from "../auth"; +import { colors } from "../chrome"; +import { useI18n } from "../locale"; +import { FormButton, FormChoices, FormFeedback, FormRow, FormSection } from "../resource-forms"; +import { accessPath, memberRoles, useAccessQuery, useAccessWrite, type AccessOverview, type AccessWrite, type GroupGrants, type PermissionTarget, type Person } from "./api"; +import { GrantFields } from "./members"; + +type Recipient = { id: string; label: string; detail?: string }; +type GroupDirectory = { items: { id: string; name: string; ownerName: string }[]; mode: "member" | "related" | "all"; nextCursor: string | null }; + +export function AccessInvite({ target, overview }: { target: PermissionTarget; overview: AccessOverview }) { + const { session } = useAuth(); + const { t } = useI18n(); + const router = useRouter(); + const [recipientKind, setRecipientKind] = useState<"person" | "group">("person"); + const [input, setInput] = useState(""); + const [term, setTerm] = useState(""); + const [recipient, setRecipient] = useState(); + const [role, setRole] = useState("reader"); + const [scope, setScope] = useState(true); + const [message, setMessage] = useState(""); + const group = recipientKind === "group"; + const roles = memberRoles(target.kind, overview.data.isOwner); + const supportsDescendants = overview.type === "resource" && overview.data.supportsDescendants; + const grants = useAccessQuery(target, "group-grants", group && !!recipient); + const write = useAccessWrite<{ pending?: boolean }>(target.kind); + const directory = useInfiniteQuery({ + queryKey: ["access-directory", session?.origin, recipientKind, term], + enabled: !!session && !!term && !recipient, + initialPageParam: "", + queryFn: async ({ signal, pageParam }) => { + const params = new URLSearchParams({ q: term }); + if (pageParam) params.set("cursor", pageParam); + if (group) { + const page = await api(`/groups/lookup?${params}`, { session, signal }); + return { ...page, items: page.items.map((item) => ({ id: item.id, label: item.name, detail: item.ownerName })) }; + } + const page = await api<{ items: Person[] }>(`/users/lookup?${params}`, { session, signal }); + return { items: page.items.map((item) => ({ id: item.id, label: item.display_name, detail: item.public_id ?? undefined })), mode: undefined, nextCursor: null }; + }, + getNextPageParam: (page) => page.nextCursor ?? undefined, + }); + const people = directory.data?.pages.flatMap((page) => page.items) ?? []; + const mode = directory.data?.pages[0]?.mode; + + function search() { + if (!input.trim()) return; + Keyboard.dismiss(); + if (term === input.trim()) void directory.refetch(); + else setTerm(input.trim()); + } + + function invite() { + if (!recipient || (group && !grants.data) || !roles.includes(role) || write.isPending) return; + const path = accessPath(target); + let command: AccessWrite; + if (group) { + command = { path: `${path}/group-grants/${recipient.id}`, method: "PUT", body: { revision: grants.data!.revision, role, includeDescendants: target.kind === "folder" || (supportsDescendants && scope) } }; + } else if (overview.type === "resource") { + command = { path: `${path}/members/${recipient.id}`, method: "PUT", body: { revision: overview.data.authzRevision, role, includeDescendants: supportsDescendants && scope, message: message.trim() } }; + } else { + command = { path: `${path}/shares`, method: "PUT", body: { userId: recipient.id, role, message: message.trim() } }; + } + Keyboard.dismiss(); + write.mutate(command); + } + + return ( + + {write.isSuccess ? ( + <> + + router.back()}>{t("dialog.close")} + + ) : ( + <> + { + setRecipientKind(kind); + setRecipient(undefined); + setInput(""); + setTerm(""); + write.reset(); + }} /> + {recipient ? ( + <> + + { setRecipient(undefined); write.reset(); }}>{t("personPicker.reselect")} + {t("permissionsUi.inviteAccess")} + + {!group ? : null} + + {group && grants.isError ? void grants.refetch()}>{t("shell.retry")} : null} + {t("permissionsUi.sendInvite")} + + ) : ( + <> + { setInput(value); setTerm(""); }} maxLength={160} returnKeyType="search" autoCorrect={false} onSubmitEditing={search} /> + {t("common.search")} + + {mode ? {t("groups.searchScope", { scope: t(`groups.scope.${mode}`) })} : null} + {directory.isSuccess && term && !people.length ? {t(group ? "groups.noSearchResults" : "users.noMatches")} : null} + {people.map((person) => setRecipient(person)} />)} + {directory.hasNextPage ? void directory.fetchNextPage()}>{t("navigation.more")} : null} + + )} + + )} + + ); +} diff --git a/apps/mobile/src/permissions/links.tsx b/apps/mobile/src/permissions/links.tsx new file mode 100644 index 00000000..3eee303f --- /dev/null +++ b/apps/mobile/src/permissions/links.tsx @@ -0,0 +1,234 @@ +import { useState } from "react"; +import { Alert, Clipboard, StyleSheet, View } from "react-native"; +import { Text, TextInput } from "react-native-paper"; +import { useAuth } from "../auth"; +import { colors, LoadingState } from "../chrome"; +import { useI18n } from "../locale"; +import { FormButton, FormChoices, FormFeedback, FormRow, FormSection, FormToggle } from "../resource-forms"; +import { accessPath, memberRoles, roleText, useAccessQuery, useAccessWrite, type PermissionTarget, type Person, type ResourceOverview } from "./api"; +import { GrantFields } from "./members"; +import { PolicyInheritance } from "./policies"; + +type ResourceLink = { + id: string; version: string; enabled: boolean; revoked: boolean; expired: boolean; + token: string | null; role: string; includeDescendants: boolean; maxMembers: number | null; + memberCount: number; members: Person[]; expiresAt: string | null; revokedAt: string | null; +}; +type ResourceLinksResponse = { items: ResourceLink[]; revokedItems: ResourceLink[]; sharingEnabled: boolean; supportsDescendants: boolean }; +type FolderLink = { + enabled: boolean; role: string; url: string | null; isOwner: boolean; maxMembers: number | null; + memberCount: number; expiresAt: string | null; revision: number | null; +}; + +function localDate(value: string) { + const date = new Date(value); + return new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString().slice(0, 23); +} + +function expiry(input: string) { + const text = input.trim().replace(" ", "T"); + if (!text) return null; + if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?$/.test(text)) return undefined; + const time = new Date(text); + return Number.isFinite(+time) && localDate(time.toISOString()).startsWith(text) ? time.toISOString() : undefined; +} + +function limit(input: string) { + const text = input.trim(); + if (!text) return null; + const value = Number(text); + return /^\d+$/.test(text) && Number.isSafeInteger(value) && value >= 1 ? value : undefined; +} + +function LinkFields({ maximum, expires, onMaximum, onExpires, busy }: { + maximum: string; expires: string; onMaximum: (value: string) => void; onExpires: (value: string) => void; busy: boolean; +}) { + const { t } = useI18n(); + return ( + <> + + + {[1, 5, 10, 20].map((value) => onMaximum(String(value))}>{value})} + onMaximum("")}>{t("sharingUi.unlimited")} + + + {t("sharingUi.expiryHelp")} + + ); +} + +function useCopyShareLink() { + const { session } = useAuth(); + const [copied, setCopied] = useState(false); + const [manual, setManual] = useState(""); + function copy(hash: string) { + if (!session) return; + const url = `${session.origin}/${hash}`; + setCopied(false); + setManual(""); + try { + Clipboard.setString(url); + setCopied(true); + } catch { + setManual(url); + } + } + return { copy, copied, manual }; +} + +function ShareFeedback({ copy }: { copy: ReturnType }) { + const { t } = useI18n(); + return copy.manual ? {copy.manual} : ; +} + +export function ResourceLinks({ target, data }: { target: PermissionTarget; data: ResourceOverview }) { + const { t } = useI18n(); + const links = useAccessQuery(target, "share-link"); + if (links.isPending) return ; + if (!links.data) return <> void links.refetch()}>{t("shell.retry")}; + return ; +} + +function ResourceLinkForm({ target, data, links }: { target: PermissionTarget; data: ResourceOverview; links: ResourceLinksResponse }) { + const { t } = useI18n(); + const roles = memberRoles(target.kind, data.isOwner); + const [initial] = useState(() => links.items.find((item) => item.enabled && !item.expired && roles.includes(item.role))); + const [role, setRole] = useState(initial?.role ?? "reader"); + const [descendants, setDescendants] = useState(initial?.includeDescendants ?? true); + const [maximum, setMaximum] = useState(initial ? initial.maxMembers?.toString() ?? "" : "1"); + const [expires, setExpires] = useState(initial?.expiresAt ? localDate(initial.expiresAt) : ""); + const [history, setHistory] = useState<"active" | "revoked">("active"); + const [expanded, setExpanded] = useState(); + const write = useAccessWrite(target.kind); + const copy = useCopyShareLink(); + const path = accessPath(target); + const maxMembers = limit(maximum); + const expiresAt = expiry(expires); + const records = history === "active" ? links.items : links.revokedItems; + + function create() { + if (!roles.includes(role) || maxMembers === undefined || expiresAt === undefined) return; + write.mutate({ path: `${path}/share-link`, method: "PUT", body: { version: null, enabled: true, role, includeDescendants: links.supportsDescendants && descendants, maxMembers, expiresAt } }, { + onSuccess: (link) => { if (link.token) copy.copy(`#/s/${link.token}`); }, + }); + } + + return ( + <> + + write.mutate({ path: `${path}/share-links/enabled`, method: "PUT", body: { enabled } })} /> + write.mutate({ path: `${path}/permissions`, method: "PUT", body: { version: data.version, resetFields: ["share_links_enabled"] } })} /> + {links.sharingEnabled ? ( + <> + {t("sharingUi.linkAccess")} + + + {t("sharingUi.copyLink")} + + ) : null} + + + + {links.sharingEnabled ? ( + + + {!records.length ? {t(history === "active" ? "sharingUi.historyEmpty" : "sharingUi.noRevocations")} : null} + {records.map((record) => { + const canChange = roles.includes(record.role) && !record.revoked && !write.isPending; + return ( + + {t("sharingUi.linkId")} {record.id} + {roleText(t, record.role)} · {t(record.revoked ? "sharingUi.revoked" : record.expired ? "ticket.expired" : record.enabled ? "sharingUi.valid" : "users.disabled")} + {links.supportsDescendants ? {t(record.includeDescendants ? "role.scope.descendants" : "role.scope.node")} : null} + {record.maxMembers === null ? t("sharingUi.unlimited") : t("sharingUi.limit", { count: record.maxMembers })} {t("sharingUi.acceptedCount", { count: record.memberCount }).trim()} + {record.expiresAt ? t("sharingUi.expiresAt", { date: new Date(record.expiresAt).toLocaleString() }) : t("sharingUi.noExpiry")} + {record.revokedAt ? {t("sharingUi.revokedAt", { date: new Date(record.revokedAt).toLocaleString() })} : null} + {record.members.length ? setExpanded(expanded === record.id ? undefined : record.id)} /> : {t("sharingUi.noAccepted")}} + {expanded === record.id ? record.members.map((person) => ) : null} + + {record.token ? copy.copy(`#/s/${record.token}`)}>{t("sharingUi.copyThis")} : null} + {!record.revoked ? ( + <> + write.mutate({ path: `${path}/share-link`, method: "PUT", body: { version: record.version, enabled: !record.enabled, role: record.role, includeDescendants: record.includeDescendants, maxMembers: record.maxMembers } })}> + {t(record.enabled ? "sharingUi.disable" : "sharingUi.enable")} + + Alert.alert(t("sharingUi.revoke"), t("sharingUi.revokeHelp"), [ + { text: t("common.cancel"), style: "cancel" }, + { text: t("sharingUi.confirmRevoke"), style: "destructive", onPress: () => write.mutate({ path: `${path}/share-links/${record.id}/revoke`, method: "POST", body: { version: record.version } }) }, + ])}>{t("sharingUi.revoke")} + + ) : null} + + + ); + })} + + + + ) : null} + + ); +} + +export function FolderLinks({ target }: { target: PermissionTarget }) { + const { t } = useI18n(); + const link = useAccessQuery(target, "share-link"); + if (link.isPending) return ; + if (!link.data) return <> void link.refetch()}>{t("shell.retry")}; + return ; +} + +function FolderLinkForm({ target, link }: { target: PermissionTarget; link: FolderLink }) { + const { t } = useI18n(); + const copy = useCopyShareLink(); + const write = useAccessWrite("folder"); + const [roleDraft, setRole] = useState(); + const [limitDraft, setLimit] = useState(); + const [expiryDraft, setExpiry] = useState(); + const baseMaximum = link.maxMembers?.toString() ?? ""; + const baseExpiry = link.expiresAt ? localDate(link.expiresAt) : ""; + const role = roleDraft ?? link.role; + const maximum = limitDraft ?? baseMaximum; + const expires = expiryDraft ?? baseExpiry; + const maxMembers = limit(maximum); + const expiresAt = expiry(expires); + const roles = memberRoles("folder", link.isOwner); + const busy = write.isPending || !roles.includes(link.role); + const changed = role !== link.role || maximum !== baseMaximum || expires !== baseExpiry; + + function update(change: Partial> & { rotate?: boolean }, reset = false) { + write.mutate({ path: `${accessPath(target)}/share-link`, method: "PUT", body: { enabled: link.enabled, role: link.role, revision: link.revision, ...change } }, { + onSuccess: () => { if (reset) { setRole(undefined); setLimit(undefined); setExpiry(undefined); } }, + }); + } + + return ( + + update({ enabled })} /> + {link.enabled ? ( + <> + + {t("sharingUi.permission")} + + + { + if (maxMembers !== undefined && expiresAt !== undefined) update({ role, maxMembers, expiresAt }, true); + }}>{t("common.confirm")} + {link.maxMembers === null ? t("sharingUi.unlimited") : t("sharingUi.limit", { count: link.maxMembers })} {t("sharingUi.acceptedCount", { count: link.memberCount }).trim()} + + {link.url ? copy.copy(link.url!)}>{t("sharingUi.copyLink")} : null} + update({ rotate: true })}>{t("sharingUi.changeLink")} + + + ) : null} + + + + ); +} + +const styles = StyleSheet.create({ + actions: { flexDirection: "row", flexWrap: "wrap", gap: 6 }, + record: { gap: 8, paddingVertical: 12, borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: colors.line }, + muted: { color: colors.secondary }, +}); diff --git a/apps/mobile/src/permissions/members.tsx b/apps/mobile/src/permissions/members.tsx new file mode 100644 index 00000000..4b50283c --- /dev/null +++ b/apps/mobile/src/permissions/members.tsx @@ -0,0 +1,253 @@ +import { useInfiniteQuery } from "@tanstack/react-query"; +import { useRouter } from "expo-router"; +import { useState } from "react"; +import { Alert, StyleSheet, View } from "react-native"; +import { Text } from "react-native-paper"; +import { api } from "../api"; +import { useAuth } from "../auth"; +import { colors, EmptyState, LoadingState } from "../chrome"; +import { useI18n } from "../locale"; +import { FormButton, FormChoices, FormFeedback, FormRow, FormSection, FormToggle } from "../resource-forms"; +import { accessPath, accessRoute, idPattern, memberRoles, roleText, useAccessQuery, useAccessWrite, type AccessOverview, type AccessWrite, type FolderMember, type GroupGrant, type GroupGrants, type PermissionTarget, type Person, type ResourceMember, type ResourceOverview, type ResourceSource } from "./api"; + +type MemberData = ResourceMember | FolderMember; +const memberId = (member: MemberData) => "id" in member ? member.id : member.user_id; +const grantKey = (group: GroupGrant) => `${group.groupId}:${group.status}`; + +export function GrantFields({ roles, role, onRole, descendants, onDescendants, busy }: { + roles: readonly string[]; + role: string; + onRole: (value: string) => void; + descendants?: boolean; + onDescendants?: (value: boolean) => void; + busy: boolean; +}) { + const { t } = useI18n(); + return ( + <> + ({ value, label: roleText(t, value) }))} value={role} onChange={onRole} disabled={busy} /> + {descendants !== undefined && onDescendants ? : null} + + ); +} + +export function AccessMembers({ target, overview }: { target: PermissionTarget; overview: AccessOverview }) { + const { t } = useI18n(); + const router = useRouter(); + const groups = useAccessQuery(target, "group-grants"); + const owner = overview.type === "folder" ? overview.data.owner : null; + return ( + <> + + router.push(accessRoute(target, "invite"))}>{t("groups.inviteCollaborator")} + {owner ? ( + router.push(accessRoute(target, "member", owner.id))} /> + ) : null} + {overview.data.members.map((member) => router.push(accessRoute(target, "member", memberId(member)))} + />)} + {!overview.data.members.length ? {t("permissionsUi.noCollaborators")} : null} + + + {groups.isPending ? : null} + + {groups.isError ? void groups.refetch()}>{t("shell.retry")} : null} + {groups.data?.items.map((group) => ( + router.push(accessRoute(target, "group", grantKey(group)))} + /> + ))} + {groups.data?.items.length === 0 ? {t("groups.noGrants")} : null} + + + ); +} + +export function AccessMember({ target, overview, subject }: { target: PermissionTarget; overview: AccessOverview; subject?: string }) { + const { t } = useI18n(); + const member = overview.data.members.find((item) => memberId(item) === subject); + const [roleDraft, setRole] = useState(); + const [scopeDraft, setScope] = useState(); + const write = useAccessWrite(target.kind); + const owner = overview.type === "folder" ? overview.data.owner : null; + if (owner && owner.id === subject) { + return ; + } + if (!member) return write.isSuccess + ? + : ; + const path = accessPath(target); + const id = memberId(member); + const baseRole = member.personalRole ?? member.role; + const baseScope = "personalIncludeDescendants" in member && member.personalIncludeDescendants; + const role = roleDraft ?? baseRole; + const scope = scopeDraft ?? baseScope; + const roles = memberRoles(target.kind, overview.data.isOwner); + const supportsDescendants = overview.type === "resource" && overview.data.supportsDescendants; + + function save(value: string | null) { + let command: AccessWrite; + if (overview.type === "resource") { + command = { method: "PUT", path: `${path}/members/${id}`, body: { revision: overview.data.authzRevision, role: value, includeDescendants: supportsDescendants && scope } }; + } else if (value) { + command = { method: "PUT", path: `${path}/shares`, body: { userId: id, role: value } }; + } else { + command = { method: "DELETE", path: `${path}/shares/${id}` }; + } + write.mutate(command, { onSuccess: () => { setRole(undefined); setScope(undefined); } }); + } + + return ( + <> + + + {!member.personalRole && member.role !== "owner" ? {t("permissionsUi.groupOnlyAccess")} : null} + {member.personalRole && member.personalRole !== member.role ? {t("permissionsUi.effectiveAccess", { role: roleText(t, member.role) })} : null} + {member.canAdjust ? ( + <> + + save(role)}>{t("common.confirm")} + {member.personalRole ? Alert.alert(t("permissionsUi.removeAuthorization"), t("permissionsUi.removeAuthorizationConfirm", { name: member.display_name }), [ + { text: t("common.cancel"), style: "cancel" }, + { text: t("permissionsUi.confirmRevoke"), style: "destructive", onPress: () => save(null) }, + ])}>{t("permissionsUi.removeAuthorization")} : null} + + ) : null} + + + + {overview.type === "resource" && "sourceDetails" in member ? member.sourceDetails.map((source, index) => ( + + )) : member.sources.map((source, index) => typeof source === "string" ? null : ( + + ))} + + + ); +} + +function ResourceGrantSource({ source, target, data, member }: { source: ResourceSource; target: PermissionTarget; data: ResourceOverview; member: ResourceMember }) { + const { t } = useI18n(); + const [editing, setEditing] = useState(false); + const [roleDraft, setRole] = useState(); + const [scopeDraft, setScope] = useState(); + const role = roleDraft ?? source.role; + const scope = scopeDraft ?? source.includeDescendants; + const write = useAccessWrite(target.kind); + const mutable = member.canAdjust && (source.type === "direct" || source.type === "link" || source.type === "parent_override"); + const active = source.status !== "disabled"; + const override = source.type === "parent_override"; + const label = source.type === "owner" ? t("permissionsUi.ownerSource") + : source.type === "group" ? t("groups.groupSource", { name: source.groupName ?? "" }) + : source.type === "parent_inherited" ? t("permissionsUi.parentSource") + : override ? t(active ? "permissionsUi.overrideParent" : "permissionsUi.blockParent") + : source.type === "link" ? t("permissionsUi.shareSource", { id: source.id ?? "" }) : t("permissionsUi.directGrant"); + const removeLabel = t(override ? "permissionsUi.clearOverride" : "permissionsUi.deleteSource"); + const roles = memberRoles(target.kind, data.isOwner); + + function save(action: "update" | "delete") { + write.mutate({ + path: `${accessPath(target)}/permission-sources/${member.id}`, + method: "PUT", + body: { revision: data.authzRevision, sourceType: source.type, sourceId: source.id, action, ...(action === "update" ? { role, includeDescendants: data.supportsDescendants && scope } : {}) }, + }, { onSuccess: () => { setEditing(false); setRole(undefined); setScope(undefined); } }); + } + + return ( + + setEditing(!editing) : undefined} /> + {editing && mutable ? ( + <> + {active ? ( + <> + + save("update")}>{t("common.confirm")} + + ) : null} + + Alert.alert(removeLabel, override ? t("permissionsUi.clearOverrideConfirm") : t("permissionsUi.deleteSourceConfirm", { name: label }), [ + { text: t("common.cancel"), style: "cancel" }, + { text: removeLabel, style: "destructive", onPress: () => save("delete") }, + ])}>{removeLabel} + + ) : null} + + ); +} + +export function AccessGroup({ target, overview, subject }: { target: PermissionTarget; overview: AccessOverview; subject?: string }) { + const { t } = useI18n(); + const router = useRouter(); + const grants = useAccessQuery(target, "group-grants"); + const group = grants.data?.items.find((grant) => grantKey(grant) === subject); + if (grants.isPending) return ; + if (grants.isError) return ; + if (!group || !grants.data) return ; + return router.back()} />; +} + +function GroupDetails({ target, overview, group, revision, removed }: { target: PermissionTarget; overview: AccessOverview; group: GroupGrant; revision: number; removed: () => void }) { + const { t } = useI18n(); + const { session } = useAuth(); + const [roleDraft, setRole] = useState(); + const [scopeDraft, setScope] = useState(); + const role = roleDraft ?? group.role; + const scope = scopeDraft ?? group.includeDescendants; + const supportsDescendants = overview.type === "resource" && overview.data.supportsDescendants; + const roles = memberRoles(target.kind, overview.data.isOwner); + const write = useAccessWrite<{ pending: boolean }>(target.kind); + const path = `${accessPath(target)}/group-grants/${group.groupId}`; + const members = useInfiniteQuery({ + queryKey: ["access", session?.origin, target.kind, target.id, "group-members", group.groupId], + enabled: !!session && idPattern.test(group.groupId) && group.status === "active", + initialPageParam: "", + queryFn: ({ pageParam, signal }) => api<{ items: Person[]; total: number; nextCursor: string | null }>(`${path}/members${pageParam ? `?cursor=${encodeURIComponent(pageParam)}` : ""}`, { session, signal }), + getNextPageParam: (page) => page.nextCursor ?? undefined, + }); + + function save(value: string | null) { + write.mutate({ path, method: "PUT", body: { revision, role: value, includeDescendants: target.kind === "folder" || (supportsDescendants && scope) } }, { + onSuccess: () => { if (value === null) removed(); else { setRole(undefined); setScope(undefined); } }, + }); + } + + return ( + <> + + + {group.canAdjust ? ( + <> + + save(role)}>{t("common.confirm")} + Alert.alert(t("groups.removeGrant"), t("groups.removeGrantConfirm", { name: group.name }), [ + { text: t("common.cancel"), style: "cancel" }, + { text: t("groups.confirmRemoveGrant"), style: "destructive", onPress: () => save(null) }, + ])}>{t("groups.removeGrant")} + + ) : null} + + + {group.status === "active" ? ( + + {members.isLoading ? : null} + + {members.isError ? void members.refetch()}>{t("shell.retry")} : null} + {!members.isError ? members.data?.pages.flatMap((page) => page.items).map((member) => ) : null} + {members.data?.pages[0]?.total === 0 ? {t("groups.noMembers")} : null} + {members.hasNextPage ? void members.fetchNextPage()}>{t("navigation.more")} : null} + + ) : null} + + ); +} + +const styles = StyleSheet.create({ + source: { gap: 8 }, + muted: { color: colors.secondary }, +}); diff --git a/apps/mobile/src/permissions/policies.tsx b/apps/mobile/src/permissions/policies.tsx new file mode 100644 index 00000000..de366b17 --- /dev/null +++ b/apps/mobile/src/permissions/policies.tsx @@ -0,0 +1,123 @@ +import type { MessageKey } from "@doca/i18n"; +import { useRouter } from "expo-router"; +import { useState } from "react"; +import { Text, TextInput } from "react-native-paper"; +import { colors, LoadingState } from "../chrome"; +import { useI18n } from "../locale"; +import { FormButton, FormChoices, FormFeedback, FormRow, FormSection, FormToggle } from "../resource-forms"; +import { accessPath, accessRoute, publicRoles, roleText, useAccessQuery, useAccessWrite, type PermissionTarget, type ResourceOverview } from "./api"; + +export function PolicyInheritance({ data, field, reset, disabled }: { + data: ResourceOverview; + field: string; + reset: () => void; + disabled: boolean; +}) { + const { t } = useI18n(); + if (data.accessMode !== "inherit") return null; + return data.inheritedFields.includes(field) + ? {t("permissionsUi.inherited")} + : {t("permissionsUi.restoreParent")}; +} + +export function ResourcePolicy({ target, data }: { target: PermissionTarget; data: ResourceOverview }) { + const { t } = useI18n(); + const router = useRouter(); + const write = useAccessWrite(target.kind); + const visibility = data.effectiveVisibility === "requestable" ? "invited" : data.effectiveVisibility; + const visible = visibility !== "invited"; + const choices: { value: string; label: string }[] = [ + { value: "invited", label: t("resourceAccess.private") }, + { value: "authenticated", label: t("policy.authenticated") }, + ]; + if (data.internetPublication || visibility === "public") choices.push({ value: "public", label: t("policy.public") }); + const [failedChange, setFailedChange] = useState>(); + + function save(change: Record) { + setFailedChange(change); + write.mutate({ path: `${accessPath(target)}/permissions`, method: "PUT", body: { ...change, version: data.version } }); + } + + function inheritance(field: string) { + return save({ resetFields: [field] })} disabled={write.isPending} />; + } + + return ( + + {data.publicContainerId ? ( + router.push(accessRoute({ kind: "library", id: data.publicContainerId! }))} /> + ) : null} + { + if (value !== visibility) save({ visibility: value }); + }} /> + {inheritance("visibility")} + {visible ? ( + <> + {t("permissionsUi.publicPermission")} + ({ value, label: roleText(t, value) }))} disabled={write.isPending} onChange={(value) => { + if (value !== data.publicRole) save({ publicRole: value }); + }} /> + {inheritance("public_role")} + + ) : {t(data.effectiveRequestsEnabled ? "permissionsUi.requestHelp" : "permissionsUi.privateHelp")}} + {target.kind === "library" ? {t("discovery.libraryPublishHelp")} : null} + save({ requestsEnabled: value })} /> + {inheritance("requests_enabled")} + {target.kind === "document" ? ( + <> + save({ historyReaders: value })} /> + {inheritance("history_readers")} + + ) : null} + {t("discovery.policyManaged")} + + {write.isError && failedChange ? save(failedChange)}>{t("shell.retry")} : null} + + ); +} + +export function FolderPublication({ target }: { target: PermissionTarget }) { + const { t } = useI18n(); + const publication = useAccessQuery<{ enabled: boolean; revision: number }>(target, "publication"); + const write = useAccessWrite("folder"); + return ( + + {publication.isPending ? : null} + {publication.data ? ( + { + write.mutate({ path: `${accessPath(target)}/publication`, method: "PUT", body: { enabled, revision: publication.data!.revision } }); + }} /> + ) : null} + {t("discovery.publishHelp")} + + {publication.isError ? void publication.refetch()}>{t("shell.retry")} : null} + + ); +} + +export function AccessRequestForm({ target, data }: { target: PermissionTarget; data: ResourceOverview }) { + const { t } = useI18n(); + const router = useRouter(); + const [role, setRole] = useState(data.rank < 1 ? "reader" : data.rank < 3 ? "editor" : "manager"); + const [message, setMessage] = useState(""); + const value = data.requestRoles.includes(role) ? role : data.requestRoles[0] ?? ""; + const write = useAccessWrite<{ id: string }>(target.kind); + if (!data.effectiveRequestsEnabled || !value) { + return ; + } + const administrators = data.administrators.filter((person) => value !== "manager" || person.role === "owner"); + return ( + + {administrators.length ? {administrators.map((person) => person.display_name).join(" · ")} : null} + {t("ticket.requestedRole")} + ({ value: item, label: roleText(t, item) }))} disabled={write.isPending} onChange={setRole} /> + + + write.mutate({ + path: `${accessPath(target)}/access-requests`, method: "POST", body: { role: value, message: message.trim() }, + }, { onSuccess: ({ id }) => router.replace({ pathname: "/tickets", params: { ticketId: id } }) })}> + {t("share.request")} + + + ); +} diff --git a/apps/mobile/src/resource-forms.tsx b/apps/mobile/src/resource-forms.tsx new file mode 100644 index 00000000..994553ca --- /dev/null +++ b/apps/mobile/src/resource-forms.tsx @@ -0,0 +1,154 @@ +import { useRouter } from "expo-router"; +import { Check, ChevronRight, Plus } from "lucide-react-native"; +import type { ReactNode } from "react"; +import { Pressable, RefreshControl, ScrollView, StyleSheet, View } from "react-native"; +import { Button, Switch, Text, useTheme, type ButtonProps } from "react-native-paper"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import type { Resource } from "./api"; +import { colors } from "./chrome"; +import { useI18n } from "./locale"; + +export function CreateResourceButton({ kind, libraryId }: { kind: Resource["kind"]; libraryId?: string }) { + const router = useRouter(); + const { t } = useI18n(); + return ( + } + onPress={() => router.push({ pathname: "/create-resource", params: libraryId ? { kind, libraryId } : { kind } })} + > + {t(kind === "library" ? "home.newLibrary" : "home.newDocument")} + + ); +} + +export function ResourceForm({ children, refresh }: { children: ReactNode; refresh?: { refreshing: boolean; onRefresh: () => void } }) { + const insets = useSafeAreaInsets(); + return ( + : undefined} + contentContainerStyle={{ + paddingTop: 16, + paddingBottom: Math.max(insets.bottom, 16) + 16, + paddingLeft: Math.max(insets.left, 16), + paddingRight: Math.max(insets.right, 16), + }} + > + {children} + + ); +} + +export function FormSection({ title, children }: { title: string; children: ReactNode }) { + return ( + + {title} + {children} + + ); +} + +export function FormButton({ contentStyle, ...props }: ButtonProps) { + return - - - - {sharing.isLoading ? : null} - {sharing.isError ? ( - - {sharing.error.message} - - - ) : null} - {folder.parent_id === "shared" && sharing.isSuccess ? ( - <> - {t("permissionsUi.collaborators")} - {sharing.data.owner ? ( - - {sharing.data.owner.display_name} - {t("role.owner")} - - ) : null} - {sharing.data.members.map((member) => ( - - {member.display_name} - {t(sharedFolderRole[member.role])} - - ))} - - ) : null} - - - - ) : null} - + router.push(accessRoute({ kind: "folder", id: folder.id }))} + style={({ pressed }) => [styles.entry, pressed && styles.pressed]} + > + + {t("sharingUi.title")} + {inherited ? t("permissionsUi.inherited") : role} + + ); } @@ -87,12 +31,5 @@ const styles = StyleSheet.create({ entry: { minHeight: 48, paddingHorizontal: 14, marginHorizontal: 12, marginBottom: 6, flexDirection: "row", alignItems: "center", gap: 8, borderRadius: 10, backgroundColor: colors.card }, pressed: { backgroundColor: colors.selected }, entryLabel: { flex: 1, color: colors.ink, fontWeight: "600" }, - page: { flex: 1, backgroundColor: colors.card }, - heading: { flexDirection: "row", alignItems: "center", paddingHorizontal: 16, gap: 12 }, - title: { flex: 1, fontWeight: "700", fontSize: 20, color: colors.ink }, - content: { padding: 16, gap: 10 }, - section: { color: colors.ink, fontWeight: "700", marginTop: 10 }, - member: { flexDirection: "row", gap: 8, justifyContent: "space-between", alignItems: "center", minHeight: 42, borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: colors.line }, - name: { flexShrink: 1, color: colors.ink }, muted: { flexShrink: 1, color: colors.secondary, fontSize: 13 }, }); diff --git a/apps/server/src/bootstrap/native-install.ts b/apps/server/src/bootstrap/native-install.ts new file mode 100644 index 00000000..ccf9fffa --- /dev/null +++ b/apps/server/src/bootstrap/native-install.ts @@ -0,0 +1,241 @@ +import { randomBytes } from "node:crypto"; +import { Client } from "pg"; +import { defaultLocale, isLocale, localeNames, locales } from "@doca/i18n"; +import { createUser } from "@core/modules/identity/passwords.js"; +import { openDatabase } from "@db/index.js"; +import { transact } from "@db/transactions.js"; +import { parseFileStoreEnvironment } from "../services/file-store-config.js"; +import { config } from "./config.js"; + +function selectedLocale(value: string = defaultLocale) { + if (!isLocale(value)) throw new Error("Unsupported site language."); + return value; +} + +function postgresUrl(value: string | undefined, label: string) { + try { + const url = new URL(value ?? ""); + if ( + !["postgres:", "postgresql:"].includes(url.protocol) || + !url.hostname || + !url.username || + !url.pathname.slice(1) || + url.hash + ) { + throw new Error(); + } + // The URL is written as a single-quoted environment value. + return url.href.replaceAll("'", "%27"); + } catch { + throw new Error( + label + " must be a PostgreSQL URL with a host, user and database name.", + ); + } +} + +async function checkEmptyDatabases(databases: Record) { + const targets = new Set(); + for (const [label, connectionString] of Object.entries(databases)) { + const url = new URL(connectionString); + const target = [ + url.hostname, + url.port || "5432", + decodeURIComponent(url.pathname), + ].join(":"); + if (targets.has(target)) + throw new Error("Supply a separate database for " + label + "."); + targets.add(target); + + const client = new Client({ + connectionString, + connectionTimeoutMillis: 5000, + query_timeout: 5000, + }); + let occupied; + try { + await client.connect(); + const result = await client.query<{ occupied: boolean }>(` + SELECT EXISTS ( + SELECT 1 FROM pg_catalog.pg_class AS relation + JOIN pg_catalog.pg_namespace AS schema ON schema.oid = relation.relnamespace + WHERE schema.nspname !~ '^pg_' AND schema.nspname <> 'information_schema' + AND relation.relkind IN ('r', 'p', 'v', 'm', 'S', 'f') + ) AS occupied + `); + occupied = result.rows[0]?.occupied; + } catch { + throw new Error( + "Cannot check the " + + label + + " database. Verify the connection settings.", + ); + } finally { + await client.end().catch(() => {}); + } + if (occupied) + throw new Error( + "The " + label + " database must be empty for a new site.", + ); + } +} + +async function configuration() { + const input = process.env; + const database = input.DOCA_SETUP_DATABASE ?? "sqlite"; + const storage = input.DOCA_SETUP_STORAGE ?? "local"; + if (database !== "sqlite" && database !== "postgres") + throw new Error("Unsupported database."); + if (storage !== "local" && storage !== "s3") + throw new Error("Unsupported file storage."); + + const store = + storage === "s3" + ? { + provider: "s3", + bucket: input.DOCA_SETUP_S3_BUCKET, + region: input.DOCA_SETUP_S3_REGION, + endpoint: input.DOCA_SETUP_S3_ENDPOINT || undefined, + forcePathStyle: input.DOCA_SETUP_S3_PATH_STYLE === "yes", + credentials: { + accessKeyId: input.DOCA_SETUP_S3_ACCESS_KEY, + secretAccessKey: input.DOCA_SETUP_S3_SECRET, + sessionToken: input.DOCA_SETUP_S3_SESSION_TOKEN || undefined, + }, + } + : { provider: "local", root: "/var/lib/doca/storage" }; + + const values: Record = { + NODE_ENV: "production", + DOCA_ORIGIN: input.DOCA_SETUP_ORIGIN || "http://127.0.0.1:39120", + DOCA_HOST: "127.0.0.1", + DOCA_PORT: "39120", + DOCA_DATABASE: database, + DOCA_DATA_DIR: "/var/lib/doca", + DOCA_FILE_STORE_ID: storage, + DOCA_FILE_STORES_JSON: JSON.stringify({ + version: 1, + stores: { [storage]: store }, + }).replaceAll("'", "\\u0027"), + DOCA_CREDENTIAL_MASTER_KEY: randomBytes(32).toString("hex"), + DOCA_INSTALL_LOCALE: selectedLocale(input.DOCA_SETUP_LOCALE), + DOCA_PDF_PYTHON: "/opt/doca/python/bin/python", + DOCA_OFFICE_RENDERER: "/usr/bin/soffice", + }; + const databases: Record = {}; + if (database === "sqlite") { + values.DOCA_SQLITE_PATH = "/var/lib/doca/doca.db"; + values.DOCA_AI_SQLITE_PATH = "/var/lib/doca/ai.db"; + } else { + values.DOCA_DATABASE_URL = databases.main = postgresUrl( + input.DOCA_SETUP_POSTGRES_URL, + "Main database", + ); + values.DOCA_WEBHOOK_DATABASE_URL = databases.Webhook = postgresUrl( + input.DOCA_SETUP_WEBHOOK_URL, + "Webhook database", + ); + if (input.DOCA_SETUP_PLUGIN_URL) { + values.DOCA_PLUGIN_DATABASE_URL = databases.plugin = postgresUrl( + input.DOCA_SETUP_PLUGIN_URL, + "Plugin database", + ); + } + } + parseFileStoreEnvironment(values); + Object.assign(process.env, values); + values.DOCA_ORIGIN = config().origin; + await checkEmptyDatabases(databases); + + if (Object.values(values).some((value) => /['\r\n\x00]/u.test(value))) + throw new Error( + "A setting contains characters that cannot be written to the environment file.", + ); + for (const [key, value] of Object.entries(values)) + console.log(key + "='" + value + "'"); +} + +async function initializeSite() { + const locale = selectedLocale(process.env.DOCA_INSTALL_LOCALE); + const login = process.env.DOCA_BOOTSTRAP_LOGIN; + const password = process.env.DOCA_BOOTSTRAP_PASSWORD; + const { database, webhookDatabase } = config(); + if (database.driver === "postgres") { + if (!login || !password) { + process.exitCode = 3; + return; + } + if (webhookDatabase.driver !== "postgres") + throw new Error( + "The native PostgreSQL setup requires a separate Webhook database.", + ); + const databases: Record = { + main: database.url, + Webhook: webhookDatabase.url, + }; + const pluginUrl = process.env.DOCA_PLUGIN_DATABASE_URL; + if (pluginUrl) databases.plugin = pluginUrl; + await checkEmptyDatabases(databases); + } + + const db = await openDatabase(database); + try { + const ready = await transact(db, async (tx) => { + const existing = await tx + .selectFrom("users") + .select("id") + .where("admin", "=", 1) + .executeTakeFirst(); + if (existing) { + if (database.driver === "postgres") + throw new Error( + "Another administrator already exists in the PostgreSQL database.", + ); + return true; + } + if (!login || !password) return false; + await createUser( + tx, + { login, password, displayName: login }, + { bootstrap: true }, + ); + await tx + .updateTable("settings") + .set((eb) => ({ + default_locale: locale, + revision: eb("revision", "+", 1), + })) + .where("id", "=", "system") + .executeTakeFirstOrThrow(); + return true; + }); + if (!ready) process.exitCode = 3; + } finally { + await db.destroy(); + } +} + +try { + switch (process.argv[2]) { + case "locales": + console.log( + locales + .map((locale) => locale + " (" + localeNames[locale] + ")") + .join(", "), + ); + break; + case "configure": + await configuration(); + break; + case "bootstrap": + await initializeSite(); + break; + default: + throw new Error("Unknown native installation command."); + } +} catch (error) { + console.error( + "Doca setup:", + error instanceof Error ? error.message : "Setup failed.", + ); + process.exitCode = 1; +} diff --git a/compose.yaml b/compose.yaml index eff6be72..f8bdfa21 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,14 +1,14 @@ # Production-oriented single-host deployment. # Put the browser-facing HTTP(S) DOCA_ORIGIN in .env. # Use a reverse proxy for HTTPS or internal HTTP; forward to 127.0.0.1:39120. -# The published image is docker.io/smartdoca/doca:0.3.10. +# The published image is docker.io/smartdoca/doca:0.3.11. # `docker compose up -d` pulls that tag. Add `--build` to build from this checkout. services: doca: build: context: . dockerfile: Dockerfile - image: docker.io/smartdoca/doca:0.3.10 + image: docker.io/smartdoca/doca:0.3.11 pull_policy: always restart: unless-stopped init: true diff --git a/docker/doca.service b/docker/doca.service new file mode 100644 index 00000000..0491f4ce --- /dev/null +++ b/docker/doca.service @@ -0,0 +1,22 @@ +[Unit] +Description=Doca document server +After=network.target + +[Service] +Type=exec +User=doca +Group=doca +WorkingDirectory=/opt/doca/app +EnvironmentFile=/etc/doca/doca.env +ExecStart=/opt/doca/bin/node --import tsx apps/server/src/main.ts +Restart=on-failure +RestartSec=3s +TimeoutStopSec=30s +UMask=0077 +NoNewPrivileges=true +PrivateTmp=true +ProtectSystem=strict +ReadWritePaths=/var/lib/doca + +[Install] +WantedBy=multi-user.target diff --git a/docs/README.es.md b/docs/README.es.md index d04fcc9b..2c66aa33 100644 --- a/docs/README.es.md +++ b/docs/README.es.md @@ -4,7 +4,7 @@ [English](README.md) · [简体中文](README.zh-CN.md) · [繁體中文](README.zh-Hant.md) · [日本語](README.ja.md) · [Français](README.fr.md) · [한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md) -Doca es un espacio de trabajo para gestionar documentos y conocimiento, diseñado para personas y equipos pequeños. Estas guías explican cómo instalar, usar, administrar y ampliar Doca. Consulta las [Notas de la versión 0.3.10](releases/0.3.10.es.md) antes de instalar o actualizar. +Doca es un espacio de trabajo para gestionar documentos y conocimiento, diseñado para personas y equipos pequeños. Estas guías explican cómo instalar, usar, administrar y ampliar Doca. Consulta las [Notas de la versión 0.3.11](releases/0.3.11.es.md) antes de instalar o actualizar. [Sitio oficial](https://i.smartdoca.cc) · [Demostración en línea](https://d.smartdoca.cc) · [Mercado de complementos](https://store.smartdoca.cc) @@ -70,7 +70,7 @@ Doca es un espacio de trabajo para gestionar documentos y conocimiento, diseñad - [Contrato de almacenamiento de complementos](plugin-horizontal-scaling.es.md) - [Contrato de colaboración](collaboration-sdk-contract.es.md) - [Intercambio de archivos](editor-file-exchange-contract.es.md) -- [Notas de la versión](releases/0.3.10.es.md) +- [Notas de la versión](releases/0.3.11.es.md) - [Mantenimiento de la documentación](documentation.es.md) - [Registros de investigación y verificación](research.es.md) diff --git a/docs/README.fr.md b/docs/README.fr.md index 2e7c1abc..a59d2a48 100644 --- a/docs/README.fr.md +++ b/docs/README.fr.md @@ -4,7 +4,7 @@ [English](README.md) · [简体中文](README.zh-CN.md) · [繁體中文](README.zh-Hant.md) · [日本語](README.ja.md) · [Français](README.fr.md) · [한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md) -Doca est un espace de travail pour gérer des documents et des connaissances, conçu pour les particuliers et les petites équipes. Ces guides couvrent l’installation, l’utilisation, l’exploitation et les extensions. Consultez les [Notes de version 0.3.10](releases/0.3.10.fr.md) avant d’installer ou de mettre à jour Doca. +Doca est un espace de travail pour gérer des documents et des connaissances, conçu pour les particuliers et les petites équipes. Ces guides couvrent l’installation, l’utilisation, l’exploitation et les extensions. Consultez les [Notes de version 0.3.11](releases/0.3.11.fr.md) avant d’installer ou de mettre à jour Doca. [Site officiel](https://i.smartdoca.cc) · [Démo en ligne](https://d.smartdoca.cc) · [Catalogue de plugins](https://store.smartdoca.cc) @@ -70,7 +70,7 @@ Doca est un espace de travail pour gérer des documents et des connaissances, co - [Contrat de stockage des plugins](plugin-horizontal-scaling.fr.md) - [Contrat de collaboration](collaboration-sdk-contract.fr.md) - [Échange de fichiers](editor-file-exchange-contract.fr.md) -- [Notes de version](releases/0.3.10.fr.md) +- [Notes de version](releases/0.3.11.fr.md) - [Maintenance de la documentation](documentation.fr.md) - [Études et rapports de vérification](research.fr.md) diff --git a/docs/README.ja.md b/docs/README.ja.md index 10eec879..0aa9de16 100644 --- a/docs/README.ja.md +++ b/docs/README.ja.md @@ -4,7 +4,7 @@ [English](README.md) · [简体中文](README.zh-CN.md) · [繁體中文](README.zh-Hant.md) · [日本語](README.ja.md) · [Français](README.fr.md) · [한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md) -Doca は個人や小規模チームで文書とナレッジを管理するためのワークスペースです。ここでは導入、利用、運用、拡張方法を説明します。インストールや更新の前に[リリースノート 0.3.10](releases/0.3.10.ja.md)をご確認ください。 +Doca は個人や小規模チームで文書とナレッジを管理するためのワークスペースです。ここでは導入、利用、運用、拡張方法を説明します。インストールや更新の前に[リリースノート 0.3.11](releases/0.3.11.ja.md)をご確認ください。 [公式サイト](https://i.smartdoca.cc) · [オンラインデモ](https://d.smartdoca.cc) · [プラグインストア](https://store.smartdoca.cc) @@ -70,7 +70,7 @@ Doca は個人や小規模チームで文書とナレッジを管理するため - [プラグインのストレージ仕様](plugin-horizontal-scaling.ja.md) - [共同編集の仕様](collaboration-sdk-contract.ja.md) - [ファイル交換](editor-file-exchange-contract.ja.md) -- [リリースノート](releases/0.3.10.ja.md) +- [リリースノート](releases/0.3.11.ja.md) - [ドキュメントの保守](documentation.ja.md) - [調査・検証記録](research.ja.md) diff --git a/docs/README.ko.md b/docs/README.ko.md index a2e071cd..e028564e 100644 --- a/docs/README.ko.md +++ b/docs/README.ko.md @@ -4,7 +4,7 @@ [English](README.md) · [简体中文](README.zh-CN.md) · [繁體中文](README.zh-Hant.md) · [日本語](README.ja.md) · [Français](README.fr.md) · [한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md) -Doca는 개인과 소규모 팀이 문서와 지식을 관리하는 작업 공간입니다. 이 문서에서는 설치, 사용, 운영, 확장 방법을 안내합니다. 설치하거나 업데이트하기 전에 [릴리스 노트 0.3.10](releases/0.3.10.ko.md)를 확인하세요. +Doca는 개인과 소규모 팀이 문서와 지식을 관리하는 작업 공간입니다. 이 문서에서는 설치, 사용, 운영, 확장 방법을 안내합니다. 설치하거나 업데이트하기 전에 [릴리스 노트 0.3.11](releases/0.3.11.ko.md)를 확인하세요. [공식 웹사이트](https://i.smartdoca.cc) · [온라인 데모](https://d.smartdoca.cc) · [플러그인 마켓](https://store.smartdoca.cc) @@ -70,7 +70,7 @@ Doca는 개인과 소규모 팀이 문서와 지식을 관리하는 작업 공 - [플러그인 저장소 규약](plugin-horizontal-scaling.ko.md) - [공동 편집 규약](collaboration-sdk-contract.ko.md) - [파일 교환](editor-file-exchange-contract.ko.md) -- [릴리스 노트](releases/0.3.10.ko.md) +- [릴리스 노트](releases/0.3.11.ko.md) - [문서 관리](documentation.ko.md) - [조사 및 검증 기록](research.ko.md) diff --git a/docs/README.md b/docs/README.md index bc8e048e..a42f23f1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,7 +2,7 @@ **English** · [简体中文](README.zh-CN.md) · [繁體中文](README.zh-Hant.md) · [日本語](README.ja.md) · [Français](README.fr.md) · [한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md) -Doca is a document and knowledge workspace for individuals and small teams. These guides track current source; follow the [0.3.10 release notes](releases/0.3.10.md) for installation and upgrades. Package contracts identify their own implementation limits. +Doca is a document and knowledge workspace for individuals and small teams. These guides track current source; follow the [0.3.11 release notes](releases/0.3.11.md) for installation and upgrades. Package contracts identify their own implementation limits. [Website](https://i.smartdoca.cc) · [Live demo](https://d.smartdoca.cc) · [Plugin marketplace](https://store.smartdoca.cc) @@ -35,6 +35,6 @@ Doca is a document and knowledge workspace for individuals and small teams. Thes ## Reference and project records -[HTTP API](api.md) · [Database](database.md) · [Plugin SDK contract](plugin-sdk-contract.md) · [Plugin storage contract](plugin-horizontal-scaling.md) · [Collaboration contract](collaboration-sdk-contract.md) · [File exchange](editor-file-exchange-contract.md) · [Release notes](releases/0.3.10.md) · [Documentation maintenance](documentation.md) · [Research and acceptance records](research.md) +[HTTP API](api.md) · [Database](database.md) · [Plugin SDK contract](plugin-sdk-contract.md) · [Plugin storage contract](plugin-horizontal-scaling.md) · [Collaboration contract](collaboration-sdk-contract.md) · [File exchange](editor-file-exchange-contract.md) · [Release notes](releases/0.3.11.md) · [Documentation maintenance](documentation.md) · [Research and acceptance records](research.md) The running application provides `/api/openapi.json`. Proposed capabilities are labeled in the relevant contract; a design record does not establish that an API is exported. Research records retain their original language and date. diff --git a/docs/README.ru.md b/docs/README.ru.md index 0b5c70ef..4e48e9e2 100644 --- a/docs/README.ru.md +++ b/docs/README.ru.md @@ -4,7 +4,7 @@ [English](README.md) · [简体中文](README.zh-CN.md) · [繁體中文](README.zh-Hant.md) · [日本語](README.ja.md) · [Français](README.fr.md) · [한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md) -Doca — рабочее пространство для документов и базы знаний, рассчитанное на частных пользователей и небольшие команды. В этих руководствах описано, как установить, использовать, администрировать и расширять Doca. Перед установкой или обновлением прочтите [Примечания к выпуску 0.3.10](releases/0.3.10.ru.md). +Doca — рабочее пространство для документов и базы знаний, рассчитанное на частных пользователей и небольшие команды. В этих руководствах описано, как установить, использовать, администрировать и расширять Doca. Перед установкой или обновлением прочтите [Примечания к выпуску 0.3.11](releases/0.3.11.ru.md). [Официальный сайт](https://i.smartdoca.cc) · [Онлайн-демо](https://d.smartdoca.cc) · [Каталог плагинов](https://store.smartdoca.cc) @@ -70,7 +70,7 @@ Doca — рабочее пространство для документов и - [Контракт хранения данных плагинов](plugin-horizontal-scaling.ru.md) - [Контракт совместного редактирования](collaboration-sdk-contract.ru.md) - [Обмен файлами](editor-file-exchange-contract.ru.md) -- [Примечания к выпуску](releases/0.3.10.ru.md) +- [Примечания к выпуску](releases/0.3.11.ru.md) - [Сопровождение документации](documentation.ru.md) - [Материалы исследований и проверок](research.ru.md) diff --git a/docs/README.zh-CN.md b/docs/README.zh-CN.md index 882eb364..21ebacbc 100644 --- a/docs/README.zh-CN.md +++ b/docs/README.zh-CN.md @@ -2,7 +2,7 @@ [English](README.md) · **简体中文** · [繁體中文](README.zh-Hant.md) · [日本語](README.ja.md) · [Français](README.fr.md) · [한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md) -Doca 是面向个人和小团队的文档与知识工作台。本套文档随当前源码维护;安装与升级请对照 [0.3.10 发行说明](releases/0.3.10.zh-CN.md),组件契约另行注明实现限制。 +Doca 是面向个人和小团队的文档与知识工作台。本套文档随当前源码维护;安装与升级请对照 [0.3.11 发行说明](releases/0.3.11.zh-CN.md),组件契约另行注明实现限制。 [官网](https://i.smartdoca.cc) · [Demo 体验](https://d.smartdoca.cc) · [插件商城](https://store.smartdoca.cc) @@ -35,6 +35,6 @@ Doca 是面向个人和小团队的文档与知识工作台。本套文档随当 ## 技术参考与项目记录 -[HTTP API](api.zh-CN.md) · [数据库](database.zh-CN.md) · [插件 SDK 契约](plugin-sdk-contract.zh-CN.md) · [插件存储契约](plugin-horizontal-scaling.zh-CN.md) · [协同契约](collaboration-sdk-contract.zh-CN.md) · [文件交换](editor-file-exchange-contract.zh-CN.md) · [发行说明](releases/0.3.10.zh-CN.md) · [文档维护](documentation.zh-CN.md) · [研发与验收资料](research.zh-CN.md) +[HTTP API](api.zh-CN.md) · [数据库](database.zh-CN.md) · [插件 SDK 契约](plugin-sdk-contract.zh-CN.md) · [插件存储契约](plugin-horizontal-scaling.zh-CN.md) · [协同契约](collaboration-sdk-contract.zh-CN.md) · [文件交换](editor-file-exchange-contract.zh-CN.md) · [发行说明](releases/0.3.11.zh-CN.md) · [文档维护](documentation.zh-CN.md) · [研发与验收资料](research.zh-CN.md) 运行中的应用提供 `/api/openapi.json`。相关契约会标明拟议能力;设计记录不代表接口已经导出。研发资料保留原始语言和日期。 diff --git a/docs/README.zh-Hant.md b/docs/README.zh-Hant.md index 3c77cc45..8339bf27 100644 --- a/docs/README.zh-Hant.md +++ b/docs/README.zh-Hant.md @@ -4,7 +4,7 @@ [English](README.md) · [简体中文](README.zh-CN.md) · [繁體中文](README.zh-Hant.md) · [日本語](README.ja.md) · [Français](README.fr.md) · [한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md) -Doca 是為個人和小型團隊設計的文件與知識工作區。這份文件涵蓋安裝、使用、部署與擴充。安裝或升級前,請先閱讀[版本說明 0.3.10](releases/0.3.10.zh-Hant.md)。 +Doca 是為個人和小型團隊設計的文件與知識工作區。這份文件涵蓋安裝、使用、部署與擴充。安裝或升級前,請先閱讀[版本說明 0.3.11](releases/0.3.11.zh-Hant.md)。 [網站](https://i.smartdoca.cc) · [線上展示](https://d.smartdoca.cc) · [外掛市集](https://store.smartdoca.cc) @@ -70,7 +70,7 @@ Doca 是為個人和小型團隊設計的文件與知識工作區。這份文件 - [外掛儲存規範](plugin-horizontal-scaling.zh-Hant.md) - [協作規範](collaboration-sdk-contract.zh-Hant.md) - [檔案交換](editor-file-exchange-contract.zh-Hant.md) -- [版本說明](releases/0.3.10.zh-Hant.md) +- [版本說明](releases/0.3.11.zh-Hant.md) - [文件維護](documentation.zh-Hant.md) - [研究與驗收記錄](research.zh-Hant.md) diff --git a/docs/configuration.md b/docs/configuration.md index 7742e195..c6a95c0f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -29,6 +29,7 @@ Use an HTTP(S) origin without credentials, subpaths, query, or fragment. A root | Entry point | Origin | Database / files | Credential master key | | --- | --- | --- | --- | +| Native Linux installer | Installer choice, default `http://127.0.0.1:39120` | SQLite or PostgreSQL, local disk or S3. Local files and databases live under `/var/lib/doca` | Generated once and stored in `/etc/doca/doca.env` | | Repository Compose | Required in `.env` | SQLite `/data/doca.db`; file ID/JSON required in `.env`; `doca_data` mounted at `/data` | Required; use the persistent deployment key | | Published image without Compose | Must supply an HTTP(S) origin | Image explicitly supplies SQLite and local storage defaults under `/data`; mount persistent `/data` yourself | Required; use the persistent deployment key | | Source development | `http://127.0.0.1:39130` | SQLite `./data/v1/doca.db`; file ID/JSON required, supplied by `.env.example` | Required; replace the public example key | diff --git a/docs/configuration.zh-CN.md b/docs/configuration.zh-CN.md index 0ec591c2..3296f302 100644 --- a/docs/configuration.zh-CN.md +++ b/docs/configuration.zh-CN.md @@ -27,6 +27,7 @@ DOCA_FILE_STORES_JSON='{"version":1,"stores":{"local":{"provider":"local","root" | 启动方式 | 来源地址 | 数据库与文件 | 凭证主密钥 | | --- | --- | --- | --- | +| Linux 原生安装器 | 向导设置,默认 `http://127.0.0.1:39120` | SQLite 或 PostgreSQL、本地磁盘或 S3。本地数据位于 `/var/lib/doca` | 仅生成一次,保存在 `/etc/doca/doca.env` | | 仓库 Compose | `.env` 必填 | SQLite `/data/doca.db`;文件 ID/JSON 在 `.env` 必填;`doca_data` 挂载到 `/data` | 必填,使用持久部署密钥 | | 单独运行发布镜像 | 须提供 HTTP(S) 来源 | 镜像显式提供 `/data` 下的 SQLite 与本地存储默认值;自行挂载持久 `/data` | 必填,使用持久部署密钥 | | 源码开发 | `http://127.0.0.1:39130` | SQLite `./data/v1/doca.db`;文件 ID/JSON 必填,`.env.example` 已提供 | 必填,替换公开示例值 | diff --git a/docs/deployment-without-github.es.md b/docs/deployment-without-github.es.md index 1b2fce64..87cb065a 100644 --- a/docs/deployment-without-github.es.md +++ b/docs/deployment-without-github.es.md @@ -4,13 +4,13 @@ [简体中文](deployment-without-github.zh-CN.md) -El servidor empresarial no necesita un checkout de fuente, Git, Node.js o pnpm. Instale Docker Engine, el complemento Docker Compose, Bash y OpenSSL de antemano, luego transfiera los archivos de despliegue, prepare la imagen, inicie Doca e inicialice al administrador. Esta guía instala Doca 0.3.10 en un servidor único nuevo con SQLite y almacenamiento de archivos local. Las instalaciones existentes deben revisar… [requisitos de liberación](releases/0.3.10.es.md) y preservar sus bases de datos, archivos, configuración y clave maestra de credenciales. +El servidor empresarial no necesita un checkout de fuente, Git, Node.js o pnpm. Instale Docker Engine, el complemento Docker Compose, Bash y OpenSSL de antemano, luego transfiera los archivos de despliegue, prepare la imagen, inicie Doca e inicialice al administrador. Esta guía instala Doca 0.3.11 en un servidor único nuevo con SQLite y almacenamiento de archivos local. Las instalaciones existentes deben revisar… [requisitos de liberación](releases/0.3.11.es.md) y preservar sus bases de datos, archivos, configuración y clave maestra de credenciales. ## Instalación nueva desde un YAML -`node scripts/pack-deployment.mjs` también genera resultados `doca-compose-vVERSION.yaml` y su checksum. Transfiera el YAML, guárdelo como `compose.yaml` En un directorio de despliegue permanente, edita `DOCA_ORIGIN` y tu generación `DOCA_CREDENTIAL_MASTER_KEY`, protegerlo con `chmod 600 compose.yaml`, entonces ejecuta `docker compose up -d`. No `.env`Se necesita un archivo JSON o un script de administrador externo. Utilice la imagen 0.3.10 correspondiente; el YAML independiente y el checksum también se encuentran en el repositorio GitHub. +`node scripts/pack-deployment.mjs` también genera resultados `doca-compose-vVERSION.yaml` y su checksum. Transfiera el YAML, guárdelo como `compose.yaml` En un directorio de despliegue permanente, edita `DOCA_ORIGIN` y tu generación `DOCA_CREDENTIAL_MASTER_KEY`, protegerlo con `chmod 600 compose.yaml`, entonces ejecuta `docker compose up -d`. No `.env`Se necesita un archivo JSON o un script de administrador externo. Utilice la imagen 0.3.11 correspondiente; el YAML independiente y el checksum también se encuentran en el repositorio GitHub. Después de que el servicio esté sano, ejecuta. `docker compose exec doca bash docker/admin.sh bootstrap`; usar `reset-password` Para el restablecimiento de contraseña. La entrada de contraseña está oculta y no se incluye en el YAML. Este ejemplo es solo para instalaciones nuevas de SQLite/local-storage. Los sitios existentes conservan su nombre de proyecto, volúmenes y clave. Los respaldos incluyen el YAML protegido. Los requisitos del reverse-proxy siguen siendo los descritos a continuación. @@ -27,22 +27,22 @@ cd doca node scripts/pack-deployment.mjs ``` -Los nombres de los archivos y las etiquetas de imagen a continuación utilizan 0.3.10 como ejemplo. Utilice los nombres de archivo impresos por el paquete y la imagen especificada en el archivo Compose generado. +Los nombres de los archivos y las etiquetas de imagen a continuación utilizan 0.3.11 como ejemplo. Utilice los nombres de archivo impresos por el paquete y la imagen especificada en el archivo Compose generado. -Transferencia `doca-deploy-v0.3.10.tar.gz` y su `.sha256` Verificación de checksum a través de un servicio de archivos empresarial, una URL de descarga interna o almacenamiento extraíble. El empaquetador solo lee archivos de despliegue públicos y no incluye ningún contenido local. `.env`Datos de usuario o imagen de contenedor. La publicación de GitHub para la etiqueta correspondiente incluye el paquete y el checksum. +Transferencia `doca-deploy-v0.3.11.tar.gz` y su `.sha256` Verificación de checksum a través de un servicio de archivos empresarial, una URL de descarga interna o almacenamiento extraíble. El empaquetador solo lee archivos de despliegue públicos y no incluye ningún contenido local. `.env`Datos de usuario o imagen de contenedor. La publicación de GitHub para la etiqueta correspondiente incluye el paquete y el checksum. Coloque ambos archivos en el mismo directorio del servidor empresarial, verifíquelos y extraiga los datos: ```sh -sha256sum -c doca-deploy-v0.3.10.tar.gz.sha256 -tar -xzf doca-deploy-v0.3.10.tar.gz -cd doca-deploy-v0.3.10 +sha256sum -c doca-deploy-v0.3.11.tar.gz.sha256 +tar -xzf doca-deploy-v0.3.11.tar.gz +cd doca-deploy-v0.3.11 ``` -En macOS, utiliza `shasum -a 256 -c doca-deploy-v0.3.10.tar.gz.sha256`. Ejecute los comandos de despliegue siguientes desde este directorio: +En macOS, utiliza `shasum -a 256 -c doca-deploy-v0.3.11.tar.gz.sha256`. Ejecute los comandos de despliegue siguientes desde este directorio: ```text -doca-deploy-v0.3.10/ +doca-deploy-v0.3.11/ compose.yaml docker.env.example README.zh-CN.md @@ -64,7 +64,7 @@ Para una transferencia de texto, guarde esta configuración de un solo servidor. ```yaml services: doca: - image: docker.io/smartdoca/doca:0.3.10 + image: docker.io/smartdoca/doca:0.3.11 pull_policy: missing restart: unless-stopped init: true @@ -155,21 +155,21 @@ docker compose pull doca El proveedor prepara un archivo de imágenes en una máquina con acceso al registro. Primero, confirme la arquitectura de la CPU objetivo. Este ejemplo utiliza Linux x86-64.`linux/amd64`); para ARM64, utilice `linux/arm64` Y etiqueta los archivos entregados correspondientemente: ```sh -docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.10 -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' -docker save -o doca-image-v0.3.10-linux-amd64.tar docker.io/smartdoca/doca:0.3.10 -sha256sum doca-image-v0.3.10-linux-amd64.tar > doca-image-v0.3.10-linux-amd64.tar.sha256 +docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.11 +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' +docker save -o doca-image-v0.3.11-linux-amd64.tar docker.io/smartdoca/doca:0.3.11 +sha256sum doca-image-v0.3.11-linux-amd64.tar > doca-image-v0.3.11-linux-amd64.tar.sha256 ``` Transfiera la imagen `.tar` y el checksum juntos. De su directorio en el servidor empresarial: ```sh -sha256sum -c doca-image-v0.3.10-linux-amd64.tar.sha256 -docker load -i doca-image-v0.3.10-linux-amd64.tar -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' +sha256sum -c doca-image-v0.3.11-linux-amd64.tar.sha256 +docker load -i doca-image-v0.3.11-linux-amd64.tar +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' ``` -Confirme que la etiqueta cargada está `smartdoca/doca:0.3.10` Y si la arquitectura coincide con el objetivo, luego regresar al directorio de despliegue. Un registro interno es otra opción de entrega: el proveedor empuja la misma imagen de lanzamiento y el equipo de negocios modifica Compose. `image` A la dirección de registro interno antes de extraerlo. Mantenga el paquete, la imagen y los scripts de inicialización en la misma versión. +Confirme que la etiqueta cargada está `smartdoca/doca:0.3.11` Y si la arquitectura coincide con el objetivo, luego regresar al directorio de despliegue. Un registro interno es otra opción de entrega: el proveedor empuja la misma imagen de lanzamiento y el equipo de negocios modifica Compose. `image` A la dirección de registro interno antes de extraerlo. Mantenga el paquete, la imagen y los scripts de inicialización en la misma versión. @@ -192,7 +192,7 @@ Espera para `docker compose ps` para mostrar `healthy`Una comprobación manual d curl -fsS -H 'Host: docs.example.com' http://127.0.0.1:39120/health ``` -Esperar `{"status":"ok","version":"0.3.10"}`Para el ejemplo interno, utilice `Host: doca.internal`Las solicitudes de bucle de retorno en blanco fallan en la validación del host. Inspeccionar los fallos de inicio. `docker compose logs --tail=100 doca`. +Esperar `{"status":"ok","version":"0.3.11"}`Para el ejemplo interno, utilice `Host: doca.internal`Las solicitudes de bucle de retorno en blanco fallan en la validación del host. Inspeccionar los fallos de inicio. `docker compose logs --tail=100 doca`. @@ -221,4 +221,4 @@ Esto no crea una cuenta. Si la base de datos está bloqueada, ejecuta `docker co Usa `docker compose restart` Para reinicios ordinarios. Mantenga el directorio de despliegue y el nombre del proyecto Compose para que sea el mismo `doca_data` Se utiliza el volumen; cambiar cualquiera de ellos puede accidentalmente iniciar un sitio vacío separado. Realice una copia de seguridad de todas las bases de datos y el almacenamiento de archivos en el volumen persistente, además del contenido protegido. `.env` y clave maestra. `docker compose down -v` Se elimina el volumen y no debe utilizarse para un reinicio o actualización ordinario. -Revisar [requisitos de liberación](releases/0.3.10.es.md) Antes de actualizar, entregue un paquete e imagen correspondiente. Esta guía inicializa sitios nuevos y no convierte datos existentes. El inicio de sesión con contraseña y los servicios de documentos locales no requieren acceso a GitHub; los servicios externos configurados para IA, inicio de sesión externo, instalación de complementos o almacenamiento en la nube deben seguir siendo accesibles. Verifique la renderización de documentos en el host de destino por separado: solo la salud de la aplicación no garantiza la corrección de la renderización de PDF, Canvas y Office. Véase [Renderizado de documentos de Docker](docker-rendering.es.md). +Revisar [requisitos de liberación](releases/0.3.11.es.md) Antes de actualizar, entregue un paquete e imagen correspondiente. Esta guía inicializa sitios nuevos y no convierte datos existentes. El inicio de sesión con contraseña y los servicios de documentos locales no requieren acceso a GitHub; los servicios externos configurados para IA, inicio de sesión externo, instalación de complementos o almacenamiento en la nube deben seguir siendo accesibles. Verifique la renderización de documentos en el host de destino por separado: solo la salud de la aplicación no garantiza la corrección de la renderización de PDF, Canvas y Office. Véase [Renderizado de documentos de Docker](docker-rendering.es.md). diff --git a/docs/deployment-without-github.fr.md b/docs/deployment-without-github.fr.md index 87f4b373..e1549538 100644 --- a/docs/deployment-without-github.fr.md +++ b/docs/deployment-without-github.fr.md @@ -4,13 +4,13 @@ [简体中文](deployment-without-github.zh-CN.md) -Le serveur d’entreprise n’a pas besoin de checkout source, de Git, de Node.js ou de pnpm. Installez d’abord Docker Engine, le plugin Docker Compose, Bash et OpenSSL, puis transférez les fichiers de déploiement, préparez l’image, lancez Doca et initialisez l’administrateur. Ce guide installe Doca 0.3.10 sur un serveur unique neuf avec SQLite et stockage de fichiers local. Les installations existantes doivent consulter… [exigences de libération](releases/0.3.10.fr.md) et préserver leurs bases de données, fichiers, configuration et clé maîtresse des identifiants. +Le serveur d’entreprise n’a pas besoin de checkout source, de Git, de Node.js ou de pnpm. Installez d’abord Docker Engine, le plugin Docker Compose, Bash et OpenSSL, puis transférez les fichiers de déploiement, préparez l’image, lancez Doca et initialisez l’administrateur. Ce guide installe Doca 0.3.11 sur un serveur unique neuf avec SQLite et stockage de fichiers local. Les installations existantes doivent consulter… [exigences de libération](releases/0.3.11.fr.md) et préserver leurs bases de données, fichiers, configuration et clé maîtresse des identifiants. ## Installation récente à partir d’un YAML -`node scripts/pack-deployment.mjs` également en sortie `doca-compose-vVERSION.yaml` et son checksum. Transférez le YAML, enregistrez-le sous `compose.yaml` Dans un répertoire de déploiement permanent, éditer `DOCA_ORIGIN` et votre génération `DOCA_CREDENTIAL_MASTER_KEY`, le protéger avec `chmod 600 compose.yaml`, puis exécuter `docker compose up -d`. Non `.env`Un fichier JSON ou un script d’administrateur externe est nécessaire. Utilisez l’image 0.3.10 correspondante ; les fichiers YAML autonomes et les checksums sont également attachés à la version de GitHub. +`node scripts/pack-deployment.mjs` également en sortie `doca-compose-vVERSION.yaml` et son checksum. Transférez le YAML, enregistrez-le sous `compose.yaml` Dans un répertoire de déploiement permanent, éditer `DOCA_ORIGIN` et votre génération `DOCA_CREDENTIAL_MASTER_KEY`, le protéger avec `chmod 600 compose.yaml`, puis exécuter `docker compose up -d`. Non `.env`Un fichier JSON ou un script d’administrateur externe est nécessaire. Utilisez l’image 0.3.11 correspondante ; les fichiers YAML autonomes et les checksums sont également attachés à la version de GitHub. Après que la situation est saine, courir `docker compose exec doca bash docker/admin.sh bootstrap`; utiliser `reset-password` Pour réinitialiser le mot de passe. La saisie du mot de passe est cachée et ne figure pas dans le YAML. Cet exemple est uniquement destiné aux installations récentes de SQLite/local-storage. Les sites existants conservent leur nom de projet, leurs volumes et leurs clés. Les sauvegardes incluent le YAML protégé. Les exigences de reverse-proxy restent telles que définies ci-dessous. @@ -27,22 +27,22 @@ cd doca node scripts/pack-deployment.mjs ``` -Les noms des archives et les étiquettes d’image ci-dessous utilisent 0.3.10 comme exemple. Utilisez les noms de fichiers générés par le packager et l’image spécifiée dans le fichier Compose créé. +Les noms des archives et les étiquettes d’image ci-dessous utilisent 0.3.11 comme exemple. Utilisez les noms de fichiers générés par le packager et l’image spécifiée dans le fichier Compose créé. -Transfert `doca-deploy-v0.3.10.tar.gz` et son `.sha256` Vérification via un service de fichiers d'entreprise, une URL de téléchargement interne ou un stockage amovible. Le packer ne lit que les fichiers de déploiement publics et ne contient aucun fichier local. `.env`données utilisateur, ou image de conteneur. La version de GitHub pour la étiquette correspondante inclut le bundle et le checksum. +Transfert `doca-deploy-v0.3.11.tar.gz` et son `.sha256` Vérification via un service de fichiers d'entreprise, une URL de téléchargement interne ou un stockage amovible. Le packer ne lit que les fichiers de déploiement publics et ne contient aucun fichier local. `.env`données utilisateur, ou image de conteneur. La version de GitHub pour la étiquette correspondante inclut le bundle et le checksum. Placer les deux fichiers dans le même dossier sur le serveur d'entreprise, vérifier et extraire : ```sh -sha256sum -c doca-deploy-v0.3.10.tar.gz.sha256 -tar -xzf doca-deploy-v0.3.10.tar.gz -cd doca-deploy-v0.3.10 +sha256sum -c doca-deploy-v0.3.11.tar.gz.sha256 +tar -xzf doca-deploy-v0.3.11.tar.gz +cd doca-deploy-v0.3.11 ``` -Sur macOS, utilisez `shasum -a 256 -c doca-deploy-v0.3.10.tar.gz.sha256`Exécutez les commandes de déploiement suivantes depuis ce dossier : +Sur macOS, utilisez `shasum -a 256 -c doca-deploy-v0.3.11.tar.gz.sha256`Exécutez les commandes de déploiement suivantes depuis ce dossier : ```text -doca-deploy-v0.3.10/ +doca-deploy-v0.3.11/ compose.yaml docker.env.example README.zh-CN.md @@ -64,7 +64,7 @@ Pour un transfert de texte, enregistrez cette configuration à un seul serveur. ```yaml services: doca: - image: docker.io/smartdoca/doca:0.3.10 + image: docker.io/smartdoca/doca:0.3.11 pull_policy: missing restart: unless-stopped init: true @@ -155,21 +155,21 @@ docker compose pull doca Le fournisseur prépare un archivage d’images sur une machine ayant accès au registre. Vérifiez d’abord l’architecture de la CPU cible. Cet exemple utilise Linux x86-64.`linux/amd64`); pour ARM64, utilisez `linux/arm64` Et étiquetez les fichiers livrés en conséquence : ```sh -docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.10 -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' -docker save -o doca-image-v0.3.10-linux-amd64.tar docker.io/smartdoca/doca:0.3.10 -sha256sum doca-image-v0.3.10-linux-amd64.tar > doca-image-v0.3.10-linux-amd64.tar.sha256 +docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.11 +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' +docker save -o doca-image-v0.3.11-linux-amd64.tar docker.io/smartdoca/doca:0.3.11 +sha256sum doca-image-v0.3.11-linux-amd64.tar > doca-image-v0.3.11-linux-amd64.tar.sha256 ``` Transférer l’image `.tar` et le checksum ensemble. D’après leur répertoire sur le serveur d’entreprise : ```sh -sha256sum -c doca-image-v0.3.10-linux-amd64.tar.sha256 -docker load -i doca-image-v0.3.10-linux-amd64.tar -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' +sha256sum -c doca-image-v0.3.11-linux-amd64.tar.sha256 +docker load -i doca-image-v0.3.11-linux-amd64.tar +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' ``` -Confirmer que l’étiquette chargée est correcte `smartdoca/doca:0.3.10` Et si l’architecture correspond au cible, alors retourner au dossier de déploiement. Un registre interne est une autre option de livraison : le fournisseur met à jour la même image de version, et l’équipe métier modifie Compose. `image` À l’adresse de registre interne avant de tirer. Conservez le bundle, l’image et les scripts d’initialisation sur la même version. +Confirmer que l’étiquette chargée est correcte `smartdoca/doca:0.3.11` Et si l’architecture correspond au cible, alors retourner au dossier de déploiement. Un registre interne est une autre option de livraison : le fournisseur met à jour la même image de version, et l’équipe métier modifie Compose. `image` À l’adresse de registre interne avant de tirer. Conservez le bundle, l’image et les scripts d’initialisation sur la même version. @@ -192,7 +192,7 @@ Attendez. `docker compose ps` pour montrer `healthy`Un contrôle manuel doit uti curl -fsS -H 'Host: docs.example.com' http://127.0.0.1:39120/health ``` -Attendez `{"status":"ok","version":"0.3.10"}`Pour l’exemple interne, utilisez `Host: doca.internal`Les demandes de loopback invalides échouent à la validation du hôte. Examinez les échecs de démarrage. `docker compose logs --tail=100 doca`. +Attendez `{"status":"ok","version":"0.3.11"}`Pour l’exemple interne, utilisez `Host: doca.internal`Les demandes de loopback invalides échouent à la validation du hôte. Examinez les échecs de démarrage. `docker compose logs --tail=100 doca`. @@ -221,4 +221,4 @@ Cela ne crée pas de compte. Si la base de données est verrouillée, exécutez. Utilisez `docker compose restart` pour les redémarrages ordinaires. Conservez le dossier de déploiement et le nom du projet Compose afin que tout soit identique `doca_data` Le volume est utilisé ; changer l’un ou l’autre peut accidentellement déclencher la création d’un site vide distinct. Faire une sauvegarde de toutes les bases de données et des stockages de fichiers dans le volume persistant, ainsi que des données protégées. `.env` et clé maîtresse. `docker compose down -v` Supprime le volume et ne doit pas être utilisé pour une restauration ou une mise à niveau ordinaire. -Réexaminer [exigences de libération](releases/0.3.10.fr.md) Avant l’upgrade, fournissez un bundle et une image correspondants. Ce guide initialise des sites neufs et ne convertit pas les données existantes. Le login par mot de passe et les services de documents locaux n’ont pas besoin d’accès GitHub ; les services externes configurés pour l’IA, le login externe, l’installation d’extension ou le stockage en cloud doivent néanmoins être accessibles. Vérifiez séparément la rédaction des documents sur l’hôte cible : la santé de l’application seule ne garantit pas la qualité de rédaction des PDF, du Canvas et de Office. Voir [Rénder de documents Docker](docker-rendering.fr.md). +Réexaminer [exigences de libération](releases/0.3.11.fr.md) Avant l’upgrade, fournissez un bundle et une image correspondants. Ce guide initialise des sites neufs et ne convertit pas les données existantes. Le login par mot de passe et les services de documents locaux n’ont pas besoin d’accès GitHub ; les services externes configurés pour l’IA, le login externe, l’installation d’extension ou le stockage en cloud doivent néanmoins être accessibles. Vérifiez séparément la rédaction des documents sur l’hôte cible : la santé de l’application seule ne garantit pas la qualité de rédaction des PDF, du Canvas et de Office. Voir [Rénder de documents Docker](docker-rendering.fr.md). diff --git a/docs/deployment-without-github.ja.md b/docs/deployment-without-github.ja.md index ccbbd928..577500fd 100644 --- a/docs/deployment-without-github.ja.md +++ b/docs/deployment-without-github.ja.md @@ -4,13 +4,13 @@ [简体中文](deployment-without-github.zh-CN.md) -ビジネスサーバーにはソースチェックアウト、Git、Node.js、またはpnpmは不要です。先にDocker Engine、Docker Composeプラグイン、Bash、OpenSSLをインストールし、デプロイファイルを転送し、イメージを準備し、Docaを起動し、管理者を初期化します。このガイドでは、SQLiteとローカルファイルストレージを使用した新しい単一サーバー上でDoca 0.3.10をインストールします。既存のインストールについては、再度確認が必要です。 [リリース要件](releases/0.3.10.ja.md) そして、彼らのデータベース、ファイル、設定、および認証キーマスターキーを保護する。 +ビジネスサーバーにはソースチェックアウト、Git、Node.js、またはpnpmは不要です。先にDocker Engine、Docker Composeプラグイン、Bash、OpenSSLをインストールし、デプロイファイルを転送し、イメージを準備し、Docaを起動し、管理者を初期化します。このガイドでは、SQLiteとローカルファイルストレージを使用した新しい単一サーバー上でDoca 0.3.11をインストールします。既存のインストールについては、再度確認が必要です。 [リリース要件](releases/0.3.11.ja.md) そして、彼らのデータベース、ファイル、設定、および認証キーマスターキーを保護する。 ## YAMLからの新しいインストール -`node scripts/pack-deployment.mjs` また出力する `doca-compose-vVERSION.yaml` およびそのチェックサム。YAMLを転送し、保存してください。 `compose.yaml` 永続的なデプロイディレクトリ内で編集する `DOCA_ORIGIN` そして、あなたが生成したもの `DOCA_CREDENTIAL_MASTER_KEY`それを保護する `chmod 600 compose.yaml`それから実行する `docker compose up -d`。いいえ `.env`seccomp JSONや外部の管理者スクリプトが必要です。対応する0.3.10のイメージを使用してください。スタンドアロン版のYAMLとチェックサムもGitHub Releaseに添付されています。 +`node scripts/pack-deployment.mjs` また出力する `doca-compose-vVERSION.yaml` およびそのチェックサム。YAMLを転送し、保存してください。 `compose.yaml` 永続的なデプロイディレクトリ内で編集する `DOCA_ORIGIN` そして、あなたが生成したもの `DOCA_CREDENTIAL_MASTER_KEY`それを保護する `chmod 600 compose.yaml`それから実行する `docker compose up -d`。いいえ `.env`seccomp JSONや外部の管理者スクリプトが必要です。対応する0.3.11のイメージを使用してください。スタンドアロン版のYAMLとチェックサムもGitHub Releaseに添付されています。 サービスが正常になった後、実行する `docker compose exec doca bash docker/admin.sh bootstrap`;使用 `reset-password` パスワードリセットのためです。パスワードの入力は隠され、YAMLに記載されません。この例は新しいSQLite/local-storageインストールの場合のみです。既存のサイトは、プロジェクト名、ボリューム、キーが保持されます。バックアップには保護されたYAMLが含まれます。リバースプロキシの要件は、以下で説明されている通りです。 @@ -27,22 +27,22 @@ cd doca node scripts/pack-deployment.mjs ``` -以下のアーカイブ名と画像タグは0.3.10を例として使用しています。パッカーが出力するファイル名と、生成されたComposeファイルで指定される画像を使用してください。 +以下のアーカイブ名と画像タグは0.3.11を例として使用しています。パッカーが出力するファイル名と、生成されたComposeファイルで指定される画像を使用してください。 -移転 `doca-deploy-v0.3.10.tar.gz` そして、それ `.sha256` エンタープライズファイルサービス、内部ダウンロードURL、またはリムーバブルストレージを通じてチェックサムを確認する。パッカーは公開されたデプロイファイルのみを読み取り、ローカルファイルは含まない。 `.env`ユーザーデータやコンテナイメージです。対応するタグのGitHub Releaseには、バンドルとチェックサムが含まれています。 +移転 `doca-deploy-v0.3.11.tar.gz` そして、それ `.sha256` エンタープライズファイルサービス、内部ダウンロードURL、またはリムーバブルストレージを通じてチェックサムを確認する。パッカーは公開されたデプロイファイルのみを読み取り、ローカルファイルは含まない。 `.env`ユーザーデータやコンテナイメージです。対応するタグのGitHub Releaseには、バンドルとチェックサムが含まれています。 ビジネスサーバーの同じディレクトリに両方のファイルを置き、確認し、抽出します。 ```sh -sha256sum -c doca-deploy-v0.3.10.tar.gz.sha256 -tar -xzf doca-deploy-v0.3.10.tar.gz -cd doca-deploy-v0.3.10 +sha256sum -c doca-deploy-v0.3.11.tar.gz.sha256 +tar -xzf doca-deploy-v0.3.11.tar.gz +cd doca-deploy-v0.3.11 ``` -macOSでは、使用する `shasum -a 256 -c doca-deploy-v0.3.10.tar.gz.sha256`このディレクトリから続くデプロイコマンドを実行してください: +macOSでは、使用する `shasum -a 256 -c doca-deploy-v0.3.11.tar.gz.sha256`このディレクトリから続くデプロイコマンドを実行してください: ```text -doca-deploy-v0.3.10/ +doca-deploy-v0.3.11/ compose.yaml docker.env.example README.zh-CN.md @@ -64,7 +64,7 @@ doca-deploy-v0.3.10/ ```yaml services: doca: - image: docker.io/smartdoca/doca:0.3.10 + image: docker.io/smartdoca/doca:0.3.11 pull_policy: missing restart: unless-stopped init: true @@ -155,21 +155,21 @@ docker compose pull doca サプライヤーはレジストリにアクセスできるマシン上で画像アーカイブを作成する。まず、対象のCPUアーキテクチャを確認する。この例ではLinux x86-64を使用している。`linux/amd64`); ARM64の場合は、使用する `linux/arm64` 送信されたファイルに適切にラベルを付けましょう: ```sh -docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.10 -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' -docker save -o doca-image-v0.3.10-linux-amd64.tar docker.io/smartdoca/doca:0.3.10 -sha256sum doca-image-v0.3.10-linux-amd64.tar > doca-image-v0.3.10-linux-amd64.tar.sha256 +docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.11 +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' +docker save -o doca-image-v0.3.11-linux-amd64.tar docker.io/smartdoca/doca:0.3.11 +sha256sum doca-image-v0.3.11-linux-amd64.tar > doca-image-v0.3.11-linux-amd64.tar.sha256 ``` 画像を転送する `.tar` チェックサムと一緒に。ビジネスサーバーのディレクトリから: ```sh -sha256sum -c doca-image-v0.3.10-linux-amd64.tar.sha256 -docker load -i doca-image-v0.3.10-linux-amd64.tar -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' +sha256sum -c doca-image-v0.3.11-linux-amd64.tar.sha256 +docker load -i doca-image-v0.3.11-linux-amd64.tar +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' ``` -ロードされたタグが正しいか確認する `smartdoca/doca:0.3.10` アーキテクチャがターゲットに合致したら、デプロイディレクトリに戻ります。内部レジストリも別の配布方法です。サプライヤーが同じリリースイメージを配布し、ビジネスチームがComposeを変更します。 `image` プルインする前に、その内部レジストリアドレスに保存してください。バンドル、イメージ、初期化スクリプトを同じリリースに保持します。 +ロードされたタグが正しいか確認する `smartdoca/doca:0.3.11` アーキテクチャがターゲットに合致したら、デプロイディレクトリに戻ります。内部レジストリも別の配布方法です。サプライヤーが同じリリースイメージを配布し、ビジネスチームがComposeを変更します。 `image` プルインする前に、その内部レジストリアドレスに保存してください。バンドル、イメージ、初期化スクリプトを同じリリースに保持します。 @@ -192,7 +192,7 @@ docker compose ps curl -fsS -H 'Host: docs.example.com' http://127.0.0.1:39120/health ``` -期待する `{"status":"ok","version":"0.3.10"}`内部の例については、使用してください。 `Host: doca.internal`バレルループバックリクエストはホスト検証に失敗する。起動失敗を調査する `docker compose logs --tail=100 doca`. +期待する `{"status":"ok","version":"0.3.11"}`内部の例については、使用してください。 `Host: doca.internal`バレルループバックリクエストはホスト検証に失敗する。起動失敗を調査する `docker compose logs --tail=100 doca`. @@ -221,4 +221,4 @@ bash scripts/reset-admin-password.sh 使用する `docker compose restart` 通常の再起動のため。デプロイディレクトリとComposeプロジェクト名を保持しておくことで、同じものが使えます `doca_data` ボリュームが使用されているため、どちらを変更しても誤って別の空のサイトが作成される可能性があります。永続ボリューム内のすべてのデータベースやファイルストレージ、および保護されたものをバックアップしてください。 `.env` そしてマスターキー。 `docker compose down -v` ボリュームを削除し、通常の再起動やアップグレードには使用できない。 -レビューをする [リリース要件](releases/0.3.10.ja.md) アップグレードする前に、対応するバンドルと画像を提供してください。このガイドでは新しいサイトを初期化するだけで、既存のデータは変換されません。パスワードログインやローカル文書サービスにはGitHubアクセスは不要ですが、AI、外部ログイン、プラグインのインストール、クラウドストレージ用の外部サービスは依然としてアクセス可能でなければなりません。ターゲットホストでの文書レンダリングを別途確認してください。アプリケーションの健康状態だけではPDF、キャンバス、Officeのレンダリングの正確性は確立されません。詳細は [Dockerドキュメントのレンダリング](docker-rendering.ja.md). +レビューをする [リリース要件](releases/0.3.11.ja.md) アップグレードする前に、対応するバンドルと画像を提供してください。このガイドでは新しいサイトを初期化するだけで、既存のデータは変換されません。パスワードログインやローカル文書サービスにはGitHubアクセスは不要ですが、AI、外部ログイン、プラグインのインストール、クラウドストレージ用の外部サービスは依然としてアクセス可能でなければなりません。ターゲットホストでの文書レンダリングを別途確認してください。アプリケーションの健康状態だけではPDF、キャンバス、Officeのレンダリングの正確性は確立されません。詳細は [Dockerドキュメントのレンダリング](docker-rendering.ja.md). diff --git a/docs/deployment-without-github.ko.md b/docs/deployment-without-github.ko.md index 663952cc..bcd825c6 100644 --- a/docs/deployment-without-github.ko.md +++ b/docs/deployment-without-github.ko.md @@ -4,13 +4,13 @@ [简体中文](deployment-without-github.zh-CN.md) -비즈니스 서버에는 소스 체크아웃, Git, Node.js 또는 pnpm이 필요하지 않습니다. 먼저 Docker Engine, Docker Compose 플러그인, Bash 및 OpenSSL을 설치한 다음 배포 파일을 전송하고 이미지를 준비한 후 Doca를 시작하고 관리자 계정을 초기화합니다. 이 가이드는 SQLite와 로컬 파일 저장소가 있는 새로 생긴 단일 서버에 Doca 0.3.10을 설치합니다. 기존 설치된 경우 확인해야 합니다. [출시 요구사항](releases/0.3.10.ko.md) 그들의 데이터베이스, 파일, 설정, 그리고 자격 증명 마스터 키를 보존합니다. +비즈니스 서버에는 소스 체크아웃, Git, Node.js 또는 pnpm이 필요하지 않습니다. 먼저 Docker Engine, Docker Compose 플러그인, Bash 및 OpenSSL을 설치한 다음 배포 파일을 전송하고 이미지를 준비한 후 Doca를 시작하고 관리자 계정을 초기화합니다. 이 가이드는 SQLite와 로컬 파일 저장소가 있는 새로 생긴 단일 서버에 Doca 0.3.11을 설치합니다. 기존 설치된 경우 확인해야 합니다. [출시 요구사항](releases/0.3.11.ko.md) 그들의 데이터베이스, 파일, 설정, 그리고 자격 증명 마스터 키를 보존합니다. ## YAML 파일을 이용한 신규 설치 -`node scripts/pack-deployment.mjs` 또한 출력됨 `doca-compose-vVERSION.yaml` 그리고 그 체크섬. YAML 파일을 전송하여 저장하세요. `compose.yaml` 영구 배포 디렉터리에서 수정하기 `DOCA_ORIGIN` 그리고 당신이 생성한 것 `DOCA_CREDENTIAL_MASTER_KEY`, 그것을 보호하세요 `chmod 600 compose.yaml`그런 다음 실행하세요 `docker compose up -d`. 아니요 `.env`seccomp JSON 또는 외부 관리자 스크립트가 필요합니다. 해당 0.3.10 이미지를 사용하세요; 독립형 YAML 및 체크섬도 GitHub Release에 함께 제공됩니다. +`node scripts/pack-deployment.mjs` 또한 출력됨 `doca-compose-vVERSION.yaml` 그리고 그 체크섬. YAML 파일을 전송하여 저장하세요. `compose.yaml` 영구 배포 디렉터리에서 수정하기 `DOCA_ORIGIN` 그리고 당신이 생성한 것 `DOCA_CREDENTIAL_MASTER_KEY`, 그것을 보호하세요 `chmod 600 compose.yaml`그런 다음 실행하세요 `docker compose up -d`. 아니요 `.env`seccomp JSON 또는 외부 관리자 스크립트가 필요합니다. 해당 0.3.11 이미지를 사용하세요; 독립형 YAML 및 체크섬도 GitHub Release에 함께 제공됩니다. 서비스가 건강한 후에 실행하세요. `docker compose exec doca bash docker/admin.sh bootstrap`; 사용하기 `reset-password` 비밀번호 재설정을 위한 것입니다. 비밀번호 입력은 숨겨져 있으며 YAML 파일에 저장되지 않습니다. 이 예시는 새로 설치된 SQLite/local-storage 환경에만 적용됩니다. 기존 사이트는 프로젝트 이름, 볼륨 및 키를 그대로 유지합니다. 백업에는 보호된 YAML 파일이 포함됩니다. 리버스 프로킷 관련 요구 사항은 아래에 설명된 대로 유지됩니다. @@ -27,22 +27,22 @@ cd doca node scripts/pack-deployment.mjs ``` -아래의 아카이브 이름과 이미지 태그는 0.3.10을 예시로 사용합니다. 패키저가 생성한 파일명과 생성된 Compose 파일에 지정된 이미지를 사용하세요. +아래의 아카이브 이름과 이미지 태그는 0.3.11을 예시로 사용합니다. 패키저가 생성한 파일명과 생성된 Compose 파일에 지정된 이미지를 사용하세요. -전송 `doca-deploy-v0.3.10.tar.gz` 그리고 그것 `.sha256` 기업 파일 서비스, 내부 다운로드 URL 또는 이동식 저장소를 통한 체크섬을 확인합니다. 패키저는 공개된 배포 파일만 읽고 로컬 파일은 포함하지 않습니다. `.env`사용자 데이터나 컨테이너 이미지입니다. 해당 태그에 대한 GitHub Release에는 번들과 체크섬이 포함되어 있습니다. +전송 `doca-deploy-v0.3.11.tar.gz` 그리고 그것 `.sha256` 기업 파일 서비스, 내부 다운로드 URL 또는 이동식 저장소를 통한 체크섬을 확인합니다. 패키저는 공개된 배포 파일만 읽고 로컬 파일은 포함하지 않습니다. `.env`사용자 데이터나 컨테이너 이미지입니다. 해당 태그에 대한 GitHub Release에는 번들과 체크섬이 포함되어 있습니다. 비즈니스 서버의 동일한 디렉터리에 두 파일을 넣고 확인한 후 추출합니다. ```sh -sha256sum -c doca-deploy-v0.3.10.tar.gz.sha256 -tar -xzf doca-deploy-v0.3.10.tar.gz -cd doca-deploy-v0.3.10 +sha256sum -c doca-deploy-v0.3.11.tar.gz.sha256 +tar -xzf doca-deploy-v0.3.11.tar.gz +cd doca-deploy-v0.3.11 ``` -macOS에서는 사용하세요. `shasum -a 256 -c doca-deploy-v0.3.10.tar.gz.sha256`이 디렉터리에서 다음 배포 명령을 실행하세요: +macOS에서는 사용하세요. `shasum -a 256 -c doca-deploy-v0.3.11.tar.gz.sha256`이 디렉터리에서 다음 배포 명령을 실행하세요: ```text -doca-deploy-v0.3.10/ +doca-deploy-v0.3.11/ compose.yaml docker.env.example README.zh-CN.md @@ -64,7 +64,7 @@ doca-deploy-v0.3.10/ ```yaml services: doca: - image: docker.io/smartdoca/doca:0.3.10 + image: docker.io/smartdoca/doca:0.3.11 pull_policy: missing restart: unless-stopped init: true @@ -155,21 +155,21 @@ docker compose pull doca 공급업체는 레지스트리 접근이 가능한 기계에서 이미지 아카이브를 준비합니다. 먼저 대상 CPU 아키텍처를 확인하세요. 이 예제에서는 Linux x86-64를 사용합니다.`linux/amd64`); ARM64의 경우, 사용하세요 `linux/arm64` 전달된 파일에 해당하는 라벨을 붙이세요: ```sh -docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.10 -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' -docker save -o doca-image-v0.3.10-linux-amd64.tar docker.io/smartdoca/doca:0.3.10 -sha256sum doca-image-v0.3.10-linux-amd64.tar > doca-image-v0.3.10-linux-amd64.tar.sha256 +docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.11 +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' +docker save -o doca-image-v0.3.11-linux-amd64.tar docker.io/smartdoca/doca:0.3.11 +sha256sum doca-image-v0.3.11-linux-amd64.tar > doca-image-v0.3.11-linux-amd64.tar.sha256 ``` 이미지를 전송하세요. `.tar` 그리고 체크섬을 함께 사용합니다. 비즈니스 서버의 그들의 디렉터리에서입니다. ```sh -sha256sum -c doca-image-v0.3.10-linux-amd64.tar.sha256 -docker load -i doca-image-v0.3.10-linux-amd64.tar -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' +sha256sum -c doca-image-v0.3.11-linux-amd64.tar.sha256 +docker load -i doca-image-v0.3.11-linux-amd64.tar +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' ``` -로드된 태그가 맞는지 확인하세요. `smartdoca/doca:0.3.10` 아키텍처가 목표와 일치하면 배포 디렉터리로 돌아갑니다. 내부 레지스트리는 또 다른 전달 옵션입니다: 공급업체가 동일한 릴리스 이미지를 전송하고 비즈니스 팀이 Compose를 변경합니다. `image` 풀기 전에 그 내부 레지스트리 주소를 사용하세요. 번들, 이미지, 초기화 스크립트를 동일한 릴리스에 유지하세요. +로드된 태그가 맞는지 확인하세요. `smartdoca/doca:0.3.11` 아키텍처가 목표와 일치하면 배포 디렉터리로 돌아갑니다. 내부 레지스트리는 또 다른 전달 옵션입니다: 공급업체가 동일한 릴리스 이미지를 전송하고 비즈니스 팀이 Compose를 변경합니다. `image` 풀기 전에 그 내부 레지스트리 주소를 사용하세요. 번들, 이미지, 초기화 스크립트를 동일한 릴리스에 유지하세요. @@ -192,7 +192,7 @@ docker compose ps curl -fsS -H 'Host: docs.example.com' http://127.0.0.1:39120/health ``` -예상할 것 `{"status":"ok","version":"0.3.10"}`내부 예시를 위해서는 사용하세요. `Host: doca.internal`바레 루프백 요청은 호스트 검증에 실패합니다. 시작 실패를 확인하세요. `docker compose logs --tail=100 doca`. +예상할 것 `{"status":"ok","version":"0.3.11"}`내부 예시를 위해서는 사용하세요. `Host: doca.internal`바레 루프백 요청은 호스트 검증에 실패합니다. 시작 실패를 확인하세요. `docker compose logs --tail=100 doca`. @@ -221,4 +221,4 @@ bash scripts/reset-admin-password.sh 사용하기 `docker compose restart` 일반적인 재시작에 해당합니다. 배포 디렉터리와 Compose 프로젝트 이름을 그대로 유지하세요. `doca_data` 볼륨이 사용되고 있으므로, 둘 중 하나를 변경하면 실수로 별도의 빈 사이트가 생길 수 있습니다. 영구 볼륨 내의 모든 데이터베이스와 파일 저장소, 그리고 보호된 내용도 모두 백업하세요. `.env` 그리고 마스터 키. `docker compose down -v` 볼륨을 삭제했으므로 일반적인 재시작이나 업그레이드에는 사용할 수 없습니다. -검토해 보세요. [출시 요구사항](releases/0.3.10.ko.md) 업그레이드하기 전에 맞는 번들과 이미지를 제공해야 합니다. 이 가이드는 새로 시작하는 사이트를 초기화하며 기존 데이터는 변환하지 않습니다. 비밀번호 로그인 및 로컬 문서 서비스는 GitHub 접근이 필요하지 않습니다; AI, 외부 로그인, 플러그인 설치 또는 클라우드 스토리지를 위한 외부 서비스는 여전히 접근 가능해야 합니다. 대상 호스트에서 문서 렌더링을 별도로 확인하십시오: 애플리케이션의 건강 상태만으로는 PDF, 캔버스 및 오피스 렌더링의 정확성을 보장할 수 없습니다. 참조하십시오. [Docker 문서 렌더링](docker-rendering.ko.md). +검토해 보세요. [출시 요구사항](releases/0.3.11.ko.md) 업그레이드하기 전에 맞는 번들과 이미지를 제공해야 합니다. 이 가이드는 새로 시작하는 사이트를 초기화하며 기존 데이터는 변환하지 않습니다. 비밀번호 로그인 및 로컬 문서 서비스는 GitHub 접근이 필요하지 않습니다; AI, 외부 로그인, 플러그인 설치 또는 클라우드 스토리지를 위한 외부 서비스는 여전히 접근 가능해야 합니다. 대상 호스트에서 문서 렌더링을 별도로 확인하십시오: 애플리케이션의 건강 상태만으로는 PDF, 캔버스 및 오피스 렌더링의 정확성을 보장할 수 없습니다. 참조하십시오. [Docker 문서 렌더링](docker-rendering.ko.md). diff --git a/docs/deployment-without-github.md b/docs/deployment-without-github.md index 6ec41413..5b498c57 100644 --- a/docs/deployment-without-github.md +++ b/docs/deployment-without-github.md @@ -2,11 +2,11 @@ **English** · [简体中文](deployment-without-github.zh-CN.md) · [繁體中文](deployment-without-github.zh-Hant.md) · [日本語](deployment-without-github.ja.md) · [Français](deployment-without-github.fr.md) · [한국어](deployment-without-github.ko.md) · [Español](deployment-without-github.es.md) · [Русский](deployment-without-github.ru.md) -The business server does not need a source checkout, Git, Node.js, or pnpm. Install Docker Engine, the Docker Compose plugin, Bash, and OpenSSL beforehand, then transfer deployment files, prepare the image, start Doca, and initialize the administrator. This guide installs Doca 0.3.10 on a fresh single server with SQLite and local file storage. Existing installations must review the [release requirements](releases/0.3.10.md) and preserve their databases, files, configuration, and credential master key. +The business server does not need a source checkout, Git, Node.js, or pnpm. Install Docker Engine, the Docker Compose plugin, Bash, and OpenSSL beforehand, then transfer deployment files, prepare the image, start Doca, and initialize the administrator. This guide installs Doca 0.3.11 on a fresh single server with SQLite and local file storage. Existing installations must review the [release requirements](releases/0.3.11.md) and preserve their databases, files, configuration, and credential master key. ## Fresh installation from one YAML -`node scripts/pack-deployment.mjs` also outputs `doca-compose-vVERSION.yaml` and its checksum. Transfer the YAML, save it as `compose.yaml` in a permanent deployment directory, edit `DOCA_ORIGIN` and your generated `DOCA_CREDENTIAL_MASTER_KEY`, protect it with `chmod 600 compose.yaml`, then run `docker compose up -d`. No `.env`, seccomp JSON or external administrator script is needed. Use the matching 0.3.10 image; the standalone YAML and checksum are also attached to the GitHub Release. +`node scripts/pack-deployment.mjs` also outputs `doca-compose-vVERSION.yaml` and its checksum. Transfer the YAML, save it as `compose.yaml` in a permanent deployment directory, edit `DOCA_ORIGIN` and your generated `DOCA_CREDENTIAL_MASTER_KEY`, protect it with `chmod 600 compose.yaml`, then run `docker compose up -d`. No `.env`, seccomp JSON or external administrator script is needed. Use the matching 0.3.11 image; the standalone YAML and checksum are also attached to the GitHub Release. After the service is healthy, run `docker compose exec doca bash docker/admin.sh bootstrap`; use `reset-password` for password reset. Password entry is hidden and does not go into the YAML. This example is only for fresh SQLite/local-storage installations. Existing sites retain their project name, volumes and key. Backups include the protected YAML. Reverse-proxy requirements remain as described below. @@ -20,22 +20,22 @@ cd doca node scripts/pack-deployment.mjs ``` -The archive names and image tag below use 0.3.10 as an example. Use the filenames printed by the packer and the image specified in the generated Compose file. +The archive names and image tag below use 0.3.11 as an example. Use the filenames printed by the packer and the image specified in the generated Compose file. -Transfer `doca-deploy-v0.3.10.tar.gz` and its `.sha256` checksum through an enterprise file service, an internal download URL, or removable storage. The packer reads only public deployment files and includes no local `.env`, user data, or container image. The GitHub Release for the corresponding tag includes the bundle and checksum. +Transfer `doca-deploy-v0.3.11.tar.gz` and its `.sha256` checksum through an enterprise file service, an internal download URL, or removable storage. The packer reads only public deployment files and includes no local `.env`, user data, or container image. The GitHub Release for the corresponding tag includes the bundle and checksum. Place both files in the same directory on the business server, verify, and extract: ```sh -sha256sum -c doca-deploy-v0.3.10.tar.gz.sha256 -tar -xzf doca-deploy-v0.3.10.tar.gz -cd doca-deploy-v0.3.10 +sha256sum -c doca-deploy-v0.3.11.tar.gz.sha256 +tar -xzf doca-deploy-v0.3.11.tar.gz +cd doca-deploy-v0.3.11 ``` -On macOS, use `shasum -a 256 -c doca-deploy-v0.3.10.tar.gz.sha256`. Run subsequent deployment commands from this directory: +On macOS, use `shasum -a 256 -c doca-deploy-v0.3.11.tar.gz.sha256`. Run subsequent deployment commands from this directory: ```text -doca-deploy-v0.3.10/ +doca-deploy-v0.3.11/ compose.yaml docker.env.example README.zh-CN.md @@ -55,7 +55,7 @@ For a text handoff, save this single-server configuration as `compose.yaml` and ```yaml services: doca: - image: docker.io/smartdoca/doca:0.3.10 + image: docker.io/smartdoca/doca:0.3.11 pull_policy: missing restart: unless-stopped init: true @@ -136,21 +136,21 @@ docker compose pull doca The supplier prepares an image archive on a machine with registry access. Confirm the target CPU architecture first. This example uses Linux x86-64 (`linux/amd64`); for ARM64, use `linux/arm64` and label the delivered files accordingly: ```sh -docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.10 -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' -docker save -o doca-image-v0.3.10-linux-amd64.tar docker.io/smartdoca/doca:0.3.10 -sha256sum doca-image-v0.3.10-linux-amd64.tar > doca-image-v0.3.10-linux-amd64.tar.sha256 +docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.11 +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' +docker save -o doca-image-v0.3.11-linux-amd64.tar docker.io/smartdoca/doca:0.3.11 +sha256sum doca-image-v0.3.11-linux-amd64.tar > doca-image-v0.3.11-linux-amd64.tar.sha256 ``` Transfer the image `.tar` and checksum together. From their directory on the business server: ```sh -sha256sum -c doca-image-v0.3.10-linux-amd64.tar.sha256 -docker load -i doca-image-v0.3.10-linux-amd64.tar -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' +sha256sum -c doca-image-v0.3.11-linux-amd64.tar.sha256 +docker load -i doca-image-v0.3.11-linux-amd64.tar +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' ``` -Confirm the loaded tag is `smartdoca/doca:0.3.10` and the architecture matches the target, then return to the deployment directory. An internal registry is another delivery option: the supplier pushes the same release image and the business team changes Compose's `image` to that internal registry address before pulling. Keep the bundle, image, and initialization scripts on the same release. +Confirm the loaded tag is `smartdoca/doca:0.3.11` and the architecture matches the target, then return to the deployment directory. An internal registry is another delivery option: the supplier pushes the same release image and the business team changes Compose's `image` to that internal registry address before pulling. Keep the bundle, image, and initialization scripts on the same release. ## 4. Start and initialize the database @@ -170,7 +170,7 @@ Wait for `docker compose ps` to show `healthy`. A manual check must use the Host curl -fsS -H 'Host: docs.example.com' http://127.0.0.1:39120/health ``` -Expect `{"status":"ok","version":"0.3.10"}`. For the internal example, use `Host: doca.internal`. Bare loopback requests fail Host validation. Inspect startup failures with `docker compose logs --tail=100 doca`. +Expect `{"status":"ok","version":"0.3.11"}`. For the internal example, use `Host: doca.internal`. Bare loopback requests fail Host validation. Inspect startup failures with `docker compose logs --tail=100 doca`. ## 5. Initialize the administrator @@ -194,4 +194,4 @@ This does not create an account. If the database is locked, run `docker compose Use `docker compose restart` for ordinary restarts. Keep the deployment directory and Compose project name so the same `doca_data` volume is used; changing either can accidentally start a separate empty site. Back up all databases and file storage in the persistent volume, plus the protected `.env` and master key. `docker compose down -v` deletes the volume and must not be used for an ordinary restart or upgrade. -Review the [release requirements](releases/0.3.10.md) before upgrading and deliver a matching bundle and image. This guide initializes fresh sites and does not convert existing data. Password login and local document services need no GitHub access; configured external services for AI, external login, plugin installation, or cloud storage must still be reachable. Verify document rendering on the target host separately: application health alone does not establish PDF, Canvas and Office rendering correctness. See [Docker document rendering](docker-rendering.md). +Review the [release requirements](releases/0.3.11.md) before upgrading and deliver a matching bundle and image. This guide initializes fresh sites and does not convert existing data. Password login and local document services need no GitHub access; configured external services for AI, external login, plugin installation, or cloud storage must still be reachable. Verify document rendering on the target host separately: application health alone does not establish PDF, Canvas and Office rendering correctness. See [Docker document rendering](docker-rendering.md). diff --git a/docs/deployment-without-github.ru.md b/docs/deployment-without-github.ru.md index 5c77be2c..ce05efb8 100644 --- a/docs/deployment-without-github.ru.md +++ b/docs/deployment-without-github.ru.md @@ -4,13 +4,13 @@ [简体中文](deployment-without-github.zh-CN.md) -Бизнес-сервер не нуждается в источнике скачивания, Git, Node.js или pnpm. Сначала установите Docker Engine, плагин Docker Compose, Bash и OpenSSL, затем передайте файлы развёртывания, подготовьте изображение, запустите Doca и инициализируйте администратора. Этот руководство устанавливает Doca 0.3.10 на свежий одноплатформенный сервер с SQLite и локальным хранением файлов. Уже существующие установки должны проверить… [требования к выпуску](releases/0.3.10.ru.md) и сохранять их базы данных, файлы, конфигурацию и главный ключ учетных данных. +Бизнес-сервер не нуждается в источнике скачивания, Git, Node.js или pnpm. Сначала установите Docker Engine, плагин Docker Compose, Bash и OpenSSL, затем передайте файлы развёртывания, подготовьте изображение, запустите Doca и инициализируйте администратора. Этот руководство устанавливает Doca 0.3.11 на свежий одноплатформенный сервер с SQLite и локальным хранением файлов. Уже существующие установки должны проверить… [требования к выпуску](releases/0.3.11.ru.md) и сохранять их базы данных, файлы, конфигурацию и главный ключ учетных данных. ## Новая установка из YAML-файла -`node scripts/pack-deployment.mjs` также выводит `doca-compose-vVERSION.yaml` и его контрольный сумма. Перенесите YAML-файл и сохраните его как `compose.yaml` В постоянном каталоге развёртывания измените `DOCA_ORIGIN` и ваша генерированная `DOCA_CREDENTIAL_MASTER_KEY`Защитить его `chmod 600 compose.yaml`, затем запустите `docker compose up -d`Нет `.env`Необходимо использовать JSON-файл seccomp или скрипт внешнего администратора. Используйте соответствующий образ версии 0.3.10; отдельный YAML-файл и контрольный сумма также прилагаются к релизу на GitHub. +`node scripts/pack-deployment.mjs` также выводит `doca-compose-vVERSION.yaml` и его контрольный сумма. Перенесите YAML-файл и сохраните его как `compose.yaml` В постоянном каталоге развёртывания измените `DOCA_ORIGIN` и ваша генерированная `DOCA_CREDENTIAL_MASTER_KEY`Защитить его `chmod 600 compose.yaml`, затем запустите `docker compose up -d`Нет `.env`Необходимо использовать JSON-файл seccomp или скрипт внешнего администратора. Используйте соответствующий образ версии 0.3.11; отдельный YAML-файл и контрольный сумма также прилагаются к релизу на GitHub. После того как процесс здоров, запустите. `docker compose exec doca bash docker/admin.sh bootstrap`; использовать `reset-password` Для сброса пароля. Введение пароля скрыто и не попадает в YAML. Этот пример предназначен только для новых установок SQLite/local-storage. Существующие сайты сохраняют свое имя проекта, объемы данных и ключи. Бэкапы включают защищенный YAML. Требования к реверс-прокси остаются такими же, как описано ниже. @@ -27,22 +27,22 @@ cd doca node scripts/pack-deployment.mjs ``` -Названия архивов и метки изображений ниже используют 0.3.10 в качестве примера. Используйте имена файлов, указанные пакером, и изображение, указанное в созданном файле Compose. +Названия архивов и метки изображений ниже используют 0.3.11 в качестве примера. Используйте имена файлов, указанные пакером, и изображение, указанное в созданном файле Compose. -Передача `doca-deploy-v0.3.10.tar.gz` и его `.sha256` Сумма контроля через сервис предприятия, внутреную URL скачивания или удаляемое хранилище. Пакер читает только публичные файлы развертывания и не включает локальные файлы. `.env`Пользовательские данные или изображение контейнера. GitHub Release для соответствующего тега включает бандл и проверочный код. +Передача `doca-deploy-v0.3.11.tar.gz` и его `.sha256` Сумма контроля через сервис предприятия, внутреную URL скачивания или удаляемое хранилище. Пакер читает только публичные файлы развертывания и не включает локальные файлы. `.env`Пользовательские данные или изображение контейнера. GitHub Release для соответствующего тега включает бандл и проверочный код. Поместите оба файла в один и тот же каталог на бизнес-сервере, проверьте и извлеките. ```sh -sha256sum -c doca-deploy-v0.3.10.tar.gz.sha256 -tar -xzf doca-deploy-v0.3.10.tar.gz -cd doca-deploy-v0.3.10 +sha256sum -c doca-deploy-v0.3.11.tar.gz.sha256 +tar -xzf doca-deploy-v0.3.11.tar.gz +cd doca-deploy-v0.3.11 ``` -На macOS используйте `shasum -a 256 -c doca-deploy-v0.3.10.tar.gz.sha256`Выполняйте последующие команды развертывания из этого директория: +На macOS используйте `shasum -a 256 -c doca-deploy-v0.3.11.tar.gz.sha256`Выполняйте последующие команды развертывания из этого директория: ```text -doca-deploy-v0.3.10/ +doca-deploy-v0.3.11/ compose.yaml docker.env.example README.zh-CN.md @@ -64,7 +64,7 @@ doca-deploy-v0.3.10/ ```yaml services: doca: - image: docker.io/smartdoca/doca:0.3.10 + image: docker.io/smartdoca/doca:0.3.11 pull_policy: missing restart: unless-stopped init: true @@ -155,21 +155,21 @@ docker compose pull doca Поставщик готовит архив изображений на устройстве с доступом к реестру. Сначала необходимо подтвердить архитектуру целевой процессора. В этом примере используется Linux x86-64.`linux/amd64`); для ARM64 используйте `linux/arm64` и обозначите доставленные файлы соответствующим образом: ```sh -docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.10 -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' -docker save -o doca-image-v0.3.10-linux-amd64.tar docker.io/smartdoca/doca:0.3.10 -sha256sum doca-image-v0.3.10-linux-amd64.tar > doca-image-v0.3.10-linux-amd64.tar.sha256 +docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.11 +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' +docker save -o doca-image-v0.3.11-linux-amd64.tar docker.io/smartdoca/doca:0.3.11 +sha256sum doca-image-v0.3.11-linux-amd64.tar > doca-image-v0.3.11-linux-amd64.tar.sha256 ``` Перенесите изображение `.tar` и сложные проверочные коды вместе. Из их директории на бизнес-сервере: ```sh -sha256sum -c doca-image-v0.3.10-linux-amd64.tar.sha256 -docker load -i doca-image-v0.3.10-linux-amd64.tar -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' +sha256sum -c doca-image-v0.3.11-linux-amd64.tar.sha256 +docker load -i doca-image-v0.3.11-linux-amd64.tar +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' ``` -Подтвердите, что загруженный тег существует. `smartdoca/doca:0.3.10` Если архитектура соответствует целевой версии, то возвращаемся в директорию развертывания. Внутренний реестр — еще один вариант доставки: поставщик публикует ту же версию изображения, а бизнес-команда меняет Compose. `image` Имейте в виду адрес внутреннего реестра перед выполнением. Сохраняйте пакет, изображение и скрипты инициализации в одном и том же релизе. +Подтвердите, что загруженный тег существует. `smartdoca/doca:0.3.11` Если архитектура соответствует целевой версии, то возвращаемся в директорию развертывания. Внутренний реестр — еще один вариант доставки: поставщик публикует ту же версию изображения, а бизнес-команда меняет Compose. `image` Имейте в виду адрес внутреннего реестра перед выполнением. Сохраняйте пакет, изображение и скрипты инициализации в одном и том же релизе. @@ -192,7 +192,7 @@ docker compose ps curl -fsS -H 'Host: docs.example.com' http://127.0.0.1:39120/health ``` -Ожидайте `{"status":"ok","version":"0.3.10"}`Для внутреннего примера используйте `Host: doca.internal`Запросы типа “bare loopback” не проходят проверку хоста. Исследуйте ошибки запуска. `docker compose logs --tail=100 doca`. +Ожидайте `{"status":"ok","version":"0.3.11"}`Для внутреннего примера используйте `Host: doca.internal`Запросы типа “bare loopback” не проходят проверку хоста. Исследуйте ошибки запуска. `docker compose logs --tail=100 doca`. @@ -221,4 +221,4 @@ bash scripts/reset-admin-password.sh Используйте `docker compose restart` Для обычных перезапусков. Сохраняйте директорию развёртывания и имя проекта Compose, чтобы все было одинаково. `doca_data` Используется объем диска; изменение любого из них может случайно вызвать создание отдельного пустого сайта. Сделайте резервную копию всех баз данных и файловых хранилищ в постоянном объеме диска, а также защищенных данных. `.env` и главный ключ. `docker compose down -v` Удаляет том, и его нельзя использовать для обычного перезапуска или обновления. -Проанализировать [требования к выпуску](releases/0.3.10.ru.md) Перед обновлением необходимо предоставить соответствующий пакет и изображение. Этот руководство инициализирует новые сайты и не конвертирует существующие данные. Вход по паролю и локальные сервисы документов не требуют доступа к GitHub; внешние сервисы для ИИ, внешний вход, установка плагинов или хранение в облаке должны все еще быть доступными. Проверьте отображение документов на целевом хосте отдельно: само состояние приложения не гарантирует корректность отображения PDF, Canvas и Office. Смотрите. [Отображение документа в Docker](docker-rendering.ru.md). +Проанализировать [требования к выпуску](releases/0.3.11.ru.md) Перед обновлением необходимо предоставить соответствующий пакет и изображение. Этот руководство инициализирует новые сайты и не конвертирует существующие данные. Вход по паролю и локальные сервисы документов не требуют доступа к GitHub; внешние сервисы для ИИ, внешний вход, установка плагинов или хранение в облаке должны все еще быть доступными. Проверьте отображение документов на целевом хосте отдельно: само состояние приложения не гарантирует корректность отображения PDF, Canvas и Office. Смотрите. [Отображение документа в Docker](docker-rendering.ru.md). diff --git a/docs/deployment-without-github.zh-CN.md b/docs/deployment-without-github.zh-CN.md index da0335c6..99d54555 100644 --- a/docs/deployment-without-github.zh-CN.md +++ b/docs/deployment-without-github.zh-CN.md @@ -2,11 +2,11 @@ [English](deployment-without-github.md) · **简体中文** · [繁體中文](deployment-without-github.zh-Hant.md) · [日本語](deployment-without-github.ja.md) · [Français](deployment-without-github.fr.md) · [한국어](deployment-without-github.ko.md) · [Español](deployment-without-github.es.md) · [Русский](deployment-without-github.ru.md) -业务服务器无需拉取源码,也无需安装 Git、Node.js 或 pnpm。准备好 Docker Engine、Docker Compose 插件、Bash 和 OpenSSL 后,复制部署文件、准备镜像、启动并初始化管理员即可。本指南用于全新单机安装 Doca 0.3.10,采用 SQLite 和本地文件存储;已有部署先阅读[发行要求](releases/0.3.10.zh-CN.md),保留原数据库、文件、配置和凭证主密钥。 +业务服务器无需拉取源码,也无需安装 Git、Node.js 或 pnpm。准备好 Docker Engine、Docker Compose 插件、Bash 和 OpenSSL 后,复制部署文件、准备镜像、启动并初始化管理员即可。本指南用于全新单机安装 Doca 0.3.11,采用 SQLite 和本地文件存储;已有部署先阅读[发行要求](releases/0.3.11.zh-CN.md),保留原数据库、文件、配置和凭证主密钥。 ## 单 YAML 全新安装 -`node scripts/pack-deployment.mjs` 另输出 `doca-compose-v版本.yaml` 和校验文件。交付此 YAML,保存为固定部署目录下的 `compose.yaml`,在文件中填写 `DOCA_ORIGIN` 与自行生成的 `DOCA_CREDENTIAL_MASTER_KEY`,执行 `chmod 600 compose.yaml` 后运行 `docker compose up -d`。无需 `.env`、seccomp JSON 或外部初始化脚本。使用匹配的 0.3.10 镜像;GitHub Release 也提供该独立 YAML 与校验文件。 +`node scripts/pack-deployment.mjs` 另输出 `doca-compose-v版本.yaml` 和校验文件。交付此 YAML,保存为固定部署目录下的 `compose.yaml`,在文件中填写 `DOCA_ORIGIN` 与自行生成的 `DOCA_CREDENTIAL_MASTER_KEY`,执行 `chmod 600 compose.yaml` 后运行 `docker compose up -d`。无需 `.env`、seccomp JSON 或外部初始化脚本。使用匹配的 0.3.11 镜像;GitHub Release 也提供该独立 YAML 与校验文件。 服务健康后执行 `docker compose exec doca bash docker/admin.sh bootstrap`;重置密码用 `docker compose exec doca bash docker/admin.sh reset-password`。密码在终端隐藏输入,不写进 YAML。该示例仅用于全新 SQLite/本地存储安装,已有站点继续使用原项目名、持久卷和密钥;备份须包含受保护的 YAML。反向代理要求与下文一致。 @@ -20,22 +20,22 @@ cd doca node scripts/pack-deployment.mjs ``` -下文用 0.3.10 的文件名和镜像标签举例。实际以打包命令输出的文件名和生成的 Compose 镜像为准。 +下文用 0.3.11 的文件名和镜像标签举例。实际以打包命令输出的文件名和生成的 Compose 镜像为准。 -把生成的 `doca-deploy-v0.3.10.tar.gz` 和同名 `.sha256` 校验文件,通过企业文件服务、内网下载地址或移动存储转交给业务方。打包只读取公开部署文件。对应标签的 GitHub Release 附带部署包和校验文件。 +把生成的 `doca-deploy-v0.3.11.tar.gz` 和同名 `.sha256` 校验文件,通过企业文件服务、内网下载地址或移动存储转交给业务方。打包只读取公开部署文件。对应标签的 GitHub Release 附带部署包和校验文件。 在业务服务器上将两个文件放到同一目录,校验并解压: ```sh -sha256sum -c doca-deploy-v0.3.10.tar.gz.sha256 -tar -xzf doca-deploy-v0.3.10.tar.gz -cd doca-deploy-v0.3.10 +sha256sum -c doca-deploy-v0.3.11.tar.gz.sha256 +tar -xzf doca-deploy-v0.3.11.tar.gz +cd doca-deploy-v0.3.11 ``` -macOS 校验可用 `shasum -a 256 -c doca-deploy-v0.3.10.tar.gz.sha256`。部署目录如下,后续命令均在此目录执行: +macOS 校验可用 `shasum -a 256 -c doca-deploy-v0.3.11.tar.gz.sha256`。部署目录如下,后续命令均在此目录执行: ```text -doca-deploy-v0.3.10/ +doca-deploy-v0.3.11/ compose.yaml docker.env.example README.zh-CN.md @@ -55,7 +55,7 @@ doca-deploy-v0.3.10/ ```yaml services: doca: - image: docker.io/smartdoca/doca:0.3.10 + image: docker.io/smartdoca/doca:0.3.11 pull_policy: missing restart: unless-stopped init: true @@ -136,21 +136,21 @@ docker compose pull doca 由交付方在可拉取镜像的机器上准备镜像文件。先确认业务服务器的 CPU 架构;以下以 Linux x86-64(`linux/amd64`)为例,ARM64 服务器把平台改为 `linux/arm64`,并在交付文件名中相应标明: ```sh -docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.10 -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' -docker save -o doca-image-v0.3.10-linux-amd64.tar docker.io/smartdoca/doca:0.3.10 -sha256sum doca-image-v0.3.10-linux-amd64.tar > doca-image-v0.3.10-linux-amd64.tar.sha256 +docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.11 +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' +docker save -o doca-image-v0.3.11-linux-amd64.tar docker.io/smartdoca/doca:0.3.11 +sha256sum doca-image-v0.3.11-linux-amd64.tar > doca-image-v0.3.11-linux-amd64.tar.sha256 ``` 把镜像 `.tar` 和校验文件一起转交。业务方在这两个文件所在目录执行: ```sh -sha256sum -c doca-image-v0.3.10-linux-amd64.tar.sha256 -docker load -i doca-image-v0.3.10-linux-amd64.tar -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' +sha256sum -c doca-image-v0.3.11-linux-amd64.tar.sha256 +docker load -i doca-image-v0.3.11-linux-amd64.tar +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' ``` -确认导入的标签是 `smartdoca/doca:0.3.10`,架构与目标服务器一致,再回到部署目录。内网镜像仓库也是可选交付方式:交付方推送同版本镜像,业务方将 Compose 的 `image` 改为内网镜像完整地址并拉取;部署包、镜像和初始化脚本保持同一版本。 +确认导入的标签是 `smartdoca/doca:0.3.11`,架构与目标服务器一致,再回到部署目录。内网镜像仓库也是可选交付方式:交付方推送同版本镜像,业务方将 Compose 的 `image` 改为内网镜像完整地址并拉取;部署包、镜像和初始化脚本保持同一版本。 ## 4. 启动与数据库初始化 @@ -170,7 +170,7 @@ docker compose ps curl -fsS -H 'Host: docs.example.com' http://127.0.0.1:39120/health ``` -应返回 `{"status":"ok","version":"0.3.10"}`。内网站点改用 `Host: doca.internal`。裸回环请求会被 Host 校验拒绝。启动失败可运行 `docker compose logs --tail=100 doca` 查看日志。 +应返回 `{"status":"ok","version":"0.3.11"}`。内网站点改用 `Host: doca.internal`。裸回环请求会被 Host 校验拒绝。启动失败可运行 `docker compose logs --tail=100 doca` 查看日志。 ## 5. 初始化管理员 @@ -194,4 +194,4 @@ bash scripts/reset-admin-password.sh 日常重启使用 `docker compose restart`,保留部署目录和 Compose 项目名,以继续使用同一个 `doca_data` 卷;不要通过改目录或项目名意外启动另一个空站点。备份覆盖持久卷中的全部数据库、文件存储以及受保护的 `.env` 和主密钥。`docker compose down -v` 会删除卷,不用于普通重启或升级。 -后续升级先确认[发行要求](releases/0.3.10.zh-CN.md),交付匹配版本的部署包和镜像;本流程只初始化全新站点,不转换已有数据。基础密码登录和本地文档服务无需 GitHub;AI、外部登录、插件安装及云存储等配置的外部服务仍需业务网络可达。文档导出还需在目标宿主机验证渲染器,应用健康不等于 PDF、画板和 Office 渲染效果已验证,见 [Docker 文档渲染器](docker-rendering.zh-CN.md)。 +后续升级先确认[发行要求](releases/0.3.11.zh-CN.md),交付匹配版本的部署包和镜像;本流程只初始化全新站点,不转换已有数据。基础密码登录和本地文档服务无需 GitHub;AI、外部登录、插件安装及云存储等配置的外部服务仍需业务网络可达。文档导出还需在目标宿主机验证渲染器,应用健康不等于 PDF、画板和 Office 渲染效果已验证,见 [Docker 文档渲染器](docker-rendering.zh-CN.md)。 diff --git a/docs/deployment-without-github.zh-Hant.md b/docs/deployment-without-github.zh-Hant.md index 588c32bd..87a330d2 100644 --- a/docs/deployment-without-github.zh-Hant.md +++ b/docs/deployment-without-github.zh-Hant.md @@ -4,13 +4,13 @@ [English](deployment-without-github.md) -業務伺服器無需拉取原始碼,也無需安裝 Git、Node.js 或 pnpm。準備好 Docker Engine、Docker Compose 外掛、Bash 和 OpenSSL 後,複製部署檔案、準備映象、啟動並初始化管理員即可。本指南用於全新單機安裝 Doca 0.3.10,採用 SQLite 和本地檔案儲存;已有部署先閱讀[發行要求](releases/0.3.10.zh-Hant.md),保留原資料庫、檔案、配置和憑證主金鑰。 +業務伺服器無需拉取原始碼,也無需安裝 Git、Node.js 或 pnpm。準備好 Docker Engine、Docker Compose 外掛、Bash 和 OpenSSL 後,複製部署檔案、準備映象、啟動並初始化管理員即可。本指南用於全新單機安裝 Doca 0.3.11,採用 SQLite 和本地檔案儲存;已有部署先閱讀[發行要求](releases/0.3.11.zh-Hant.md),保留原資料庫、檔案、配置和憑證主金鑰。 ## 單 YAML 全新安裝 -`node scripts/pack-deployment.mjs` 另輸出 `doca-compose-v版本.yaml` 和校驗檔案。交付此 YAML,儲存為固定部署目錄下的 `compose.yaml`,在檔案中填寫 `DOCA_ORIGIN` 與自行生成的 `DOCA_CREDENTIAL_MASTER_KEY`,執行 `chmod 600 compose.yaml` 後執行 `docker compose up -d`。無需 `.env`、seccomp JSON 或外部初始化指令碼。使用匹配的 0.3.10 映象;GitHub Release 也提供該獨立 YAML 與校驗檔案。 +`node scripts/pack-deployment.mjs` 另輸出 `doca-compose-v版本.yaml` 和校驗檔案。交付此 YAML,儲存為固定部署目錄下的 `compose.yaml`,在檔案中填寫 `DOCA_ORIGIN` 與自行生成的 `DOCA_CREDENTIAL_MASTER_KEY`,執行 `chmod 600 compose.yaml` 後執行 `docker compose up -d`。無需 `.env`、seccomp JSON 或外部初始化指令碼。使用匹配的 0.3.11 映象;GitHub Release 也提供該獨立 YAML 與校驗檔案。 服務健康後執行 `docker compose exec doca bash docker/admin.sh bootstrap`;重置密碼用 `docker compose exec doca bash docker/admin.sh reset-password`。密碼在終端隱藏輸入,不寫進 YAML。該示例僅用於全新 SQLite/本地儲存安裝,已有站點繼續使用原專案名、持久卷和金鑰;備份須包含受保護的 YAML。反向代理要求與下文一致。 @@ -27,22 +27,22 @@ cd doca node scripts/pack-deployment.mjs ``` -下文用 0.3.10 的檔名和映象標籤舉例。實際以打包命令輸出的檔名和生成的 Compose 映象為準。 +下文用 0.3.11 的檔名和映象標籤舉例。實際以打包命令輸出的檔名和生成的 Compose 映象為準。 -把生成的 `doca-deploy-v0.3.10.tar.gz` 和同名 `.sha256` 校驗檔案,透過企業檔案服務、內網下載地址或移動儲存轉交給業務方。打包只讀取公開部署檔案。對應標籤的 GitHub Release 附帶部署包和校驗檔案。 +把生成的 `doca-deploy-v0.3.11.tar.gz` 和同名 `.sha256` 校驗檔案,透過企業檔案服務、內網下載地址或移動儲存轉交給業務方。打包只讀取公開部署檔案。對應標籤的 GitHub Release 附帶部署包和校驗檔案。 在業務伺服器上將兩個檔案放到同一目錄,校驗並解壓: ```sh -sha256sum -c doca-deploy-v0.3.10.tar.gz.sha256 -tar -xzf doca-deploy-v0.3.10.tar.gz -cd doca-deploy-v0.3.10 +sha256sum -c doca-deploy-v0.3.11.tar.gz.sha256 +tar -xzf doca-deploy-v0.3.11.tar.gz +cd doca-deploy-v0.3.11 ``` -macOS 校驗可用 `shasum -a 256 -c doca-deploy-v0.3.10.tar.gz.sha256`。部署目錄如下,後續命令均在此目錄執行: +macOS 校驗可用 `shasum -a 256 -c doca-deploy-v0.3.11.tar.gz.sha256`。部署目錄如下,後續命令均在此目錄執行: ```text -doca-deploy-v0.3.10/ +doca-deploy-v0.3.11/ compose.yaml docker.env.example README.zh-CN.md @@ -64,7 +64,7 @@ doca-deploy-v0.3.10/ ```yaml services: doca: - image: docker.io/smartdoca/doca:0.3.10 + image: docker.io/smartdoca/doca:0.3.11 pull_policy: missing restart: unless-stopped init: true @@ -155,21 +155,21 @@ docker compose pull doca 由交付方在可拉取映象的機器上準備映象檔案。先確認業務伺服器的 CPU 架構;以下以 Linux x86-64(`linux/amd64`)為例,ARM64 伺服器把平臺改為 `linux/arm64`,並在交付檔名中相應標明: ```sh -docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.10 -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' -docker save -o doca-image-v0.3.10-linux-amd64.tar docker.io/smartdoca/doca:0.3.10 -sha256sum doca-image-v0.3.10-linux-amd64.tar > doca-image-v0.3.10-linux-amd64.tar.sha256 +docker pull --platform linux/amd64 docker.io/smartdoca/doca:0.3.11 +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' +docker save -o doca-image-v0.3.11-linux-amd64.tar docker.io/smartdoca/doca:0.3.11 +sha256sum doca-image-v0.3.11-linux-amd64.tar > doca-image-v0.3.11-linux-amd64.tar.sha256 ``` 把映象 `.tar` 和校驗檔案一起轉交。業務方在這兩個檔案所在目錄執行: ```sh -sha256sum -c doca-image-v0.3.10-linux-amd64.tar.sha256 -docker load -i doca-image-v0.3.10-linux-amd64.tar -docker image inspect docker.io/smartdoca/doca:0.3.10 --format '{{.Os}}/{{.Architecture}}' +sha256sum -c doca-image-v0.3.11-linux-amd64.tar.sha256 +docker load -i doca-image-v0.3.11-linux-amd64.tar +docker image inspect docker.io/smartdoca/doca:0.3.11 --format '{{.Os}}/{{.Architecture}}' ``` -確認匯入的標籤是 `smartdoca/doca:0.3.10`,架構與目標伺服器一致,再回到部署目錄。內網映象倉庫也是可選交付方式:交付方推送同版本映象,業務方將 Compose 的 `image` 改為內網映象完整地址並拉取;部署包、映象和初始化指令碼保持同一版本。 +確認匯入的標籤是 `smartdoca/doca:0.3.11`,架構與目標伺服器一致,再回到部署目錄。內網映象倉庫也是可選交付方式:交付方推送同版本映象,業務方將 Compose 的 `image` 改為內網映象完整地址並拉取;部署包、映象和初始化指令碼保持同一版本。 @@ -192,7 +192,7 @@ docker compose ps curl -fsS -H 'Host: docs.example.com' http://127.0.0.1:39120/health ``` -應返回 `{"status":"ok","version":"0.3.10"}`。內網站點改用 `Host: doca.internal`。裸迴環請求會被 Host 校驗拒絕。啟動失敗可執行 `docker compose logs --tail=100 doca` 檢視日誌。 +應返回 `{"status":"ok","version":"0.3.11"}`。內網站點改用 `Host: doca.internal`。裸迴環請求會被 Host 校驗拒絕。啟動失敗可執行 `docker compose logs --tail=100 doca` 檢視日誌。 @@ -221,4 +221,4 @@ bash scripts/reset-admin-password.sh 日常重啟使用 `docker compose restart`,保留部署目錄和 Compose 專案名,以繼續使用同一個 `doca_data` 卷;不要透過改目錄或專案名意外啟動另一個空站點。備份覆蓋持久卷中的全部資料庫、檔案儲存以及受保護的 `.env` 和主金鑰。`docker compose down -v` 會刪除卷,不用於普通重啟或升級。 -後續升級先確認[發行要求](releases/0.3.10.zh-Hant.md),交付匹配版本的部署包和映象;本流程只初始化全新站點,不轉換已有資料。基礎密碼登入和本地文件服務無需 GitHub;AI、外部登入、外掛安裝及雲端儲存等配置的外部服務仍需業務網路可達。文件匯出還需在目標宿主機驗證渲染器,應用健康不等於 PDF、畫板和 Office 渲染效果已驗證,見 [Docker 文件渲染器](docker-rendering.zh-Hant.md)。 +後續升級先確認[發行要求](releases/0.3.11.zh-Hant.md),交付匹配版本的部署包和映象;本流程只初始化全新站點,不轉換已有資料。基礎密碼登入和本地文件服務無需 GitHub;AI、外部登入、外掛安裝及雲端儲存等配置的外部服務仍需業務網路可達。文件匯出還需在目標宿主機驗證渲染器,應用健康不等於 PDF、畫板和 Office 渲染效果已驗證,見 [Docker 文件渲染器](docker-rendering.zh-Hant.md)。 diff --git a/docs/deployment.es.md b/docs/deployment.es.md index 0ac20479..ccec473d 100644 --- a/docs/deployment.es.md +++ b/docs/deployment.es.md @@ -38,7 +38,7 @@ Editar `.env` antes del primer inicio. El almacenamiento de archivos también requiere `DOCA_FILE_STORE_ID` y `DOCA_FILE_STORES_JSON`, según lo estipulado `docker.env.example`. Los caminos y credenciales del backend se leen del entorno; la página de administración es de solo lectura. Ver [almacenamiento de archivos](storage.es.md). -El anfitrión actual utiliza generación `doca-2026-10-12-book-payload-storage-v1`La startup alinea automáticamente las bases de datos 0.1.22 liberadas. `doca-2026-10-09-history-storage-v1` A través de la revisión/reconciliación de DDL actual y registra la nueva generación. Todas las filas antiguas permanecen, incluyendo los resultados del libro SQL; no se añaden conversiones, limpiezas ni adaptadores para cuerpos antiguos. Los registros residuales del libro antiguo pueden requerir manejo manual. Los datos de objetos de la versión 0.1.23 existentes permanecen. Ver [Evolución de la estructura de la base de datos](database-schema-evolution.es.md) y [Requisitos de lanzamiento actuales](releases/0.3.10.es.md)La base exacta 0.1.13 `doca-2026-10-08-knowledge-books-v2` Todavía se necesita la actualización explícita de historial a continuación. Preserve las bases de datos, los objetos privados, la configuración y la clave maestra de credenciales original. +El anfitrión actual utiliza generación `doca-2026-10-12-book-payload-storage-v1`La startup alinea automáticamente las bases de datos 0.1.22 liberadas. `doca-2026-10-09-history-storage-v1` A través de la revisión/reconciliación de DDL actual y registra la nueva generación. Todas las filas antiguas permanecen, incluyendo los resultados del libro SQL; no se añaden conversiones, limpiezas ni adaptadores para cuerpos antiguos. Los registros residuales del libro antiguo pueden requerir manejo manual. Los datos de objetos de la versión 0.1.23 existentes permanecen. Ver [Evolución de la estructura de la base de datos](database-schema-evolution.es.md) y [Requisitos de lanzamiento actuales](releases/0.3.11.es.md)La base exacta 0.1.13 `doca-2026-10-08-knowledge-books-v2` Todavía se necesita la actualización explícita de historial a continuación. Preserve las bases de datos, los objetos privados, la configuración y la clave maestra de credenciales original. `DOCA_ORIGIN` Es el origen de los usuarios que se escribe en el navegador. Se aceptan HTTP y HTTPS, incluso en producción. Se debe usar únicamente el origen sin subruta, consulta o fragmento; la barra final en la raíz se normaliza. diff --git a/docs/deployment.fr.md b/docs/deployment.fr.md index a2321341..c33cc71a 100644 --- a/docs/deployment.fr.md +++ b/docs/deployment.fr.md @@ -38,7 +38,7 @@ cp docker.env.example .env Le stockage de fichiers nécessite également `DOCA_FILE_STORE_ID` et `DOCA_FILE_STORES_JSON`, comme indiqué `docker.env.example`. Les chemins et les identifiants du backend sont lus depuis l'environnement ; la page d'administration est uniquement consultable. Voir [stockage de fichiers](storage.fr.md). -L’hôte actuel utilise la génération `doca-2026-10-12-book-payload-storage-v1`Le startup aligne automatiquement les bases de données 0.1.22 libérées. `doca-2026-10-09-history-storage-v1` Grâce à l’examen/reconciliation des DDL actuels, la nouvelle génération est enregistrée. Toutes les lignes anciennes restent, y compris les résultats du livre SQL ; aucune conversion, nettoyage ou adaptateur pour les anciens objets n’est ajouté. Les enregistrements de livres anciens résiduels peuvent nécessiter une manipulation manuelle. Les données des objets de version 0.1.23 existantes restent intactes. Voir [évolution de la structure de la base de données](database-schema-evolution.fr.md) et [exigences de sortie actuelle](releases/0.3.10.fr.md)La valeur de base exacte 0.1.13 `doca-2026-10-08-knowledge-books-v2` Il est encore nécessaire d’appliquer l’amélioration de l’histoire explicite ci-dessous. Il faut conserver les bases de données, les objets privés, la configuration et la clé maîtresse des credences originale. +L’hôte actuel utilise la génération `doca-2026-10-12-book-payload-storage-v1`Le startup aligne automatiquement les bases de données 0.1.22 libérées. `doca-2026-10-09-history-storage-v1` Grâce à l’examen/reconciliation des DDL actuels, la nouvelle génération est enregistrée. Toutes les lignes anciennes restent, y compris les résultats du livre SQL ; aucune conversion, nettoyage ou adaptateur pour les anciens objets n’est ajouté. Les enregistrements de livres anciens résiduels peuvent nécessiter une manipulation manuelle. Les données des objets de version 0.1.23 existantes restent intactes. Voir [évolution de la structure de la base de données](database-schema-evolution.fr.md) et [exigences de sortie actuelle](releases/0.3.11.fr.md)La valeur de base exacte 0.1.13 `doca-2026-10-08-knowledge-books-v2` Il est encore nécessaire d’appliquer l’amélioration de l’histoire explicite ci-dessous. Il faut conserver les bases de données, les objets privés, la configuration et la clé maîtresse des credences originale. `DOCA_ORIGIN` C’est l’origine des utilisateurs saisie dans le navigateur. Les protocoles HTTP et HTTPS sont acceptés, y compris en production. Utilisez uniquement l’origine sans sous-réseau, sans requête ou sans fragment ; la barre finale “/” est normalisée. diff --git a/docs/deployment.ja.md b/docs/deployment.ja.md index b831ea58..73737f4d 100644 --- a/docs/deployment.ja.md +++ b/docs/deployment.ja.md @@ -38,7 +38,7 @@ cp docker.env.example .env ファイルストレージも必要です `DOCA_FILE_STORE_ID` そして `DOCA_FILE_STORES_JSON`、提供されている通り `docker.env.example`. サーバー内のパスと認証情報は環境から読み取られる。管理ページは読み取り専用である。詳細はこちらを参照。 [ファイルストレージ](storage.ja.md). -現在のホストは生成を使用している `doca-2026-10-12-book-payload-storage-v1`スタートアップは自動的に0.1.22版のデータベースを整列します。 `doca-2026-10-09-history-storage-v1` 現在のDDLレビュー/調整を通じて新しい世代が記録される。SQLブックの結果を含む、すべての古い行は保持される。何の変換、クリーンアップ、または古い体アダプターも追加されない。残存する古いブック記録は手動で処理が必要になる可能性がある。既存の0.1.23オブジェクトデータは保持される。詳細は [データベース構造の進化](database-schema-evolution.ja.md) そして [現在のリリース要件](releases/0.3.10.ja.md)正確な0.1.13のベースライン `doca-2026-10-08-knowledge-books-v2` 以下の明示的な歴史アップグレードがまだ必要です。データベース、プライベートオブジェクト、設定、および元の認証マスターキーを保持してください。 +現在のホストは生成を使用している `doca-2026-10-12-book-payload-storage-v1`スタートアップは自動的に0.1.22版のデータベースを整列します。 `doca-2026-10-09-history-storage-v1` 現在のDDLレビュー/調整を通じて新しい世代が記録される。SQLブックの結果を含む、すべての古い行は保持される。何の変換、クリーンアップ、または古い体アダプターも追加されない。残存する古いブック記録は手動で処理が必要になる可能性がある。既存の0.1.23オブジェクトデータは保持される。詳細は [データベース構造の進化](database-schema-evolution.ja.md) そして [現在のリリース要件](releases/0.3.11.ja.md)正確な0.1.13のベースライン `doca-2026-10-08-knowledge-books-v2` 以下の明示的な歴史アップグレードがまだ必要です。データベース、プライベートオブジェクト、設定、および元の認証マスターキーを保持してください。 `DOCA_ORIGIN` ブラウザでオリジンを入力する。HTTPとHTTPSが受け入れられ、実際の運用でも同様です。サブパス、クエリ、フラグメントを含まないオリジンのみを使用し、ルートのトレーリングスラッシュは正規化されます。 diff --git a/docs/deployment.ko.md b/docs/deployment.ko.md index 652bee62..afa1e3c3 100644 --- a/docs/deployment.ko.md +++ b/docs/deployment.ko.md @@ -38,7 +38,7 @@ cp docker.env.example .env 파일 저장도 필요합니다. `DOCA_FILE_STORE_ID` 그리고 `DOCA_FILE_STORES_JSON`제시된 대로 `docker.env.example`. 서버 경로와 자격 정보는 환경에서 읽어오며, 관리 페이지는 읽기 전용입니다. 참조하세요. [파일 저장](storage.ko.md). -현재 호스트는 génération을 사용합니다. `doca-2026-10-12-book-payload-storage-v1`스타트업은 자동으로 0.1.22 버전의 데이터베이스를 정렬합니다. `doca-2026-10-09-history-storage-v1` 현재의 DDL 검토/조정을 거쳐 새로운 세대가 기록됩니다. SQL 책의 결과를 포함한 모든 기존 행은 그대로 유지됩니다; 어떠한 변환, 정리 또는 기존 객체 어댑터도 추가되지 않습니다. 남아있는 기존 책 기록은 수동 처리가 필요할 수 있습니다. 기존의 0.1.23 객체 데이터는 그대로 유지됩니다. 참고하세요. [데이터베이스 구조의 발전](database-schema-evolution.ko.md) 그리고 [현재 출시 요구 사항](releases/0.3.10.ko.md)정확한 0.1.13 기준값 `doca-2026-10-08-knowledge-books-v2` 아래의 명시적인 역사 업그레이드가 여전히 필요합니다. 데이터베이스, 개인 정보, 설정 및 원본 자격 증명 마스터 키를 보존해야 합니다. +현재 호스트는 génération을 사용합니다. `doca-2026-10-12-book-payload-storage-v1`스타트업은 자동으로 0.1.22 버전의 데이터베이스를 정렬합니다. `doca-2026-10-09-history-storage-v1` 현재의 DDL 검토/조정을 거쳐 새로운 세대가 기록됩니다. SQL 책의 결과를 포함한 모든 기존 행은 그대로 유지됩니다; 어떠한 변환, 정리 또는 기존 객체 어댑터도 추가되지 않습니다. 남아있는 기존 책 기록은 수동 처리가 필요할 수 있습니다. 기존의 0.1.23 객체 데이터는 그대로 유지됩니다. 참고하세요. [데이터베이스 구조의 발전](database-schema-evolution.ko.md) 그리고 [현재 출시 요구 사항](releases/0.3.11.ko.md)정확한 0.1.13 기준값 `doca-2026-10-08-knowledge-books-v2` 아래의 명시적인 역사 업그레이드가 여전히 필요합니다. 데이터베이스, 개인 정보, 설정 및 원본 자격 증명 마스터 키를 보존해야 합니다. `DOCA_ORIGIN` 브라우저에서 원본 origin을 입력합니다. 프로덕션 환경에서도 HTTP와 HTTPS가 허용됩니다. 서브패스, 쿼리, 프래그먼트가 없는 원본만 사용하세요; 루트에 trailing slash는 정규화됩니다. diff --git a/docs/deployment.md b/docs/deployment.md index fa2bfbfd..1e7bb557 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -4,6 +4,30 @@ The Tauri desktop package includes the Web frontend and connects to a separately deployed host with desktop authorization routes. It has no bundled Node host. Build and verify each OS/architecture package independently. See [desktop client](desktop-client.md). +## Native Linux installation + +On a fresh Debian 12 server (amd64 or arm64) with systemd, curl and CA certificates, use this command once the [release](https://github.com/workhold/doca/releases) includes the native installer. + +```sh +curl -fsSL https://github.com/workhold/doca/releases/latest/download/doca-install.sh | sudo bash +``` + +The wizard uses the terminal to collect the administrator login and password, the browser-facing site URL, the default site language, the database and file storage. Choose SQLite and local disk for a self-contained site. For PostgreSQL, supply URLs for separate empty main and Webhook databases and, if needed, a separate empty plugin database. For private S3-compatible storage, supply the bucket, region and credentials, with a custom endpoint and path-style addressing when required. See [configuration](configuration.md) and [storage](storage.md). + +The installer verifies the selected architecture's archive checksum and installs the PDF and Office dependencies through APT and a dedicated Python environment. It checks Doca at `127.0.0.1:39120`, then enables `doca.service` at boot. For remote access, set the real HTTP(S) origin in the wizard and [configure the reverse proxy](#reverse-proxy) to forward HTTP and WebSocket traffic to that address. + +The application lives in `/opt/doca`, configuration in `/etc/doca/doca.env`, and local data in `/var/lib/doca`. Back up the configuration with the database and files. The configuration contains the installation key and any external database or storage credentials. + +```sh +sudo systemctl status doca.service +sudo journalctl -u doca.service -f +sudo systemctl restart doca.service +``` + +The installer can resume a setup of the same release using its original configuration. For automation with SQLite and local storage, use `--admin-login` and `--admin-password-file` together, with optional `--origin` and `--locale`. When piping the script, pass options as `sudo bash -s -- `. A downloaded `doca-install.sh` also accepts `--archive` with a local archive and its matching adjacent `.sha256` file. APT and the Python package source must remain available. + +## Docker deployment + One server can run the image specified by `compose.yaml` on main. A single container uses SQLite and does not need PostgreSQL or Redis. Use those only when you run more than one application replica. See [single instance and horizontal scaling](horizontal-scaling.md). ## Requirements @@ -30,7 +54,7 @@ Edit `.env` before the first start. File storage also requires `DOCA_FILE_STORE_ID` and `DOCA_FILE_STORES_JSON`, as provided by `docker.env.example`. Backend paths and credentials are read from the environment; the administration page is read-only. See [file storage](storage.md). -The current host uses generation `doca-2026-10-12-book-payload-storage-v1`. Startup automatically aligns released 0.1.22 databases on `doca-2026-10-09-history-storage-v1` through current-DDL review/reconciliation and records the new generation. All old rows remain, including SQL book outcomes; no body conversion, cleanup or old-body adapter is added. Residual old book records can require manual handling. Existing 0.1.23 object data remains. See [database structure evolution](database-schema-evolution.md) and [current release requirements](releases/0.3.10.md). The exact 0.1.13 baseline `doca-2026-10-08-knowledge-books-v2` still needs the explicit history upgrade below. Preserve databases, private objects, configuration and the original credential master key. +The current host uses generation `doca-2026-10-12-book-payload-storage-v1`. Startup automatically aligns released 0.1.22 databases on `doca-2026-10-09-history-storage-v1` through current-DDL review/reconciliation and records the new generation. All old rows remain, including SQL book outcomes; no body conversion, cleanup or old-body adapter is added. Residual old book records can require manual handling. Existing 0.1.23 object data remains. See [database structure evolution](database-schema-evolution.md) and [current release requirements](releases/0.3.11.md). The exact 0.1.13 baseline `doca-2026-10-08-knowledge-books-v2` still needs the explicit history upgrade below. Preserve databases, private objects, configuration and the original credential master key. `DOCA_ORIGIN` is the origin users type in the browser. HTTP and HTTPS are accepted, including in production. Use only the origin without a subpath, query, or fragment; a root trailing slash is normalized. diff --git a/docs/deployment.ru.md b/docs/deployment.ru.md index 47a0597b..cd71d332 100644 --- a/docs/deployment.ru.md +++ b/docs/deployment.ru.md @@ -38,7 +38,7 @@ cp docker.env.example .env Хранение файлов также требует `DOCA_FILE_STORE_ID` и `DOCA_FILE_STORES_JSON`, как указано `docker.env.example`Пути и учетные данные сервера считываются из окружения; страница управления доступна только для чтения. Смотрите [хранение файлов](storage.ru.md). -Текущий хост использует генерацию `doca-2026-10-12-book-payload-storage-v1`Стартап автоматически синхронизирует выпущенные базы данных версии 0.1.22. `doca-2026-10-09-history-storage-v1` После обзора/согласования текущих DDL-запросов и регистрации нового поколения. Все старые строки остаются, включая результаты работы SQL-книги; никаких преобразований, очисток или адаптеров старых данных добавлено не производится. Остатки старых записей из книги могут требовать ручной обработки. Существующие данные объектов версии 0.1.23 остаются. Смотрите. [Эволюция структуры базы данных](database-schema-evolution.ru.md) и [Требования к текущему выпуску](releases/0.3.10.ru.md)Точный базовый вариант 0.1.13 `doca-2026-10-08-knowledge-books-v2` Требуется явная обновление истории ниже. Необходимо сохранить базы данных, приватные объекты, конфигурацию и оригинальный ключ-мастер. +Текущий хост использует генерацию `doca-2026-10-12-book-payload-storage-v1`Стартап автоматически синхронизирует выпущенные базы данных версии 0.1.22. `doca-2026-10-09-history-storage-v1` После обзора/согласования текущих DDL-запросов и регистрации нового поколения. Все старые строки остаются, включая результаты работы SQL-книги; никаких преобразований, очисток или адаптеров старых данных добавлено не производится. Остатки старых записей из книги могут требовать ручной обработки. Существующие данные объектов версии 0.1.23 остаются. Смотрите. [Эволюция структуры базы данных](database-schema-evolution.ru.md) и [Требования к текущему выпуску](releases/0.3.11.ru.md)Точный базовый вариант 0.1.13 `doca-2026-10-08-knowledge-books-v2` Требуется явная обновление истории ниже. Необходимо сохранить базы данных, приватные объекты, конфигурацию и оригинальный ключ-мастер. `DOCA_ORIGIN` Источник — это тип, указанный пользователем в браузере. Принимаются HTTP и HTTPS, включая случаи использования в продакшене. Используйте только источник без подпатрона, запроса или фрагмента; корневой слеш в конце считается нормальным. diff --git a/docs/deployment.zh-CN.md b/docs/deployment.zh-CN.md index 3a84623c..4d5c499b 100644 --- a/docs/deployment.zh-CN.md +++ b/docs/deployment.zh-CN.md @@ -2,6 +2,30 @@ [English](deployment.md) · **简体中文** · [繁體中文](deployment.zh-Hant.md) · [日本語](deployment.ja.md) · [Français](deployment.fr.md) · [한국어](deployment.ko.md) · [Español](deployment.es.md) · [Русский](deployment.ru.md) +## Linux 原生一键安装 + +在使用 systemd 的全新 Debian 12 服务器(amd64 或 arm64)上,准备 curl 和 CA 证书。待[正式版本](https://github.com/workhold/doca/releases)提供原生安装器后,运行一条命令。 + +```sh +curl -fsSL https://github.com/workhold/doca/releases/latest/download/doca-install.sh | sudo bash +``` + +向导会询问管理员账号和密码、浏览器访问地址、站点默认语言、数据库和文件存储。单机可选择 SQLite 和本地磁盘。选择 PostgreSQL 时填写独立的空主库、空 Webhook 投递库和可选的空插件业务库连接。选择 S3 兼容存储时填写私有桶、区域和凭据;按服务商要求填写自定义端点并选择路径式寻址。参见[配置说明](configuration.zh-CN.md)和[文件存储](storage.zh-CN.md)。 + +安装器校验对应架构的运行包,通过 APT 和独立的 Python 环境安装 PDF 和 Office 渲染依赖。Doca 在 `127.0.0.1:39120` 健康后,安装器启用 `doca.service` 开机启动。远程访问时,在向导填实际 HTTP(S) 地址,并将 HTTP 和 WebSocket 请求通过[反向代理](#反向代理)转发至该端口。 + +程序位于 `/opt/doca`,配置位于 `/etc/doca/doca.env`,本地数据位于 `/var/lib/doca`。配置包含站点主密钥及外部数据库和云存储凭据,备份数据库和文件时一起保留。 + +```sh +sudo systemctl status doca.service +sudo journalctl -u doca.service -f +sudo systemctl restart doca.service +``` + +可用同版本安装器和原配置继续安装。SQLite 和本地磁盘支持无人值守安装,成对传入 `--admin-login` 和 `--admin-password-file`,也可指定 `--origin` 和 `--locale`。通过管道运行时用 `sudo bash -s -- <选项>` 传参。已下载的 `doca-install.sh` 可通过 `--archive` 读取本地运行包和同目录匹配的 `.sha256` 文件。渲染依赖仍由系统软件源和 Python 包源提供。 + +## Docker 部署 + 一台服务器可以运行 main 分支 `compose.yaml` 指定的镜像。单个容器使用 SQLite,不需要 PostgreSQL 或 Redis。只有运行多个应用副本时才需要它们。见 [单实例与水平扩展部署](horizontal-scaling.zh-CN.md)。 ## 条件 @@ -28,7 +52,7 @@ cp docker.env.example .env 文件存储还需要 `DOCA_FILE_STORE_ID` 和 `DOCA_FILE_STORES_JSON`,示例见 `docker.env.example`。后端路径和密钥通过环境变量提供,管理页只读展示。见[文件存储](storage.zh-CN.md)。 -当前宿主使用数据库代际 `doca-2026-10-12-book-payload-storage-v1`。对已发布 0.1.22 的 `doca-2026-10-09-history-storage-v1`,启动时以最新 DDL 检查并对齐结构、记录新代际;旧 SQL 知识册成果等全部业务行原样保留,不增加正文转换、单独清理或旧正文适配。残留旧知识册记录可能需人工处理,已有 0.1.23 对象存储数据保留。见[数据库结构演进](database-schema-evolution.zh-CN.md)及[当前发行要求](releases/0.3.10.zh-CN.md)。0.1.13 的准确基线 `doca-2026-10-08-knowledge-books-v2` 仍需按下方步骤显式升级历史存储。保留原数据库、私有对象、配置和凭证主密钥。 +当前宿主使用数据库代际 `doca-2026-10-12-book-payload-storage-v1`。对已发布 0.1.22 的 `doca-2026-10-09-history-storage-v1`,启动时以最新 DDL 检查并对齐结构、记录新代际;旧 SQL 知识册成果等全部业务行原样保留,不增加正文转换、单独清理或旧正文适配。残留旧知识册记录可能需人工处理,已有 0.1.23 对象存储数据保留。见[数据库结构演进](database-schema-evolution.zh-CN.md)及[当前发行要求](releases/0.3.11.zh-CN.md)。0.1.13 的准确基线 `doca-2026-10-08-knowledge-books-v2` 仍需按下方步骤显式升级历史存储。保留原数据库、私有对象、配置和凭证主密钥。 `DOCA_ORIGIN` 是用户在浏览器里打开的地址。包括生产环境在内,均支持 HTTP 和 HTTPS。不要加子路径、查询参数或片段;根路径末尾斜杠会被规范化。 diff --git a/docs/deployment.zh-Hant.md b/docs/deployment.zh-Hant.md index 512c0bdb..39e6fcc9 100644 --- a/docs/deployment.zh-Hant.md +++ b/docs/deployment.zh-Hant.md @@ -36,7 +36,7 @@ cp docker.env.example .env 檔案儲存還需要 `DOCA_FILE_STORE_ID` 和 `DOCA_FILE_STORES_JSON`,示例見 `docker.env.example`。後端路徑和金鑰透過環境變數提供,管理頁只讀展示。見[檔案儲存](storage.zh-Hant.md)。 -當前宿主使用資料庫代際 `doca-2026-10-12-book-payload-storage-v1`。對已釋出 0.1.22 的 `doca-2026-10-09-history-storage-v1`,啟動時以最新 DDL 檢查並對齊結構、記錄新代際;舊 SQL 知識冊成果等全部業務行原樣保留,不增加正文轉換、單獨清理或舊正文適配。殘留舊知識冊記錄可能需人工處理,已有 0.1.23 物件儲存資料保留。見[資料庫結構演進](database-schema-evolution.zh-Hant.md)及[當前發行要求](releases/0.3.10.zh-Hant.md)。0.1.13 的準確基線 `doca-2026-10-08-knowledge-books-v2` 仍需按下方步驟顯式升級歷史儲存。保留原資料庫、私有物件、配置和憑證主金鑰。 +當前宿主使用資料庫代際 `doca-2026-10-12-book-payload-storage-v1`。對已釋出 0.1.22 的 `doca-2026-10-09-history-storage-v1`,啟動時以最新 DDL 檢查並對齊結構、記錄新代際;舊 SQL 知識冊成果等全部業務行原樣保留,不增加正文轉換、單獨清理或舊正文適配。殘留舊知識冊記錄可能需人工處理,已有 0.1.23 物件儲存資料保留。見[資料庫結構演進](database-schema-evolution.zh-Hant.md)及[當前發行要求](releases/0.3.11.zh-Hant.md)。0.1.13 的準確基線 `doca-2026-10-08-knowledge-books-v2` 仍需按下方步驟顯式升級歷史儲存。保留原資料庫、私有物件、配置和憑證主金鑰。 `DOCA_ORIGIN` 是使用者在瀏覽器裡開啟的地址。包括生產環境在內,均支援 HTTP 和 HTTPS。不要加子路徑、查詢引數或片段;根路徑末尾斜槓會被規範化。 diff --git a/docs/document-experience.md b/docs/document-experience.md index 52b79c64..41590cda 100644 --- a/docs/document-experience.md +++ b/docs/document-experience.md @@ -18,7 +18,11 @@ The Documents page scrolls through recent visits below its sticky filters. The L In the [mobile workspace source](../specs/036-mobile-workspace/spec.md), Home uses the active server's name and logo, and the account menu uses the same avatar preferences as Web. Recent documents appear in one list. A title emoji followed by a space and text replaces the format icon in mobile resource lists, and library cards display the cover set on Web. -Recent documents show the library name when the server exposes it, or the same library or personal label as Web. Next to the profile picture, **Open link** accepts a document URL from the current server and **Scan** reads document or sign-in QR codes. Share invitations require confirmation before the App accepts access. [Mobile document experience](../specs/038-mobile-document-experience/spec.md) +Recent documents show the library name when the server exposes it, or the same library or personal label as Web. Next to the profile picture, **Open link** and **Scan** accept document, share and ticket links from the current server. Scan also reads sign-in codes. When a link requires invitation acceptance, the app shows a preview and asks for confirmation. [Mobile document experience](../specs/038-mobile-document-experience/spec.md) + +Use **New document** on Home for a personal document, **New library** in Libraries, or **New document** inside a library to create at its root. Library documents inherit access from their destination. Library managers and owners can rename the library and choose or remove its cover in **Library settings**. [Mobile creation and settings](../specs/043-mobile-resource-creation/spec.md) + +Open **Sharing and permissions** using the document shield, library settings, or the shared folder header. A subfolder leads to the shared root's permissions. The native panel uses the same APIs as Web for visibility, individual and group invitations, member roles and sources, sharing links, and access requests. Open related tickets from the panel, all tickets from the account page, or an individual ticket from a notification. Group owners and administrators handle invitations sent to their groups under **Resource invitations** on the account page. [Permission controls](permission-inheritance.md#shared-permission-components) Files opens separate personal, shared, and system folders. Tap a file to preview it or open its actions menu to download, rename, move, or send it to trash as permitted. The add button creates a folder or uploads a file in the current location. A move changes the containing folder. AI files and document attachments in system folders are available for browsing and download. diff --git a/docs/document-experience.zh-CN.md b/docs/document-experience.zh-CN.md index 94f1f6d2..b7104920 100644 --- a/docs/document-experience.zh-CN.md +++ b/docs/document-experience.zh-CN.md @@ -18,7 +18,11 @@ [手机工作台源码](../specs/036-mobile-workspace/spec.md)使用当前后端配置的名称和 Logo,账号入口与 Web 共用头像设置。最近访问集中在一张列表里。文档标题以表情、空格和正文开头时,列表中的类型图标由该表情替换。知识库卡片展示 Web 上设置的封面。 -最近访问显示服务端允许查看的知识库名称,或沿用 Web 的「知识库文档」「个人文档」标记。首页头像旁的「打开链接」接收当前服务器的文档链接,「扫码」识别文档链接和登录码。分享邀请需要用户确认后才会接受授权。[手机文档体验](../specs/038-mobile-document-experience/spec.md) +最近访问显示服务端允许查看的知识库名称,或沿用 Web 的「知识库文档」「个人文档」标记。首页头像旁的「打开链接」和「扫码」支持当前服务器的文档、分享和工单链接。「扫码」还支持登录码。需要接受邀请时,App 会显示预览并询问是否加入。[手机文档体验](../specs/038-mobile-document-experience/spec.md) + +在首页点「新建文档」创建个人文档,在知识库列表点「新建知识库」,或进入知识库后在库根目录新建文档。库内新文档继承所在知识库的访问权限。管理员和所有者可在「知识库设置」中改名、更换或移除封面。[手机端创建与设置](../specs/043-mobile-resource-creation/spec.md) + +从文档页盾牌、知识库设置或共享文件夹页头打开「分享与权限」。下级文件夹进入共享根的权限页。手机原生页面与 Web 使用同一套接口管理可见范围、个人和用户组邀请、协作者角色及授权来源、分享链接和权限申请。在权限页打开相关工单,在账号页查看全部工单,也可从通知进入工单详情。组所有者和管理员可在账号页的「资源授权邀请」中处理发送给用户组的邀请。[权限操作](permission-inheritance.zh-CN.md#共享权限组件) 文件页提供个人文件夹、共享文件夹和系统文件夹三个入口。点文件名打开预览,点行末菜单可按权限下载、重命名、移动或移到回收站。当前目录的加号用于新建文件夹和上传。移动可变更文件或文件夹的所属目录。系统目录里的 AI 文件和文档附件可浏览和下载。 diff --git a/docs/permission-inheritance.md b/docs/permission-inheritance.md index 2cbd50d5..74feb63f 100644 --- a/docs/permission-inheritance.md +++ b/docs/permission-inheritance.md @@ -65,3 +65,5 @@ Each row uses two lines: identity and actions above, metadata/member avatars and Source-detail entries also use `PermissionGrantRow`: the source label stays on the left, with its permission and removal controls on the right. Readonly source boundaries remain unchanged. `PermissionEffectiveAccess` highlights the effective role in bold blue when group access exceeds personal access and identifies the group source in the label. Mutation callbacks return success or failure: failure keeps the confirmation open, and only success closes it. Deleting a source and clearing an inheritance override have different confirmation copy; clearing an override resumes parent evaluation and must not be described as simply revoking access. Server-side ownership, management floors, invitation consent and scope checks remain authoritative. + +The mobile client offers the same permission operations in native screens for documents, libraries, and shared folders. It reads the same permission overviews and uses the same resource, folder, member, group, link, and ticket APIs as the Web panel. The server determines which actions each role can take. Document settings include permission inheritance and access to history. Shared folders publish and share from the shared root. If an update conflicts with another edit, the app refreshes the server revision and keeps the form input for review and retry. [Mobile permission acceptance](../specs/044-mobile-permission-parity/spec.md) diff --git a/docs/permission-inheritance.zh-CN.md b/docs/permission-inheritance.zh-CN.md index 83913b5e..52d593fb 100644 --- a/docs/permission-inheritance.zh-CN.md +++ b/docs/permission-inheritance.zh-CN.md @@ -65,3 +65,5 @@ Web 的 `apps/web/src/shared/components/permission-grant-row.tsx` 和同目录 授权来源明细同样复用 `PermissionGrantRow`:左侧来源名称,右侧权限及删除操作,保留原有来源只读边界。用户组权限高于个人权限时,`PermissionEffectiveAccess` 将生效角色显示为加粗蓝色,并在文案中明确用户组来源。 保存回调必须返回成功/失败:失败保留删除气泡,成功后才关闭。来源操作删除与清除继承覆盖使用不同确认文案,清除覆盖会恢复按上级计算;不得用通用的“取消授权”描述释放限制。后端仍独立校验所有者、管理下限、邀请接受及范围,不依赖前端组件授权。 + +手机端在原生页面提供文档、知识库和共享文件夹的同一套权限操作。权限概览和写入沿用 Web 面板使用的资源、文件夹、协作者、用户组、分享链接和工单接口。服务端决定当前角色可以执行的操作。文档可设置权限继承和阅读历史的权限,共享文件夹在共享根设置公开和分享。发生并发冲突时,App 会刷新服务端修订并保留表单输入,供用户核对后重试。[手机端权限验收](../specs/044-mobile-permission-parity/spec.md) diff --git a/docs/releases/0.3.11.es.md b/docs/releases/0.3.11.es.md new file mode 100644 index 00000000..ce71ff3d --- /dev/null +++ b/docs/releases/0.3.11.es.md @@ -0,0 +1,9 @@ +# Doca 0.3.11 · Instalación en Linux, permisos móviles y estabilidad en escritorio + +[English](https://workhold.github.io/doca/#/en/releases/0.3.11) · [简体中文](https://workhold.github.io/doca/#/zh-cn/releases/0.3.11) · [繁體中文](https://workhold.github.io/doca/#/zh-hant/releases/0.3.11) · [日本語](https://workhold.github.io/doca/#/ja/releases/0.3.11) · [Français](https://workhold.github.io/doca/#/fr/releases/0.3.11) · [한국어](https://workhold.github.io/doca/#/ko/releases/0.3.11) · [Русский](https://workhold.github.io/doca/#/ru/releases/0.3.11) + +- El asistente instala Doca en un servidor Debian 12 nuevo. Configura el administrador, el idioma, la base de datos y el almacenamiento, inicia Doca y activa el servicio systemd al arrancar. +- En el móvil, crea documentos personales y bases de conocimiento, cambia nombres y portadas y administra permisos, enlaces compartidos y solicitudes de acceso. +- La aplicación de escritorio cierra los puertos de mensajes de un solo uso de formularios, menús, selectores y hojas de cálculo para reducir la acumulación de mensajes en WebKit. + +El instalador de Android es `Doca-Android-0.3.11.apk`. La imagen del servidor es `smartdoca/doca:0.3.11`. diff --git a/docs/releases/0.3.11.fr.md b/docs/releases/0.3.11.fr.md new file mode 100644 index 00000000..5bac8946 --- /dev/null +++ b/docs/releases/0.3.11.fr.md @@ -0,0 +1,9 @@ +# Doca 0.3.11 · Installation Linux, autorisations sur mobile et stabilité du bureau + +[English](https://workhold.github.io/doca/#/en/releases/0.3.11) · [简体中文](https://workhold.github.io/doca/#/zh-cn/releases/0.3.11) · [繁體中文](https://workhold.github.io/doca/#/zh-hant/releases/0.3.11) · [日本語](https://workhold.github.io/doca/#/ja/releases/0.3.11) · [한국어](https://workhold.github.io/doca/#/ko/releases/0.3.11) · [Español](https://workhold.github.io/doca/#/es/releases/0.3.11) · [Русский](https://workhold.github.io/doca/#/ru/releases/0.3.11) + +- Un assistant installe Doca sur un nouveau serveur Debian 12. Il configure le compte administrateur, la langue, la base et le stockage, puis démarre Doca et active le service systemd au démarrage. +- Sur mobile, créez des documents personnels et des bases de connaissances, modifiez le nom et la couverture des bases et gérez les autorisations, les liens de partage et les demandes d’accès. +- L’application de bureau ferme les ports de messages à usage unique des formulaires, menus, listes et feuilles de calcul pour réduire l’accumulation de messages dans WebKit. + +Le programme Android est `Doca-Android-0.3.11.apk`. L’image serveur correspondante est `smartdoca/doca:0.3.11`. diff --git a/docs/releases/0.3.11.ja.md b/docs/releases/0.3.11.ja.md new file mode 100644 index 00000000..bd392874 --- /dev/null +++ b/docs/releases/0.3.11.ja.md @@ -0,0 +1,9 @@ +# Doca 0.3.11 · Linux ネイティブインストール、モバイルの権限、デスクトップの安定性 + +[English](https://workhold.github.io/doca/#/en/releases/0.3.11) · [简体中文](https://workhold.github.io/doca/#/zh-cn/releases/0.3.11) · [繁體中文](https://workhold.github.io/doca/#/zh-hant/releases/0.3.11) · [Français](https://workhold.github.io/doca/#/fr/releases/0.3.11) · [한국어](https://workhold.github.io/doca/#/ko/releases/0.3.11) · [Español](https://workhold.github.io/doca/#/es/releases/0.3.11) · [Русский](https://workhold.github.io/doca/#/ru/releases/0.3.11) + +- Debian 12 で新しいサイトをセットアップするインストールウィザードを追加しました。管理者、言語、データベース、ストレージを設定すると、Doca が起動し systemd の自動起動が有効になります。 +- モバイルで個人文書やナレッジベースを作成し、名前とカバーを編集できます。文書、ナレッジベース、共有フォルダーの権限、共有リンク、アクセス申請も管理できます。 +- デスクトップでは、フォーム、メニュー、選択欄、スプレッドシートの単発メッセージポートを閉じて、長時間実行時の WebKit のメッセージ蓄積を抑えます。 + +Android のインストーラーは `Doca-Android-0.3.11.apk` です。サーバーイメージは `smartdoca/doca:0.3.11` です。 diff --git a/docs/releases/0.3.11.ko.md b/docs/releases/0.3.11.ko.md new file mode 100644 index 00000000..728113fc --- /dev/null +++ b/docs/releases/0.3.11.ko.md @@ -0,0 +1,9 @@ +# Doca 0.3.11 · Linux 설치, 모바일 권한 및 데스크톱 안정성 + +[English](https://workhold.github.io/doca/#/en/releases/0.3.11) · [简体中文](https://workhold.github.io/doca/#/zh-cn/releases/0.3.11) · [繁體中文](https://workhold.github.io/doca/#/zh-hant/releases/0.3.11) · [日本語](https://workhold.github.io/doca/#/ja/releases/0.3.11) · [Français](https://workhold.github.io/doca/#/fr/releases/0.3.11) · [Español](https://workhold.github.io/doca/#/es/releases/0.3.11) · [Русский](https://workhold.github.io/doca/#/ru/releases/0.3.11) + +- Debian 12 새 사이트를 위한 설치 마법사를 추가했습니다. 관리자, 언어, 데이터베이스와 저장소를 설정하면 Doca가 시작되고 systemd 자동 시작이 활성화됩니다. +- 모바일에서 개인 문서와 지식 베이스를 만들고 지식 베이스 이름과 표지를 편집할 수 있습니다. 문서, 지식 베이스 및 공유 폴더의 권한, 공유 링크와 접근 요청도 관리할 수 있습니다. +- 데스크톱의 양식, 메뉴, 선택 목록 및 스프레드시트에서 일회성 메시지 포트를 닫아 WebKit에 메시지가 누적되는 문제를 줄였습니다. + +Android 설치 파일은 `Doca-Android-0.3.11.apk`입니다. 서버 이미지는 `smartdoca/doca:0.3.11`입니다. diff --git a/docs/releases/0.3.11.md b/docs/releases/0.3.11.md new file mode 100644 index 00000000..361b6c04 --- /dev/null +++ b/docs/releases/0.3.11.md @@ -0,0 +1,9 @@ +# Doca 0.3.11 · Native Linux installer, mobile permissions and desktop stability + +[简体中文](https://workhold.github.io/doca/#/zh-cn/releases/0.3.11) · [繁體中文](https://workhold.github.io/doca/#/zh-hant/releases/0.3.11) · [日本語](https://workhold.github.io/doca/#/ja/releases/0.3.11) · [Français](https://workhold.github.io/doca/#/fr/releases/0.3.11) · [한국어](https://workhold.github.io/doca/#/ko/releases/0.3.11) · [Español](https://workhold.github.io/doca/#/es/releases/0.3.11) · [Русский](https://workhold.github.io/doca/#/ru/releases/0.3.11) + +- Doca now has a native installation wizard for fresh Debian 12 hosts. It sets up the administrator, site language, database and storage, then starts Doca and enables its systemd service. +- On mobile, create personal documents and libraries, edit library names and covers, and manage permissions, share links, and access requests for documents, libraries and shared folders. +- The desktop client closes one-shot message ports used by forms, menus, selectors and spreadsheets to reduce WebKit event buildup on long-running sessions. + +The Android package is `Doca-Android-0.3.11.apk`. Use `smartdoca/doca:0.3.11` for the server. diff --git a/docs/releases/0.3.11.ru.md b/docs/releases/0.3.11.ru.md new file mode 100644 index 00000000..b84f0088 --- /dev/null +++ b/docs/releases/0.3.11.ru.md @@ -0,0 +1,9 @@ +# Doca 0.3.11 · Установка в Linux, разрешения на мобильных устройствах и стабильность настольного клиента + +[English](https://workhold.github.io/doca/#/en/releases/0.3.11) · [简体中文](https://workhold.github.io/doca/#/zh-cn/releases/0.3.11) · [繁體中文](https://workhold.github.io/doca/#/zh-hant/releases/0.3.11) · [日本語](https://workhold.github.io/doca/#/ja/releases/0.3.11) · [Français](https://workhold.github.io/doca/#/fr/releases/0.3.11) · [한국어](https://workhold.github.io/doca/#/ko/releases/0.3.11) · [Español](https://workhold.github.io/doca/#/es/releases/0.3.11) + +- Мастер установки настраивает новый сайт Doca на Debian 12. После выбора администратора, языка, базы и хранилища Doca запускается, а служба systemd включается при загрузке. +- В мобильном приложении можно создавать личные документы и базы знаний, менять имена и обложки баз, управлять разрешениями, ссылками и запросами доступа. +- Настольный клиент закрывает одноразовые порты сообщений форм, меню, списков и электронных таблиц, чтобы уменьшить накопление сообщений WebKit. + +Установщик Android называется `Doca-Android-0.3.11.apk`. Образ сервера — `smartdoca/doca:0.3.11`. diff --git a/docs/releases/0.3.11.zh-CN.md b/docs/releases/0.3.11.zh-CN.md new file mode 100644 index 00000000..cb288803 --- /dev/null +++ b/docs/releases/0.3.11.zh-CN.md @@ -0,0 +1,9 @@ +# Doca 0.3.11 · Linux 原生安装、手机权限与桌面稳定性 + +[English](https://workhold.github.io/doca/#/en/releases/0.3.11) · [繁體中文](https://workhold.github.io/doca/#/zh-hant/releases/0.3.11) · [日本語](https://workhold.github.io/doca/#/ja/releases/0.3.11) · [Français](https://workhold.github.io/doca/#/fr/releases/0.3.11) · [한국어](https://workhold.github.io/doca/#/ko/releases/0.3.11) · [Español](https://workhold.github.io/doca/#/es/releases/0.3.11) · [Русский](https://workhold.github.io/doca/#/ru/releases/0.3.11) + +- Debian 12 新站点可通过一条命令启动安装向导。设置管理员、默认语言、数据库和文件存储后,Doca 会启动并启用 systemd 开机自启。 +- 手机端可以创建个人文档和知识库、管理知识库名称和封面,并对文档、知识库和共享文件夹操作权限、分享链接、申请和审批。 +- 桌面端修复表单、菜单、下拉选项和表格中的一次性消息端口泄漏,减少长时间运行时的 WebKit 消息积压。 + +Android 安装包为 `Doca-Android-0.3.11.apk`。对应的服务器镜像为 `smartdoca/doca:0.3.11`。 diff --git a/docs/releases/0.3.11.zh-Hant.md b/docs/releases/0.3.11.zh-Hant.md new file mode 100644 index 00000000..93b94652 --- /dev/null +++ b/docs/releases/0.3.11.zh-Hant.md @@ -0,0 +1,9 @@ +# Doca 0.3.11 · Linux 原生安裝、手機權限與桌面穩定性 + +[English](https://workhold.github.io/doca/#/en/releases/0.3.11) · [简体中文](https://workhold.github.io/doca/#/zh-cn/releases/0.3.11) · [日本語](https://workhold.github.io/doca/#/ja/releases/0.3.11) · [Français](https://workhold.github.io/doca/#/fr/releases/0.3.11) · [한국어](https://workhold.github.io/doca/#/ko/releases/0.3.11) · [Español](https://workhold.github.io/doca/#/es/releases/0.3.11) · [Русский](https://workhold.github.io/doca/#/ru/releases/0.3.11) + +- Debian 12 新站點可透過一個指令開啟安裝精靈。設定管理員、預設語言、資料庫和檔案儲存後,Doca 會啟動並啟用 systemd 開機自動啟動。 +- 手機端可建立個人文件與知識庫、編輯知識庫名稱和封面,並管理文件、知識庫及共用資料夾的權限、分享連結與存取申請。 +- 桌面端關閉表單、選單、下拉選項和試算表的一次性訊息連接埠,減少 WebKit 長時間執行時的訊息堆積。 + +Android 安裝檔為 `Doca-Android-0.3.11.apk`。對應的伺服器映像檔為 `smartdoca/doca:0.3.11`。 diff --git a/docs/site/assets/site.js b/docs/site/assets/site.js index 370cf282..72609001 100644 --- a/docs/site/assets/site.js +++ b/docs/site/assets/site.js @@ -50,7 +50,7 @@ }, search: { paths: "auto", - namespace: "doca-docs-0.3.10", + namespace: "doca-docs-0.3.11", pathNamespaces: languages.map(code => "/" + code), placeholder: localizedConfig("search", editions.en.search), noData: localizedConfig("noResults", editions.en.noResults), diff --git a/docs/site/navigation.json b/docs/site/navigation.json index 0b46cf84..3fd15075 100644 --- a/docs/site/navigation.json +++ b/docs/site/navigation.json @@ -316,6 +316,12 @@ "en": "Releases", "zh": "发行记录", "pages": [ + [ + "releases/0.3.11", + "0.3.11 · Native Linux installation and mobile permissions", + "0.3.11 · Linux 原生安装与手机权限", + true + ], [ "releases/0.3.10", "0.3.10 · Mobile document lists and assistant", diff --git a/package.json b/package.json index 2d73e897..996ca146 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "doca", - "version": "0.3.10", + "version": "0.3.11", "license": "MIT", "private": true, "type": "module", diff --git a/packages/i18n/src/catalogs/en.ts b/packages/i18n/src/catalogs/en.ts index 81c04bb9..852db812 100644 --- a/packages/i18n/src/catalogs/en.ts +++ b/packages/i18n/src/catalogs/en.ts @@ -2880,8 +2880,8 @@ export const en = { "mobile.settings.invalidServer": "That server address is not valid", "mobile.settings.scan": "Scan to sign in on the web", "mobile.link.title": "Open link", - "mobile.link.paste": "Paste a Doca document link", - "mobile.link.invalid": "Enter a valid Doca document link.", + "mobile.link.paste": "Paste a Doca link", + "mobile.link.invalid": "Enter a valid document, share, or ticket link.", "mobile.link.otherServer": "This link is for a different server.", "mobile.scan.title": "Scan", "mobile.scan.cameraPermission": "Allow camera access to scan a QR code.", @@ -2890,7 +2890,7 @@ export const en = { "mobile.scan.noQr": "No QR code was found in this image.", "mobile.scan.multipleQr": "This image contains multiple QR codes. Choose an image with one QR code.", "mobile.scan.photoFailed": "Could not read this image. Try another photo.", - "mobile.scan.invalid": "Scan a Doca sign-in code or a document QR code.", + "mobile.scan.invalid": "Scan a Doca sign-in, document, share, or ticket QR code.", "mobile.scan.accountRequired": "Sign in to {origin} in the Doca app before scanning.", "mobile.scan.accountExpired": "Your session on this server has expired. Sign in again.", "mobile.scan.confirmAccount": "Sign in on the web as {name} on {origin}.", diff --git a/packages/i18n/src/catalogs/es.json b/packages/i18n/src/catalogs/es.json index 252b9174..5f713e51 100644 --- a/packages/i18n/src/catalogs/es.json +++ b/packages/i18n/src/catalogs/es.json @@ -2666,8 +2666,8 @@ "mobile.settings.invalidServer": "La dirección del servidor no es válida.", "mobile.settings.scan": "Escanee para iniciar sesión en la web", "mobile.link.title": "Abrir enlace", - "mobile.link.paste": "Pegar un enlace a un documento de Doca", - "mobile.link.invalid": "Introduce un enlace válido a un documento de Doca.", + "mobile.link.paste": "Pegar un enlace de Doca", + "mobile.link.invalid": "Introduce un enlace válido de documento, de uso compartido o de ticket.", "mobile.link.otherServer": "Este enlace pertenece a otro servidor.", "mobile.scan.title": "Escanear", "mobile.scan.cameraPermission": "Permite el acceso a la cámara para escanear un código QR.", @@ -2676,7 +2676,7 @@ "mobile.scan.noQr": "No se detectó ningún código QR en esta imagen.", "mobile.scan.multipleQr": "Esta imagen contiene varios códigos QR. Elige una imagen con un solo código QR.", "mobile.scan.photoFailed": "No se pudo leer la imagen. Prueba con otra foto.", - "mobile.scan.invalid": "Escanea un código QR de acceso de Doca o un enlace de documento.", + "mobile.scan.invalid": "Escanea un código QR de Doca para iniciar sesión o abrir un documento, un enlace compartido o un ticket.", "mobile.scan.accountRequired": "Inicia sesión en {origin} en Doca antes de escanear este código.", "mobile.scan.accountExpired": "La sesión de este servidor ha caducado. Inicia sesión de nuevo para escanear.", "mobile.scan.confirmAccount": "Iniciar sesión en la web como {name} en {origin}.", diff --git a/packages/i18n/src/catalogs/fr.json b/packages/i18n/src/catalogs/fr.json index a16937d3..d850e76d 100644 --- a/packages/i18n/src/catalogs/fr.json +++ b/packages/i18n/src/catalogs/fr.json @@ -2666,8 +2666,8 @@ "mobile.settings.invalidServer": "L’adresse du serveur n’est pas valide.", "mobile.settings.scan": "Scanner pour se connecter en ligne", "mobile.link.title": "Ouvrir un lien", - "mobile.link.paste": "Coller un lien vers un document Doca", - "mobile.link.invalid": "Saisissez un lien valide vers un document Doca.", + "mobile.link.paste": "Coller un lien Doca", + "mobile.link.invalid": "Saisissez un lien valide de document, de partage ou de ticket.", "mobile.link.otherServer": "Ce lien appartient à un autre serveur.", "mobile.scan.title": "Scanner", "mobile.scan.cameraPermission": "Autorisez la caméra pour scanner un code QR.", @@ -2676,7 +2676,7 @@ "mobile.scan.noQr": "Aucun code QR n’a été détecté dans cette image.", "mobile.scan.multipleQr": "Cette image contient plusieurs codes QR. Choisissez une image avec un seul code QR.", "mobile.scan.photoFailed": "Impossible de lire cette image. Essayez une autre photo.", - "mobile.scan.invalid": "Scannez un code de connexion Doca ou un lien de document.", + "mobile.scan.invalid": "Scannez un QR code Doca de connexion, de document, de partage ou de ticket.", "mobile.scan.accountRequired": "Connectez-vous à {origin} dans Doca avant de scanner ce code.", "mobile.scan.accountExpired": "La session sur ce serveur a expiré. Reconnectez-vous pour scanner.", "mobile.scan.confirmAccount": "Connexion au site en tant que {name} sur {origin}.", diff --git a/packages/i18n/src/catalogs/ja.json b/packages/i18n/src/catalogs/ja.json index c8f8067e..89713b72 100644 --- a/packages/i18n/src/catalogs/ja.json +++ b/packages/i18n/src/catalogs/ja.json @@ -2666,8 +2666,8 @@ "mobile.settings.invalidServer": "そのサーバーアドレスは有効ではありません。", "mobile.settings.scan": "ウェブ上でサインインするためにスキャンする", "mobile.link.title": "リンクを開く", - "mobile.link.paste": "Doca の文書リンクを貼り付け", - "mobile.link.invalid": "有効な Doca の文書リンクを入力してください。", + "mobile.link.paste": "Doca のリンクを貼り付け", + "mobile.link.invalid": "有効なドキュメント、共有、またはチケットのリンクを入力してください。", "mobile.link.otherServer": "このリンクは別のサーバーのものです。", "mobile.scan.title": "スキャン", "mobile.scan.cameraPermission": "QR コードを読み取るにはカメラへのアクセスを許可してください。", @@ -2676,7 +2676,7 @@ "mobile.scan.noQr": "この画像からQRコードを読み取れませんでした。", "mobile.scan.multipleQr": "この画像には複数のQRコードがあります。QRコードが1つだけの画像を選んでください。", "mobile.scan.photoFailed": "画像を読み込めませんでした。別の写真を選んでください。", - "mobile.scan.invalid": "Doca のログイン用 QR コードまたは文書リンクを読み取ってください。", + "mobile.scan.invalid": "Doca のログイン、ドキュメント、共有、またはチケットの QR コードを読み取ってください。", "mobile.scan.accountRequired": "Doca アプリで {origin} にログインしてから、このコードを読み取ってください。", "mobile.scan.accountExpired": "このサーバーのログインが期限切れです。再度ログインしてください。", "mobile.scan.confirmAccount": "{origin} の {name} として Web にログインします。", diff --git a/packages/i18n/src/catalogs/ko.json b/packages/i18n/src/catalogs/ko.json index d4dc2332..e8fb86fe 100644 --- a/packages/i18n/src/catalogs/ko.json +++ b/packages/i18n/src/catalogs/ko.json @@ -2666,8 +2666,8 @@ "mobile.settings.invalidServer": "그 서버 주소는 유효하지 않습니다.", "mobile.settings.scan": "웹에서 로그인하려면 스캔해야 합니다.", "mobile.link.title": "링크 열기", - "mobile.link.paste": "Doca 문서 링크 붙여넣기", - "mobile.link.invalid": "유효한 Doca 문서 링크를 입력하세요.", + "mobile.link.paste": "Doca 링크 붙여넣기", + "mobile.link.invalid": "유효한 문서, 공유 또는 티켓 링크를 입력하세요.", "mobile.link.otherServer": "이 링크는 다른 서버에 속합니다.", "mobile.scan.title": "스캔", "mobile.scan.cameraPermission": "QR 코드를 스캔하려면 카메라 접근을 허용하세요.", @@ -2676,7 +2676,7 @@ "mobile.scan.noQr": "이 이미지에서 QR 코드를 찾지 못했습니다.", "mobile.scan.multipleQr": "이 이미지에 QR 코드가 여러 개 있습니다. QR 코드가 하나인 이미지를 선택하세요.", "mobile.scan.photoFailed": "이미지를 읽을 수 없습니다. 다른 사진으로 다시 시도하세요.", - "mobile.scan.invalid": "Doca 로그인 QR 코드나 문서 링크를 스캔하세요.", + "mobile.scan.invalid": "Doca 로그인, 문서, 공유 또는 티켓 QR 코드를 스캔하세요.", "mobile.scan.accountRequired": "Doca 앱에서 {origin}에 로그인한 뒤 이 코드를 스캔하세요.", "mobile.scan.accountExpired": "이 서버의 로그인 세션이 만료되었습니다. 다시 로그인한 뒤 스캔하세요.", "mobile.scan.confirmAccount": "{origin}에서 {name} 계정으로 웹에 로그인합니다.", diff --git a/packages/i18n/src/catalogs/ru.json b/packages/i18n/src/catalogs/ru.json index dde5a72c..79e24b9d 100644 --- a/packages/i18n/src/catalogs/ru.json +++ b/packages/i18n/src/catalogs/ru.json @@ -2666,8 +2666,8 @@ "mobile.settings.invalidServer": "Адрес сервера неверен.", "mobile.settings.scan": "Сканируйте, чтобы войти в интернете", "mobile.link.title": "Открыть ссылку", - "mobile.link.paste": "Вставить ссылку на документ Doca", - "mobile.link.invalid": "Введите действительную ссылку на документ Doca.", + "mobile.link.paste": "Вставить ссылку Doca", + "mobile.link.invalid": "Введите действительную ссылку на документ, приглашение или заявку.", "mobile.link.otherServer": "Эта ссылка ведёт на другой сервер.", "mobile.scan.title": "Сканировать", "mobile.scan.cameraPermission": "Разрешите доступ к камере для сканирования QR-кода.", @@ -2676,7 +2676,7 @@ "mobile.scan.noQr": "QR-код на этом изображении не найден.", "mobile.scan.multipleQr": "На этом изображении несколько QR-кодов. Выберите изображение с одним кодом.", "mobile.scan.photoFailed": "Не удалось прочитать изображение. Попробуйте выбрать другое фото.", - "mobile.scan.invalid": "Отсканируйте QR-код для входа в Doca или ссылку на документ.", + "mobile.scan.invalid": "Отсканируйте QR-код Doca для входа, открытия документа, приглашения или заявки.", "mobile.scan.accountRequired": "Войдите на {origin} в Doca перед сканированием этого кода.", "mobile.scan.accountExpired": "Сеанс на этом сервере истёк. Войдите снова, чтобы сканировать.", "mobile.scan.confirmAccount": "Вход на сайт как {name} на {origin}.", diff --git a/packages/i18n/src/catalogs/zh-Hant.json b/packages/i18n/src/catalogs/zh-Hant.json index 84406c0a..dbbb82d0 100644 --- a/packages/i18n/src/catalogs/zh-Hant.json +++ b/packages/i18n/src/catalogs/zh-Hant.json @@ -2666,8 +2666,8 @@ "mobile.settings.invalidServer": "伺服器地址無效", "mobile.settings.scan": "掃碼登入網頁", "mobile.link.title": "開啟連結", - "mobile.link.paste": "貼上 Doca 文件連結", - "mobile.link.invalid": "請輸入有效的 Doca 文件連結。", + "mobile.link.paste": "貼上 Doca 連結", + "mobile.link.invalid": "請輸入有效的文件、分享或工單連結。", "mobile.link.otherServer": "這個連結屬於其他伺服器。", "mobile.scan.title": "掃碼", "mobile.scan.cameraPermission": "允許使用相機後即可掃碼。", @@ -2676,7 +2676,7 @@ "mobile.scan.noQr": "這張圖片裡沒有辨識到二維碼。", "mobile.scan.multipleQr": "這張圖片裡有多個二維碼,請選擇只含一個二維碼的圖片。", "mobile.scan.photoFailed": "無法讀取圖片,請換一張再試。", - "mobile.scan.invalid": "請掃描 Doca 登入二維碼或文件連結。", + "mobile.scan.invalid": "請掃描 Doca 登入碼,或文件、分享、工單的二維碼。", "mobile.scan.accountRequired": "請先在 Doca App 登入 {origin},再掃描此二維碼。", "mobile.scan.accountExpired": "這個伺服器的登入已失效,請重新登入後再掃碼。", "mobile.scan.confirmAccount": "將使用 {origin} 上的「{name}」登入網頁。", diff --git a/packages/i18n/src/catalogs/zh.ts b/packages/i18n/src/catalogs/zh.ts index e532378d..747bc145 100644 --- a/packages/i18n/src/catalogs/zh.ts +++ b/packages/i18n/src/catalogs/zh.ts @@ -2670,8 +2670,8 @@ export const zh = { "mobile.settings.invalidServer": "服务器地址无效", "mobile.settings.scan": "扫码登录网页", "mobile.link.title": "打开链接", - "mobile.link.paste": "粘贴 Doca 文档链接", - "mobile.link.invalid": "请输入有效的 Doca 文档链接。", + "mobile.link.paste": "粘贴 Doca 链接", + "mobile.link.invalid": "请输入有效的文档、分享或工单链接。", "mobile.link.otherServer": "链接属于其他服务器。", "mobile.scan.title": "扫码", "mobile.scan.cameraPermission": "允许使用相机后即可扫码。", @@ -2680,7 +2680,7 @@ export const zh = { "mobile.scan.noQr": "这张图片里没有识别到二维码。", "mobile.scan.multipleQr": "这张图片里有多个二维码,请选择只含一个二维码的图片。", "mobile.scan.photoFailed": "无法读取图片,请换一张再试。", - "mobile.scan.invalid": "请扫描 Doca 登录二维码或文档链接。", + "mobile.scan.invalid": "请扫描 Doca 登录码,或文档、分享、工单的二维码。", "mobile.scan.accountRequired": "请先在 Doca App 登录 {origin},再扫描此二维码。", "mobile.scan.accountExpired": "这个服务器的登录已失效,请重新登录后再扫码。", "mobile.scan.confirmAccount": "将使用 {origin} 上的「{name}」登录网页。", diff --git a/patches/@rc-component__form@1.8.6.patch b/patches/@rc-component__form@1.8.6.patch new file mode 100644 index 00000000..20b0a42a --- /dev/null +++ b/patches/@rc-component__form@1.8.6.patch @@ -0,0 +1,32 @@ +diff --git a/es/hooks/useNotifyWatch.js b/es/hooks/useNotifyWatch.js +--- a/es/hooks/useNotifyWatch.js ++++ b/es/hooks/useNotifyWatch.js +@@ -4,7 +4,11 @@ + */ + export const macroTask = fn => { + const channel = new MessageChannel(); +- channel.port1.onmessage = fn; ++ channel.port1.onmessage = event => { ++ channel.port1.close(); ++ channel.port2.close(); ++ fn.call(channel.port1, event); ++ }; + channel.port2.postMessage(null); + }; + export default class WatcherCenter { +diff --git a/lib/hooks/useNotifyWatch.js b/lib/hooks/useNotifyWatch.js +--- a/lib/hooks/useNotifyWatch.js ++++ b/lib/hooks/useNotifyWatch.js +@@ -10,7 +10,11 @@ + */ + const macroTask = fn => { + const channel = new MessageChannel(); +- channel.port1.onmessage = fn; ++ channel.port1.onmessage = event => { ++ channel.port1.close(); ++ channel.port2.close(); ++ fn.call(channel.port1, event); ++ }; + channel.port2.postMessage(null); + }; + exports.macroTask = macroTask; diff --git a/patches/@rc-component__overflow@1.0.1.patch b/patches/@rc-component__overflow@1.0.1.patch new file mode 100644 index 00000000..449607ed --- /dev/null +++ b/patches/@rc-component__overflow@1.0.1.patch @@ -0,0 +1,32 @@ +diff --git a/es/hooks/channelUpdate.js b/es/hooks/channelUpdate.js +--- a/es/hooks/channelUpdate.js ++++ b/es/hooks/channelUpdate.js +@@ -3,7 +3,11 @@ export default function channelUpdate(callback) { + if (typeof MessageChannel === 'undefined') { + raf(callback); + } else { + const channel = new MessageChannel(); +- channel.port1.onmessage = () => callback(); ++ channel.port1.onmessage = () => { ++ channel.port1.close(); ++ channel.port2.close(); ++ callback(); ++ }; + channel.port2.postMessage(undefined); + } +diff --git a/lib/hooks/channelUpdate.js b/lib/hooks/channelUpdate.js +--- a/lib/hooks/channelUpdate.js ++++ b/lib/hooks/channelUpdate.js +@@ -10,7 +10,11 @@ function channelUpdate(callback) { + if (typeof MessageChannel === 'undefined') { + (0, _raf.default)(callback); + } else { + const channel = new MessageChannel(); +- channel.port1.onmessage = () => callback(); ++ channel.port1.onmessage = () => { ++ channel.port1.close(); ++ channel.port2.close(); ++ callback(); ++ }; + channel.port2.postMessage(undefined); + } diff --git a/patches/@rc-component__select@1.10.1.patch b/patches/@rc-component__select@1.10.1.patch new file mode 100644 index 00000000..5207865d --- /dev/null +++ b/patches/@rc-component__select@1.10.1.patch @@ -0,0 +1,32 @@ +diff --git a/es/hooks/useOpen.js b/es/hooks/useOpen.js +--- a/es/hooks/useOpen.js ++++ b/es/hooks/useOpen.js +@@ -2,7 +2,11 @@ + import { useRef, useState, useEffect } from 'react'; + const internalMacroTask = fn => { + const channel = new MessageChannel(); +- channel.port1.onmessage = fn; ++ channel.port1.onmessage = () => { ++ channel.port1.close(); ++ channel.port2.close(); ++ fn(); ++ }; + channel.port2.postMessage(null); + }; + export const macroTask = (fn, times = 1) => { +diff --git a/lib/hooks/useOpen.js b/lib/hooks/useOpen.js +--- a/lib/hooks/useOpen.js ++++ b/lib/hooks/useOpen.js +@@ -8,7 +8,11 @@ + var _react = require("react"); + const internalMacroTask = fn => { + const channel = new MessageChannel(); +- channel.port1.onmessage = fn; ++ channel.port1.onmessage = () => { ++ channel.port1.close(); ++ channel.port2.close(); ++ fn(); ++ }; + channel.port2.postMessage(null); + }; + const macroTask = (fn, times = 1) => { diff --git a/patches/@univerjs__core@0.25.1.patch b/patches/@univerjs__core@0.25.1.patch new file mode 100644 index 00000000..056b07d3 --- /dev/null +++ b/patches/@univerjs__core@0.25.1.patch @@ -0,0 +1,90 @@ +diff --git a/lib/cjs/index.js b/lib/cjs/index.js +--- a/lib/cjs/index.js ++++ b/lib/cjs/index.js +@@ -920,15 +920,18 @@ + function requestImmediateMacroTask(callback) { + const channel = new MessageChannel(); +- let cancelled = false; +- const handler = () => { +- if (!cancelled) callback(); +- }; +- channel.port1.onmessage = handler; +- channel.port2.postMessage(null); +- return () => { +- cancelled = true; ++ let pending = true; ++ const close = () => { ++ if (!pending) return; ++ pending = false; + channel.port1.onmessage = null; + channel.port1.close(); + channel.port2.close(); + }; ++ channel.port1.onmessage = () => { ++ if (!pending) return; ++ close(); ++ callback(); ++ }; ++ channel.port2.postMessage(null); ++ return close; + } +diff --git a/lib/es/index.js b/lib/es/index.js +--- a/lib/es/index.js ++++ b/lib/es/index.js +@@ -886,15 +886,18 @@ + function requestImmediateMacroTask(callback) { + const channel = new MessageChannel(); +- let cancelled = false; +- const handler = () => { +- if (!cancelled) callback(); +- }; +- channel.port1.onmessage = handler; +- channel.port2.postMessage(null); +- return () => { +- cancelled = true; ++ let pending = true; ++ const close = () => { ++ if (!pending) return; ++ pending = false; + channel.port1.onmessage = null; + channel.port1.close(); + channel.port2.close(); + }; ++ channel.port1.onmessage = () => { ++ if (!pending) return; ++ close(); ++ callback(); ++ }; ++ channel.port2.postMessage(null); ++ return close; + } +diff --git a/lib/index.js b/lib/index.js +--- a/lib/index.js ++++ b/lib/index.js +@@ -886,15 +886,18 @@ + function requestImmediateMacroTask(callback) { + const channel = new MessageChannel(); +- let cancelled = false; +- const handler = () => { +- if (!cancelled) callback(); +- }; +- channel.port1.onmessage = handler; +- channel.port2.postMessage(null); +- return () => { +- cancelled = true; ++ let pending = true; ++ const close = () => { ++ if (!pending) return; ++ pending = false; + channel.port1.onmessage = null; + channel.port1.close(); + channel.port2.close(); + }; ++ channel.port1.onmessage = () => { ++ if (!pending) return; ++ close(); ++ callback(); ++ }; ++ channel.port2.postMessage(null); ++ return close; + } diff --git a/patches/README.md b/patches/README.md index 5d9cdea7..5faba5c5 100644 --- a/patches/README.md +++ b/patches/README.md @@ -4,6 +4,8 @@ The `@mastra/memory@1.29.0` patch makes reflection read and validate the record The `@open-file-viewer/core@0.1.47` patch reads PDF.js text chunks with `ReadableStream.getReader()`. A text read error leaves the rendered page visible, and a canceled render leaves the page ready to draw when the reader returns to it. The browser regression builds the Doca preview and checks a scanned page and selectable text with stream async iteration disabled. [PDF preview regression](../scripts/qa-file-pdf-preview.mts) +The `@rc-component/form`, `@rc-component/overflow`, `@rc-component/select` and `@univerjs/core` patches close both ports when a one-shot message arrives. These packages schedule work for Ant Design forms, menu overflow and selects, and for spreadsheet rendering and calculations. Univer also closes both ports when a task is canceled. Accumulated ports increase IPC work in the WebKit version sampled during a desktop freeze. `tests/desktop-message-ports.test.ts` checks asynchronous delivery, cancellation and port cleanup. [WebKit's MessagePort dispatch fix](https://github.com/WebKit/WebKit/commit/5157006888252f01a0e53c808a2dc4b441abfeaa) + The editor fixes now ship upstream: Slate 0.4.25 contains the DOCX fixes and Markdown 0.4.4 contains the KaTeX/lazy-PDF fixes. Doca installs their official npm artifacts without editor patch bindings. The obsolete editor patch files were removed after verifying the official artifacts and DOCX/PDF regressions; preceding releases and their matching patches remain recoverable from Git history. Local copies are retained under `artifacts/verification/npm-direct-2026-10-23/retired-editor-patches/`. The DOCX scope covers directly assigned font family, font size, hex foreground/background colors, paragraph alignment, explicit off marks and table-cell marks, with online heading sizes, 16px body text, 1.6 line spacing and A4 defaults. Arbitrary inherited Word styles, complex sections and exact Word pagination remain outside the verified scope. `tests/document-pdf.test.ts` and `tests/document-pdf-access.test.ts` pass against official Slate 0.4.25. The actual browser export/reimport check passes three rich-text pages and one Markdown page, with math/image checks and zero source writes or page errors. See [the reviewed npm integration record](../docs/verification/issue-tracker-2026-10-21/npm-direct.md). diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dfe3c795..723b9f97 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -62,6 +62,10 @@ overrides: patchedDependencies: '@mastra/memory@1.29.0': 60d56858970164a4f0b90b5f380282484f93fef17d89ee36db8a8a4d2ceb02ab '@open-file-viewer/core@0.1.47': 6f9b3a925fbc0651a4cbd007f51cf607c73d6752e691dfce865fad64a8238371 + '@rc-component/form@1.8.6': 98a7b10a741b54bf93dd65f735d925f41da650bdd8f343315b9d939697cc49d1 + '@rc-component/overflow@1.0.1': 82855bc88dd78603cdf96a37bf246e7a4d6b75ec09268434c5ad1bf5d869f981 + '@rc-component/select@1.10.1': 4e689c9c0e6c35fc5c4c8664fdb2434bd7a64d97d0d2ebbecccecce91eba6b30 + '@univerjs/core@0.25.1': 62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee importers: @@ -13769,7 +13773,7 @@ snapshots: '@rc-component/cascader@1.22.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': dependencies: - '@rc-component/select': 1.10.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@rc-component/select': 1.10.1(patch_hash=4e689c9c0e6c35fc5c4c8664fdb2434bd7a64d97d0d2ebbecccecce91eba6b30)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/tree': 1.4.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/util': 1.13.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) clsx: 2.1.1 @@ -13832,7 +13836,7 @@ snapshots: react: 19.2.8 react-dom: 19.2.8(react@19.2.8) - '@rc-component/form@1.8.6(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': + '@rc-component/form@1.8.6(patch_hash=98a7b10a741b54bf93dd65f735d925f41da650bdd8f343315b9d939697cc49d1)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': dependencies: '@rc-component/async-validator': 6.0.0 '@rc-component/util': 1.13.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -13889,7 +13893,7 @@ snapshots: '@rc-component/menu@1.5.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': dependencies: '@rc-component/motion': 1.3.3(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@rc-component/overflow': 1.0.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@rc-component/overflow': 1.0.1(patch_hash=82855bc88dd78603cdf96a37bf246e7a4d6b75ec09268434c5ad1bf5d869f981)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/trigger': 3.10.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/util': 1.13.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) clsx: 2.1.1 @@ -13921,7 +13925,7 @@ snapshots: react: 19.2.8 react-dom: 19.2.8(react@19.2.8) - '@rc-component/overflow@1.0.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': + '@rc-component/overflow@1.0.1(patch_hash=82855bc88dd78603cdf96a37bf246e7a4d6b75ec09268434c5ad1bf5d869f981)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': dependencies: '@babel/runtime': 7.29.7 '@rc-component/resize-observer': 1.1.2(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -13939,7 +13943,7 @@ snapshots: '@rc-component/picker@1.12.2(dayjs@1.11.23)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': dependencies: - '@rc-component/overflow': 1.0.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@rc-component/overflow': 1.0.1(patch_hash=82855bc88dd78603cdf96a37bf246e7a4d6b75ec09268434c5ad1bf5d869f981)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/resize-observer': 1.1.2(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/trigger': 3.10.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/util': 1.13.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -13991,9 +13995,9 @@ snapshots: react: 19.2.8 react-dom: 19.2.8(react@19.2.8) - '@rc-component/select@1.10.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': + '@rc-component/select@1.10.1(patch_hash=4e689c9c0e6c35fc5c4c8664fdb2434bd7a64d97d0d2ebbecccecce91eba6b30)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': dependencies: - '@rc-component/overflow': 1.0.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@rc-component/overflow': 1.0.1(patch_hash=82855bc88dd78603cdf96a37bf246e7a4d6b75ec09268434c5ad1bf5d869f981)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/trigger': 3.10.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/util': 1.13.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/virtual-list': 1.5.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -14062,7 +14066,7 @@ snapshots: '@rc-component/tree-select@1.16.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': dependencies: - '@rc-component/select': 1.10.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@rc-component/select': 1.10.1(patch_hash=4e689c9c0e6c35fc5c4c8664fdb2434bd7a64d97d0d2ebbecccecce91eba6b30)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/tree': 1.4.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/util': 1.13.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) clsx: 2.1.1 @@ -14700,7 +14704,7 @@ snapshots: '@smartdoca/sheet@0.2.21(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': dependencies: '@antv/g2': 5.4.8 - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) '@univerjs/drawing-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) @@ -15207,7 +15211,7 @@ snapshots: dependencies: '@univerjs-pro/collaboration': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/collaboration-client': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) @@ -15233,7 +15237,7 @@ snapshots: '@noble/ciphers': 2.4.0 '@univerjs-pro/collaboration': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/license': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/drawing': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/network': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15248,7 +15252,7 @@ snapshots: dependencies: '@univerjs-pro/license': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/sheets-outline': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/data-validation': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15267,7 +15271,7 @@ snapshots: '@univerjs-pro/docs-exchange-client@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: '@univerjs-pro/exchange-client': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) transitivePeerDependencies: - '@types/react' @@ -15280,7 +15284,7 @@ snapshots: dependencies: '@univerjs-pro/license': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/print': 0.25.1 - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15308,7 +15312,7 @@ snapshots: '@univerjs-pro/sheets-shape-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/sheets-sparkline': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/sheets-sparkline-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/data-validation': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15353,7 +15357,7 @@ snapshots: '@univerjs-pro/sheets-pivot': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/sheets-shape': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/sheets-sparkline': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/data-validation': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/drawing': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15378,7 +15382,7 @@ snapshots: '@univerjs-pro/engine-chart@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 transitivePeerDependencies: @@ -15387,7 +15391,7 @@ snapshots: '@univerjs-pro/engine-formula@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: '@univerjs-pro/license': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) transitivePeerDependencies: - react @@ -15401,7 +15405,7 @@ snapshots: dependencies: '@univerjs-pro/collaboration': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/license': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/icons': 1.4.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/network': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15419,7 +15423,7 @@ snapshots: dependencies: '@noble/ed25519': 3.1.0 '@noble/hashes': 2.2.0 - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 transitivePeerDependencies: @@ -15431,7 +15435,7 @@ snapshots: dependencies: '@univerjs-pro/engine-chart': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/sheets-chart': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/drawing': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15454,7 +15458,7 @@ snapshots: dependencies: '@univerjs-pro/engine-chart': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/license': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets-drawing': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15465,7 +15469,7 @@ snapshots: '@univerjs-pro/sheets-exchange-client@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: '@univerjs-pro/exchange-client': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) '@univerjs/ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) @@ -15479,7 +15483,7 @@ snapshots: '@univerjs-pro/sheets-outline-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: '@univerjs-pro/sheets-outline': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/icons': 1.4.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -15496,7 +15500,7 @@ snapshots: '@univerjs-pro/sheets-outline@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: '@univerjs-pro/license': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 transitivePeerDependencies: @@ -15506,7 +15510,7 @@ snapshots: dependencies: '@univerjs-pro/engine-pivot': 0.25.1 '@univerjs-pro/sheets-pivot': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15527,7 +15531,7 @@ snapshots: dependencies: '@univerjs-pro/engine-pivot': 0.25.1 '@univerjs-pro/license': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/rpc': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15542,7 +15546,7 @@ snapshots: '@univerjs-pro/collaboration-client': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/license': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/print': 0.25.1 - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) @@ -15563,7 +15567,7 @@ snapshots: dependencies: '@univerjs-pro/engine-shape': 0.25.1 '@univerjs-pro/sheets-shape': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) @@ -15587,7 +15591,7 @@ snapshots: dependencies: '@univerjs-pro/engine-shape': 0.25.1 '@univerjs-pro/license': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/drawing': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets-drawing': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15598,7 +15602,7 @@ snapshots: '@univerjs-pro/sheets-sparkline-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: '@univerjs-pro/sheets-sparkline': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15618,7 +15622,7 @@ snapshots: '@univerjs-pro/sheets-sparkline@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: '@univerjs-pro/license': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 transitivePeerDependencies: @@ -15628,7 +15632,7 @@ snapshots: dependencies: '@univerjs-pro/collaboration-client': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs-pro/license': 0.25.1(react@19.2.8)(rxjs@7.8.2) - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/network': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/protocol': 0.25.1 '@univerjs/thread-comment': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15640,7 +15644,7 @@ snapshots: - react - react-dom - '@univerjs/core@0.25.1(react@19.2.8)(rxjs@7.8.2)': + '@univerjs/core@0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2)': dependencies: '@univerjs/protocol': 0.25.1 '@univerjs/themes': 0.25.1 @@ -15659,7 +15663,7 @@ snapshots: '@univerjs/data-validation@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 transitivePeerDependencies: - react @@ -15687,7 +15691,7 @@ snapshots: '@univerjs/docs-drawing-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs-drawing': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15705,7 +15709,7 @@ snapshots: '@univerjs/docs-drawing@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/drawing': 0.25.1(react@19.2.8)(rxjs@7.8.2) transitivePeerDependencies: - react @@ -15713,7 +15717,7 @@ snapshots: '@univerjs/docs-hyper-link-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs-hyper-link': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15730,14 +15734,14 @@ snapshots: '@univerjs/docs-hyper-link@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) transitivePeerDependencies: - react - rxjs '@univerjs/docs-thread-comment-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15754,7 +15758,7 @@ snapshots: '@univerjs/docs-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/drawing': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15770,7 +15774,7 @@ snapshots: '@univerjs/docs@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 transitivePeerDependencies: @@ -15778,7 +15782,7 @@ snapshots: '@univerjs/drawing-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/drawing': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -15793,7 +15797,7 @@ snapshots: '@univerjs/drawing@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) ot-json1: 1.0.2 rxjs: 7.8.2 transitivePeerDependencies: @@ -15802,7 +15806,7 @@ snapshots: '@univerjs/engine-formula@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: '@flatten-js/interval-tree': 1.1.3 - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/rpc': 0.25.1(react@19.2.8)(rxjs@7.8.2) decimal.js: 10.6.0 rxjs: 7.8.2 @@ -15813,7 +15817,7 @@ snapshots: dependencies: '@floating-ui/dom': 1.8.0 '@floating-ui/utils': 0.2.12 - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) cjk-regex: 3.4.0 franc-min: 6.2.0 opentype.js: 2.0.0 @@ -15823,7 +15827,7 @@ snapshots: '@univerjs/find-replace@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/icons': 1.4.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -15842,7 +15846,7 @@ snapshots: '@univerjs/network@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 transitivePeerDependencies: - react @@ -16142,7 +16146,7 @@ snapshots: '@univerjs/presets@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/preset-docs-advanced': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) '@univerjs/preset-docs-collaboration': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) '@univerjs/preset-docs-core': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) @@ -16177,7 +16181,7 @@ snapshots: '@univerjs/rpc-node@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/rpc': 0.25.1(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 transitivePeerDependencies: @@ -16185,14 +16189,14 @@ snapshots: '@univerjs/rpc@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 transitivePeerDependencies: - react '@univerjs/sheets-conditional-formatting-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -16212,7 +16216,7 @@ snapshots: '@univerjs/sheets-conditional-formatting@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -16222,7 +16226,7 @@ snapshots: '@univerjs/sheets-data-validation-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/data-validation': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -16243,7 +16247,7 @@ snapshots: '@univerjs/sheets-data-validation@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/data-validation': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/protocol': 0.25.1 @@ -16255,7 +16259,7 @@ snapshots: '@univerjs/sheets-drawing-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs-drawing': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) @@ -16275,7 +16279,7 @@ snapshots: '@univerjs/sheets-drawing@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/drawing': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -16285,7 +16289,7 @@ snapshots: '@univerjs/sheets-filter-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/icons': 1.4.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -16303,7 +16307,7 @@ snapshots: '@univerjs/sheets-filter@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/rpc': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -16314,7 +16318,7 @@ snapshots: '@univerjs/sheets-find-replace@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/find-replace': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -16328,7 +16332,7 @@ snapshots: '@univerjs/sheets-formula-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) @@ -16348,7 +16352,7 @@ snapshots: '@univerjs/sheets-formula@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/rpc': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -16358,7 +16362,7 @@ snapshots: '@univerjs/sheets-graphics@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) transitivePeerDependencies: @@ -16370,7 +16374,7 @@ snapshots: '@univerjs/sheets-hyper-link-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) @@ -16392,7 +16396,7 @@ snapshots: '@univerjs/sheets-hyper-link@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -16402,7 +16406,7 @@ snapshots: '@univerjs/sheets-note-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/icons': 1.4.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -16419,7 +16423,7 @@ snapshots: '@univerjs/sheets-note@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 transitivePeerDependencies: @@ -16427,7 +16431,7 @@ snapshots: '@univerjs/sheets-numfmt-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -16445,7 +16449,7 @@ snapshots: '@univerjs/sheets-numfmt@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 @@ -16454,7 +16458,7 @@ snapshots: '@univerjs/sheets-sort-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/icons': 1.4.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -16471,7 +16475,7 @@ snapshots: '@univerjs/sheets-sort@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) transitivePeerDependencies: @@ -16480,7 +16484,7 @@ snapshots: '@univerjs/sheets-table-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -16500,7 +16504,7 @@ snapshots: '@univerjs/sheets-table@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 @@ -16509,7 +16513,7 @@ snapshots: '@univerjs/sheets-thread-comment-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/icons': 1.4.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -16528,7 +16532,7 @@ snapshots: '@univerjs/sheets-thread-comment@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/sheets': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/thread-comment': 0.25.1(react@19.2.8)(rxjs@7.8.2) @@ -16538,7 +16542,7 @@ snapshots: '@univerjs/sheets-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/docs-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) @@ -16558,7 +16562,7 @@ snapshots: '@univerjs/sheets@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-formula': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/protocol': 0.25.1 @@ -16569,7 +16573,7 @@ snapshots: '@univerjs/telemetry@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) transitivePeerDependencies: - react - rxjs @@ -16578,7 +16582,7 @@ snapshots: '@univerjs/thread-comment-ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/docs-ui': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2) '@univerjs/icons': 1.4.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -16593,14 +16597,14 @@ snapshots: '@univerjs/thread-comment@0.25.1(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) rxjs: 7.8.2 transitivePeerDependencies: - react '@univerjs/ui@0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(rxjs@7.8.2)': dependencies: - '@univerjs/core': 0.25.1(react@19.2.8)(rxjs@7.8.2) + '@univerjs/core': 0.25.1(patch_hash=62ac740a4f2d2d4e8633d7c259a5689972650c96a265ac764f4960223c6c74ee)(react@19.2.8)(rxjs@7.8.2) '@univerjs/design': 0.25.1(@types/react-dom@19.2.7(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@univerjs/engine-render': 0.25.1(react@19.2.8)(rxjs@7.8.2) '@univerjs/icons': 1.4.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -16834,7 +16838,7 @@ snapshots: '@rc-component/dialog': 1.10.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/drawer': 1.4.2(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/dropdown': 1.0.3(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@rc-component/form': 1.8.6(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@rc-component/form': 1.8.6(patch_hash=98a7b10a741b54bf93dd65f735d925f41da650bdd8f343315b9d939697cc49d1)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/image': 1.10.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/input': 1.3.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/input-number': 1.6.2(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -16851,7 +16855,7 @@ snapshots: '@rc-component/rate': 1.0.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/resize-observer': 1.1.2(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/segmented': 1.3.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@rc-component/select': 1.10.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@rc-component/select': 1.10.1(patch_hash=4e689c9c0e6c35fc5c4c8664fdb2434bd7a64d97d0d2ebbecccecce91eba6b30)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/slider': 1.1.1(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/steps': 1.2.3(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@rc-component/switch': 1.0.3(react-dom@19.2.8(react@19.2.8))(react@19.2.8) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index eeae7096..82672827 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -73,3 +73,7 @@ overrides: patchedDependencies: '@mastra/memory@1.29.0': patches/@mastra__memory@1.29.0.patch '@open-file-viewer/core@0.1.47': patches/@open-file-viewer__core@0.1.47.patch + '@rc-component/form@1.8.6': patches/@rc-component__form@1.8.6.patch + '@rc-component/overflow@1.0.1': patches/@rc-component__overflow@1.0.1.patch + '@rc-component/select@1.10.1': patches/@rc-component__select@1.10.1.patch + '@univerjs/core@0.25.1': patches/@univerjs__core@0.25.1.patch diff --git a/scripts/install-native.sh b/scripts/install-native.sh new file mode 100755 index 00000000..04d7caa3 --- /dev/null +++ b/scripts/install-native.sh @@ -0,0 +1,391 @@ +#!/usr/bin/env bash +set +x +set -euo pipefail +umask 077 +PATH=/usr/sbin:/usr/bin:/sbin:/bin + +release_tag=__DOCA_RELEASE_TAG__ +program=/opt/doca +config_dir=/etc/doca +config_file=$config_dir/doca.env +state_dir=/var/lib/doca +unit=doca.service +unit_file=/etc/systemd/system/$unit +listen_host=127.0.0.1 +listen_port=39120 + +fail() { + printf 'Doca: %s\n' "$*" >&2 + exit 1 +} + +usage() { + cat <<'HELP' +Usage: doca-install.sh [--origin URL] [--locale CODE] [--archive FILE] + [--admin-login NAME --admin-password-file FILE] + +Installs and starts Doca on Debian 12 (amd64, arm64) with systemd. +The first install asks for the administrator, site language, database and +file storage. Providing an administrator password file selects unattended +setup with SQLite and local storage. Use --locale to set the site language. +The default origin is http://127.0.0.1:39120. For a reverse proxy, set the +browser-facing origin with --origin. With --archive, use the matching +release archive and its adjacent .sha256 file. +HELP +} + +parse_options() { + while (($#)); do + case "$1" in + --help|-h) usage; exit 0 ;; + --origin|--locale|--archive|--admin-login|--admin-password-file) + [[ $# -ge 2 && -n "$2" && "$2" != --* ]] || fail "$1 requires a value." + case "$1" in + --origin) requested_origin=$2 ;; + --locale) requested_locale=$2 ;; + --archive) local_archive=$2 ;; + --admin-login) admin_login=$2 ;; + --admin-password-file) password_file=$2 ;; + esac + shift 2 ;; + *) fail "Unknown option $1. Use --help for usage." ;; + esac + done + if [[ -n "$admin_login" && -z "$password_file" || -z "$admin_login" && -n "$password_file" ]]; then + fail "Supply --admin-login and --admin-password-file together." + fi +} + +preflight() { + [[ $EUID == 0 ]] || fail "Run this installer with sudo." + [[ "$release_tag" =~ ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]] \ + || fail "Use doca-install.sh from a Doca release." + # /etc/os-release is the distro's shell-compatible identification file. + [[ -r /etc/os-release ]] || fail "This release supports Debian 12." + . /etc/os-release + [[ "${ID:-}" == debian && "${VERSION_ID:-}" == 12 ]] \ + || fail "This release supports Debian 12." + arch=$(dpkg --print-architecture) + [[ "$arch" == amd64 || "$arch" == arm64 ]] || fail "Unsupported architecture: $arch." + for tool in curl flock runuser sha256sum systemctl tar; do + command -v "$tool" >/dev/null || fail "Required tool is missing: $tool." + done + systemctl show --property=Version --value >/dev/null || fail "A running systemd manager is required." + exec 9>/run/lock/doca-install.lock + flock -n 9 || fail "Another Doca installer is running." + + # Use the generated configuration even when invoked from a Doca shell. + while IFS= read -r name; do + case "$name" in + DOCA_*|DOTENV_CONFIG_*|NODE_OPTIONS|NODE_PATH|TSX_TSCONFIG_PATH) unset "$name" ;; + esac + done < <(compgen -e) +} + +read_admin_credentials() { + if [[ -n "$password_file" ]]; then + [[ -f "$password_file" && -r "$password_file" ]] || fail "Cannot read the administrator password file." + IFS= read -r admin_password < "$password_file" || [[ -n "$admin_password" ]] \ + || fail "The administrator password file is empty." + else + if ! { exec 3<>/dev/tty; } 2>/dev/null; then + fail "For a non-interactive install, provide --admin-login and --admin-password-file." + fi + printf 'Administrator login: ' >&3 + IFS= read -r admin_login <&3 || fail "Administrator setup was interrupted." + printf 'Administrator password: ' >&3 + IFS= read -rs admin_password <&3 || fail "Administrator setup was interrupted." + printf '\nConfirm password: ' >&3 + IFS= read -rs confirmation <&3 || fail "Administrator setup was interrupted." + printf '\n' >&3 + exec 3>&- + [[ "$admin_password" == "$confirmation" ]] || fail "Passwords differ." + unset confirmation + fi + [[ "$admin_login" =~ ^[a-zA-Z0-9+][a-zA-Z0-9_.@+-]{2,159}$ ]] \ + || fail "Use a 3–160 character administrator login with letters, digits or ._@+-." + [[ "${#admin_password}" -ge 12 && "${#admin_password}" -le 128 ]] \ + || fail "Use a password with 12–128 characters." +} + +download() { + curl -q --fail --silent --show-error --location --proto '=https' --proto-redir '=https' \ + --connect-timeout 15 --retry 2 --output "$2" "$1" +} + +normalize_origin() { + "$1" --input-type=module - "$2" <<'JS' +try { + const url = new URL(process.argv[2]); + if (!["http:", "https:"].includes(url.protocol) || url.username || + url.password || url.pathname !== "/" || url.search || url.hash) { + throw new Error(); + } + console.log(url.origin); +} catch { + console.error("Use an HTTP(S) origin without credentials, a path, query or fragment."); + process.exitCode = 1; +} +JS +} + +configure_site() ( + local stage=$1 origin=$requested_origin locale=$requested_locale database=sqlite storage=local + local main_url= webhook_url= plugin_url= bucket= region= endpoint= path_style=no access= secret= token= choice + cd "$stage/app" + local -a setup=("$stage/bin/node" --import tsx apps/server/src/bootstrap/native-install.ts) + if [[ -z "$password_file" ]]; then + exec 3<>/dev/tty + if [[ -z "$origin" ]]; then + printf 'Site URL [http://127.0.0.1:39120]: ' >&3 + IFS= read -r origin <&3 + fi + if [[ -z "$locale" ]]; then + "${setup[@]}" locales >&3 + printf 'Site default language [zh]: ' >&3 + IFS= read -r locale <&3 + fi + printf 'Database, SQLite (1) or PostgreSQL (2) [1]: ' >&3 + IFS= read -r choice <&3 + case "$choice" in + ""|1) ;; + 2) + database=postgres + printf 'Use separate empty databases for the main site, Webhooks and optional plugins.\n' >&3 + printf 'PostgreSQL main database URL: ' >&3 + IFS= read -rs main_url <&3 + printf '\nPostgreSQL Webhook database URL: ' >&3 + IFS= read -rs webhook_url <&3 + printf '\nPostgreSQL shared plugin database URL [optional]: ' >&3 + IFS= read -rs plugin_url <&3 + printf '\n' >&3 ;; + *) fail "Select database 1 or 2." ;; + esac + + printf 'File storage, local disk (1) or S3-compatible (2) [1]: ' >&3 + IFS= read -r choice <&3 + case "$choice" in + ""|1) ;; + 2) + storage=s3 + printf 'Private S3 bucket: ' >&3 + IFS= read -r bucket <&3 + printf 'S3 region [us-east-1]: ' >&3 + IFS= read -r region <&3 + printf 'Custom S3 endpoint [optional]: ' >&3 + IFS= read -r endpoint <&3 + if [[ -n "$endpoint" ]]; then path_style=yes; fi + printf 'Use path-style addressing [yes/no, %s]: ' "$path_style" >&3 + IFS= read -r choice <&3 + case "$choice" in + "") ;; + y|yes) path_style=yes ;; + n|no) path_style=no ;; + *) fail "Enter yes or no for path-style addressing." ;; + esac + printf 'S3 access key ID: ' >&3 + IFS= read -rs access <&3 + printf '\nS3 secret access key: ' >&3 + IFS= read -rs secret <&3 + printf '\nS3 session token [optional]: ' >&3 + IFS= read -rs token <&3 + printf '\n' >&3 ;; + *) fail "Select storage 1 or 2." ;; + esac + exec 3>&- + fi + + DOCA_SETUP_ORIGIN="$origin" DOCA_SETUP_LOCALE="${locale:-zh}" \ + DOCA_SETUP_DATABASE="$database" DOCA_SETUP_STORAGE="$storage" \ + DOCA_SETUP_POSTGRES_URL="$main_url" DOCA_SETUP_WEBHOOK_URL="$webhook_url" DOCA_SETUP_PLUGIN_URL="$plugin_url" \ + DOCA_SETUP_S3_BUCKET="$bucket" DOCA_SETUP_S3_REGION="${region:-us-east-1}" DOCA_SETUP_S3_ENDPOINT="$endpoint" \ + DOCA_SETUP_S3_PATH_STYLE="$path_style" DOCA_SETUP_S3_ACCESS_KEY="$access" \ + DOCA_SETUP_S3_SECRET="$secret" DOCA_SETUP_S3_SESSION_TOKEN="$token" \ + "${setup[@]}" configure > "$stage/.initial-env" +) + +stage_installation() { + local archive="doca-linux-$arch-$release_tag.tar.gz" url stage digest name received + for path in "$config_dir" "$state_dir" "$unit_file"; do + [[ ! -e "$path" && ! -L "$path" ]] || fail "Existing path $path requires review." + done + local load_state + load_state=$(systemctl show --property=LoadState --value "$unit") || fail "Cannot check the systemd unit." + [[ "$load_state" == not-found ]] || fail "An existing $unit requires review." + if getent passwd doca >/dev/null || getent group doca >/dev/null; then + fail "An existing doca system account or group requires review." + fi + + read_admin_credentials + work=$(mktemp -d /opt/.doca-install.XXXXXXXX) + trap 'rm -rf -- "$work"' EXIT + if [[ -n "$local_archive" ]]; then + cp -- "$local_archive" "$work/$archive" + cp -- "$local_archive.sha256" "$work/$archive.sha256" + else + url="https://github.com/workhold/doca/releases/download/$release_tag/$archive" + download "$url.sha256" "$work/$archive.sha256" + printf 'Downloading Doca %s for linux/%s...\n' "$release_tag" "$arch" + download "$url" "$work/$archive" + fi + read -r digest name < "$work/$archive.sha256" || fail "Cannot read the release checksum." + [[ "$digest" =~ ^[a-f0-9]{64}$ && "$name" == "$archive" ]] \ + || fail "The checksum does not describe the requested release archive." + received=$(sha256sum "$work/$archive") + [[ "${received%% *}" == "$digest" ]] || fail "Release archive checksum mismatch." + + stage=$work/program + install -d -m 0755 "$stage" + (umask 022; tar -xzf "$work/$archive" -C "$stage" --no-same-owner --no-same-permissions) + [[ -x "$stage/bin/node" && -f "$stage/app/apps/web/dist/index.html" \ + && -f "$stage/doca.service" && -f "$stage/pdf-requirements.txt" ]] \ + || fail "The release archive is missing runtime files." + [[ $("$stage/bin/node" -p 'require(process.argv[1]).version' "$stage/app/package.json") == "${release_tag#v}" ]] \ + || fail "The runtime version does not match the installer." + "$stage/bin/node" -e ' + const net = require("node:net"); + const server = net.createServer(); + server.on("error", () => { + console.error("The Doca listen address is unavailable."); + process.exitCode = 1; + }); + server.listen(Number(process.argv[2]), process.argv[1], () => server.close()); + ' "$listen_host" "$listen_port" + + configure_site "$stage" + digest=$(sha256sum "$stage/.initial-env") + printf '%s\n' "${digest%% *}" > "$stage/.configuration-sha256" + printf '%s\n' "$release_tag" > "$stage/.native-release" + mv -T -- "$stage" "$program" +} + +prepare_site() { + local loaded_config configured_origin requested stored_locale digest + [[ ! -L "$config_dir" && ! -L "$config_file" && ! -L "$state_dir" ]] \ + || fail "The configuration or data path requires review." + if [[ -f "$config_file" ]]; then + loaded_config=$config_file + elif [[ -f "$program/.initial-env" && ! -e "$state_dir" ]]; then + loaded_config=$program/.initial-env + else + fail "The site configuration is unavailable. Restore $config_file before retrying." + fi + digest=$(sha256sum "$loaded_config") + [[ "${digest%% *}" == "$(cat "$program/.configuration-sha256")" ]] \ + || fail "Site configuration has changed. Manage the existing service with systemctl." + configured_origin=$("$program/bin/node" --env-file="$loaded_config" -p 'new URL(process.env.DOCA_ORIGIN).origin') + if [[ -n "$requested_origin" ]]; then + requested=$(normalize_origin "$program/bin/node" "$requested_origin") || fail "Invalid site origin." + [[ "$requested" == "$configured_origin" ]] || fail "This installation already uses $configured_origin." + fi + if [[ -n "$requested_locale" ]]; then + stored_locale=$("$program/bin/node" --env-file="$loaded_config" -p 'process.env.DOCA_INSTALL_LOCALE') + [[ "$requested_locale" == "$stored_locale" ]] || fail "This installation was created with language $stored_locale." + fi + site_origin=$configured_origin + + if ! id -u doca >/dev/null 2>&1; then + useradd --system --user-group --home-dir "$state_dir" --shell /usr/sbin/nologin doca + fi + if [[ ! -f "$config_file" ]]; then + install -d -m 0750 -o root -g doca "$config_dir" + local pending_config + pending_config=$(mktemp "$config_dir/.doca-env.XXXXXXXX") + install -m 0640 -o root -g doca "$program/.initial-env" "$pending_config" + mv -T -- "$pending_config" "$config_file" + fi + rm -f -- "$program/.initial-env" + if [[ ! -e "$state_dir" ]]; then + install -d -m 0750 -o doca -g doca "$state_dir" + fi + [[ -d "$state_dir" && $(stat -c %u "$state_dir") == "$(id -u doca)" ]] \ + || fail "The site directory is not owned by the doca service user." +} + +install_renderers() { + if [[ -f "$program/.renderers-ready" ]]; then return; fi + apt-get -o Acquire::Retries=3 update 9>&- + DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 install -y --no-install-recommends \ + python3 python3-venv libpango-1.0-0 libpangoft2-1.0-0 libharfbuzz-subset0 \ + fonts-noto-cjk fonts-liberation \ + libreoffice-writer libreoffice-calc libreoffice-impress libreoffice-math 9>&- + ( + umask 022 + python3 -m venv "$program/python" + "$program/python/bin/python" -m pip install --no-cache-dir -r "$program/pdf-requirements.txt" + "$program/python/bin/python" -c 'import weasyprint' + /usr/bin/soffice --headless --version + ) + touch "$program/.renderers-ready" +} + +bootstrap_site() ( + cd "$program/app" || exit 1 + export DOCA_BOOTSTRAP_LOGIN="$admin_login" DOCA_BOOTSTRAP_PASSWORD="$admin_password" + runuser -u doca -- "$program/bin/node" --env-file="$config_file" --import tsx \ + apps/server/src/bootstrap/native-install.ts bootstrap +) + +initialize_admin() { + if [[ -f "$program/.site-initialized" ]]; then return; fi + if bootstrap_site; then + touch "$program/.site-initialized" + return + else + [[ $? == 3 ]] || fail "Site initialization failed." + fi + read_admin_credentials + bootstrap_site + touch "$program/.site-initialized" +} + +start_service() { + if [[ -e "$unit_file" || -L "$unit_file" ]]; then + [[ ! -L "$unit_file" ]] && cmp -s -- "$program/$unit" "$unit_file" \ + || fail "Existing $unit_file requires review." + else + install -m 0644 "$program/$unit" "$unit_file" + fi + systemctl daemon-reload + systemctl start "$unit" 9>&- || fail "Service start failed. See: sudo journalctl -u $unit" + local host="${site_origin#*://}" response attempt + for ((attempt=0; attempt<60; attempt++)); do + if response=$(curl -q --noproxy '*' --fail --silent --max-time 2 \ + --header "Host: $host" "http://$listen_host:$listen_port/health") && + "$program/bin/node" -e ' + try { + const health = JSON.parse(require("node:fs").readFileSync(0, "utf8")); + process.exitCode = Number(health.status !== "ok" || health.version !== process.argv[1]); + } catch { process.exitCode = 1; } + ' "${release_tag#v}" <<< "$response" && + systemctl is-active --quiet "$unit"; then + systemctl enable "$unit" + printf '\nDoca %s is running and enabled at boot.\nOpen %s\n' "$release_tag" "$site_origin" + printf 'Status: sudo systemctl status %s\nLogs: sudo journalctl -u %s -f\n' "$unit" "$unit" + return + fi + sleep 1 + done + fail "Service health verification failed. See: sudo journalctl -u $unit" +} + +main() { + local requested_origin= requested_locale= local_archive= admin_login= password_file= admin_password= + parse_options "$@" + preflight + if [[ -e "$program" || -L "$program" ]]; then + [[ -d "$program" && ! -L "$program" && -f "$program/.native-release" ]] \ + || fail "Existing path $program requires review." + [[ $(cat "$program/.native-release") == "$release_tag" ]] \ + || fail "This installer can only resume the same native release." + else + stage_installation + fi + prepare_site + install_renderers + initialize_admin + unset admin_password + start_service +} + +main "$@" diff --git a/scripts/pack-native-release.sh b/scripts/pack-native-release.sh new file mode 100755 index 00000000..3698b45c --- /dev/null +++ b/scripts/pack-native-release.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ $# != 3 || "$3" != amd64 && "$3" != arm64 ]]; then + echo "Usage: $0 " >&2 + exit 2 +fi + +root=$(cd -- "$(dirname -- "$0")/.." && pwd) +payload=$(cd -- "$1" && pwd) +out=$2 +arch=$3 +version=$("$payload/bin/node" -p 'require(process.argv[1]).version' "$payload/app/package.json") +expected=$("$payload/bin/node" -p 'require(process.argv[1]).version' "$root/package.json") +if [[ ! "$version" =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ || "$version" != "$expected" ]]; then + echo "Native bundle version must match the checkout's official release version." >&2 + exit 1 +fi +if [[ -n "${GITHUB_REF_NAME:-}" && "$GITHUB_REF_NAME" != "v$version" ]]; then + echo "Native bundle version must match the GitHub tag." >&2 + exit 1 +fi + +node_arch=$arch +if [[ "$arch" == amd64 ]]; then node_arch=x64; fi +if [[ $("$payload/bin/node" -p 'process.platform + "/" + process.arch') != "linux/$node_arch" ]]; then + echo "Native runtime architecture does not match linux/$arch." >&2 + exit 1 +fi + +archive="doca-linux-$arch-v$version.tar.gz" +mkdir -p -- "$out" +tar -C "$payload" -czf "$out/$archive" bin app doca.service pdf-requirements.txt LICENSE LICENSE.node +(cd -- "$out" && sha256sum "$archive" > "$archive.sha256") +sed "s/__DOCA_RELEASE_TAG__/v$version/" "$root/scripts/install-native.sh" > "$out/doca-install.sh" +chmod 755 "$out/doca-install.sh" +printf '%s\n' "$out/$archive" "$out/doca-install.sh" diff --git a/scripts/qa-native-release.sh b/scripts/qa-native-release.sh new file mode 100755 index 00000000..90bba033 --- /dev/null +++ b/scripts/qa-native-release.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ $# != 3 || "$2" != amd64 && "$2" != arm64 ]]; then + echo "Usage: $0 " >&2 + exit 2 +fi + +file=$(cd -- "$(dirname -- "$1")" && pwd)/$(basename -- "$1") +version=${3#v} +docker run --rm -i --platform "linux/$2" --network none --user 1000:1000 \ + --mount "type=bind,source=$file,target=/bundle.tar.gz,readonly" \ + --tmpfs /var/lib/doca:uid=1000,gid=1000 \ + --env "EXPECTED_VERSION=$version" \ + debian:bookworm-slim bash -s <<'RUN' +set -euo pipefail +for command in node npm pnpm docker; do + if command -v "$command" >/dev/null; then exit 1; fi +done + +runtime=$(mktemp -d) +tar -xzf /bundle.tar.gz -C "$runtime" +node="$runtime/bin/node" +cd "$runtime/app" +DOCA_SETUP_LOCALE=ja "$node" --import tsx apps/server/src/bootstrap/native-install.ts configure > "$runtime/site.env" +DOCA_BOOTSTRAP_LOGIN=smoke-admin DOCA_BOOTSTRAP_PASSWORD=native-release-smoke-password \ + "$node" --env-file="$runtime/site.env" --import tsx apps/server/src/bootstrap/native-install.ts bootstrap +"$node" --env-file="$runtime/site.env" --import tsx apps/server/src/main.ts > "$runtime/service.log" 2>&1 & +service=$! +trap 'kill "$service" 2>/dev/null || true; wait "$service" || true' EXIT +trap 'cat "$runtime/service.log" >&2' ERR +"$node" --input-type=module - <<'JS' +import assert from "node:assert/strict"; +import http from "node:http"; +import { setTimeout as delay } from "node:timers/promises"; +const base = "http://127.0.0.1:39120"; +async function request(path, body) { + return await new Promise((resolve, reject) => { + const data = body === undefined ? "" : JSON.stringify(body); + const client = http.request(base + path, { + method: body === undefined ? "GET" : "POST", + headers: { origin: base, "content-type": "application/json", "content-length": Buffer.byteLength(data) }, + timeout: 3000, + }, (res) => { + res.setEncoding("utf8"); + let text = ""; + res.on("data", (chunk) => { text += chunk; }); + res.on("error", reject); + res.on("end", () => resolve({ status: res.statusCode, text, headers: res.headers })); + }); + client.on("error", reject); + client.on("timeout", () => client.destroy(new Error("request timeout"))); + client.end(data); + }); +} +let health; +for (let i = 0; i < 60; i++) { + health = await request("/health").catch(() => undefined); + if (health?.status === 200) break; + await delay(500); +} +assert.equal(health?.status, 200); +assert.equal(JSON.parse(health.text).version, process.env.EXPECTED_VERSION); +const bootstrap = await request("/api/v1/bootstrap"); +assert.equal(bootstrap.status, 200); +assert.equal(JSON.parse(bootstrap.text).defaultLocale, "ja"); +const home = await request("/"); +assert.equal(home.status, 200); +const entry = home.text.match(/src="(\/assets\/[^"]+\.js)"/)?.[1]; +assert.ok(entry); +assert.equal((await request(entry)).status, 200); +const login = await request("/api/v1/auth/login", { + login: "smoke-admin", password: "native-release-smoke-password", +}); +assert.equal(login.status, 200); +assert.ok(login.headers["set-cookie"]?.length); +console.log("Verified Doca " + process.env.EXPECTED_VERSION + " native runtime on " + process.arch); +JS +RUN diff --git a/specs/043-mobile-resource-creation/spec.md b/specs/043-mobile-resource-creation/spec.md new file mode 100644 index 00000000..ec772510 --- /dev/null +++ b/specs/043-mobile-resource-creation/spec.md @@ -0,0 +1,56 @@ +# 手机端创建文档和管理知识库 + +**Level**: standard +**Status**: verified +**Created**: 2026-12-05 +**Decision**: 用户要求补齐手机端个人文档、知识库和库内文档的创建入口,并接入知识库名称、权限和封面设置。改动是原生客户端交互,使用现有服务端授权、接口及存储。 + +## Scope + +Doca 0.3.10 的 iOS 和 Android 工作台,基线为 Expo 53.0.27 和 React Native 0.79.5。创建在首页、知识库列表和普通知识库文档树发起。设置入口沿用 Web 的管理员和所有者范围。 + +## Acceptance + +- **AC-001**:首页可新建个人文档,知识库列表可新建知识库。创建后打开新资源,返回时可在对应列表找到它。 +- **AC-002**:普通知识库的编辑者、管理员及所有者可在库根目录新建文档。文档采用服务端的继承权限,支持富文本、表格、Markdown、画布和演示。只读成员和由生成工作流维护内容的知识书没有库内新建入口。 +- **AC-003**:知识库管理员和所有者可修改名称,从相册更换或移除封面。成功后,知识库标题和列表使用服务端保存的名称及封面。 +- **AC-004**:管理者可调整可见范围、公开权限、访问申请和个人协作者授权。公网公开选项、管理角色、协作者可调整范围及子文档授权依据当前服务端返回和写入校验。 +- **AC-005**:表单展示提交状态及服务端错误。发生版本或权限修订冲突后刷新当前数据,保留用户输入以供核对重试。 + +## Architecture and contracts + +创建、详情及改名使用 `/resources` 和 `/resources/:id`。封面通过 `/assets?purpose=cover` 上传,并写入 `/resources/:id/cover`。权限读取 `/resources/:id/permission-overview`,使用 `/permissions`、`/members/:userId` 和 `/permission-sources/:userId` 的既有资源路由。更新[手机工作台说明](../../docs/document-experience.md#mobile-workspace)。 + +## Compatibility decision + +使用 Doca 0.3.10 当前的资源字段、资产记录和权限修订。此次客户端入口没有跨版本格式选择、转换或迁移。 + +## Design + +三个创建入口共用同一表单,库内明确展示目标知识库。设置页提供名称和封面,并进入独立的权限页。提交使用服务端版本或授权修订,保存后重新读取有关详情和列表。封面预览支持本地选择和鉴权读取。个人授权使用服务端发出邀请或直接授权,现有个人授权可单独调整或撤销。 + +## Tasks + +- [x] T001 实现创建表单及三个入口(AC-001、AC-002)。 +- [x] T002 实现知识库设置、个人授权及保存结果刷新(AC-003、AC-004、AC-005)。 +- [x] T003 更新工作台说明并验证隔离后端上的手机交互(AC-001 至 AC-005)。 + +## Validation + +**Result**: passed + +| 验收 | 验证结果 | +| --- | --- | +| AC-001 | Android 从首页新建 Markdown,打开后返回个人文档列表可见。iOS 和 Android 均从知识库列表创建新库并进入新库。 | +| AC-002 | iOS 所有者在库内创建表格,Android 编辑者创建演示文稿。回到文档树可见新文档,后端确认所属库、根目录和继承权限。表单显示五种格式。Android 阅读者只看到文档树,直接调用创建接口返回 403。通过源码核对知识书使用详情的生成类型标记来隐藏新建入口。 | +| AC-003 | Android 改名后,返回知识库可看到新标题。选取相册图片并保存后,后端返回可鉴权读取的 WebP,列表卡片显示该封面。移除并保存后,封面字段为空。 | +| AC-004 | iOS 保存站内公开、可评论和允许申请权限,后端读取结果一致。邀请个人协作者、将个人授权范围调整为当前知识库可阅读、撤销个人授权均成功。站点关闭公网公开后,未全网公开的库只显示私有和站内公开。编辑者没有管理入口,切换为阅读者后访问管理页被服务端拒绝。 | +| AC-005 | Android 空名称显示必填。并发改名和并发权限更新分别触发资源版本和权限修订冲突。App 保留待提交的名称、成员角色及子文档范围,复试后写入成功。 | + +验证使用 Doca 0.3.10 源码、隔离 SQLite 服务端、375 点宽的 iPhone SE 模拟器和 Android 15 模拟器。iOS 使用 Expo Go,Android 使用本地签名的验证包。截图、可访问性快照及后端结果保存在 `artifacts/verification/mobile-resource-creation/`。 + +手机端 TypeScript 检查、SDD 及文档检查通过。权限、继承、访问申请、文档标题和界面语言共 103 项现有针对性测试通过。 + +## References + +[Doca 开发流程](../../docs/sdd.md) · [模块索引](../../docs/sdd-module-index.md) diff --git a/specs/044-mobile-permission-parity/spec.md b/specs/044-mobile-permission-parity/spec.md new file mode 100644 index 00000000..df8962b0 --- /dev/null +++ b/specs/044-mobile-permission-parity/spec.md @@ -0,0 +1,60 @@ +# 手机端权限操作与 Web 对齐 + +**Level**: standard +**Status**: verified +**Created**: 2026-12-05 +**Decision**: 用户明确要求文档、知识库和文件夹的权限操作与 Web 一致,并确认手机继续使用原生界面,调用 Web 使用的现有 API。变更属于客户端交互及数据刷新。 + +## Scope + +Doca 0.3.10,Expo SDK 53 和 React Native 0.79.5。文档、知识库和一级共享文件夹共用手机端权限导航。共享文件夹下级定位到同一共享根。保留已验收的创建、知识库名称和封面流程。[手机工作台](../../docs/document-experience.md#mobile-workspace) + +## Acceptance + +- **AC-001**:三个对象都能从原生入口查看当前身份及生效权限。一级共享目录具备 Web 的管理动作,下级目录可进入共享根权限,普通文件夹不出现共享管理。服务端授权决定每类角色的可用操作。 +- **AC-002**:可查找并邀请个人和群组,查看成员、群组成员和授权来源,按 Web 的规则调整角色、子文档范围及撤销授权。授权来源详情区分个人、链接、群组、所有权和继承,并能单独更新或撤销可操作的来源。用户组所有者和管理员可在账号页处理发送给组的资源邀请。 +- **AC-003**:文档和知识库提供 Web 的公开范围、公开角色及访问申请设置,文档还支持继承及恢复字段、阅读历史和公开知识库的统一范围。共享文件夹管理站内公开。 +- **AC-004**:按 Web 支持的方式启停、创建、复制及管理分享链接。文档及库包含使用记录、停用及撤销历史,共享文件夹支持更新链接。角色、期限及人数上限以服务端保存为准。手机可打开当前服务器的共享文件夹链接,按站点规则确认加入或直接进入。 +- **AC-005**:文档及知识库可申请更高权限。各对象可进入关联工单,账号页可打开全部工单,从通知或工单链接可打开详情。显示服务端允许的接受、拒绝、审批、取消和催办操作,审批采用返回的角色选项及范围。 +- **AC-006**:保存、冲突、错误与取消有明确反馈。刷新适用的访问、授权、目录和工单结果;重试读取新的资源版本或权限修订后保留用户输入。 + +## Architecture and contracts + +使用 [Web 权限面板和现行授权模型](../../docs/permission-inheritance.md#shared-permission-components) 的同一组资源、文件夹、群组和工单 API。读写对象和权限范围由 [现有权限模型](../../docs/permission-inheritance.md) 及 Web 的 [工单流程](../../apps/web/src/features/tickets/tickets.tsx) 确定。更新[手机工作台说明](../../docs/document-experience.md#mobile-workspace)及[权限使用说明](../../docs/permission-inheritance.md#shared-permission-components)。 + +## Compatibility decision + +继续调用当前版本已有的 REST 接口和读写格式。手机与 Web 独立构建。已部署服务端的账号、权限及分享记录通过现行接口使用,各版本组合没有新增适配规则、读写转换或迁移。 + +## Design + +使用一个原生权限入口及可返回的操作页面。文档和知识库使用资源权限端点,共享文件夹使用自身的权限端点及角色定义。成员、来源、群组、分享及工单操作沿用已有后端验证。保存完成后使对应的 React Query 资源、文件夹和工单快照重新加载。分享和工单只解析当前服务器的现有链接格式。 + +## Tasks + +- [x] T001 统一权限入口及生效范围,接入资源政策、继承和文件夹公开(AC-001、AC-003)。 +- [x] T002 接入个人及群组邀请、成员管理、群组成员和授权来源,允许用户组管理者处理组的资源邀请(AC-002、AC-006)。 +- [x] T003 接入分享链接、文件夹确认加入和操作记录(AC-004、AC-006)。 +- [x] T004 接入权限申请、工单详情、通知及处理动作(AC-005、AC-006)。 +- [x] T005 更新使用说明并运行隔离后端及手机端验收(AC-001 至 AC-006)。 + +## Validation + +**Result**: passed + +| 验收 | 验证结果 | +| --- | --- | +| AC-001 | iOS 从文档盾牌及知识库设置进入权限页。Android 从下级共享文件夹进入共享根的权限页。知识库阅读者看到申请及工单入口,文档编辑者看到只读协作者摘要,知识库管理员可执行管理操作并受授予角色范围限制。 | +| AC-002 | Android 管理员邀请个人协作者,服务端为受邀人创建阅读权限邀请工单。iOS 查找并向知识库添加用户组,显示组成员与同组的生效授权、待接受邀请。组所有者在账号页接受知识库邀请、拒绝文件夹邀请,后端确认生效与待办状态。现有授权和群组测试覆盖个人、用户组、来源和继承。 | +| AC-003 | iOS 关闭并恢复文档继承,修改阅读者历史权限。Android 启用共享文件夹的站内公开,回到目录可看到新的可见范围。 | +| AC-004 | iOS 创建带 5 人上限、有效期和子文档范围的文档链接并复制。停用和撤销后,服务端分别返回停用状态及撤销记录。Android 创建并复制共享文件夹链接,随后通过「打开链接」以阅读者身份确认加入,服务端接受人数从 0 增至 1。链接测试覆盖接受、期限、人数、撤销及来源。 | +| AC-005 | Android 阅读者提交知识库访问申请,从文档权限审批通知打开工单。iOS 所有者从文档权限页打开工单并审批,后端确认编辑角色与子文档范围。其他工单动作由现有接口测试覆盖。 | +| AC-006 | iOS 设置页遇到资源版本冲突时提示重试,刷新他人已写入的申请设置,重试只保存原选的历史权限。两端写入后读取服务端结果核对角色、范围与状态。 | + +验证使用 Doca 0.3.10 源码及隔离 SQLite 服务端。iOS 使用 iPhone SE 模拟器和 Expo Go。Android 使用 Android 15 模拟器和本地签名的验证包。验证快照与后端结果位于 `artifacts/verification/mobile-permission-parity/`。 + +手机 TypeScript、SDD、文档检查及文档测试通过。手机链接与会话、登录码、权限与继承、访问申请、用户组、文件与共享、工单和界面语言共 136 项针对性测试通过。 + +## References + +[手机创建和知识库设置](../043-mobile-resource-creation/spec.md) · [Doca 开发流程](../../docs/sdd.md) diff --git a/specs/045-native-linux-installer/plan.md b/specs/045-native-linux-installer/plan.md new file mode 100644 index 00000000..19386b9e --- /dev/null +++ b/specs/045-native-linux-installer/plan.md @@ -0,0 +1,17 @@ +# Linux native installer plan + +**Spec**: [Linux native installer](spec.md) + +## Build and publish + +Export a native filesystem target from the same build that produces the Docker runtime. Preserve Node's module resolution, native addon binaries, application workers and all Web build files. GitHub Actions runs the build for each architecture with its native runner. Each archive has a release-specific checksum and the installer embedded with that release tag. + +## Install and run + +Require Debian 12 and a running systemd manager. Serialize installation, verify the selected GitHub release asset, and publish the complete application directory under /opt/doca. Collect site choices at the controlling terminal. Use current database and file-store configuration parsers, check dedicated PostgreSQL databases for pre-existing relations, write /etc/doca/doca.env with restricted access, and generate the credential key once. Use /var/lib/doca for local data. Validate S3 settings using the established storage JSON shape. Install the distro renderer packages and the locked Python environment. Create the initial administrator through the existing identity service and set the existing default-locale field in the same transaction under the service user. Keep service installation separate from data creation so retry can continue after setup or startup failures. + +Install doca.service with the packaged binary as its executable and the app directory as its working directory. Start it, verify the exact version on /health and enable it persistently. On an existing matching installation, use its configuration and resume the initial bootstrap only when needed. A bootstrap after an interruption recognizes an existing administrator within that same installation. Foreign installation paths and other release versions need operator review. + +## Verification + +Run the installer on an isolated Linux environment. Test fresh setup, failure before initialization, same-release retry, status and automatic start after restart. Verify the real app login, chosen language, PostgreSQL empty-database checks, S3 configuration, and artifact serving, and run rendering checks where the renderer packages are available. Keep the production release claim scoped to the tag and tested architectures. diff --git a/specs/045-native-linux-installer/spec.md b/specs/045-native-linux-installer/spec.md new file mode 100644 index 00000000..f629bc1c --- /dev/null +++ b/specs/045-native-linux-installer/spec.md @@ -0,0 +1,33 @@ +# Linux native installer + +**Level**: full +**Status**: implemented +**Created**: 2026-12-05 +**Decision**: Ship a single install command that installs and starts Doca and enables startup at boot, with a wizard for administrator credentials, site default language, database and file storage. The installer provisions operating system credentials, persistent directories and a system service, so this change affects deployment and credential boundaries. + +## Scope + +Provide a native server release for fresh Debian 12 systemd hosts on amd64 and arm64. The command selects the distribution for the current architecture, provisions the initial site administrator, starts Doca and reports the available URL once the service is healthy and enabled at boot. The wizard offers the eight current site languages, SQLite or a dedicated PostgreSQL deployment, and local disk or private S3-compatible storage. The bundle carries the Node binary and production application. The installer configures the system and Python rendering dependencies. + +The baseline is Doca 0.3.10 at tag v0.3.10. This is an additional distribution of the server. Existing-site adoption, cross-version native updates and rollback require a separate scope and agreement. + +## Acceptance + +- **AC-001**: A stable GitHub release built with this workflow supplies a version-specific installer, both Linux archives and their SHA-256 checksums. The archived Node binary, runtime modules and Web resources start together without a host Node, pnpm or Docker installation. +- **AC-002**: A first run on a supported host verifies the archive, creates a persistent configuration and key, installs the PDF and Office render dependencies and uses the existing administrator bootstrap. The administrator password is accepted through a terminal or a root-supplied file and is excluded from the site configuration and service environment. +- **AC-003**: The installed application runs under a dedicated unprivileged account and binds to loopback. The installer checks the actual release version on the local health route using the configured Host, enables the persistent systemd unit and reports the site URL. The enabled unit starts Doca after boot. +- **AC-004**: A repeat invocation of the same release uses its installed configuration, key, credentials and files. If interrupted PostgreSQL provisioning leaves a populated database without a completed local setup record, the installer reports that it needs review. Unsupported hosts, corrupt archives, incompatible arguments and occupied installation paths report failure. An unhealthy service cannot produce a successful install result. +- **AC-005**: Release and deployment documentation give the one-command entry point, supported hosts, proxy requirements and service administration commands. +- **AC-006**: Interactive setup asks for the site origin, administrator login and password, supported site language, database and storage. PostgreSQL collects connection URLs for dedicated empty databases and checks them before initializing the site. S3 collects bucket, region, addressing, optional endpoint and credentials, and validates the existing storage configuration format. The selected locale is written with first administrator creation and is available on first login. The terminal masks passwords, PostgreSQL URLs and S3 credentials. + +## Architecture and contracts + +Use the current server, database drivers, file-store parser, locale list, site setting and transactional administrator creation. Add a native distribution target to the existing image build, an installation entry point and a systemd unit. Update [deployment](../../docs/deployment.md) and [configuration](../../docs/configuration.md). See [the plan](plan.md), [tasks](tasks.md) and [validation](validation.md). + +## Compatibility decision + +This scope provisions a new native installation using the schema and credential format of the bundled host. Same-release repeats operate only on a site marked by that native installer. The existing schema reconciliation, explicit history upgrades and obsolete environment-key rejection remain current host behavior. This work creates no adoption, conversion, migration, cross-version update or persisted format decision. + +## References + +[Doca workflow](../../docs/sdd.md) · [Module index](../../docs/sdd-module-index.md) · [Repository rules](../../AGENTS.md) diff --git a/specs/045-native-linux-installer/tasks.md b/specs/045-native-linux-installer/tasks.md new file mode 100644 index 00000000..596d12d1 --- /dev/null +++ b/specs/045-native-linux-installer/tasks.md @@ -0,0 +1,9 @@ +# Linux native installer tasks + +**Spec**: [Linux native installer](spec.md) + +- [x] T001 Export and package the amd64 and arm64 Node runtime bundles and publish coordinated release assets (AC-001). +- [x] T002 Implement installation, administrator setup, persistent configuration and renderer dependencies for Debian 12 (AC-002, AC-004, AC-006). +- [x] T003 Install, run, check and enable the systemd service with the correct data ownership and local bind address (AC-003, AC-004). +- [x] T004 Document command, access, paths and service lifecycle in the current deployment contracts (AC-005). +- [x] T005 Run isolated install, repeat and failure-path checks plus SDD and documentation checks. Record results by architecture and release (AC-001, AC-002, AC-003, AC-004, AC-005, AC-006). diff --git a/specs/045-native-linux-installer/validation.md b/specs/045-native-linux-installer/validation.md new file mode 100644 index 00000000..2d9cb057 --- /dev/null +++ b/specs/045-native-linux-installer/validation.md @@ -0,0 +1,40 @@ +# Linux native installer validation + +**Spec**: [Linux native installer](spec.md) +**Result**: partial + +## Scope + +2026-12-05. Doca 0.3.10 source baseline 3c91029c with this installer change. Source checks used Node.js 24 and isolated databases. The ARM64 installer fixture packaged the cached 0.2.26 renderer candidate with the current installer bootstrap and language package. Its systemctl and renderer installation commands used test doubles. + +## Initial local acceptance results + +| Acceptance ID | Check | Result and limits | +| --- | --- | --- | +| AC-001 | Buildx native target configuration check and archive packaging on Linux ARM64 | Buildx check passed. The cached ARM64 fixture was packaged and unpacked without a preinstalled Node. The current-source ARM64 build was stopped after repeated Debian package-index download stalls. The real amd64 and arm64 release builds and upload remain pending. | +| AC-002 | Native fixture run and pseudoterminal setup with SQLite | Archive checksum rejection preceded persistent setup. The fixture started a real Doca server and stored a generated configuration. Administrator input was masked and absent from the persisted environment file. APT, Python environment installation and external renderers were replaced in the fixture. | +| AC-003 | Service installation with systemctl test double | The installer checked HTTP health and the version of a real Doca process. The unit runs as the dedicated user and the fixture observed the persistent enable command and symlink. A real systemd boot/reboot test remained pending in this run because the isolated Debian package setup could not download its package index. | +| AC-004 | Re-run and bad-input fixture runs | An invalid checksum failed before installation. The same-release run preserved the configuration and credential key. Changing the requested initial language was rejected. The activation command releases the installer lock descriptor before the service starts. | +| AC-005 | SDD, documentation, shell and workflow checks | Passed the SDD structure, repository links, Bash syntax and workflow YAML checks. | +| AC-006 | Locale bootstrap tests, pseudoterminal and isolated PostgreSQL 17/RustFS integration | The interactive ARM64 fixture set French. Current-source tests verified locale initialization and retained user settings on another bootstrap. With PostgreSQL 17 and RustFS 1.0.4, the installer configuration initialized Japanese, rejected reusing the populated database, signed in and uploaded and downloaded a file through Doca. | + +## Evidence and exclusions + +The native configuration, HTTP session and release check suites passed 21 tests. The SDD suite passed 13 tests. TypeScript check passed. Raw build, pseudoterminal, installer and PostgreSQL/RustFS outputs are under artifacts/verification/native-install. The release workflow has an archive smoke test for both architectures. Publication, renderer provisioning and automatic restart on real systemd remained pending after the local run. + +## AMD64 systemd follow-up + +On 2026-12-05, a Debian 12 AMD64 guest with systemd 252 ran on the operator's CentOS 8 host. The native test archive used the runtime of published Doca 0.3.10 with Node 22.23.5. The AMD64 manifest digest matched the published manifest and the archive added the installer bootstrap and service files from the working tree. The installer ran from that archive in a guest that had no Node, npm, pnpm or Docker executable. + +| Acceptance ID | Check | Result | +| --- | --- | --- | +| AC-001 | AMD64 test archive and SHA-256 | The installer verified the checksum and started the matching 0.3.10 runtime. The release workflow's full matrix and publication remain pending. | +| AC-002, AC-006 | Real installer in a pseudoterminal | All seven prompts completed. The password was hidden and absent from the site configuration. SQLite and local storage started with English as the site default. Admin sign-in, Web assets, WebSocket and file round trip passed. The installer provisioned WeasyPrint and LibreOffice. Both the PDF export and DOCX conversion produced PDF files with selectable Chinese. | +| AC-003 | Real systemd and guest reboot | The unit ran as the dedicated doca user and was enabled. Restarting the isolated guest brought Doca back via systemd. The same administrator and file bytes were present after reboot. | +| AC-004 | Fresh systemd preflight and repeat invocation | Real systemd returned exit 1 from the filtered unit listing when the service was absent. The installer now checks the unit's LoadState and requires not-found for that case. The same-release rerun preserved the configuration and running process. | + +The follow-up used a test archive assembled from the published runtime. Raw evidence is under `artifacts/verification/native-install/remote-49.232.14.169/evidence/`. Full ARM64 systemd installation and release publishing remain pending. + +## Contracts and compatibility + +Deployment and configuration references document the fresh native installation. This change uses the current locale, identity, database and file storage contracts. Existing site adoption and cross-release database or storage changes are outside this scope. diff --git a/tests/desktop-message-ports.test.ts b/tests/desktop-message-ports.test.ts new file mode 100644 index 00000000..77d1c2aa --- /dev/null +++ b/tests/desktop-message-ports.test.ts @@ -0,0 +1,69 @@ +import { createRequire } from "node:module"; +import { MessageChannel } from "node:worker_threads"; +import { afterEach, beforeEach, expect, test, vi } from "vitest"; + +const require = createRequire(import.meta.url); +const requireFromAntd = createRequire(require.resolve("antd")); +const requireFromSheet = createRequire(require.resolve("@smartdoca/sheet")); +type Schedule = (callback: () => void) => void; + +const formTask: Schedule = requireFromAntd("@rc-component/form/lib/hooks/useNotifyWatch").macroTask; +const overflowTask: Schedule = requireFromAntd("@rc-component/overflow/lib/hooks/channelUpdate").default; +const selectTask: (callback: () => void, turns: number) => void = + requireFromAntd("@rc-component/select/lib/hooks/useOpen").macroTask; +const sheetTask: (callback: () => void) => () => void = + requireFromSheet("@univerjs/core").requestImmediateMacroTask; + +let channels: MessageChannel[]; +let closeCalls: ReturnType[]; + +beforeEach(() => { + channels = []; + closeCalls = []; + vi.stubGlobal("MessageChannel", class extends MessageChannel { + constructor() { + super(); + channels.push(this); + closeCalls.push(vi.spyOn(this.port1, "close"), vi.spyOn(this.port2, "close")); + } + }); +}); + +afterEach(() => { + vi.unstubAllGlobals(); + for (const channel of channels) { + channel.port1.close(); + channel.port2.close(); + } +}); + +test.each([ + { name: "form notifications", schedule: formTask, turns: 1 }, + { name: "menu overflow updates", schedule: overflowTask, turns: 1 }, + { name: "select updates", schedule: (callback: () => void) => selectTask(callback, 2), turns: 2 }, + { name: "spreadsheet rendering", schedule: sheetTask, turns: 1 }, +])("releases one-shot message ports for $name", async ({ schedule, turns }) => { + let count = 0; + const completed = new Promise(resolve => { + schedule(() => { + count += 1; + resolve(); + }); + }); + expect(count).toBe(0); + await completed; + expect(count).toBe(1); + expect(channels).toHaveLength(turns); + for (const close of closeCalls) expect(close).toHaveBeenCalledTimes(1); +}); + +test("cancels spreadsheet rendering without delivering the callback", async () => { + const callback = vi.fn(); + const cancel = sheetTask(callback); + cancel(); + cancel(); + await new Promise(resolve => setImmediate(resolve)); + expect(callback).not.toHaveBeenCalled(); + expect(channels).toHaveLength(1); + for (const close of closeCalls) expect(close).toHaveBeenCalledTimes(1); +}); diff --git a/tests/mobile-document-link.test.ts b/tests/mobile-document-link.test.ts index b2ae32d2..c59d5733 100644 --- a/tests/mobile-document-link.test.ts +++ b/tests/mobile-document-link.test.ts @@ -11,6 +11,14 @@ it("opens direct and shared document links on the current Doca server", () => { expect(parseDocumentLink(`${origin}/#/s/${token}`, origin)).toEqual({ type: "share", token }); }); +it("recognizes Web folder invitations and permission tickets only on the current server", () => { + expect(parseDocumentLink(`${origin}/#/shared-files/join?token=${token}`, origin)).toEqual({ type: "folder-share", token }); + expect(parseDocumentLink(`#/tickets/${id}`, origin)).toEqual({ type: "ticket", id }); + expect(parseDocumentLink(`https://other.example/#/shared-files/join?token=${token}`, origin)).toEqual({ type: "otherServer" }); + expect(parseDocumentLink("#/shared-files/join?token=wrong", origin)).toEqual({ type: "invalid" }); + expect(parseDocumentLink("#/tickets/invalid", origin)).toEqual({ type: "invalid" }); +}); + it("rejects different hosts, schemes and ports, and unrelated routes", () => { for (const server of ["https://doca.example", "http://doca.example:8443", "https://other.example:8443", "//other.example:8443"]) expect(parseDocumentLink(`${server}/#/r/${id}`, origin)).toEqual({ type: "otherServer" }); diff --git a/tests/native-install.test.ts b/tests/native-install.test.ts new file mode 100644 index 00000000..6989759a --- /dev/null +++ b/tests/native-install.test.ts @@ -0,0 +1,94 @@ +import { execFileSync } from "node:child_process"; +import { mkdtempSync, rmSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { parseEnv } from "node:util"; +import Sqlite from "better-sqlite3"; +import { expect, it } from "vitest"; +import { parseFileStoreEnvironment } from "@server/services/file-store-config.js"; + +function setup(command: string, input: NodeJS.ProcessEnv) { + const env = Object.fromEntries( + Object.entries(process.env).filter(([key]) => !key.startsWith("DOCA_")), + ); + return execFileSync( + process.execPath, + ["--import", "tsx", "apps/server/src/bootstrap/native-install.ts", command], + { env: { ...env, ...input }, encoding: "utf8" }, + ); +} + +it("sets the site language alongside the first administrator and preserves later language choices", () => { + const directory = mkdtempSync(join(tmpdir(), "doca-native-setup-")); + try { + const path = join(directory, "doca.db"); + const env = parseEnv(setup("configure", { DOCA_SETUP_LOCALE: "fr" })); + expect(env.DOCA_CREDENTIAL_MASTER_KEY).toMatch(/^[0-9a-f]{64}$/); + const bootstrap = { + ...env, + DOCA_SQLITE_PATH: path, + DOCA_BOOTSTRAP_LOGIN: "first-admin", + DOCA_BOOTSTRAP_PASSWORD: "installation-test-password", + }; + setup("bootstrap", bootstrap); + const db = new Sqlite(path); + try { + expect( + db + .prepare("SELECT default_locale FROM settings WHERE id = 'system'") + .get(), + ).toEqual({ default_locale: "fr" }); + expect( + db.prepare("SELECT login FROM users WHERE admin = 1").all(), + ).toEqual([{ login: "first-admin" }]); + db.prepare( + "UPDATE settings SET default_locale = 'es' WHERE id = 'system'", + ).run(); + setup("bootstrap", { + ...bootstrap, + DOCA_BOOTSTRAP_LOGIN: "second-admin", + }); + expect( + db + .prepare("SELECT default_locale FROM settings WHERE id = 'system'") + .get(), + ).toEqual({ default_locale: "es" }); + expect( + db.prepare("SELECT login FROM users WHERE admin = 1").all(), + ).toEqual([{ login: "first-admin" }]); + } finally { + db.close(); + } + } finally { + rmSync(directory, { force: true, recursive: true }); + } +}); + +it("round trips S3 settings and quoted credentials in the installed environment file", () => { + const secret = "key'with\" quotes \\ and #"; + const output = setup("configure", { + DOCA_SETUP_STORAGE: "s3", + DOCA_SETUP_S3_BUCKET: "doca-install-test", + DOCA_SETUP_S3_REGION: "us-east-1", + DOCA_SETUP_S3_ENDPOINT: "http://127.0.0.1:9000", + DOCA_SETUP_S3_PATH_STYLE: "yes", + DOCA_SETUP_S3_ACCESS_KEY: "access-key", + DOCA_SETUP_S3_SECRET: secret, + DOCA_SETUP_S3_SESSION_TOKEN: "session-token", + }); + const config = parseFileStoreEnvironment(parseEnv(output)); + expect(config.currentId).toBe("s3"); + expect(config.stores.get("s3")).toEqual({ + provider: "s3", + bucket: "doca-install-test", + region: "us-east-1", + endpoint: "http://127.0.0.1:9000", + forcePathStyle: true, + credentials: { + accessKeyId: "access-key", + secretAccessKey: secret, + sessionToken: "session-token", + }, + }); + expect(output).not.toContain("DOCA_BOOTSTRAP_PASSWORD"); +});