Documentation
¶
Overview ¶
Package envconfig owns every environment variable the agent reads. Each name has a Key* constant; accessors re-read on every call so flags can flip without a restart. System env vars (PATH, KUBECONFIG, ...) stay at callsites.
Index ¶
- Constants
- func APIKey() string
- func APIServer() string
- func AgentDBDir() string
- func AgentDBLogCapMB() string
- func AgentDBMetricCapMB() string
- func AgentName() string
- func AgentNetwork() string
- func AgentNetworkLegacy() string
- func AgentNetworkLegacyOrDefault() string
- func AgentOutput() string
- func ChunkParallelism() string
- func DisableDiagnosticUpload() bool
- func KeepOutputFiles() bool
- func LocalK8s() bool
- func MetricsAddr() string
- func ProxyURL() string
- func ReportingConfigPath() string
- func ScanLogUploadEnabled() bool
- func ScanParallelism() string
- func TeamID() string
- func UpdateURL() string
- func Verbose() bool
Constants ¶
const ( KeyAPIKey = "PDCP_API_KEY" KeyTeamID = "PDCP_TEAM_ID" KeyAPIServer = "PDCP_API_SERVER" KeyUpdateURL = "PDCP_UPDATE_URL" DefaultAPIServer = "https://api.projectdiscovery.io" )
const ( KeyAgentName = "PDCP_AGENT_NAME" KeyAgentNetwork = "PDCP_AGENT_NETWORK" KeyAgentNetworkAlt = "AGENT_NETWORK" // legacy alias; PDCP_AGENT_NETWORK wins KeyAgentOutput = "PDCP_AGENT_OUTPUT" DefaultAgentNetwork = "default" )
const ( KeyChunkParallelism = "PDCP_CHUNK_PARALLELISM" KeyScanParallelism = "PDCP_SCAN_PARALLELISM" DefaultScanParallelism = "1" )
const ( KeyAgentDBDir = "PDCP_AGENTDB_DIR" KeyAgentDBLogCapMB = "PDCP_AGENTDB_LOG_CAP_MB" KeyAgentDBMetricCapMB = "PDCP_AGENTDB_METRIC_CAP_MB" )
const ( KeyVerbose = "PDCP_VERBOSE" KeyKeepOutputFiles = "PDCP_KEEP_OUTPUT_FILES" KeyLocalK8s = "LOCAL_K8S" KeyDisableDiagnosticUpload = "PDCP_DISABLE_DIAGNOSTIC_UPLOAD" KeyEnableScanLogUpload = "PDCP_ENABLE_SCAN_LOG_UPLOAD" )
const KeyMetricsAddr = "PDCP_METRICS_ADDR"
const KeyProxyURL = "PROXY_URL"
const KeyReportingConfig = "PDCP_REPORTING_CONFIG"
Variables ¶
This section is empty.
Functions ¶
func AgentDBDir ¶
func AgentDBDir() string
AgentDBDir overrides the local observability DB directory.
func AgentDBLogCapMB ¶
func AgentDBLogCapMB() string
AgentDBLogCapMB returns the log ring-buffer cap in MB.
func AgentDBMetricCapMB ¶
func AgentDBMetricCapMB() string
AgentDBMetricCapMB returns the metric ring-buffer cap in MB.
func AgentNetworkLegacy ¶
func AgentNetworkLegacy() string
AgentNetworkLegacy returns the older AGENT_NETWORK alias.
func AgentNetworkLegacyOrDefault ¶
func AgentNetworkLegacyOrDefault() string
AgentNetworkLegacyOrDefault returns AGENT_NETWORK or DefaultAgentNetwork.
func ChunkParallelism ¶
func ChunkParallelism() string
ChunkParallelism returns the raw value; empty means auto-detect.
func DisableDiagnosticUpload ¶
func DisableDiagnosticUpload() bool
DisableDiagnosticUpload disables shipping the SQLite DB to GCS at shutdown.
func KeepOutputFiles ¶
func KeepOutputFiles() bool
KeepOutputFiles preserves per-chunk output files after upload.
func LocalK8s ¶
func LocalK8s() bool
LocalK8s switches to KUBECONFIG instead of the in-cluster service account. Strict "true" match: ParseBool would let LOCAL_K8S=1 flip to a path that fails silently when KUBECONFIG is unset.
func MetricsAddr ¶
func MetricsAddr() string
MetricsAddr returns the Prometheus bind address; empty disables the server.
func ReportingConfigPath ¶
func ReportingConfigPath() string
ReportingConfigPath returns a local nuclei -rc YAML path. When set, it overrides the reporting config in the work message, keeping tracker credentials off the platform.
func ScanLogUploadEnabled ¶
func ScanLogUploadEnabled() bool
ScanLogUploadEnabled is off by default so agents without scan-log storage provisioned don't hammer the API with rejected uploads.
func ScanParallelism ¶
func ScanParallelism() string
ScanParallelism returns PDCP_SCAN_PARALLELISM or "1".
Types ¶
This section is empty.