Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about order of bootstrapping operations #518

Open
1 of 8 tasks
oregonpillow opened this issue Jan 26, 2025 · 5 comments
Open
1 of 8 tasks

Question about order of bootstrapping operations #518

oregonpillow opened this issue Jan 26, 2025 · 5 comments
Labels

Comments

@oregonpillow
Copy link

This question is about

  • Installation
  • Initializing / Cloning
  • Alternate files
  • Jinja templates
  • Encryption
  • Bootstrap
  • Hooks
  • Other

Describe your question

Hi, i'm new to YADM. Must understanding is that bootstrapping is designed as post dotfile installation step. However, surely dotfiles should be installed AFTER bootstrapping in most cases?

For example, if my bootstrapping script installs iTerm AFTER YADM clone, surely when ITerm is installed, it will just replace the existing dotfile i just cloned with YADM. This may be an application specific problem (e.g. some programs wont init a config file if already exists and others might overwrite). But i don't want to leave this to chance.

How are people handling this? or is my understanding compeltely wrong :)

@oregonpillow
Copy link
Author

oregonpillow commented Jan 26, 2025

Sorry and another problem i'm having is i want to encrypt my .ssh folder and my .zshrc file but for some reason ONLY the .ssh folder get's encrpyted.

.config/yadm/config:

[yadm]
        auto-private-dirs = false

.config/yadm/encrypt:

.ssh/**/*
.zshrc
❯ yadm status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit (use -u to show untracked files)

❯ yadm decrypt
gpg: AES256.CFB encrypted data
gpg: encrypted with 1 passphrase
x .ssh/config.d/akamai-components
x .ssh/config.d/cns-sps19
x .ssh/config.d/ipp-b2b
x .ssh/config.d/mobile
x .ssh/config.d/open-resolver
x .ssh/config.d/svn
x .ssh/config.d/wireline
x .zshrc
All files decrypted.

❯ yadm add .zshrc
The following paths are ignored by one of your .gitignore files:
.zshrc
hint: Use -f if you really want to add them.
hint: Turn this message off by running
hint: "git config advice.addIgnoredFile false"

❯ yadm check-ignore -v .zshrc

/Users/user1/.local/share/yadm/repo.git/info/exclude:13:.zshrc	.zshrc

❯ nano .local/share/yadm/repo.git/

❯ nano .gitignore

❯ nano /Users/user1/.local/share/yadm/repo.git/info/exclude

❯ yadm add .zshrc
The following paths are ignored by one of your .gitignore files:
.zshrc
hint: Use -f if you really want to add them.
hint: Turn this message off by running
hint: "git config advice.addIgnoredFile false"

Basically, how can i over-ride or turn off the /Users/user1/.local/share/yadm/repo.git/info/exclude, i don't want to exclude .ssh + .zshrc

@erijo
Copy link
Collaborator

erijo commented Jan 26, 2025

I don't use iTerm myself, but it seems strange if it would overwrite the user's configuration after installation. But if it really does you should be able to restore the config in the bootstrap after installing iTerm (e.g. using yadm restore ...).

Regarding the other question I'm not sure I fully understand. If .zshrc is supposed to be encrypted, then it shouldn't be added to the repo as it will then be committed unencrypted.

@oregonpillow
Copy link
Author

iTerm was just an example, but in general it seems strange to clone dotfiles used by applications, and THEN install the applications that will use those dotfiles and just hope that applications don't overwrite existing dotfiles. That's the point i was trying to make. It seems clear to me that the cloning of dotfiles should always be done AFTER bootstrapping because this is only order of operations that guarantees the dotfiles are what you think. Correct me if im wrong.

Thanks, in regards to .zshrc how are you supposed to add encrypted files then? Can you write the example commands you would write to add .zshrc encrypted? So i would never write yadm add .zshrc? I would only write .zshrc within the encrypted file and then it would automatically be pushed?

@erijo
Copy link
Collaborator

erijo commented Jan 26, 2025

I can't think of any reason why an application would ever overwrite the user's dotfiles? Seems like a very user hostile action to do. But if this unlikely case would in fact happen, it wouldn't matter much as the files are then tracked by yadm and can easily be restored.

Please have a look at https://yadm.io/docs/encryption and see if that clears it up. In short, the files to encrypt are not tracked in the repo, they are instead stored in an archive that's encrypted and it's this archive that's then tracked in the repo.

@oregonpillow
Copy link
Author

Thanks! Ok I think I understand it now. Will give it a test tomorrow. Thanks for quick reply!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants