zeus
3 years ago
3 changed files with 24 additions and 177 deletions
@ -1,5 +1,5 @@ |
|||
name: swarmlab_faq |
|||
title: swarmlab_faq |
|||
name: swarmlab_how-to-build-a-Swarmlab-service |
|||
title: swarmlab_how-to-build-a-Swarmlab-service |
|||
version: docs |
|||
nav: |
|||
- modules/ROOT/nav.adoc |
|||
|
@ -1,211 +1,58 @@ |
|||
= FAQ! |
|||
|
|||
= how-to-build-a-Swarmlab-service! |
|||
|
|||
[#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] |
|||
image::ROOT:swarmlab.png[swarmlab,150,float=right] |
|||
|
|||
[#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]] |
|||
== Clone a example |
|||
|
|||
[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 |
|||
git clone https://git.swarmlab.io:3000/swarmlab/swarmlab-microservice-example.git |
|||
---- |
|||
|
|||
|
|||
[#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 |
|||
== Edit template |
|||
|
|||
[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 |
|||
|
|||
install/usr/share/swarmlab.io/sec/swarmlab-gen.sh |
|||
---- |
|||
|
|||
[#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]] |
|||
== Generate |
|||
|
|||
[source,bash] |
|||
---- |
|||
sudo usermod -aG docker $USER |
|||
./install/usr/share/swarmlab.io/sec/swarmlab-gen.sh |
|||
---- |
|||
|
|||
[#poc-rocketchat] |
|||
[.text-right] |
|||
== How to open Web service rocketchat xref:index.adoc#poc-rocketchat0[image:up-1.png[28,28,float=right]] |
|||
|
|||
|
|||
== create |
|||
|
|||
[source,bash] |
|||
---- |
|||
Start poc-rocketchat with URL: http://localhost:7030 |
|||
./install/usr/share/swarmlab.io/sec/swarmlab-sec create |
|||
---- |
|||
|
|||
[#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 |
|||
== Start |
|||
|
|||
[source,bash] |
|||
---- |
|||
Start with URL: http://localhost:port |
|||
./install/usr/share/swarmlab.io/sec/swarmlab-sec up |
|||
---- |
|||
|
|||
[#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 |
|||
== Stop |
|||
|
|||
[source,bash] |
|||
---- |
|||
Start with URL: http://localhost:port |
|||
./install/usr/share/swarmlab.io/sec/swarmlab-sec down |
|||
---- |
|||
|
|||
(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 |
|||
== git push |
|||
|
|||
[source,bash] |
|||
---- |
|||
mongo-express --admin --url mongodb://[IP]:27017 |
|||
[IP] = Step (3) |
|||
git add . |
|||
git commit -m"info" |
|||
git push origin |
|||
---- |
|||
|
|||
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 |
|||
|
|||
==== |
|||
|
|||
|
|||
|
|||
|
|||
|
Loading…
Reference in new issue