同步历史版本代码

This commit is contained in:
2026-03-03 09:32:22 -08:00
parent 7d46b31866
commit 4d8516b2e1
140 changed files with 8399 additions and 489 deletions
+3
View File
@@ -64,3 +64,6 @@ const SendIntervalKeyPrefix = "send:interval:"
const SendCountLimitKeyPrefix = "send:limit:"
const RegisterIpKeyPrefix = "register:ip:"
// UserSessionsKeyPrefix per-user sessions zset key prefix
const UserSessionsKeyPrefix = "auth:user_sessions:"
+30 -1
View File
@@ -5,6 +5,7 @@ import (
"github.com/perfect-panel/server/pkg/logger"
"github.com/perfect-panel/server/pkg/orm"
"github.com/perfect-panel/server/pkg/trace"
)
type Config struct {
@@ -27,9 +28,13 @@ type Config struct {
Register RegisterConfig `yaml:"Register"`
Subscribe SubscribeConfig `yaml:"Subscribe"`
Invite InviteConfig `yaml:"Invite"`
Kutt KuttConfig `yaml:"Kutt"`
OpenInstall OpenInstallConfig `yaml:"OpenInstall"`
Loki LokiConfig `yaml:"Loki"`
Telegram Telegram `yaml:"Telegram"`
Log Log `yaml:"Log"`
Currency Currency `yaml:"Currency"`
Trace trace.Config `yaml:"Trace"`
Administrator struct {
Email string `yaml:"Email" default:"admin@ppanel.dev"`
Password string `yaml:"Password" default:"password"`
@@ -214,6 +219,29 @@ type InviteConfig struct {
ForcedInvite bool `yaml:"ForcedInvite" default:"false"`
ReferralPercentage int64 `yaml:"ReferralPercentage" default:"0"`
OnlyFirstPurchase bool `yaml:"OnlyFirstPurchase" default:"false"`
GiftDays int64 `yaml:"GiftDays" default:"3"`
}
// KuttConfig Kutt 短链接服务配置
type KuttConfig struct {
Enable bool `yaml:"Enable" default:"false"` // 是否启用 Kutt 短链接
ApiURL string `yaml:"ApiURL" default:""` // Kutt API 地址
ApiKey string `yaml:"ApiKey" default:""` // Kutt API 密钥
TargetURL string `yaml:"TargetURL" default:""` // 目标注册页面基础 URL
Domain string `yaml:"Domain" default:""` // 短链接域名 (例如: getsapp.net)
}
// OpenInstallConfig OpenInstall 配置
type OpenInstallConfig struct {
Enable bool `yaml:"Enable" default:"false"` // 是否启用 OpenInstall
AppKey string `yaml:"AppKey" default:""` // OpenInstall AppKey (SDK使用)
ApiKey string `yaml:"ApiKey" default:""` // OpenInstall 数据接口 ApiKey
}
// LokiConfig Loki 日志查询配置
type LokiConfig struct {
Enable bool `yaml:"Enable" default:"false"` // 是否启用 Loki 查询
URL string `yaml:"URL" default:"http://localhost:3100"` // Loki 服务地址
}
type Telegram struct {
@@ -221,6 +249,7 @@ type Telegram struct {
BotID int64 `yaml:"BotID" default:""`
BotName string `yaml:"BotName" default:""`
BotToken string `yaml:"BotToken" default:""`
GroupChatID string `yaml:"GroupChatID" default:""`
EnableNotify bool `yaml:"EnableNotify" default:"false"`
WebHookDomain string `yaml:"WebHookDomain" default:""`
}
@@ -232,7 +261,7 @@ type TLS struct {
}
type VerifyCode struct {
ExpireTime int64 `yaml:"ExpireTime" default:"300"`
ExpireTime int64 `yaml:"ExpireTime" default:"900"`
Limit int64 `yaml:"Limit" default:"15"`
Interval int64 `yaml:"Interval" default:"60"`
}