> ## 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 是 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` 程式的透明包裝。

範例：

```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.