@forge/tunnel 2.0.0-next.3 → 2.0.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # @forge/tunnel
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 5972825c: Refuse to store credentials in plaintext
8
+
9
+ ### Minor Changes
10
+
11
+ - 35172f2: Add ngrok debug logs
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [23c1a25]
16
+ - Updated dependencies [5424f97]
17
+ - Updated dependencies [35172f2]
18
+ - Updated dependencies [edab85a]
19
+ - Updated dependencies [36612fd]
20
+ - Updated dependencies [5972825c]
21
+ - @forge/runtime@2.3.0
22
+ - @forge/cli-shared@3.0.0
23
+ - @forge/bundler@3.0.12
24
+
25
+ ## 2.0.0-next.5
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [5424f97]
30
+ - @forge/cli-shared@3.0.0-next.3
31
+ - @forge/bundler@3.0.12-next.3
32
+
33
+ ## 2.0.0-next.4
34
+
35
+ ### Minor Changes
36
+
37
+ - 35172f2: Add ngrok debug logs
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies [35172f2]
42
+ - @forge/cli-shared@3.0.0-next.2
43
+ - @forge/bundler@3.0.12-next.2
44
+
3
45
  ## 2.0.0-next.3
4
46
 
5
47
  ### Patch Changes
@@ -0,0 +1 @@
1
+ log_level: debug
@@ -1 +1 @@
1
- {"version":3,"file":"create-tunnel-service.d.ts","sourceRoot":"","sources":["../../../src/tunnelling/services/create-tunnel-service.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAQD,qBAAa,wBAAyB,YAAW,mBAAmB;IAGtD,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAqB;gBAER,MAAM,EAAE,MAAM;IAE9B,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAU3C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB1C"}
1
+ {"version":3,"file":"create-tunnel-service.d.ts","sourceRoot":"","sources":["../../../src/tunnelling/services/create-tunnel-service.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAIjD,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAQD,qBAAa,wBAAyB,YAAW,mBAAmB;IAGtD,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAqB;gBAER,MAAM,EAAE,MAAM;IAE9B,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAyB3C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB1C"}
@@ -5,6 +5,8 @@ const tslib_1 = require("tslib");
5
5
  const ngrok = tslib_1.__importStar(require("ngrok"));
6
6
  const url_1 = require("url");
7
7
  const cli_shared_1 = require("@forge/cli-shared");
8
+ const fs_1 = require("fs");
9
+ const path_1 = tslib_1.__importDefault(require("path"));
8
10
  class NgrokError extends Error {
9
11
  constructor() {
10
12
  super(cli_shared_1.Text.tunnel.error.ngrok);
@@ -15,8 +17,22 @@ class NgrokCreateTunnelService {
15
17
  this.logger = logger;
16
18
  }
17
19
  async establishTunnel(port) {
20
+ const configDir = process.env.CONFIG_DIR
21
+ ? process.env.CONFIG_DIR
22
+ : path_1.default.join(__dirname, '..', '..', '..', 'config');
23
+ const configFile = `${configDir}/ngrok.yml`;
18
24
  try {
19
- this.endpoint = await ngrok.connect(port);
25
+ const options = {
26
+ addr: port,
27
+ configPath: fs_1.existsSync(configFile) ? configFile : '',
28
+ onStatusChange: (status) => {
29
+ this.logger.debug(cli_shared_1.Text.tunnel.tunnelStatusChange(status));
30
+ },
31
+ onLogEvent: (data) => {
32
+ this.logger.debug(`${data}`);
33
+ }
34
+ };
35
+ this.endpoint = await ngrok.connect(options);
20
36
  this.logger.debug(cli_shared_1.Text.tunnel.startedTunnel(this.endpoint));
21
37
  return new url_1.URL(this.endpoint);
22
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/tunnel",
3
- "version": "2.0.0-next.3",
3
+ "version": "2.0.0",
4
4
  "description": "Tunnel functionality for Forge CLI",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",
@@ -16,11 +16,11 @@
16
16
  "postbuild": "chmod +x out/*.js"
17
17
  },
18
18
  "dependencies": {
19
- "@forge/bundler": "3.0.12-next.1",
20
- "@forge/cli-shared": "3.0.0-next.1",
19
+ "@forge/bundler": "3.0.12",
20
+ "@forge/cli-shared": "3.0.0",
21
21
  "@forge/csp": "^1.11.0",
22
22
  "@forge/isolated-vm": "3.3.10",
23
- "@forge/runtime": "2.3.0-next.1",
23
+ "@forge/runtime": "2.3.0",
24
24
  "express": "^4.17.1",
25
25
  "express-mung": "^0.5.1",
26
26
  "http-proxy-middleware": "^1.0.6",
@@ -31,7 +31,7 @@
31
31
  "uuid": "^3.4.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@forge/manifest": "^4.1.0-next.0",
34
+ "@forge/manifest": "^4.1.0",
35
35
  "@types/express": "^4.17.2",
36
36
  "@types/express-mung": "^0.5.2",
37
37
  "@types/jest": "^26.0.0",