onedeploy-cli 0.1.2 → 0.1.3

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/README.md CHANGED
@@ -1,7 +1,28 @@
1
1
  # OneDeploy CLI
2
2
 
3
- This CLI allows you to connect to a OneDeploy cluster via [Nebula](https://github.com/slackhq/nebula). First, you need to create an API key on your dashboard. Then, you can `Setup new connection` with your dashboard URL and API key. Afterwards, you can `Connect` to the cluster you added. Please note that Nebula requires administrator permissions to run, so you'll need to enter your password.
3
+ This CLI allows you to connect to a OneDeploy cluster via
4
+ [Nebula](https://github.com/slackhq/nebula).
5
+
6
+ ## Getting Started
7
+
8
+ Run it using `sudo` on Unix-like systems:
9
+
10
+ ```
11
+ sudo npx onedeploy-cli
12
+ ```
13
+
14
+ or from an administrator prompt on Windows:
15
+
16
+ ```
17
+ npx onedeploy-cli
18
+ ```
19
+
20
+ Then, you need to create an API key on your OneDeploy dashboard. You can
21
+ `Setup new connection` to enter your dashboard URL and API key. Afterwards, you
22
+ can `Connect` to the cluster you added. Please note that connections are stored
23
+ per computer (for the root user), not individually per user.
4
24
 
5
25
  ## License
6
26
 
7
- The OneDeploy CLI licensed under MIT, see [here](./LICENSE). It uses the Nebula overlay network, which is also MIT licensed.
27
+ The OneDeploy CLI licensed under MIT, see [here](./LICENSE). It uses the Nebula
28
+ overlay network, which is also MIT licensed.
package/dist/nebula.js CHANGED
@@ -59,20 +59,9 @@ export const getNebulaCert = async (instance) => {
59
59
  await writeFile(`${tmpDir}/nebula.yml`, nebulaConfig);
60
60
  await chmod(`${tmpDir}/nebula.yml`, 0o600);
61
61
  };
62
- const spawnNebula = () => {
63
- if (process.platform === "win32") {
64
- return spawn("powershell.exe", [
65
- "-Command",
66
- `Start-Process ${tmpDir}\\nebula.exe -ArgumentList '-config','${tmpDir}\\nebula.yml' -Verb RunAs`,
67
- ]);
68
- }
69
- return spawn("sudo", [`${tmpDir}/nebula`, "-config", `${tmpDir}/nebula.yml`], {
70
- stdio: "inherit",
71
- });
72
- };
73
62
  export const connectNebula = async (instance) => {
74
63
  await getNebulaCert(instance);
75
- const nebula = spawnNebula();
64
+ const nebula = spawn(`${tmpDir}/nebula`, ["-config", `${tmpDir}/nebula.yml`], { stdio: "inherit" });
76
65
  const interval = setInterval(async () => {
77
66
  // refresh Nebula cert every 10 minutes (lifetime is 15 minutes)
78
67
  await getNebulaCert(instance);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onedeploy-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "CLI tool for connecting to OneDeploy via Nebula",
5
5
  "keywords": [
6
6
  "onedeploy",
package/src/index.ts CHANGED
@@ -100,7 +100,7 @@ const mainMenu = async (): Promise<boolean> => {
100
100
  return false;
101
101
  }
102
102
  return true;
103
- }
103
+ };
104
104
 
105
105
  await installNebula();
106
106
  try {