feat(vault): initialize fresh instances with public example notes

This commit is contained in:
eezd committed 2026-10-27 13:41:10 +08:00
1 parent 9ee7402c8e
commit 10fd6d8efb
24 files changed
+438 -14

No files matched your search

+13 -3
View File
@@ -28,16 +28,26 @@ ssh -L 21000:127.0.0.1:21000 user@your-server
The container defaults to UID/GID `65532:65532`. A new Docker named volume inherits permissions from the image's data directory.
A fresh instance with an empty vault receives seven English example notes from the public template in `deploy/data/vault/`. They are embedded in the binary, so Docker and native deployments behave the same way. You still set your own password; no account credentials or personal settings are shipped. Existing accounts and nonempty vaults are left untouched. Examples are ordinary user files: deleting them, restarting, or resetting preferences does not recreate them. Initialization state is retained in the application database, outside user preferences.
## Docker Compose
The repository includes [deploy/docker-compose.yml](../deploy/docker-compose.yml), which persists data in the host's `deploy/data/`. For a first deployment on Linux:
The repository includes [deploy/docker-compose.yml](../deploy/docker-compose.yml), which stores runtime data in an independent Docker named volume:
```sh
mkdir -p deploy/data
sudo chown 65532:65532 deploy/data
docker compose -f deploy/docker-compose.yml up -d --build --wait
```
The tracked `deploy/data/` directory is a public example template, not a runtime data directory. Do not mount it as writable application storage. To use a host directory instead, create it with UID/GID `65532:65532` and set an absolute path:
```sh
sudo install -d -o 65532 -g 65532 /your/storage/rawmark/data
RAWMARK_DATA_DIR=/your/storage/rawmark/data \
docker compose -f deploy/docker-compose.yml up -d --build --wait
```
Keep the same `RAWMARK_DATA_DIR` value for every subsequent Compose command, for example in a private file passed with `--env-file`. This Compose variable selects the host mount; it is separate from the application's `RAWMARK_DATA` variable inside the container. Existing deployments that used `deploy/data/` must explicitly select that directory until it has been migrated; omitting the override starts a separate instance in a named volume.
This configuration publishes port **21000** on all network interfaces by default. Complete initialization and configure access boundaries before exposing it publicly. With a reverse proxy, you can change the Compose port binding to `127.0.0.1:${RAWMARK_PORT:-21000}:8080`. For a custom port, use `RAWMARK_PORT=21001 docker compose -f deploy/docker-compose.yml up -d --build --wait`.
Do not point the quick-start container and a Compose instance at the same database or vault concurrently. Stop the old instance, back up, and verify data locations before switching deployment methods.
+13 -3
View File
@@ -28,16 +28,26 @@ ssh -L 21000:127.0.0.1:21000 user@your-server
容器默认以 UID/GID `65532:65532` 运行,Docker 新建命名卷会继承镜像数据目录的权限。
全新实例的空笔记库会自动生成 `deploy/data/vault/` 公开模板中的 7 篇英文示例笔记。示例嵌入二进制,Docker 与原生部署行为一致。仍需自行设置密码,不附带账号凭据或私人设置;已有账号和非空笔记库不会被添加示例。示例是普通文件,删除、重启或重置偏好设置后都不会重新生成;一次性初始化状态保存在应用数据库中,不属于用户偏好设置。
## Docker Compose
仓库提供 [deploy/docker-compose.yml](../deploy/docker-compose.yml),使用宿主机的 `deploy/data/` 持久化。Linux 上首次部署可执行:
仓库提供 [deploy/docker-compose.yml](../deploy/docker-compose.yml),默认使用独立的 Docker 命名卷保存运行数据:
```sh
mkdir -p deploy/data
sudo chown 65532:65532 deploy/data
docker compose -f deploy/docker-compose.yml up -d --build --wait
```
纳入版本控制的 `deploy/data/` 是公开示例模板,不是运行数据目录,不要将其作为可写数据目录挂载。若使用宿主机目录,先创建目录并设置 UID/GID `65532:65532`,再指定绝对路径:
```sh
sudo install -d -o 65532 -g 65532 /your/storage/rawmark/data
RAWMARK_DATA_DIR=/your/storage/rawmark/data \
docker compose -f deploy/docker-compose.yml up -d --build --wait
```
后续每次执行 Compose 命令都必须使用相同的 `RAWMARK_DATA_DIR`,例如保存在通过 `--env-file` 指定的私有文件中。该 Compose 变量选择宿主机挂载位置,与容器内应用使用的 `RAWMARK_DATA` 不同。原先使用 `deploy/data/` 的实例,在迁出前必须显式指定原目录;省略此覆盖值会在命名卷中启动另一个独立实例。
该配置默认发布到所有网卡的 **21000** 端口。对公网开放前完成初始化并设置访问边界;使用反向代理时,可将 Compose 端口绑定改为 `127.0.0.1:${RAWMARK_PORT:-21000}:8080`。自定义端口可使用 `RAWMARK_PORT=21001 docker compose -f deploy/docker-compose.yml up -d --build --wait`。
不要把快速开始中的容器与 Compose 实例同时指向同一份数据库或笔记库;切换部署方式前先停止旧实例、备份并确认数据位置。
+1 -1
View File
@@ -53,7 +53,7 @@ web/
router/ Routes and guards
pinia/ Pinia instance and shared auth, permission, settings state
types/auto/ Generated import declarations
deploy/ Container and proxy configuration
deploy/ Container/proxy configuration and embedded public example vault
scripts/ Development, resource generation, historical migrations
```
+1 -1
View File
@@ -53,7 +53,7 @@ web/
router/ 路由与守卫
pinia/ 实例及共享认证、权限、设置状态
types/auto/ 自动生成的导入声明
deploy/ 容器与代理配置
deploy/ 容器、代理配置及嵌入的公开示例笔记库
scripts/ 开发、资源生成及历史迁移脚本
```
+1 -1
View File
@@ -8,7 +8,7 @@ RawMark is a single-user workspace with notes stored on your server. Multiple br
## Start writing
Set a password on first use. Subsequent sign-ins require your password and an image captcha. Right-click the **Files** heading or empty space in the sidebar to search, create notes or folders, import documents, open the tag index, or manage images. You can also click the heading to open the menu on a touchscreen.
Set a password on first use. A new, empty instance includes seven English example notes that you can edit or delete; they do not return after deletion or restart. Existing vaults are not populated with examples. Subsequent sign-ins require your password and an image captcha. Right-click the **Files** heading or empty space in the sidebar to search, create notes or folders, import documents, open the tag index, or manage images. You can also click the heading to open the menu on a touchscreen.
The editor opens in live preview mode. Use the icons at the top right to switch to source mode, open the outline, or enter focus mode. Supported syntax includes standard Markdown, tables, task lists, code blocks, math, Mermaid, footnotes, and YAML metadata.
+1 -1
View File
@@ -8,7 +8,7 @@ RawMark 是单用户笔记工作台,笔记保存在服务器上。多个浏览
## 开始写作
首次访问设置密码,之后通过密码和图片验证码登录。在侧栏「文件目录」标题或空白处右键,可以搜索、新建笔记、新建目录、导入文档、打开标签索引或管理图片;点击标题同样可以打开菜单,便于触屏使用。
首次访问设置密码。全新空实例带有 7 篇英文示例笔记,可以编辑或删除;删除或重启后不会再次生成,已有笔记库不会添加示例。之后通过密码和图片验证码登录。在侧栏「文件目录」标题或空白处右键,可以搜索、新建笔记、新建目录、导入文档、打开标签索引或管理图片;点击标题同样可以打开菜单,便于触屏使用。
编辑器默认使用即时预览,点击右上角图标切换源码模式、打开大纲或进入专注写作。支持标准 Markdown、表格、任务列表、代码块、数学公式、Mermaid、脚注和 YAML 元数据。