refactor: 更新项目引用路径从perfect-panel/ppanel-server到perfect-panel/server
Build docker and publish / build (20.15.1) (push) Failing after 6m27s

feat: 添加版本和构建时间变量
fix: 修正短信队列类型注释错误
style: 清理未使用的代码和测试文件
docs: 更新安装文档中的下载链接
chore: 迁移数据库脚本添加日志和订阅配置
This commit is contained in:
2025-10-13 01:33:03 -07:00
parent 393b42f35a
commit c582087c0f
974 changed files with 23609 additions and 23398 deletions
+1 -18
View File
@@ -12,9 +12,6 @@ const SiteConfigKey = "system:site_config"
// SubscribeConfigKey Subscribe Config Key
const SubscribeConfigKey = "system:subscribe_config"
// ApplicationKey Application Key
const ApplicationKey = "system:application"
// RegisterConfigKey Register Config Key
const RegisterConfigKey = "system:register_config"
@@ -51,26 +48,12 @@ const AuthCodeCacheKey = "auth:verify:email"
// AuthCodeTelephoneCacheKey Register Code Cache Key
const AuthCodeTelephoneCacheKey = "auth:verify:telephone"
// ServerUserListCacheKey Server User List Cache Key
const ServerUserListCacheKey = "server:user_list:id:"
// ServerConfigCacheKey Server Config Cache Key
const ServerConfigCacheKey = "server:config:id:"
// CommonStat Cache Key
// CommonStatCacheKey CommonStat Cache Key
const CommonStatCacheKey = "common:stat"
// ServerStatusCacheKey Server Status Cache Key
const ServerStatusCacheKey = "server:status:id:"
// ServerCountCacheKey Server Count Cache Key
const ServerCountCacheKey = "server:count"
// UserBindTelegramCacheKey User Bind Telegram Cache Key
const UserBindTelegramCacheKey = "user:bind:telegram:code:"
const CacheSmsCount = "cache:sms:count"
// SendIntervalKeyPrefix Auth Code Send Interval Key Prefix
const SendIntervalKeyPrefix = "send:interval:"
+103 -6
View File
@@ -1,8 +1,10 @@
package config
import (
"github.com/perfect-panel/ppanel-server/pkg/logger"
"github.com/perfect-panel/ppanel-server/pkg/orm"
"encoding/json"
"github.com/perfect-panel/server/pkg/logger"
"github.com/perfect-panel/server/pkg/orm"
)
type Config struct {
@@ -19,12 +21,14 @@ type Config struct {
Node NodeConfig `yaml:"Node"`
Mobile MobileConfig `yaml:"Mobile"`
Email EmailConfig `yaml:"Email"`
Device DeviceConfig `yaml:"device"`
Verify Verify `yaml:"Verify"`
VerifyCode VerifyCode `yaml:"VerifyCode"`
Register RegisterConfig `yaml:"Register"`
Subscribe SubscribeConfig `yaml:"Subscribe"`
Invite InviteConfig `yaml:"Invite"`
Telegram Telegram `yaml:"Telegram"`
Log Log `yaml:"Log"`
Administrator struct {
Email string `yaml:"Email" default:"admin@ppanel.dev"`
Password string `yaml:"Password" default:"password"`
@@ -52,9 +56,11 @@ type Verify struct {
type SubscribeConfig struct {
SingleModel bool `yaml:"SingleModel" default:"false"`
SubscribePath string `yaml:"SubscribePath" default:"/api/subscribe"`
SubscribePath string `yaml:"SubscribePath" default:"/v1/subscribe/config"`
SubscribeDomain string `yaml:"SubscribeDomain" default:""`
PanDomain bool `yaml:"PanDomain" default:"false"`
UserAgentLimit bool `yaml:"UserAgentLimit" default:"false"`
UserAgentList string `yaml:"UserAgentList" default:""`
}
type RegisterConfig struct {
@@ -91,6 +97,14 @@ type MobileConfig struct {
Whitelist []string `yaml:"whitelist"`
}
type DeviceConfig struct {
Enable bool `yaml:"enable" default:"true"`
ShowAds bool `yaml:"show_ads"`
EnableSecurity bool `yaml:"enable_security"`
OnlyRealDevice bool `yaml:"only_real_device"`
SecuritySecret string `yaml:"security_secret"`
}
type SiteConfig struct {
Host string `yaml:"Host" default:""`
SiteName string `yaml:"SiteName" default:""`
@@ -102,9 +116,76 @@ type SiteConfig struct {
}
type NodeConfig struct {
NodeSecret string `yaml:"NodeSecret" default:""`
NodePullInterval int64 `yaml:"NodePullInterval" default:"60"`
NodePushInterval int64 `yaml:"NodePushInterval" default:"60"`
NodeSecret string `yaml:"NodeSecret" default:""`
NodePullInterval int64 `yaml:"NodePullInterval" default:"60"`
NodePushInterval int64 `yaml:"NodePushInterval" default:"60"`
TrafficReportThreshold int64 `yaml:"TrafficReportThreshold" default:"0"`
IPStrategy string `yaml:"IPStrategy" default:""`
DNS []NodeDNS `yaml:"DNS"`
Block []string `yaml:"Block" `
Outbound []NodeOutbound `yaml:"Outbound"`
}
func (n *NodeConfig) Marshal() ([]byte, error) {
type Alias NodeConfig
return json.Marshal(&struct {
*Alias
}{
Alias: (*Alias)(n),
})
}
func (n *NodeConfig) Unmarshal(data []byte) error {
type Alias NodeConfig
aux := &struct {
*Alias
}{
Alias: (*Alias)(n),
}
return json.Unmarshal(data, &aux)
}
type NodeDNS struct {
Proto string `json:"proto"`
Address string `json:"address"`
Domains []string `json:"domains"`
}
func (n *NodeDNS) Marshal() ([]byte, error) {
type Alias NodeDNS
return json.Marshal(&struct {
*Alias
}{
Alias: (*Alias)(n),
})
}
func (n *NodeDNS) Unmarshal(data []byte) error {
type Alias NodeDNS
aux := &struct {
*Alias
}{
Alias: (*Alias)(n),
}
return json.Unmarshal(data, &aux)
}
type NodeOutbound struct {
Name string `json:"name"`
Protocol string `json:"protocol"`
Address string `json:"address"`
Port int64 `json:"port"`
Password string `json:"password"`
Rules []string `json:"rules"`
}
func (n *NodeOutbound) Marshal() ([]byte, error) {
type Alias NodeOutbound
return json.Marshal(&struct {
*Alias
}{
Alias: (*Alias)(n),
})
}
type File struct {
@@ -144,3 +225,19 @@ type VerifyCode struct {
Limit int64 `yaml:"Limit" default:"15"`
Interval int64 `yaml:"Interval" default:"60"`
}
type Log struct {
AutoClear bool `yaml:"AutoClear" default:"true"`
ClearDays int64 `yaml:"ClearDays" default:"7"`
}
type NodeDBConfig struct {
NodeSecret string
NodePullInterval int64
NodePushInterval int64
TrafficReportThreshold int64
IPStrategy string
DNS string
Block string
Outbound string
}
-5
View File
@@ -1,5 +0,0 @@
package config
import "github.com/perfect-panel/ppanel-server/pkg/constant"
const Version = constant.Version