安装方法
您可以选择以下三种方式运行
1. 源码编译运行
1.
git clone https://github.com/soxft/busuanzi.git && cd busuanzi
2.
go build -o busuanzi main.go
3.
config.yml
4.
dist/busuanzi.js
或编译dist/busuanzi.ts
, 替换链接为自己部署的。5.
./busuanzi
启动程序2. 使用 Docker 运行 (Recommend)
docker-compose.yaml
的文件, 内容如下或见 docker-compose.yaml
环境变量设置
环境变量 | 参数说明 |
---|---|
API_SERVER | busuanzi.js API地址 |
WEB_LOG | 是否开启日志,默认 true |
REDIS_ADDRESS | Redis 地址, 默认为 redis:6379 |
REDIS_PASSWORD | Redis 密码,默认空 |
BSZ_SECRET | 签名密钥, 使用任意长度的字符串填充 |
docker compose up -d
服务将会运行在 8080 端口, 也可以自行修改 docker-compose.yml
指定端口~/data/bsz/config.yaml
自定义配置, 后重启容器。通用环境变量
Tips: 所有 config 内的设置, 均可使用 环境变量 覆盖
Ex. BSZ_SECRET = 123 将覆盖 config.yaml 中的 Bsz.Secret
API 转译
仅在 2.8.6 之前需要进行转译
https://busuanzi.9420.ltd
, 则请在 env 中填写 https:\/\/busuanzi.9420.ltd
https://
将其替换为 https:\/\/
3. 二进制文件运行
修改于 2024-12-03 01:22:13