# 配置说明 所有运行时配置在 `config.yaml`(git-ignored)。完整 schema 见 `config.example.yaml`。 ## 配置项 | 段 | 关键项 | 说明 | |----|--------|------| | `server` | `host`/`port` | 绑定地址,保持 `127.0.0.1:6867`(Apache 反代) | | `database` | `host`/`port`/`user`/`password`/`database` | MySQL 连接;密码由 `setup.sh` 自动生成写回 | | `storage` | `upload_dir` | 文件存储根目录(默认 `uploads`) | | | `chunk_bytes` | 流式上传分片大小(默认 1 MiB) | | | `chunk_session_dir` | 分片会话暂存目录(默认 `uploads/.work`) | | | `chunk_session_ttl_seconds` | 被放弃会话存活秒数(默认 300) | | `docs` | `username`/`password` | `/docs`、`/api/files-page`、`/api/wb-admin`、`/api/pdf-admin` 及 `/api/admin/*` 的 Basic Auth(明文,常量时间比较) | | `sftp` | `enabled`/`host`/`port` | SFTP 服务,默认 `0.0.0.0:2022` | | | `users[].username`/`password_hash` | SFTP 用户(bcrypt) | | | `host_key_path`/`authorized_keys_path` | 主机密钥与公钥白名单路径 | | `tunnel` | `enabled`/`users[]` | 反向隧道:`username`/`password_hash`/`tunnel_port`/`local_port` | | `whiteboard` | `heartbeat_interval_seconds` | 心跳间隔(默认 3s) | | | `heartbeat_miss_threshold` | 失活阈值(默认 5 次 = 15s) | | | `max_board_id_length` | board_id 长度上限(默认 64) | | | `max_connections_per_board` | 单白板并发连接上限(默认 50) | | | `list_limit` | 管理页单次列表上限(默认 100) | ## 生成 bcrypt hash(SFTP/隧道用户密码) ```bash .venv/bin/python -c "import bcrypt;print(bcrypt.hashpw(b'yourpass',bcrypt.gensalt()).decode())" ``` 把输出填入 `config.yaml` 对应 `password_hash` 字段。 ## 重新生成 DB 密码 ```bash .venv/bin/python -m app.scripts.init_db # 重置密码(写回 config.yaml) KEEP_DB_PASSWORD=1 .venv/bin/python -m app.scripts.init_db # 保留现有密码,仅建库建账 ```