Browse Source

add ttyd

master
zeus 3 years ago
parent
commit
1c9cfb1163
  1. 54
      README.md
  2. BIN
      install/usr/share/swarmlab.io/sec/bin/ttyd.x86_64
  3. 1
      install/usr/share/swarmlab.io/sec/sec_bootstrap
  4. 9
      install/usr/share/swarmlab.io/sec/swarmlab-sec

54
README.md

@ -34,43 +34,6 @@ This is a quickstart guide of howto use this *LabInstance to deploy Vue js appli
> pass
#### Find lab workers
> ifconfig
>
> nmap -sP 172.130.0.0/24
>
> or
>
> /home/docker/project/bin/swarmlab-nmap
#### connect to workers
```bash
ssh docker@[IP]
```
#### Create hosts file
```bash
/home/docker/project/bin/swarmlab-nmap > /home/docker/project/hosts
```
---
**NOTE:** copy files to all clients
```bash
while read -r line;
do
scp /home/docker/project/file docker@$line:/some_dir/file
done < /home/docker/project/hosts
```
---
### Vue CLI Documentation
@ -94,23 +57,6 @@ https://cli.vuejs.org/guide/creating-a-project.html#vue-create
http://localhost:8080
```
:warning: Publishing Docker ports via -p
Using the -p (lower case) flag at runtime lets you publish a container’s specific port(s) to the Docker host.
```bash
docker exec -it -udocker -p [host-port]:[expose-port*] hybrid-nodevuejs_master_1 /bin/bash
e.g.
docker exec -it -udocker -p 8080:8080 hybrid-nodevuejs_master_1 /bin/bash
^^^^^^^^^^^
```
>
> (*) this is the port found in the container menu.
>
> We would expect the port number do be next to the "Ports" field.
>

BIN
install/usr/share/swarmlab.io/sec/bin/ttyd.x86_64

Binary file not shown.

1
install/usr/share/swarmlab.io/sec/sec_bootstrap

@ -46,6 +46,7 @@ case $ROLE in
# Auto update default host file in background and dumb all output
auto_update_hosts "${HOSTNAMES}" > /dev/null 2>&1 &
ttyd -p 3787 bash
# Start ssh server
/usr/sbin/sshd -D
;;

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

@ -151,6 +151,7 @@ if [ -d "$Wdir/project" ]; then
WORKDIR /home/docker/project
COPY .vimrc /home/docker
EXPOSE 3787
USER docker
EOF
fi
@ -233,6 +234,7 @@ if [ "$Wdir" == "$HOME" ]; then
COPY .vimrc /home/docker
WORKDIR /home/docker/project
EXPOSE 3787
USER docker
EOF
fi
@ -247,6 +249,7 @@ fi
/bin/cp -f $DIR/$hostnames_get $Wdir/$hostnames_get
/bin/cp -f $DIR/ROOT_PASSWORD $Wdir/ROOT_PASSWORD
/bin/cp -rf $DIR/.vimrc $Wdir/.vimrc
/bin/cp -rf $DIR/bin $Wdir
/bin/cp -rf $DIR/install-vim-plugin.sh $Wdir/install-vim-plugin.sh
@ -268,10 +271,12 @@ services:
entrypoint: ["sec_bootstrap", "role=masterservice", "sec_master_service_name=masterservice", "sec_worker_service_name=workerservice"]
ports:
- "\${SSH_PORT}:22"
- "\${R_PORT1}:3787" # console
networks:
- ${HYBRID_NETWORK}
volumes:
- $Wdir/project:/home/docker/project
- $Wdir/bin/ttyd.x86_64:/usr/bin/ttyd
workerservice:
@ -286,11 +291,13 @@ services:
user: root
entrypoint: ["sec_bootstrap", "role=workerservice", "sec_master_service_name=masterservice", "sec_worker_service_name=workerservice"]
ports:
- "\${SSH_PORT}:22"
#- "\${SSH_PORT}:22"
- "\${R_PORT2}:3787" # console
networks:
- ${HYBRID_NETWORK}
volumes:
- $Wdir/project:/home/docker/project
- $Wdir/bin/ttyd.x86_64:/usr/bin/ttyd
networks:
${HYBRID_NETWORK}:

Loading…
Cancel
Save