Skip to content

Commit

Permalink
feat: add --bind_ip_all flag
Browse files Browse the repository at this point in the history
Fix #42
  • Loading branch information
vkarpov15 committed Sep 26, 2020
1 parent 5873fe8 commit 1a217d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,17 @@ function* run() {

console.log(`Running '${mongod}'`, ports);
const rs = new ReplSet(mongod,
ports.map(port => ({
options: {
ports.map(port => {
const options = {
port: port,
dbpath: isWin ? `${dbPath}\\${port}` : `${dbPath}/${port}`,
bind_ip: hostname
};
if (commander.bind_ip_all) {
options.bind_ip_all = null;
}
})), { replSet: 'rs' });
return options;

This comment has been minimized.

Copy link
@KristinaKoeva

KristinaKoeva Sep 30, 2020

Shouldn't this be

return { options }

This comment has been minimized.

Copy link
@vkarpov15

vkarpov15 Oct 11, 2020

Author Owner

👍 you're right, this should fix #50

}), { replSet: 'rs' });

if (commander.keep) {
console.log(chalk.blue('Restarting replica set...'));
Expand Down
4 changes: 4 additions & 0 deletions src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ module.exports = Object.freeze([
option: '-l, --linux [string]',
description: 'Override the default system linux. Only for linux version. `ubuntu1604` by default'
},
{
option: '-p, --bind_ip_all',
description: 'Allow connections from remote servers, not just from localhost.'
},
{
option: '--help',
description: 'Output help'
Expand Down

0 comments on commit 1a217d0

Please sign in to comment.