Browse Source

how-to-build-a-Swarmlab-service

master
zeus 2 years ago
parent
commit
417219d681
  1. 2
      auto-complete.sh
  2. 10
      build.sh
  3. 33
      faq/modules/ROOT/pages/index.adoc
  4. 5
      how-to-build-a-Swarmlab-service/antora.yml
  5. BIN
      how-to-build-a-Swarmlab-service/modules/ROOT/images/adhoc.png
  6. BIN
      how-to-build-a-Swarmlab-service/modules/ROOT/images/swarmlab.png
  7. BIN
      how-to-build-a-Swarmlab-service/modules/ROOT/images/up-1.png
  8. BIN
      how-to-build-a-Swarmlab-service/modules/ROOT/images/up-2.png
  9. BIN
      how-to-build-a-Swarmlab-service/modules/ROOT/images/up.png
  10. 1
      how-to-build-a-Swarmlab-service/modules/ROOT/nav.adoc
  11. 211
      how-to-build-a-Swarmlab-service/modules/ROOT/pages/index.adoc
  12. 4
      how-to-build-a-Swarmlab-service/run/build-intro.sh
  13. 4
      how-to-build-a-Swarmlab-service/run/build.sh
  14. 21
      how-to-build-a-Swarmlab-service/site.yml
  15. 4
      site.yml

2
auto-complete.sh

@ -4,7 +4,7 @@ function libs()
{
if [ "$1" != "" ];
then
COMPREPLY=($(compgen -W "all xelatex-thesis infrastructure-as-code sidecar-firefox network-scanning network-adhoc raspi-docker tech-list faq sensor-node ssh-tunneling iptables poc-datacollector help" "${COMP_WORDS[$COMP_CWORD]}"))
COMPREPLY=($(compgen -W "all xelatex-thesis infrastructure-as-code sidecar-firefox how-to-build-a-Swarmlab-service network-scanning network-adhoc raspi-docker tech-list faq sensor-node ssh-tunneling iptables poc-datacollector help" "${COMP_WORDS[$COMP_CWORD]}"))
fi
}

10
build.sh

@ -55,6 +55,8 @@ usage ()
echo ""
echo -e " ${txtg}xelatex-thesis:${NOCOLOR} This tutorial demonstrates, howto setup xelatex & howto use it "
echo ""
echo -e " ${txtg}how-to-build-a-Swarmlab-service:${NOCOLOR} This tutorial demonstrates, howto build swarmlab service "
echo ""
echo -e " ${txtg}help:${NOCOLOR} show this message"
echo " ./build.sh help"
echo ""
@ -208,6 +210,14 @@ do
COMMAND_CREATE=1
;;
how-to-build-a-Swarmlab-service)
DESC="how-to-build-a-Swarmlab-service" ;
build="build.sh" ;
# source adoc directory
docdir="how-to-build-a-Swarmlab-service" ;
COMMAND_CREATE=1
;;
*)
echo "ERROR: unknown parameter \"$PARAM\""
usage

33
faq/modules/ROOT/pages/index.adoc

@ -23,6 +23,10 @@
* xref:index.adoc#microservice-mongoexpress[How to use Web service microservice-mongoexpress]
[#poc-jitsimeet0]
* xref:index.adoc#poc-jitsimeet[How to use Web service microservice-jitsimeet]
@ -173,6 +177,35 @@ mongo-express --admin --url mongodb://[IP]:27017
====
[#poc-jitsimeet]
[.text-right]
== How to open Web service poc-jitsimeet xref:index.adoc#poc-jitsimeet0[image:up-1.png[28,28,float=right]]
Start service:
* Private/Local->Proof_of_concept->poc-jitsimeet
Open Web
* Instances->running Containers
** [jitsiweb]->Actions->Connect [Click here to open the Web_App]
[TIP]
====
Accept self-signed certificate!
self-signed certificates are good to go for testing purposes and for internal LAN-only services.
When you use VENUS
====

5
how-to-build-a-Swarmlab-service/antora.yml

@ -0,0 +1,5 @@
name: swarmlab_faq
title: swarmlab_faq
version: docs
nav:
- modules/ROOT/nav.adoc

BIN
how-to-build-a-Swarmlab-service/modules/ROOT/images/adhoc.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

BIN
how-to-build-a-Swarmlab-service/modules/ROOT/images/swarmlab.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
how-to-build-a-Swarmlab-service/modules/ROOT/images/up-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

BIN
how-to-build-a-Swarmlab-service/modules/ROOT/images/up-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

BIN
how-to-build-a-Swarmlab-service/modules/ROOT/images/up.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

1
how-to-build-a-Swarmlab-service/modules/ROOT/nav.adoc

@ -0,0 +1 @@
* xref:index.adoc[faq]

211
how-to-build-a-Swarmlab-service/modules/ROOT/pages/index.adoc

@ -0,0 +1,211 @@
= FAQ!
[#How_to_get_the_path_of_current_script0]
* xref:index.adoc#How_to_get_the_path_of_current_script[How to get the path of current script]
[#Fix_x509_certificate_signed_by_unknown_authority_issue0]
* xref:index.adoc#Fix_x509_certificate_signed_by_unknown_authority_issue[How to Fix "x509: certificate signed by unknown authority" issue]
[#Add_current_user_to_the_docker_group0]
* xref:index.adoc#Add_current_user_to_the_docker_group[How to Add current user to the docker group]
[#poc-rocketchat0]
* xref:index.adoc#poc-rocketchat[How to open Web service rocketchat]
[#microservice-gns30]
* xref:index.adoc#microservice-gns3[How to open Web service microservice-gns3]
[#microservice-mongoexpress0]
* xref:index.adoc#microservice-mongoexpress[How to use Web service microservice-mongoexpress]
[#poc-jitsimeet0]
* xref:index.adoc#poc-jitsimeet[How to use Web service microservice-jitsimeet]
[#How_to_get_the_path_of_current_script]
[.text-right]
== How to get the path of current script xref:index.adoc#How_to_get_the_path_of_current_script0[image:up-1.png[28,28,float=right]]
[source,bash]
----
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
TARGET="$(readlink "$SOURCE")"
if [[ $TARGET == /* ]]; then
SOURCE="$TARGET"
else
DIR="$( dirname "$SOURCE" )"
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
SRPATH="$( dirname "$SOURCE" )"
SFPATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
if [ "$SFPATH" != "$SRPATH" ]; then
RDIR=$SRPATH # relativ path directory
fi
#echo "full path file $SOURCE"
#echo "full path dir $SFPATH"
#echo "relativ path dir $SRPATH"
cwdir=$PWD
wdir=$SFPATH
cd $wdir
echo "current working directory,"
echo $cwdir
echo "dir of running program"
echo $wdir
----
[#Fix_x509_certificate_signed_by_unknown_authority_issue]
[.text-right]
== How to Fix "x509: certificate signed by unknown authority" issue xref:index.adoc#Fix_x509_certificate_signed_by_unknown_authority_issue0[image:up-1.png[28,28,float=right]]
run with sudo
[source,bash]
----
#!/bin/bash
registry_address=hub.swarmlab.io
registry_port=5443
mkdir -p /etc/docker/certs.d/$registry_address:$registry_port
openssl s_client -showcerts -connect $registry_address:$registry_port < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/docker/certs.d/$registry_address:$registry_port/ca.crt
registry_port=5480
mkdir -p /etc/docker/certs.d/$registry_address:$registry_port
openssl s_client -showcerts -connect $registry_address:$registry_port < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/docker/certs.d/$registry_address:$registry_port/ca.crt
----
[#Add_current_user_to_the_docker_group]
[.text-right]
== How to Add current user to the docker group xref:index.adoc#Fix_x509_certificate_signed_by_unknown_authority_issue0[image:up-1.png[28,28,float=right]]
[source,bash]
----
sudo usermod -aG docker $USER
----
[#poc-rocketchat]
[.text-right]
== How to open Web service rocketchat xref:index.adoc#poc-rocketchat0[image:up-1.png[28,28,float=right]]
[source,bash]
----
Start poc-rocketchat with URL: http://localhost:7030
----
[#microservice-gns3]
[.text-right]
== How to open Web service microservice-gns3 xref:index.adoc#microservice-gns30[image:up-1.png[28,28,float=right]]
Find IP:port in:
* Instances->running Containers
** Actions->Ports
[source,bash]
----
Start with URL: http://localhost:port
----
[#microservice-mongoexpress]
[.text-right]
== How to open Web service microservice-mongoexpress xref:index.adoc#microservice-gns30[image:up-1.png[28,28,float=right]]
(1) Find IP:port in:
* Instances->running Containers
** Actions->Ports
[source,bash]
----
Start with URL: http://localhost:port
----
(2) Attach-network-interface mongoserver:
* Instances->running Containers
** Actions->Networks [Select network]
TIP: Once attached, you can work with the MongoDB server, managing MongoDB Databases, Collections, and Documents.
(3) Find mongoserver:
* Instances->running Containers
** Actions->Connect [Run in terminal]
*** nmap -sP IP/mask or nmap -p- IP/Network
[TIP]
====
Start mongoexpress
[source,bash]
----
mongo-express --admin --url mongodb://[IP]:27017
[IP] = Step (3)
----
Reload http://localhost:port
Step (1)
====
[#poc-jitsimeet]
[.text-right]
== How to open Web service poc-jitsimeet xref:index.adoc#poc-jitsimeet0[image:up-1.png[28,28,float=right]]
Start service:
* Private/Local->Proof_of_concept->poc-jitsimeet
Open Web
* Instances->running Containers
** [jitsiweb]->Actions->Connect [Click here to open the Web_App]
[TIP]
====
Accept self-signed certificate!
self-signed certificates are good to go for testing purposes and for internal LAN-only services.
When you use VENUS
====

4
how-to-build-a-Swarmlab-service/run/build-intro.sh

@ -0,0 +1,4 @@
antora --fetch /antora/site-intro.yml
antora /antora/site-intro.yml
ifconfig
http-server build/site -c-1

4
how-to-build-a-Swarmlab-service/run/build.sh

@ -0,0 +1,4 @@
antora --fetch /antora/site.yml
antora /antora/site.yml
ifconfig
http-server build/site -c-1

21
how-to-build-a-Swarmlab-service/site.yml

@ -0,0 +1,21 @@
site:
title: Swarmlab faq
url: http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs
start_page: swarmlab_faq::index.adoc
content:
sources:
- url: https://git.swarmlab.io:3000/docs/Documentation.git
branches: master
start_path: faq
ui:
bundle:
url: https://git.swarmlab.io:3000/docs/docs/raw/branch/master/ui-bundle.zip
snapshot: true
supplemental_files: ./supplemental-ui
asciidoc:
attributes:
:plantuml-server-url: http://www.plantuml.com/plantuml
extensions:
- '@djencks/asciidoctor-mathjax'
- asciidoctor-plantuml

4
site.yml

@ -53,6 +53,10 @@ content:
- url: https://git.swarmlab.io:3000/docs/Documentation.git
branches: master
start_path: sidecar-firefox
- url: https://git.swarmlab.io:3000/docs/Documentation.git
branches: master
start_path: how-to-build-a-Swarmlab-service
ui:
bundle:
url: https://git.swarmlab.io:3000/docs/docs/raw/branch/master/ui-bundle.zip

Loading…
Cancel
Save