paths

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func LibDir(elem ...string) string

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

func Relocate(p string) string

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 Root

func Root() string

Root returns the stateless scratch root ("" when off).

func StateDir

func StateDir(name, def string) string

StateDir returns def normally, and <root>/<name> under the stateless home.

func StateDirSet added in v0.5.8

func StateDirSet() bool

StateDirSet reports whether VIGOLIUM_STATE_DIR names a directory.

func Stateless

func Stateless() bool

Stateless reports whether the stateless home is on.

func UserCacheDir added in v0.5.8

func UserCacheDir(name string) string

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

func VigoliumPath(elem ...string) string

VigoliumPath joins elem under VigoliumDir ("" when that is "").

func Writable

func Writable(dir string) bool

Writable reports whether dir exists (or can be created) and accepts a file. Used to decide whether a cache under HOME can be used in stateless mode.

Types

This section is empty.

Directories

Path Synopsis
Package earlyenv points the embedded libraries' config directories at VIGOLIUM_STATE_DIR before their package init runs.
Package earlyenv points the embedded libraries' config directories at VIGOLIUM_STATE_DIR before their package init runs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL