Browse Source

add console

master
zeus 3 years ago
parent
commit
c9227969ad
  1. 23
      install/usr/share/swarmlab.io/sec/swarmlab-sec

23
install/usr/share/swarmlab.io/sec/swarmlab-sec

@ -116,6 +116,20 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
# ---------------------------------------------- # ----------------------------------------------
function EPHEMERAL_PORT() {
LOW_BOUND=49152
RANGE=16384
while true; do
CANDIDATE=$[$LOW_BOUND + ($RANDOM % $RANGE)]
(echo "" >/dev/tcp/127.0.0.1/${CANDIDATE}) >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo $CANDIDATE
break
fi
done
}
Wdir=$(pwd) Wdir=$(pwd)
if [ ! -f $Wdir/.env ]; then if [ ! -f $Wdir/.env ]; then
@ -124,6 +138,14 @@ REGISTRY_ADDR=localhost
REGISTRY_PORT=5000 REGISTRY_PORT=5000
IMAGE_NAME=$HYBRID_NETWORK IMAGE_NAME=$HYBRID_NETWORK
SSH_PORT= SSH_PORT=
WEB_PORT=$(EPHEMERAL_PORT)
WEB_PORT1=$(EPHEMERAL_PORT)
WEB_PORT2=$(EPHEMERAL_PORT)
R_PORT1=$(EPHEMERAL_PORT)
R_PORT2=$(EPHEMERAL_PORT)
R_PORT3=$(EPHEMERAL_PORT)
R_PORT4=$(EPHEMERAL_PORT)
R_PORT5=$(EPHEMERAL_PORT)
EOF EOF
fi fi
@ -378,6 +400,7 @@ services:
user: root user: root
entrypoint: ["sec_bootstrap", "role=master", "sec_master_service_name=master", "sec_worker_service_name=worker"] entrypoint: ["sec_bootstrap", "role=master", "sec_master_service_name=master", "sec_worker_service_name=worker"]
ports: ports:
- "\${R_PORT1}:3787"
- "\${SSH_PORT}:22" - "\${SSH_PORT}:22"
networks: networks:
- ${HYBRID_NETWORK} - ${HYBRID_NETWORK}

Loading…
Cancel
Save