-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
feat: git https credentials for template leak into final repo #466
Comments
Or maybe Copier could detect when git is asking for credentials, and allow the user to input them. It would abort with an error if the |
Although the issue is valid, currently I just clone private templates by ssh, and I'm happy with it. Proper docs about this would be enough to fix the issue ? |
mmh - maybe I need to clarify a bit more: I don't think the fact that you need to put username/password into the URL when using copier is a problem in and itself - as you mentioned, @yajo , this is probably just a matter of documenting it more clearly. The main issue I see though, is that these credentials will end up in the Just as an example, if I use a copier command like this:
the username and password will end up in the
|
Yes, don't worry, I understood you perfectly. But if you use SSH, authentication is automatic and you don't need a password in git URL. |
ok 😂 then this ticket is basically about allowing something similar to the SSH usecase, but when SSH is not an option. This may happen in many cases, such as:
|
To solve this, use a credential helper as described in conan-io/docs#3683 (comment):
to set it up, then set your credentials as environment variables and run copier without specifying it:
|
Additional use case: our Renovate setup accesses Bitbucket through HTTPS, so we have to use HTTPS with copier as well. FWIW, at least |
Interesting solutions. see also these docs: |
Is your feature request related to a problem? Please describe.
Currently, copier does not support Git HTTPS template URLs with included credentials. At least not without leaking these credentials into the
.copier-answers.yml
file of the target repo.I.e., commands like this are not a great idea, but there exists no workaround:
Describe the solution you'd like
It would be great if credentials for cloning the template could be passed during runtime to copier (i.e. through env variables, cli arguments or separate secret files). For example with a command like:
copier copy \ --template-clone-username myuser --template-clone-password secretpw https://myrepos.com/repo.git .
These credentials should then not be saved in the target repo - but instead a future user running
copier update
must supply his own credentials again.The text was updated successfully, but these errors were encountered: