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

# 品牌定制

> 在 Kubernetes 部署中更改站点标题、Logo、页眉链接、页脚和维护消息。

**web** 服务根据环境变量渲染标题、Logo、页眉链接、页脚和维护页面。每项设置及其格式请参见[品牌定制](https://ayakaleaf-pro.mintlify.site/zh-CN/on-premises/configuration/overleaf-toolkit/branding.md)；在 Kubernetes 上，它们放入 ConfigMap。

| | |
| - | - |
| 服务 | web，位于每个 Ayakaleaf Pro Pod 中；在 web 启动时读取 |
| 网络 | 无：Logo 是由浏览器加载的 URL |
| 定期任务 | 无（web 每 5 秒检查一次维护文件，见下文） |

### 配置

```yaml title="30-config.yaml (additions)" wrap theme={null}
  OVERLEAF_NAV_TITLE: Our Overleaf Instance
  OVERLEAF_HEADER_IMAGE_URL: https://example.com/img/logo.png
  OVERLEAF_HEADER_EXTRAS: '[{"text":"Help","url":"https://example.com/help","class":"subdued"}]'
  OVERLEAF_LEFT_FOOTER: '[{"text":"Run by the IT department"}]'
  OVERLEAF_RIGHT_FOOTER: '[{"text":"Imprint","url":"https://example.com/imprint"}]'
  OVERLEAF_MAINTENANCE_MESSAGE: Our Overleaf Instance is down for maintenance and will be back shortly.
```

```bash theme={null}
kubectl apply -f 30-config.yaml
kubectl -n overleaf rollout restart deployment/overleaf     # or statefulset/overleaf
```

请像上面那样将 JSON 值放在单引号中，以便 YAML 将其作为一个字符串保留。`OVERLEAF_HEADER_EXTRAS` 或页脚中的无效 JSON 会被忽略，只在启动时记录到日志。

### 维护模式

当容器中的文件 `/etc/overleaf/site_status` 包含 `closed` 时，会显示维护页面。每个 Pod 都有该文件的独立副本，新建或重启的 Pod 启动时处于开放状态。要关闭站点，请在每个 Pod 中写入该文件：

```bash theme={null}
for p in $(kubectl -n overleaf get pod -l app=overleaf -o name); do   # app=overleaf-ha for several replicas
  kubectl -n overleaf exec "$p" -- sh -c 'echo closed > /etc/overleaf/site_status'
done
```

以同样的方式写入 `open` 即可结束维护。Pod 会在 5 秒内获取到该变更。

管理面板中的 **Close Editor** 工作方式不同：它只会在处理管理员请求的那个副本中关闭编辑器，并且该副本重启后会再次打开编辑器。如果有多个副本，请改用上述文件方式。

### 在 Kubernetes 上的测试

在 Kubernetes 1.37 上：在 ConfigMap 中使用上述设置后，页面显示了 `OVERLEAF_NAV_TITLE`、左侧页脚，并在登录后显示了来自 `OVERLEAF_HEADER_EXTRAS` 的链接（登录页面会隐藏页眉链接）。在一个 Pod 的 `/etc/overleaf/site_status` 中写入 `closed` 后，仅该 Pod 显示了带有 `OVERLEAF_MAINTENANCE_MESSAGE` 的维护页面，而写入 `open` 后几秒内即结束维护。使用三个副本时，管理面板的 Close Editor 只在处理管理员请求的副本上关闭了编辑器，另外两个副本保持开放。


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