omnius 1.0.899 → 1.0.901

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/index.js
3
- size: 39003716 bytes
4
- sha256: b6edef747f657c5b2a3d457343f93a79c376d250cf0aaffa2e59e7666d232f24
3
+ size: 39011177 bytes
4
+ sha256: aa20c94ffd6dd5b7c4c05db62ec87494608e39d47960e9a4fdd5b6de4562b427
@@ -694,6 +694,10 @@ function hasSystemDaemonUnit() {
694
694
 
695
695
  function installDesktopCompanion(nodeBin, omniusScript, user) {
696
696
  if (!user) return;
697
+ if (process.env.OMNIUS_SKIP_TRAY_INSTALL === "1") {
698
+ log("OMNIUS_SKIP_TRAY_INSTALL=1 — leaving the desktop tray companion unchanged.");
699
+ return;
700
+ }
697
701
  var helper = path.join(__dirname, "omnius-tray-install.cjs");
698
702
  if (!fs.existsSync(helper)) {
699
703
  warn("Desktop tray companion installer is missing from this package.");
@@ -705,6 +709,13 @@ function installDesktopCompanion(nodeBin, omniusScript, user) {
705
709
  var entry = cp.execFileSync("getent", ["passwd", user], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 5000 }).trim().split(":");
706
710
  if (entry[0] === user && entry[5]) userHome = entry[5];
707
711
  }
712
+ // An install with a redirected HOME (smoke tests, sandboxes) must never
713
+ // repoint the desktop owner's real indicator service at its throwaway prefix.
714
+ var ownHome = process.env.HOME && path.resolve(process.env.HOME);
715
+ if (process.getuid && process.getuid() !== 0 && ownHome && ownHome !== path.resolve(userHome)) {
716
+ log("HOME is redirected away from " + userHome + " — leaving the desktop tray companion unchanged.");
717
+ return;
718
+ }
708
719
  cp.execFileSync(nodeBin, [helper, "--node", nodeBin, "--entrypoint", omniusScript,
709
720
  "--home", userHome, "--user", user, "--data-dir", path.join(userHome, ".omnius"), "--port", String(PORT)],
710
721
  { stdio: "pipe", timeout: 20000 });