diff --git a/RUNTIME/DRAGON_p2p_ssh.sh b/RUNTIME/DRAGON_p2p_ssh.sh new file mode 100755 index 00000000..fe9bd27d --- /dev/null +++ b/RUNTIME/DRAGON_p2p_ssh.sh @@ -0,0 +1,83 @@ +#!/bin/bash +################################################################################ +# Author: Fred (support@qo-op.com) +# Version: 0.2 +# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) +################################################################################ +# Activate SUPPORT MODE: open ssh over IPFS +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +. "$MY_PATH/my.sh" +######################################################################## +YOU=$(myIpfsApi) || er+=" ipfs daemon not running" +[[ "$YOU" == "" || "${IPFSNODEID}" == "" ]] && echo "ERROR : $er " && exit 1 +######################################################################## +## THIS SCRIPT COPY BOOSTRAP PUBKEY +### AND OPEN IPFS P2P SSH FORWARD ON CHANNEL +# Make Station publish SSH port on "/x/ssh-$(IPFSNODEID)" +######################################################################## +## use STOP or OFF to finish forwarding + +PARAM="$1" +if [[ "${PARAM,,}" == "off" || "${PARAM,,}" == "stop" ]]; then + ipfs p2p close --all + rm ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh 2>/dev/null + rm ~/.zen/tmp/${IPFSNODEID}/y_ssh.pub 2>/dev/null + echo "STOP" && exit 0 +fi + +############################################ +## DISTRIBUTE DRAGON SSH WOT SEED : A_boostrap_ssh.txt +############################################ +while IFS= read -r line +do + LINE=$(echo "$line" | grep "ssh-ed25519" | grep -Ev "#") # Remove # & not ssh-ed25519 + [[ ! ${LINE} ]] && continue + if [[ ! $(cat ~/.ssh/authorized_keys | grep "${LINE}") ]] + then + echo "# ADDING ${LINE} to ~/.ssh/authorized_keys" + mkdir -p ~/.ssh && echo "${LINE}" >> ~/.ssh/authorized_keys + else + echo "TRUSTING ${LINE}" + fi +done < ${MY_PATH}/../A_boostrap_ssh.txt + +############################################ +## PUBLISH SSH PUBKEY OVER IPFS +## KITTY ssh-keygen style +[[ -s ~/.ssh/id_ed25519.pub ]] && cp ~/.ssh/id_ed25519.pub ~/.zen/tmp/${IPFSNODEID}/y_ssh.pub +## DRAGONz PGP/SSH style (https://pad.p2p.legal/keygen) +gpg --export-ssh-key $(cat ~/.zen/game/players/.current/.player) 2>/dev/null > ~/.zen/tmp/${IPFSNODEID}/z_ssh.pub + +############################################ +### FORWARD SSH PORT over /x/ssh-${IPFSNODEID} +############################################ +echo "Lanching /x/ssh-${IPFSNODEID}" + +[[ ! $(ipfs p2p ls | grep "/x/ssh-${IPFSNODEID}") ]] && ipfs p2p listen /x/ssh-${IPFSNODEID} /ip4/127.0.0.1/tcp/22 + +ipfs p2p ls + +echo +echo "#!/bin/bash" +############################################ +## PREPARE x_ssh.sh +## REMOTE ACCESS COMMAND FROM DRAGONS +############################################ +PORT=22000 +PORT=$((PORT+${RANDOM:0:3})) + +echo "if [[ ! \$(ipfs p2p ls | grep x/ssh-${IPFSNODEID}) ]]; then +ipfs --timeout=5s ping -n 1 /p2p/${IPFSNODEID} +ipfs p2p forward /x/ssh-${IPFSNODEID} /ip4/127.0.0.1/tcp/$PORT /p2p/${IPFSNODEID} +ssh $USER@127.0.0.1 -p $PORT +fi" > ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh + +cat ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh + +############################################ +echo +echo "ipfs cat /ipns/${IPFSNODEID}/x_ssh.sh | bash" +############################################ + +exit 0 diff --git a/images/android.svg b/images/android.svg new file mode 100644 index 00000000..4f8773f6 --- /dev/null +++ b/images/android.svg @@ -0,0 +1,67 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/images/apple.svg b/images/apple.svg new file mode 100644 index 00000000..d453449b --- /dev/null +++ b/images/apple.svg @@ -0,0 +1,62 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/images/cesium-android.png b/images/cesium-android.png new file mode 100644 index 00000000..9eba24b4 Binary files /dev/null and b/images/cesium-android.png differ diff --git a/images/cesium-apple.png b/images/cesium-apple.png new file mode 100644 index 00000000..a26f96ed Binary files /dev/null and b/images/cesium-apple.png differ diff --git a/images/cesium.png b/images/cesium.png new file mode 100644 index 00000000..159ea77d Binary files /dev/null and b/images/cesium.png differ diff --git a/images/firefox2019.png b/images/firefox2019.png new file mode 100644 index 00000000..0e90e13f Binary files /dev/null and b/images/firefox2019.png differ diff --git a/images/github.svg b/images/github.svg new file mode 100644 index 00000000..b9177165 --- /dev/null +++ b/images/github.svg @@ -0,0 +1,67 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/images/internet.png b/images/internet.png new file mode 100644 index 00000000..e4e7bccb Binary files /dev/null and b/images/internet.png differ