Launches tor with the '--quiet' flag when attempting to get the hashed password for the control port. Uses 'os.EOL' instead of '\n' when creating the config file for compatibility with windows
This commit is contained in:
parent
7d996ffa81
commit
56b34f2133
|
@ -6,4 +6,3 @@ npm-debug.log
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
.env
|
.env
|
||||||
README.md
|
README.md
|
||||||
.travis.yml
|
|
|
@ -2,4 +2,3 @@ node_modules
|
||||||
yarn.lock
|
yarn.lock
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
.env
|
.env
|
||||||
.travis.yml
|
|
550
package-lock.json
generated
550
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -10,6 +10,7 @@ const { TorController } = require('granax');
|
||||||
const { connect } = require('net');
|
const { connect } = require('net');
|
||||||
const shell = require('shelljs');
|
const shell = require('shelljs');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
const os = require('os');
|
||||||
temp.track();
|
temp.track();
|
||||||
|
|
||||||
class TorProcess extends EventEmitter {
|
class TorProcess extends EventEmitter {
|
||||||
|
@ -103,10 +104,10 @@ class TorProcess extends EventEmitter {
|
||||||
DNSPort: `127.0.0.1:${context.dnsPort}`,
|
DNSPort: `127.0.0.1:${context.dnsPort}`,
|
||||||
SocksPort: `127.0.0.1:${context.socksPort}`,
|
SocksPort: `127.0.0.1:${context.socksPort}`,
|
||||||
ControlPort: `127.0.0.1:${context.controlPort}`,
|
ControlPort: `127.0.0.1:${context.controlPort}`,
|
||||||
HashedControlPassword: shell.exec(`${this.tor_path} --hash-password "${this.control_password}"`, { async: false, silent: true }).stdout.trim()
|
HashedControlPassword: shell.exec(`${this.tor_path} --quiet --hash-password "${this.control_password}"`, { async: false, silent: true }).stdout.trim()
|
||||||
};
|
};
|
||||||
let config = _.extend(_.extend({}, this.tor_config), options);
|
let config = _.extend(_.extend({}, this.tor_config), options);
|
||||||
let text = Object.keys(config).map((key) => `${key} ${config[key]}`).join("\n");
|
let text = Object.keys(config).map((key) => `${key} ${config[key]}`).join(os.EOL);
|
||||||
|
|
||||||
temp.open('tor-router', (err, info) => {
|
temp.open('tor-router', (err, info) => {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
|
|
Loading…
Reference in a new issue