90 lines
2.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 项目前端
启动前请务必配置以下环境变量,否则项目无法正常连接到后端运行,不修改的情况下使用默认值:
* API_BASE_URL=http://localhost:8080 - 后端接口基础地址
Nginx默认配置文件
```nginx
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
```
## 项目后端
本项目对接和风天气请前往和风天气开发者官网申请API秘钥https://dev.qweather.com
项目默认用户有两个:
* 用户名: user 密码: 123456
* 用户名: test 密码: 123456
启动前需要先完成以下环境变量配置,若不修改则使用下列默认值。
邮件发送配置:
* MAIL_HOST=smtp.163.com - SMTP邮件服务器地址
* MAIL_USERNAME=user - 邮件服务用户名
* MAIL_PASSWORD=123456 - 邮件服务密码
RabbitMQ消息队列配置
* RABBITMQ_ADDRESS=localhost - RabbitMQ连接地址
* RABBITMQ_USERNAME=admin - RabbitMQ用户名
* RABBITMQ_PASSWORD=admin - RabbitMQ密码
* RABBITMQ_VIRTUAL_HOST=/ - RabbitMQ虚拟主机配置
MySQL数据库连接信息配置
* MYSQL_URL=jdbc:mysql://localhost:3306/monitor - MySQL数据库连接URL
* MYSQL_USERNAME=root - MySQL数据库用户名
* MYSQL_PASSWORD=123456 - MySQL数据库密码
Minio对象存储服务配置
* MINIO_ENDPOINT=http://localhost:9000 - minio服务地址
* MINIO_USERNAME=minio - minio服务用户名
* MINIO_PASSWORD=12345678 - minio服务密码
和风天气API接口
* WEATHER_API_KEY=7abbc24d3b4443b597a3b3c676e0f221 - 默认值(自己去申请一个,别用这个默认的)
接口请求限流配置:
* FLOW_LIMIT=20 - 单位时间内最大请求数
* FLOW_LIMIT_PERIOD=3 - 统计单位时间(秒)
* FLOW_LIMIT_BLOCK=30 - 超过最大请求频率的封禁时间
Jwt令牌生成参数配置
* JWT_KEY=abcdefghijklmn - 令牌的秘钥
* JWT_EXPIRE=72 - 令牌过期时间
* JWT_LIMIT_BASE=10 - 生成Jwt令牌的冷却时间防止刷接口频繁登录生成令牌
* JWT_LIMIT_UPGRADE=300 - 用户如果继续恶意刷令牌,更严厉的封禁时间
* JWT_LIMIT_FREQUENCY=30 - 判定用户在冷却时间内,继续恶意刷令牌的次数限制
跨域配置:
* CORS_ORIGIN=*
* CORS_METHODS=*
Redis数据库配置
* REDIS_HOST=localhost - Redis数据库主机地址
* REDIS_PORT=6379 - Redis数据库端口
* REDIS_PASSWORD='' - Redis数据库密码