【问题标题】:Virtual .git archive with license key for node modules带有节点模块许可证密钥的虚拟 .git 存档
【发布时间】:2016-04-08 17:44:22
【问题描述】:

不太确定如何命名,但这是我想要做的。 我有一些我想使用许可证密钥提供的私有节点模块。

所以节点模块的安装应该如下所示:

npm install http://example.com/example.git?key=12123123

我不希望 example.git 成为实际的 .git 实例。如果它们的密钥有效,我希望能够为节点获取正确的存档。我可以使用 php 处理密钥验证,但不确定输出表单应该是什么。

谢谢, 拉度

【问题讨论】:

    标签: node.js git npm


    【解决方案1】:

    实际上将 git 存储库归档为 gz tarball 允许我使用 npm install 安装它,所以我有

    npm install http://example.com/repo.php?key=123123123

    我在 repo.php 里面

    header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Length: ' . filesize($file));
    header('Content-Disposition: attachment; filename=' . basename($file));
    readfile($f_location);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-01
      • 1970-01-01
      • 2016-04-21
      • 2013-01-24
      • 2010-09-20
      • 2017-06-12
      • 1970-01-01
      • 2018-02-26
      相关资源
      最近更新 更多