onedeploy-cli 0.1.8 → 0.1.9
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/nebula.js +4 -5
- package/package.json +1 -1
package/dist/nebula.js
CHANGED
|
@@ -73,18 +73,17 @@ export const getNebulaCert = async (instance, session) => {
|
|
|
73
73
|
"-path",
|
|
74
74
|
`${tmpDir}/nebula-debug.crt`,
|
|
75
75
|
]);
|
|
76
|
+
const cert = JSON.parse(stdout);
|
|
76
77
|
// in case our local time isn't correct, wait for the certificate to become valid
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
throw new Error("
|
|
78
|
+
const validFromDate = new Date(cert.details.notBefore);
|
|
79
|
+
if (validFromDate.toString() === "Invalid Date") {
|
|
80
|
+
throw new Error("Nebula certificate has invalid 'notBefore' date");
|
|
80
81
|
}
|
|
81
|
-
const validFromDate = new Date(validFrom[1]);
|
|
82
82
|
if (validFromDate > new Date()) {
|
|
83
83
|
const waitTime = validFromDate.getTime() - Date.now();
|
|
84
84
|
console.log(`Your system clock is running slow! Waiting ${Math.ceil(waitTime / 1000)} seconds for Nebula certificate to become valid...`);
|
|
85
85
|
await new Promise((resolve) => setTimeout(resolve, waitTime));
|
|
86
86
|
}
|
|
87
|
-
process.stdout.write(stdout);
|
|
88
87
|
};
|
|
89
88
|
export let isNebulaRunning = false;
|
|
90
89
|
const getSession = (instance) => {
|