# 脚本文档总览

当前 `scriptdoc/` 中的文档按脚本拆分：

- [setup_database.md](/www/proofdb/scriptdoc/setup_database.md): PostgreSQL 结构初始化与升级
- [setup_admin_users.md](/www/proofdb/scriptdoc/setup_admin_users.md): 管理员用户表与首个管理员账号初始化
- [setup_opensearch.md](/www/proofdb/scriptdoc/setup_opensearch.md): OpenSearch 索引初始化
- [reembed_chunks.md](/www/proofdb/scriptdoc/reembed_chunks.md): chunk 向量重新生成与断点续跑
- [reindex_opensearch.md](/www/proofdb/scriptdoc/reindex_opensearch.md): OpenSearch 重建索引与回灌

## 当前运维脚本

```text
scripts/setup_database.php
scripts/setup_admin_users.php
scripts/setup_opensearch.php
scripts/reembed_chunks.php
scripts/reindex_opensearch.php
```

## 推荐顺序

首次初始化或较完整的修复操作，通常按下面顺序执行：

```bash
php scripts/setup_database.php
php scripts/setup_opensearch.php
php scripts/reindex_opensearch.php
```

如果本地 OpenSearch 使用 HTTPS 且证书为自签名，可在相关脚本前临时加：

```bash
OPENSEARCH_SSL_VERIFY=false
```
