@abtnode/core 1.17.3-beta-20251119-102907-28b69b76 → 1.17.3-beta-20251120-052956-035abea6
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/lib/api/node.js +2 -1
- package/lib/router/helper.js +4 -1
- package/lib/states/node.js +12 -3
- package/package.json +24 -24
package/lib/api/node.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* eslint-disable no-underscore-dangle */
|
|
3
3
|
const assert = require('assert');
|
|
4
4
|
const os = require('os');
|
|
5
|
+
const isUrl = require('is-url');
|
|
5
6
|
const { Hasher } = require('@ocap/mcrypto');
|
|
6
7
|
const isDocker = require('@abtnode/util/lib/is-docker');
|
|
7
8
|
const isGitpod = require('@abtnode/util/lib/is-gitpod');
|
|
@@ -52,7 +53,7 @@ class NodeAPI {
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
try {
|
|
55
|
-
if (entity.registerUrl) {
|
|
56
|
+
if (entity.registerUrl && isUrl(entity.registerUrl)) {
|
|
56
57
|
const launcherInfo = await getLauncherInfo(entity.registerUrl);
|
|
57
58
|
entity.registerInfo = launcherInfo;
|
|
58
59
|
logger.info(`Updated launcher info from ${entity.registerUrl}`, launcherInfo);
|
package/lib/router/helper.js
CHANGED
|
@@ -786,7 +786,9 @@ module.exports = function getRouterHelpers({
|
|
|
786
786
|
const trafficInsight = states.trafficInsight;
|
|
787
787
|
|
|
788
788
|
const downloadCert = async ({ domain, url }) => {
|
|
789
|
-
const destFolder = getTmpDir(path.join(`certificate-${Date.now()}`));
|
|
789
|
+
const destFolder = getTmpDir(path.join(`certificate-${md5(domain)}-${Date.now()}`));
|
|
790
|
+
logger.info('download certificate start', { domain, url, destFolder });
|
|
791
|
+
|
|
790
792
|
try {
|
|
791
793
|
const filename = path.join(destFolder, 'certificate.tar.gz');
|
|
792
794
|
fs.ensureDirSync(destFolder);
|
|
@@ -821,6 +823,7 @@ module.exports = function getRouterHelpers({
|
|
|
821
823
|
throw error;
|
|
822
824
|
} finally {
|
|
823
825
|
fs.removeSync(destFolder);
|
|
826
|
+
logger.info('remove certificate dest folder', { domain, url, destFolder });
|
|
824
827
|
}
|
|
825
828
|
};
|
|
826
829
|
|
package/lib/states/node.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/* eslint-disable no-underscore-dangle */
|
|
2
2
|
const semver = require('semver');
|
|
3
|
+
const isUrl = require('is-url');
|
|
3
4
|
const omit = require('lodash/omit');
|
|
4
5
|
const isEmpty = require('lodash/isEmpty');
|
|
5
6
|
const security = require('@abtnode/util/lib/security');
|
|
6
7
|
const { CustomError } = require('@blocklet/error');
|
|
7
8
|
const { generateRandomString } = require('@abtnode/models/lib/util');
|
|
8
9
|
const { isFromPublicKey } = require('@arcblock/did');
|
|
10
|
+
const { getLauncherInfo } = require('@abtnode/auth/lib/launcher');
|
|
9
11
|
const { DBCache, getAbtNodeRedisAndSQLiteUrl } = require('@abtnode/db-cache');
|
|
10
12
|
const {
|
|
11
13
|
NODE_MODES,
|
|
@@ -124,8 +126,7 @@ class NodeState extends BaseState {
|
|
|
124
126
|
|
|
125
127
|
const initialized = this.isInitialized({ nodeOwner, enablePassportIssuance, trustedPassports });
|
|
126
128
|
const defaultConfigs = await getDefaultConfigs();
|
|
127
|
-
|
|
128
|
-
doc = await this.insert({
|
|
129
|
+
const entity = {
|
|
129
130
|
...(defaultConfigs || {}),
|
|
130
131
|
name,
|
|
131
132
|
description,
|
|
@@ -158,7 +159,15 @@ class NodeState extends BaseState {
|
|
|
158
159
|
nftDomainUrl: DEFAULT_NFT_DOMAIN_URL,
|
|
159
160
|
sessionSalt: generateRandomString(16),
|
|
160
161
|
enableFileSystemIsolation,
|
|
161
|
-
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
if (entity.registerUrl && isUrl(entity.registerUrl)) {
|
|
165
|
+
const launcherInfo = await getLauncherInfo(entity.registerUrl);
|
|
166
|
+
entity.registerInfo = launcherInfo;
|
|
167
|
+
logger.info(`Init launcher info from ${entity.registerUrl}`, launcherInfo);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
doc = await this.insert(entity);
|
|
162
171
|
|
|
163
172
|
if (dek) {
|
|
164
173
|
doc.sk = security.decrypt(doc.sk, doc.did, dek);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.17.3-beta-
|
|
6
|
+
"version": "1.17.3-beta-20251120-052956-035abea6",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -17,21 +17,21 @@
|
|
|
17
17
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
18
18
|
"license": "Apache-2.0",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@abtnode/analytics": "1.17.3-beta-
|
|
21
|
-
"@abtnode/auth": "1.17.3-beta-
|
|
22
|
-
"@abtnode/certificate-manager": "1.17.3-beta-
|
|
23
|
-
"@abtnode/constant": "1.17.3-beta-
|
|
24
|
-
"@abtnode/cron": "1.17.3-beta-
|
|
25
|
-
"@abtnode/db-cache": "1.17.3-beta-
|
|
26
|
-
"@abtnode/docker-utils": "1.17.3-beta-
|
|
27
|
-
"@abtnode/logger": "1.17.3-beta-
|
|
28
|
-
"@abtnode/models": "1.17.3-beta-
|
|
29
|
-
"@abtnode/queue": "1.17.3-beta-
|
|
30
|
-
"@abtnode/rbac": "1.17.3-beta-
|
|
31
|
-
"@abtnode/router-provider": "1.17.3-beta-
|
|
32
|
-
"@abtnode/static-server": "1.17.3-beta-
|
|
33
|
-
"@abtnode/timemachine": "1.17.3-beta-
|
|
34
|
-
"@abtnode/util": "1.17.3-beta-
|
|
20
|
+
"@abtnode/analytics": "1.17.3-beta-20251120-052956-035abea6",
|
|
21
|
+
"@abtnode/auth": "1.17.3-beta-20251120-052956-035abea6",
|
|
22
|
+
"@abtnode/certificate-manager": "1.17.3-beta-20251120-052956-035abea6",
|
|
23
|
+
"@abtnode/constant": "1.17.3-beta-20251120-052956-035abea6",
|
|
24
|
+
"@abtnode/cron": "1.17.3-beta-20251120-052956-035abea6",
|
|
25
|
+
"@abtnode/db-cache": "1.17.3-beta-20251120-052956-035abea6",
|
|
26
|
+
"@abtnode/docker-utils": "1.17.3-beta-20251120-052956-035abea6",
|
|
27
|
+
"@abtnode/logger": "1.17.3-beta-20251120-052956-035abea6",
|
|
28
|
+
"@abtnode/models": "1.17.3-beta-20251120-052956-035abea6",
|
|
29
|
+
"@abtnode/queue": "1.17.3-beta-20251120-052956-035abea6",
|
|
30
|
+
"@abtnode/rbac": "1.17.3-beta-20251120-052956-035abea6",
|
|
31
|
+
"@abtnode/router-provider": "1.17.3-beta-20251120-052956-035abea6",
|
|
32
|
+
"@abtnode/static-server": "1.17.3-beta-20251120-052956-035abea6",
|
|
33
|
+
"@abtnode/timemachine": "1.17.3-beta-20251120-052956-035abea6",
|
|
34
|
+
"@abtnode/util": "1.17.3-beta-20251120-052956-035abea6",
|
|
35
35
|
"@aigne/aigne-hub": "^0.10.9",
|
|
36
36
|
"@arcblock/did": "^1.27.7",
|
|
37
37
|
"@arcblock/did-connect-js": "^1.27.7",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"@arcblock/pm2-events": "^0.0.5",
|
|
44
44
|
"@arcblock/validator": "^1.27.7",
|
|
45
45
|
"@arcblock/vc": "^1.27.7",
|
|
46
|
-
"@blocklet/constant": "1.17.3-beta-
|
|
46
|
+
"@blocklet/constant": "1.17.3-beta-20251120-052956-035abea6",
|
|
47
47
|
"@blocklet/did-space-js": "^1.2.4",
|
|
48
|
-
"@blocklet/env": "1.17.3-beta-
|
|
48
|
+
"@blocklet/env": "1.17.3-beta-20251120-052956-035abea6",
|
|
49
49
|
"@blocklet/error": "^0.3.3",
|
|
50
|
-
"@blocklet/meta": "1.17.3-beta-
|
|
51
|
-
"@blocklet/resolver": "1.17.3-beta-
|
|
52
|
-
"@blocklet/sdk": "1.17.3-beta-
|
|
53
|
-
"@blocklet/server-js": "1.17.3-beta-
|
|
54
|
-
"@blocklet/store": "1.17.3-beta-
|
|
50
|
+
"@blocklet/meta": "1.17.3-beta-20251120-052956-035abea6",
|
|
51
|
+
"@blocklet/resolver": "1.17.3-beta-20251120-052956-035abea6",
|
|
52
|
+
"@blocklet/sdk": "1.17.3-beta-20251120-052956-035abea6",
|
|
53
|
+
"@blocklet/server-js": "1.17.3-beta-20251120-052956-035abea6",
|
|
54
|
+
"@blocklet/store": "1.17.3-beta-20251120-052956-035abea6",
|
|
55
55
|
"@blocklet/theme": "^3.2.6",
|
|
56
56
|
"@fidm/x509": "^1.2.1",
|
|
57
57
|
"@ocap/mcrypto": "^1.27.7",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"express": "^4.18.2",
|
|
117
117
|
"unzipper": "^0.10.11"
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "fe41f1c21bb8e3efcf42623e9b0d24c77563862a"
|
|
120
120
|
}
|