Documentation
¶
Index ¶
- Constants
- type Config
- type DeviceConfig
- type EmailConfig
- type File
- type InviteConfig
- type JwtAuth
- type Log
- type MobileConfig
- type NodeConfig
- type NodeDBConfig
- type NodeDNS
- type NodeOutbound
- type Protocol
- type RedisConfig
- type RegisterConfig
- type SiteConfig
- type SubscribeConfig
- type TLS
- type Telegram
- type Verify
- type VerifyCode
Constants ¶
const AuthCodeCacheKey = "auth:verify:email"
AuthCodeCacheKey Register Code Cache Key
const AuthCodeTelephoneCacheKey = "auth:verify:telephone"
AuthCodeTelephoneCacheKey Register Code Cache Key
const CommonStatCacheKey = "common:stat"
CommonStatCacheKey CommonStat Cache Key
const CurrencyConfigKey = "system:currency_config"
CurrencyConfigKey Currency Config Key
const EmailSmtpConfigKey = "system:email_smtp_config"
EmailSmtpConfigKey Email Smtp Config Key
const GlobalConfigKey = "system:global_config"
GlobalConfigKey Global Config Key
const InviteConfigKey = "system:invite_config"
InviteConfigKey Invite Config Key
const NodeConfigKey = "system:node_config"
NodeConfigKey Node Config Key
const RegisterConfigKey = "system:register_config"
RegisterConfigKey Register Config Key
const SendCountLimitKeyPrefix = "send:limit:"
SendCountLimitKeyPrefix Send Count Limit Key Prefix eg. send:limit:register:email:xxx@ppanel.dev
const SendIntervalKeyPrefix = "send:interval:"
SendIntervalKeyPrefix Auth Code Send Interval Key Prefix
const ServerCountCacheKey = "server:count"
ServerCountCacheKey Server Count Cache Key
const SessionIdKey = "auth:session_id"
SessionIdKey cache session key
const SiteConfigKey = "system:site_config"
SiteConfigKey Site Config Key
const SmsConfigKey = "system:sms_config"
SmsConfigKey Mobile Config Key
const SubscribeConfigKey = "system:subscribe_config"
SubscribeConfigKey Subscribe Config Key
const TelegramConfigKey = "system:telegram_config"
TelegramConfigKey Telegram Config Key
const TosConfigKey = "system:tos_config"
TosConfigKey Tos配置
const VerifyCodeConfigKey = "system:verify_code_config"
VerifyCodeConfigKey Verify Code Config Key
const VerifyConfigKey = "system:verify_config"
VerifyConfigKey Verify Config Key
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Model string `yaml:"Model" default:"prod"`
Host string `yaml:"Host" default:"0.0.0.0"`
Port int `yaml:"Port" default:"8080"`
Debug bool `yaml:"Debug" default:"false"`
TLS TLS `yaml:"TLS"`
JwtAuth JwtAuth `yaml:"JwtAuth"`
Logger logger.LogConf `yaml:"Logger"`
MySQL orm.Config `yaml:"MySQL"`
Redis RedisConfig `yaml:"Redis"`
Site SiteConfig `yaml:"Site"`
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"`
} `yaml:"Administrator"`
}
type DeviceConfig ¶ added in v1.1.8
type EmailConfig ¶
type EmailConfig struct {
Enable bool `yaml:"Enable" default:"true"`
Platform string `yaml:"platform"`
PlatformConfig string `yaml:"platform_config"`
EnableVerify bool `yaml:"enable_verify"`
EnableNotify bool `yaml:"enable_notify"`
EnableDomainSuffix bool `yaml:"enable_domain_suffix"`
DomainSuffixList string `yaml:"domain_suffix_list"`
VerifyEmailTemplate string `yaml:"verify_email_template"`
ExpirationEmailTemplate string `yaml:"expiration_email_template"`
MaintenanceEmailTemplate string `yaml:"maintenance_email_template"`
TrafficExceedEmailTemplate string `yaml:"traffic_exceed_email_template"`
}
type File ¶
type File struct {
Host string `yaml:"Host" default:"0.0.0.0"`
Port int `yaml:"Port" default:"8080"`
TLS TLS `yaml:"TLS"`
Debug bool `yaml:"Debug" default:"true"`
JwtAuth JwtAuth `yaml:"JwtAuth"`
Logger logger.LogConf `yaml:"Logger"`
MySQL orm.Config `yaml:"MySQL"`
Redis RedisConfig `yaml:"Redis"`
}
type InviteConfig ¶
type MobileConfig ¶
type NodeConfig ¶
type NodeConfig struct {
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 (*NodeConfig) Marshal ¶ added in v1.1.2
func (n *NodeConfig) Marshal() ([]byte, error)
func (*NodeConfig) Unmarshal ¶ added in v1.1.2
func (n *NodeConfig) Unmarshal(data []byte) error
type NodeDBConfig ¶ added in v1.1.2
type NodeDNS ¶ added in v1.1.2
type NodeOutbound ¶ added in v1.1.2
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 (*NodeOutbound) Marshal ¶ added in v1.1.2
func (n *NodeOutbound) Marshal() ([]byte, error)
type RedisConfig ¶
type RegisterConfig ¶
type RegisterConfig struct {
StopRegister bool `yaml:"StopRegister" default:"false"`
EnableTrial bool `yaml:"EnableTrial" default:"false"`
TrialSubscribe int64 `yaml:"TrialSubscribe" default:"0"`
TrialTime int64 `yaml:"TrialTime" default:"0"`
TrialTimeUnit string `yaml:"TrialTimeUnit" default:""`
IpRegisterLimit int64 `yaml:"IpRegisterLimit" default:"0"`
IpRegisterLimitDuration int64 `yaml:"IpRegisterLimitDuration" default:"0"`
EnableIpRegisterLimit bool `yaml:"EnableIpRegisterLimit" default:"false"`
}
type SiteConfig ¶
type SiteConfig struct {
Host string `yaml:"Host" default:""`
SiteName string `yaml:"SiteName" default:""`
SiteDesc string `yaml:"SiteDesc" default:""`
SiteLogo string `yaml:"SiteLogo" default:""`
Keywords string `yaml:"Keywords" default:""`
CustomHTML string `yaml:"CustomHTML" default:""`
CustomData string `yaml:"CustomData" default:""`
}
type SubscribeConfig ¶
type SubscribeConfig struct {
SingleModel bool `yaml:"SingleModel" default:"false"`
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 Telegram ¶
type Telegram struct {
Enable bool `yaml:"Enable" default:"false"`
BotID int64 `yaml:"BotID" default:""`
BotName string `yaml:"BotName" default:""`
BotToken string `yaml:"BotToken" default:""`
EnableNotify bool `yaml:"EnableNotify" default:"false"`
WebHookDomain string `yaml:"WebHookDomain" default:""`
}
type Verify ¶
type Verify struct {
TurnstileSiteKey string `yaml:"TurnstileSiteKey" default:""`
TurnstileSecret string `yaml:"TurnstileSecret" default:""`
LoginVerify bool `yaml:"LoginVerify" default:"false"`
RegisterVerify bool `yaml:"RegisterVerify" default:"false"`
ResetPasswordVerify bool `yaml:"ResetPasswordVerify" default:"false"`
}