bugfix missing relay on init
This commit is contained in:
parent
27a85a3e73
commit
9e61caaa6c
|
@ -494,6 +494,7 @@ function getToken(err, state) {
|
||||||
console.error("Error while initializing config [init]:");
|
console.error("Error while initializing config [init]:");
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
state.relay = state.config.relay;
|
||||||
|
|
||||||
// { _otp, config: {} }
|
// { _otp, config: {} }
|
||||||
common.api.token(state, {
|
common.api.token(state, {
|
||||||
|
@ -581,7 +582,7 @@ function getToken(err, state) {
|
||||||
, end: function () {
|
, end: function () {
|
||||||
utils.putConfig('enable', [], function (err) {
|
utils.putConfig('enable', [], function (err) {
|
||||||
if (err) { console.error(err); return; }
|
if (err) { console.error(err); return; }
|
||||||
console.info("[end] Success");
|
console.info("Success");
|
||||||
|
|
||||||
// workaround for https://github.com/nodejs/node/issues/21319
|
// workaround for https://github.com/nodejs/node/issues/21319
|
||||||
if (state._useTty) {
|
if (state._useTty) {
|
||||||
|
@ -602,8 +603,6 @@ function getToken(err, state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseCli(/*state*/) {
|
function parseCli(/*state*/) {
|
||||||
//console.log(parseCli);
|
|
||||||
//console.log(argv);
|
|
||||||
if (-1 !== argv.indexOf('init')) {
|
if (-1 !== argv.indexOf('init')) {
|
||||||
utils.putConfig('list', []/*, function (err) {
|
utils.putConfig('list', []/*, function (err) {
|
||||||
}*/);
|
}*/);
|
||||||
|
@ -663,7 +662,6 @@ function handleConfig(err, config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log("done questioning:", Date.now());
|
//console.log("done questioning:", Date.now());
|
||||||
state.relay = state.config.relay;
|
|
||||||
if (!state.token && !state.config.token) {
|
if (!state.token && !state.config.token) {
|
||||||
getToken(err, state);
|
getToken(err, state);
|
||||||
} else {
|
} else {
|
||||||
|
@ -788,6 +786,7 @@ var parsers = {
|
||||||
state.config._otp = common.otp();
|
state.config._otp = common.otp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
argv.unshift('init');
|
||||||
parseCb(null, state);
|
parseCb(null, state);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ function serveControlsHelper() {
|
||||||
|| 'undefined' !== typeof conf.agreeTos ) {
|
|| 'undefined' !== typeof conf.agreeTos ) {
|
||||||
state.config.agreeTos = conf.agreeTos || conf.agree_tos;
|
state.config.agreeTos = conf.agreeTos || conf.agree_tos;
|
||||||
}
|
}
|
||||||
state.otp = conf._otp || '0000'; // this should only be done on the client side
|
state.otp = conf._otp; // this should only be done on the client side
|
||||||
state.config.relay = conf.relay || state.config.relay || '';
|
state.config.relay = conf.relay || state.config.relay || '';
|
||||||
console.log();
|
console.log();
|
||||||
console.log('conf.token', typeof conf.token, conf.token);
|
console.log('conf.token', typeof conf.token, conf.token);
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
There are a number of conditions and whatnot that must be tested in more-or-less real-world conditions.
|
There are a number of conditions and whatnot that must be tested in more-or-less real-world conditions.
|
||||||
|
|
||||||
|
telebit init // fresh install
|
||||||
|
telebit init // after install complete
|
||||||
|
|
||||||
telebit http 3000 // have an app listening on localhost:3000
|
telebit http 3000 // have an app listening on localhost:3000
|
||||||
telebit http 4545 // do not have an app listening
|
telebit http 4545 // do not have an app listening
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue