简体   繁体   English

如何在 Coldfusion(在 Windows 上)上设置 github 机器用户?

[英]How can I set up a github Machine User on Coldfusion (on Windows)?

I am writing a Coldfusion web app (for internal use) that allows our project managers to begin the deployment of a new project.我正在编写一个 Coldfusion Web 应用程序(供内部使用),它允许我们的项目经理开始部署新项目。 A key component of that app requires it to clone a repository on github.该应用程序的一个关键组件要求它在 github 上克隆一个存储库。 I am stuck on communicating the credentials when I execute the git clone.当我执行 git clone 时,我一直在传达凭据。

I think the canonical solution to this would be to set up a Machine User with a set of ssh keys, but I don't know how to associate the key with the server in a way that it would be available to the application.我认为对此的规范解决方案是使用一组 ssh 密钥设置机器用户,但我不知道如何以应用程序可用的方式将密钥与服务器相关联。

I can have whatever access to the server I need in order to accomplish this.我可以访问我需要的服务器来完成此任务。

I don't know if it's relevant, but here is the example code in question:我不知道它是否相关,但这是有问题的示例代码:

     cfexecute(
            variable = "output",
            name = "c:\progra~2\git\bin\git.exe",
            arguments = "clone ssh://[github path] d:\inetpub\wwwroot\[file path]",
            timeout = 240
        );

I don't know how to associate the key with the server in a way that it would be available to the application.我不知道如何以应用程序可用的方式将密钥与服务器相关联。

You need to see which user is going to run the application (I assume that your webserver has a particular user), and then as that user generate a keypair and upload the key to GitHub.您需要查看哪个用户将运行该应用程序(我假设您的网络服务器有一个特定用户),然后作为该用户生成一个密钥对并将密钥上传到 GitHub。

You can also try this answer, which basically states:你也可以试试这个答案,它基本上是这样说的:

I faced the same problem today and used Process Monitor to see what was going on and found that for some reasons sh.exe looked for the keys in C:\\Windows\\SysWOW64\\config\\systemprofile\\.ssh .我今天遇到了同样的问题,并使用 Process Monitor 查看发生了什么,发现由于某些原因sh.exeC:\\Windows\\SysWOW64\\config\\systemprofile\\.ssh So I copied everything in C:\\Users\\Administrator\\.ssh to that folder and it worked perfectly.因此,我将C:\\Users\\Administrator\\.ssh所有内容复制到该文件夹​​中,并且运行良好。

Basically have your keys in the C:\\Windows\\SysWOW64\\config\\systemprofile\\.ssh folder.基本上将您的密钥放在C:\\Windows\\SysWOW64\\config\\systemprofile\\.ssh文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM