From 190770774c8914f3763522aacd28937a2c0b9143 Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 4 Jun 2021 03:38:21 +0200 Subject: [PATCH] (RE)ACTIVATE ipfs p2p tunnels = NextCloud FROM taurus TO oasis (https://taurus.copylaradio.com) --- cron_MINUTE.sh | 3 +++ zen/ipfs_P2P_forward.sh | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 1137b63..83b9310 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -136,6 +136,9 @@ if [[ $(($minute % 15)) == 0 ]]; then exit 1 fi + ## (RE)ACTIVATE ipfs p2p tunnels + # NextCloud FROM taurus TO oasis (https://taurus.copylaradio.com) + $MY_PATH/zen/ipfs_P2P_forward.sh ########## CHATON : OPEN OR CLOSE SSH ACCESS ################# # [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" == "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # OPEN-SSH # [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" != "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # CLOSE-SSH diff --git a/zen/ipfs_P2P_forward.sh b/zen/ipfs_P2P_forward.sh index 8eb2f60..238f646 100755 --- a/zen/ipfs_P2P_forward.sh +++ b/zen/ipfs_P2P_forward.sh @@ -18,24 +18,32 @@ 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; +# 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 !! +# _____ +#|_ _|_ _ _ _ _ __ _ _ ___ +# | |/ _` | | | | '__| | | / __| +# | | (_| | |_| | | | |_| \__ \ +# |_|\__,_|\__,_|_| \__,_|___/ NextCloud +# +# 12D3KooWRstYPJSakosgnvvGpxDdUJd2xAncJB7fbBwLBaTAEJxp + if [[ "$IPFSNODEID" == "12D3KooWRstYPJSakosgnvvGpxDdUJd2xAncJB7fbBwLBaTAEJxp" ]]; then - ipfs p2p listen /x/https-taurus /ip4/127.0.0.1/tcp/443 + [[ ! $(ipfs p2p ls | grep '/x/https-taurus') ]] && ipfs p2p listen /x/https-taurus /ip4/127.0.0.1/tcp/443 fi -# OASIS /etc/nginx/sites-available/taurus.copylaradio.com.conf + +# BRING TO 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 + [[ ! $(ipfs p2p ls | grep '/x/https-taurus') ]] && ipfs p2p forward /x/https-taurus /ip4/127.0.0.1/tcp/2443 /p2p/12D3KooWRstYPJSakosgnvvGpxDdUJd2xAncJB7fbBwLBaTAEJxp fi ipfs p2p ls