@abtnode/util 1.16.28-beta-641c9f13 → 1.16.28-beta-32519531

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.
Files changed (2) hide show
  1. package/lib/security.js +7 -2
  2. package/package.json +7 -7
package/lib/security.js CHANGED
@@ -5,7 +5,7 @@ const semver = require('semver');
5
5
  const uniq = require('lodash/uniq');
6
6
  const { dirname, join, sep } = require('path');
7
7
  const resolve = require('resolve/sync');
8
- const { tmpdir } = require('os');
8
+ const { tmpdir, homedir } = require('os');
9
9
  const which = require('which');
10
10
 
11
11
  const encrypt = (m, s, i) => AES.encrypt(m, crypto.pbkdf2Sync(i, s, 256, 32, 'sha512').toString('hex'));
@@ -87,6 +87,7 @@ const getSecurityNodeOptions = (blocklet, enableFileSystemIsolation = true) => {
87
87
 
88
88
  const pm2Path = getPm2Path();
89
89
  const meiliSearchPath = findExecutable('meilisearch');
90
+ const blockletCliPath = findExecutable('blocklet');
90
91
 
91
92
  options.push(
92
93
  '--experimental-permission',
@@ -95,6 +96,7 @@ const getSecurityNodeOptions = (blocklet, enableFileSystemIsolation = true) => {
95
96
  blocklet.environmentObj.BLOCKLET_APP_DIR,
96
97
  blocklet.environmentObj.BLOCKLET_LOG_DIR,
97
98
  blocklet.environmentObj.BLOCKLET_CACHE_DIR,
99
+ join(blocklet.environmentObj.BLOCKLET_APP_DATA_DIR, '.projects'),
98
100
  tmpdir(),
99
101
  ].map((dir) => `--allow-fs-write=${dir}`),
100
102
  // @note: sqlite3 需要这个
@@ -109,6 +111,7 @@ const getSecurityNodeOptions = (blocklet, enableFileSystemIsolation = true) => {
109
111
  blocklet.environmentObj.BLOCKLET_MODE === BLOCKLET_MODES.DEVELOPMENT
110
112
  ) {
111
113
  options.push('--allow-worker', '--allow-fs-read=*');
114
+ options.push(`--allow-fs-write=${join(homedir(), '.npm', '_logs')}`);
112
115
  } else {
113
116
  options.push(
114
117
  ...[
@@ -120,9 +123,11 @@ const getSecurityNodeOptions = (blocklet, enableFileSystemIsolation = true) => {
120
123
  ...[
121
124
  join(blocklet.environmentObj.BLOCKLET_APP_DATA_DIR, '.config'),
122
125
  join(blocklet.environmentObj.BLOCKLET_APP_DATA_DIR, '.assets'),
126
+ join(blocklet.environmentObj.BLOCKLET_APP_DATA_DIR, '.projects'),
123
127
  pm2Path && dirname(dirname(dirname(dirname(pm2Path)))),
124
128
  meiliSearchPath && dirname(dirname(meiliSearchPath)),
125
- dirname(process.execPath),
129
+ blockletCliPath && dirname(blockletCliPath),
130
+ dirname(dirname(process.execPath)),
126
131
  process.cwd(),
127
132
  tmpdir(),
128
133
  ]
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.28-beta-641c9f13",
6
+ "version": "1.16.28-beta-32519531",
7
7
  "description": "ArcBlock's JavaScript utility",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,11 +18,11 @@
18
18
  "author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
19
19
  "license": "Apache-2.0",
20
20
  "dependencies": {
21
- "@abtnode/constant": "1.16.28-beta-641c9f13",
22
- "@abtnode/logger": "1.16.28-beta-641c9f13",
23
- "@arcblock/pm2": "^5.4.0-beta-2024-06-17-19-14-035",
24
- "@blocklet/constant": "1.16.28-beta-641c9f13",
25
- "@blocklet/meta": "1.16.28-beta-641c9f13",
21
+ "@abtnode/constant": "1.16.28-beta-32519531",
22
+ "@abtnode/logger": "1.16.28-beta-32519531",
23
+ "@arcblock/pm2": "^5.4.0",
24
+ "@blocklet/constant": "1.16.28-beta-32519531",
25
+ "@blocklet/meta": "1.16.28-beta-32519531",
26
26
  "@ocap/client": "1.18.123",
27
27
  "@ocap/mcrypto": "1.18.123",
28
28
  "@ocap/util": "1.18.123",
@@ -79,5 +79,5 @@
79
79
  "fs-extra": "^11.2.0",
80
80
  "jest": "^29.7.0"
81
81
  },
82
- "gitHead": "eb1fa63e4ed26fe5ba230845a318faa29408138b"
82
+ "gitHead": "db4586719871ff19d3a6db4baf0408ec121baafa"
83
83
  }