@lazycatcloud/lzc-cli 1.2.63 → 1.2.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.2.64
2
+ 1. 升级 dozzle,支持查看所有容器日志
3
+ 2. 修复 devshell ssh 多路复用错误
4
+
1
5
  # 1.2.63
2
6
 
3
7
  1. 处理开发者账号无法登陆问题
package/lib/app/index.js CHANGED
@@ -149,6 +149,7 @@ export function lpkAppCommand(program) {
149
149
  const bridge = new DebugBridge()
150
150
  await bridge.init()
151
151
  await bridge.uninstall(pkgId)
152
+ console.log(`默认微服设备: ${bridge.boxname} ,卸载应用 ${pkgId} 完成`)
152
153
  }
153
154
  },
154
155
  {
@@ -25,9 +25,9 @@ function findOnceLpkByDir(dir = process.cwd()) {
25
25
  }
26
26
 
27
27
  export class LpkInstaller {
28
- constructor() {}
28
+ constructor() { }
29
29
 
30
- async init() {}
30
+ async init() { }
31
31
 
32
32
  // deploy 构建和安装
33
33
  async deploy(builder) {
@@ -119,17 +119,23 @@ export class LpkInstaller {
119
119
  fs.rmSync(tempDir, { recursive: true })
120
120
  }
121
121
 
122
- const bridge = new DebugBridge()
123
- await bridge.init()
124
- logger.info("开始安装应用")
125
- await bridge.install(pkgPath, manifest ? manifest["package"] : "")
126
- logger.info("\n")
127
- logger.info(`安装成功!`)
128
- if (manifest) {
129
- logger.info(
130
- `👉 请在浏览器中访问 https://${manifest["application"]["subdomain"]}.${shellapi.boxname}.heiyu.space`
122
+ try {
123
+ const bridge = new DebugBridge()
124
+ await bridge.init()
125
+ logger.info("开始安装应用")
126
+ await bridge.install(pkgPath, manifest ? manifest["package"] : "")
127
+ logger.info("\n")
128
+ logger.info(`安装成功!`)
129
+ if (manifest) {
130
+ logger.info(
131
+ `👉 请在浏览器中访问 https://${manifest["application"]["subdomain"]}.${shellapi.boxname}.heiyu.space`
132
+ )
133
+ logger.info(`👉 并使用微服的用户名和密码登录`)
134
+ }
135
+ } catch(error) {
136
+ logger.error(
137
+ `安装失败: ${error}`
131
138
  )
132
- logger.info(`👉 并使用微服的用户名和密码登录`)
133
139
  }
134
140
  }
135
141
  }
@@ -30,6 +30,7 @@ export function sshCmdArgs(...args) {
30
30
  const defaultOptions = [
31
31
  `-o "StrictHostKeyChecking=no"`,
32
32
  `-o "UserKnownHostsFile=/dev/null"`,
33
+ `-o "ControlMaster=no"`,
33
34
  "-q",
34
35
  "-p 22222",
35
36
  `${isTraceMode() ? "-v" : ""}`
@@ -126,7 +127,11 @@ export class DebugBridge {
126
127
  return true
127
128
  } catch (err) {
128
129
  logger.debug("canPublicKey error: ", err)
129
- return false
130
+ if (err?.code == "ETIMEOUT") {
131
+ throw `域名解析失败,请检查代理软件是否对*.heiyu.space拦截`
132
+ } else {
133
+ return false
134
+ }
130
135
  }
131
136
  }
132
137
 
package/lib/utils.js CHANGED
@@ -484,21 +484,20 @@ export async function resolveDomain(domain) {
484
484
  try {
485
485
  // Set machine's dns server as defalut dns server
486
486
  dns.setServers(["[fc03:1136:3800::1]"])
487
-
488
487
  const [ipv6Addresses, ipv4Addresses] = await Promise.allSettled([
489
488
  __resolveDomain(domain, true),
490
489
  __resolveDomain(domain, false)
491
490
  ])
492
491
  if (ipv6Addresses.status == "fulfilled") {
493
492
  return ipv6Addresses.value
494
- } else if (ipv4Addresses.status != "fulfilled") {
493
+ } else if (ipv4Addresses.status == "fulfilled") {
495
494
  return ipv4Addresses.value
496
495
  } else {
497
- throw `无法解析域名 ${domain}`
496
+ throw ipv6Addresses.reason
498
497
  }
499
498
  } catch (error) {
500
- logger.error("resolve domain: ", error)
501
- throw `无法解析域名 ${domain}: ${error}`
499
+ logger.error(`无法解析域名 ${domain}: `, error)
500
+ throw error
502
501
  }
503
502
  }
504
503
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazycatcloud/lzc-cli",
3
- "version": "1.2.63",
3
+ "version": "1.2.64",
4
4
  "description": "lazycat cloud developer kit",
5
5
  "scripts": {
6
6
  "prepublishOnly": "node check-changelog.js"