mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-03-19 05:15:38 +08:00
用户系统可以切换CDN和智能DNS
This commit is contained in:
@@ -15,9 +15,7 @@ const (
|
||||
UserFeatureCodeServerWAF UserFeatureCode = "server.waf"
|
||||
UserFeatureCodeServerUAM UserFeatureCode = "server.uam"
|
||||
UserFeatureCodeServerWebP UserFeatureCode = "server.webp"
|
||||
UserFeatureCodeFinance UserFeatureCode = "finance"
|
||||
UserFeatureCodeServerACME UserFeatureCode = "server.acme"
|
||||
UserFeatureCodeNS UserFeatureCode = "ns" // NS域名解析,注意不同于DNS
|
||||
)
|
||||
|
||||
// UserFeature 用户功能
|
||||
@@ -94,21 +92,11 @@ func FindAllUserFeatures() []*UserFeature {
|
||||
Code: UserFeatureCodeServerWebP,
|
||||
Description: "用户可以开启WebP自动转换功能",
|
||||
},
|
||||
{
|
||||
Name: "费用账单",
|
||||
Code: UserFeatureCodeFinance,
|
||||
Description: "开启费用账单相关功能",
|
||||
},
|
||||
{
|
||||
Name: "套餐",
|
||||
Code: UserFeatureCodePlan,
|
||||
Description: "用户可以购买和管理套餐",
|
||||
},
|
||||
{
|
||||
Name: "NS域名解析",
|
||||
Code: UserFeatureCodeNS,
|
||||
Description: "用户可以管理GoEdge智能DNS域名解析",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
12
pkg/userconfigs/user_modules.go
Normal file
12
pkg/userconfigs/user_modules.go
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
|
||||
package userconfigs
|
||||
|
||||
type UserModule = string
|
||||
|
||||
const (
|
||||
UserModuleCDN UserModule = "cdn"
|
||||
UserModuleNS UserModule = "ns"
|
||||
)
|
||||
|
||||
var DefaultUserModules = []UserModule{UserModuleCDN}
|
||||
@@ -3,23 +3,30 @@
|
||||
package userconfigs
|
||||
|
||||
type UserRegisterConfig struct {
|
||||
IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用用户注册
|
||||
IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用用户注册
|
||||
ComplexPassword bool `yaml:"complexPassword" json:"complexPassword"` // 必须使用复杂密码
|
||||
|
||||
// CDN
|
||||
CDNIsOn bool `json:"cdnIsOn"` // 是否开启CDN服务
|
||||
ClusterId int64 `yaml:"clusterId" json:"clusterId"` // 用户创建服务集群
|
||||
ComplexPassword bool `yaml:"complexPassword" json:"complexPassword"` // 必须使用复杂密码
|
||||
Features []string `yaml:"features" json:"features"` // 默认启用的功能
|
||||
RequireVerification bool `yaml:"requireVerification" json:"requireVerification"` // 是否需要审核
|
||||
RequireIdentity bool `yaml:"requireIdentity" json:"requireIdentity"` // 是否需要实名认证
|
||||
|
||||
// 开通DNS
|
||||
NSIsOn bool `json:"nsIsOn"` // 是否开启智能DNS服务
|
||||
}
|
||||
|
||||
func DefaultUserRegisterConfig() *UserRegisterConfig {
|
||||
return &UserRegisterConfig{
|
||||
IsOn: false,
|
||||
ComplexPassword: true,
|
||||
CDNIsOn: true,
|
||||
NSIsOn: false,
|
||||
Features: []string{
|
||||
UserFeatureCodeServerAccessLog,
|
||||
UserFeatureCodeServerViewAccessLog,
|
||||
UserFeatureCodeServerWAF,
|
||||
UserFeatureCodeFinance,
|
||||
UserFeatureCodePlan,
|
||||
},
|
||||
RequireVerification: false,
|
||||
|
||||
Reference in New Issue
Block a user