From f3aa95f360bbff6cf6d69dc51ba6ecb4baa2d43d Mon Sep 17 00:00:00 2001 From: Zakk Date: Thu, 24 Sep 2026 10:25:14 +1000 Subject: [PATCH] docs(readme): lead with password sign-in Show administrator setup as the first-run path and keep token pairing for automation. Clarify where password sessions and backend tokens are stored. --- README.md | 8 +++++--- README.zh-CN.md | 8 +++++--- README.zh-TW.md | 8 +++++--- docs/guide.md | 20 +++++++++++--------- docs/guide.zh-CN.md | 20 +++++++++++--------- docs/guide.zh-TW.md | 20 +++++++++++--------- 6 files changed, 48 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index ed4acd40..e6db631f 100644 --- a/README.md +++ b/README.md @@ -64,17 +64,19 @@ experimental { native_api { enabled: true listen: '127.0.0.1:9527' - secret: 'operator-supplied-random-token' + password_auth: true ui: '/usr/share/doona' } } ``` -Keep this block in its own include (`include { api.dae }`) so the main file stays editable from the configuration page. Requirements, serving from another web server or a reverse proxy, and the distribution packages are in the [guide](docs/guide.md#install). +Keep this block in its own include (`include { api.dae }`) so the main file stays editable from the configuration page. For scripts and automation, use `secret: ''` instead of `password_auth: true`. Requirements, serving from another web server or a reverse proxy, and the distribution packages are in the [guide](docs/guide.md#install). ## First run -Open `/ui/` on the engine host. On a first visit doona asks the origin it was served from for `/api`; when the engine answers it becomes the saved backend and a token prompt follows. Served from elsewhere, or to reach another engine, open Settings and enter the server root and the token; a pairing link such as `/ui/#/settings?api=http://router:9527&token=…` fills the form and drops the token from the address bar on load. +Open `/ui/` on the engine host. On a first visit doona asks the origin it was served from for `/api` and saves the engine as a backend. In password mode, the locked sign-in dialog offers first-time setup to create the administrator; complete setup from a loopback or private-network client, then sign in with the username and password. Served from elsewhere, or to reach another engine, open Settings and enter the server root. + +In token mode, doona asks for the token. Enter it in Settings with the server root, or use a pairing link such as `/ui/#/settings?api=http://router:9527&token=…` to fill the form; doona removes the token from the address bar on load. The activity page then shows the running engine. Add a subscription or paste share links on Nodes, pick or pin members on Policies, add rules on Rules, and edit, validate and reload the sources on Configuration. Every write goes through the engine with the hash doona read the source at, and a failed reload keeps the previous generation active. The [guide](docs/guide.md#first-run) walks through each page. diff --git a/README.zh-CN.md b/README.zh-CN.md index 600c107b..e6fb64dc 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -64,17 +64,19 @@ experimental { native_api { enabled: true listen: '127.0.0.1:9527' - secret: 'operator-supplied-random-token' + password_auth: true ui: '/usr/share/doona' } } ``` -这个块请放在独立的 include(`include { api.dae }`),主文件才能在配置页编辑。运行环境、由其他 Web 服务器或反向代理提供、发行版软件包,见[使用指南](docs/guide.zh-CN.md#安装)。 +这个块请放在独立的 include(`include { api.dae }`),主文件才能在配置页编辑。供脚本和自动化程序使用时,以 `secret: ''` 代替 `password_auth: true`。运行环境、由其他 Web 服务器或反向代理提供、发行版软件包,见[使用指南](docs/guide.zh-CN.md#安装)。 ## 首次使用 -在引擎主机上打开 `/ui/`。首次访问时,doona 向提供页面的来源请求 `/api`;引擎响应后就成为已保存的后端,接着提示输入 token。若页面来自别处,或要连接另一台引擎,打开设置页填写服务器根地址与 token;配对链接(`/ui/#/settings?api=http://router:9527&token=…`)可以代填表单,加载后 token 会从地址栏移除。 +在引擎主机上打开 `/ui/`。首次访问时,doona 向提供页面的来源请求 `/api`,并将引擎保存为后端。密码模式下,锁定的登录对话框提供首次设置入口,用于创建管理员;请从本机或私有网络客户端完成设置,然后使用用户名和密码登录。若页面来自别处,或要连接另一台引擎,打开设置页填写服务器根地址。 + +token 模式下,doona 会提示输入 token。可在设置页填写服务器根地址和 token,或使用配对链接(`/ui/#/settings?api=http://router:9527&token=…`)代填表单;加载后,doona 会从地址栏移除 token。 接着活动页显示运行中的引擎。在节点页新增订阅或粘贴分享链接,在策略页选择或固定群组成员,在规则页加规则,在配置页编辑、校验并重载来源。每次写入都带着读取时的哈希经过引擎;重载失败时仍沿用先前的世代。各页面的用法见[使用指南](docs/guide.zh-CN.md#首次使用)。 diff --git a/README.zh-TW.md b/README.zh-TW.md index 10cc5cd2..3a047a47 100644 --- a/README.zh-TW.md +++ b/README.zh-TW.md @@ -64,17 +64,19 @@ experimental { native_api { enabled: true listen: '127.0.0.1:9527' - secret: 'operator-supplied-random-token' + password_auth: true ui: '/usr/share/doona' } } ``` -這個區塊請放在獨立的 include(`include { api.dae }`),主檔才能在組態頁編輯。執行環境、由其他 Web 伺服器或反向代理提供、發行版套件,見[使用指南](docs/guide.zh-TW.md#安裝)。 +這個區塊請放在獨立的 include(`include { api.dae }`),主檔才能在組態頁編輯。供指令碼和自動化程式使用時,以 `secret: ''` 取代 `password_auth: true`。執行環境、由其他 Web 伺服器或反向代理提供、發行版套件,見[使用指南](docs/guide.zh-TW.md#安裝)。 ## 第一次使用 -在引擎主機上開 `/ui/`。第一次造訪時,doona 向提供頁面的來源請求 `/api`;引擎回應後就成為已儲存的後端,接著提示輸入 token。若頁面來自別處,或要連另一台引擎,開設定頁填伺服器根位址與 token;配對連結(`/ui/#/settings?api=http://router:9527&token=…`)可以代填表單,載入後 token 會從網址列移除。 +在引擎主機上開 `/ui/`。第一次造訪時,doona 向提供頁面的來源請求 `/api`,並將引擎儲存為後端。密碼模式下,鎖定的登入對話方塊提供首次設定入口,用於建立管理員;請從本機或私人網路用戶端完成設定,再以使用者名稱和密碼登入。若頁面來自別處,或要連另一台引擎,開設定頁填伺服器根位址。 + +token 模式下,doona 會提示輸入 token。可在設定頁填入伺服器根位址和 token,或使用配對連結(`/ui/#/settings?api=http://router:9527&token=…`)代填表單;載入後,doona 會從網址列移除 token。 接著活動頁顯示執行中的引擎。在節點頁新增訂閱或貼入分享連結,在策略頁選擇或固定群組成員,在規則頁加規則,在組態頁編輯、校驗並重載來源。每次寫入都帶著讀取時的雜湊經過引擎;重載失敗時仍沿用先前的世代。各頁面的用法見[使用指南](docs/guide.zh-TW.md#第一次使用)。 diff --git a/docs/guide.md b/docs/guide.md index b35e74a3..a245daad 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -34,7 +34,9 @@ None published yet. Each release carries `deb`, `rpm`, `ipk` and Arch packages b ## First run -Open `/ui/` on the engine host. On a first visit doona asks the origin it was served from for `/api`; when the engine answers it becomes the saved backend and a token prompt follows. Served from elsewhere, or to reach another engine, open Settings and enter the server root (`http://router:9527`, without `/api/v1`) and the token; Test Connection checks discovery before saving, and saving reloads the page. A pairing link fills the form for you: `/ui/#/settings?api=http://router:9527&token=…`, and the token leaves the address bar on load. +Open `/ui/` on the engine host. On a first visit doona asks the origin it was served from for `/api` and saves the engine as a backend. In password mode, the locked sign-in dialog offers first-time setup to create the administrator; complete setup from a loopback or private-network client, then sign in with the username and password. Served from elsewhere, or to reach another engine, open Settings and enter the server root (`http://router:9527`, without `/api/v1`); Test Connection checks discovery before saving, and saving reloads the page. + +In token mode, doona asks for the token. Enter it in Settings with the server root, or use a pairing link to fill the form: `/ui/#/settings?api=http://router:9527&token=…`. Doona removes the token from the address bar on load. The activity page then shows the running engine. The usual route through the rest: @@ -71,14 +73,14 @@ Every page remains in navigation. A page is marked unavailable only when every r doona has no server-side store for its own UI settings. Configuration and runtime changes are written through the engine; doona's UI settings live in the browser's `localStorage` for the site's origin: -| Setting | Key | Values | -| ------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Backends | `doona-profiles` | JSON list of `{id, name, api, token}`; `api` is a server root or proxy prefix, empty or `mock` for demo data; API requests send the token in the `Authorization` header. Pairing links may carry it in the URL fragment and remove it on load. | -| Active one | `doona-profile` | `id` of the selected backend | -| Language | `doona-lang` | `zh-TW` (default), `zh-CN`, `en` | -| Colour scheme | `doona-scheme` | `system` (default), `light`, `dark` | -| Palette | `doona-palette` | `rose-pine/moon` (default); the other ids are the `PaletteId` union in [preferences.ts](../src/shell/preferences.ts) | -| Wordmark | `doona-wordmark` | `gradient` (default), `plain` | +| Setting | Key | Values | +| ------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Backends | `doona-profiles` | JSON list of `{id, name, api, token}`; `api` is a server root or proxy prefix, empty or `mock` for demo data. For password backends, `token` is empty and honk manages the session; doona keeps its session token in this tab's `sessionStorage`. In token mode, API requests send the token in the `Authorization` header. Pairing links may carry it in the URL fragment and remove it on load. | +| Active one | `doona-profile` | `id` of the selected backend | +| Language | `doona-lang` | `zh-TW` (default), `zh-CN`, `en` | +| Colour scheme | `doona-scheme` | `system` (default), `light`, `dark` | +| Palette | `doona-palette` | `rose-pine/moon` (default); the other ids are the `PaletteId` union in [preferences.ts](../src/shell/preferences.ts) | +| Wordmark | `doona-wordmark` | `gradient` (default), `plain` | The saved theme and language are applied before the first paint, so a reload does not flash the default look. diff --git a/docs/guide.zh-CN.md b/docs/guide.zh-CN.md index a204f22c..f50b1be0 100644 --- a/docs/guide.zh-CN.md +++ b/docs/guide.zh-CN.md @@ -36,7 +36,9 @@ ## 首次使用 -在引擎主机上打开 `/ui/`。首次访问时,doona 向提供页面的来源请求 `/api`;引擎响应后就成为已保存的后端,接着提示输入 token。若页面来自别处,或要连接另一台引擎,打开设置页填写服务器根地址(`http://router:9527`,不含 `/api/v1`)与 token;「测试连接」在保存前先检查发现端点,保存后重新加载页面。配对链接可以代填表单:`/ui/#/settings?api=http://router:9527&token=…`,加载后 token 会从地址栏移除。 +在引擎主机上打开 `/ui/`。首次访问时,doona 向提供页面的来源请求 `/api`,并将引擎保存为后端。密码模式下,锁定的登录对话框提供首次设置入口,用于创建管理员;请从本机或私有网络客户端完成设置,然后使用用户名和密码登录。若页面来自别处,或要连接另一台引擎,打开设置页填写服务器根地址(`http://router:9527`,不含 `/api/v1`);「测试连接」在保存前先检查发现端点,保存后重新加载页面。 + +token 模式下,doona 会提示输入 token。可在设置页填写服务器根地址和 token,或使用配对链接代填表单:`/ui/#/settings?api=http://router:9527&token=…`。加载后,doona 会从地址栏移除 token。 接着活动页显示运行中的引擎。其余页面的常见顺序: @@ -69,14 +71,14 @@ doona 没有用于存储自身界面设置的服务器端存储。配置与运行时变更通过引擎写入;doona 的界面设置存储在浏览器中,范围限于该网站来源的 `localStorage`: -| 设置 | 键 | 值 | -| -------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 后端 | `doona-profiles` | `{id, name, api, token}` 的 JSON 数组;`api` 是服务器根地址或代理前缀,留空或 `mock` 使用演示数据;API 请求通过 `Authorization` 头发送 token。配对链接可能把 token 放在网址片段中,并在加载后移除。 | -| 使用中的 | `doona-profile` | 所选后端的 `id` | -| 语言 | `doona-lang` | `zh-TW`(默认)、`zh-CN`、`en` | -| 配色方案 | `doona-scheme` | `system`(默认)、`light`、`dark` | -| 配色 | `doona-palette` | `rose-pine/moon`(默认);其他值见 [preferences.ts](../src/shell/preferences.ts) 的 `PaletteId` | -| 字标 | `doona-wordmark` | `gradient`(默认)、`plain` | +| 设置 | 键 | 值 | +| -------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 后端 | `doona-profiles` | `{id, name, api, token}` 的 JSON 数组;`api` 是服务器根地址或代理前缀,留空或 `mock` 使用演示数据。密码模式下,`token` 为空,honk 管理会话,doona 将会话 token 保存在当前标签页的 `sessionStorage` 中。token 模式下,API 请求通过 `Authorization` 头发送 token。配对链接可能把 token 放在网址片段中,并在加载后移除。 | +| 使用中的 | `doona-profile` | 所选后端的 `id` | +| 语言 | `doona-lang` | `zh-TW`(默认)、`zh-CN`、`en` | +| 配色方案 | `doona-scheme` | `system`(默认)、`light`、`dark` | +| 配色 | `doona-palette` | `rose-pine/moon`(默认);其他值见 [preferences.ts](../src/shell/preferences.ts) 的 `PaletteId` | +| 字标 | `doona-wordmark` | `gradient`(默认)、`plain` | 保存的主题与语言在第一帧之前就应用,重新加载不会闪出默认外观。 diff --git a/docs/guide.zh-TW.md b/docs/guide.zh-TW.md index 57ee4ddd..55887f97 100644 --- a/docs/guide.zh-TW.md +++ b/docs/guide.zh-TW.md @@ -36,7 +36,9 @@ ## 第一次使用 -在引擎主機上開 `/ui/`。第一次造訪時,doona 向提供頁面的來源請求 `/api`;引擎回應後就成為已儲存的後端,接著提示輸入 token。若頁面來自別處,或要連另一台引擎,開設定頁填伺服器根位址(`http://router:9527`,不含 `/api/v1`)與 token;「測試連線」在儲存前先檢查探索端點,儲存後重新載入頁面。配對連結可以代填表單:`/ui/#/settings?api=http://router:9527&token=…`,載入後 token 會從網址列移除。 +在引擎主機上開 `/ui/`。第一次造訪時,doona 向提供頁面的來源請求 `/api`,並將引擎儲存為後端。密碼模式下,鎖定的登入對話方塊提供首次設定入口,用於建立管理員;請從本機或私人網路用戶端完成設定,再以使用者名稱和密碼登入。若頁面來自別處,或要連另一台引擎,開設定頁填伺服器根位址(`http://router:9527`,不含 `/api/v1`);「測試連線」在儲存前先檢查探索端點,儲存後重新載入頁面。 + +token 模式下,doona 會提示輸入 token。可在設定頁填入伺服器根位址和 token,或使用配對連結代填表單:`/ui/#/settings?api=http://router:9527&token=…`。載入後,doona 會從網址列移除 token。 接著活動頁顯示執行中的引擎。其餘頁面的常見順序: @@ -69,14 +71,14 @@ doona 沒有供自身介面設定使用的伺服器端儲存空間。組態與執行期變更透過引擎寫入;doona 的介面設定儲存在瀏覽器中,範圍限於該網站來源的 `localStorage`: -| 設定 | 鍵 | 值 | -| -------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 後端 | `doona-profiles` | `{id, name, api, token}` 的 JSON 陣列;`api` 是伺服器根位址或代理前綴,留空或 `mock` 使用示範資料;API 請求透過 `Authorization` 標頭傳送 token。配對連結可能把 token 放在網址片段中,並在載入後移除。 | -| 使用中的 | `doona-profile` | 所選後端的 `id` | -| 語言 | `doona-lang` | `zh-TW`(預設)、`zh-CN`、`en` | -| 配色方案 | `doona-scheme` | `system`(預設)、`light`、`dark` | -| 配色 | `doona-palette` | `rose-pine/moon`(預設);其他值見 [preferences.ts](../src/shell/preferences.ts) 的 `PaletteId` | -| 字標 | `doona-wordmark` | `gradient`(預設)、`plain` | +| 設定 | 鍵 | 值 | +| -------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 後端 | `doona-profiles` | `{id, name, api, token}` 的 JSON 陣列;`api` 是伺服器根位址或代理前綴,留空或 `mock` 使用示範資料。密碼模式下,`token` 為空,honk 管理工作階段,doona 將工作階段 token 儲存在目前分頁的 `sessionStorage`。token 模式下,API 請求透過 `Authorization` 標頭傳送 token。配對連結可能把 token 放在網址片段中,並在載入後移除。 | +| 使用中的 | `doona-profile` | 所選後端的 `id` | +| 語言 | `doona-lang` | `zh-TW`(預設)、`zh-CN`、`en` | +| 配色方案 | `doona-scheme` | `system`(預設)、`light`、`dark` | +| 配色 | `doona-palette` | `rose-pine/moon`(預設);其他值見 [preferences.ts](../src/shell/preferences.ts) 的 `PaletteId` | +| 字標 | `doona-wordmark` | `gradient`(預設)、`plain` | 儲存的主題與語言在第一幀之前就套用,重新載入不會閃出預設外觀。