scripts

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemLog = "/var/lib/komizo/system.log"

	// AccessLog is where the generated site blocks write. See alpine.sh.
	AccessLog = "/srv/_proxy/logs/access.log"
)

Where the sampler writes and how much it keeps.

Here rather than in the app package because the two scripts that read and write this file are here, and a path that lives apart from the only things that use it is a value two places have to agree about.

Variables

View Source
var AlpineInitScript string
View Source
var AlpineProxyScript string
View Source
var AlpineRemoveScript string
View Source
var AlpineScript string

Functions

func Inventory added in v0.0.12

func Inventory() string

Inventory is one tab-separated record per app, plus the box itself.

func Metrics added in v0.0.12

func Metrics(from, to int64) string

Metrics totals the requests in a range, per app, off the proxy's access log.

func Sampler added in v0.0.12

func Sampler() string

Sampler is the per-minute script exactly as it lands on the box.

func SamplerInstall added in v0.0.12

func SamplerInstall(stamp, version string) string

SamplerInstall writes the sampler onto the box and puts it in cron.

version is the komizo release doing the installing and stamp is the content hash of what it writes. Both are recorded so the interface can answer two different questions: which komizo set this box up, and would running the update change anything.

func ShQuote added in v0.0.12

func ShQuote(s string) string

ShQuote wraps a value for a shell command line.

Single quotes, with any single quote in the value closed, escaped and reopened -- the one form that is safe for arbitrary text in POSIX sh.

Exported and living HERE because this is the package that builds shell. The app package had its own copy; it now calls this one, so there is a single definition of the rule that makes every quoted value in this tool safe.

func Storage added in v0.0.12

func Storage(app string) string

Storage measures one app's volumes with du, now.

The app name is SHELL-QUOTED rather than interpolated bare: it is the only value here that comes from a caller rather than from a constant in this file. The app package validates it too, but that made the safety of this line depend on a rule enforced in another package -- the same argument shQuote carries there.

func SystemLogRange added in v0.0.12

func SystemLogRange(from, to int64) string

SystemLogRange reads back what the sampler wrote in a range.

Types

This section is empty.

Jump to

Keyboard shortcuts

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