This commit is contained in:
fred 2022-12-01 18:26:21 +01:00
parent c3510a1a93
commit b7ed00f0ef
5 changed files with 177 additions and 31 deletions

View File

@ -46,12 +46,12 @@ Content-Type: text/html; charset=UTF-8
echo "_________________________________________________________"
echo "LAUNCHING Astroport API Server - TUBE : $TUBE - "
echo
echo "NEW TW ${myHTTP}${myHOST}:1234/?salt=totodu56&pepper=totodu56&g1pub=on&email=totodu56@yopmail.com"
echo
echo "TW R/W MODE ${myHTTP}${myHOST}:1234/?salt=totodu56&pepper=totodu56&official"
echo
echo "GCHANGE MESSAGING ${myHTTP}${myHOST}:1234/?salt=totodu56&pepper=totodu56&messaging"
echo "OPEN GCHANGE ${myHTTP}${myHOST}:1234/?salt=totodu56&pepper=totodu56&g1pub"
echo "VISA.new ${myHTTP}${myHOST}:1234/?salt=totodu56&pepper=totodu56&g1pub=on&email=totodu56@yopmail.com"
echo "GCHANGE MESSAGING ${myHTTP}${myHOST}:1234/?salt=totodu56&pepper=totodu56&messaging"
echo
echo "VIDEO URL COPY ${myHTTP}${myHOST}:1234/?salt=totodu56&pepper=totodu56&videourl=https://"
echo
echo "TESTCRAFT ${myHTTP}${myHOST}:1234/?salt=totodu56&pepper=totodu56&testcraft=on&nodeid=12D3KooWK1ACupF7RD3MNvkBFU9Z6fX11pKRAR99WDzEUiYp5t8j&dataid=QmPXhrqQrS1bePKJUPH9cJ2qe4RrNjaJdRXaJzSjxWuvDi"
echo "_________________________________________________________"
@ -142,8 +142,6 @@ while true; do
sed -i "s~_IPFSNODEID_~${IPFSNODEID}~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect
sed -i "s~_HOSTNAME_~$(hostname)~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect
sed -i "s~http://127.0.0.1:8080~${myHTTP}${myHOSTPort}~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect
## Random Background image ;)
sed -i "s~.000.~.$(printf '%03d' $(echo ${RANDOM} % 18 | bc)).~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect
@ -163,8 +161,8 @@ while true; do
arr=(${URL//[=&]/ })
# CHECK APPNAME
APPNAME=$(urldecode ${arr[4]})
WHAT=$(urldecode ${arr[5]})
APPNAME=$(urldecode ${arr[4]} | xargs)
WHAT=$(urldecode ${arr[5]} | xargs)
########## CHECK GET PARAM NAMES
###################################################################################################
@ -617,18 +615,26 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
fi
##############################################
# VIDEOURL
##############################################
if [[ $APPNAME == "videourl" ]]; then
echo "$HTTPCORS /ipns/${ASTRONAUTENS} ADDING ${WHAT}"| nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
end=`date +%s`
echo $APPNAME "(☉_☉ ) ${WHAT} Execution time was "`expr $end - $start` seconds.
continue
fi
## RESPONDING
cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > ~/.zen/tmp/coucou/${MOATS}.official.swallow &
echo "HTTP 1.1 PROTOCOL DOCUMENT READY"
cat ~/.zen/tmp/coucou/${MOATS}.index.redirect
echo "${MOATS} -----> PAGE AVAILABLE -----> http://${myHOST}:${PORT}"
#echo "${ASTRONAUTENS}" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
## CHECK IF ALREADY EXISTING ${WHAT}
# IF NOT = BATCH CREATE TW
end=`date +%s`
echo $type" (☓‿‿☓) Execution time was "`expr $end - $start` seconds.
echo $type" (J‿‿J) Execution time was "`expr $end - $start` seconds.
fi ## END IF SALT

View File

@ -167,7 +167,7 @@ while read LINE;
PLAYLIST=$(yt-dlp --print "%(playlist)s" "${ZYURL}" | sed -r 's/\<./\U&/g' | sed 's/ //g')
EXTRATAG="$CHANNEL $PLAYLIST"
## PREPARE VIDEO HTML5 CODE
TEXT="<video controls width=100% poster='/ipfs/"${ANIMH}"'><source src='/ipfs/"${ILINK}"' type='"${MIME}"'></video><h1><a href='"${ZYURL}"'>"${TITLE}"</a></h1>"
TEXT="<video controls width=100% poster='/ipfs/"${ANIMH}"'><source src='/ipfs/"${ILINK}"' type='"${MIME}"'></video><br>{{!!duree}}<br><h1><a href='"${ZYURL}"'>"${TITLE}"</a></h1>"
echo "Creating Youtube ${YID} tiddler : G1CopierYoutube !"
echo $TEXT

View File

@ -8,7 +8,29 @@ Content-Type: text/html; charset=UTF-8
<!doctype html>
<html>
<head>
<meta http-equiv="refresh" content="30; url='http://127.0.0.1:12345'" />
<style>
body {
background-image:url("http://127.0.0.1:8080/ipfs/QmSFgatcq3q898J56epa8SyGbH651vRBFnv93kQSwfoi83/background.000.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
}
html {
height: 100%
}
input[type=submit] {
width: 12em; height: 4em;
}
input[type=checkbox] {
width: 2em; height: 2em;
}
input {
width: 20em; height: 2em;
}
</style>
<style>
#reduce42 {
width:42%;
@ -44,6 +66,92 @@ Content-Type: text/html; charset=UTF-8
</head>
<body>
<header>
<h6>
<a href="http://127.0.0.1:1234/"> <span>"/ipfs/</span>TW<span>"</span></a>
</h6>
</header>
<main>
<center>
<b>--- Welkom - Mirë se vini - Willkommen - Welkomma - Welcome - Marhaban - Bari galoust - Xos gelmissiniz - Welkum - Ongi etorri- Swagata - Ansuf yiswen - ščyra zaprašajem - Kyo tzo pa eit - Ani kié - Dobro došli - Dagemer mat - Dobre doshŭl - Benvinguts - Ulihebisdi - Huān yíng - Karibu - Eoso eoseyo - Benvenuti - Bel bonjou - Bienvini - Dobrodošli - Velkommen - Bienvenido - Bonvenon - Tere tulemast - Gabitê - Vælkomin - Tervetuloa - Welkom - Wìllkòmme - Binvignut - Fàilte - Benvido - Croeso - Planvenguda - Mikouabô - Kalos irthate - -Eguahé porá - Baroukh habaim - ... ----</b><br>
<h1>Astroport</h1>
<h2>Internet Reboot !<br>Inscrivez-vous<br>
<form id="formlink" action = "http://127.0.0.1:1234" method = "GET">
<br>
<b>Associez 2 phrases clefs et votre adresse email</b></br></br>
Phrase 1 : <input name=salt value=''></br>
Phrase 2 : <input name=pepper value=''></br></br>
Bitswap Ŋ1 (délégation de clef à 20h12) : <input type="checkbox" id="g1pub" name="g1pub" checked></br>
- Email -</br><input name=email value=''></br></br>
<input type='submit' value='(☼‿‿☼)'>
</form>
</h2>
<p>
<b>Besoin d'aide ? Contactez support@qo-op.com</b>
</p>
</center>
<article>
<div class="row justify-center">
<h1 class="video-title">
<a href="https://git.p2p.legal/qo-op/Astroport.ONE" target="code">'ASTROŊAUTE'. Insérez vos clefs. Activez le niveau Ŋ1. Explorez les toiles confiances.</a>. <br>
<a target="code" href="http://opencollective.com/monnaie-libre/projects/bunker-box">Copiez, conservez, partagez, diffusez vos chaines multimédia et json dans IPFS, entre amis!<br>
Prenez possession de votre TW. Rendez in-censurable, in-arrêtable la liberté d'expression.</a>
</h1>
</div>
</article>
<article>
<div class="row justify-center">
</div>
</article>
<article>
<div class="row justify-center">
<p><h3>Devenez INTERNET - Installez IPFS - Activez >>> <a href="https://git.p2p.legal/qo-op/Astroport.ONE" target="code"><b>Astroport.ONE</b></a> <<< </h3>
<ul>
<li>Installez 'go-ipfs' <a href="https://docs.ipfs.tech/install/command-line/#official-distributions" target="code">KUBO</a> sur votre système</li>
<li>Ajoutez <a href="https://docs.ipfs.tech/install/ipfs-companion/" target="code"><b>ipfs-companion</b></a> à votre navigateur</li>
</ul>
</p>
</div>
</article>
BECOME ASTROŊAUTE
explore
Astroport Ŋ1 Swarm#0
Associate your key phrases with an email address
Phrase One ("login")
Phrase Two ("password")
Accept delegation of your key (Ŋ1 20h12 bitswap) :
Email :
Need help? Contact support@qo-op.com
Astroport' operates a 100% blockchain digitalization.
Copy, store, share, broadcast your multimedia and json channels in IPFS, between friends!
Take possession of your TW. Make freedom of expression uncensurable, unstoppable.
>>> Let's reboot the INTERNET - Install IPFS - Activate Astroport.ONE <<<
Install 'go-ipfs' KUBO on your system
Add ipfs-companion to your browser
<center>
<h6>
<a href="http://madeinzion.org"> Made In Zion _\/_ </a> powered by <a href="http://astroport.com"><span>"</span>Astroport<span>"</span></a>
</h6>
</center>
</main>
<center>
<h2>IPFS BIOS<br> - TW Astroport Ŋ1 -</h2>
<div id="yellow">
@ -96,8 +204,47 @@ function countdown() {
timeLeft--;
}
}
</script>
<script>
var arrTimes = [];
var i = 0; // start
var timesToTest = 3;
var tThreshold = 300; //ms
var testImage = "http://libra.copylaradio.com:8080/ipfs/QmUUyiuCM4yXgaeGyqC2SVUUXZksuxhDfHQYpUpZPuL2oS/astroport.jpg"; // small image in your server
var dummyImage = new Image();
var isConnectedFast = false;
testLatency(function(avg){
isConnectedFast = (avg <= tThreshold);
/** output */
document.body.appendChild(
document.createTextNode("Time: " + (avg.toFixed(2)) + "ms - Bunker BOX ready ? " + isConnectedFast)
);
});
/** test and average time took to download image from server, called recursively timesToTest times */
function testLatency(cb) {
var tStart = new Date().getTime();
if (i<timesToTest-1) {
dummyImage.src = testImage + '?t=' + tStart;
dummyImage.onload = function() {
var tEnd = new Date().getTime();
var tTimeTook = tEnd-tStart;
arrTimes[i] = tTimeTook;
testLatency(cb);
i++;
};
} else {
/** calculate average of array items then callback */
var sum = arrTimes.reduce(function(a, b) { return a + b; });
var avg = sum / arrTimes.length;
cb(avg);
}
}
</script>
</body>
</html>

View File

@ -9,14 +9,14 @@ IPFSNODEID=$(ipfs id -f='<id>\n') || ( echo "IPFSNODEID MISSING" && exit 1 )
TUBE=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 3)
## GETTING LAST TW via IPFS
echo "ipfs --timeout 12s cat /ipns/${ASTRONAUTENS}"\
echo "IPFS : ipfs --timeout 12s cat /ipns/${ASTRONAUTENS}"\
&& ipfs --timeout 12s cat /ipns/${ASTRONAUTENS} > ~/.zen/tmp/coucou/${MOATS}.astroindex.html
## GETTING LAST TW via HTTP
[[ ! -s ~/.zen/tmp/coucou/${MOATS}.astroindex.html ]] \
&& echo "$TUBE/ipns/${ASTRONAUTENS}" \
&& echo "WWW : $TUBE/ipns/${ASTRONAUTENS}" \
&& curl -m 12 -so ~/.zen/tmp/coucou/${MOATS}.astroindex.html "$TUBE/ipns/${ASTRONAUTENS}"
|| curl -m 1 -so ~/.zen/tmp/${MOATS}.html "$TUBE/ipns/${ASTRONAUTENS}"
|| curl -m 1 -so ~/.zen/tmp/${MOATS}.html "$TUBE/ipns/${ASTRONAUTENS}" ## Ask caching
### GOT TW !!
if [[ -s ~/.zen/tmp/coucou/${MOATS}.astroindex.html ]]; then
@ -35,6 +35,7 @@ TUBE=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d
[[ ! -s ~/.zen/tmp/${MOATS}Astroport.json ]] && echo "BAD TW (☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 1
espeak "Hello. $(cat ~/.zen/tmp/${MOATS}Astroport.json | jq -r .[].pseudo) Happy to Help you."
export PLAYER=$PLAYER
else
echo "BAD PLAYER"

View File

@ -84,11 +84,10 @@ PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null);
[[ ! $PLAYER ]] && echo "(╥☁╥ ) No current player. Please Login" && exit 1
# NOT CURRENT PLAYER (CHECK FOR TW & KEY
[[ $G1PUB != $(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) ]] \
&& [[ $(ipfs key list -l | grep -w $G1PUB) ]] \
[[ $(ipfs key list -l | grep -w $G1PUB) ]] \
&& echo "(ᵔ◡◡ᵔ) INVITATION $G1PUB" \
&& ASTRONS=$($MY_PATH/tools/g1_to_ipfs.py "$G1PUB") \
&& $MY_PATH/tools/TW.cache.sh $ASTRONS $MOATS \
&& $MY_PATH/TW.cache.sh $ASTRONS $MOATS \
|| echo "(╥☁╥ ) I cannot help you"
########################################################################
@ -97,7 +96,7 @@ PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null);
mkdir -p ~/.zen/game/players/$PLAYER/ipfs/.${IPFSNODEID}
### SOURCE IS ~/Astroport/ !!
[[ ! $(echo "$path" | cut -d '/' -f 4 | grep 'astroport') ]] && er="Les fichiers sont à placer dans ~/Astroport/ MERCI" && echo "$er" && exit 1
[[ ! $(echo "$path" | cut -d '/' -f 4 | grep 'Astroport') ]] && er="Les fichiers sont à placer dans ~/Astroport/ MERCI" && echo "$er" && exit 1
### TyPE & type & T = related to ~/astroport location of the infile (mimetype subdivision)
TyPE=$(echo "$path" | cut -d '/' -f 5 ) # ex: /home/$YOU/Astroport/... TyPE(film, youtube, mp3, video, page)/ REFERENCE /
@ -297,14 +296,7 @@ then
TEXT="<video controls width=100% poster='/ipfs/"${ANIMH}"'><source src='/ipfs/"${IPFSID}"' type='"${MIME}"'></video>
<br>{{!!duree}}<br>
"$H1"
<h2>"$DESCRIPTION"</h2>
<\$button class='tc-tiddlylink'>
<\$list filter='[tag[G1${CAT}]]'>
<\$action-navigate \$to=<<currentTiddler>> \$scroll=no/>
</\$list>
Afficher G1${CAT}
</\$button>"
<h2>"$DESCRIPTION"</h2>"
TidType="text/vnd.tiddlywiki" ## MAYBE REAL ONCE TW CAN SHOW ATTACHED IPFS VIDEO (TODO: TESTINGS)
TAGS="G1${CAT} ${PLAYER} ${FILETAG} $SAISON $GENRE ipfs ${HASHTAG}"