yadm icon indicating copy to clipboard operation
yadm copied to clipboard

Add --universal option to yadm config command

Open rasa opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe.

yadm has to be configured the same on every decrypting system to match the settings on the encrypting system.

Describe the solution you'd like

Add a --universal option to yadm config to direct yadm to store the option in $XDG_CONFIG_HOME/yadm/universal instead of $XDG_CONFIG_HOME/yadm/config

That way, to easily encrypt/decrypt, one runs:

$ yadm config --universal yadm.ciphername openssl
$ yadm config --universal yadm.openssl-old true
$ yadm encrypt
$ yadm add ~/.config/yadm/universal ~/.local/share/yadm/archive
$ yadm commit

on the encrypting system, and runs:

$ yadm pull
$ yadm decrypt

on each decrypting system.

--universal seems better than --global as git config already has this option to store config options in ~/.gitconfig. See https://git-scm.com/docs/git-config#OPTIONS

We could also add support for a --local option, which directs yadm to store the option in $XDG_CONFIG_HOME/yadm/config . This would be the default if neither --local or --universal is specified.

If there's interest, I'll draft a PR.

Describe alternatives you've considered

Do it manually.

Additional context

rasa avatar Mar 18 '22 07:03 rasa

I think I must be missing some detail, but why not simply add $XDG_CONFIG_HOME/yadm/config to the repo, and have the encryption options stored there?

TheLocehiliosan avatar May 13 '22 13:05 TheLocehiliosan

Because other settings in the config file are specific to each machine, such as class. Hence the need for a "local" config and an all-systems "universal" config.

rasa avatar May 13 '22 18:05 rasa

Because other settings in the config file are specific to each machine, such as class. Hence the need for a "local" config and an all-systems "universal" config.

The config options that are prefaced with local. (like local.class) are not stored in the $XDG_CONFIG_HOME/yadm/config. They're stored in the git config of the local repo.

I'm sure I'm missing something here, but I'm still confused.

TheLocehiliosan avatar Jun 22 '22 14:06 TheLocehiliosan

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Aug 22 '22 02:08 github-actions[bot]

This issue was closed because it has been labeled as stale for 7 days with no activity.

github-actions[bot] avatar Aug 29 '22 02:08 github-actions[bot]