qcobjects-cli 2.4.64 → 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 CHANGED
@@ -1 +1 @@
1
- 2.4.64
1
+ 2.4.65
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qcobjects-cli",
3
- "version": "2.4.64",
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",
@@ -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
- 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"));
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
- var prehook_posthook = "--pre-hook \"service qcobjects stop\" --post-hook=\"service qcobjects start\"";
60
- stdout = execSync(`certbot -n -d ${CONFIG.get("domain")} certonly --standalone ${prehook_posthook}`);
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;