Browse Source

alpine

master
zeus 4 years ago
parent
commit
9992319bab
  1. 1
      files/mongo/docker-compose.yml
  2. 32
      llo/connect-new.js

1
files/mongo/docker-compose.yml

@ -26,6 +26,7 @@ services:
swlabadminvenus:
hostname: 'swlabadminvenus'
container_name: 'swlabadminvenus'
image: 'hub.swarmlab.io:5480/venus-admin:latest'
entrypoint: /bin/bash -c "tail -f /dev/null"
user: root

32
llo/connect-new.js

@ -522,7 +522,7 @@ function myserverStatus(){
var mongoserver = JSON.parse(fs.readFileSync('./hybrid/venus-stats/config.json', 'utf8'))
var mypath = process.cwd()
var showexec = `./hybrid/scripts/check-wg-connection.sh`
var showexec = `docker exec swlabadminvenus /bin/bash -c "/usr/local/bin/check-wg-connection.sh"`
log = spawn(showexec, {
shell: true,
cwd: mypath,
@ -544,14 +544,28 @@ function myserverStatus(){
var resprivatekey = interfaces[i].ip;
var respublickey = interfaces[i].publickey;
var bootstrapstackid = interfaces[i].stackid;
if(intconnection == 'no'){
var nn = {}
nn.connection = interfaces[i].connection;
nn.AllowedIPs = interfaces[i].ip;
nn.publickey = interfaces[i].publickey;
nn.bootstrapstackid = interfaces[i].stackid;
console.log('no connection '+JSON.stringify(nn));
}
if(intconnection == 'no'){
var nn = {}
nn.connection = interfaces[i].connection;
nn.AllowedIPs = interfaces[i].ip;
nn.publickey = interfaces[i].publickey;
nn.bootstrapstackid = interfaces[i].stackid;
console.log('no connection '+JSON.stringify(nn));
var wgdown = `/bin/bash /config/${nn.bootstrapstackid}/ifdown_linux`
var showexec1 = `docker exec swlabadminvenus /bin/bash -c "${wgdown}"`
log1 = spawn(showexec1, {
shell: true,
cwd: mypath,
detached: false,
stdio: 'pipe'
});
log1.on('close', function (code) {
console.log('close1 '+JSON.stringify(code));
var n = {}
n.data = code
io.emit('message_close', n);
});
}
}
});

Loading…
Cancel
Save