fix(api): restore DefaultConfig() and constants used by config loader
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Restore api.DefaultConfig() - used by internal/config/loader.go - Restore DefaultInterface, DefaultPort, DefaultBPFFilter constants - Restore DefaultFlowTimeout, DefaultPacketBuffer constants - Remove unused LogLevel* constants (never referenced in codebase) docs(architecture.yml): update packaging and service sections - Update packaging tool from fpm to rpmbuild - Remove CentOS 7 / RHEL 7 from target distros (EOL) - Update rpm_builder stage description for rpmbuild workflow - Add spec_file section with version_macro documentation - Update service to run as root (required for packet capture) - Update security sandboxing to match current systemd unit - Remove pid_file (not used) - Update binary_path from /usr/local/bin to /usr/bin Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
28
api/types.go
28
api/types.go
@ -232,3 +232,31 @@ func NewLogRecord(ch TLSClientHello, fp *Fingerprints) LogRecord {
|
||||
|
||||
return rec
|
||||
}
|
||||
|
||||
// Default values and constants
|
||||
|
||||
const (
|
||||
DefaultInterface = "eth0"
|
||||
DefaultPort = 443
|
||||
DefaultBPFFilter = ""
|
||||
DefaultFlowTimeout = 30 // seconds
|
||||
DefaultPacketBuffer = 1000 // packet channel buffer size
|
||||
)
|
||||
|
||||
// DefaultConfig returns an AppConfig with sensible default values.
|
||||
// Uses eth0 as the default interface, port 443 for monitoring,
|
||||
// no BPF filter, a 30-second flow timeout, and a 1000-packet
|
||||
// channel buffer. Returns an empty outputs slice (caller must
|
||||
// configure outputs explicitly).
|
||||
func DefaultConfig() AppConfig {
|
||||
return AppConfig{
|
||||
Core: Config{
|
||||
Interface: DefaultInterface,
|
||||
ListenPorts: []uint16{DefaultPort},
|
||||
BPFFilter: DefaultBPFFilter,
|
||||
FlowTimeoutSec: DefaultFlowTimeout,
|
||||
PacketBufferSize: DefaultPacketBuffer,
|
||||
},
|
||||
Outputs: []OutputConfig{},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user