> 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-tw/kai-shi-shi-yong/what-is-the-overleaf-toolkit.md).

# 什麼是 Ayakaleaf Toolkit？

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 服務的停止／啟動。更多資訊請參閱升級您的部署：<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 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
    - docker compose
        - 狀態：存在
        - 版本資訊：Docker Compose version 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 Edition 的使用者可以在 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-tw/kai-shi-shi-yong/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.
