2015-07-17 00:38:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## NAME
|
|
|
|
yadm - Yet Another Dotfiles Manager
|
|
|
|
|
|
|
|
## SYNOPSIS
|
|
|
|
yadm command [options]
|
|
|
|
|
|
|
|
yadm git-command-or-alias [options]
|
|
|
|
|
2015-08-29 15:22:41 +00:00
|
|
|
yadm init [-f] [-w directory]
|
2015-07-17 00:38:43 +00:00
|
|
|
|
2017-02-10 22:32:07 +00:00
|
|
|
yadm clone url [-f] [-w directory] [--bootstrap] [--no-bootstrap]
|
2015-07-17 00:38:43 +00:00
|
|
|
|
|
|
|
yadm config name [value]
|
|
|
|
|
|
|
|
yadm config [-e]
|
|
|
|
|
|
|
|
yadm list [-a]
|
|
|
|
|
2017-02-10 22:32:07 +00:00
|
|
|
yadm bootstrap
|
|
|
|
|
2015-07-17 00:38:43 +00:00
|
|
|
yadm encrypt
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
yadm enter
|
|
|
|
|
2015-07-17 01:57:53 +00:00
|
|
|
yadm decrypt [-l]
|
2015-07-17 00:38:43 +00:00
|
|
|
|
|
|
|
yadm alt
|
|
|
|
|
|
|
|
yadm perms
|
|
|
|
|
2017-05-04 12:22:48 +00:00
|
|
|
yadm introspect category
|
|
|
|
|
2015-07-17 00:38:43 +00:00
|
|
|
## DESCRIPTION
|
|
|
|
yadm is a tool for managing a collection of files across multiple com-
|
|
|
|
puters, using a shared Git repository. In addition, yadm provides a
|
2017-01-10 11:01:37 +00:00
|
|
|
feature to select alternate versions of files based on the operating
|
2015-07-17 00:38:43 +00:00
|
|
|
system or host name. Lastly, yadm supplies the ability to manage a
|
|
|
|
subset of secure files, which are encrypted before they are included in
|
|
|
|
the repository.
|
|
|
|
|
|
|
|
## COMMANDS
|
|
|
|
git-command or git-alias
|
|
|
|
Any command not internally handled by yadm is passed through to
|
|
|
|
git(1). Git commands or aliases are invoked with the yadm man-
|
2017-04-03 12:09:32 +00:00
|
|
|
aged repository. The working directory for Git commands will be
|
2015-07-17 00:38:43 +00:00
|
|
|
the configured work-tree (usually $HOME).
|
|
|
|
|
|
|
|
Dotfiles are managed by using standard git commands; add, com-
|
|
|
|
mit, push, pull, etc.
|
|
|
|
|
|
|
|
The config command is not passed directly through. Instead use
|
|
|
|
the gitconfig command (see below).
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
alt Create symbolic links and process Jinja templates for any man-
|
|
|
|
aged files matching the naming rules described in the ALTERNATES
|
|
|
|
and JINJA sections. It is usually unnecessary to run this com-
|
|
|
|
mand, as yadm automatically processes alternates by default.
|
|
|
|
This automatic behavior can be disabled by setting the configu-
|
|
|
|
ration yadm.auto-alt to "false".
|
2015-07-17 00:38:43 +00:00
|
|
|
|
2017-02-10 22:32:07 +00:00
|
|
|
bootstrap
|
|
|
|
Execute $HOME/.yadm/bootstrap if it exists.
|
|
|
|
|
2015-07-17 00:38:43 +00:00
|
|
|
clone url
|
|
|
|
Clone a remote repository for tracking dotfiles. After the con-
|
2017-04-03 12:09:32 +00:00
|
|
|
tents of the remote repository have been fetched, a "merge" of
|
|
|
|
origin/master is attempted. If there are conflicting files
|
|
|
|
already present in the work-tree, this merge will fail and
|
|
|
|
instead a "reset" of origin/master will be done, followed by a
|
2017-02-10 22:32:07 +00:00
|
|
|
"stash". This "stash" operation will preserve the original data.
|
|
|
|
|
|
|
|
You can review the stashed conflicts by running the command
|
2015-07-17 00:38:43 +00:00
|
|
|
|
2017-02-10 22:32:07 +00:00
|
|
|
yadm stash show -p
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
from within your $HOME directory. If you want to restore the
|
2017-02-10 22:32:07 +00:00
|
|
|
stashed data, you can run
|
|
|
|
|
|
|
|
yadm stash apply
|
|
|
|
or
|
|
|
|
yadm stash pop
|
2015-07-17 00:38:43 +00:00
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
The repository is stored in $HOME/.yadm/repo.git. By default,
|
|
|
|
$HOME will be used as the work-tree, but this can be overridden
|
2015-07-17 00:38:43 +00:00
|
|
|
with the -w option. yadm can be forced to overwrite an existing
|
2017-02-10 22:32:07 +00:00
|
|
|
repository by providing the -f option. By default yadm will ask
|
2017-04-03 12:09:32 +00:00
|
|
|
the user if the bootstrap program should be run (if it exists).
|
|
|
|
The options --bootstrap or --no-bootstrap will either force the
|
|
|
|
bootstrap to be run, or prevent it from being run, without
|
2017-02-10 22:32:07 +00:00
|
|
|
prompting the user.
|
2015-07-17 00:38:43 +00:00
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
config This command manages configurations for yadm. This command
|
|
|
|
works exactly they way git-config(1) does. See the CONFIGURA-
|
2015-07-17 00:38:43 +00:00
|
|
|
TION section for more details.
|
|
|
|
|
|
|
|
decrypt
|
2017-04-03 12:09:32 +00:00
|
|
|
Decrypt all files stored in $HOME/.yadm/files.gpg. Files
|
|
|
|
decrypted will be relative to the configured work-tree (usually
|
|
|
|
$HOME). Using the -l option will list the files stored without
|
2015-07-17 01:57:53 +00:00
|
|
|
extracting them.
|
2015-07-17 00:38:43 +00:00
|
|
|
|
|
|
|
encrypt
|
2017-04-03 12:09:32 +00:00
|
|
|
Encrypt all files matching the patterns found in
|
|
|
|
$HOME/.yadm/encrypt. See the ENCRYPTION section for more
|
2015-07-17 00:38:43 +00:00
|
|
|
details.
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
enter 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 be used to easily interact
|
|
|
|
with your yadm repository using "git" commands. This could be
|
|
|
|
useful if you are using a tool which uses Git directly. For
|
|
|
|
example, Emacs Tramp and Magit can manage files by using this
|
|
|
|
configuration:
|
|
|
|
(add-to-list 'tramp-methods
|
|
|
|
'("yadm"
|
|
|
|
(tramp-login-program "yadm")
|
|
|
|
(tramp-login-args (("enter")))
|
|
|
|
(tramp-remote-shell "/bin/sh")
|
|
|
|
(tramp-remote-shell-args ("-c"))))
|
|
|
|
|
2015-07-17 00:38:43 +00:00
|
|
|
gitconfig
|
2017-04-03 12:09:32 +00:00
|
|
|
Pass options to the git config command. Since yadm already uses
|
|
|
|
the config command to manage its own configurations, this com-
|
2015-07-17 00:38:43 +00:00
|
|
|
mand is provided as a way to change configurations of the repos-
|
2017-04-03 12:09:32 +00:00
|
|
|
itory managed by yadm. One useful case might be to configure
|
|
|
|
the repository so untracked files are shown in status commands.
|
2015-07-26 21:56:22 +00:00
|
|
|
yadm initially configures its repository so that untracked files
|
2017-04-03 12:09:32 +00:00
|
|
|
are not shown. If you wish use the default Git behavior (to
|
|
|
|
show untracked files and directories), you can remove this con-
|
2015-07-26 21:56:22 +00:00
|
|
|
figuration.
|
2015-07-17 00:38:43 +00:00
|
|
|
|
2015-07-26 21:56:22 +00:00
|
|
|
yadm gitconfig --unset status.showUntrackedFiles
|
2015-07-17 00:38:43 +00:00
|
|
|
|
|
|
|
help Print a summary of yadm commands.
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
init Initialize a new, empty repository for tracking dotfiles. The
|
2015-07-17 00:38:43 +00:00
|
|
|
repository is stored in $HOME/.yadm/repo.git. By default, $HOME
|
2017-04-03 12:09:32 +00:00
|
|
|
will be used as the work-tree, but this can be overridden with
|
|
|
|
the -w option. yadm can be forced to overwrite an existing
|
2015-07-17 00:38:43 +00:00
|
|
|
repository by providing the -f option.
|
|
|
|
|
|
|
|
list Print a list of files managed by yadm. The -a option will cause
|
2017-04-03 12:09:32 +00:00
|
|
|
all managed files to be listed. Otherwise, the list will only
|
2015-07-17 00:38:43 +00:00
|
|
|
include files from the current directory or below.
|
|
|
|
|
2017-05-04 12:22:48 +00:00
|
|
|
introspect category
|
|
|
|
Report internal yadm data. Supported categories are commands,
|
|
|
|
configs, repo, and switches. The purpose of introspection is to
|
|
|
|
support command line completion.
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
perms Update permissions as described in the PERMISSIONS section. It
|
|
|
|
is usually unnecessary to run this command, as yadm automati-
|
2015-07-17 00:38:43 +00:00
|
|
|
cally processes permissions by default. This automatic behavior
|
2017-04-03 12:09:32 +00:00
|
|
|
can be disabled by setting the configuration yadm.auto-perms to
|
2015-07-17 00:38:43 +00:00
|
|
|
"false".
|
|
|
|
|
|
|
|
version
|
|
|
|
Print the version of yadm.
|
|
|
|
|
2016-04-18 22:24:04 +00:00
|
|
|
## OPTIONS
|
2017-04-03 12:09:32 +00:00
|
|
|
yadm supports a set of universal options that alter the paths it uses.
|
2016-04-18 22:24:04 +00:00
|
|
|
The default paths are documented in the FILES section. Any path speci-
|
2017-04-03 12:09:32 +00:00
|
|
|
fied 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
|
2016-04-18 22:24:04 +00:00
|
|
|
used to override the repository directory.
|
|
|
|
|
|
|
|
alias yadm='yadm --yadm-repo /alternate/path/to/repo'
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
The following is the full list of universal options. Each option
|
2016-04-18 22:24:04 +00:00
|
|
|
should be followed by a fully qualified path.
|
|
|
|
|
|
|
|
-Y,--yadm-dir
|
2017-04-03 12:09:32 +00:00
|
|
|
Override the yadm directory. yadm stores its data relative to
|
2016-04-18 22:24:04 +00:00
|
|
|
this directory.
|
|
|
|
|
|
|
|
--yadm-repo
|
|
|
|
Override the location of the yadm repository.
|
|
|
|
|
|
|
|
--yadm-config
|
|
|
|
Override the location of the yadm configuration file.
|
|
|
|
|
|
|
|
--yadm-encrypt
|
|
|
|
Override the location of the yadm encryption configuration.
|
|
|
|
|
|
|
|
--yadm-archive
|
|
|
|
Override the location of the yadm encrypted files archive.
|
|
|
|
|
2017-02-10 22:32:07 +00:00
|
|
|
--yadm-bootstrap
|
|
|
|
Override the location of the yadm bootstrap program.
|
|
|
|
|
2015-07-17 00:38:43 +00:00
|
|
|
## CONFIGURATION
|
2017-04-03 12:09:32 +00:00
|
|
|
yadm uses a configuration file named $HOME/.yadm/config. This file
|
|
|
|
uses the same format as git-config(1). Also, you can control the con-
|
|
|
|
tents of the configuration file via the yadm config command (which
|
2015-07-17 00:38:43 +00:00
|
|
|
works exactly like git-config). For example, to disable alternates you
|
|
|
|
can run the command:
|
|
|
|
|
|
|
|
yadm config yadm.auto-alt false
|
|
|
|
|
|
|
|
The following is the full list of supported configurations:
|
|
|
|
|
|
|
|
yadm.auto-alt
|
2017-04-03 12:09:32 +00:00
|
|
|
Disable the automatic linking described in the section ALTER-
|
2015-07-17 00:38:43 +00:00
|
|
|
NATES. If disabled, you may still run yadm alt manually to cre-
|
|
|
|
ate the alternate links. This feature is enabled by default.
|
|
|
|
|
|
|
|
yadm.auto-perms
|
2017-04-03 12:09:32 +00:00
|
|
|
Disable the automatic permission changes described in the sec-
|
|
|
|
tion PERMISSIONS. If disabled, you may still run yadm perms
|
|
|
|
manually to update permissions. This feature is enabled by
|
2015-07-17 00:38:43 +00:00
|
|
|
default.
|
|
|
|
|
|
|
|
yadm.ssh-perms
|
|
|
|
Disable the permission changes to $HOME/.ssh/*. This feature is
|
|
|
|
enabled by default.
|
|
|
|
|
2015-08-12 05:56:36 +00:00
|
|
|
yadm.gpg-perms
|
2017-04-03 12:09:32 +00:00
|
|
|
Disable the permission changes to $HOME/.gnupg/*. This feature
|
2015-08-12 05:56:36 +00:00
|
|
|
is enabled by default.
|
|
|
|
|
2016-04-19 19:56:00 +00:00
|
|
|
yadm.gpg-recipient
|
|
|
|
Asymmetrically encrypt files with a gpg public/private key pair.
|
2017-04-03 12:09:32 +00:00
|
|
|
Provide a "key ID" to specify which public key to encrypt with.
|
|
|
|
The key must exist in your public keyrings. If left blank or
|
|
|
|
not provided, symmetric encryption is used instead. If set to
|
|
|
|
"ASK", gpg will interactively ask for recipients. See the
|
|
|
|
ENCRYPTION section for more details. This feature is disabled
|
2016-04-21 12:59:43 +00:00
|
|
|
by default.
|
2016-04-19 19:56:00 +00:00
|
|
|
|
2016-09-08 13:08:22 +00:00
|
|
|
yadm.gpg-program
|
2017-04-03 12:09:32 +00:00
|
|
|
Specify an alternate program to use instead of "gpg". By
|
2016-09-08 13:08:22 +00:00
|
|
|
default, the first "gpg" found in $PATH is used.
|
|
|
|
|
2017-01-12 23:15:24 +00:00
|
|
|
yadm.git-program
|
2017-04-03 12:09:32 +00:00
|
|
|
Specify an alternate program to use instead of "git". By
|
2017-01-12 23:15:24 +00:00
|
|
|
default, the first "git" found in $PATH is used.
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
These last four "local" configurations are not stored in the
|
2017-02-10 22:32:07 +00:00
|
|
|
$HOME/.yadm/config, they are stored in the local repository.
|
|
|
|
|
|
|
|
|
|
|
|
local.class
|
2017-04-03 12:09:32 +00:00
|
|
|
Specify a CLASS for the purpose of symlinking alternate files.
|
2017-02-10 22:32:07 +00:00
|
|
|
By default, no CLASS will be matched.
|
|
|
|
|
|
|
|
local.os
|
|
|
|
Override the OS for the purpose of symlinking alternate files.
|
|
|
|
|
|
|
|
local.hostname
|
2017-04-03 12:09:32 +00:00
|
|
|
Override the HOSTNAME for the purpose of symlinking alternate
|
2017-02-10 22:32:07 +00:00
|
|
|
files.
|
|
|
|
|
|
|
|
local.user
|
|
|
|
Override the USER for the purpose of symlinking alternate files.
|
|
|
|
|
2015-07-17 00:38:43 +00:00
|
|
|
## ALTERNATES
|
|
|
|
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
|
2017-01-10 11:01:37 +00:00
|
|
|
a different operating system, host, or user. yadm implements a feature
|
2016-01-09 03:47:17 +00:00
|
|
|
which will automatically create a symbolic link to the appropriate ver-
|
2017-04-03 12:09:32 +00:00
|
|
|
sion of a file, as long as you follow a specific naming convention.
|
2017-02-10 22:32:07 +00:00
|
|
|
yadm can detect files with names ending in any of the following:
|
2015-07-17 00:38:43 +00:00
|
|
|
|
2017-02-10 22:32:07 +00:00
|
|
|
##
|
|
|
|
##CLASS
|
|
|
|
##CLASS.OS
|
|
|
|
##CLASS.OS.HOSTNAME
|
|
|
|
##CLASS.OS.HOSTNAME.USER
|
|
|
|
##OS
|
|
|
|
##OS.HOSTNAME
|
|
|
|
##OS.HOSTNAME.USER
|
2015-07-17 00:38:43 +00:00
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
If there are any files managed by yadm's repository, or listed in
|
2017-01-12 23:15:24 +00:00
|
|
|
$HOME/.yadm/encrypt, which match this naming convention, symbolic links
|
2017-04-03 12:09:32 +00:00
|
|
|
will be created for the most appropriate version. This may best be
|
|
|
|
demonstrated by example. Assume the following files are managed by
|
2017-01-12 23:15:24 +00:00
|
|
|
yadm's repository:
|
2015-07-17 00:38:43 +00:00
|
|
|
|
2015-07-19 17:06:51 +00:00
|
|
|
- $HOME/path/example.txt##
|
2017-02-10 22:32:07 +00:00
|
|
|
- $HOME/path/example.txt##Work
|
2015-07-17 00:38:43 +00:00
|
|
|
- $HOME/path/example.txt##Darwin
|
|
|
|
- $HOME/path/example.txt##Darwin.host1
|
|
|
|
- $HOME/path/example.txt##Darwin.host2
|
|
|
|
- $HOME/path/example.txt##Linux
|
|
|
|
- $HOME/path/example.txt##Linux.host1
|
|
|
|
- $HOME/path/example.txt##Linux.host2
|
|
|
|
|
|
|
|
If running on a Macbook named "host2", yadm will create a symbolic link
|
|
|
|
which looks like this:
|
|
|
|
|
|
|
|
$HOME/path/example.txt -> $HOME/path/example.txt##Darwin.host2
|
|
|
|
|
|
|
|
However, on another Mackbook named "host3", yadm will create a symbolic
|
|
|
|
link which looks like this:
|
|
|
|
|
|
|
|
$HOME/path/example.txt -> $HOME/path/example.txt##Darwin
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
Since the hostname doesn't match any of the managed files, the more
|
2015-07-17 00:38:43 +00:00
|
|
|
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-17 00:38:43 +00:00
|
|
|
|
|
|
|
$HOME/path/example.txt -> $HOME/path/example.txt##Linux
|
|
|
|
|
2015-07-19 17:06:51 +00:00
|
|
|
If running on a Solaris server, the link use the default "##" version:
|
2015-07-17 00:38:43 +00:00
|
|
|
|
2015-07-19 17:06:51 +00:00
|
|
|
$HOME/path/example.txt -> $HOME/path/example.txt##
|
|
|
|
|
2017-02-10 22:32:07 +00:00
|
|
|
If running on a system, with CLASS set to "Work", the link will be:
|
|
|
|
|
|
|
|
$HOME/path/example.txt -> $HOME/path/example.txt##WORK
|
|
|
|
|
|
|
|
If no "##" version exists and no files match the current CLASS/OS/HOST-
|
2016-01-09 03:47:17 +00:00
|
|
|
NAME/USER, then no link will be created.
|
2015-07-19 17:06:51 +00:00
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
Links are also created for directories named this way, as long as they
|
2016-09-08 13:08:22 +00:00
|
|
|
have at least one yadm managed file within them.
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
CLASS must be manually set using yadm config local.class <class>. OS
|
|
|
|
is determined by running uname -s, HOSTNAME by running hostname, and
|
|
|
|
USER by running id -u -n. yadm will automatically create these links
|
2017-02-10 22:32:07 +00:00
|
|
|
by default. This can be disabled using the yadm.auto-alt configuration.
|
|
|
|
Even if disabled, links can be manually created by running yadm alt.
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
It is possible to use "%" as a "wildcard" in place of CLASS, OS, HOST-
|
|
|
|
NAME, or USER. For example, The following file could be linked for any
|
2017-02-10 22:32:07 +00:00
|
|
|
host when the user is "harvey".
|
|
|
|
|
|
|
|
$HOME/path/example.txt##%.%.harvey
|
|
|
|
|
2017-04-03 12:09:32 +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 class using the configuration local.class. This is
|
2017-02-10 22:32:07 +00:00
|
|
|
set like any other yadm configuration with the yadm config command. The
|
|
|
|
following sets the CLASS to be "Work".
|
|
|
|
|
|
|
|
yadm config local.class Work
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
Similarly, the values of OS, HOSTNAME, and USER can be manually over-
|
|
|
|
ridden using the configuration options local.os, local.hostname, and
|
2017-02-10 22:32:07 +00:00
|
|
|
local.user.
|
|
|
|
|
2015-07-17 00:38:43 +00:00
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
## JINJA
|
|
|
|
If the envtpl command is available, Jinja templates will also be pro-
|
|
|
|
cessed to create or overwrite real files. yadm will treat files ending
|
|
|
|
in
|
|
|
|
|
|
|
|
##yadm.j2
|
|
|
|
|
|
|
|
as Jinja templates. During processing, the following variables are set
|
|
|
|
according to the rules explained in the ALTERNATES section:
|
|
|
|
|
|
|
|
YADM_CLASS
|
|
|
|
YADM_OS
|
|
|
|
YADM_HOSTNAME
|
|
|
|
YADM_USER
|
|
|
|
|
|
|
|
For example, a file named whatever##yadm.j2 with the following content
|
|
|
|
|
|
|
|
{% if YADM_USER == 'harvey' -%}
|
|
|
|
config={{YADM_CLASS}}-{{ YADM_OS }}
|
|
|
|
{% else -%}
|
|
|
|
config=dev-whatever
|
|
|
|
{% endif -%}
|
|
|
|
|
|
|
|
would output a file named whatever with the following content if the
|
|
|
|
user is "harvey":
|
|
|
|
|
|
|
|
config=work-Linux
|
|
|
|
|
|
|
|
and the following otherwise:
|
|
|
|
|
|
|
|
config=dev-whatever
|
|
|
|
|
|
|
|
See http://jinja.pocoo.org/ for an overview of Jinja.
|
|
|
|
|
|
|
|
|
2015-07-17 00:38:43 +00:00
|
|
|
## ENCRYPTION
|
2017-04-03 12:09:32 +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 repository, which often resides on a public system. yadm
|
|
|
|
implements a feature which can make it easy to encrypt and decrypt a
|
|
|
|
set of files so the encrypted version can be maintained in the Git
|
|
|
|
repository. This feature will only work if the gpg(1) command is
|
2015-08-12 05:56:36 +00:00
|
|
|
available.
|
2015-07-17 00:38:43 +00:00
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
To use this feature, a list of patterns must be created and saved as
|
|
|
|
$HOME/.yadm/encrypt. This list of patterns should be relative to the
|
2015-07-17 00:38:43 +00:00
|
|
|
configured work-tree (usually $HOME). For example:
|
|
|
|
|
2015-08-12 05:56:36 +00:00
|
|
|
.ssh/*.key
|
|
|
|
.gnupg/*.gpg
|
2015-07-17 00:38:43 +00:00
|
|
|
|
|
|
|
The yadm encrypt command will find all files matching the patterns, and
|
2017-04-03 12:09:32 +00:00
|
|
|
prompt for a password. Once a password has confirmed, the matching
|
|
|
|
files will be encrypted and saved as $HOME/.yadm/files.gpg. The pat-
|
|
|
|
terns and files.gpg should be added to the yadm repository so they are
|
2015-07-17 00:38:43 +00:00
|
|
|
available across multiple systems.
|
|
|
|
|
|
|
|
To decrypt these files later, or on another system run yadm decrypt and
|
2017-04-03 12:09:32 +00:00
|
|
|
provide the correct password. After files are decrypted, permissions
|
2015-07-17 00:38:43 +00:00
|
|
|
are automatically updated as described in the PERMISSIONS section.
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
Symmetric encryption is used by default, but asymmetric encryption may
|
2016-04-21 12:59:43 +00:00
|
|
|
be enabled using the yadm.gpg-recipient configuration.
|
|
|
|
|
2017-04-03 12:09:32 +00:00
|
|
|
NOTE: It is recommended that you use a private repository when keeping
|
2015-07-19 18:01:52 +00:00
|
|
|
confidential files, even though they are encrypted.
|
2015-07-17 00:38:43 +00:00
|
|
|
|
|
|
|
## PERMISSIONS
|
2017-04-03 12:09:32 +00:00
|
|
|
When files are checked out of a Git repository, their initial permis-
|
2015-07-17 00:38:43 +00:00
|
|
|
sions are dependent upon the user's umask. This can result in confiden-
|
|
|
|
tial files with lax permissions.
|
|
|
|
|
|
|
|
To prevent this, yadm will automatically update the permissions of con-
|
2017-04-03 12:09:32 +00:00
|
|
|
fidential files. The "group" and "others" permissions will be removed
|
2015-07-17 00:38:43 +00:00
|
|
|
from the following files:
|
|
|
|
|
|
|
|
- $HOME/.yadm/files.gpg
|
|
|
|
|
|
|
|
- All files matching patterns in $HOME/.yadm/encrypt
|
|
|
|
|
|
|
|
- The SSH directory and files, .ssh/*
|
|
|
|
|
2015-08-12 05:56:36 +00:00
|
|
|
- The GPG directory and files, .gnupg/*
|
|
|
|
|
2015-07-17 00:38:43 +00:00
|
|
|
yadm will automatically update permissions by default. This can be dis-
|
2017-04-03 12:09:32 +00:00
|
|
|
abled using the yadm.auto-perms configuration. Even if disabled, per-
|
2015-07-17 00:38:43 +00:00
|
|
|
missions can be manually updated by running yadm perms. The SSH direc-
|
|
|
|
tory processing can be disabled using the yadm.ssh-perms configuration.
|
|
|
|
|
|
|
|
## FILES
|
2017-04-03 12:09:32 +00:00
|
|
|
The following are the default paths yadm uses for its own data. These
|
|
|
|
paths can be altered using universal options. See the OPTIONS section
|
2016-04-18 22:24:04 +00:00
|
|
|
for details.
|
|
|
|
|
|
|
|
$HOME/.yadm
|
|
|
|
The yadm directory. By default, all data yadm stores is relative
|
|
|
|
to this directory.
|
|
|
|
|
|
|
|
$YADM_DIR/config
|
2015-07-17 00:38:43 +00:00
|
|
|
Configuration file for yadm.
|
|
|
|
|
2016-04-18 22:24:04 +00:00
|
|
|
$YADM_DIR/repo.git
|
2015-07-17 00:38:43 +00:00
|
|
|
Git repository used by yadm.
|
|
|
|
|
2016-04-18 22:24:04 +00:00
|
|
|
$YADM_DIR/encrypt
|
2015-07-17 00:38:43 +00:00
|
|
|
List of globs used for encrypt/decrypt
|
|
|
|
|
2016-04-18 22:24:04 +00:00
|
|
|
$YADM_DIR/files.gpg
|
2015-07-17 00:38:43 +00:00
|
|
|
All files encrypted with yadm encrypt are stored in this file.
|
|
|
|
|
|
|
|
## EXAMPLES
|
|
|
|
yadm init
|
|
|
|
Create an empty repo for managing files
|
|
|
|
|
|
|
|
yadm add .bash_profile ; yadm commit
|
|
|
|
Add .bash_profile to the Git index and create a new commit
|
|
|
|
|
|
|
|
yadm remote add origin <url>
|
|
|
|
Add a remote origin to an existing repository
|
|
|
|
|
|
|
|
yadm push -u origin master
|
|
|
|
Initial push of master to origin
|
|
|
|
|
|
|
|
echo .ssh/*.key >> $HOME/.yadm/encrypt
|
|
|
|
Add a new pattern to the list of encrypted files
|
|
|
|
|
|
|
|
yadm encrypt ; yadm add ~/.yadm/files.gpg ; yadm commit
|
|
|
|
Commit a new set of encrypted files
|
|
|
|
|
|
|
|
## REPORTING BUGS
|
|
|
|
Report issues or create pull requests at GitHub:
|
|
|
|
|
2016-09-08 13:08:22 +00:00
|
|
|
https://github.com/TheLocehiliosan/yadm/issues
|
2015-07-17 00:38:43 +00:00
|
|
|
|
|
|
|
## AUTHOR
|
|
|
|
Tim Byrne <sultan@locehilios.com>
|
|
|
|
|
|
|
|
## SEE ALSO
|
|
|
|
git(1), gpg(1)
|
|
|
|
|
2016-09-08 13:08:22 +00:00
|
|
|
https://thelocehiliosan.github.io/yadm/
|
2015-07-17 00:38:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|