qcobjects-cli 2.4.63 → 2.4.65
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/VERSION +1 -1
- package/package.json +10 -2
- package/src/qcobjects-createcert.js +19 -3
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.4.
|
|
1
|
+
2.4.65
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qcobjects-cli",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.65",
|
|
4
4
|
"description": "qcobjects cli command line tool",
|
|
5
5
|
"main": "src/index.cjs",
|
|
6
6
|
"module": "src/index.mjs",
|
|
@@ -10,7 +10,15 @@
|
|
|
10
10
|
"import": "./src/index.mjs"
|
|
11
11
|
},
|
|
12
12
|
"./package.json": "./package.json",
|
|
13
|
-
"./*.js": "./src/*.js"
|
|
13
|
+
"./*.js": "./src/*.js",
|
|
14
|
+
"./qcobjects-collab": "./src/qcobjects-collab.js",
|
|
15
|
+
"./qcobjects-cli": "./src/qcobjects-cli.js",
|
|
16
|
+
"./qcobjects-createcert": "./src/qcobjects-createcert.js",
|
|
17
|
+
"./qcobjects-gae-http-server": "./src/qcobjects-gae-http-server.js",
|
|
18
|
+
"./qcobjects-http-server": "./src/qcobjects-http-server.js",
|
|
19
|
+
"./qcobjects-http2-server": "./src/qcobjects-http2-server.js",
|
|
20
|
+
"./qcobjects-shell": "./src/qcobjects-shell.js",
|
|
21
|
+
"./defaultsettings": "./src/org.quickcorp.qcobjects.defaultsettings.js"
|
|
14
22
|
},
|
|
15
23
|
"type": "commonjs",
|
|
16
24
|
"types": "./src/index.d.ts",
|
|
@@ -33,6 +33,14 @@
|
|
|
33
33
|
const path = require("path");
|
|
34
34
|
const absolutePath = path.resolve( __dirname, "./" );
|
|
35
35
|
const templatePath = path.resolve( __dirname, "./templates/apps/" )+"/";
|
|
36
|
+
const os = require("os");
|
|
37
|
+
const isWindows = ()=>{
|
|
38
|
+
return os.platform().toLowerCase().startsWith("win");
|
|
39
|
+
};
|
|
40
|
+
const isMac = ()=>{
|
|
41
|
+
return os.platform().toLowerCase().startsWith("darwin");
|
|
42
|
+
};
|
|
43
|
+
|
|
36
44
|
|
|
37
45
|
require("qcobjects");
|
|
38
46
|
|
|
@@ -53,11 +61,19 @@ class Main extends InheritClass {
|
|
|
53
61
|
case "self_signed":
|
|
54
62
|
// stderr is sent to stderr of parent process
|
|
55
63
|
// you can set options.stdio if you want it to go elsewhere
|
|
56
|
-
|
|
64
|
+
if (isWindows()){
|
|
65
|
+
stdout = execSync("openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj \"/CN="+CONFIG.get("domain")+"\" -keyout "+CONFIG.get("private-key-pem")+" -out "+CONFIG.get("private-cert-pem"));
|
|
66
|
+
} else {
|
|
67
|
+
stdout = execSync("openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN="+CONFIG.get("domain")+"' -keyout "+CONFIG.get("private-key-pem")+" -out "+CONFIG.get("private-cert-pem"));
|
|
68
|
+
}
|
|
57
69
|
break;
|
|
58
70
|
case "letsencrypt":
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
if (isWindows()){
|
|
72
|
+
throw Error("Letsencrypt certificate is not supported in Windows");
|
|
73
|
+
} else {
|
|
74
|
+
var prehook_posthook = "--pre-hook \"service qcobjects stop\" --post-hook=\"service qcobjects start\"";
|
|
75
|
+
stdout = execSync(`certbot -n -d ${CONFIG.get("domain")} certonly --standalone ${prehook_posthook}`);
|
|
76
|
+
}
|
|
61
77
|
break;
|
|
62
78
|
default:
|
|
63
79
|
break;
|