Bitwarden 是一个类似 1Password
和 LastPass
的开源密码管理软件,Bitwarden RS 是基于 Rust 语言的一个实现,更轻量一些,可能效率也会更高一点点,并且是完全兼容官方 App 的,比如各种浏览器扩展,手机 App 等。[ 摘抄 ]
不想折腾可以直接官网注册使用即可,网速有点慢
Docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker $USER
{
// 镜像加速
"registry-mirrors": [
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
],
// dns 保证网络安全
"dns": [
"8.8.8.8",
114.114.114.114,
255.5.5.5,
255.6.6.6
],
// 日志文件大小
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3",
"labels": "production_status",
"env": "os,customer"
}
}
# 下面这段长长的字符就是上面的内容编码后的内容,执行下面这个命令即可
echo 'ewogIC8vIOmVnOWDj+WKoOmAnwogICJyZWdpc3RyeS1taXJyb3JzIjogWwogICAgImh0dHBzOi8vaHViLW1pcnJvci5jLjE2My5jb20iLAogICAgImh0dHBzOi8vbWlycm9yLmJhaWR1YmNlLmNvbSIKICBdLAogIC8vIGRucyDkv53or4HnvZHnu5zlronlhagKICAiZG5zIjogWwogICAgIjguOC44LjgiLAogICAgMTE0LjExNC4xMTQuMTE0LAogICAgMjU1LjUuNS41LAogICAgMjU1LjYuNi42CiAgXSwKICAvLyDml6Xlv5fmlofku7blpKflsI8KICAibG9nLWRyaXZlciI6ICJqc29uLWZpbGUiLAogICJsb2ctb3B0cyI6IHsKICAgICJtYXgtc2l6ZSI6ICIxMG0iLAogICAgIm1heC1maWxlIjogIjMiLAogICAgImxhYmVscyI6ICJwcm9kdWN0aW9uX3N0YXR1cyIsCiAgICAiZW52IjogIm9zLGN1c3RvbWVyIgogIH0KfQ==' | base64 -d > /etc/docker/daemon.json
具体步骤请查阅这两篇文章
mkdir -p bitwarden/data bitwarden/ssl
# 将申请的证书 的 crt 和 key 传输到 bitwarden/ssl 目录里面,并重命名为 docker.crt docker.key
docker run -it --rm \
--name bitwarden \
-e ROCKET_PORT=25003 \
-e ADMIN_TOKEN=123456 \
-e TZ=Asia/Shanghai \
-e "ROCKET_TLS={certs=\"/ssl/docker.crt\",key=\"/ssl/docker.key\"}" \
-p 25003:25003 \
-v $(pwd)/bitwarden/data:/data \
-v $(pwd)/bitwarden/ssl:/ssl \
-v /etc/localtime:/etc/localtime \
vaultwarden/server:latest
使用浏览器访问 http://[服务器 IP]:25003
最好配置一下邮箱服务端,qq邮箱可以参考这篇文章,两步推荐也最好弄一下,避免账号登录不上去
下载浏览器插件和软件
网速不好可以 百度问题原因
以上的都配置完毕后,开始配置安全选项
docker stop bitwarden
docker run -it -d \
--name bitwarden \
--restart=always \
-e ROCKET_ENV=staging \
-e ROCKET_PORT=25003 \
-e ROCKET_WORKERS=10 \
-e WEBSOCKET_ENABLED=true \
-e WEBSOCKET_PORT=25005 \
-e WEB_VAULT_ENABLED=false \
-e LOG_FILE=/data/vaultwarden.log \
-e "ROCKET_TLS={certs=\"/ssl/docker.crt\",key=\"/ssl/docker.key\"}" \
-e TZ=Asia/Shanghai \
-p 25003:25003 \
-p 25005:25005 \
-v $(pwd)/bitwarden/data:/data \
-v $(pwd)/bitwarden/ssl:/ssl \
-v /etc/localtime:/etc/localtime \
vaultwarden/server:latest
{
"domain": "https://10.0.4.6:25003", // https://[服务器 IP]:25003
"sends_allowed": true,
"WEBSOCKET_ENABLED": true, // 启用 WEBSOCKET 消息通知
"WEBSOCKET_PORT": 25005,
"disable_icon_download": false,
"WEB_VAULT_ENABLED": false, // 禁用网页访问
"signups_allowed": false, // 禁止用户注册
"signups_verify": true, // 注册验证
"signups_verify_resend_time": 3600,
"signups_verify_resend_limit": 6,
"invitations_allowed": false,
"password_iterations": 100000,
"show_password_hint": false,
"admin_token": "123456", // 管理员密码
"ip_header": "X-Real-IP",
"icon_cache_ttl": 2592000,
"icon_cache_negttl": 259200,
"icon_download_timeout": 15,
"icon_blacklist_non_global_ips": true,
"disable_2fa_remember": true,
"authenticator_disable_time_drift": true,
"require_device_email": true,
"reload_templates": false,
"log_timestamp_format": "%Y-%m-%d %H:%M:%S.%3f",
"disable_admin_token": false, // 禁用管理员密码
"_enable_yubico": false,
"_enable_duo": false,
"_enable_smtp": true, // 启用邮箱验证
"smtp_host": "smtp.qq.com", // 邮箱服务器地址
"smtp_ssl": true, // 启用ssl验证
"smtp_explicit_tls": true,
"smtp_port": 465, // 邮箱端口号
"smtp_from": "xrsec@qq.com", // 你的邮箱账号
"smtp_from_name": "XRSec", // 发送人的名称
"smtp_username": "xrsec@qq.com", // 你的邮箱账号
"smtp_password": "123456", //你的邮箱密码
"smtp_timeout": 15,
"smtp_accept_invalid_certs": false,
"smtp_accept_invalid_hostnames": false,
"_enable_email_2fa": true, // 启用邮箱二次验证
"email_token_size": 6,
"email_expiration_time": 600,
"email_attempts_limit": 3
}
请将上面的内容修改并保存到 当前目录/bitwarden/data/config.json
全部的配置文件
与官方托管对比
优势:
劣势:
个人总结:
XRSec has the right to modify and interpret this article. If you want to reprint or disseminate this article, you must ensure the integrity of this article, including all contents such as copyright notice. Without the permission of the author, the content of this article shall not be modified or increased or decreased arbitrarily, and it shall not be used for commercial purposes in any way