mirror of
https://github.com/whyour/qinglong.git
synced 2026-12-01 09:45:36 +08:00
fix: address dependency and code scanning vulnerabilities
Upgrade SQLite to 1.1.5 and tar to 7.5.23 without a tar override. Update Umi, React Router, uuid, lint-staged and compatible transitive security fixes while retaining the existing ProLayout version. Constrain script file operations to checked paths, serialize Python environment values safely, and keep resource-intensive API limits with room for normal bulk use. Avoid dynamic child-process code in upgrade tests and load offline installer scripts from a fixed working directory. Cover dependency compatibility, rate limits, offline recovery and npm packaging, including the decoder patch required by existing Umi consumers.
This commit is contained in:
1 parent
0902bc074d
commit
9023a654df
20 files changed
+3055
-2752
No files matched your search
@@ -8,6 +8,30 @@ const {
|
||||
const artifacts = require('../../cli/src/internal/maintenance/upgradeArtifacts.cjs');
|
||||
const { installBundle } = require('../../shell/install-bundle.cjs');
|
||||
|
||||
test('offline environment loading treats installation paths as data and preserves the caller directory', async (t) => {
|
||||
const directory = await fs.mkdtemp(path.join(require('node:os').tmpdir(), 'ql-offline-path-'));
|
||||
t.after(() => fs.rm(directory, { recursive: true, force: true }));
|
||||
const root = path.join(directory, 'panel space \' " $(echo injected) `echo injected`;');
|
||||
await fs.mkdir(path.join(root, 'shell'), { recursive: true });
|
||||
await fs.writeFile(path.join(root, 'shell/share.sh'), 'import_config() { ql_port=5789; ql_base_url=/panel/; }\n');
|
||||
await fs.writeFile(path.join(root, 'shell/env.sh'), 'export QL_BRANCH=develop\n');
|
||||
const cwd = process.cwd();
|
||||
let captured;
|
||||
t.mock.method(artifacts, 'stageUpgrade', async ({ env }) => {
|
||||
captured = env;
|
||||
throw new Error('reached staging');
|
||||
});
|
||||
await assert.rejects(installBundle(
|
||||
['--file', path.join(root, 'unused.tar.gz'), '--download-only'],
|
||||
{ ...process.env, QL_DIR: root },
|
||||
), /reached staging/);
|
||||
assert.equal(captured.QL_DIR, root);
|
||||
assert.equal(captured.QlPort, '5789');
|
||||
assert.equal(captured.QlBaseUrl, '/panel/');
|
||||
assert.equal(captured.QL_BRANCH, 'develop');
|
||||
assert.equal(process.cwd(), cwd);
|
||||
});
|
||||
|
||||
for (const scenario of ['cancel-new-start', 'both-starts-fail'])
|
||||
test(`offline application restores files and records failure: ${scenario}`, async (t) => {
|
||||
const f = await manualUpgradeFixture(t);
|
||||
|
||||
Reference in new issue
Block a user