Skip to content
/ snapk Public

Snapper pre-post commit hook for apk (Alpine Package Keeper)

Notifications You must be signed in to change notification settings

wuvz/snapk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snapk

snapk is a bash script providing snapper pre-post snapshots for Alpine Package Keeper as a commit hook. It was originally inspired by snap-xbps for Void Linux.

Installation

Simply run # make install to install snapk and # make uninstall to do the opposite. Default installation prefix is /usr/local.

Configuration

Default snapk configuration is located at /etc/snapk.conf. The only parameters are:

  • ABORT_ON_FAIL - Abort apk transaction if snapk fails (default: "yes")
  • DESC_LIMIT - Number of characters to be shown in snapshot descrition (default: 72)
  • INCLUDE - List of snapper configs to include OR "all" (default: "root")
  • IGNORE - List of snapper configs to ignore OR empty (default: "")

Most of those parameters can be overriden with environment variables:

  • SNAPK_SKIP - Skip snapk if variable is set
  • SNAPK_CONFIG - Path to snapk configuration file (default: "/etc/snapk.conf")
  • SNAPK_ABORT - Same as $ABORT_ON_FAIL
  • SNAPK_INCLUDE - Same as $INCLUDE
  • SNAPK_IGNORE - Same as $IGNORE

In order to specify one of them apk must be launched with --preserve-env flag. If launching apk requires elevated privilleges (the usual case), some additional steps might be taken. For instance, when using doas utility one must provide setenv { ... } option in doas.conf containing all the variables that will be transfered into fresh environment. Example configuration can be found in doas.conf.example.

About

Snapper pre-post commit hook for apk (Alpine Package Keeper)

Resources

Stars

Watchers

Forks

Packages

No packages published