# 安装配置文件

安装配置文件用于生成必要的安装资产（如 Bitwarden 实例的端口、证书文件路径等），以便 Bitwarden 脚本用于安装操作。

安装配置文件位置：`./bwdata/config.yml` 。

`config.yml` 默认内容如下：

{% code title="config.yml" %}

```yaml
# 
# 注意：对该文件进行修改后，你需要运行 'rebuild' 或 'update' 命令，以使其生效。
# 
# 用于从浏览器访问安装的完整 URL。（必填）
url: https://vault.yourdomain.com
# 
# 自动生成的 './docker/docker-compose.yml' 配置文件。
# 警告：禁用已生成的配置文件会破坏未来的更新。需要您自行负责维护这个配置文件。
# 模板：https://github.com/bitwarden/server/blob/master/util/Setup/Templates/DockerCompose.hbs
generate_compose_config: true
# 
# 自动生成的 './nginx/default.conf' 配置文件。
# 警告：禁用已生成的配置文件会破坏未来的更新。需要您自行负责维护这个配置文件。
# 模板：https://github.com/bitwarden/server/blob/master/util/Setup/Templates/NginxConfig.hbs
generate_nginx_config: true
# 
# Docker 编译文件的 HTTP 端口映射。留空以移除端口映射。
# 了解更多：https://docs.docker.com/compose/compose-file/#ports
http_port: 80
# 
# Docker 编译文件的 HTTPS 端口映射。留空以移除端口映射。
# 了解更多：https://docs.docker.com/compose/compose-file/#ports
https_port: 443
# 
# Docker 编译文件的版本。留空以使用默认值。
# 了解更多：https://docs.docker.com/compose/compose-file/compose-versioning/
compose_version: 
# 
# 配置 Nginx 的 SSL。
ssl: true
# 
# Nginx 使用的 SSL 的版本（ssl_protocols）。留空以使用推荐的默认值。
# 了解更多：https://wiki.mozilla.org/Security/Server_Side_TLS
ssl_versions: 
# 
# Nginx 使用的 SSL 密码套件（ssl_ciphers）。留空以使用推荐的默认值。
# 了解更多：https://wiki.mozilla.org/Security/Server_Side_TLS
ssl_ciphersuites: 
# 
# 使用可管理的 Let's Encrypt 证书。
ssl_managed_lets_encrypt: false
# 
# 实际的证书。（如果不使用可管理的 Let's Encrypt 配置 SSL，则必填）
# 注意：路径使用容器的 ssl 目录。'./ssl' 主机目录被映射到容器内的 '/etc/ssl' 目录。
ssl_certificate_path: /etc/ssl/vault.yourdomain.com/certificate.crt
# 
# 证书私钥。（如果不使用可管理的 Let's Encrypt 配置 SSL，则必填）
# 注意：路径使用容器的 ssl 目录。'./ssl' 主机目录被映射到容器内的 '/etc/ssl' 目录。
ssl_key_path: /etc/ssl/vault.yourdomain.com/private.key
# 
# 如果该证书是由 CA 信任的，你需要提供该 CA 的证书。
# 注意：路径使用容器的 ssl 目录。'./ssl' 主机目录被映射到容器内的 '/etc/ssl' 目录。
ssl_ca_path: /etc/ssl/vault.yourdomain.com/ca.crt
# 
# Diffie Hellman ephemeral parameters
# 了解更多：https://security.stackexchange.com/q/94390/79072
# 注意：路径使用容器的 ssl 目录。'./ssl' 主机目录被映射到容器内的 '/etc/ssl' 目录。
ssl_diffie_hellman_path: 
# 
# 与 Bitwarden 推送中继服务（push.bitwarden.com）进行通信，以实现移动应用的实时同步。
push_notifications: true
# 
# 使用 docker 卷（'mssql_data'）而不是主机映射的卷来存放持久化数据库。
# 警告：改变这个值会导致您失去对现有持久化数据库的访问。
# 了解更多：https://docs.docker.com/storage/volumes/
database_docker_volume: false
# 
# 在 nginx.conf 中定义的"真实"的 IP。对于定义转发客户端 IP 地址的代理服务器很有用。
# 了解更多：https://nginx.org/en/docs/http/ngx_http_realip_module.html
real_ips: 
```

{% endcode %}

更改安装配置文件后，需要运行 **`rebuild`**（重建）命令以使更改生效：

```shell
./bitwarden.sh rebuild
```


---

# Agent Instructions: 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:

```
GET https://host.ppgg.in/bitwarden/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
