是否应该忽略.NPMRC?
Fontawesome Pro 说明 描述了将密钥放在 .npmrc
文件中,但尚不清楚应如何管理该文件。具体来说,这个文件应该被 Git 忽略吗?
The Fontawesome Pro instructions describe placing a secret key in a .npmrc
file but it is unclear how this file should be managed. Specifically, should this file be ignored by Git?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是正确的示例,是在
.nmprc
文件中管理敏感信息的一般方法:The Fontawesome Pro instructions are correct as an example of the general approach to managing sensitive information in a
.nmprc
file :我的答案说,最好忽略它而不是努力回购。好像您有多个工程师对生成的软件包进行贡献更改,以将每个开发人员都必须具有自己的.NPMRC文件推向注册表,并且“您不太可能希望将其推入repo,因为每次尝试都会覆盖/冲突。
我可以想象一个方案,您想通过为所有开发人员使用一个凭据,因此想自动化一个全局.npmrc文件,但这是我认为的显而易见的安全性人造PA。
My answer would say it's best to ignore it and not push to repo. as if you have multiple Engineers contributing changes to a generated package for push to the registry each developer will have to have their own .npmrc file and it' unlikely that you'd ever want that pushed to the repo as each attempt would overwrite/conflict.
I could imagine a scenario where you'd like to automate by using a single credential for all devs and thus one global .npmrc file but that is an obvious security faux pas in my view.
您可以
.npmrc
文件复制到.npmrc_local
.npmrc_local
(通过 .gitignore).npmrc
中删除敏感数据代码> 文件。npm install
之前将更改推送到存储库,.npmrc
中。这样 git repo 中就没有敏感日期了。这种方法可以用在可以轻松管理安全文件的地方(例如azure)
You can
.npmrc
file into.npmrc_local
.npmrc_local
(by .gitignore).npmrc
file.npm install
just temporary compy .npmrc_local into.npmrc
.In this way sensitive date are no in git repo. This approach can be used in places where you can easy manage security files (e.g. azure)