环境配置文件

环境配置文件用于在 Bitwarden 部署完成以后增减某些功能,如配置 SMTP、启用 Yubico、启用系统管理员门户、禁用用户注册等。

环境配置文件位置:./bwdata/env/global.override.env

其默认内容如下:

global.override.env
globalSettings__baseServiceUri__vault=https://vault.yourdomain.com
globalSettings__baseServiceUri__api=https://vault.yourdomain.com/api
globalSettings__baseServiceUri__identity=https://vault.yourdomain.com/identity
globalSettings__baseServiceUri__admin=https://vault.yourdomain.com/admin
globalSettings__baseServiceUri__notifications=https://vault.yourdomain.com/notifications
globalSettings__baseServiceUri__sso=https://vault.yourdomain.com/sso
globalSettings__baseServiceUri__portal=https://vault.yourdomain.com/portal
globalSettings__sqlServer__connectionString="Data Source=tcp:mssql,1433;Initial Catalog=vault;Persist Security Info=False;User ID=sa;Password=xGKRrfeggznz5SEAFKAqYPmMNCujUNdK;MultipleActiveResultSets=False;Connect Timeout=30;Encrypt=True;TrustServerCertificate=True"
globalSettings__identityServer__certificatePassword=UYS4X3urhIikdexM58pNYJ6o535gOxg4
globalSettings__attachment__baseDirectory=/etc/bitwarden/core/attachments
globalSettings__attachment__baseUrl=https://vault.yourdomain.com/attachments
globalSettings__dataProtection__directory=/etc/bitwarden/core/aspnet-dataprotection
globalSettings__logDirectory=/etc/bitwarden/logs
globalSettings__logRollBySizeLimit=
globalSettings__syslog__destination=
globalSettings__licenseDirectory=/etc/bitwarden/core/licenses
globalSettings__internalIdentityKey=jpGTst16CGZL2BTjvzL5erR2XRTqsWrhBysa4tTomf6KtVXr8TF0hcxuACxVUpt5
globalSettings__oidcIdentityClientKey=nZu60QKCaOrpPjF9jxrOHnd07d1RrWXrHp5sxv8C7CL9IBu9w9bhI5s03E8qeyiX
globalSettings__duo__aKey=KeW4TH9jYSfmdWGd0c0nROS3TXJHIMdRzNZrw7bHqw0svhE6ePL9jWBiwRRHNc1w
globalSettings__installation__id=0e39beb9-5efe-4ebb-919d-ac3e00d7b1c1
globalSettings__installation__key=QNruWGv7N0n5UY18f4ay
globalSettings__yubico__clientId=REPLACE
globalSettings__yubico__key=REPLACE
globalSettings__mail__replyToEmail=no-reply@vault.yourdomain.com
globalSettings__mail__smtp__host=REPLACE
globalSettings__mail__smtp__port=587
globalSettings__mail__smtp__ssl=false
globalSettings__mail__smtp__username=REPLACE
globalSettings__mail__smtp__password=REPLACE
globalSettings__disableUserRegistration=false
globalSettings__hibpApiKey=REPLACE
adminSettings__admins=

由于环境配置文件只有在 Bitwarden 容器启动时才会被读取,因此,更改环境配置文件后,需要运行 restart(重启)命令以使更改生效:

./bitwarden.sh restart

注意环境配置文件中值为 https://vault.yourdomain.com 的所有变量,需要全部修改其值为实际的外部访问地址(包括端口),否则当有链接跳转时,会导致错误,例如验证电子邮件的跳转链接、管理员门户的跳转链接。假设外部访问地址为 https://vault.yourdomain.com:28443,则环境配置文件中值为 https://vault.yourdomain.com 的所有变量的值都要替换为 https://vault.yourdomain.com:28443

已有变量

以下变量在 global.override.env 中已经存在:

可选变量

以下变量在 global.override.env 中尚不存在,但可以手动添加:

最后更新于