From 1731d09849f73bd7c56bb35157b2d94f30402db2 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 16 May 2017 16:58:45 -0500 Subject: [PATCH 1/4] get packages for admin ui --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.sh b/install.sh index b220b98..09a8243 100644 --- a/install.sh +++ b/install.sh @@ -183,6 +183,10 @@ $sudo_cmd chown -R _www:_www /opt/goldilocks/{lib,bin,etc} || true $sudo_cmd chown www-data:www-data /var/www /srv/www || true $sudo_cmd chown -R www-data:www-data /opt/goldilocks/{lib,bin,etc} || true npm install -g 'git+https://git@git.daplie.com/Daplie/goldilocks.js.git#v1' +# Finish up with submodule +pushd /opt/goldilocks/lib/node_modules/goldilocks +bash ./update-packages.sh +popd # Unistall dap_dl "https://git.daplie.com/Daplie/goldilocks.js/raw/master/uninstall.sh" "./goldilocks-uninstall" From 15c80dab144872293bc8a0b3e85247c3e21a41e7 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 16 May 2017 17:10:32 -0500 Subject: [PATCH 2/4] add socket-pair as dep --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 6202868..e425fc7 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "serve-index": "^1.7.0", "serve-static": "^1.10.0", "server-destroy": "^1.0.1", + "socket-pair": "^1.0.0", "stream-pair": "^1.0.3", "stunnel": "git+https://git.daplie.com/Daplie/node-tunnel-client.git#v1" } From e386b19e3f7acd0d71a4e1c826a8b5c3e516dcbf Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 17 May 2017 14:24:19 -0500 Subject: [PATCH 3/4] update no-config defaults --- bin/goldilocks.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/goldilocks.js b/bin/goldilocks.js index 90ec4ce..b19d5e0 100755 --- a/bin/goldilocks.js +++ b/bin/goldilocks.js @@ -71,15 +71,16 @@ function readConfigAndRun(args) { config = recase.camelCopy(config); if (!config.dns) { - config.dns = { proxy: { port: 3053 } }; + config.dns = { modules: { name: 'proxy', port: 3053 } }; } if (!config.tcp) { config.tcp = {}; } if (!config.http) { - config.http = { proxy: { port: 3000 } }; + config.http = { modules: { name: 'proxy', port: 3000 } }; } if (!config.tls) { + console.log("TODO: tls: { modules: { name: 'acme', email: 'foo@bar.com', domains: [ '*' ] } }"); config.tls = { agreeTos: args.agreeTos || args.agree || args['agree-tos'] , servernames: (args.servernames||'').split(',').filter(Boolean).map(function (str) { return str.toLowerCase(); }) From 100e7cee7cbe08f1aebd2b1d3d32a65551ff6737 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 22 May 2017 14:23:18 -0500 Subject: [PATCH 4/4] make /opt/goldilocks user-writable for install --- install.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 09a8243..eb055e2 100644 --- a/install.sh +++ b/install.sh @@ -169,6 +169,7 @@ set -u dap_dl_bash "https://git.daplie.com/coolaj86/node-install-script/raw/master/setup-min.sh" # Install +# TODO install to tmp location, then move to /opt export NODE_PATH=/opt/goldilocks/lib/node_modules export NPM_CONFIG_PREFIX=/opt/goldilocks $sudo_cmd mkdir -p /etc/goldilocks @@ -176,17 +177,26 @@ $sudo_cmd mkdir -p /var/log/goldilocks $sudo_cmd mkdir -p /srv/www $sudo_cmd mkdir -p /var/www $sudo_cmd mkdir -p /opt/goldilocks/{lib,bin,etc} + +# Change to user perms + +# OS X or Linux +$sudo_cmd chown -R $(whoami) /opt/goldilocks/ || true + +npm install -g 'git+https://git@git.daplie.com/Daplie/goldilocks.js.git#v1' +# Finish up with submodule +pushd /opt/goldilocks/lib/node_modules/goldilocks +bash ./update-packages.sh +popd + +# Change to admin perms + # OS X $sudo_cmd chown _www:_www /var/www /srv/www || true $sudo_cmd chown -R _www:_www /opt/goldilocks/{lib,bin,etc} || true # Linux $sudo_cmd chown www-data:www-data /var/www /srv/www || true $sudo_cmd chown -R www-data:www-data /opt/goldilocks/{lib,bin,etc} || true -npm install -g 'git+https://git@git.daplie.com/Daplie/goldilocks.js.git#v1' -# Finish up with submodule -pushd /opt/goldilocks/lib/node_modules/goldilocks -bash ./update-packages.sh -popd # Unistall dap_dl "https://git.daplie.com/Daplie/goldilocks.js/raw/master/uninstall.sh" "./goldilocks-uninstall"