Sync DNS2 production changes - removed obsolete test suite and refactored structure

This commit is contained in:
Krystie
2026-03-23 10:47:15 +01:00
parent 1ac50918ab
commit d76644d948
288 changed files with 8965 additions and 15731 deletions

View File

@@ -185,7 +185,7 @@ class SelfUpdater extends EventEmitter {
const frontendSrc = this._findDir(stagingDir, 'status');
if (frontendSrc) {
await this._copyDir(frontendSrc, this.config.frontendDir, [
'dist', 'css', 'assets', 'vendor', 'index.html', 'sw.js',
'dist', 'css', 'assets', 'vendor', 'index.html', 'sw.js'
]);
this.emit('update-progress', { step: 'frontend-updated', version: remoteInfo.version });
}
@@ -209,7 +209,7 @@ class SelfUpdater extends EventEmitter {
};
await fsp.writeFile(
path.join(this.config.updatesDir, 'trigger.json'),
JSON.stringify(trigger, null, 2),
JSON.stringify(trigger, null, 2)
);
// The host-side systemd service will handle the rest.
@@ -312,7 +312,7 @@ class SelfUpdater extends EventEmitter {
this.status = 'waiting';
await fsp.writeFile(
path.join(this.config.updatesDir, 'trigger.json'),
JSON.stringify(trigger, null, 2),
JSON.stringify(trigger, null, 2)
);
this._addToHistory({
@@ -412,12 +412,12 @@ class SelfUpdater extends EventEmitter {
try {
resolve(JSON.parse(data));
} catch (e) {
reject(new Error(`Invalid JSON from ${ url}`));
reject(new Error('Invalid JSON from ' + url));
}
});
});
req.on('error', reject);
req.on('timeout', () => { req.destroy(); reject(new Error(`Timeout fetching ${ url}`)); });
req.on('timeout', () => { req.destroy(); reject(new Error('Timeout fetching ' + url)); });
});
}
@@ -459,7 +459,7 @@ class SelfUpdater extends EventEmitter {
try {
execSync(`tar xzf "${tarballPath}" -C "${destDir}" --strip-components=1`, { stdio: 'pipe' });
} catch (e) {
throw new Error(`Failed to extract tarball: ${ e.message}`);
throw new Error('Failed to extract tarball: ' + e.message);
}
}