使用 Github 页面托管的 Jekyll 站点是否需要 gemfile.lock 文件?
Is the gemfile.lock file needed in a Jekyll site hosted with Github Pages?
最近我开始使用 Jekyll 来构建文档站点并将它们托管在 Github 页面上。我知道 Github Pages 有一个非常有限的插件允许列表。在进行一些漏洞测试时,我发现文件 Gemfile.lock 容易受到 XML 外部实体 (XXE) 注入的攻击。
在我的研究中我读到:
- Should Gemfile.lock be included in .gitignore?
- A Gem's Gemfile.lock should NOT be in source control.
- Setting up your GitHub Pages site locally with Jekyll
阅读接受的答案后:
Assuming you're not writing a rubygem, Gemfile.lock should be in your repository. It's used as a snapshot of all your required gems and their dependencies. This way bundler doesn't have to recalculate all the gem dependencies each time you deploy, etc.
但我无法控制 Jekyll 站点。如果我理解该过程但 Github Pages 构建站点并且 Gemfile.lock 用于开发 Gems 而不是我的东西,请纠正我可以控制删除文件并添加到 .gitignore?
就可以了
GitHub Pages 不查找 Gemfile.lock
文件,也不查找 Gemfile
本身。
它所需要的只是一个正确的配置文件来加载 gems / 插件。
最近我开始使用 Jekyll 来构建文档站点并将它们托管在 Github 页面上。我知道 Github Pages 有一个非常有限的插件允许列表。在进行一些漏洞测试时,我发现文件 Gemfile.lock 容易受到 XML 外部实体 (XXE) 注入的攻击。
在我的研究中我读到:
- Should Gemfile.lock be included in .gitignore?
- A Gem's Gemfile.lock should NOT be in source control.
- Setting up your GitHub Pages site locally with Jekyll
阅读接受的答案后:
Assuming you're not writing a rubygem, Gemfile.lock should be in your repository. It's used as a snapshot of all your required gems and their dependencies. This way bundler doesn't have to recalculate all the gem dependencies each time you deploy, etc.
但我无法控制 Jekyll 站点。如果我理解该过程但 Github Pages 构建站点并且 Gemfile.lock 用于开发 Gems 而不是我的东西,请纠正我可以控制删除文件并添加到 .gitignore?
就可以了GitHub Pages 不查找 Gemfile.lock
文件,也不查找 Gemfile
本身。
它所需要的只是一个正确的配置文件来加载 gems / 插件。