由于以前搭建的主密码忘记了手机端可以使用而电脑端却无法使用
进入后台也无法解决,当时完全忽略了忘记密码的尴尬。还好可以备份正好借此机会重建在树莓派上
添加网站选择反向代理进行创建
- 终端介入指令
docker pull vaultwarden/server:latest
docker run -d --name vaultwarden \
-e ADMIN_TOKEN=kEGh/9lx/S8eyS7mjBIJNpvjRTBfgFHNk4JepG5JUB4a7sEBEyC1QJRalwSrQykO \##此处为终端介入openssl rand -base64 48所生产出的密码,用于后台登陆
-e DOMAIN=https://key.cam.gs \
-e SENDS_ALLOWED=true \
-e EMERGENCY_ACCESS_ALLOWED=true \
-v /opt/1panel/apps/vaultwarden/:/data/ \
-p 7002:80 \
vaultwarden/server:latest
- 打开地址192.168.100.100:7002即可进入
- 进入frpc配置文件加入
[[proxies]]
name = "vaultwarden"
type = "http"
localIP = "192.168.100.100"
localPort = 7002
customDomains = ["key.cam.gs"]
- 进入服务端添加caddy反代规则
echo "key.cam.gs {
gzip
tls *******@gmail.com#填入邮箱配置ssl
proxy / key.cam.gs:8080
}" >> /etc/caddy/Caddyfile
- 重启服务
service caddy restart
至此结束
补充=Vaultwarden改用MariaDB数据库
- 应用商店安装Vaultwarden并编辑配置文件
networks:
1panel-network:
external: true
services:
bitwarden:
container_name: ${CONTAINER_NAME}
deploy:
resources:
limits:
cpus: ${CPUS}
memory: ${MEMORY_LIMIT}
environment:
- ADMIN_TOKEN=E9G8*******#后台管理钥匙
- DOMAIN=https://key.cam.gs
- SENDS_ALLOWED=true
- WEBSOCKET_ENABLED=true
- EMERGENCY_ACCESS_ALLOWED=true
- DATABASE_URL=mysql://<数据库用户>:<数据库密码>@mariadb/vaultwarden
image: vaultwarden/server:1.30.5-alpine
labels:
createdBy: Apps
networks:
- 1panel-network
ports:
- ${HOST_IP}:${PANEL_APP_PORT_HTTP}:80
restart: always
volumes:
- ./data:/data