> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/zh-cn/ru-men/what-is-the-overleaf-toolkit.md).

# 什么是 Ayakaleaf 工具包？

Ayakaleaf Toolkit 是 Community Edition 和 Ayakaleaf Pro 的本地部署推荐方式，它专为最常见的环境而设计：一台物理服务器或虚拟机。该 Toolkit 使用 `docker compose` 来管理服务器上的 Docker 容器，并提供一组脚本，用于封装 `docker` 命令，以协助处理在本地部署版本的 Overleaf 的更技术性的管理工作。

#### 该 `bin/docker-compose` 包装器

该 `bin/docker-compose` 脚本是围绕 `docker compose`。它会从 `config/` 目录加载配置，然后在调用 `docker compose` 时使用传递给脚本的任何参数。

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

示例：

{% code title="检查正在运行的容器" %}

```bash
$ bin/docker-compose ps
```

{% endcode %}

#### 便捷辅助脚本

除了 `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** 容器并切换到正确的数据库（**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** 容器中启动一个 shell
* `bin/upgrade`：协助实例升级。该脚本会检查 Toolkit 更新（通过 git），并提供拉取更改的选项；检查最新的 Docker 镜像版本，并提供更新选项。它提供逐步确认、备份当前配置的选项，并处理 Docker 服务的停止/启动。更多信息请参见 Upgrading your deployment：<https://docs.overleaf.com/on-premises/maintenance/upgrading-your-deployment>

{% hint style="info" %}
如果你希望运行实例时不附加到 Docker 日志，可以运行 `bin/up -d` 以分离模式运行。
{% endhint %}

#### 检查你的服务器

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

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

{% code title="运行 Overleaf Doctor" %}

```bash
bin/doctor
```

{% endcode %}

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

<details>

<summary>bin/doctor 的示例输出</summary>

```
====== Overleaf Doctor ======
- 主机信息
    - Linux
    - 'lsb_release -a' 的输出：
            没有可用的 LSB 模块。
            发行商 ID:     Ubuntu
            描述:        Ubuntu 22.04.5 LTS
            版本:    22.04
            代号:   jammy
- 依赖项
    - bash
        - 状态：已安装
        - 版本信息：5.1.16(1)-release
    - docker
        - 状态：已安装
        - 版本信息：Docker version 27.3.1, build ce12230
    - realpath
        - 状态：已安装
        - 版本信息：realpath (GNU coreutils) 8.32
    - perl
        - 状态：已安装
        - 版本信息：5.034000
    - awk
        - 状态：已安装
        - 版本信息：GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)
    - openssl
        - 状态：已安装
        - 版本信息：OpenSSL 3.0.2 2022年3月15日（库：OpenSSL 3.0.2 2022年3月15日）
    - docker compose
        - 状态：已安装
        - 版本信息：Docker Compose 版本 v2.29.7
- Docker 守护进程
    - 状态：运行中
====== 配置 ======
- config/version
    - 状态：已安装
    - 版本：5.1.1
- config/overleaf.rc
    - 状态：已安装
    - 值
        - OVERLEAF_DATA_PATH: data/overleaf
        - OVERLEAF_LOG_PATH: data/overleaf/logs
        - SERVER_PRO: true
            - 已登录 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
    - 状态：已安装
    - 值
        - OVERLEAF_FILESTORE_BACKEND: fs
        - OVERLEAF_HISTORY_BACKEND: fs
====== 警告 ======
- 无，一切正常
====== 结束 ======
```

</details>

如果有任何依赖缺失，doctor 会打印警告。如果你遇到问题，首先运行 `bin/doctor` 并检查其输出中是否有警告。

{% hint style="info" %}

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

在这两种情况下，请在你的消息中附上 `bin/doctor` 的输出。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/zh-cn/ru-men/what-is-the-overleaf-toolkit.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
