diff --git a/README.md b/README.md index eb1ce0a..12a8953 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,8 @@ Documentation is a multi-repository site generator (Antora based) # Examples of [OPTIONS] can be: +> *faq:* **FAQ** +> > *iptables:* **This tutorial demonstrates, howto setup iptables & howto use it** > > *network-scanning:* **This tutorial demonstrates some common nmap port scanning scenarios and explains the output.** @@ -69,4 +71,3 @@ Documentation is a multi-repository site generator (Antora based) ### *poc-rocketchat:* Start poc-rocketchat with URL: http://localhost:7030 - diff --git a/all/antora.yml b/all/antora.yml new file mode 100644 index 0000000..9bafa1c --- /dev/null +++ b/all/antora.yml @@ -0,0 +1,5 @@ + name: swarmlab_all + title: swarmlab_all + version: docs + nav: + - modules/ROOT/nav.adoc diff --git a/all/modules/ROOT/images/adhoc.png b/all/modules/ROOT/images/adhoc.png new file mode 100644 index 0000000..6256678 Binary files /dev/null and b/all/modules/ROOT/images/adhoc.png differ diff --git a/all/modules/ROOT/images/swarmlab.png b/all/modules/ROOT/images/swarmlab.png new file mode 100644 index 0000000..d94ea42 Binary files /dev/null and b/all/modules/ROOT/images/swarmlab.png differ diff --git a/all/modules/ROOT/images/up-1.png b/all/modules/ROOT/images/up-1.png new file mode 100644 index 0000000..1a3ee40 Binary files /dev/null and b/all/modules/ROOT/images/up-1.png differ diff --git a/all/modules/ROOT/images/up-2.png b/all/modules/ROOT/images/up-2.png new file mode 100644 index 0000000..43b8990 Binary files /dev/null and b/all/modules/ROOT/images/up-2.png differ diff --git a/all/modules/ROOT/images/up.png b/all/modules/ROOT/images/up.png new file mode 100644 index 0000000..f4db804 Binary files /dev/null and b/all/modules/ROOT/images/up.png differ diff --git a/all/modules/ROOT/nav.adoc b/all/modules/ROOT/nav.adoc new file mode 100644 index 0000000..ed063c5 --- /dev/null +++ b/all/modules/ROOT/nav.adoc @@ -0,0 +1 @@ +* xref:index.adoc[faq] diff --git a/all/modules/ROOT/pages/index.adoc b/all/modules/ROOT/pages/index.adoc new file mode 100644 index 0000000..8958d45 --- /dev/null +++ b/all/modules/ROOT/pages/index.adoc @@ -0,0 +1,92 @@ += 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[Homw to Add current user to the docker group] + + + + + + + + + + + + + +[#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] +== Homw 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 +---- diff --git a/all/run/build-intro.sh b/all/run/build-intro.sh new file mode 100755 index 0000000..af181d8 --- /dev/null +++ b/all/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 diff --git a/all/run/build.sh b/all/run/build.sh new file mode 100755 index 0000000..7122c21 --- /dev/null +++ b/all/run/build.sh @@ -0,0 +1,4 @@ +antora --fetch /antora/site.yml +antora /antora/site.yml +ifconfig +http-server build/site -c-1 diff --git a/all/site.yml b/all/site.yml new file mode 100644 index 0000000..98f342a --- /dev/null +++ b/all/site.yml @@ -0,0 +1,27 @@ +site: + title: Swarmlab all + url: http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs + start_page: swarmlab_all::index.adoc +content: + sources: + - url: https://git.swarmlab.io:3000/docs/Documentation.git + branches: master + start_path: faq + - url: https://git.swarmlab.io:3000/docs/Documentation.git + branches: master + start_path: poc-datacollector + - url: https://git.swarmlab.io:3000/docs/Documentation.git + branches: master + start_path: raspi-docker +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 +