2020-01-17 19:30:28 +00:00
|
|
|
.\" vim: set spell so=8:
|
2020-08-08 20:08:23 +00:00
|
|
|
.TH yadm 1 "9 August 2020" "2.5.0"
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 12:48:47 +00:00
|
|
|
.SH NAME
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 12:48:47 +00:00
|
|
|
yadm \- Yet Another Dotfiles Manager
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 12:48:47 +00:00
|
|
|
.SH SYNOPSIS
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
.B yadm
|
|
|
|
.I command
|
|
|
|
.RI [ options ]
|
|
|
|
|
|
|
|
.B yadm
|
|
|
|
.I git-command-or-alias
|
|
|
|
.RI [ options ]
|
|
|
|
|
|
|
|
.B yadm
|
|
|
|
init
|
|
|
|
.RB [ -f ]
|
2015-08-29 15:22:41 +00:00
|
|
|
.RB [ -w
|
2019-10-07 13:36:32 +00:00
|
|
|
.IR dir ]
|
2015-07-14 21:39:52 +00:00
|
|
|
|
|
|
|
.B yadm
|
|
|
|
.RI clone " url
|
|
|
|
.RB [ -f ]
|
|
|
|
.RB [ -w
|
2019-10-07 13:36:32 +00:00
|
|
|
.IR dir ]
|
|
|
|
.RB [ -b
|
|
|
|
.IR branch ]
|
2017-02-01 00:00:06 +00:00
|
|
|
.RB [ --bootstrap ]
|
|
|
|
.RB [ --no-bootstrap ]
|
2015-07-14 21:39:52 +00:00
|
|
|
|
|
|
|
.B yadm
|
|
|
|
.RI config " name
|
|
|
|
.RI [ value ]
|
|
|
|
|
|
|
|
.B yadm
|
|
|
|
config
|
|
|
|
.RB [ -e ]
|
|
|
|
|
|
|
|
.B yadm
|
|
|
|
list
|
|
|
|
.RB [ -a ]
|
|
|
|
|
2017-02-01 00:00:06 +00:00
|
|
|
.BR yadm " bootstrap
|
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
.BR yadm " encrypt
|
|
|
|
|
|
|
|
.BR yadm " decrypt
|
2015-07-17 01:57:53 +00:00
|
|
|
.RB [ -l ]
|
2015-07-14 21:39:52 +00:00
|
|
|
|
|
|
|
.BR yadm " alt
|
|
|
|
|
|
|
|
.BR yadm " perms
|
2017-04-06 12:30:28 +00:00
|
|
|
|
2019-12-16 14:06:52 +00:00
|
|
|
.BR yadm " enter [ command ]
|
|
|
|
|
2019-12-16 14:25:11 +00:00
|
|
|
.BR yadm " git-crypt [ options ]
|
|
|
|
|
2020-02-21 14:15:58 +00:00
|
|
|
.BR yadm " transcrypt [ options ]
|
|
|
|
|
2019-10-22 22:47:41 +00:00
|
|
|
.BR yadm " upgrade
|
|
|
|
|
2017-04-06 12:30:28 +00:00
|
|
|
.BR yadm " introspect
|
|
|
|
.I category
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 12:48:47 +00:00
|
|
|
.SH DESCRIPTION
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2019-10-05 17:01:48 +00:00
|
|
|
yadm is a tool for managing a collection of files across multiple computers,
|
2015-07-14 21:39:52 +00:00
|
|
|
using a shared Git repository.
|
2019-10-05 17:01:48 +00:00
|
|
|
In addition, yadm provides a feature to select alternate versions of files for
|
|
|
|
particular systems.
|
|
|
|
Lastly, yadm supplies the ability to manage a subset of secure files, which are
|
2015-07-14 21:39:52 +00:00
|
|
|
encrypted before they are included in the repository.
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
.SH COMMANDS
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
.TP
|
|
|
|
.IR git-command " or " git-alias
|
2019-10-05 17:01:48 +00:00
|
|
|
Any command not internally handled by yadm is passed through to
|
2015-07-14 21:39:52 +00:00
|
|
|
.BR git (1).
|
2019-10-05 17:01:48 +00:00
|
|
|
Git commands or aliases are invoked with the yadm managed repository.
|
2017-03-30 21:30:49 +00:00
|
|
|
The working directory for Git commands will be the configured
|
2015-07-14 21:39:52 +00:00
|
|
|
.IR work-tree " (usually
|
|
|
|
.IR $HOME ).
|
|
|
|
|
|
|
|
Dotfiles are managed by using standard
|
|
|
|
.B git
|
|
|
|
commands;
|
|
|
|
.IR add ,
|
|
|
|
.IR commit ,
|
|
|
|
.IR push ,
|
|
|
|
.IR pull ,
|
|
|
|
etc.
|
|
|
|
|
|
|
|
.RI The " config
|
|
|
|
command is not passed directly through.
|
|
|
|
Instead use the
|
|
|
|
.I gitconfig
|
|
|
|
command (see below).
|
|
|
|
.TP
|
|
|
|
.B alt
|
2019-10-02 23:59:57 +00:00
|
|
|
Create symbolic links and process templates for any managed files matching the
|
|
|
|
naming rules described in the ALTERNATES and TEMPLATES sections. It is usually
|
2019-10-05 17:01:48 +00:00
|
|
|
unnecessary to run this command, as yadm automatically processes alternates by
|
|
|
|
default. This automatic behavior can be disabled by setting the configuration
|
2015-07-14 21:39:52 +00:00
|
|
|
.I yadm.auto-alt
|
|
|
|
to "false".
|
|
|
|
.TP
|
2017-02-01 00:00:06 +00:00
|
|
|
.B bootstrap
|
|
|
|
Execute
|
2019-08-06 13:19:45 +00:00
|
|
|
.I $HOME/.config/yadm/bootstrap
|
2017-02-01 00:00:06 +00:00
|
|
|
if it exists.
|
|
|
|
.TP
|
2015-07-14 21:39:52 +00:00
|
|
|
.BI clone " url
|
|
|
|
Clone a remote repository for tracking dotfiles.
|
|
|
|
After the contents of the remote repository have been fetched, a "merge" of
|
2020-11-28 17:23:46 +00:00
|
|
|
the remote HEAD branch is attempted.
|
2015-07-14 21:39:52 +00:00
|
|
|
If there are conflicting files already present in the
|
|
|
|
.IR work-tree ,
|
2020-11-28 17:23:46 +00:00
|
|
|
this merge will fail and instead a "reset" of the remote HEAD branch
|
2017-02-01 00:00:06 +00:00
|
|
|
will be done, followed by a "stash". This "stash" operation will preserve the
|
|
|
|
original data.
|
|
|
|
|
|
|
|
You can review the stashed conflicts by running the command
|
2015-07-14 21:39:52 +00:00
|
|
|
|
|
|
|
.RS
|
|
|
|
.RS
|
2017-02-01 00:00:06 +00:00
|
|
|
yadm stash show -p
|
2015-07-14 21:39:52 +00:00
|
|
|
.RE
|
2017-02-01 00:00:06 +00:00
|
|
|
|
|
|
|
from within your
|
|
|
|
.I $HOME
|
|
|
|
directory. If you want to restore the stashed data, you can run
|
|
|
|
|
|
|
|
.RS
|
|
|
|
yadm stash apply
|
|
|
|
.RE
|
|
|
|
or
|
|
|
|
.RS
|
|
|
|
yadm stash pop
|
2015-07-14 21:39:52 +00:00
|
|
|
.RE
|
2017-02-01 00:00:06 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
The repository is stored in
|
2020-11-17 22:22:17 +00:00
|
|
|
.IR $HOME/.local/share/yadm/repo.git .
|
2015-07-14 21:39:52 +00:00
|
|
|
By default,
|
|
|
|
.I $HOME
|
|
|
|
will be used as the
|
|
|
|
.IR work-tree ,
|
|
|
|
but this can be overridden with the
|
|
|
|
.BR -w " option.
|
2019-10-05 17:01:48 +00:00
|
|
|
yadm can be forced to overwrite an existing repository by providing the
|
2015-07-14 21:39:52 +00:00
|
|
|
.BR -f " option.
|
2020-11-28 17:23:46 +00:00
|
|
|
If you want to use a branch other than the remote HEAD branch
|
2019-10-07 13:36:32 +00:00
|
|
|
you can specify it using the
|
|
|
|
.BR -b " option.
|
2019-10-05 17:01:48 +00:00
|
|
|
By default yadm will ask the user if the bootstrap program should be run (if it
|
|
|
|
exists). The options
|
2017-02-01 00:00:06 +00:00
|
|
|
.BR --bootstrap " or " --no-bootstrap
|
|
|
|
will either force the bootstrap to be run, or prevent it from being run,
|
|
|
|
without prompting the user.
|
|
|
|
.RE
|
2015-07-14 21:39:52 +00:00
|
|
|
.TP
|
|
|
|
.B config
|
2019-10-05 17:01:48 +00:00
|
|
|
This command manages configurations for yadm.
|
2020-06-11 00:49:01 +00:00
|
|
|
This command works exactly the way
|
2015-07-14 21:39:52 +00:00
|
|
|
.BR git-config (1)
|
|
|
|
does.
|
|
|
|
See the CONFIGURATION section for more details.
|
|
|
|
.TP
|
|
|
|
.B decrypt
|
|
|
|
Decrypt all files stored in
|
2020-11-17 22:22:17 +00:00
|
|
|
.IR $HOME/.local/share/yadm/archive .
|
2015-07-14 21:39:52 +00:00
|
|
|
Files decrypted will be relative to the configured
|
|
|
|
.IR work-tree " (usually
|
|
|
|
.IR $HOME ).
|
2015-07-17 01:57:53 +00:00
|
|
|
Using the
|
|
|
|
.B -l
|
|
|
|
option will list the files stored without extracting them.
|
2015-07-14 21:39:52 +00:00
|
|
|
.TP
|
|
|
|
.B encrypt
|
|
|
|
Encrypt all files matching the patterns found in
|
2019-08-06 13:19:45 +00:00
|
|
|
.IR $HOME/.config/yadm/encrypt .
|
2015-07-14 21:39:52 +00:00
|
|
|
See the ENCRYPTION section for more details.
|
|
|
|
.TP
|
2017-03-21 10:53:13 +00:00
|
|
|
.B enter
|
2017-03-31 21:27:17 +00:00
|
|
|
Run a sub-shell with all Git variables set. Exit the sub-shell the same way you
|
|
|
|
leave your normal shell (usually with the "exit" command). This sub-shell can
|
2019-10-05 17:01:48 +00:00
|
|
|
be used to easily interact with your yadm repository using "git" commands. This
|
2019-12-08 20:39:03 +00:00
|
|
|
could be useful if you are using a tool which uses Git directly, such as tig,
|
|
|
|
vim-fugitive, git-cola, etc.
|
2019-11-16 21:26:50 +00:00
|
|
|
|
2019-12-08 20:39:03 +00:00
|
|
|
Optionally, you can provide a command after "enter", and instead of invoking
|
|
|
|
your shell, that command will be run with all of the Git variables exposed to
|
|
|
|
the command's environment.
|
|
|
|
|
|
|
|
Emacs Tramp and Magit can manage files by using this configuration:
|
2019-11-16 21:26:50 +00:00
|
|
|
|
2017-03-21 10:53:13 +00:00
|
|
|
.RS
|
|
|
|
(add-to-list 'tramp-methods
|
2017-03-30 21:30:44 +00:00
|
|
|
'("yadm"
|
|
|
|
(tramp-login-program "yadm")
|
|
|
|
(tramp-login-args (("enter")))
|
2019-11-16 02:52:31 +00:00
|
|
|
(tramp-login-env (("SHELL") ("/bin/sh")))
|
2017-03-30 21:30:44 +00:00
|
|
|
(tramp-remote-shell "/bin/sh")
|
|
|
|
(tramp-remote-shell-args ("-c"))))
|
2017-03-21 10:53:13 +00:00
|
|
|
.RE
|
2019-11-16 21:26:50 +00:00
|
|
|
|
|
|
|
.RS
|
|
|
|
With this config, use (magit-status "/yadm::"). If you find issue with Emacs 27 and zsh,
|
2019-11-16 02:52:31 +00:00
|
|
|
trying running (setenv "SHELL" "/bin/bash").
|
2019-11-16 21:26:50 +00:00
|
|
|
.RE
|
2017-03-21 10:53:13 +00:00
|
|
|
.TP
|
2019-12-16 14:25:11 +00:00
|
|
|
.BI git-crypt " options
|
|
|
|
If git-crypt is installed, this command allows you to pass options directly to
|
|
|
|
git-crypt, with the environment configured to use the yadm repository.
|
|
|
|
|
|
|
|
git-crypt enables transparent encryption and decryption of files in a git repository.
|
|
|
|
You can read
|
|
|
|
https://github.com/AGWA/git-crypt
|
|
|
|
for details.
|
|
|
|
.TP
|
2015-07-14 21:39:52 +00:00
|
|
|
.B gitconfig
|
|
|
|
Pass options to the
|
|
|
|
.B git config
|
2019-10-05 17:01:48 +00:00
|
|
|
command. Since yadm already uses the
|
2015-07-14 21:39:52 +00:00
|
|
|
.I config
|
|
|
|
command to manage its own configurations,
|
2019-10-05 17:01:48 +00:00
|
|
|
this command is provided as a way to change configurations of the repository
|
|
|
|
managed by yadm.
|
|
|
|
One useful case might be to configure the repository so untracked files are
|
|
|
|
shown in status commands. yadm initially configures its repository so that
|
|
|
|
untracked files are not shown.
|
|
|
|
If you wish use the default Git behavior (to show untracked files and
|
|
|
|
directories), you can remove this configuration.
|
2015-07-14 21:39:52 +00:00
|
|
|
|
|
|
|
.RS
|
|
|
|
.RS
|
2015-07-26 15:59:13 +00:00
|
|
|
yadm gitconfig --unset status.showUntrackedFiles
|
2015-07-14 21:39:52 +00:00
|
|
|
.RE
|
|
|
|
.RE
|
|
|
|
.TP
|
|
|
|
.B help
|
2019-10-05 17:01:48 +00:00
|
|
|
Print a summary of yadm commands.
|
2015-07-14 21:39:52 +00:00
|
|
|
.TP
|
|
|
|
.B init
|
|
|
|
Initialize a new, empty repository for tracking dotfiles.
|
|
|
|
The repository is stored in
|
2020-11-17 22:22:17 +00:00
|
|
|
.IR $HOME/.local/share/yadm/repo.git .
|
2015-07-14 21:39:52 +00:00
|
|
|
By default,
|
|
|
|
.I $HOME
|
|
|
|
will be used as the
|
|
|
|
.IR work-tree ,
|
|
|
|
but this can be overridden with the
|
|
|
|
.BR -w " option.
|
2019-10-05 17:01:48 +00:00
|
|
|
yadm can be forced to overwrite an existing repository by providing the
|
2015-07-14 21:39:52 +00:00
|
|
|
.BR -f " option.
|
|
|
|
.TP
|
|
|
|
.B list
|
2019-10-05 17:01:48 +00:00
|
|
|
Print a list of files managed by yadm.
|
2015-07-14 21:39:52 +00:00
|
|
|
.RB The " -a
|
|
|
|
option will cause all managed files to be listed.
|
|
|
|
Otherwise, the list will only include files from the current directory or below.
|
|
|
|
.TP
|
2017-04-06 12:30:28 +00:00
|
|
|
.BI introspect " category
|
2019-10-05 17:01:48 +00:00
|
|
|
Report internal yadm data. Supported categories are
|
2017-04-06 12:30:28 +00:00
|
|
|
.IR commands ,
|
|
|
|
.IR configs ,
|
|
|
|
.IR repo,
|
|
|
|
and
|
|
|
|
.IR switches .
|
|
|
|
The purpose of introspection is to support command line completion.
|
|
|
|
.TP
|
2015-07-14 21:39:52 +00:00
|
|
|
.B perms
|
|
|
|
Update permissions as described in the PERMISSIONS section.
|
2019-10-05 17:01:48 +00:00
|
|
|
It is usually unnecessary to run this command, as yadm automatically processes
|
|
|
|
permissions by default. This automatic behavior can be disabled by setting the
|
|
|
|
configuration
|
2015-07-14 21:39:52 +00:00
|
|
|
.I yadm.auto-perms
|
|
|
|
to "false".
|
|
|
|
.TP
|
2020-02-21 14:15:58 +00:00
|
|
|
.BI transcrypt " options
|
|
|
|
If transcrypt is installed, this command allows you to pass options directly to
|
|
|
|
transcrypt, with the environment configured to use the yadm repository.
|
|
|
|
|
|
|
|
transcrypt enables transparent encryption and decryption of files in a git repository.
|
|
|
|
You can read
|
|
|
|
https://github.com/elasticdog/transcrypt
|
|
|
|
for details.
|
|
|
|
.TP
|
2019-10-22 22:47:41 +00:00
|
|
|
.B upgrade
|
2020-11-18 05:01:45 +00:00
|
|
|
Version 3 of yadm uses a different directory for storing data.
|
|
|
|
When you start to use version 3 for the first time, you may see warnings about
|
2019-10-22 22:47:41 +00:00
|
|
|
moving your data to this new directory.
|
|
|
|
The easiest way to accomplish this is by running "yadm upgrade".
|
|
|
|
This command will start by moving your yadm repo to the new path.
|
2020-11-18 05:01:45 +00:00
|
|
|
Next it will move any archive data.
|
|
|
|
If the archive is tracked within your yadm repo, this command will
|
|
|
|
"stage" the renaming of that file in the repo's index.
|
2019-11-08 03:36:53 +00:00
|
|
|
Upgrading will also re-initialize all submodules you have added (otherwise they
|
|
|
|
will be broken when the repo moves).
|
2019-10-22 22:47:41 +00:00
|
|
|
After running "yadm upgrade", you should run "yadm status" to review changes
|
|
|
|
which have been staged, and commit them to your repository.
|
|
|
|
|
|
|
|
You can read
|
2020-11-18 05:01:45 +00:00
|
|
|
https://yadm.io/docs/upgrade_from_2
|
2019-10-22 22:47:41 +00:00
|
|
|
for more information.
|
|
|
|
.TP
|
2015-07-14 21:39:52 +00:00
|
|
|
.B version
|
2019-10-05 17:01:48 +00:00
|
|
|
Print the version of yadm.
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2016-04-18 22:24:04 +00:00
|
|
|
.SH OPTIONS
|
|
|
|
|
2019-10-05 17:01:48 +00:00
|
|
|
yadm supports a set of universal options that alter the paths it uses. The
|
|
|
|
default paths are documented in the FILES section. Any path specified by these
|
|
|
|
options must be fully qualified. If you always want to override one or more of
|
|
|
|
these paths, it may be useful to create an alias for the yadm command.
|
|
|
|
For example, the following alias could be used to override the repository
|
|
|
|
directory.
|
2016-04-18 22:24:04 +00:00
|
|
|
|
|
|
|
.RS
|
|
|
|
alias yadm='yadm --yadm-repo /alternate/path/to/repo'
|
|
|
|
.RE
|
|
|
|
|
|
|
|
The following is the full list of universal options.
|
|
|
|
Each option should be followed by a fully qualified path.
|
|
|
|
.TP
|
|
|
|
.B -Y,--yadm-dir
|
2019-10-05 17:01:48 +00:00
|
|
|
Override the yadm directory.
|
2020-11-17 22:22:17 +00:00
|
|
|
yadm stores its configurations relative to this directory.
|
|
|
|
.TP
|
|
|
|
.B --yadm-data
|
|
|
|
Override the yadm data directory.
|
2019-10-05 17:01:48 +00:00
|
|
|
yadm stores its data relative to this directory.
|
2016-04-18 22:24:04 +00:00
|
|
|
.TP
|
|
|
|
.B --yadm-repo
|
2019-10-05 17:01:48 +00:00
|
|
|
Override the location of the yadm repository.
|
2016-04-18 22:24:04 +00:00
|
|
|
.TP
|
|
|
|
.B --yadm-config
|
2019-10-05 17:01:48 +00:00
|
|
|
Override the location of the yadm configuration file.
|
2016-04-18 22:24:04 +00:00
|
|
|
.TP
|
|
|
|
.B --yadm-encrypt
|
2019-10-05 17:01:48 +00:00
|
|
|
Override the location of the yadm encryption configuration.
|
2016-04-18 22:24:04 +00:00
|
|
|
.TP
|
|
|
|
.B --yadm-archive
|
2019-10-05 17:01:48 +00:00
|
|
|
Override the location of the yadm encrypted files archive.
|
2017-02-01 00:00:06 +00:00
|
|
|
.TP
|
|
|
|
.B --yadm-bootstrap
|
2019-10-05 17:01:48 +00:00
|
|
|
Override the location of the yadm bootstrap program.
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
.SH CONFIGURATION
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2019-10-05 17:01:48 +00:00
|
|
|
yadm uses a configuration file named
|
2019-08-06 13:19:45 +00:00
|
|
|
.IR $HOME/.config/yadm/config .
|
2015-07-14 21:39:52 +00:00
|
|
|
This file uses the same format as
|
|
|
|
.BR git-config (1).
|
|
|
|
Also, you can control the contents of the configuration file
|
|
|
|
via the
|
|
|
|
.B yadm config
|
|
|
|
command (which works exactly like
|
|
|
|
.BR git-config ).
|
|
|
|
For example, to disable alternates you can run the command:
|
|
|
|
|
|
|
|
.RS
|
|
|
|
yadm config yadm.auto-alt false
|
|
|
|
.RE
|
|
|
|
|
|
|
|
The following is the full list of supported configurations:
|
|
|
|
.TP
|
2019-10-09 13:25:02 +00:00
|
|
|
.B yadm.alt-copy
|
|
|
|
If set to "true", alternate files will be copies instead of symbolic links.
|
|
|
|
This might be desirable, because some systems may not properly support
|
|
|
|
symlinks.
|
|
|
|
.TP
|
2015-07-14 21:39:52 +00:00
|
|
|
.B yadm.auto-alt
|
2019-10-05 17:01:48 +00:00
|
|
|
Disable the automatic linking described in the section ALTERNATES. If disabled,
|
|
|
|
you may still run "yadm alt" manually to create the alternate links. This
|
|
|
|
feature is enabled by default.
|
2015-07-14 21:39:52 +00:00
|
|
|
.TP
|
2019-10-15 12:17:38 +00:00
|
|
|
.B yadm.auto-exclude
|
|
|
|
Disable the automatic exclusion of patterns defined in
|
|
|
|
.IR $HOME/.config/yadm/encrypt .
|
|
|
|
This feature is enabled by default.
|
|
|
|
.TP
|
2015-07-14 21:39:52 +00:00
|
|
|
.B yadm.auto-perms
|
|
|
|
Disable the automatic permission changes described in the section PERMISSIONS.
|
|
|
|
If disabled, you may still run
|
|
|
|
.B yadm perms
|
|
|
|
manually to update permissions.
|
|
|
|
This feature is enabled by default.
|
|
|
|
.TP
|
2017-07-17 13:52:06 +00:00
|
|
|
.B yadm.auto-private-dirs
|
|
|
|
Disable the automatic creating of private directories described in the section PERMISSIONS.
|
|
|
|
.TP
|
2020-09-25 17:45:53 +00:00
|
|
|
.B yadm.cipher
|
|
|
|
Configure which encryption system is used by the encrypt/decrypt commands.
|
|
|
|
Valid options are "gpg" and "openssl". The default is "gpg".
|
|
|
|
Detailed information can be found in the section ENCRYPTION.
|
|
|
|
.TP
|
2019-10-09 23:40:25 +00:00
|
|
|
.B yadm.git-program
|
|
|
|
Specify an alternate program to use instead of "git".
|
|
|
|
By default, the first "git" found in $PATH is used.
|
2015-08-07 12:18:22 +00:00
|
|
|
.TP
|
|
|
|
.B yadm.gpg-perms
|
|
|
|
Disable the permission changes to
|
|
|
|
.IR $HOME/.gnupg/* .
|
|
|
|
This feature is enabled by default.
|
2016-04-19 19:56:00 +00:00
|
|
|
.TP
|
2019-10-09 23:40:25 +00:00
|
|
|
.B yadm.gpg-program
|
|
|
|
Specify an alternate program to use instead of "gpg".
|
|
|
|
By default, the first "gpg" found in $PATH is used.
|
|
|
|
.TP
|
2016-04-19 19:56:00 +00:00
|
|
|
.B yadm.gpg-recipient
|
|
|
|
Asymmetrically encrypt files with a gpg public/private key pair.
|
2016-04-21 12:59:43 +00:00
|
|
|
Provide a "key ID" to specify which public key to encrypt with.
|
|
|
|
The key must exist in your public keyrings.
|
2020-01-15 14:07:04 +00:00
|
|
|
Multiple recipients can be specified (separated by space).
|
2016-04-19 19:56:00 +00:00
|
|
|
If left blank or not provided, symmetric encryption is used instead.
|
2016-04-21 12:59:43 +00:00
|
|
|
If set to "ASK", gpg will interactively ask for recipients.
|
|
|
|
See the ENCRYPTION section for more details.
|
|
|
|
This feature is disabled by default.
|
2016-08-13 22:17:16 +00:00
|
|
|
.TP
|
2020-09-25 17:45:53 +00:00
|
|
|
.B yadm.openssl-ciphername
|
|
|
|
Specify which cipher should be used by openssl.
|
|
|
|
"aes-256-cbc" is used by default.
|
|
|
|
.TP
|
|
|
|
.B yadm.openssl-old
|
|
|
|
Newer versions of openssl support the pbkdf2 key derivation function. This is
|
|
|
|
used by default. If this configuration is set to "true", openssl operations
|
|
|
|
will use options compatible with older versions of openssl. If you change this
|
|
|
|
option, you will need to recreate your encrypted archive.
|
|
|
|
.TP
|
|
|
|
.B yadm.openssl-program
|
|
|
|
Specify an alternate program to use instead of "openssl".
|
|
|
|
By default, the first "openssl" found in $PATH is used.
|
|
|
|
.TP
|
2019-10-09 23:40:25 +00:00
|
|
|
.B yadm.ssh-perms
|
|
|
|
Disable the permission changes to
|
|
|
|
.IR $HOME/.ssh/* .
|
|
|
|
This feature is enabled by default.
|
2017-02-01 00:00:06 +00:00
|
|
|
|
|
|
|
.RE
|
2019-10-02 23:59:57 +00:00
|
|
|
The following four "local" configurations are not stored in the
|
2019-08-06 13:19:45 +00:00
|
|
|
.IR $HOME/.config/yadm/config,
|
2017-02-01 00:00:06 +00:00
|
|
|
they are stored in the local repository.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.B local.class
|
2019-10-02 23:59:57 +00:00
|
|
|
Specify a class for the purpose of symlinking alternate files.
|
|
|
|
By default, no class will be matched.
|
2017-02-01 00:00:06 +00:00
|
|
|
.TP
|
|
|
|
.B local.hostname
|
2019-10-02 23:59:57 +00:00
|
|
|
Override the hostname for the purpose of symlinking alternate files.
|
2017-02-01 00:00:06 +00:00
|
|
|
.TP
|
2019-10-09 23:40:25 +00:00
|
|
|
.B local.os
|
|
|
|
Override the OS for the purpose of symlinking alternate files.
|
|
|
|
.TP
|
2017-02-01 00:00:06 +00:00
|
|
|
.B local.user
|
2019-10-02 23:59:57 +00:00
|
|
|
Override the user for the purpose of symlinking alternate files.
|
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
.SH ALTERNATES
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
When managing a set of files across different systems, it can be useful to have
|
|
|
|
an automated way of choosing an alternate version of a file for a different
|
2019-10-02 23:59:57 +00:00
|
|
|
operating system, host, user, etc.
|
|
|
|
|
|
|
|
yadm will automatically create a symbolic link to the appropriate version of a
|
|
|
|
file, when a valid suffix is appended to the filename. The suffix contains
|
|
|
|
the conditions that must be met for that file to be used.
|
|
|
|
|
|
|
|
The suffix begins with "##", followed by any number of conditions separated by
|
|
|
|
commas.
|
|
|
|
|
|
|
|
##<condition>[,<condition>,...]
|
|
|
|
|
|
|
|
Each condition is an attribute/value pair, separated by a period. Some
|
|
|
|
conditions do not require a "value", and in that case, the period and value can
|
2019-10-30 22:34:34 +00:00
|
|
|
be omitted. Most attributes can be abbreviated as a single letter.
|
2019-10-02 23:59:57 +00:00
|
|
|
|
|
|
|
<attribute>[.<value>]
|
|
|
|
|
|
|
|
These are the supported attributes, in the order of the weighted precedence:
|
2015-07-14 21:39:52 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
.TP
|
|
|
|
.BR template , " t
|
|
|
|
Valid when the value matches a supported template processor.
|
|
|
|
See the TEMPLATES section for more details.
|
|
|
|
.TP
|
|
|
|
.BR user , " u
|
|
|
|
Valid if the value matches the current user.
|
|
|
|
Current user is calculated by running
|
|
|
|
.BR "id -u -n" .
|
|
|
|
.TP
|
2019-10-06 16:04:21 +00:00
|
|
|
.BR distro , " d
|
|
|
|
Valid if the value matches the distro.
|
|
|
|
Distro is calculated by running
|
2019-11-30 16:52:18 +00:00
|
|
|
.B "lsb_release -si"
|
|
|
|
or by inspecting the ID from
|
|
|
|
.BR "/etc/os-release" .
|
2019-10-06 16:04:21 +00:00
|
|
|
.TP
|
2019-10-02 23:59:57 +00:00
|
|
|
.BR os , " o
|
|
|
|
Valid if the value matches the OS.
|
|
|
|
OS is calculated by running
|
|
|
|
.BR "uname -s" .
|
|
|
|
.TP
|
|
|
|
.BR class , " c
|
|
|
|
Valid if the value matches the
|
|
|
|
.B local.class
|
|
|
|
configuration.
|
|
|
|
Class must be manually set using
|
|
|
|
.BR "yadm config local.class <class>" .
|
|
|
|
See the CONFIGURATION section for more details about setting
|
|
|
|
.BR local.class .
|
|
|
|
.TP
|
|
|
|
.BR hostname , " h
|
|
|
|
Valid if the value matches the short hostname.
|
|
|
|
Hostname is calculated by running
|
2019-11-30 16:27:28 +00:00
|
|
|
.BR "uname -n" ,
|
2019-10-02 23:59:57 +00:00
|
|
|
and trimming off any domain.
|
|
|
|
.TP
|
|
|
|
.B default
|
|
|
|
Valid when no other alternate is valid.
|
2020-10-18 19:03:46 +00:00
|
|
|
.TP
|
|
|
|
.BR extension , " e
|
|
|
|
A special "condition" that doesn't affect the selection process. Its purpose is
|
|
|
|
instead to allow the alternate file to end with a certain extension to
|
|
|
|
e.g. make editors highlight the content properly.
|
2019-10-02 23:59:57 +00:00
|
|
|
.LP
|
2015-07-14 21:39:52 +00:00
|
|
|
|
2019-11-14 14:23:41 +00:00
|
|
|
.BR NOTE :
|
|
|
|
The OS for "Windows Subsystem for Linux" is reported as "WSL", even
|
|
|
|
though uname identifies as "Linux".
|
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
You may use any number of conditions, in any order.
|
|
|
|
An alternate will only be used if ALL conditions are valid.
|
2019-11-08 03:09:37 +00:00
|
|
|
For all files managed by yadm's repository or listed in
|
2019-08-06 13:19:45 +00:00
|
|
|
.IR $HOME/.config/yadm/encrypt ,
|
2019-10-30 22:34:34 +00:00
|
|
|
if they match this naming convention,
|
2015-07-14 21:39:52 +00:00
|
|
|
symbolic links will be created for the most appropriate version.
|
2019-10-02 23:59:57 +00:00
|
|
|
|
|
|
|
The "most appropriate" version is determined by calculating a score for each
|
|
|
|
version of a file. A template is always scored higher than any symlink
|
|
|
|
condition. The number of conditions is the next largest factor in scoring.
|
|
|
|
Files with more conditions will always be favored. Any invalid condition will
|
|
|
|
disqualify that file completely.
|
|
|
|
|
2019-10-10 13:23:36 +00:00
|
|
|
If you don't care to have all versions of alternates stored in the same
|
|
|
|
directory as the generated symlink, you can place them in the
|
|
|
|
.I $HOME/.config/yadm/alt
|
|
|
|
directory. The generated symlink or processed template will be created using
|
2019-10-30 22:34:34 +00:00
|
|
|
the same relative path.
|
2019-10-10 13:23:36 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
Alternate linking may best be demonstrated by example. Assume the following
|
2019-10-05 17:01:48 +00:00
|
|
|
files are managed by yadm's repository:
|
2015-07-14 21:39:52 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
- $HOME/path/example.txt##default
|
|
|
|
- $HOME/path/example.txt##class.Work
|
|
|
|
- $HOME/path/example.txt##os.Darwin
|
|
|
|
- $HOME/path/example.txt##os.Darwin,hostname.host1
|
|
|
|
- $HOME/path/example.txt##os.Darwin,hostname.host2
|
|
|
|
- $HOME/path/example.txt##os.Linux
|
|
|
|
- $HOME/path/example.txt##os.Linux,hostname.host1
|
|
|
|
- $HOME/path/example.txt##os.Linux,hostname.host2
|
2015-07-14 21:39:52 +00:00
|
|
|
|
|
|
|
If running on a Macbook named "host2",
|
2019-10-05 17:01:48 +00:00
|
|
|
yadm will create a symbolic link which looks like this:
|
2015-07-14 21:39:52 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
.IR $HOME/path/example.txt " -> " $HOME/path/example.txt##os.Darwin,hostname.host2
|
2015-07-14 21:39:52 +00:00
|
|
|
|
2019-10-05 17:01:48 +00:00
|
|
|
However, on another Mackbook named "host3", yadm will create a symbolic link
|
|
|
|
which looks like this:
|
2015-07-14 21:39:52 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
.IR $HOME/path/example.txt " -> " $HOME/path/example.txt##os.Darwin
|
2015-07-14 21:39:52 +00:00
|
|
|
|
|
|
|
Since the hostname doesn't match any of the managed files, the more generic version is chosen.
|
|
|
|
|
2015-07-19 17:06:51 +00:00
|
|
|
If running on a Linux server named "host4", the link will be:
|
2015-07-14 21:39:52 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
.IR $HOME/path/example.txt " -> " $HOME/path/example.txt##os.Linux
|
2015-07-14 21:39:52 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
If running on a Solaris server, the link will use the default version:
|
2015-07-14 21:39:52 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
.IR $HOME/path/example.txt " -> " $HOME/path/example.txt##default
|
2015-07-19 17:06:51 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
If running on a system, with class set to "Work", the link will be:
|
2017-02-01 00:00:06 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
.IR $HOME/path/example.txt " -> " $HOME/path/example.txt##class.Work
|
2017-02-01 00:00:06 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
If no "##default" version exists and no files have valid conditions, then no
|
|
|
|
link will be created.
|
2015-07-19 17:06:51 +00:00
|
|
|
|
2019-10-05 17:01:48 +00:00
|
|
|
Links are also created for directories named this way, as long as they have at
|
|
|
|
least one yadm managed file within them.
|
2016-08-05 21:09:26 +00:00
|
|
|
|
2019-10-05 17:01:48 +00:00
|
|
|
yadm will automatically create these links by default. This can be disabled
|
|
|
|
using the
|
2015-07-14 21:39:52 +00:00
|
|
|
.I yadm.auto-alt
|
|
|
|
configuration.
|
|
|
|
Even if disabled, links can be manually created by running
|
2019-10-02 23:59:57 +00:00
|
|
|
.BR "yadm alt" .
|
2017-02-01 00:00:06 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
Class is a special value which is stored locally on each host (inside the local
|
|
|
|
repository). To use alternate symlinks using class, you must set the value of
|
2017-02-01 00:00:06 +00:00
|
|
|
class using the configuration
|
|
|
|
.BR local.class .
|
2019-10-05 17:01:48 +00:00
|
|
|
This is set like any other yadm configuration with the
|
2017-02-01 00:00:06 +00:00
|
|
|
.B yadm config
|
2019-10-02 23:59:57 +00:00
|
|
|
command. The following sets the class to be "Work".
|
2017-02-01 00:00:06 +00:00
|
|
|
|
|
|
|
yadm config local.class Work
|
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
Similarly, the values of os, hostname, and user can be manually overridden
|
2017-02-01 00:00:06 +00:00
|
|
|
using the configuration options
|
|
|
|
.BR local.os ,
|
|
|
|
.BR local.hostname ,
|
|
|
|
and
|
|
|
|
.BR local.user .
|
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
.SH TEMPLATES
|
|
|
|
|
|
|
|
If a template condition is defined in an alternate file's "##" suffix, and the
|
|
|
|
necessary dependencies for the template are available, then the file will be
|
|
|
|
processed to create or overwrite files.
|
|
|
|
|
|
|
|
Supported template processors:
|
|
|
|
.TP
|
2019-10-30 22:34:34 +00:00
|
|
|
.B default
|
2019-10-05 17:01:48 +00:00
|
|
|
This is yadm's built-in template processor. This processor is very basic, with
|
|
|
|
a Jinja-like syntax. The advantage of this processor is that it only depends
|
|
|
|
upon
|
|
|
|
.BR awk ,
|
|
|
|
which is available on most *nix systems. To use this processor,
|
2019-10-30 22:34:34 +00:00
|
|
|
specify the value of "default" or just leave the value off (e.g. "##template").
|
2019-10-02 23:59:57 +00:00
|
|
|
.TP
|
2020-07-08 06:45:33 +00:00
|
|
|
.B ESH
|
|
|
|
ESH is a template processor written in POSIX compliant shell. It allows
|
|
|
|
executing shell commands within templates. This can be used to reference your
|
|
|
|
own configurations within templates, for example:
|
|
|
|
|
|
|
|
<% yadm config mysection.myconfig %>
|
|
|
|
|
|
|
|
To use the ESH template processor, specify the value of "esh"
|
2020-05-20 02:27:14 +00:00
|
|
|
.TP
|
2019-10-02 23:59:57 +00:00
|
|
|
.B j2cli
|
|
|
|
To use the j2cli Jinja template processor, specify the value of "j2" or
|
|
|
|
"j2cli".
|
|
|
|
.TP
|
2017-03-31 05:30:36 +00:00
|
|
|
.B envtpl
|
2019-10-02 23:59:57 +00:00
|
|
|
To use the envtpl Jinja template processor, specify the value of "j2" or "envtpl".
|
|
|
|
.LP
|
|
|
|
|
|
|
|
.BR NOTE :
|
|
|
|
Specifying "j2" as the processor will attempt to use j2cli or envtpl, whichever
|
|
|
|
is available.
|
2017-03-25 18:26:10 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
If the template processor specified is available, templates will be processed
|
|
|
|
to create or overwrite files.
|
2017-03-25 18:26:10 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
During processing, the following variables are available in the template:
|
2017-03-25 18:26:10 +00:00
|
|
|
|
2020-07-08 06:45:33 +00:00
|
|
|
Default Jinja or ESH Description
|
2019-10-02 23:59:57 +00:00
|
|
|
------------- ------------- --------------------------
|
|
|
|
yadm.class YADM_CLASS Locally defined yadm class
|
|
|
|
yadm.distro YADM_DISTRO lsb_release -si
|
2019-11-30 16:27:28 +00:00
|
|
|
yadm.hostname YADM_HOSTNAME uname -n (without domain)
|
2019-10-02 23:59:57 +00:00
|
|
|
yadm.os YADM_OS uname -s
|
|
|
|
yadm.user YADM_USER id -u -n
|
2019-10-10 13:09:31 +00:00
|
|
|
yadm.source YADM_SOURCE Template filename
|
2017-03-25 18:26:10 +00:00
|
|
|
|
2019-11-14 14:23:41 +00:00
|
|
|
.BR NOTE :
|
|
|
|
The OS for "Windows Subsystem for Linux" is reported as "WSL", even
|
|
|
|
though uname identifies as "Linux".
|
|
|
|
|
2019-11-30 16:52:18 +00:00
|
|
|
.BR NOTE :
|
|
|
|
If lsb_release is not available, DISTRO will be the ID specified in
|
|
|
|
/etc/os-release.
|
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
Examples:
|
2017-07-07 13:23:45 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
.I whatever##template
|
2017-03-31 05:30:36 +00:00
|
|
|
with the following content
|
2017-03-25 18:26:10 +00:00
|
|
|
|
2020-10-10 08:15:41 +00:00
|
|
|
{% if yadm.user == "harvey" %}
|
2019-10-02 23:59:57 +00:00
|
|
|
config={{yadm.class}}-{{yadm.os}}
|
|
|
|
{% else %}
|
2017-03-31 05:30:36 +00:00
|
|
|
config=dev-whatever
|
2020-10-09 13:36:58 +00:00
|
|
|
{% include "whatever.extra" %}
|
2019-10-02 23:59:57 +00:00
|
|
|
{% endif %}
|
2017-03-25 18:26:10 +00:00
|
|
|
|
2017-03-31 05:30:36 +00:00
|
|
|
would output a file named
|
|
|
|
.I whatever
|
|
|
|
with the following content if the user is "harvey":
|
2017-03-25 18:26:10 +00:00
|
|
|
|
2017-03-31 05:30:36 +00:00
|
|
|
config=work-Linux
|
2017-03-25 18:26:10 +00:00
|
|
|
|
2020-10-09 13:36:58 +00:00
|
|
|
and the following otherwise (if
|
|
|
|
.I whatever.extra
|
|
|
|
contains admin=false):
|
2017-03-25 18:26:10 +00:00
|
|
|
|
2017-03-31 05:30:36 +00:00
|
|
|
config=dev-whatever
|
2020-10-09 13:36:58 +00:00
|
|
|
admin=false
|
2017-03-25 18:26:10 +00:00
|
|
|
|
2019-10-02 23:59:57 +00:00
|
|
|
An equivalent Jinja template named
|
|
|
|
.I whatever##template.j2
|
|
|
|
would look like:
|
|
|
|
|
|
|
|
{% if YADM_USER == 'harvey' -%}
|
|
|
|
config={{YADM_CLASS}}-{{YADM_OS}}
|
|
|
|
{% else -%}
|
|
|
|
config=dev-whatever
|
2020-10-09 13:36:58 +00:00
|
|
|
{% include 'whatever.extra' %}
|
2019-10-02 23:59:57 +00:00
|
|
|
{% endif -%}
|
2017-03-25 18:26:10 +00:00
|
|
|
|
2020-07-08 06:45:33 +00:00
|
|
|
An equivalent ESH templated named
|
2020-05-20 02:27:14 +00:00
|
|
|
.I whatever##template.esh
|
|
|
|
would look like:
|
|
|
|
|
|
|
|
<% if [ "$YADM_USER" = "harvey" ]; then -%>
|
|
|
|
config=<%= $YADM_CLASS %>-<%= $YADM_OS %>
|
|
|
|
<% else -%>
|
|
|
|
config=dev-whatever
|
2020-10-09 13:36:58 +00:00
|
|
|
<%+ whatever.extra %>
|
2020-05-20 02:27:14 +00:00
|
|
|
<% fi -%>
|
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
.SH ENCRYPTION
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-08-07 12:18:22 +00:00
|
|
|
It can be useful to manage confidential files, like SSH or GPG keys, across
|
|
|
|
multiple systems. However, doing so would put plain text data into a Git
|
2019-10-05 17:01:48 +00:00
|
|
|
repository, which often resides on a public system. yadm can make it easy to
|
|
|
|
encrypt and decrypt a set of files so the encrypted version can be maintained
|
|
|
|
in the Git repository.
|
2020-09-25 17:45:53 +00:00
|
|
|
This feature will only work if a supported tool is available.
|
|
|
|
Both
|
2015-07-14 21:39:52 +00:00
|
|
|
.BR gpg (1)
|
2020-09-25 17:45:53 +00:00
|
|
|
and
|
|
|
|
.BR openssl (1)
|
|
|
|
are supported.
|
|
|
|
gpg is used by default, but openssl can be configured with the
|
|
|
|
.I yadm.cypher
|
|
|
|
configuration.
|
2015-07-14 21:39:52 +00:00
|
|
|
|
|
|
|
To use this feature, a list of patterns must be created and saved as
|
2019-08-06 13:19:45 +00:00
|
|
|
.IR $HOME/.config/yadm/encrypt .
|
2015-07-14 21:39:52 +00:00
|
|
|
This list of patterns should be relative to the configured
|
|
|
|
.IR work-tree " (usually
|
|
|
|
.IR $HOME ).
|
|
|
|
For example:
|
|
|
|
|
|
|
|
.RS
|
2015-08-07 12:18:22 +00:00
|
|
|
.ssh/*.key
|
|
|
|
.gnupg/*.gpg
|
2015-07-14 21:39:52 +00:00
|
|
|
.RE
|
|
|
|
|
2019-11-26 22:59:19 +00:00
|
|
|
Standard filename expansions (*, ?, [) are supported.
|
|
|
|
If you have Bash version 4, you may use "**" to match all subdirectories.
|
|
|
|
Other shell expansions like brace and tilde are not supported.
|
|
|
|
Spaces in paths are supported, and should not be quoted.
|
|
|
|
If a directory is specified, its contents will be included, but not recursively.
|
|
|
|
Paths beginning with a "!" will be excluded.
|
2017-10-24 12:38:13 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
The
|
|
|
|
.B yadm encrypt
|
|
|
|
command will find all files matching the patterns, and prompt for a password. Once a
|
|
|
|
password has confirmed, the matching files will be encrypted and saved as
|
2020-11-17 22:22:17 +00:00
|
|
|
.IR $HOME/.local/share/yadm/archive .
|
2020-09-25 15:03:27 +00:00
|
|
|
The "encrypt" and "archive" files should be added to the yadm repository so they are
|
2019-10-05 17:01:48 +00:00
|
|
|
available across multiple systems.
|
2015-07-14 21:39:52 +00:00
|
|
|
|
|
|
|
To decrypt these files later, or on another system run
|
2019-10-02 23:59:57 +00:00
|
|
|
.B yadm decrypt
|
2015-07-14 21:39:52 +00:00
|
|
|
and provide the correct password.
|
|
|
|
After files are decrypted, permissions are automatically updated as described
|
|
|
|
in the PERMISSIONS section.
|
|
|
|
|
2016-04-21 12:59:43 +00:00
|
|
|
Symmetric encryption is used by default, but asymmetric encryption may be
|
|
|
|
enabled using the
|
|
|
|
.I yadm.gpg-recipient
|
|
|
|
configuration.
|
|
|
|
|
2015-07-17 07:29:20 +00:00
|
|
|
.BR NOTE :
|
2015-07-19 18:01:52 +00:00
|
|
|
It is recommended that you use a private repository when keeping confidential
|
|
|
|
files, even though they are encrypted.
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2019-10-15 12:17:38 +00:00
|
|
|
Patterns found in
|
|
|
|
.I $HOME/.config/yadm/encrypt
|
|
|
|
are automatically added to the repository's
|
|
|
|
.I info/exclude
|
|
|
|
file every time
|
|
|
|
.B yadm encrypt
|
|
|
|
is run.
|
|
|
|
This is to prevent accidentally committing sensitive data to the repository.
|
|
|
|
This can be disabled using the
|
|
|
|
.I yadm.auto-exclude
|
|
|
|
configuration.
|
|
|
|
|
2020-09-25 17:21:10 +00:00
|
|
|
.B Using transcrypt or git-crypt
|
2019-12-16 14:25:11 +00:00
|
|
|
|
2020-09-25 17:21:10 +00:00
|
|
|
A completely separate option for encrypting data is to install and use
|
|
|
|
transcrypt or git-crypt.
|
|
|
|
Once installed, you can use these tools by running
|
|
|
|
.B "yadm transcrypt"
|
|
|
|
or
|
2019-12-16 14:25:11 +00:00
|
|
|
.BR "yadm git-crypt" .
|
2020-09-25 17:21:10 +00:00
|
|
|
These tools enables transparent encryption and decryption of files in a git
|
|
|
|
repository. See the following web sites for more information:
|
|
|
|
|
|
|
|
- https://github.com/elasticdog/transcrypt
|
|
|
|
|
|
|
|
- https://github.com/AGWA/git-crypt
|
2019-12-16 14:25:11 +00:00
|
|
|
.LP
|
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
.SH PERMISSIONS
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
When files are checked out of a Git repository, their initial permissions are
|
2019-10-05 17:01:48 +00:00
|
|
|
dependent upon the user's umask. Because of this, yadm will automatically
|
|
|
|
update the permissions of some file paths. The "group" and "others" permissions
|
|
|
|
will be removed from the following files:
|
2015-07-14 21:39:52 +00:00
|
|
|
|
2020-11-17 22:22:17 +00:00
|
|
|
.RI - " $HOME/.local/share/yadm/archive
|
2015-07-14 21:39:52 +00:00
|
|
|
|
|
|
|
- All files matching patterns in
|
2019-08-06 13:19:45 +00:00
|
|
|
.I $HOME/.config/yadm/encrypt
|
2015-07-14 21:39:52 +00:00
|
|
|
|
|
|
|
- The SSH directory and files,
|
|
|
|
.I .ssh/*
|
|
|
|
|
2015-08-07 12:18:22 +00:00
|
|
|
- The GPG directory and files,
|
|
|
|
.I .gnupg/*
|
|
|
|
|
2019-10-05 17:01:48 +00:00
|
|
|
yadm will automatically update permissions by default. This can be disabled
|
|
|
|
using the
|
2015-07-14 21:39:52 +00:00
|
|
|
.I yadm.auto-perms
|
2017-07-17 13:52:06 +00:00
|
|
|
configuration. Even if disabled, permissions can be manually updated by running
|
2019-10-02 23:59:57 +00:00
|
|
|
.BR "yadm perms" .
|
2017-07-17 13:52:06 +00:00
|
|
|
The
|
|
|
|
.I .ssh
|
|
|
|
directory processing can be disabled using the
|
2015-07-14 21:39:52 +00:00
|
|
|
.I yadm.ssh-perms
|
2017-07-17 13:52:06 +00:00
|
|
|
configuration. The
|
|
|
|
.I .gnupg
|
|
|
|
directory processing can be disabled using the
|
|
|
|
.I yadm.gpg-perms
|
|
|
|
configuration.
|
|
|
|
|
|
|
|
When cloning a repo which includes data in a
|
|
|
|
.IR .ssh " or " .gnupg
|
2019-10-05 17:01:48 +00:00
|
|
|
directory, if those directories do not exist at the time of cloning, yadm will
|
|
|
|
create the directories with mask 0700 prior to merging the fetched data into
|
|
|
|
the work-tree.
|
2017-07-17 13:52:06 +00:00
|
|
|
|
|
|
|
When running a Git command and
|
|
|
|
.IR .ssh " or " .gnupg
|
2019-10-05 17:01:48 +00:00
|
|
|
directories do not exist, yadm will create those directories with mask 0700
|
|
|
|
prior to running the Git command. This can be disabled using the
|
2017-07-17 13:52:06 +00:00
|
|
|
.I yadm.auto-private-dirs
|
2015-07-14 21:39:52 +00:00
|
|
|
configuration.
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2017-07-07 02:53:23 +00:00
|
|
|
.SH HOOKS
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2019-10-05 17:01:48 +00:00
|
|
|
For every command yadm supports, a program can be provided to run before or
|
|
|
|
after that command. These are referred to as "hooks". yadm looks for hooks in
|
|
|
|
the directory
|
2019-08-06 13:19:45 +00:00
|
|
|
.IR $HOME/.config/yadm/hooks .
|
2017-07-07 02:53:23 +00:00
|
|
|
Each hook is named using a prefix of
|
|
|
|
.I pre_
|
|
|
|
or
|
|
|
|
.IR post_ ,
|
|
|
|
followed by the command which should trigger the hook. For
|
|
|
|
example, to create a hook which is run after every
|
|
|
|
.I yadm pull
|
|
|
|
command, create a hook named
|
|
|
|
.IR post_pull.
|
|
|
|
Hooks must have the executable file permission set.
|
|
|
|
|
|
|
|
If a
|
|
|
|
.I pre_
|
2019-10-05 17:01:48 +00:00
|
|
|
hook is defined, and the hook terminates with a non-zero exit status, yadm will
|
|
|
|
refuse to run the yadm command. For example, if a
|
2017-07-07 02:53:23 +00:00
|
|
|
.I pre_commit
|
|
|
|
hook is defined, but that command ends with a non-zero exit status, the
|
|
|
|
.I yadm commit
|
|
|
|
will never be run. This allows one to "short-circuit" any operation using a
|
|
|
|
.I pre_
|
|
|
|
hook.
|
|
|
|
|
|
|
|
Hooks have the following environment variables available to them at runtime:
|
|
|
|
.TP
|
|
|
|
.B YADM_HOOK_COMMAND
|
|
|
|
The command which triggered the hook
|
|
|
|
.TP
|
|
|
|
.B YADM_HOOK_EXIT
|
2019-10-05 17:01:48 +00:00
|
|
|
The exit status of the yadm command
|
2017-07-07 02:53:23 +00:00
|
|
|
.TP
|
|
|
|
.B YADM_HOOK_FULL_COMMAND
|
2020-01-27 13:35:09 +00:00
|
|
|
The yadm command with all command line arguments (parameters are space
|
|
|
|
delimited, and any space, tab or backslash will be escaped with a backslash)
|
2017-07-07 02:53:23 +00:00
|
|
|
.TP
|
|
|
|
.B YADM_HOOK_REPO
|
2019-10-05 17:01:48 +00:00
|
|
|
The path to the yadm repository
|
2017-07-07 02:53:23 +00:00
|
|
|
.TP
|
|
|
|
.B YADM_HOOK_WORK
|
|
|
|
The path to the work-tree
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
.SH FILES
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2019-10-05 17:01:48 +00:00
|
|
|
All of yadm's configurations are relative to the "yadm directory".
|
|
|
|
yadm uses the "XDG Base Directory Specification" to determine this directory.
|
|
|
|
If the environment variable
|
2019-10-02 23:59:57 +00:00
|
|
|
.B $XDG_CONFIG_HOME
|
|
|
|
is defined as a fully qualified path, this directory will be
|
|
|
|
.IR "$XDG_CONFIG_HOME/yadm" .
|
|
|
|
Otherwise it will be
|
|
|
|
.IR "$HOME/.config/yadm" .
|
|
|
|
|
2020-11-17 22:22:17 +00:00
|
|
|
Similarly, yadm's data files are relative to the "yadm data directory".
|
|
|
|
yadm uses the "XDG Base Directory Specification" to determine this directory.
|
|
|
|
If the environment variable
|
|
|
|
.B $XDG_DATA_HOME
|
|
|
|
is defined as a fully qualified path, this directory will be
|
|
|
|
.IR "$XDG_DATA_HOME/yadm" .
|
|
|
|
Otherwise it will be
|
|
|
|
.IR "$HOME/.local/share/yadm" .
|
|
|
|
|
2019-10-05 17:01:48 +00:00
|
|
|
The following are the default paths yadm uses for its own data.
|
2019-10-10 13:23:36 +00:00
|
|
|
Most of these paths can be altered using universal options.
|
2016-04-18 22:24:04 +00:00
|
|
|
See the OPTIONS section for details.
|
|
|
|
.TP
|
2019-08-06 13:19:45 +00:00
|
|
|
.I $HOME/.config/yadm
|
2020-11-17 22:22:17 +00:00
|
|
|
The yadm directory. By default, all configs yadm stores is relative to this
|
|
|
|
directory.
|
|
|
|
.TP
|
|
|
|
.I $HOME/.local/share/yadm
|
|
|
|
The yadm data directory. By default, all data yadm stores is relative to this
|
2019-10-05 17:01:48 +00:00
|
|
|
directory.
|
2015-07-14 21:39:52 +00:00
|
|
|
.TP
|
2016-04-18 22:24:04 +00:00
|
|
|
.I $YADM_DIR/config
|
2019-10-05 17:01:48 +00:00
|
|
|
Configuration file for yadm.
|
2015-07-14 21:39:52 +00:00
|
|
|
.TP
|
2019-10-10 13:23:36 +00:00
|
|
|
.I $YADM_DIR/alt
|
|
|
|
This is a directory to keep "alternate files" without having them side-by-side
|
|
|
|
with the resulting symlink or processed template. Alternate files placed in
|
|
|
|
this directory will be created relative to $HOME instead.
|
|
|
|
.TP
|
2020-11-17 22:22:17 +00:00
|
|
|
.I $YADM_DATA/repo.git
|
2019-10-05 17:01:48 +00:00
|
|
|
Git repository used by yadm.
|
2015-07-14 21:39:52 +00:00
|
|
|
.TP
|
2016-04-18 22:24:04 +00:00
|
|
|
.I $YADM_DIR/encrypt
|
2015-07-14 21:39:52 +00:00
|
|
|
List of globs used for encrypt/decrypt
|
|
|
|
.TP
|
2020-11-17 22:22:17 +00:00
|
|
|
.I $YADM_DATA/archive
|
2015-07-14 21:39:52 +00:00
|
|
|
All files encrypted with
|
|
|
|
.B yadm encrypt
|
|
|
|
are stored in this file.
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
.SH EXAMPLES
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
.TP
|
|
|
|
.B yadm init
|
|
|
|
Create an empty repo for managing files
|
|
|
|
.TP
|
|
|
|
.B yadm add .bash_profile ; yadm commit
|
|
|
|
Add
|
|
|
|
.I .bash_profile
|
|
|
|
to the Git index and create a new commit
|
|
|
|
.TP
|
|
|
|
.B yadm remote add origin <url>
|
|
|
|
Add a remote origin to an existing repository
|
|
|
|
.TP
|
|
|
|
.B yadm push -u origin master
|
|
|
|
Initial push of master to origin
|
|
|
|
.TP
|
2019-08-06 13:19:45 +00:00
|
|
|
.B echo ".ssh/*.key" >> $HOME/.config/yadm/encrypt
|
2015-07-14 21:39:52 +00:00
|
|
|
Add a new pattern to the list of encrypted files
|
|
|
|
.TP
|
2020-11-17 22:22:17 +00:00
|
|
|
.B yadm encrypt ; yadm add ~/.local/share/yadm/archive ; yadm commit
|
2015-07-14 21:39:52 +00:00
|
|
|
Commit a new set of encrypted files
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 12:48:47 +00:00
|
|
|
.SH REPORTING BUGS
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
Report issues or create pull requests at GitHub:
|
|
|
|
|
2016-09-08 13:08:22 +00:00
|
|
|
https://github.com/TheLocehiliosan/yadm/issues
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 12:48:47 +00:00
|
|
|
.SH AUTHOR
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
Tim Byrne <sultan@locehilios.com>
|
2019-10-02 23:59:57 +00:00
|
|
|
|
2015-07-14 21:39:52 +00:00
|
|
|
.SH SEE ALSO
|
|
|
|
|
|
|
|
.BR git (1),
|
|
|
|
.BR gpg (1)
|
2020-09-25 17:45:53 +00:00
|
|
|
.BR openssl (1)
|
|
|
|
.BR transcrypt (1)
|
|
|
|
.BR git-crypt (1)
|
2015-07-14 21:39:52 +00:00
|
|
|
|
2019-08-06 13:19:45 +00:00
|
|
|
https://yadm.io/
|