-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.properties.example
More file actions
153 lines (116 loc) · 5.14 KB
/
config.properties.example
File metadata and controls
153 lines (116 loc) · 5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# ============================================
# FoxNAServer 配置文件
# ============================================
# 使用说明:
# 1. 复制此文件为 config.properties
# 2. 修改以下配置项
# 3. 重启服务生效
# ============================================
# 基础服务配置
# ============================================
# HTTP 服务端口
server.port=8080
# 广播端口(用于局域网发现等功能)
broadcast.port=25522
# 服务名称
name=FoxNas
# Swagger UI 访问路径(不应修改)
springdoc.swagger-ui.path=/api-docs
# ============================================
# 数据库配置(必填)
# ============================================
# MySQL 数据库配置
# 数据库地址
app.spring.datasource.url=jdbc:mysql://localhost:3306/db_foxnas?useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
# 数据库用户名
app.spring.datasource.username=<your_mysql_username>
# 数据库密码(生产环境请使用强密码)
app.spring.datasource.password=<your_mysql_password>
# ============================================
# Redis 配置(必填)
# ============================================
# Redis 服务器地址
app.spring.data.redis.host=127.0.0.1
# Redis 端口
app.spring.data.redis.port=6379
# ============================================
# MongoDB 配置(必填)
# ============================================
# MongoDB 服务器地址
app.spring.data.mongodb.host=localhost
# MongoDB 端口
app.spring.data.mongodb.port=27017
# MongoDB 数据库名
app.spring.data.mongodb.database=foxnas_logs
# ============================================
# JWT 安全配置(必填,生产环境必须修改)
# ============================================
# JWT 密钥(用于签名 Token)
# 建议使用随机生成的长字符串
app.jwt.secret=<your-super-secret-key-change-this-in-production>
# ============================================
# 邮件配置(可选,用于找回密码等功能)
# ============================================
# SMTP 服务器地址(示例:smtp.qq.com / smtp.resend.com)
app.spring.mail.host=smtp.qq.com
# SMTP 端口
app.spring.mail.port=465
# 发件账号
app.spring.mail.username=<your_email_or_smtp_user>
# 邮件密码或授权码
app.spring.mail.password=<your_email_auth_code>
# 发件人显示名
app.spring.mail.from=FoxNAS <no-reply@example.com>
# 默认编码
app.spring.mail.default-encoding=UTF-8
# SMTP 认证与 TLS
app.spring.mail.properties.mail.smtp.auth=true
app.spring.mail.properties.mail.smtp.starttls.enable=true
app.spring.mail.properties.mail.smtp.starttls.required=true
# SSL SocketFactory(如不需要可注释)
app.spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
app.spring.mail.properties.mail.smtp.socketFactory.port=465
app.spring.mail.properties.mail.smtp.socketFactory.fallback=false
# 连接超时配置(毫秒)
app.spring.mail.properties.mail.smtp.connectiontimeout=5000
app.spring.mail.properties.mail.smtp.timeout=5000
app.spring.mail.properties.mail.smtp.writetimeout=5000
# ============================================
# 文件上传配置
# ============================================
# 单个文件最大大小(默认 10GB)
app.spring.servlet.multipart.max-file-size=20480MB
# 单次请求最大大小(默认 10GB)
app.spring.servlet.multipart.max-request-size=20480MB
# ============================================
# 日志配置
# ============================================
# 日志文件路径
app.logging.file.name=logs/foxnas_log.log
# 单个日志文件最大大小
app.logging.logback.rollingpolicy.max-file-size=10MB
# 日志文件保留天数
app.logging.logback.rollingpolicy.max-history=30
# 推荐日志级别(按需开启)
app.logging.level.org.apache.ibatis=warn
app.logging.level.org.springframework.jdbc=warn
app.logging.level.com.zaxxer.hikari=warn
# ============================================
# OAuth2 配置(可选,用于第三方登录),相关解释请在 Wiki 中查看
# ============================================
# 后端地址(用于 OAuth 回调)
oauth.base.url=http://localhost:8080
# 前端地址(用于 OAuth 回调跳转)
oauth.frontend.base.url=http://localhost:5173
# GitHub OAuth
spring.security.oauth2.client.registration.github.client-id=your_github_client_id
spring.security.oauth2.client.registration.github.client-secret=your_github_client_secret
spring.security.oauth2.client.registration.github.redirect-uri=${oauth.base.url}/api/login/oauth2/code/{registrationId}
# QQ OAuth(必须是生产环境地址,且 https 加密,并且在 QQ 开发者平台配置)
spring.security.oauth2.client.registration.qq.client-id=your_qq_app_id
spring.security.oauth2.client.registration.qq.client-secret=your_qq_app_key
spring.security.oauth2.client.registration.qq.redirect-uri=${oauth.base.url}/api/login/oauth2/code/{registrationId}
# Microsoft OAuth(需要同时配置 microsoft.client.id 和 microsoft.client.secret 才会启用)
microsoft.client.id=your_microsoft_client_id
microsoft.client.secret=your_microsoft_client_secret
spring.security.oauth2.client.registration.microsoft.redirect-uri=${oauth.base.url}/api/login/oauth2/code/{registrationId}