6 changed files with 100 additions and 59 deletions
@ -1,27 +0,0 @@
|
||||
#!/bin/bash |
||||
################################################################################ |
||||
# Author: Fred (support@qo-op.com) |
||||
# Version: 0.1 |
||||
# 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 |
||||
######################################################################## |
||||
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || er+=" ipfs daemon not running" |
||||
IPFSNODEID=$(ipfs id -f='<id>\n') || er+=" ipfs id problem" |
||||
WHOAMI=$(sbotc whoami | jq -r .id) || er+=" sbotc whoami problem" |
||||
[[ "$YOU" == "" || "$IPFSNODEID" == "" || "$WHOAMI" == "" ]] && echo "ERROR : $er " && exit 1 |
||||
######################################################################## |
||||
# TODO ESTABLISH A PORT FORWARD STRATEGY (depending on Node Flavour) |
||||
|
||||
# Arrange local port forwarded to swarm |
||||
|
||||
# GET _uidna (means g1sms/init.sh been run) |
||||
[[ -f /home/$YOU/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid ]] && UIDNA=$(cat /home/$YOU/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid) |
||||
|
||||
ipfs p2p close --all |
||||
ipfs p2p listen /x/ssh-$UIDNA /ip4/127.0.0.1/tcp/22 |
||||
# ipfs p2p listen /x/http-$UIDNA /ip4/127.0.0.1/tcp/80 |
||||
# ipfs p2p listen /x/https-$UIDNA /ip4/127.0.0.1/tcp/443 |
||||
ipfs p2p ls |
@ -0,0 +1,41 @@
|
||||
#!/bin/bash |
||||
################################################################################ |
||||
# Author: Fred (support@qo-op.com) |
||||
# Version: 0.1 |
||||
# 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 |
||||
######################################################################## |
||||
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || er+=" ipfs daemon not running" |
||||
IPFSNODEID=$(ipfs --timeout=5s id -f='<id>\n') || er+=" ipfs id problem" |
||||
[[ "$YOU" == "" || "$IPFSNODEID" == "" ]] && echo "ERROR : $er " && exit 1 |
||||
######################################################################## |
||||
# TODO ESTABLISH A PORT FORWARD STRATEGY (depending on Node Flavour) |
||||
IPFSADMINID=$(cat ~/.zen/astrXbian/A_swarm_admin.txt) |
||||
|
||||
## OASIS acts as nginx proxy WITH localhost:2443 => taurus:443 (NextCloud) |
||||
# OASIS : /etc/nginx/sites-available/taurus.copylaradio.com.conf |
||||
# server { |
||||
# server_name taurus.copylaradio.com; |
||||
# |
||||
# access_log /var/log/nginx/taurus-access.log; |
||||
# error_log /var/log/nginx/taurus-error.log; |
||||
# |
||||
# location / { |
||||
# proxy_pass https://127.0.0.1:2443; |
||||
# } |
||||
# } |
||||
# + sudo certbot !! |
||||
|
||||
if [[ "$IPFSNODEID" == "12D3KooWRstYPJSakosgnvvGpxDdUJd2xAncJB7fbBwLBaTAEJxp" ]]; then |
||||
ipfs p2p listen /x/https-taurus /ip4/127.0.0.1/tcp/443 |
||||
fi |
||||
# OASIS /etc/nginx/sites-available/taurus.copylaradio.com.conf |
||||
if [[ "$IPFSNODEID" == "12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN" ]]; then |
||||
ipfs p2p close -p /x/https-taurus |
||||
ipfs p2p forward /x/https-taurus /ip4/127.0.0.1/tcp/2443 /p2p/12D3KooWRstYPJSakosgnvvGpxDdUJd2xAncJB7fbBwLBaTAEJxp |
||||
fi |
||||
|
||||
ipfs p2p ls |
Loading…
Reference in new issue