-
Notifications
You must be signed in to change notification settings - Fork 499
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
External with authentication #4120
Comments
Putting password directly to externals file doesn't seem to be a good idea. It's much better to use ssh-agent for this: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent Or you can just add entry in |
Nobody is suggesting that we put a password in the externals file? Obviously, that is a bad idea. From what i can tell, there is no way to download an archive type with authentication. if i had a custom cmd arg that i could do some maybe the redactions were confusing, the only stuff that was redacted was the enterprise URL and my account ID. no passwords... :) |
I think you can put access token to one of these env vars:
Also will #3748 help for your use case? |
interesting, With the access key i can atleast get wget to download the zip. that MIGHT work, but then i would have to find a way to inject that safely. Im not sure what the scope of #3748 is, i would not expect that this would be captured from the comments i read |
The What are you providing for authentication? If it's a SSH private key, then you can install that manually (or have chezmoi retrieve it from your password manager or encrypted file). If you are providing an access token in one of the environment variables listed in #4120 (comment). |
Im fine with using the git clone style, but it seems to just not do anything most of the time for me :( Right here, i remove the private dotfiles folder, chezmoi apply (after the refresh period is up, same result with the --refresh-externals). If the repo is already there, it will take extra time as if it is doing a git pull. If its not already clone, it does NOTHING. -v adds no information. authentication in this case is already setup with git as i hope the example shows. otherwise i was doing https::@github.xxx/xxx/xxx.com as a test, no dice ... |
Please run the command with |
Please include the full output of the command with |
Redirect stderr to the file with:
The error in your screenshot looks like a file not found error. Note that |
so .chezmoiexternals will not be evaluated on until after .bashrc is evaluated? That seems very weird to me. I assumed that it would be used as a setup, so it should run before the others. If this is the case, can you recommend a work around? am i to add a run_once script that clones the repo? |
No. See the application order. |
ok sure, how do i make that happen? because the folder I can source the private stuff in my bash rc if it exists instead of doing the chezmoi template injecting but that seems like a limited work around. |
tl;dr you're encountering problems because you're not using chezmoi the way it's designed to be used. chezmoi is designed to generate your dotfiles for the current machine from a single source of truth, i.e. a single branch from a single git repo. You're trying to generate dotfiles from multiple repos. To keep the private parts of your dotfiles secret, use a password manager or encryption. Don't use a separate repo. |
Is your feature request related to a problem? Please describe.
I cannot download the archive of a github branch when it requires authentication.
Describe the solution you'd like
I would like a way to use an authenticated way to pull the archive for a github repo.
even if we were given a custom retrieval command, that would work , in that case i would probably do a gh api query where authentication is already taken care of
Describe alternatives you've considered
I have tried this
which i though worked once, but on another computer it does not work( i don't think it actually ever worked now, but that i did something on the last pc ). I must use SSH because my organization does not allow http :(
I see that the docs only refer to http forms. so im guessing this is ignored because the url doesnt match. I think it should allow ssh forms though, consididering i can apply based on the ssh form on initial setup.
When i run apply, it seems to completely skip this file. some feedback there would be nice. even verbose makes me think the file is ignored completely
The text was updated successfully, but these errors were encountered: