Files
yggdrasil-go/config_example.ini
Gardel f6ac467265
Some checks failed
Release / build (push) Failing after 3m38s
feat: password reset support
2025-03-30 22:22:24 +08:00

164 lines
4.7 KiB
INI

[meta]
;应用显示名称
server_name = A Mojang Yggdrasil Server
;软件名称
implementation_name = go-yggdrasil-server
;版本
implementation_version = v0.0.1
;皮肤、披风材质白名单
skin_domains = .example.com, localhost
;访问路径(不要添加"/"后缀)
skin_root_url = http://localhost:8080
[server]
;服务监听地址
server_address = :8080
;反向代理信任地址
trusted_proxies = 127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12
[database]
; Database driver type, mysql or sqlite
database_driver = sqlite
; Database DSN, for mysql
;database_dsn = user:pass@tcp(127.0.0.1:3306)/yggdrasil?charset=utf8mb4&parseTime=True&loc=Local
; Database DSN, for sqlite
database_dsn = file:sqlite.db?cache=shared
[paths]
;私钥存储路径
private_key_file = private.pem
;公钥存储路径
public_key_file = public.pem
[smtp]
; 发件服务器地址
smtp_server = localhost
; 发件服务器端口
smtp_port = 25
; 服务器使用 SSL (StartTLS 填否)
smtp_ssl = false
; 发件人
email_from = Go Yggdrasil Server <mc@example.com>
; 服务器认证用户名
smtp_user = mc@example.com
; 服务器认证密码
smtp_password = 123456
; 邮件标题前缀
title_prefix = [A Mojang Yggdrasil Server]
; 注册邮件模板
register_template = """<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
.email-container {
font-family: Arial, sans-serif;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
.email-header {
font-weight: bold;
color: #333;
margin-bottom: 10px;
}
.email-body {
margin-bottom: 20px;
color: #555;
}
.email-footer {
font-style: italic;
color: #777;
}
.reset-link {
background-color: #007bff;
color: white;
text-decoration: none;
padding: 10px 15px;
border-radius: 3px;
}
</style>
</head>
<body>
<div class="email-container">
<div class="email-header">验证邮箱地址</div>
<div class="email-body">
你好!你刚才在 A Mojang Yggdrasil Server 申请创建账户。如果你没有发起请求,请忽视此邮件。
<br><br>
若要继续,请点击下面的链接进行安全验证:
<br><br>
<a href="http://localhost:8080/profile/#emailVerifyToken={{.AccessToken}}" class="reset-link">安全验证</a>
<pre>http://localhost:8080/profile/#emailVerifyToken={{.AccessToken}}</pre>
</div>
<div class="email-footer">如果链接无法点击,请复制并粘贴到浏览器地址栏中访问。</div>
</div>
</body>
</html>
"""
; 重置密码邮件模板
reset_password_template = """<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
.email-container {
font-family: Arial, sans-serif;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
.email-header {
font-weight: bold;
color: #333;
margin-bottom: 10px;
}
.email-body {
margin-bottom: 20px;
color: #555;
}
.email-footer {
font-style: italic;
color: #777;
}
.reset-link {
background-color: #007bff;
color: white;
text-decoration: none;
padding: 10px 15px;
border-radius: 3px;
}
</style>
</head>
<body>
<div class="email-container">
<div class="email-header">密码重置</div>
<div class="email-body">
你好!有人请求重置你的 A Mojang Yggdrasil Server 账户密码。如果你没有发起请求,请忽视此邮件。
<br><br>
若要继续,请点击下面的链接进行安全验证:
<br><br>
<a href="http://localhost:8080/profile/resetPassword#passwordResetToken={{.AccessToken}}" class="reset-link">重置密码</a>
<pre>http://localhost:8080/profile/resetPassword#passwordResetToken={{.AccessToken}}</pre>
</div>
<div class="email-footer">如果链接无法点击,请复制并粘贴到浏览器地址栏中访问。</div>
</div>
</body>
</html>
"""