1. 安装 Vaultwarden
使用以下 docker-compose.yml
文件部署 Vaultwarden:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
version: '3.8'
services:
bitwarden:
image: vaultwarden/server:latest
container_name: vaultwarden
restart: always
environment:
- SIGNUPS_ALLOWED=true # 是否开启用户注册
- WEBSOCKET_ENABLED=true
- TZ=Asia/Shanghai
- ADMIN_TOKEN="<password>" # 管理员密码
volumes:
- ./:/data/
ports:
- "6666:80"
- "3012:3012"
|
2. 设置反向代理
使用 Nginx 设置反向代理,以下是基本的配置示例:
需要修改的参数
ssl_certificate
: SSL证书路径
ssl_certificate_key
: SSL证书路径
server_name
: 跟你前面配置的domain相同,案例中为b.lsy22.com
proxy_pass
: 运行Vaultwarden的服务器地址和端口,比如本机为127.0.0.1:6666
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name b.lsy22.com; # 将 your_domain.com 替换为您的域名
ssl_certificate /root/.acme.sh/b.lsy22.com/fullchain.cer; # 填入SSL证书路径
ssl_certificate_key /root/.acme.sh/b.lsy22.com/b.lsy22.com.key;# 填入SSL证书路径
location / {
proxy_pass http://127.0.0.1:6666;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
location /notifications/hub {
proxy_pass http://127.0.0.1:3012;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /notifications/hub/negotiate {
proxy_pass http://127.0.0.1:6666;
}
}
|
3. 创建账号
访问 Vaultwarden 的 Web 界面创建账号。
其他
翻译模板
将翻译好的模板放到templates
目录下,如果没有创建一个
模板下载链接:https://github.com/wcjxixi/vaultwarden-lang-zhcn