feat: 新增会话ID伪装功能,优化日志系统

- 新增 session_id_masking_enabled 配置,启用后将在15分钟内固定
  metadata.user_id 中的 session ID
- TLS fingerprint 模块日志从自定义 debugLog 迁移到 slog
- main.go 添加 slog 初始化,根据 gin mode 设置日志级别
- 前端创建/编辑账号模态框添加会话ID伪装开关
- 多语言支持(中英文)
This commit is contained in:
shaw
2026-01-19 10:22:13 +08:00
parent 4c12799a95
commit ccfeaeb22d
15 changed files with 397 additions and 109 deletions

View File

@@ -2,6 +2,7 @@
package tlsfingerprint
import (
"log/slog"
"sort"
"sync"
@@ -40,7 +41,7 @@ func NewRegistryFromConfig(cfg *config.TLSFingerprintConfig) *Registry {
r := NewRegistry()
if cfg == nil || !cfg.Enabled {
debugLog("[TLS Registry] TLS fingerprint disabled or no config, using default profile only")
slog.Debug("tls_registry_disabled", "reason", "disabled or no config")
return r
}
@@ -56,10 +57,10 @@ func NewRegistryFromConfig(cfg *config.TLSFingerprintConfig) *Registry {
// If the profile has empty values, they will use defaults in dialer
r.RegisterProfile(name, profile)
debugLog("[TLS Registry] Loaded custom profile: %s (%s)", name, profileCfg.Name)
slog.Debug("tls_registry_loaded_profile", "key", name, "name", profileCfg.Name)
}
debugLog("[TLS Registry] Initialized with %d profiles: %v", len(r.profileNames), r.profileNames)
slog.Debug("tls_registry_initialized", "profile_count", len(r.profileNames), "profiles", r.profileNames)
return r
}