Compare commits

..

No commits in common. "a56594b1df14658b3d982f4617b8584968e95e64" and "a92147939d0c09c943a0b7099721c6032466227f" have entirely different histories.

3 changed files with 1 additions and 36 deletions

View File

@ -1,6 +1,6 @@
{
"name": "multi-hoster-uploader",
"version": "2.3.5",
"version": "2.3.4",
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
"main": "main.js",
"scripts": {

View File

@ -49,18 +49,6 @@ describe('backup-crypto', () => {
assert.deepStrictEqual(result, sampleConfig);
});
it('encrypt rejects empty password', () => {
assert.throws(() => encrypt(sampleConfig, ''), /Passwort/);
assert.throws(() => encrypt(sampleConfig, null), /Passwort/);
assert.throws(() => encrypt(sampleConfig, undefined), /Passwort/);
});
it('decrypt rejects empty password', () => {
const buf = encrypt(sampleConfig, 'valid');
assert.throws(() => decrypt(buf, ''), /Passwort/);
assert.throws(() => decrypt(buf, null), /Passwort/);
});
it('each encryption produces different output (random salt/iv)', () => {
const a = encrypt(sampleConfig, 'same');
const b = encrypt(sampleConfig, 'same');

View File

@ -131,27 +131,4 @@ describe('ConfigStore', () => {
assert.equal(config.globalSettings.scaleParallelUploads, false);
assert.equal(config.globalSettings.logFilePath, '');
});
it('concurrent saves preserve both sections', async () => {
const save1 = store.save({ hosters: { 'doodstream.com': [{ id: 'c1', enabled: true, authType: 'api', apiKey: 'concurrent-key' }] } });
const save2 = store.save({ globalSettings: { alwaysOnTop: true } });
await Promise.all([save1, save2]);
const config = store.load();
assert.equal(config.hosters['doodstream.com'][0].apiKey, 'concurrent-key');
assert.equal(config.globalSettings.alwaysOnTop, true);
});
it('backup recovery when main file is corrupted', () => {
// Write valid config first
fs.writeFileSync(store.filePath, JSON.stringify({
hosters: { 'doodstream.com': [{ id: 'bak-1', authType: 'api', apiKey: 'from-backup' }] },
hosterSettings: {}, globalSettings: {}, history: []
}), 'utf-8');
// Copy to backup
fs.copyFileSync(store.filePath, store.filePath + '.bak');
// Corrupt main file
fs.writeFileSync(store.filePath, 'CORRUPTED!!!', 'utf-8');
const config = store.load();
assert.equal(config.hosters['doodstream.com'][0].apiKey, 'from-backup');
});
});