mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-11-16 23:04:24 +08:00
feat(domain): 支持通配符域名及关联功能适配 (#63)
* feat(domain): 支持通配符域名及关联功能适配 * fix(domain): preserve legacy Unicode imports and address review findings * fix(domain): canonicalize legacy IDNs and exclude empty host labels * fix(domain): normalize equivalent Unicode IDN spellings --------- Co-authored-by: Ryan <63696351+Rain-kl@users.noreply.github.com> Co-authored-by: ryan <ryan@arctel.net>
This commit is contained in:
@@ -24,7 +24,7 @@ type NodeAccessLogFilter struct {
|
||||
NodeID string
|
||||
RemoteAddr string
|
||||
Host string
|
||||
// Hosts exact-matches any host (case-insensitive). Prefer over Host for multi-domain scopes.
|
||||
// Hosts 优先于 Host:具体域名精确匹配(忽略大小写),*.suffix 匹配非空、多层子域名但不含 suffix 本身。
|
||||
Hosts []string
|
||||
Path string
|
||||
// StatusCode filters by exact HTTP status code when > 0.
|
||||
|
||||
@@ -160,7 +160,9 @@ type OpenFlareAccessLogQuery struct {
|
||||
NodeID string
|
||||
RemoteAddr string
|
||||
Host string
|
||||
// Hosts exact-matches any host (case-insensitive). Prefer over Host for multi-domain scopes.
|
||||
// Hosts matches case-insensitively and takes precedence over Host.
|
||||
// Exact names match only that host; *.example.com matches one or more
|
||||
// nonempty subdomain levels, excluding example.com itself.
|
||||
Hosts []string
|
||||
Path string
|
||||
// StatusCode filters by exact HTTP status code when > 0.
|
||||
@@ -175,9 +177,10 @@ type OpenFlareAccessLogQuery struct {
|
||||
|
||||
// OpenFlareAccessLogBucketQuery filters folded access log queries (v1 stub).
|
||||
type OpenFlareAccessLogBucketQuery struct {
|
||||
NodeID string
|
||||
RemoteAddr string
|
||||
Host string
|
||||
NodeID string
|
||||
RemoteAddr string
|
||||
Host string
|
||||
// Hosts follows OpenFlareAccessLogQuery.Hosts exact and wildcard matching.
|
||||
Hosts []string
|
||||
Path string
|
||||
Since time.Time
|
||||
|
||||
@@ -25,7 +25,7 @@ func (Zone) TableName() string {
|
||||
return tableOfZones
|
||||
}
|
||||
|
||||
// ZoneDomain OpenFlare Zone 下的明确域名实体。
|
||||
// ZoneDomain OpenFlare Zone 下的具体或通配符域名实体。
|
||||
type ZoneDomain struct {
|
||||
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
|
||||
ZoneID uint `json:"zone_id" gorm:"not null;index:idx_of_zone_domains_zone_id"`
|
||||
@@ -41,7 +41,7 @@ func (ZoneDomain) TableName() string {
|
||||
return tableOfZoneDomains
|
||||
}
|
||||
|
||||
// ZoneDomainCount is the per-zone explicit domain count for list queries.
|
||||
// ZoneDomainCount 是每个 Zone 的登记域名记录数,通配符按一条记录计数。
|
||||
type ZoneDomainCount struct {
|
||||
ZoneID uint `json:"zone_id" gorm:"column:zone_id"`
|
||||
Count int64 `json:"count" gorm:"column:count"`
|
||||
|
||||
Reference in New Issue
Block a user