Documentation
¶
Overview ¶
Package paths holds the process-wide "stateless home" switch.
`-S/--stateless` on a scan-driving command promises that the run leaves no config or state in $HOME: it may READ caches (an already-extracted browser or jstangle, installed nuclei templates), but every file it would otherwise write under ~/.vigolium (bootstrap config, profiles, database, init marker, update-check cache, native-sessions liveness, materialized wordlists) goes to a per-process scratch directory instead, and a download that would land in HOME (template clone, Chrome for Testing) fails closed with a clear error.
The CLI enables it in PersistentPreRunE; packages that write state consult Stateless/StateDir. The embedded nuclei/uncover libraries create their config directories at package init, before any flag is parsed; only VIGOLIUM_STATE_DIR moves them (state_dir.go, earlyenv).
Index ¶
- Constants
- func EnableStateless(root string)
- func LibDir(elem ...string) string
- func NucleiTemplatesDir() string
- func Relocate(p string) string
- func Root() string
- func StateDir(name, def string) string
- func StateDirSet() bool
- func Stateless() bool
- func UserCacheDir(name string) string
- func VigoliumDir() string
- func VigoliumPath(elem ...string) string
- func Writable(dir string) bool
Constants ¶
const StateDirEnv = "VIGOLIUM_STATE_DIR"
StateDirEnv relocates everything vigolium writes. Unset, vigolium keeps its state where it always lives under $HOME:
~/.vigolium/ config, default DB, presets, projects, active-project,
sessions, native-sessions/, replay jars, markers
~/.cache/<name>/ caches (Chrome for Testing, spitolas, jstangle, audit)
~/nuclei-templates/ the known-issue templates
Set, every one of those lives under the variable's directory instead:
$VIGOLIUM_STATE_DIR/ what ~/.vigolium holds
$VIGOLIUM_STATE_DIR/cache/<name>/ what ~/.cache/<name> holds
$VIGOLIUM_STATE_DIR/nuclei-templates/ the templates
$VIGOLIUM_STATE_DIR/lib/ the embedded nuclei/uncover libraries'
config dirs (internal/paths/earlyenv)
so a driver that sets it can run vigolium against a read-only or disposable HOME and find every byte vigolium wrote in one tree.
Variables ¶
This section is empty.
Functions ¶
func EnableStateless ¶
func EnableStateless(root string)
EnableStateless switches the process to the stateless home rooted at root (a scratch directory the caller owns). An empty root disables it.
func LibDir ¶ added in v0.5.8
LibDir is where earlyenv points the embedded libraries' config dirs under VIGOLIUM_STATE_DIR ("" when the variable is unset).
func NucleiTemplatesDir ¶ added in v0.5.8
func NucleiTemplatesDir() string
NucleiTemplatesDir is the default nuclei templates directory: $VIGOLIUM_STATE_DIR/nuclei-templates when the variable is set, else ~/nuclei-templates. "" when neither resolves.
func Relocate ¶ added in v0.5.8
Relocate rewrites a "~/"-relative path that names vigolium state (~/.vigolium, ~/.cache, ~/nuclei-templates and anything under them) onto VIGOLIUM_STATE_DIR, and returns every other path unchanged. Unset, it is the identity, so the caller's "~" expansion applies as before. Config defaults spell their paths "~/.vigolium/...", so routing ExpandPath through here moves every configured default at once.
func StateDirSet ¶ added in v0.5.8
func StateDirSet() bool
StateDirSet reports whether VIGOLIUM_STATE_DIR names a directory.
func UserCacheDir ¶ added in v0.5.8
UserCacheDir is the cache directory ~/.cache/<name> names: $VIGOLIUM_STATE_DIR/cache/<name> when the variable is set. "" when neither resolves.
func VigoliumDir ¶ added in v0.5.8
func VigoliumDir() string
VigoliumDir is the directory ~/.vigolium names: VIGOLIUM_STATE_DIR when set, else ~/.vigolium. It is "" only when neither the variable nor the home directory resolves.
func VigoliumPath ¶ added in v0.5.8
VigoliumPath joins elem under VigoliumDir ("" when that is "").
Types ¶
This section is empty.