Visual Studio 2015 远程 iOS 构建服务器设置 - 安全模式问题
Visual Studio 2015 Remote iOS Build Server Setup - secure mode issue
我正在构建一个混合移动应用程序 (Cordova),我正在尝试 运行 我在 iOS 上构建。
我已按照此 documentation 中的步骤设置连接的 Mac,当我尝试在 [=32] 中构建代码时,我可以看到 Mac 终端响应=].
我的问题是,每当我使用 remotebuild --secure false
启用远程构建服务器时,我都会在 visual studio 输出中收到以下错误(注意终端正在响应来自 visual studio 但随后因错误而失败):
Non-secure connection to http://192.168.1.10:3000/cordova could not be established. Verify that the build server is not running in secure mode.
这是 Mac 终端 activity 并输出:
Last login: Tue Aug 18 19:31:21 on ttys001
IBRAHIM-ALHUSSAINs-Mac-mini:~ IBRAHIMALHUSSAIN$ remotebuild --secure false
remotebuild
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
1.0.1
Warning: No server modules selected. Defaulting to configuration "modules": {"taco-remote": { "mountPath": "cordova"} }
Build Retention initialized with baseBuildDir /Users/IBRAHIMALHUSSAIN/.taco_home/remote-builds/taco-remote/builds, maxBuildsToKeep 20
Initialized BuildManager with baseBuildDir /Users/IBRAHIMALHUSSAIN/.taco_home/remote-builds/taco-remote/builds; maxBuildsInQueue 10; deleteBuildsOnShutdown true; allowsEmulate true; nextBuildNumber 423
Remote build server listening on [http] port 3000
express deprecated req.host: Use req.hostname instead ../../usr/local/lib/node_modules/remotebuild/lib/server.js:257:81
GET /modules/taco-remote 200 14.494 ms - 7
New build request submitted:
/build/tasks?command=build&vcordova=4.3.0&cfg=debug&loglevel=warn
{ 'accept-language': 'en-US',
host: '192.168.1.10:3000',
connection: 'close',
'transfer-encoding': 'chunked' }
POST /cordova/build/tasks?command=build&vcordova=4.3.0&cfg=debug&loglevel=warn - - ms - -
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "taco-remote-multiplexer"
npm ERR! node v0.12.4
npm ERR! npm v2.13.4
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! /Users/IBRAHIMALHUSSAIN/.taco_home/node_modules/taco-remote-multiplexer/latest/npm-debug.log
我记得在某处读到我应该启用一次安全构建然后禁用它以初始化远程服务器安全配置。每当我在安全构建模式 运行 中尝试 remotebuild
时,我都会收到此错误:
Secure connection to https://192.168.1.10:3000/cordova could not be established. Verify that the build server is running in secure mode.
我也曾尝试通过重新创建 PIN、生成和重置证书来解决此问题。
我该如何解决这个问题?
可能是因为OS有沙盒系统
从您在那里包含的控制台输出来看,您的 mac 似乎无法访问 npm 存储库:
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org
行说明
New build request submitted
表示visual studio已经成功连接到remotebuild服务器,并且已经发送过来一个待构建的项目。作为构建项目的一部分,remotebuild 动态获取一些 npm 包以确保它是面向未来的并且可以与多个不同版本的 Cordova 一起工作。
如果您不能或不愿意让您的 mac 看到 npm 存储库,那么可以提供您自己的替代函数来确定加载什么包来实际构建项目。
我强烈建议不要这样做,但这是删除该功能的最简单方法:
在可以访问 npm 的 machine 上,"npm install taco-remote-lib" 下载为 remotebuild 执行 cordova 构建的默认包,然后在那个 "npm install cordova@<version>" 中为您打算使用的单一版本。打开 taco-remote-lib/ios/iosBuild.js 并替换
TacoPackageLoader.lazyRequire("cordova", "cordova@" + cordovaVersion, buildInfo.logLevle).done(function pkg) {
科尔多瓦 = pkg;
和
cordova = require("cordova");
并删除您删除的函数末尾的“}, function (err) { [...] })”。
- 将整个 taco-remote-lib 文件夹复制到 mac,因为它现在是一个专用于特定 cordova 版本的独立实例
- 在某处新建一个js文件"myRedirector.js",并给它类似下面的内容:
.
module.exports.getPackageToServeRequest = function (request) {
return require("/path/to/copied/taco-remote-lib");
}
- 创建一个如下所示的配置文件:
.
{
"modules": {
"taco-remote": {
"requirePath": "taco-remote",
"mountPath": "cordova",
"redirector": "/path/to/myRedirector.js",
}
}
}
- 通过 运行 "remotebuild --config path/to/the/config.json"
开始远程构建
这应该使用自定义请求重定向器启动 remotebuild,该重定向器使用您自定义修改的 taco-remote-lib 包来构建所有请求。
这不会考虑 VS 为构建指定的 cordova 版本,因为这需要能够按需从 NPM 下载这些版本。
就我而言,我的 mac 名字中有“'”。一旦我删除“'”,它确实通过主机名连接。
我正在构建一个混合移动应用程序 (Cordova),我正在尝试 运行 我在 iOS 上构建。
我已按照此 documentation 中的步骤设置连接的 Mac,当我尝试在 [=32] 中构建代码时,我可以看到 Mac 终端响应=].
我的问题是,每当我使用 remotebuild --secure false
启用远程构建服务器时,我都会在 visual studio 输出中收到以下错误(注意终端正在响应来自 visual studio 但随后因错误而失败):
Non-secure connection to http://192.168.1.10:3000/cordova could not be established. Verify that the build server is not running in secure mode.
这是 Mac 终端 activity 并输出:
Last login: Tue Aug 18 19:31:21 on ttys001
IBRAHIM-ALHUSSAINs-Mac-mini:~ IBRAHIMALHUSSAIN$ remotebuild --secure false
remotebuild
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
1.0.1
Warning: No server modules selected. Defaulting to configuration "modules": {"taco-remote": { "mountPath": "cordova"} }
Build Retention initialized with baseBuildDir /Users/IBRAHIMALHUSSAIN/.taco_home/remote-builds/taco-remote/builds, maxBuildsToKeep 20
Initialized BuildManager with baseBuildDir /Users/IBRAHIMALHUSSAIN/.taco_home/remote-builds/taco-remote/builds; maxBuildsInQueue 10; deleteBuildsOnShutdown true; allowsEmulate true; nextBuildNumber 423
Remote build server listening on [http] port 3000
express deprecated req.host: Use req.hostname instead ../../usr/local/lib/node_modules/remotebuild/lib/server.js:257:81
GET /modules/taco-remote 200 14.494 ms - 7
New build request submitted:
/build/tasks?command=build&vcordova=4.3.0&cfg=debug&loglevel=warn
{ 'accept-language': 'en-US',
host: '192.168.1.10:3000',
connection: 'close',
'transfer-encoding': 'chunked' }
POST /cordova/build/tasks?command=build&vcordova=4.3.0&cfg=debug&loglevel=warn - - ms - -
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "taco-remote-multiplexer"
npm ERR! node v0.12.4
npm ERR! npm v2.13.4
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! /Users/IBRAHIMALHUSSAIN/.taco_home/node_modules/taco-remote-multiplexer/latest/npm-debug.log
我记得在某处读到我应该启用一次安全构建然后禁用它以初始化远程服务器安全配置。每当我在安全构建模式 运行 中尝试 remotebuild
时,我都会收到此错误:
Secure connection to https://192.168.1.10:3000/cordova could not be established. Verify that the build server is running in secure mode.
我也曾尝试通过重新创建 PIN、生成和重置证书来解决此问题。
我该如何解决这个问题?
可能是因为OS有沙盒系统
从您在那里包含的控制台输出来看,您的 mac 似乎无法访问 npm 存储库:
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org
行说明
New build request submitted
表示visual studio已经成功连接到remotebuild服务器,并且已经发送过来一个待构建的项目。作为构建项目的一部分,remotebuild 动态获取一些 npm 包以确保它是面向未来的并且可以与多个不同版本的 Cordova 一起工作。
如果您不能或不愿意让您的 mac 看到 npm 存储库,那么可以提供您自己的替代函数来确定加载什么包来实际构建项目。
我强烈建议不要这样做,但这是删除该功能的最简单方法:
在可以访问 npm 的 machine 上,"npm install taco-remote-lib" 下载为 remotebuild 执行 cordova 构建的默认包,然后在那个 "npm install cordova@<version>" 中为您打算使用的单一版本。打开 taco-remote-lib/ios/iosBuild.js 并替换
TacoPackageLoader.lazyRequire("cordova", "cordova@" + cordovaVersion, buildInfo.logLevle).done(function pkg) { 科尔多瓦 = pkg;
和
cordova = require("cordova");
并删除您删除的函数末尾的“}, function (err) { [...] })”。
- 将整个 taco-remote-lib 文件夹复制到 mac,因为它现在是一个专用于特定 cordova 版本的独立实例
- 在某处新建一个js文件"myRedirector.js",并给它类似下面的内容:
.
module.exports.getPackageToServeRequest = function (request) {
return require("/path/to/copied/taco-remote-lib");
}
- 创建一个如下所示的配置文件:
.
{
"modules": {
"taco-remote": {
"requirePath": "taco-remote",
"mountPath": "cordova",
"redirector": "/path/to/myRedirector.js",
}
}
}
- 通过 运行 "remotebuild --config path/to/the/config.json" 开始远程构建
这应该使用自定义请求重定向器启动 remotebuild,该重定向器使用您自定义修改的 taco-remote-lib 包来构建所有请求。
这不会考虑 VS 为构建指定的 cordova 版本,因为这需要能够按需从 NPM 下载这些版本。
就我而言,我的 mac 名字中有“'”。一旦我删除“'”,它确实通过主机名连接。