Skip to content

Commit

Permalink
⚡️ remote access now uses cloudflare tunnels #3170
Browse files Browse the repository at this point in the history
  • Loading branch information
smashah committed Feb 19, 2024
1 parent 0bb4ac3 commit 4df62c4
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 81 deletions.
164 changes: 100 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
"@types/express": "^4.17.11",
"@types/fs-extra": "^9.0.11",
"@types/line-reader": "0.0.34",
"@types/localtunnel": "^2.0.1",
"@types/marked": "^4.0.2",
"@types/mime": "^3.0.1",
"@types/node": "^18.7.6",
Expand Down Expand Up @@ -106,7 +105,7 @@
"dependencies": {
"@brillout/import": "^0.2.1",
"@discordjs/collection": "0.8.0",
"@open-wa/wa-automate-socket-client": "*",
"@open-wa/wa-automate-socket-client": "^3.3.0",
"@open-wa/wa-decrypt": "^4.3.1",
"atob": "^2.1.2",
"aws4": "^1.11.0",
Expand All @@ -116,6 +115,7 @@
"change-case": "^4.1.2",
"chokidar": "^3.5.3",
"chrome-launcher": "^0.15.0",
"cloudflared": "^0.5.1",
"command-exists": "^1.2.9",
"command-line-usage": "^6.1.1",
"cors": "^2.8.5",
Expand All @@ -138,7 +138,6 @@
"is-url-superb": "^5.0.0",
"json5": "^2.2.0",
"klona": "^2.0.5",
"localtunnel": "^2.0.2",
"lodash.uniq": "^4.5.0",
"meow": "^9.0.0",
"mime": "^3.0.0",
Expand Down
14 changes: 13 additions & 1 deletion src/cli/cli-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,19 @@ Merge<Merge<{
{
name: 'tunnel',
type: Boolean,
description: "Expose a tunnel to your EASY API session - this is for testing and it is unsecured."
description: "Expose a tunnel to your EASY API session - this is for testing and it is unsecured. By default it will use a random cloudflare tunnel URL. Make sure you have cloudflared installed and running."
},
{
name: 'cf-tunnel-host-domain',
type: String,
typeLabel: '{yellow {underline "mycool.site"}}',
description: "If you have a domain set up in a cloudflare account and have run cloudflared login on your machine, you can use this to expose the tunnel on your own domain. For example, if you set --cf-tunnel-host-domain mycool.site, the tunnel will be exposed on https://session_id_owa.mycool.site"
},
{
name: 'cf-tunnel-namespace',
type: String,
typeLabel: '{yellow {underline "owa"}}',
description: "You can set a sub-subdomain namespace on which the tunnel will be exposed. Needs to be set in conjunction with --tunnel & --cf-tunnel-host-domain. For example, if you set --cf-tunnel-namespace owa, the tunnel will be exposed on https://session_id.owa.mycool.site"
},
{
name: 'pm2',
Expand Down
2 changes: 1 addition & 1 deletion src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ async function start() {
});
if(cliConfig.tunnel) {
spinner.info(`\n• Setting up external tunnel`);
const tunnelUrl = await setupTunnel(cliConfig, await client.getTunnelCode(), PORT)
const tunnelUrl = await setupTunnel(cliConfig, PORT)
spinner.succeed(`\n\t${terminalLink('External address', tunnelUrl)}`)

}
Expand Down

0 comments on commit 4df62c4

Please sign in to comment.