Skip to main content

Configuration

odirscan uses three configuration structs, each with a Default*() constructor that provides sensible defaults. All fields are public and can be set programmatically.

ScannerConfig

Controls the crawling and filtering behavior.

FieldTypeDefaultDescription
Parallelismint32Number of concurrent HTTP requests
RequestTimeouttime.Duration15sPer-request HTTP timeout
ProxyCountint50Maximum number of Mullvad proxies to select
MaxRelayWeightint99Upper bound (inclusive) for relay weight filter
SkipMimeTypePrefixes[]stringimage, font, text/css, audio, videoMIME type prefixes whose files are excluded from findings
SkipSubdirKeywords[]string.git, .svn, .hg, node_modules, bower_components, venv, vendor, __pycache__, site-packages, .cache, .ideaSubstrings that cause a subdirectory to be skipped
cfg := config.DefaultScannerConfig()
cfg.Parallelism = 64
cfg.RequestTimeout = 30 * time.Second

MullvadConfig

Controls the Mullvad relay list and proxy settings.

FieldTypeDefaultDescription
RelayURLstringhttps://api.mullvad.net/public/relays/wireguard/v2Mullvad relay list API endpoint
DataFilestringrelays.jsonPath to the cached relay list on disk
MetaFilestringrelays.meta.jsonPath to the cached relay metadata on disk
ProxyPortint1080SOCKS5 port on Mullvad relay hosts
UpdateIntervaltime.Duration1hHow often to refresh the relay list
cfg := config.DefaultMullvadConfig()
cfg.UpdateInterval = 30 * time.Minute

WebConfig

Controls the web server.

FieldTypeDefaultDescription
ListenAddrstring:8080TCP address to listen on
cfg := config.DefaultWebConfig()
cfg.ListenAddr = ":3000"