From 461166d3e35c9b676b0ede235d789af5579ba1de Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 7 Oct 2018 22:50:11 -0600 Subject: [PATCH 1/4] single npm install process at a time --- usr/share/install_helper.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr/share/install_helper.sh b/usr/share/install_helper.sh index 9d819c2..3e59706 100644 --- a/usr/share/install_helper.sh +++ b/usr/share/install_helper.sh @@ -224,16 +224,20 @@ pushd $TELEBIT_TMP >/dev/null else echo -n "." fi + set +e $tmp_npm install >/dev/null 2>/dev/null & - # ursa is now an entirely optional dependency for key generation - # but very much needed on ARM devices - $tmp_npm install ursa >/dev/null 2>/dev/null & tmp_npm_pid=$! while [ -n "$tmp_npm_pid" ]; do sleep 2 echo -n "." kill -s 0 $tmp_npm_pid >/dev/null 2>/dev/null || tmp_npm_pid="" done + set -e + echo -n "." + $tmp_npm install >/dev/null 2>/dev/null + # ursa is now an entirely optional dependency for key generation + # but very much needed on ARM devices + $tmp_npm install ursa >/dev/null 2>/dev/null || true popd >/dev/null if [ -n "${TELEBIT_DEBUG}" ]; then From 8589a66fcad45a18cd329861afefb4f02ebceba5 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 7 Oct 2018 23:05:32 -0600 Subject: [PATCH 2/4] bugfix: always launchctl unload, not just on DEBUG --- usr/share/install_helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/share/install_helper.sh b/usr/share/install_helper.sh index 3e59706..e92f8ed 100644 --- a/usr/share/install_helper.sh +++ b/usr/share/install_helper.sh @@ -429,8 +429,8 @@ if [ -d "/Library/LaunchDaemons" ]; then if [ -n "${TELEBIT_DEBUG}" ]; then echo " > launchctl unload -w $my_app_launchd_service >/dev/null 2>/dev/null" - launchctl unload -w "$my_app_launchd_service" >/dev/null 2>/dev/null fi + launchctl unload -w "$my_app_launchd_service" >/dev/null 2>/dev/null else my_app_launchd_service_skel="usr/share/dist/Library/LaunchDaemons/${my_app_pkg_name}.plist" my_app_launchd_service="$my_root/Library/LaunchDaemons/${my_app_pkg_name}.plist" From 909b47926593fe895b2c91a6f1b7db9adb7f3b74 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 9 Oct 2018 16:30:10 -0600 Subject: [PATCH 3/4] v0.20.8: fix npmPrefixPath --- package.json | 2 +- usr/share/install-launcher.js | 4 ++-- usr/share/template-launcher.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 38cf164..5457a41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "telebit", - "version": "0.20.6", + "version": "0.20.8", "description": "Break out of localhost. Connect to any device from anywhere over any tcp port or securely in a browser. A secure tunnel. A poor man's reverse VPN.", "main": "lib/remote.js", "files": [ diff --git a/usr/share/install-launcher.js b/usr/share/install-launcher.js index eec6c56..8e04fad 100644 --- a/usr/share/install-launcher.js +++ b/usr/share/install-launcher.js @@ -114,8 +114,8 @@ Launcher.install = function (things, fn) { }; vars.telebitBinTpl = path.join(telebitRoot, 'usr/share/dist/bin/telebit.tpl'); vars.telebitNpm = path.resolve(vars.telebitNode, '../npm'); - vars.nodePath = path.resolve(vars.telebitNode, '../lib/node_modules'); - vars.npmConfigPrefix = path.resolve(vars.telebitNode, '..'); + vars.nodePath = path.resolve(vars.telebitNode, '../../lib/node_modules'); + vars.npmConfigPrefix = path.resolve(vars.telebitNode, '..', '..'); vars.userspace = (!things.telebitUser || (things.telebitUser === os.userInfo().username)) ? true : false; if (-1 === vars.telebitRwDirs.indexOf(vars.npmConfigPrefix)) { vars.telebitRwDirs.push(vars.npmConfigPrefix); diff --git a/usr/share/template-launcher.js b/usr/share/template-launcher.js index 124766f..9c0f259 100644 --- a/usr/share/template-launcher.js +++ b/usr/share/template-launcher.js @@ -79,8 +79,8 @@ function run() { , TELEBIT_LOG_DIR: process.env.TELEBIT_LOG_DIR || path.join(os.homedir(), '.local/share/telebit/var/log') }; vars.telebitNpm = process.env.TELEBIT_NPM || path.resolve(vars.telebitNode, '../npm'); - vars.nodePath = process.env.NODE_PATH || path.resolve(vars.telebitNode, '../lib/node_modules'); - vars.npmConfigPrefix = process.env.NPM_CONFIG_PREFIX || path.resolve(vars.telebitNode, '..'); + vars.nodePath = process.env.NODE_PATH || path.resolve(vars.telebitNode, '../../lib/node_modules'); + vars.npmConfigPrefix = process.env.NPM_CONFIG_PREFIX || path.resolve(vars.telebitNode, '..', '..'); if (-1 === vars.telebitRwDirs.indexOf(vars.npmConfigPrefix)) { vars.telebitRwDirs.push(vars.npmConfigPrefix); } From 8ffc30797a10376f4756d1fa44d36deb67c92996 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 15 Oct 2018 18:46:40 -0600 Subject: [PATCH 4/4] doc 'status' to take no arguments --- lib/en-us.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/en-us.toml b/lib/en-us.toml index c4c845d..86ee017 100644 --- a/lib/en-us.toml +++ b/lib/en-us.toml @@ -59,7 +59,7 @@ Use \"telebit help [command]\" for more information about a command, including f Copyright 2015-2018 AJ ONeal https://telebit.cloud MPL-2.0 Licensed (RAWR!)" -status = "usage: telebit status [subdomain] +status = "usage: telebit status 'telebit status' shows details about the current connections (or lack thereof).