> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 什么是 Ayakaleaf Toolkit？

Ayakaleaf Toolkit 是社区版和 Ayakaleaf Pro 本地部署的推荐部署方式，专为最常见的环境而设计：单台物理服务器或虚拟机。Toolkit 使用 `docker compose` 管理服务器上的 Docker 容器，并提供一组封装了 `docker` 命令的脚本，帮助你处理管理本地版 Overleaf 时较为技术性的工作。

#### `bin/docker-compose` 封装脚本

`bin/docker-compose` 脚本是对 `docker compose` 的封装。它会先从 `config/` 目录加载配置，然后使用传递给脚本的任意参数调用 `docker compose`。

你可以将 `bin/docker-compose` 视为机器上已安装的 `docker compose` 程序的透明封装。

示例：

```bash title="Check running containers" theme={null}
$ bin/docker-compose ps
```

#### 便捷辅助脚本

除了 `bin/docker-compose`，Toolkit 还提供了一些便捷脚本来协助完成常见任务：

* `bin/up`：`bin/docker-compose up` 的快捷方式
* `bin/start`：`bin/docker-compose start` 的快捷方式
* `bin/stop`：`bin/docker-compose stop` 的快捷方式
* `bin/shell`：在 **sharelatex** 容器内启动一个 shell
* `bin/doctor`：用于收集安装和部署信息的脚本。请参阅下文的"检查你的服务器"部分
* `bin/mongo`：在 **mongo** 容器内启动一个 shell，并切换到正确的数据库（**sharelatex**）
* `bin/backup-config`：创建当前配置的副本（zip 或 tar），并将其存储到你选择的目标目录中
* `bin/logs`：查看/跟踪服务日志
* `bin/error-logs`：查看/跟踪服务错误日志
* `bin/rename-env-vars-5-0`：用于更新 **config/variables.env** 中环境变量的迁移脚本（从 ShareLaTeX 更名为 Overleaf）
* `bin/rename-rc-vars`：用于更新 **config/overleaf.rc** 中环境变量的迁移脚本（从 ShareLaTeX 更名为 Overleaf）
* `bin/run-script`：简化运行 **sharelatex** 容器内所存储脚本的辅助工具
* `bin/upgrade`：协助进行实例升级。该脚本会（通过 git）检查 Toolkit 更新并提示拉取更改，检查最新的 Docker 镜像版本并提示更新。它提供分步确认、备份当前配置的选项，并负责停止/启动 Docker 服务。更多信息请参阅升级部署：[https://docs.overleaf.com/on-premises/maintenance/upgrading-your-deployment](https://docs.overleaf.com/on-premises/maintenance/upgrading-your-deployment)

<Info>
  如果你希望运行实例时不附加到 Docker 日志，可以运行 `bin/up -d` 以分离模式运行。
</Info>

#### 检查你的服务器

Overleaf Toolkit 包含一个名为 `bin/doctor` 的实用脚本，它会生成一份报告，指出任何未满足的依赖项。

在继续之前，请运行 `bin/doctor` 脚本并检查一切是否正常：

```bash title="Run Overleaf Doctor" theme={null}
bin/doctor
```

示例输出（已截断/仅供示意）：

<Accordion title="bin/doctor 的示例输出">
  ```text theme={null}
  ====== Overleaf Doctor ======
  - Host Information
      - Linux
      - Output of 'lsb_release -a':
              No LSB modules are available.
              Distributor ID:     Ubuntu
              Description:        Ubuntu 22.04.5 LTS
              Release:    22.04
              Codename:   jammy
  - Dependencies
      - bash
          - status: present
          - version info: 5.1.16(1)-release
      - docker
          - status: present
          - version info: Docker version 27.3.1, build ce12230
      - realpath
          - status: present
          - version info: realpath (GNU coreutils) 8.32
      - perl
          - status: present
          - version info: 5.034000
      - awk
          - status: present
          - version info: GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)
      - openssl
          - status: present
          - version info: OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
      - docker compose
          - status: present
          - version info: Docker Compose version v2.29.7
  - Docker Daemon
      - status: up
  ====== Configuration ======
  - config/version
      - status: present
      - version: 5.1.1
  - config/overleaf.rc
      - status: present
      - values
          - OVERLEAF_DATA_PATH: data/overleaf
          - OVERLEAF_LOG_PATH: data/overleaf/logs
          - SERVER_PRO: true
              - logged in to quay.io: true
          - SIBLING_CONTAINERS_ENABLED: true
          - OVERLEAF_LISTEN_IP: 0.0.0.0
          - OVERLEAF_PORT: 80
          - MONGO_ENABLED: true
          - MONGO_IMAGE: mongo
          - MONGO_VERSION: 6.0
          - MONGO_DATA_PATH: data/mongo
          - REDIS_ENABLED: true
          - REDIS_IMAGE: redis:6.2
          - REDIS_DATA_PATH: data/redis
  - config/variables.env
      - status: present
      - values
          - OVERLEAF_FILESTORE_BACKEND: fs
          - OVERLEAF_HISTORY_BACKEND: fs
  ====== Warnings ======
  - None, all good
  ====== End ======
  ```
</Accordion>

如果缺少任何依赖项，doctor 会打印警告。如果遇到问题，请先运行 `bin/doctor` 并检查其输出中的警告。

<Info>
  * Ayakaleaf Pro 版本的用户可以在 GitHub 上提交 issue：[https://github.com/ayaka-notes/toolkit/issues](https://github.com/ayaka-notes/toolkit/issues)

  无论哪种情况，请在你的消息中附上 `bin/doctor` 的输出。
</Info>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.