Skip to content

install

xcsoft edited this page Oct 16, 2024 · 12 revisions

You can choose one of the following three ways to run it.

中文文档

1. Compile from Source

  1. git clone https://github.com/soxft/busuanzi.git && cd busuanzi
  2. go build -o busuanzi main.go
  3. Modify config.yml according to the prompts.
  4. Edit dist/busuanzi.js or compile dist/busuanzi.ts, replacing the link with your own deployment.
  5. Start the program by running ./busuanzi.

2. Run with Docker (Recommended)

Create a file named docker-compose.yaml in an empty folder. See docker-compose.yaml for the content.

Environment Variable Settings

Environment Variable Description
API_SERVER The API address for busuanzi.js, needs to be translated *
WEB_LOG Whether to enable logging, default is true
REDIS_ADDRESS Redis address, defaults to redis:6379
REDIS_PASSWORD Redis password, defaults to empty
BSZ_SECRET Signature key, fill with a string of any length

Run docker compose up -d, the service will run on port 8080. You can also modify docker-compose.yml to specify a different port.

You can also modify ~/data/bsz/config.yaml for custom configurations, then restart the container.

General Environment Variables

TIPS: All settings in the config can be overridden using environment variables.

Ex. BSZ_SECRET = 123 will override Bsz.Secret in config.yaml.

API Translation

For example, if your deployment URL is https://busuanzi.9420.ltd, please fill in the env as https:\/\/busuanzi.9420.ltd.

3. Run the Binary File

$ git clone https://github.com/soxft/busuanzi && cd busuanzi

# Choose the binary file suitable for your system version from Releases (from v2.8.0 onwards, all binaries are automatically built by GitHub Actions)
$ wget https://github.com/soxft/busuanzi/releases/download/v2.8.3/busuanzi-linux-amd64-v2.8.3 -O busuanzi

$ chmod +x busuanzi

# Run busuanzi
$ ./busuanzi