Реализован production-hardening по fix1: env/reconfigure, IPv4-only, TLS, secrets, firewall, docs
This commit is contained in:
@@ -28,4 +28,3 @@ type AccountExport struct {
|
||||
ConAt int64 `json:"conAt"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
|
||||
@@ -203,4 +203,3 @@ type serverConfigMasquerade struct {
|
||||
ListenHTTPS *string `yaml:"listenHTTPS,omitempty" json:"listenHTTPS" validate:"omitempty"`
|
||||
ForceHTTPS *bool `yaml:"forceHTTPS,omitempty" json:"forceHTTPS" validate:"omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -4,4 +4,3 @@ type Hysteria2UserTraffic struct {
|
||||
Tx int64 `json:"tx"` // upload
|
||||
Rx int64 `json:"rx"` // download
|
||||
}
|
||||
|
||||
|
||||
@@ -25,4 +25,3 @@ type ClashConfig struct {
|
||||
Proxies []interface{} `yaml:"proxies"`
|
||||
ProxyGroups []ProxyGroup `yaml:"proxy-groups"`
|
||||
}
|
||||
|
||||
|
||||
@@ -6,4 +6,3 @@ const (
|
||||
V2rayN = "v2rayn"
|
||||
NekoBox = "nekobox"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,4 +7,3 @@ const (
|
||||
CodeForbiddenError int = 50403
|
||||
CodeInvalidError int = 50001
|
||||
)
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
HUIWebPort = "H_UI_WEB_PORT"
|
||||
HUIWebContext = "H_UI_WEB_CONTEXT"
|
||||
HUICrtPath = "H_UI_CRT_PATH"
|
||||
HUIKeyPath = "H_UI_KEY_PATH"
|
||||
JwtSecret = "JWT_SECRET"
|
||||
Hysteria2Enable = "HYSTERIA2_ENABLE"
|
||||
Hysteria2Config = "HYSTERIA2_CONFIG"
|
||||
Hysteria2TrafficTime = "HYSTERIA2_TRAFFIC_TIME"
|
||||
Hysteria2ConfigRemark = "HYSTERIA2_CONFIG_REMARK"
|
||||
Hysteria2ConfigPortHopping = "HYSTERIA2_CONFIG_PORT_HOPPING"
|
||||
ResetTrafficCron = "RESET_TRAFFIC_CRON"
|
||||
ClashExtension = "CLASH_EXTENSION"
|
||||
HUIWebPort = "H_UI_WEB_PORT"
|
||||
HUIWebContext = "H_UI_WEB_CONTEXT"
|
||||
HUICrtPath = "H_UI_CRT_PATH"
|
||||
HUIKeyPath = "H_UI_KEY_PATH"
|
||||
JwtSecret = "JWT_SECRET"
|
||||
Hysteria2TrafficStatsSecret = "HYSTERIA2_TRAFFIC_STATS_SECRET"
|
||||
Hysteria2Enable = "HYSTERIA2_ENABLE"
|
||||
Hysteria2Config = "HYSTERIA2_CONFIG"
|
||||
Hysteria2TrafficTime = "HYSTERIA2_TRAFFIC_TIME"
|
||||
Hysteria2ConfigRemark = "HYSTERIA2_CONFIG_REMARK"
|
||||
Hysteria2ConfigPortHopping = "HYSTERIA2_CONFIG_PORT_HOPPING"
|
||||
ResetTrafficCron = "RESET_TRAFFIC_CRON"
|
||||
ClashExtension = "CLASH_EXTENSION"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,4 +12,3 @@ const (
|
||||
WrongPassword string = "wrong password"
|
||||
ConfigNotExist string = "config not exist"
|
||||
)
|
||||
|
||||
|
||||
@@ -18,4 +18,3 @@ const (
|
||||
|
||||
Version = "v0.0.22"
|
||||
)
|
||||
|
||||
|
||||
@@ -34,4 +34,3 @@ type AccountUpdateDto struct {
|
||||
Deleted *int64 `json:"deleted" form:"deleted" validate:"omitempty,oneof=0 1"`
|
||||
Remark *string `json:"remark" form:"remark" validate:"omitempty,min=0,max=32"`
|
||||
}
|
||||
|
||||
|
||||
@@ -16,4 +16,3 @@ type ConfigUpdateDto struct {
|
||||
type ConfigsUpdateDto struct {
|
||||
ConfigUpdateDtos []ConfigUpdateDto `json:"configUpdateDtos" form:"configUpdateDtos" validate:"required"`
|
||||
}
|
||||
|
||||
|
||||
@@ -10,4 +10,3 @@ type BaseDto struct {
|
||||
type IdDto struct {
|
||||
Id *int64 `json:"id" form:"id" validate:"required,gt=0"` // Первичный ключ
|
||||
}
|
||||
|
||||
|
||||
@@ -25,4 +25,3 @@ type Hysteria2UrlDto struct {
|
||||
AccountId *int64 `json:"accountId" form:"accountId" validate:"required,gt=0"`
|
||||
Hostname *string `json:"hostname" form:"hostname" validate:"required,min=1,max=255"`
|
||||
}
|
||||
|
||||
|
||||
@@ -7,4 +7,3 @@ type LogDto struct {
|
||||
type LogExportDto struct {
|
||||
Option *int `json:"option" form:"option" validate:"required,oneof=0 1"`
|
||||
}
|
||||
|
||||
|
||||
@@ -3,4 +3,3 @@ package dto
|
||||
type ServerDto struct {
|
||||
Port *int64 `json:"port" form:"port" validate:"required,min=1,max=65535"`
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ type Account struct {
|
||||
Deleted *int64 `gorm:"column:deleted;default:0" json:"deleted"`
|
||||
BaseEntity `gorm:"embedded"`
|
||||
|
||||
LoginAt *int64 `gorm:"column:login_at;default:0" json:"loginAt"`
|
||||
ConAt *int64 `gorm:"column:con_at;default:0" json:"conAt"`
|
||||
Remark *string `gorm:"column:remark;default:''" json:"remark"`
|
||||
LoginAt *int64 `gorm:"column:login_at;default:0" json:"loginAt"`
|
||||
ConAt *int64 `gorm:"column:con_at;default:0" json:"conAt"`
|
||||
Remark *string `gorm:"column:remark;default:''" json:"remark"`
|
||||
ForcePasswordChange *int64 `gorm:"column:force_password_change;default:0" json:"forcePasswordChange"`
|
||||
}
|
||||
|
||||
|
||||
@@ -6,4 +6,3 @@ type Config struct {
|
||||
Remark *string `gorm:"column:remark;default:''" json:"remark"`
|
||||
BaseEntity `gorm:"embedded"`
|
||||
}
|
||||
|
||||
|
||||
@@ -7,4 +7,3 @@ type BaseEntity struct {
|
||||
CreateTime *time.Time `gorm:"column:create_time;default:null" json:"createTime"`
|
||||
UpdateTime *time.Time `gorm:"column:update_time;default:null" json:"updateTime"`
|
||||
}
|
||||
|
||||
|
||||
@@ -29,4 +29,3 @@ type AccountInfoVo struct {
|
||||
Username string `json:"username"`
|
||||
Roles []string `json:"roles"`
|
||||
}
|
||||
|
||||
|
||||
@@ -5,4 +5,3 @@ type ConfigVo struct {
|
||||
Value string `json:"value"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
|
||||
@@ -38,4 +38,3 @@ type Hysteria2AcmePathVo struct {
|
||||
CrtPath string `json:"crtPath"`
|
||||
KeyPath string `json:"keyPath"`
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package vo
|
||||
|
||||
type JwtVo struct {
|
||||
TokenType string `json:"tokenType"`
|
||||
AccessToken string `json:"accessToken"`
|
||||
TokenType string `json:"tokenType"`
|
||||
AccessToken string `json:"accessToken"`
|
||||
ForcePasswordChange bool `json:"forcePasswordChange"`
|
||||
}
|
||||
|
||||
|
||||
@@ -21,4 +21,3 @@ type LogHysteria2Vo struct {
|
||||
Msg string `json:"msg"`
|
||||
Time string `json:"time"`
|
||||
}
|
||||
|
||||
|
||||
@@ -13,4 +13,3 @@ type Hysteria2MonitorVo struct {
|
||||
Version string `json:"version"` // Версия
|
||||
Running bool `json:"running"` // Статус выполнения
|
||||
}
|
||||
|
||||
|
||||
@@ -44,4 +44,3 @@ func Fail(message string, c *gin.Context) {
|
||||
Data: nil,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -6,4 +6,3 @@ type BaseVo struct {
|
||||
Id int64 `json:"id"`
|
||||
CreateTime time.Time `json:"createTime"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user