@abtnode/core 1.16.47-beta-20250730-070104-87a128a5 → 1.16.47-beta-20250801-094129-1ba43aaa
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 +27 -0
- package/lib/api/team.js +5 -0
- package/lib/blocklet/manager/disk.js +5 -0
- package/lib/blocklet/migration-dist/migration.cjs +1 -1
- package/lib/blocklet/security/security-rule.js +14 -3
- package/lib/event/index.js +1 -1
- package/lib/index.js +1 -0
- package/lib/states/blocklet.js +6 -1
- package/lib/states/node.js +10 -0
- package/lib/states/notification.js +4 -4
- package/lib/team/manager.js +1 -1
- package/lib/util/docker/docker-backup-pg-blocklet-db.js +3 -3
- package/lib/util/docker/ensure-docker-postgres.js +5 -3
- package/lib/util/migration-sqlite-to-postgres.js +2 -2
- package/package.json +26 -26
package/lib/api/node.js
CHANGED
|
@@ -10,6 +10,8 @@ const canPackageReadWrite = require('@abtnode/util/lib/can-pkg-rw');
|
|
|
10
10
|
const { toDelegateAddress } = require('@arcblock/did-util');
|
|
11
11
|
const { MONITOR_RECORD_INTERVAL_SEC, NODE_MODES } = require('@abtnode/constant');
|
|
12
12
|
const { getLauncherInfo } = require('@abtnode/auth/lib/launcher');
|
|
13
|
+
const { getProvider } = require('@abtnode/router-provider/lib');
|
|
14
|
+
const get = require('lodash/get');
|
|
13
15
|
|
|
14
16
|
const logger = require('@abtnode/logger')('@abtnode/core:api:node');
|
|
15
17
|
|
|
@@ -18,6 +20,7 @@ const { validateNodeInfo, validateUpdateGateway } = require('../validators/node'
|
|
|
18
20
|
const { getAll } = require('../blocklet/manager/engine');
|
|
19
21
|
const { getDelegateState } = require('../util');
|
|
20
22
|
const { NodeRuntimeMonitor } = require('../monitor/node-runtime-monitor');
|
|
23
|
+
const { hasMigratedToPostgres } = require('../util/migration-sqlite-to-postgres');
|
|
21
24
|
const getHistoryList = require('../monitor/get-history-list');
|
|
22
25
|
|
|
23
26
|
class NodeAPI {
|
|
@@ -103,10 +106,33 @@ class NodeAPI {
|
|
|
103
106
|
return diskInfo;
|
|
104
107
|
}
|
|
105
108
|
|
|
109
|
+
async getServerProviders({ dataDir } = {}) {
|
|
110
|
+
const nodeInfo = await this.state.read();
|
|
111
|
+
const name = get(nodeInfo, 'routing.provider', null);
|
|
112
|
+
const Provider = getProvider(name);
|
|
113
|
+
const routerProvider = [name, Provider.version].join('@');
|
|
114
|
+
const dataPath = dataDir || process.env.ABT_NODE_DATA_DIR;
|
|
115
|
+
const postgresVersion = process.env.ABT_NODE_POSTGRES_VERSION || '17.5';
|
|
116
|
+
let dbProvider = '';
|
|
117
|
+
if (hasMigratedToPostgres(dataPath)) {
|
|
118
|
+
dbProvider = `PostgresGQL@${postgresVersion}`;
|
|
119
|
+
} else {
|
|
120
|
+
const sqliteVersion = await this.state.getSqliteVersion();
|
|
121
|
+
dbProvider = sqliteVersion ? `SQLite@${sqliteVersion}` : 'SQLite';
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
routerProvider,
|
|
126
|
+
...(dbProvider ? { dbProvider } : {}),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
106
130
|
async getEnv() {
|
|
107
131
|
const info = await IP.get({ timeout: 5000 });
|
|
108
132
|
info.internalV4 = info.internal;
|
|
109
133
|
info.externalV4 = info.external;
|
|
134
|
+
// get router provider info
|
|
135
|
+
const providers = await this.getServerProviders();
|
|
110
136
|
|
|
111
137
|
const res = {
|
|
112
138
|
ip: info,
|
|
@@ -116,6 +142,7 @@ class NodeAPI {
|
|
|
116
142
|
blockletEngines: getAll(),
|
|
117
143
|
gitpod: isGitpod(),
|
|
118
144
|
disk: await this.getDiskInfo(),
|
|
145
|
+
...providers,
|
|
119
146
|
};
|
|
120
147
|
|
|
121
148
|
return res;
|
package/lib/api/team.js
CHANGED
|
@@ -7,6 +7,7 @@ const throttle = require('lodash/throttle');
|
|
|
7
7
|
const cloneDeep = require('@abtnode/util/lib/deep-clone');
|
|
8
8
|
const { joinURL, withoutTrailingSlash } = require('ufo');
|
|
9
9
|
const { Op } = require('sequelize');
|
|
10
|
+
const dayjs = require('@abtnode/util/lib/dayjs');
|
|
10
11
|
|
|
11
12
|
const logger = require('@abtnode/logger')('@abtnode/core:api:team');
|
|
12
13
|
const {
|
|
@@ -948,6 +949,10 @@ class TeamAPI extends EventEmitter {
|
|
|
948
949
|
throw new Error('Role cannot be empty');
|
|
949
950
|
}
|
|
950
951
|
|
|
952
|
+
if (passportExpireTime && dayjs(passportExpireTime).isBefore(dayjs())) {
|
|
953
|
+
throw new Error('Passport expire time must be greater than current time');
|
|
954
|
+
}
|
|
955
|
+
|
|
951
956
|
const roles = await this.getRoles({ teamDid });
|
|
952
957
|
const role = roles.find((r) => r.name === roleName);
|
|
953
958
|
if (!role) {
|
|
@@ -1147,6 +1147,11 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
1147
1147
|
try {
|
|
1148
1148
|
const blocklet = await this.getBlocklet(input.appPid);
|
|
1149
1149
|
if (blocklet) {
|
|
1150
|
+
this.emit(BlockletEvents.restoreProgress, {
|
|
1151
|
+
appDid: input.appDid,
|
|
1152
|
+
meta: { did: input.appPid },
|
|
1153
|
+
status: RESTORE_PROGRESS_STATUS.waiting,
|
|
1154
|
+
});
|
|
1150
1155
|
await this.delete({ did: input.appPid, keepData: false, keepLogsDir: false, keepConfigs: false }, context);
|
|
1151
1156
|
}
|
|
1152
1157
|
} catch (error) {
|
|
@@ -38918,7 +38918,7 @@ module.exports = require("zlib");
|
|
|
38918
38918
|
/***/ ((module) => {
|
|
38919
38919
|
|
|
38920
38920
|
"use strict";
|
|
38921
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.16.46","description":"","main":"lib/index.js","files":["lib"],"scripts":{"lint":"eslint tests lib --ignore-pattern \'tests/assets/*\'","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"keywords":[],"author":"wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)","license":"Apache-2.0","dependencies":{"@abtnode/analytics":"1.16.46","@abtnode/auth":"1.16.46","@abtnode/certificate-manager":"1.16.46","@abtnode/client":"1.16.46","@abtnode/constant":"1.16.46","@abtnode/cron":"1.16.46","@abtnode/db-cache":"1.16.46","@abtnode/docker-utils":"1.16.46","@abtnode/logger":"1.16.46","@abtnode/models":"1.16.46","@abtnode/queue":"1.16.46","@abtnode/rbac":"1.16.46","@abtnode/router-provider":"1.16.46","@abtnode/static-server":"1.16.46","@abtnode/timemachine":"1.16.46","@abtnode/util":"1.16.46","@aigne/aigne-hub":"^0.2.2","@arcblock/did":"1.21.0","@arcblock/did-auth":"1.21.0","@arcblock/did-ext":"1.21.0","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"1.21.0","@arcblock/event-hub":"1.21.0","@arcblock/jwt":"1.21.0","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"1.21.0","@arcblock/vc":"1.21.0","@blocklet/constant":"1.16.46","@blocklet/did-space-js":"^1.1.
|
|
38921
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.16.46","description":"","main":"lib/index.js","files":["lib"],"scripts":{"lint":"eslint tests lib --ignore-pattern \'tests/assets/*\'","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"keywords":[],"author":"wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)","license":"Apache-2.0","dependencies":{"@abtnode/analytics":"1.16.46","@abtnode/auth":"1.16.46","@abtnode/certificate-manager":"1.16.46","@abtnode/client":"1.16.46","@abtnode/constant":"1.16.46","@abtnode/cron":"1.16.46","@abtnode/db-cache":"1.16.46","@abtnode/docker-utils":"1.16.46","@abtnode/logger":"1.16.46","@abtnode/models":"1.16.46","@abtnode/queue":"1.16.46","@abtnode/rbac":"1.16.46","@abtnode/router-provider":"1.16.46","@abtnode/static-server":"1.16.46","@abtnode/timemachine":"1.16.46","@abtnode/util":"1.16.46","@aigne/aigne-hub":"^0.2.2","@arcblock/did":"1.21.0","@arcblock/did-auth":"1.21.0","@arcblock/did-ext":"1.21.0","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"1.21.0","@arcblock/event-hub":"1.21.0","@arcblock/jwt":"1.21.0","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"1.21.0","@arcblock/vc":"1.21.0","@blocklet/constant":"1.16.46","@blocklet/did-space-js":"^1.1.11","@blocklet/env":"1.16.46","@blocklet/error":"^0.2.5","@blocklet/meta":"1.16.46","@blocklet/resolver":"1.16.46","@blocklet/sdk":"1.16.46","@blocklet/store":"1.16.46","@blocklet/theme":"^3.0.37","@fidm/x509":"^1.2.1","@ocap/mcrypto":"1.21.0","@ocap/util":"1.21.0","@ocap/wallet":"1.21.0","@slack/webhook":"^5.0.4","archiver":"^7.0.1","axios":"^1.7.9","axon":"^2.0.3","chalk":"^4.1.2","cross-spawn":"^7.0.3","dayjs":"^1.11.13","deep-diff":"^1.0.2","detect-port":"^1.5.1","envfile":"^7.1.0","escape-string-regexp":"^4.0.0","fast-glob":"^3.3.2","filesize":"^10.1.1","flat":"^5.0.2","fs-extra":"^11.2.0","get-port":"^5.1.1","hasha":"^5.2.2","is-base64":"^1.1.0","is-cidr":"4","is-ip":"3","is-url":"^1.2.4","joi":"17.12.2","joi-extension-semver":"^5.0.0","js-yaml":"^4.1.0","kill-port":"^2.0.1","lodash":"^4.17.21","node-stream-zip":"^1.15.0","p-all":"^3.0.0","p-limit":"^3.1.0","p-map":"^4.0.0","p-retry":"^4.6.2","p-wait-for":"^3.2.0","rate-limiter-flexible":"^5.0.5","read-last-lines":"^1.8.0","semver":"^7.6.3","sequelize":"^6.35.0","shelljs":"^0.8.5","slugify":"^1.6.6","ssri":"^8.0.1","stream-throttle":"^0.1.3","stream-to-promise":"^3.0.0","systeminformation":"^5.23.3","tail":"^2.2.4","tar":"^6.1.11","transliteration":"^2.3.5","ua-parser-js":"^1.0.2","ufo":"^1.5.3","uuid":"^11.1.0","valid-url":"^1.0.9","which":"^2.0.2","xbytes":"^1.8.0"},"devDependencies":{"expand-tilde":"^2.0.2","express":"^4.18.2","jest":"^29.7.0","unzipper":"^0.10.11"},"gitHead":"e5764f753181ed6a7c615cd4fc6682aacf0cb7cd"}');
|
|
38922
38922
|
|
|
38923
38923
|
/***/ }),
|
|
38924
38924
|
|
|
@@ -69,16 +69,26 @@ async function addBlockletSecurityRule({ teamManager }, { did, data }) {
|
|
|
69
69
|
this.emit(BlockletEvents.securityConfigUpdated, { did });
|
|
70
70
|
return result;
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const { securityRuleState } = await teamManager.getSecurityState(did);
|
|
72
|
+
|
|
73
|
+
function parseUpdateBlockletSecurityRule(data) {
|
|
75
74
|
const { value, error } = securityRuleSchema
|
|
76
75
|
.concat(
|
|
77
76
|
Joi.object({
|
|
78
77
|
id: Joi.string().required(),
|
|
78
|
+
componentDid: Joi.when('id', {
|
|
79
|
+
is: 'default',
|
|
80
|
+
then: Joi.optional().strip(), // 当 id 为 'default' 时删除 componentDid 字段
|
|
81
|
+
otherwise: securityRuleSchema.extract('componentDid'),
|
|
82
|
+
}),
|
|
79
83
|
})
|
|
80
84
|
)
|
|
81
85
|
.validate(data);
|
|
86
|
+
return { value, error };
|
|
87
|
+
}
|
|
88
|
+
// HACK: 由于需要使用 this.emit,所以这里不能使用箭头函数(尝试过传入 emit,会报错,目前只能这样)
|
|
89
|
+
async function updateBlockletSecurityRule({ teamManager }, { did, data }) {
|
|
90
|
+
const { securityRuleState } = await teamManager.getSecurityState(did);
|
|
91
|
+
const { value, error } = parseUpdateBlockletSecurityRule(data);
|
|
82
92
|
if (error) {
|
|
83
93
|
logger.error('Failed to update blocklet security rule', {
|
|
84
94
|
error,
|
|
@@ -124,4 +134,5 @@ module.exports = {
|
|
|
124
134
|
updateBlockletSecurityRule,
|
|
125
135
|
deleteBlockletSecurityRule,
|
|
126
136
|
initializeDefaultData,
|
|
137
|
+
parseUpdateBlockletSecurityRule,
|
|
127
138
|
};
|
package/lib/event/index.js
CHANGED
|
@@ -22,7 +22,7 @@ const {
|
|
|
22
22
|
} = require('@abtnode/constant');
|
|
23
23
|
const { joinURL } = require('ufo');
|
|
24
24
|
const { encode } = require('@abtnode/util/lib/base32');
|
|
25
|
-
const dayjs = require('dayjs');
|
|
25
|
+
const dayjs = require('@abtnode/util/lib/dayjs');
|
|
26
26
|
|
|
27
27
|
const { NodeMonitSender } = require('../monitor/node-monit-sender');
|
|
28
28
|
const { isCLI } = require('../util');
|
package/lib/index.js
CHANGED
|
@@ -461,6 +461,7 @@ function ABTNode(options) {
|
|
|
461
461
|
// Node State
|
|
462
462
|
getNodeInfo: nodeAPI.getInfo.bind(nodeAPI),
|
|
463
463
|
getNodeEnv: nodeAPI.getEnv.bind(nodeAPI),
|
|
464
|
+
getServerProviders: nodeAPI.getServerProviders.bind(nodeAPI),
|
|
464
465
|
updateNodeInfo: nodeAPI.updateNodeInfo.bind(nodeAPI),
|
|
465
466
|
getDelegationState: nodeAPI.getDelegationState.bind(nodeAPI),
|
|
466
467
|
cleanupDirtyMaintainState: states.node.cleanupDirtyMaintainState.bind(states.node),
|
package/lib/states/blocklet.js
CHANGED
|
@@ -249,7 +249,12 @@ class BlockletState extends BaseState {
|
|
|
249
249
|
try {
|
|
250
250
|
fixPerson(meta);
|
|
251
251
|
fixInterfaces(meta);
|
|
252
|
-
|
|
252
|
+
const { requirements, ...rest } = meta;
|
|
253
|
+
let sanitized = validateBlockletMeta(rest);
|
|
254
|
+
// 补充传入的 requirements.aigne 字段
|
|
255
|
+
if (sanitized.requirements && requirements) {
|
|
256
|
+
sanitized.requirements.aigne = requirements.aigne || false;
|
|
257
|
+
}
|
|
253
258
|
// bundle info
|
|
254
259
|
sanitized = ensureMeta(sanitized);
|
|
255
260
|
sanitized = omit(sanitized, ['htmlAst']);
|
package/lib/states/node.js
CHANGED
|
@@ -175,6 +175,16 @@ class NodeState extends BaseState {
|
|
|
175
175
|
return this.cache.autoCache(this.cacheGroup, () => this._read());
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
async getSqliteVersion() {
|
|
179
|
+
try {
|
|
180
|
+
const [result] = await this.model.sequelize.query('SELECT sqlite_version();');
|
|
181
|
+
return result[0]['sqlite_version()'];
|
|
182
|
+
} catch (err) {
|
|
183
|
+
logger.error('getSqliteVersion failed', { err });
|
|
184
|
+
return '';
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
178
188
|
// FIXME: 这个接口比较危险,可能会修改一些本不应该修改的字段,后续需要考虑改进
|
|
179
189
|
async updateNodeInfo(entity = {}) {
|
|
180
190
|
await this.deleteCache();
|
|
@@ -265,13 +265,13 @@ class NotificationState extends BaseState {
|
|
|
265
265
|
const sourceOrComponentDid = [];
|
|
266
266
|
sourceOrComponentDid.push('n.source IN (:source)');
|
|
267
267
|
if (componentDid && componentDid.length) {
|
|
268
|
-
sourceOrComponentDid.push('n.componentDid IN (:componentDid)');
|
|
268
|
+
sourceOrComponentDid.push('n."componentDid" IN (:componentDid)');
|
|
269
269
|
replacements.componentDid = componentDid;
|
|
270
270
|
}
|
|
271
271
|
conditions.push(`(${sourceOrComponentDid.join(' OR ')})`);
|
|
272
272
|
replacements.source = source;
|
|
273
273
|
} else if (componentDid && componentDid.length) {
|
|
274
|
-
conditions.push('n.componentDid IN (:componentDid)');
|
|
274
|
+
conditions.push('n."componentDid" IN (:componentDid)');
|
|
275
275
|
replacements.componentDid = componentDid;
|
|
276
276
|
}
|
|
277
277
|
|
|
@@ -893,13 +893,13 @@ class NotificationState extends BaseState {
|
|
|
893
893
|
const sourceOrComponentDid = [];
|
|
894
894
|
sourceOrComponentDid.push('n.source IN (:source)');
|
|
895
895
|
if (componentDid && componentDid.length) {
|
|
896
|
-
sourceOrComponentDid.push('n.componentDid IN (:componentDid)');
|
|
896
|
+
sourceOrComponentDid.push('n."componentDid" IN (:componentDid)');
|
|
897
897
|
replacements.componentDid = componentDid;
|
|
898
898
|
}
|
|
899
899
|
conditions.push(`(${sourceOrComponentDid.join(' OR ')})`);
|
|
900
900
|
replacements.source = source;
|
|
901
901
|
} else if (componentDid && componentDid.length) {
|
|
902
|
-
conditions.push('n.componentDid IN (:componentDid)');
|
|
902
|
+
conditions.push('n."componentDid" IN (:componentDid)');
|
|
903
903
|
replacements.componentDid = componentDid;
|
|
904
904
|
}
|
|
905
905
|
|
package/lib/team/manager.js
CHANGED
|
@@ -26,7 +26,7 @@ const {
|
|
|
26
26
|
const { isActivityIncluded } = require('@abtnode/util/lib/notification-preview/util');
|
|
27
27
|
const { joinURL, withHttps } = require('ufo');
|
|
28
28
|
const { isCustomDomain } = require('@abtnode/util/lib/url-evaluation');
|
|
29
|
-
const dayjs = require('dayjs');
|
|
29
|
+
const dayjs = require('@abtnode/util/lib/dayjs');
|
|
30
30
|
const { getDidDomainForBlocklet } = require('@abtnode/util/lib/get-domain-for-blocklet');
|
|
31
31
|
const getBlockletInfo = require('@blocklet/meta/lib/info');
|
|
32
32
|
const { getDomainsByDid } = require('../router/helper');
|
|
@@ -5,7 +5,7 @@ const promiseSpawn = require('@abtnode/util/lib/promise-spawn');
|
|
|
5
5
|
const logger = require('@abtnode/logger')('backup-pg-blocklet-db');
|
|
6
6
|
|
|
7
7
|
const { POSTGRES_CONTAINER_NAME } = require('./ensure-docker-postgres');
|
|
8
|
-
const {
|
|
8
|
+
const { hasMigratedToPostgres } = require('../migration-sqlite-to-postgres');
|
|
9
9
|
|
|
10
10
|
// 最长 1 小时, 因为特别大的表, pg_dump 会很久
|
|
11
11
|
const baseSpawnOptions = { timeout: 3600_000, retry: 0 };
|
|
@@ -49,7 +49,7 @@ function getPgUrl() {
|
|
|
49
49
|
|
|
50
50
|
const dockerBackupPgBlockletDb = async (dbPath) => {
|
|
51
51
|
const dataDir = getBlockletDataRoot(dbPath);
|
|
52
|
-
if (!
|
|
52
|
+
if (!hasMigratedToPostgres(dataDir)) {
|
|
53
53
|
logger.info('no using postgres, skip backup the pg blocklet db:', dbPath);
|
|
54
54
|
return {};
|
|
55
55
|
}
|
|
@@ -87,7 +87,7 @@ const dockerBackupPgBlockletDb = async (dbPath) => {
|
|
|
87
87
|
|
|
88
88
|
const dockerRestorePgBlockletDb = async (dbPath) => {
|
|
89
89
|
const dataDir = getBlockletDataRoot(dbPath);
|
|
90
|
-
if (!
|
|
90
|
+
if (!hasMigratedToPostgres(dataDir)) {
|
|
91
91
|
logger.info('no using postgres, skip restore the pg blocklet db:', dbPath);
|
|
92
92
|
return {};
|
|
93
93
|
}
|
|
@@ -6,7 +6,7 @@ const fs = require('fs');
|
|
|
6
6
|
const { Sequelize } = require('sequelize');
|
|
7
7
|
|
|
8
8
|
const { checkDockerInstalled } = require('./check-docker-installed');
|
|
9
|
-
const {
|
|
9
|
+
const { hasMigratedToPostgres } = require('../migration-sqlite-to-postgres');
|
|
10
10
|
|
|
11
11
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
12
12
|
|
|
@@ -41,7 +41,7 @@ async function _ensureDockerPostgres(dataDir, name = 'abtnode-postgres', port =
|
|
|
41
41
|
return '';
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
if (!
|
|
44
|
+
if (!hasMigratedToPostgres(dataDir) && !force) {
|
|
45
45
|
return '';
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -60,6 +60,8 @@ async function _ensureDockerPostgres(dataDir, name = 'abtnode-postgres', port =
|
|
|
60
60
|
fs.mkdirSync(path.join(dataDir, 'core'), { recursive: true });
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
const postgresVersion = process.env.ABT_NODE_POSTGRES_VERSION || '17.5';
|
|
64
|
+
|
|
63
65
|
const runCmd = [
|
|
64
66
|
'docker run -d',
|
|
65
67
|
`--name ${name}`,
|
|
@@ -70,7 +72,7 @@ async function _ensureDockerPostgres(dataDir, name = 'abtnode-postgres', port =
|
|
|
70
72
|
'-e POSTGRES_PASSWORD=postgres',
|
|
71
73
|
'-e POSTGRES_USER=postgres',
|
|
72
74
|
'-e POSTGRES_DB=postgres',
|
|
73
|
-
|
|
75
|
+
`postgres:${postgresVersion}`,
|
|
74
76
|
'-c max_connections=200',
|
|
75
77
|
].join(' ');
|
|
76
78
|
|
|
@@ -424,7 +424,7 @@ async function findBlockletDbFiles(dataDir) {
|
|
|
424
424
|
return results;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
-
function
|
|
427
|
+
function hasMigratedToPostgres(dataDir) {
|
|
428
428
|
const lockPath = path.join(dataDir, 'core', 'sqlite-to-postgres.lock');
|
|
429
429
|
const hasLock = fs.existsSync(lockPath);
|
|
430
430
|
return hasLock;
|
|
@@ -487,6 +487,6 @@ async function migrationSqliteToPostgres(dataDir, dbPaths) {
|
|
|
487
487
|
|
|
488
488
|
module.exports = {
|
|
489
489
|
migrationSqliteToPostgres,
|
|
490
|
-
|
|
490
|
+
hasMigratedToPostgres,
|
|
491
491
|
removePostgresLock,
|
|
492
492
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.47-beta-
|
|
6
|
+
"version": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,22 +19,22 @@
|
|
|
19
19
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@abtnode/analytics": "1.16.47-beta-
|
|
23
|
-
"@abtnode/auth": "1.16.47-beta-
|
|
24
|
-
"@abtnode/certificate-manager": "1.16.47-beta-
|
|
25
|
-
"@abtnode/client": "1.16.47-beta-
|
|
26
|
-
"@abtnode/constant": "1.16.47-beta-
|
|
27
|
-
"@abtnode/cron": "1.16.47-beta-
|
|
28
|
-
"@abtnode/db-cache": "1.16.47-beta-
|
|
29
|
-
"@abtnode/docker-utils": "1.16.47-beta-
|
|
30
|
-
"@abtnode/logger": "1.16.47-beta-
|
|
31
|
-
"@abtnode/models": "1.16.47-beta-
|
|
32
|
-
"@abtnode/queue": "1.16.47-beta-
|
|
33
|
-
"@abtnode/rbac": "1.16.47-beta-
|
|
34
|
-
"@abtnode/router-provider": "1.16.47-beta-
|
|
35
|
-
"@abtnode/static-server": "1.16.47-beta-
|
|
36
|
-
"@abtnode/timemachine": "1.16.47-beta-
|
|
37
|
-
"@abtnode/util": "1.16.47-beta-
|
|
22
|
+
"@abtnode/analytics": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
23
|
+
"@abtnode/auth": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
24
|
+
"@abtnode/certificate-manager": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
25
|
+
"@abtnode/client": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
26
|
+
"@abtnode/constant": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
27
|
+
"@abtnode/cron": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
28
|
+
"@abtnode/db-cache": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
29
|
+
"@abtnode/docker-utils": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
30
|
+
"@abtnode/logger": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
31
|
+
"@abtnode/models": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
32
|
+
"@abtnode/queue": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
33
|
+
"@abtnode/rbac": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
34
|
+
"@abtnode/router-provider": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
35
|
+
"@abtnode/static-server": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
36
|
+
"@abtnode/timemachine": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
37
|
+
"@abtnode/util": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
38
38
|
"@aigne/aigne-hub": "^0.2.2",
|
|
39
39
|
"@arcblock/did": "1.21.0",
|
|
40
40
|
"@arcblock/did-auth": "1.21.0",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"@arcblock/pm2-events": "^0.0.5",
|
|
47
47
|
"@arcblock/validator": "1.21.0",
|
|
48
48
|
"@arcblock/vc": "1.21.0",
|
|
49
|
-
"@blocklet/constant": "1.16.47-beta-
|
|
50
|
-
"@blocklet/did-space-js": "^1.1.
|
|
51
|
-
"@blocklet/env": "1.16.47-beta-
|
|
49
|
+
"@blocklet/constant": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
50
|
+
"@blocklet/did-space-js": "^1.1.11",
|
|
51
|
+
"@blocklet/env": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
52
52
|
"@blocklet/error": "^0.2.5",
|
|
53
|
-
"@blocklet/meta": "1.16.47-beta-
|
|
54
|
-
"@blocklet/resolver": "1.16.47-beta-
|
|
55
|
-
"@blocklet/sdk": "1.16.47-beta-
|
|
56
|
-
"@blocklet/store": "1.16.47-beta-
|
|
57
|
-
"@blocklet/theme": "^3.0.
|
|
53
|
+
"@blocklet/meta": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
54
|
+
"@blocklet/resolver": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
55
|
+
"@blocklet/sdk": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
56
|
+
"@blocklet/store": "1.16.47-beta-20250801-094129-1ba43aaa",
|
|
57
|
+
"@blocklet/theme": "^3.0.37",
|
|
58
58
|
"@fidm/x509": "^1.2.1",
|
|
59
59
|
"@ocap/mcrypto": "1.21.0",
|
|
60
60
|
"@ocap/util": "1.21.0",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"jest": "^29.7.0",
|
|
118
118
|
"unzipper": "^0.10.11"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "0c90ec548e798d7ca264c37189b3887769591047"
|
|
121
121
|
}
|