parrot-blackbox 1.0.14 → 1.0.15
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/package.json +2 -2
- package/src/cli.js +15 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parrot-blackbox",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.15",
|
|
4
|
+
"description": "Crash-proof, multi-cloud backup & recovery automation for Parrot OS. Daily/weekly off-disk backups with automatic catch-up, smart storage across many MEGA + Google Drive accounts, Timeshift snapshot backups and one-command restore.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/cli.js",
|
|
7
7
|
"bin": {
|
package/src/cli.js
CHANGED
|
@@ -538,6 +538,21 @@ const main = defineCommand({
|
|
|
538
538
|
s.stop('✖ Upload failed');
|
|
539
539
|
console.error(`_internal_upload failed: ${e.message}`);
|
|
540
540
|
process.exitCode = 1;
|
|
541
|
+
} finally {
|
|
542
|
+
// If we are running as root via sudo, rclone might have refreshed OAuth tokens
|
|
543
|
+
// and rewritten rclone.conf as root:root. Restore ownership to the real user.
|
|
544
|
+
if (process.getuid && process.getuid() === 0 && process.env.SUDO_UID && process.env.SUDO_GID) {
|
|
545
|
+
import('node:fs').then(fs => {
|
|
546
|
+
import('node:path').then(path => {
|
|
547
|
+
const confPath = path.join(process.env.HOME, '.config', 'rclone', 'rclone.conf');
|
|
548
|
+
if (fs.existsSync(confPath)) {
|
|
549
|
+
try {
|
|
550
|
+
fs.chownSync(confPath, parseInt(process.env.SUDO_UID, 10), parseInt(process.env.SUDO_GID, 10));
|
|
551
|
+
} catch { /* best effort */ }
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
});
|
|
555
|
+
}
|
|
541
556
|
}
|
|
542
557
|
return;
|
|
543
558
|
}
|