paths

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 2 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 owns the single source of truth for "where does the agent put its files." It resolves a base directory (the install dir) from a layered set of sources so callers can stop deriving ~/.stepsecurity independently:

  1. --install-dir CLI flag (set by main via SetOverride)
  2. $STEPSECURITY_HOME environment variable (set by service unit / loader)
  3. install_dir config field (loaded by internal/config)
  4. ~/.stepsecurity (legacy default)

config.json itself stays at the legacy location regardless — see internal/config.LegacyDir — so the agent can always bootstrap. All other files (logs, hook errors, the binary placed by the loader) live under Home().

Index

Constants

View Source
const HomeEnvVar = "STEPSECURITY_HOME"

HomeEnvVar is the environment variable consulted in resolution step 2. Service installers bake this into their unit files so scheduler-invoked runs see the same install dir as interactive ones.

Variables

This section is empty.

Functions

func Home

func Home() string

Home returns the resolved install dir. Falls back to LegacyHome when nothing else is set. Empty string is possible only when the home directory itself cannot be resolved.

func LegacyHome

func LegacyHome() string

LegacyHome returns ~/.stepsecurity. Exposed for the migration check in main and for ShowConfigure displays. Mirrors config.LegacyDir but kept here so callers can grab the legacy path without taking a package dependency on config.

func SetOverride

func SetOverride(s string)

SetOverride installs the CLI-flag value. Called by main after cli.Parse and before any code that calls Home() — see cmd/stepsecurity-dev-machine-guard/main.go.

Types

This section is empty.

Jump to

Keyboard shortcuts

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