1
0
Fork 0
mirror of synced 2024-06-01 06:41:11 -04:00
Commit graph

250 commits

Author SHA1 Message Date
Luis López 8e2d85de7f
Merge from upstream 2020-02-27 08:20:45 -06:00
Luis López 67ce492b2a
Added undocumented config yadm.openssl-ciphername 2020-02-27 07:44:44 -06:00
Luis López bde5ecbc66
Deduplicate openssl cipher name code (and change default value) 2020-02-27 07:44:41 -06:00
Luis López baaeb88628
Initial support for alternative cyphers.
This patch implements an OpenSSL cypher (via openssl enc command). It has to be enabled using yadm.cypher configuration key.

Some rough edges:
- archive file refers to GPG (.gpg extension)
- no test cases
2020-02-27 07:43:57 -06:00
Tim Byrne 4b99ece480
Support transcrypt (#197)
Support is inherently provided by `enter`, which supports a command.
I've added a `transcrypt` command, which is really just an alias
under-the-hood for "enter transcrypt".
2020-02-21 08:05:56 -06:00
Tim Byrne ee9ffb6828
Reorder command list 2020-02-21 07:55:58 -06:00
Tim Byrne dd86c8a691
Release 2.4.0
Update version number and update documentation

* Support multiple keys in `yadm.gpg-recipient` (#139)
* Ensure all templates are written atomically (#142)
* Add encrypt_with_checksums to the hooks collection (#188)
* Escape white space in YADM_HOOK_FULL_COMMAND (#187)
* Improve parsing of os-release (#194)
* Improve identification of WSL (#196)
* Fix troff warnings emitted by man page (#195)
* Write encrypt-based exclusions during decrypt
2020-02-06 07:53:18 -06:00
Tim Byrne 79e93e38bc
Fix error when /proc/version is missing 2020-02-03 08:30:50 -06:00
Ross Smith II 062181be4a
Simplify WSL identification 2020-02-03 08:27:54 -06:00
Tim Byrne 69cde7f83c
Exclude files listed in yadm/encrypt when decrypt is called
Previously this would only happen when encrypting.
2020-01-30 09:39:10 -06:00
Tim Byrne ccb75b97ea
Escape space in YADM_HOOK_FULL_COMMAND (#187)
Backslashes are used to escape spaces, tabs, and backslashes. This
allows hooks to identify separate parameters (which are space
delimited).
2020-01-24 08:33:07 -06:00
Tim Byrne 76c82c763e
Improve identification of WSL (#196)
Ignore case when searching for Microsoft inside /proc/version.
2020-01-20 07:52:50 -06:00
Tim Byrne 04b98a96cb
Ensure all templates are written atomically
This takes jonasc's change, and applies it to all template writing. Also
removes the dependency on mktemp, and only moves files if they are
successfully written.
2020-01-16 16:27:59 -06:00
Tim Byrne 3e42bd9f52
Merge pull request #142 from jonasc/master
Resolved conflicts, and signed commit from jonasc.
2020-01-16 12:59:32 -06:00
jonasc a1845c6e8a
Write template result to temporary file and move
This prevents problems with programs which watch the file for changes and will
first be presented an empty file.
One such example which will show a notification message about an empty config
file is Alacritty.
By writing to a tempory file and then moving it (atomically?) to the real
location this problem is mitigated.
2020-01-16 12:58:38 -06:00
Tim Byrne 0b22220e3c
Merge pull request #139 from stigtsp/multiple-gpg-recipients 2020-01-14 08:08:44 -06:00
Tim Byrne 4546636336
Merge pull request #194 from rasa/rasa/remove-quotes-from-distro 2020-01-14 07:14:04 -06:00
Martin Zuther 499837bd80
apply code review changes 2019-12-30 00:34:27 +01:00
Martin Zuther 45b218d5c1
support encrypted files in "yadm list"
* export some helper functions to hooks
2019-12-29 15:21:55 +01:00
Martin Zuther bd19e31c6e
get rid of dirname 2019-12-29 12:51:29 +01:00
Martin Zuther c190333fdf
correctly export array to subscript
* fix shellcheck errors and warnings
2019-12-28 16:09:19 +01:00
Martin Zuther 91266ca8eb
Check encrypted files with SHA-512/256 checksums 2019-12-27 18:15:04 +01:00
Tim Byrne b4fd9e19c2
Release 2.3.0
Update version number and update documentation

* Support git-crypt (#168)
* Support specifying a command after `yadm enter`
* Expose GIT_WORK_TREE during `yadm enter` (#160)
* Support GNUPGHOME environment variable (#134)
* Assert private dirs, only when worktree = $HOME (#171)
2019-12-17 07:15:58 -06:00
Tim Byrne 7ad28c3a97
Set exit status when running a command from enter 2019-12-16 17:11:07 -06:00
Tim Byrne d3a2a06184
Support git-crypt (#168)
Support is inherently provided by `enter`, which now supports a command.
I've added a `git-crypt` command, which is really just an alias
under-the-hood for "enter git-crypt".
2019-12-16 17:11:06 -06:00
Tim Byrne b9f5fdaafa
Support GNUPGHOME environment variable (#134) 2019-12-14 13:24:39 -06:00
Tim Byrne 84a173551e
Only assert private dirs, when worktree = $HOME (#171) 2019-12-14 13:24:32 -06:00
Tim Byrne cc1993dc14
Move logic around assert_private_dirs to be more efficient 2019-12-12 08:09:30 -06:00
Tim Byrne 46105aae47
Set YADM_WORK within configure_paths 2019-12-12 08:00:10 -06:00
Tim Byrne 18e5fcfacc
Only assert private dirs, when worktree = $HOME 2019-12-11 08:37:45 -06:00
Tim Byrne e7d2406af3
Export GIT_WORK_TREE during yadm enter (#160) 2019-12-08 15:17:47 -06:00
Tim Byrne 32baf81b56
Support specifying a command after yadm enter 2019-12-08 15:17:47 -06:00
Ross Smith II 43ac19398a
Remove quotes from distro name 2019-12-06 20:38:37 -08:00
Tim Byrne 96bce8dbac
Release 2.2.0
Update version number and update documentation

* Resolve hostname using `uname -n` (#182)
* Use /etc/os-release if lsb_release is missing (#175)
* Issue warning for any invalid alternates found (#183)
* Add support for gawk (#180)
2019-12-05 16:53:16 -06:00
Tim Byrne 4d23bbcf11
Standardize on &> when not appending output 2019-12-04 22:39:00 -06:00
Tim Byrne 758a2e0c26
Automatically prefer gawk over awk 2019-12-04 22:18:22 -06:00
Tim Byrne c0310a43a2
Merge pull request #180 from rasa/rasa/use-gawk-on-openwrt 2019-12-04 17:53:36 -06:00
Tim Byrne 3d10309665
Issue warning for any invalid alternates found (#183) 2019-12-03 08:38:11 -06:00
Tim Byrne 6bf0852609
Use /etc/os-release if lsb_release is missing (#175) 2019-11-30 18:31:27 -06:00
Tim Byrne 96839a5743
Remove dependency on hostname (#182) 2019-11-30 10:27:28 -06:00
Tim Byrne 75c19c9cc0
Release 2.1.0
Update version number and update documentation

* Use relative symlinks for alternates (#100, #177)
* Support double-star globs in .config/yadm/encrypt (#109)
* Improve bash completion (#136)
* Update docs about using magit (#123)
* Note exception for WSL (#113)
2019-11-27 07:21:44 -06:00
Tim Byrne 510169eb7f
Support double-star globs in encrypt (#109)
This will only work for Bash >=4, there the shell option "globstar" is
supported.
2019-11-26 16:24:51 -06:00
Tim Byrne 5634c09a8a
Refactor symlink code
Update variable names, favoring the terminology used by `ln`.
* source (original file containing data)
* target (the symlink file, pointing to source)
2019-11-25 08:24:46 -06:00
Tim Byrne 61576a6ae1
Use relative symlinks for alt (#100)
* Fix broken support for .config/yadm/alt
* Removes dependence on external basename / dirname
2019-11-25 07:27:54 -06:00
Tim Byrne 98392b9a9c
Add function relative_path
This function will create a path relative to another, without the use of
an external program like dirname.
2019-11-24 13:15:42 -06:00
Ross Smith II 2bf98a5ade
Use gawk on OpenWrt, as awk is BusyBox version
The BusyBox version of awk fails with this error:
awk: bad regex '[\\.^$(){}\[\]|*+?]': Repetition not preceded by valid expression
2019-11-23 19:39:57 -08:00
Tim Byrne 98915151a3
Revert version change 2019-11-17 12:39:05 -06:00
Ross Smith II 539ffd3ffc
Make symlinks relative 2019-11-13 08:17:06 -08:00
Tim Byrne 5aa1a7be75
Release 2.0.1
Update version number and update documentation

* Fix bug with worktree permissions (#174)
2019-11-12 07:49:26 -06:00
Ross Smith II 8633083716
Don't glob into parent dirs 2019-11-12 06:50:54 -06:00
Tim Byrne de73c9f4b4
Release 2.0.0
Update version number and update documentation

* Support XDG base directory specification
* Redesign alternate processing
* Add built-in default template processor
* Allow storing alternates in yadm dir (#90)
* Add support for j2cli template processor
* Ignore encrypted files (#69)
* Support DISTRO in alternates (#72)
* Support `source` in templates (#163)
* Change yadm.cygwin-copy to yadm.alt-copy
* Support `-b <branch>` when cloning (#133)
* Support includes for j2-based templates (#114)
* Remove stale/invalid linked alternates (#65)
* Add support for Mingw/Msys (#102)
* Allow `-l` to pass thru to the `yadm config` command
* Improve processing of `yadm/encrypt`
* Fix bugs in legacy alternate processing
* Fix bug with hidden private files
* Improve support for older versions of Git
* Add upgrade command
2019-11-07 21:38:53 -06:00
Tim Byrne f2b2d505a2
Reinitialize submodules during upgrade 2019-11-05 16:36:05 -06:00
Tim Byrne a217537b26
Fix URL for upgrade help 2019-11-04 17:31:55 -06:00
Tim Byrne 5a802c8afd
Allow -l to pass thru to the yadm config command 2019-11-03 14:21:59 -06:00
Tim Byrne f5287f1588
Properly format supported configs 2019-11-03 14:17:10 -06:00
Tim Byrne fc53cfd1f8
Remove --local
`--local` isn't supported by versions of Git older than 1.8. But it
should be the default if the `--local` is omitted.
2019-11-03 13:35:44 -06:00
Tim Byrne 616baaeac6
Rename default template processor 2019-10-30 17:29:17 -05:00
Tim Byrne b62a4c77a6
Create an upgrade command
This command will assist users with migration from 1.x.x to 2.0.0.
2019-10-23 17:08:04 -05:00
Tim Byrne 0c9468c9b5
Ignore encrypted files (#69)
Append the contents of .config/yadm/encrypt to the repo's git ignore
list. This is to help prevent accidentally committing unencrypted
sensitive data.
2019-10-17 08:22:17 -05:00
Tim Byrne f3249e00b5
Ensure base directories for alternates before creation 2019-10-12 18:22:02 -05:00
Tim Byrne 6d5467951a
Properly handle missing "." in alternate conditions 2019-10-12 09:59:03 -05:00
Tim Byrne 4ea3ed9e2a
Allow storing alternates elsewhere (#90)
This change allows alternates to be stored in "$YADM_DIR/alt". The
correct path within the work tree will be symlinked.

Storing alternates within the work tree is still allowed. Both locations
will be considered when choosing an appropriate alternate file.
2019-10-12 09:59:02 -05:00
Tim Byrne aeb6a54ad7
Add source to templates (#163)
A new variable is exposed to templates, which holds the filename of the
template source. The primary use case is to be able to include a warning
message within the template. For example:

  # Do not edit. This file auto-generated from {{ yadm.source }}.
2019-10-11 07:23:52 -05:00
Tim Byrne 3a192db420
Remove symlinks before processing a template 2019-10-11 07:20:03 -05:00
Tim Byrne 574945f010
Change yadm.cygwin-copy to yadm.alt-copy
This removes the constraint of only allowing the copy option on Cygwin
systems. Now any system can configure this option.
2019-10-09 18:47:42 -05:00
Tim Byrne b2ef6d2e09
Merge pull request #102 from rasa/rasa-add-mingw-msys-support 2019-10-09 07:48:56 -05:00
Tim Byrne f3bde37f78
Support -b <branch> when cloning (#133) 2019-10-08 17:28:53 -05:00
Tim Byrne 6a3199ceea
Support DISTRO in alternates (#72) 2019-10-06 16:35:47 -05:00
Tim Byrne 444622a658
Support else statements in builtin templates 2019-10-05 11:43:48 -05:00
Tim Byrne e999929818
Change builtin templates to resemble jinja 2019-10-02 15:16:41 -05:00
Tim Byrne b411f9d74f
Split out processing of stale links 2019-10-02 15:16:10 -05:00
Tim Byrne 0438e383e5
Unify the way alternate file strings are matched 2019-10-02 15:16:10 -05:00
Tim Byrne 3ba17f41fd
Fix a known bug with hidden private files 2019-10-02 15:16:10 -05:00
Tim Byrne cfda485b34
Implement future alternate processing 2019-10-02 15:16:02 -05:00
Tim Byrne f3ae31f1c2
Separate alternate linking code from other operations 2019-09-27 08:40:32 -05:00
Tim Byrne e4e956fe21
Split discovery of alternates test data into a testable function 2019-09-27 08:40:32 -05:00
Tim Byrne c29292d02b
Split out processing of alt (past/future) 2019-09-27 08:40:31 -05:00
Tim Byrne 289b8e0c6c
Remove unnecessary continuation backslashes 2019-09-27 08:40:31 -05:00
Tim Byrne cec8778578
Align continuation backslashes 2019-09-27 08:40:31 -05:00
Tim Byrne 48fc6b0db7
Support XDG base directory specification
https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
2019-09-27 08:40:31 -05:00
Tim Byrne f0ad40376d
Create YADM_HOOKS variable for hooks dir 2019-08-06 08:19:01 -05:00
Tim Byrne a399c35e4e
Add quoting 2019-07-29 08:00:09 -05:00
Daniel Wagenknecht b404a87a89
Replace direkt calls to git with $GIT_PROGRAM
Some calls to git ignored the yadm.gpg-program configuration option
and called the first git found in $PATH instead. Make them adhere to
the configured git program by replacing the call with $GIT_PROGRAM.
2019-07-16 21:45:14 +02:00
Tim Byrne 4613c1d0c4
Merge pull request #114 from bb010g/patch-1 2019-04-12 07:57:35 -05:00
Tim Byrne d245f633bf
Remove invalid linked alternates (#65) 2019-04-10 09:23:34 -05:00
Tim Byrne a2cc970dd6
Remove unnecessary Git invocations
`git ls-files` was being called multiple times during the processing of
alternates. This is now run once, and kept in an array.
2019-04-09 07:53:27 -05:00
Tim Byrne 2375a0955b
Standardize sort order
Prevent localizations from interfering with sorting order.
2019-04-05 08:58:30 -05:00
Tim Byrne 0c6be5e398
Fix bug with alternate linked directories
Previously the tracked files were sorted, and then the files and their
parent directories were considered for possible alternates. Depending on
the length of directories and names of files, inconsistencies would
occur because the directory separator (/) would be part of the sorting.

To fix this, a unique list of tracked files and their parent directories
are sorted into a single list which is processed.
2019-04-05 08:58:30 -05:00
Tim Byrne 2aa1710214
Remove superfluous ; in comments 2019-03-24 17:22:11 -05:00
Tim Byrne 58edf313aa
Process .yadm/encrypt in sorted order 2019-03-24 17:05:11 -05:00
addshore ec65801d9b
Run hooks on MINGW* systems
MINGW* systems don't have a +x flag.
Everything is executable if it exists (as far as I know).

This, while trying to run hooks on MINGW* systems just check
for the existence of the file instead of -x
2019-03-15 17:31:48 +00:00
Tim Byrne 402b57880d
Update GPLv3 LICENSE information
This does NOT change the licensing.
2019-03-14 18:25:02 -05:00
Stig Palmquist d075438308
support multiple keys in yadm.gpg-recipient 2019-01-20 20:26:18 +01:00
Brayden Banks 0b9f537909
Allow for more complex Jinja templates
By calling envtpl with a filename, Jinja can perform includes, which is useful for more general machine configuration.
2018-06-11 19:31:10 -07:00
Ross Smith II 54f7cbcebe Fix OS name match for Cygwin/Msys 2018-03-05 07:02:46 -08:00
Ross Smith II 315ad0873e Fix OS check to match (Cygwin|Msys)* 2018-03-04 06:34:08 -08:00
Ross Smith II adfedf4b64 Add Mingw/Msys support 2018-03-03 20:02:45 -08:00
Tim Byrne 09a018ea5a
Release 1.12.0
Update version number and update documentation

* Add basic Zsh completion (#71, #79)
* Support directories in `.yadm/encrypt` (#81, #82)
* Support exclusions in `.yadm/encrypt` (#86)
* Improve portability with printf (#87)
* Eliminate usage of `eval` and `ls`
2017-10-24 22:12:23 -05:00
Thomas Luzat ac2aed9ab4
Indentation: Convert tab to space 2017-10-09 15:21:32 +02:00
Tim Byrne d411db9f6f
Consolidate cd to YADM_WORK 2017-09-22 12:30:24 -05:00