This commit is contained in:
fred 2022-11-19 17:46:00 +01:00
parent 81ebc17d8b
commit bf228a42d3
4 changed files with 40 additions and 19 deletions

View File

@ -298,7 +298,7 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
gum=$(echo "$nicegw" | sed "s~:hash~$DATAID~g")
echo "LOADING $gum"
curl -m 5 -so ~/.zen/tmp/${IPFSNODEID}/${ASTRONAUTENS}/${APPNAME}/${MOATS}.data.${WHAT} "$gum"
[[ $? != 0 ]] && echo "(✜‿‿✜) BYPASSING"; echo
[[ $? != 0 ]] && echo "(✜‿‿✜) BYPASSING"
if [[ -s ~/.zen/tmp/${IPFSNODEID}/${ASTRONAUTENS}/${APPNAME}/${MOATS}.data.${WHAT} ]]; then
@ -325,7 +325,7 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
else
echo " (⇀‿‿↼) - TIMEOUT - (⇀‿‿↼)"
echo " (⇀‿‿↼) - NO FILE - (⇀‿‿↼)"
continue
fi
@ -411,7 +411,7 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
$MY_PATH/tools/natools.py decrypt -f pubsec -k ~/.zen/tmp/coucou/${MOATS}.secret.key -i ~/.zen/tmp/myIP.$G1PUB.enc.2 -o ~/.zen/tmp/myIP.$G1PUB > /dev/null 2>&1
GWIP=$(cat ~/.zen/tmp/myIP.$G1PUB > /dev/null 2>&1)
[[ ! $GWIP ]] && GWIP=$SECRET ## CLEAR
[[ ! $GWIP ]] && GWIP=$myIP ## CLEAR
#
echo "TW is on $GWIP"

View File

@ -50,7 +50,7 @@ URL="$1"
if [ $URL ]; then
echo "URL: $URL"
REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_"
[ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Quel type de media voulez vous copier ?" --entry-text="Video" Page MP3 Web)
[ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="${PLAYER} Type de media à importer ?" --entry-text="Video" Page MP3 Web)
[[ $IMPORT == "" ]] && espeak "No choice made. Exiting program" && exit 1
[[ $IMPORT == "Video" ]] && IMPORT="Youtube"
CHOICE="$IMPORT"
@ -272,10 +272,17 @@ rm -Rf ${YTEMP}
## record one page to PDF
[[ ! $(which chromium) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de page web absent.. Lancez la commande 'sudo apt install chromium'" && exit 1
cd /tmp/ && rm -f output.pdf
cd ~/.zen/tmp/ && rm -f output.pdf
${MY_PATH}/tools/timeout.sh -t 12 \
chromium --headless --no-sandbox --print-to-pdf $URL
TITLE=$(zenity --entry --width 480 --title "Titre" --text "Quel nom de fichier à donner à cette page ? " --entry-text="${URL}")
[[ ! -s ~/.zen/tmp/output.pdf ]] && espeak "No file Sorry. Exit" > /dev/null 2>&1 && exit 1
CTITLE=$(echo $URL | rev | cut -d '/' -f 1 | rev)
TITLE=$(zenity --entry --width 480 --title "Titre" --text "Quel nom de fichier à donner à cette page ? " --entry-text="${CTITLE}")
[[ $TITLE == "" ]] && exit 1
FILE_NAME="$(echo "${TITLE}" | detox --inline).pdf" ## TODO make it better
@ -660,7 +667,7 @@ espeak "Updating IPNS. Please wait..."
~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats)
TW=$(ipfs add -Hq ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html | tail -n 1)
ipfs name publish --allow-offline -t 72h --key=${PLAYER} /ipfs/$TW
ipfs name publish --allow-offline -t 24h --key=${PLAYER} /ipfs/$TW
[[ $DIFF ]] && echo $TW > ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain
echo ${MOATS} > ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats

View File

@ -25,6 +25,8 @@ myIP=$(hostname -I | awk '{print $1}' | head -n 1)
isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost"
alias zenity='zenity 2> >(grep -v GtkDialog >&2)'
# ~/.zen/game/players/$PLAYER/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN
# Astropot/Kodi/Vstream source reads ${PREFIX}ASTRXBIAN from http://${myIP}:8080/.$IPFNODEID/
# Index File Format (could be enhanced) is using Kodi TMDB enhancement

View File

@ -122,9 +122,9 @@
<script>
function cacheIt (appName, hash, nodeId = '') {
var gatewayProtocol = 'https';
var gatewayProtocol = 'http';
var gatewayDomain = 'tube.copylaradio.com';
var gatewayDomain = 'astroport.localhost';
var gatewayPort = '1234';
@ -137,10 +137,7 @@ function cacheIt (appName, hash, nodeId = '') {
query += '&nodeid=' + nodeId
query += '&dataid=' + hash;
var URL1234 = 'http://'+ gatewayDomain +':'+ gatewayPort + '/?' + query;
console.log(URL1234)
var fullURL = 'https://'+ gatewayDomain +'/'+ gatewayPort + '/?' + query;
var fullURL = 'http://'+ gatewayDomain +':'+ gatewayPort + '/?' + query;
console.log(fullURL)
const controller = new AbortController()
@ -192,9 +189,21 @@ async function ipfs_init() {
'/dns4/wrtc-star2.sjc.dwebops.pub/tcp/443/wss/p2p-webrtc-star'
]
}
}
},
"Discovery": {
"MDNS": {
"Enabled": false,
"Interval": 10
},
"webRTCStar": {
"Enabled": true
}
},
"Bootstrap": [
"/dns4/wss0.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmZMxNdpMkewiVZLMRxaNxUeZpDUb34pWjZ1kZvsd16Zic",
"/dns4/wss1.bootstrap.libp2p.io/tcp/443/wss/ipfs/Qmbut9Ywz9YEDrz8ySBSgWyJk41Uvm2QJPhwDJzJyGFsD6"
]
}
);
let nodeId = await node.id();
@ -218,12 +227,15 @@ async function ipfs_init() {
);
const cid = fileAdded.cid.toString();
var salt = 'totodu56';
var pepper = 'totodu56';
document.getElementById('informations').innerHTML = [
'The file has been added to IPFS!',
'Prêt à enregistrer !',
'',
'Its hash (CID) is:',
`<a href="https://download-a-file-from-ipfs.com/?cid=${cid}" target="_blank">${cid}</a>`,
'(click to download it)'
'Son Hash (CID) est :',
`<a href="http://libra.copylaradio.com:1234/?salt=${salt}&pepper=${pepper}&testcraft=on&nodeid=${nodeId}&dataid=${cid}" target="reboot">${cid}</a>`,
'(cliquez pour demander enregistrement)'
].join('<br />');
cacheIt('testcraft=on', cid, nodeId)