xynginc 1.0.90 → 1.0.91
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/startPlugin.js +21 -5
- package/package.json +1 -1
- package/xypriss.plugin.xsig +4 -4
package/dist/startPlugin.js
CHANGED
|
@@ -2,13 +2,29 @@ import { ensureBinary } from "./mods/ensureBinary";
|
|
|
2
2
|
import { Logger } from "./mods/logger";
|
|
3
3
|
import { addDomain, applyConfig, checkRequirements, getStatus, installRequirementsHandler, listDomains, reloadNginx, removeDomain, testNginx, } from "./mods/requirements";
|
|
4
4
|
const getSudo = (sudoPassword) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
let pwd = sudoPassword;
|
|
6
|
+
// Attempt multiple ways to get the password from the host project's environment
|
|
7
|
+
if (!pwd && typeof __sys__ !== "undefined" && __sys__.__env__) {
|
|
8
|
+
const projectRoot = globalThis.__sys__?._primaryRoot ||
|
|
9
|
+
globalThis.__sys__?._internalRoot ||
|
|
10
|
+
process.cwd();
|
|
11
|
+
if (typeof __sys__.__env__.getForRoot === "function") {
|
|
12
|
+
pwd = __sys__.__env__.getForRoot("SUDO_PASSWORD", projectRoot);
|
|
13
|
+
}
|
|
14
|
+
if (!pwd) {
|
|
15
|
+
pwd = __sys__.__env__.get("SUDO_PASSWORD");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
// Strip wrapping quotes if present in .env (e.g., SUDO_PASSWORD="Test")
|
|
19
|
+
if (pwd) {
|
|
20
|
+
if ((pwd.startsWith('"') && pwd.endsWith('"')) ||
|
|
21
|
+
(pwd.startsWith("'") && pwd.endsWith("'"))) {
|
|
22
|
+
pwd = pwd.slice(1, -1);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
9
25
|
if (pwd) {
|
|
10
26
|
if (sudoPassword) {
|
|
11
|
-
Logger.info(`[XyNginC] Using sudo password provided via plugin options(${
|
|
27
|
+
Logger.info(`[XyNginC] Using sudo password provided via plugin options(${pwd.slice(0, 2)}***).`);
|
|
12
28
|
}
|
|
13
29
|
else {
|
|
14
30
|
Logger.info("[XyNginC] Using sudo password injected from environment variables.");
|
package/package.json
CHANGED
package/xypriss.plugin.xsig
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
--- XYPRISS SIGNATURE (G3) ---
|
|
2
|
-
Manifest: xynginc@1.0.
|
|
2
|
+
Manifest: xynginc@1.0.91
|
|
3
3
|
Min-Engine: 1.0.81
|
|
4
|
-
Fingerprint: sha256:
|
|
4
|
+
Fingerprint: sha256:528683a10d34bbd3202d63026467c67783d03a68242cdca43cd0c3e775a07dd1
|
|
5
5
|
Identity: ed25519:0e2e1accdbba45480979305256d50d368ae6cc2c0d7ee378c5f1999ae834cf58
|
|
6
6
|
Privileges: XHS.HOOK.LIFECYCLE.REGISTER,XHS.HOOK.LIFECYCLE.SERVER_START,XHS.HOOK.LIFECYCLE.SERVER_STOP,XHS.HOOK.LIFECYCLE.SERVER_READY
|
|
7
|
-
Expires: 2027-09-12T13:
|
|
7
|
+
Expires: 2027-09-12T13:45:56Z
|
|
8
8
|
Revision: sha256:none
|
|
9
9
|
--- BEGIN CRYPTOGRAPHIC PROOF ---
|
|
10
|
-
base64:
|
|
10
|
+
base64:4IQrfdTzQgE0onhmKPoT54zzAJ2oj34hrWiIiZXapzl+SNdSOBW/6LVtqf3B5Rbba8n3Q61mSXm+vTgIuPTXCA==
|
|
11
11
|
--- END XYPRISS SIGNATURE ---
|