From b580c42a2c0ee7d3b043605014d6c02391eb0c79 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 27 Nov 2022 13:59:03 +0100 Subject: [PATCH 1/6] =?UTF-8?q?BRO=20=C5=8A1=20+=20=C5=8A2=20networks=20ex?= =?UTF-8?q?ploration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/Connect_PLAYER_To_Gchange.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tools/Connect_PLAYER_To_Gchange.sh b/tools/Connect_PLAYER_To_Gchange.sh index eb386a56..c8686b56 100755 --- a/tools/Connect_PLAYER_To_Gchange.sh +++ b/tools/Connect_PLAYER_To_Gchange.sh @@ -97,14 +97,13 @@ do echo "TW ? http://tube.copylaradio.com:8080/ipns/$ASTRONAUTENS " ##### CHECKING IF WE LIKE EACH OTHER Ŋ1 LEVEL + echo "Receiving Stars : cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json | jq -r" ################################## JAKLIS LIKING_ME stars ~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \ ~/.zen/Astroport.ONE/tools/jaklis/jaklis.py \ -k ~/.zen/game/players/${PLAYER}/secret.dunikey \ -n "https://data.gchange.fr" \ stars -p ${liking_me} > ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json - - echo "Got Stars - DEBUG - cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json | jq -r" ## ZOMBIE PROTECTION [[ "$?" == "0" && ! -s ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json ]] && rm -Rf ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me} && echo "${liking_me} is a ZOMBIE..." && continue @@ -127,8 +126,15 @@ do cp ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/ && rm -f ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json echo "$my_star_level" > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/stars.level && echo "***** $my_star_level STARS *****" + ## GET FRIEND GCHANGE PROFILE + ${MY_PATH}/timeout.sh -t 20 \ + ${MY_PATH}/jaklis/jaklis.py \ + -p ${liking_me} > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/gchange.json + + FRIENDTITLE=$(cat ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/gchange.json | jq -r '.title') + ## GET FRIEND TW !! - echo "Getting latest online TW..." + echo "Getting $FRIENDTITLE latest online TW..." YOU=$(ipfs swarm peers >/dev/null 2>&1 && echo "$USER" || ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2) echo "$LIBRA/ipns/$ASTRONAUTENS" @@ -139,18 +145,14 @@ do ## PLAYER TW EXISTING ? if [ ! -s ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html ]; then - # # # # # # # # # # # # # # # ## AUCUN VISA ASTRONAUTE ENVOYER UN MESSAGE PAR GCHANGE echo "AUCUN TW ACTIF. ENVOYONS LUI UN MESSAGE..." $MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey -n "https://data.gchange.fr" send -d "${liking_me}" -t "BRO !" -m ">>> (◕‿‿◕) <<< https://astroport.copylaradio.com >>> (◕‿‿◕) <<<" else - echo "COOL MON AMI PUBLIE SUR IPFS" + echo "COOL MON AMI EST SUR IPFS" ls -al ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html - # # # # # # # # # # # # # # # TODO - # CHECK Dessin de Moa ?? (DIS)CONNECT PLAYERS - # # # # # # # # # # # # # # # fi @@ -158,15 +160,14 @@ do # SCRAPING DONNE LE BON COIN # https://www.leboncoin.fr/recherche?text=donne&locations=Toulouse__43.59743304757555_1.4471155185604894_10000_5000&owner_type=private&sort=time&donation=1 - - ## Get Ŋ2 LEVEL echo "(°▃▃°) (°▃▃°) (°▃▃°) Ŋ2 scraping ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/friend_of_friend.json" for nid in $(cat ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/${liking_me}.Gstars.json | jq -r '.likes[].issuer'); do + echo "Ami(s) de cet Ami $linking_me : $nid" friend_of_friend=$(cat ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/${liking_me}.Gstars.json | jq -r '.likes[] | select(.issuer | strings | test("'$nid'"))') - echo "$friend_of_friend" | jq -r > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/friend_of_friend.json + echo "$friend_of_friend" | jq -r > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/FoF_$nid.json done From 32f6824e4b244804e9e678b2060b57870eb41c08 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 27 Nov 2022 13:59:33 +0100 Subject: [PATCH 2/6] send email from: support@g1sms.fr --- tools/mailjet.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mailjet.sh b/tools/mailjet.sh index ae640a38..0da17688 100755 --- a/tools/mailjet.sh +++ b/tools/mailjet.sh @@ -25,8 +25,8 @@ messfile="$2" # FICHIER A AJOUTER AU CORPS MESSAGE [[ ! $1 ]] && mail="support@qo-op.com" -SUBJECT="[(♥‿‿♥)] Astronaute. Message Station Astroport.ONE" -MESSAGE="( ◕‿◕)\n\n Bonjour $PLAYER\n\n\n Activez votre TW https://astroport.copylaradio.com .\n\nAstroport\n$IPFSNODEID" +SUBJECT="[(♥‿‿♥)] Message Station Astroport : $(hostname)" +MESSAGE="( ◕‿◕)\n\n Bonjour $PLAYER\n\n\n Activez votre TW https://astroport.copylaradio.com .\n\nAstroport\n($IPFSNODEID)" echo "From: support@g1sms.fr To: EMAIL From 1ba3b338f52aa5775d24b46e772f229aad064ec2 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 27 Nov 2022 18:06:24 +0100 Subject: [PATCH 3/6] --download-archive $HOME/.zen/.yt-dlp.list \ --- ASTROBOT/G1CopierYoutube.sh | 100 ++++++++++++++++++++++++------------ 1 file changed, 66 insertions(+), 34 deletions(-) diff --git a/ASTROBOT/G1CopierYoutube.sh b/ASTROBOT/G1CopierYoutube.sh index 13632bcd..f3a5e108 100755 --- a/ASTROBOT/G1CopierYoutube.sh +++ b/ASTROBOT/G1CopierYoutube.sh @@ -13,9 +13,11 @@ echo "$ME RUNNING" # Download video, add to ipfs and import new tiddler # Publish !! +## TODO USE API 1234 & new_file_in_astroport.sh FOR TW + # ASTROBOT FIRST PROCESS # "Copier youtube" + (voeu) => CopierYoutube (G1Voeu G1CopierYoutube) = ASTROBOT copy Ŋ1 "(G1CopierYoutube)" - +IPFSNODEID=$(ipfs id -f='\n') INDEX="$1" [[ ! $INDEX ]] && echo "ERROR - Please provide path to source TW index.html" && exit 1 @@ -26,53 +28,78 @@ WISHKEY="$2" ## IPNS KEY NAME - G1PUB - PLAYER ... TWNS=$(ipfs key list -l | grep -w $WISHKEY | cut -d ' ' -f1) [[ ! $TWNS ]] && echo "ERROR - Clef IPNS $WISHKEY introuvable!" && exit 1 -# Extract tag=tube from TW into ~/.zen/tmp/$WISHKEY/CopierYoutube.json +# Extract tag=tube from TW MOATS=$(date -u +"%Y%m%d%H%M%S%4N") -mkdir -p ~/.zen/tmp/$WISHKEY +mkdir -p ~/.zen/tmp/$IPFSNODEID ################################################################### ## TODO BOUCLER SUR LES INDEX des G1Astronautes G1Ami ################################################################### -rm -f ~/.zen/tmp/$WISHKEY/CopierYoutube.json +rm -f ~/.zen/tmp/CopierYoutube.json tiddlywiki --load ${INDEX} \ - --output ~/.zen/tmp/$WISHKEY \ + --output ~/.zen/tmp \ --render '.' 'CopierYoutube.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[CopierYoutube]]' -echo "cat ~/.zen/tmp/$WISHKEY/CopierYoutube.json" +echo "cat ~/.zen/tmp/CopierYoutube.json | jq -r" + +### MAKE CACHE REFRESH FUNCTION +#~ ############################# +#~ ## Refresh _12345.sh IPNS Memories +#~ # ipfs name publish --key "MySwarm_$IPFSNODEID" --allow-offline /ipfs/$SWARMH +#~ MySwarm=$(ipfs key list -l | grep "MySwarm_$IPFSNODEID" | cut -d ' ' -f 1) +#~ if [[ $MySwarm ]]; then +#~ ############################# + #~ mkdir -p ~/.zen/tmp/$MySwarm && rm -Rf ~/.zen/tmp/$MySwarm/*.* + + #~ echo "## Getting Station MySwarm /ipns/$MySwarm" + #~ ipfs --timeout 12s get -o ~/.zen/tmp/$MySwarm /ipns/$MySwarm + + #~ echo "## Rebuild ~/.zen/tmp/$IPFSNODEID/yt-dlp.command & yt-dlp.cache" + #~ cat ~/.zen/tmp/$MySwarm/*/yt-dlp.command ~/.zen/tmp/$IPFSNODEID/yt-dlp.command | sort | uniq > ~/.zen/tmp/$IPFSNODEID/yt-dlp.command + #~ cat ~/.zen/tmp/$MySwarm/*/yt-dlp.cache ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache | sort | uniq > ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache + +#~ ############################# +#~ fi ################################################################### ## TEXT TREATMENT ## For this TAG, specific extract URL from text field and copy all video from links into tid.json -for YURL in $(cat ~/.zen/tmp/$WISHKEY/CopierYoutube.json | jq -r '.[].text' | grep 'http'); do +for YURL in $(cat ~/.zen/tmp/CopierYoutube.json | jq -r '.[].text' | grep 'http'); do echo "Detected $YURL" echo "Extracting video playlist" - ### GETTING ALL VIDEO IDs (for playlist copy) - yt-dlp --print "%(id)s" "${YURL}" >> ~/.zen/tmp/$WISHKEY/ytids.$MOATS + ### yt-dlp.command + [[ ! $(cat ~/.zen/tmp/$IPFSNODEID/yt-dlp.command 2>/dev/null | grep "$YURL") ]] \ + && echo "$WISHKEY&$YURL" >> ~/.zen/tmp/$IPFSNODEID/yt-dlp.command + + yt-dlp --print "%(id)s&%(webpage_url)s" "${YURL}" >> ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$WISHKEY done # FINISH YURL loop -echo "cat ~/.zen/tmp/$WISHKEY/ytids.$MOATS" +## SORT UNIQ CACHE +cat ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$WISHKEY | sort | uniq > ~/.zen/tmp/yt-dlp.cache +cp ~/.zen/tmp/yt-dlp.cache ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$WISHKEY ################################################################### -[[ ! -s ~/.zen/tmp/$WISHKEY/ytids.$MOATS ]] && echo "AUCUN YOUTUBEID pour CopierYoutube" && exit 0 +[[ ! -s ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$WISHKEY ]] && echo "AUCUN YOUTUBEID pour CopierYoutube" && exit 0 ################################################################### ################################################################### # PROCESS YOUTUBEID VIDEO DOWNLOAD AND CREATE TIDDLER in TW ################################################################### -while read YID; +while read LINE; do - [[ -f ~/.zen/tmp/$WISHKEY/$YID.TW.json ]] && echo "Tiddler json already existing : ~/.zen/tmp/$WISHKEY/$YID.TW.json" && continue + YID=$(echo "$LINE" | cut -d '&' -f 2) + [[ -s ~/.zen/tmp/$IPFSNODEID/$YID.TW.json ]] && echo "Tiddler json already existing : ~/.zen/tmp/$IPFSNODEID/$YID.TW.json" && continue ## TODO :: CHECK IF ALREADY YOURS OR NOT :: THEN ADD2TW / SEND MESSAGE ? # SINGLE VIDEO YURL - ZYURL="https://www.youtube.com/watch?v=$YID"; - echo "YOUTUBE : $ZYURL" + ZYURL=$(echo "$LINE" | cut -d '&' -f 3-) + echo "COPIE : $ZYURL" TITLE="$(yt-dlp --print "%(title)s" "${ZYURL}")" TITLE=${TITLE//[^A-zÀ-ÿ0-9 ]/} - [[ ! $TITLE ]] && continue + [[ ! $TITLE ]] && echo "NO TITLE" && continue echo ".... Downloading $TITLE.mp4" @@ -80,14 +107,18 @@ while read YID; # SUBS ? --write-subs --write-auto-subs --sub-langs "fr, en, en-orig" --embed-subs # (bv*[height<=720][vcodec~='^((he|a)vc|h26[45])']+ba) # TODO : DELAY COPY OPERATION... Astro can download quicker at 03:00 AM - echo "yt-dlp -f \"(bv*[ext=mp4][height<=720]+ba/b[height<=720])\" --no-mtime --embed-thumbnail --add-metadata -o \"$HOME/.zen/tmp/$WISHKEY/$TITLE.%(ext)s\" ${ZYURL}" + echo "yt-dlp -f \"(bv*[ext=mp4][height<=720]+ba/b[height<=720])\" --no-mtime --embed-thumbnail --add-metadata -o \"$HOME/.zen/tmp/yt-dlp/$TITLE.%(ext)s\" ${ZYURL}" ############################################################################# ## COPY FROM YOUTUBE (TODO DOUBLE COPY & MKV to MP4 OPTIMISATION) + ## EXTRA PARAM TO TRY + # --cookies-from-browser browser (xdg-settings get default-web-browser) allow member copies + # --dateafter DATE --download-archive myarchive.txt yt-dlp -f "(bv*[ext=mp4][height<=720]+ba/b[height<=720])" \ + --download-archive $HOME/.zen/.yt-dlp.list \ -S "filesize:700M" --no-mtime --embed-thumbnail --add-metadata \ --write-subs --write-auto-subs --sub-langs "fr, en, en-orig" --embed-subs \ - -o "$HOME/.zen/tmp/$WISHKEY/$TITLE.%(ext)s" ${ZYURL} + -o "$HOME/.zen/tmp/yt-dlp/$TITLE.%(ext)s" ${ZYURL} ################################################################################ ### ADAPT TO TW RYTHM (DELAY COPY?) echo @@ -96,21 +127,21 @@ while read YID; ############################################################################ ### CHECK RESULT CONVERT MKV TO MP4 - [[ ! -f "$HOME/.zen/tmp/$WISHKEY/$ZFILE" ]] && ffmpeg -loglevel quiet -i "$HOME/.zen/tmp/$WISHKEY/$TITLE.mkv" -c:v libx264 -c:a aac "$HOME/.zen/tmp/$WISHKEY/$TITLE.mp4" # TRY TO CONVERT MKV TO MP4 - [[ ! -f "$HOME/.zen/tmp/$WISHKEY/$ZFILE" ]] && echo "No FILE -- CONTINUE --" && continue + [[ ! -f "$HOME/.zen/tmp/yt-dlp/$ZFILE" ]] && ffmpeg -loglevel quiet -i "$HOME/.zen/tmp/yt-dlp/$TITLE.mkv" -c:v libx264 -c:a aac "$HOME/.zen/tmp/yt-dlp/$TITLE.mp4" # TRY TO CONVERT MKV TO MP4 + [[ ! -f "$HOME/.zen/tmp/yt-dlp/$ZFILE" ]] && echo "No FILE -- CONTINUE --" && continue echo #################################################### - echo "FOUND : ~/.zen/tmp/$WISHKEY/$ZFILE" - FILE_BSIZE=$(du -b "$HOME/.zen/tmp/$WISHKEY/$ZFILE" | awk '{print $1}') + echo "FOUND : ~/.zen/tmp/yt-dlp/$ZFILE" + FILE_BSIZE=$(du -b "$HOME/.zen/tmp/yt-dlp/$ZFILE" | awk '{print $1}') FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; while( $1>1024 ){ $1/=1024; s++ } printf "%.2f %s", $1, v[s] }') echo "FILE SIZE = $FILE_SIZE ($FILE_BSIZE octets)" echo "Adding to IPFS" - ILINK=$(ipfs add -q "$HOME/.zen/tmp/$WISHKEY/$ZFILE" | tail -n 1) + ILINK=$(ipfs add -q "$HOME/.zen/tmp/yt-dlp/$ZFILE" | tail -n 1) echo "/ipfs/$ILINK <=> $ZFILE" - MIME=$(file --mime-type -b "$HOME/.zen/tmp/$WISHKEY/$ZFILE") + MIME=$(file --mime-type -b "$HOME/.zen/tmp/yt-dlp/$ZFILE") ## ADD TAGS SEC=$(yt-dlp --print "%(duration)s" "${ZYURL}") @@ -138,7 +169,7 @@ while read YID; "tags": "'ipfs G1CopierYoutube ${WISHKEY} ${EXTRATAG} ${MIME}'" } ] -' > "$HOME/.zen/tmp/$WISHKEY/$YID.TW.json" +' > "$HOME/.zen/tmp/$IPFSNODEID/$YID.TW.json" ################################################################# @@ -147,22 +178,23 @@ while read YID; echo "==========================" echo "Adding $YID tiddler to TW /ipns/$TWNS " - rm -f ~/.zen/tmp/$WISHKEY/newindex.html + rm -f ~/.zen/tmp/$IPFSNODEID/newindex.html - echo ">>> Importing $HOME/.zen/tmp/$WISHKEY/$YID.TW.json" + echo ">>> Importing $HOME/.zen/tmp/$IPFSNODEID/$YID.TW.json" tiddlywiki --load $INDEX \ - --import "$HOME/.zen/tmp/$WISHKEY/$YID.TW.json" "application/json" \ - --deletetiddlers '[tag[CopierYoutube]]' \ - --output ~/.zen/tmp/$WISHKEY --render "$:/core/save/all" "newindex.html" "text/plain" + --import "$HOME/.zen/tmp/$IPFSNODEID/$YID.TW.json" "application/json" \ + --output ~/.zen/tmp/$IPFSNODEID --render "$:/core/save/all" "newindex.html" "text/plain" - if [[ -s ~/.zen/tmp/$WISHKEY/newindex.html ]]; then +# --deletetiddlers '[tag[CopierYoutube]]' ### REFRESH CHANNEL COPY + + if [[ -s ~/.zen/tmp/$IPFSNODEID/newindex.html ]]; then echo "$$$ Mise à jour $INDEX" - cp ~/.zen/tmp/$WISHKEY/newindex.html $INDEX + cp ~/.zen/tmp/$IPFSNODEID/newindex.html $INDEX else - echo "Problem with tiddlywiki command. Missing ~/.zen/tmp/$WISHKEY/newindex.html" + echo "Problem with tiddlywiki command. Missing ~/.zen/tmp/$IPFSNODEID/newindex.html" echo "XXXXXXXXXXXXXXXXXXXXXXX" fi -done < ~/.zen/tmp/$WISHKEY/ytids.$MOATS # FINISH YID loop 1 +done < ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache # FINISH YID loop 1 exit 0 From 3699d5bfffd4162dfcddccd6e2a40ecd9d3f882b Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 27 Nov 2022 18:07:02 +0100 Subject: [PATCH 4/6] bugs killing & enhancement --- _12345.sh | 4 ++-- tools/Connect_PLAYER_To_Gchange.sh | 2 +- tools/new_file_in_astroport.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_12345.sh b/_12345.sh index 77aa5d6a..e3fbba2e 100755 --- a/_12345.sh +++ b/_12345.sh @@ -77,7 +77,7 @@ while true; do ls ~/.zen/tmp/swarm BSIZE=$(du -b ~/.zen/tmp/swarm | tail -n 1 | cut -f 1) - ## SIZE MODIFIED + ## SIZE MODIFIED => PUBLISH MySwarm_$IPFSNODEID [[ $BSIZE != $(cat ~/.zen/tmp/swarm/.bsize) ]] \ && echo $BSIZE > ~/.zen/tmp/swarm/.bsize \ && SWARMH=$(ipfs add -rwq ~/.zen/tmp/swarm/* | tail -n 1 ) \ @@ -85,7 +85,7 @@ while true; do ############# PUBLISH IPFSNODEID BALISE - # Clean Empty + # Clean Empty Directory (inode dependancy BUG ??) du -b ~/.zen/tmp/${IPFSNODEID} > /tmp/du while read branch; do [[ $branch =~ "4096" ]] && rmdir $(echo $branch | cut -f 2 -d ' '); done < /tmp/du diff --git a/tools/Connect_PLAYER_To_Gchange.sh b/tools/Connect_PLAYER_To_Gchange.sh index c8686b56..ebcf437f 100755 --- a/tools/Connect_PLAYER_To_Gchange.sh +++ b/tools/Connect_PLAYER_To_Gchange.sh @@ -84,7 +84,7 @@ echo "Getting received stars" -k ~/.zen/game/players/${PLAYER}/secret.dunikey \ -n "https://data.gchange.fr" stars > ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/received_stars.json -cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/received_stars.json | jq -r '.likes[].issuer' | uniq > ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/liking_me +cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/received_stars.json | jq -r '.likes[].issuer' | sort | uniq > ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/liking_me echo "cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/received_stars.json | jq -r" for liking_me in $(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/liking_me | sort | uniq); diff --git a/tools/new_file_in_astroport.sh b/tools/new_file_in_astroport.sh index ee26cec6..689c768a 100755 --- a/tools/new_file_in_astroport.sh +++ b/tools/new_file_in_astroport.sh @@ -98,7 +98,7 @@ PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null); # NOT CURRENT PLAYER (CHECK FOR TW & KEY [[ $G1PUB != $(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) ]] \ -&& [[ $(ipfs key list -l | grep -v $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 \ From a53223f887d4fe4154da51cce23d8a58251e1a17 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 27 Nov 2022 18:08:44 +0100 Subject: [PATCH 5/6] IPFS FileUpload & G1lib crypto try --- tools/ipfs_P2P_forward.sh | 43 ++++++ www/crypto.js | 92 ++++++++++++ www/crypto.mjs | 1 + www/dunikey.html | 70 +++++++++ www/dunikey.js | 54 +++++++ www/favicon.ico | Bin 0 -> 5430 bytes www/index.html | 276 +---------------------------------- www/upload_to_astroport.html | 275 ++++++++++++++++++++++++++++++++++ 8 files changed, 536 insertions(+), 275 deletions(-) create mode 100755 tools/ipfs_P2P_forward.sh create mode 100644 www/crypto.js create mode 100644 www/crypto.mjs create mode 100644 www/dunikey.html create mode 100644 www/dunikey.js create mode 100755 www/favicon.ico mode change 100644 => 120000 www/index.html create mode 100644 www/upload_to_astroport.html diff --git a/tools/ipfs_P2P_forward.sh b/tools/ipfs_P2P_forward.sh new file mode 100755 index 00000000..72d87abe --- /dev/null +++ b/tools/ipfs_P2P_forward.sh @@ -0,0 +1,43 @@ +#!/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 +######################################################################## +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=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) || er+=" ipfs id problem" +[[ "$YOU" == "" || "$IPFSNODEID" == "" ]] && echo "ERROR : $er " && exit 1 +######################################################################## + +# Make Station publish SSH port on "/x/ssh-$(hostname)" +zuid="$(hostname)" +if [[ $zuid ]] +then + if [[ ! $(cat ~/.ssh/authorized_keys | grep "fred@ONELOVE") ]] + then + echo "# ADD fred@ONELOVE to ~/.ssh/authorized_keys" + echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFLHW8P88C/B7622yXzdAn1ZcTBfE1A4wMqajBwAoHwUVTOUaYfvkiSxbzb5H9dPTAXhQU6ZfuLa70kTo1m2b9TKH0tD6hR3RiKJ0NIjCHYEypcPGpLmHaZWnBKPq3IUU24qFVdUJxnTkDdFUszYMNoV4nqlXY/ZYdNpic8L1jPPyfOLLfPFkuSxagyQj4FGJq77UQE5j+skMJS3ISkazNTLqOCGLFJ5qtBC11BvQaCJ4cQ2Ss7ejPYhpx16NLJfg9VtG4dv9ZebEIl2pf7niiQGSPrDMFWHuQcGAuHt/patr0BcvfvD3Gv+qNsVfAJCNZ2U5NHEMKIhgj1ilNPEw7 fred@ONELOVE" >> ~/.ssh/authorized_keys + fi + echo "Lanching /x/ssh-$zuid" + [[ ! $(ipfs p2p ls | grep "/x/ssh-$zuid") ]] && ipfs p2p listen /x/ssh-$zuid /ip4/127.0.0.1/tcp/22 + # echo "echo \"ssh-$zuid local port please?\"; read lport; ipfs p2p forward /x/ssh-$zuid /ip4/127.0.0.1/tcp/$lport /p2p/$IPFSNODEID" >> ~/.zen/tmp/$IPFSNODEID/astroport/port +fi + +ipfs p2p ls + +## CONNECT WITH COMMAND +## ipfs cat /ipns/$IPFSNODEID/.$IPFSNODEID/x_ssh-$zuid.sh | bash +rm ~/.zen/tmp/$IPFSNODEID/x_ssh-$zuid.sh >/dev/null 2>&1 +if [[ ! -f ~/.zen/tmp/$IPFSNODEID/x_ssh-$zuid.sh ]]; then + PORT=12345 + [ ${PORT} -eq 12345 ] && PORT=$((PORT+${RANDOM:0:3})) || PORT=$((PORT-${RANDOM:0:3})) + echo "[[ ! \$(ipfs p2p ls | grep x/ssh-$zuid) ]] && ipfs --timeout=5s ping -n 1 /p2p/$IPFSNODEID && ipfs p2p forward /x/ssh-$zuid /ip4/127.0.0.1/tcp/$PORT /p2p/$IPFSNODEID && ssh $USER@127.0.0.1 -p $PORT" > ~/.zen/tmp/$IPFSNODEID/x_ssh-$zuid.sh +fi +cat ~/.zen/tmp/$IPFSNODEID/x_ssh-$zuid.sh + +## THIS PORT FORWARDING HUB COULD BE MADE MORE CONTROLABLE USING FRIENDSHIP LEVEL & IPFS BALISES + diff --git a/www/crypto.js b/www/crypto.js new file mode 100644 index 00000000..166cd8a7 --- /dev/null +++ b/www/crypto.js @@ -0,0 +1,92 @@ +export {b58,b16, saltPass2seed, seed2keyPair,idSecPass2rawAll, raw2b58, idSecPass2cleanKeys} +import {nacl} from "./vendors/nacl.js"; + +async function idSecPass2rawAll(idSec,pass) { + const rawSeed = await saltPass2seed(idSec,pass); + const keyPair = seed2keyPair(rawSeed); + return { + seed:rawSeed, + publicKey:keyPair.publicKey, + secretKey:keyPair.secretKey + } +} +function raw2b58(raws){ + const res = {}; + for(let r in raws) res[r] = b58.encode(raws[r]); + return res; +} +async function idSecPass2cleanKeys(idSec,pass){ + const raw = await idSecPass2rawAll(idSec,pass); + return Object.assign(raw2b58(raw),{idSec,password:pass}); +} +function seed2keyPair(seed){ + return nacl.sign.keyPair.fromSeed(seed); +} +import scrypt from "./vendors/scrypt.js"; +async function saltPass2seed(idSec,pass) { + const options = { + logN: 12, + r: 16, + p: 1, + //dkLen: 32, + encoding: 'binary' + }; + return await scrypt(pass.normalize('NFKC'), idSec.normalize('NFKC'), options); +} +//inspired by bs58 and base-x module +const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; +const b58 = basex(ALPHABET); +const b16 = basex('0123456789abcdef'); +function basex (ALPHABET) { + const ALPHABET_MAP = {}; + const BASE = ALPHABET.length; + const LEADER = ALPHABET.charAt(0); + // pre-compute lookup table + for (let z = 0; z < ALPHABET.length; z++) { + let x = ALPHABET.charAt(z); + if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous'); + ALPHABET_MAP[x] = z; + } + function encode (source) { + if (source.length === 0) return ''; + const digits = [0]; + for (let i = 0; i < source.length; ++i) { + let carry = source[i]; + for (let j = 0; j < digits.length; ++j) { + carry += digits[j] << 8; + digits[j] = carry % BASE; + carry = (carry / BASE) | 0; + } + while (carry > 0) { digits.push(carry % BASE); carry = (carry / BASE) | 0; } + } + let string = ''; + for (let k = 0; source[k] === 0 && k < source.length - 1; ++k) string += LEADER; // deal with leading zeros + for (let q = digits.length - 1; q >= 0; --q) string += ALPHABET[digits[q]]; // convert digits to a string + return string; + } + + function decodeUnsafe (string) { + if (typeof string !== 'string') throw new TypeError('Expected String'); + if (string.length === 0) return new Uint8Array(0); + const bytes = [0]; + for (let i = 0; i < string.length; i++) { + const value = ALPHABET_MAP[string[i]]; + if (value === undefined) return ; + let carry = value; + for (let j = 0; j < bytes.length; ++j) { + carry += bytes[j] * BASE; + bytes[j] = carry & 0xff; + carry >>= 8; + } + while (carry > 0) { bytes.push(carry & 0xff); carry >>= 8; } + } + for (let k = 0; string[k] === LEADER && k < string.length - 1; ++k) bytes.push(0); // deal with leading zeros + return new Uint8Array(bytes.reverse()); + } + function decode (string) { + const buffer = decodeUnsafe(string); + if (buffer) return buffer; + throw new Error('Non-base' + BASE + ' character') + } + return { encode, decodeUnsafe, decode } +} diff --git a/www/crypto.mjs b/www/crypto.mjs new file mode 100644 index 00000000..ce339aec --- /dev/null +++ b/www/crypto.mjs @@ -0,0 +1 @@ +import t from"tweetnacl";function a(t,r,n){var e=void 0===n?{}:n,o=e.N,i=void 0===o?16384:o,s=e.logN,f=e.r,a=void 0===f?8:f,c=e.p,u=void 0===c?1:c,l=e.dkLen,y=void 0===l?32:l,d=e.interruptStep,p=void 0===d?0:d,w=e.encoding;return new Promise((function(n,e){if(!s&&!i)return e(new Error("scrypt: missing N or logN parameter"));if(s||0===s){if(s<1||s>31)return e(new Error("scrypt: logN must be between 1 and 31"));i=1<>>0}else{if(i<2||i>h)return e(new Error("scrypt: N is out of range"));if(0!=(i&i-1))return e(Error("scrypt: N is not a power of 2"))}return u<1?e(new Error("scrypt: invalid p")):a<1?e(new Error("scrypt: invalid r")):void function(t,r){var n,e,o,i,s=t.password,f=t.salt,a=t.N,c=t.r,u=t.p,l=t.dkLen,y=t.interruptStep,d=t.encoding;function p(t){var r=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],n=1779033703,e=3144134277,o=1013904242,i=2773480762,s=1359893119,f=2600822924,h=528734635,a=1541459225,c=new Array(64);function u(t){for(var u=0,l=t.length;l>=64;){var y=n,d=e,p=o,w=i,g=s,v=f,b=h,A=a,E=void 0,m=void 0,x=void 0,_=void 0,B=void 0;for(m=0;m<16;m++)x=u+4*m,c[m]=(255&t[x])<<24|(255&t[x+1])<<16|(255&t[x+2])<<8|255&t[x+3];for(m=16;m<64;m++)_=((E=c[m-2])>>>17|E<<15)^(E>>>19|E<<13)^E>>>10,B=((E=c[m-15])>>>7|E<<25)^(E>>>18|E<<14)^E>>>3,c[m]=(_+c[m-7]|0)+(B+c[m-16]|0)|0;for(m=0;m<64;m++)_=(((g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&v^~g&b)|0)+(A+(r[m]+c[m]|0)|0)|0,B=((y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10))+(y&d^y&p^d&p)|0,A=b,b=v,v=g,g=w+_|0,w=p,p=d,d=y,y=_+B|0;n=n+y|0,e=e+d|0,o=o+p|0,i=i+w|0,s=s+g|0,f=f+v|0,h=h+b|0,a=a+A|0,u+=64,l-=64}}u(t);var l,y=t.length%64,d=t.length/536870912|0,p=t.length<<3,w=y<56?56:120,g=t.slice(t.length-y,t.length);for(g.push(128),l=y+1;l>>24&255),g.push(d>>>16&255),g.push(d>>>8&255),g.push(d>>>0&255),g.push(p>>>24&255),g.push(p>>>16&255),g.push(p>>>8&255),g.push(p>>>0&255),u(g),[n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,e>>>24&255,e>>>16&255,e>>>8&255,e>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255,h>>>24&255,h>>>16&255,h>>>8&255,h>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255]}function w(t,r,n){t.length>64&&(t=p(t.push?t:function(){for(var t=0,r=0,n=arguments.length;r=o-4;t--){if(i[t]++,i[t]<=255)return;i[t]=0}}for(;n>=32;)h(),f=f.concat(p(s.concat(p(i)))),n-=32;return n>0&&(h(),f=f.concat(p(s.concat(p(i))).slice(0,n))),f}function g(t,r,n,e){var o,i,s=t[0]^r[n++],f=t[1]^r[n++],h=t[2]^r[n++],a=t[3]^r[n++],c=t[4]^r[n++],u=t[5]^r[n++],l=t[6]^r[n++],y=t[7]^r[n++],d=t[8]^r[n++],p=t[9]^r[n++],w=t[10]^r[n++],g=t[11]^r[n++],v=t[12]^r[n++],b=t[13]^r[n++],A=t[14]^r[n++],E=t[15]^r[n++],m=s,x=f,_=h,B=a,U=c,S=u,P=l,k=y,M=d,I=p,T=w,R=g,z=v,N=b,L=A,K=E;for(i=0;i<8;i+=2)m^=(o=(z^=(o=(M^=(o=(U^=(o=m+z)<<7|o>>>25)+m)<<9|o>>>23)+U)<<13|o>>>19)+M)<<18|o>>>14,S^=(o=(x^=(o=(N^=(o=(I^=(o=S+x)<<7|o>>>25)+S)<<9|o>>>23)+I)<<13|o>>>19)+N)<<18|o>>>14,T^=(o=(P^=(o=(_^=(o=(L^=(o=T+P)<<7|o>>>25)+T)<<9|o>>>23)+L)<<13|o>>>19)+_)<<18|o>>>14,K^=(o=(R^=(o=(k^=(o=(B^=(o=K+R)<<7|o>>>25)+K)<<9|o>>>23)+B)<<13|o>>>19)+k)<<18|o>>>14,m^=(o=(B^=(o=(_^=(o=(x^=(o=m+B)<<7|o>>>25)+m)<<9|o>>>23)+x)<<13|o>>>19)+_)<<18|o>>>14,S^=(o=(U^=(o=(k^=(o=(P^=(o=S+U)<<7|o>>>25)+S)<<9|o>>>23)+P)<<13|o>>>19)+k)<<18|o>>>14,T^=(o=(I^=(o=(M^=(o=(R^=(o=T+I)<<7|o>>>25)+T)<<9|o>>>23)+R)<<13|o>>>19)+M)<<18|o>>>14,K^=(o=(L^=(o=(N^=(o=(z^=(o=K+L)<<7|o>>>25)+K)<<9|o>>>23)+z)<<13|o>>>19)+N)<<18|o>>>14;r[e++]=t[0]=m+s|0,r[e++]=t[1]=x+f|0,r[e++]=t[2]=_+h|0,r[e++]=t[3]=B+a|0,r[e++]=t[4]=U+c|0,r[e++]=t[5]=S+u|0,r[e++]=t[6]=P+l|0,r[e++]=t[7]=k+y|0,r[e++]=t[8]=M+d|0,r[e++]=t[9]=I+p|0,r[e++]=t[10]=T+w|0,r[e++]=t[11]=R+g|0,r[e++]=t[12]=z+v|0,r[e++]=t[13]=N+b|0,r[e++]=t[14]=L+A|0,r[e++]=t[15]=K+E|0}function v(t,r,n,e,o){for(;o--;)t[r++]=n[e++]}function b(t,r,n,e,o){for(;o--;)t[r++]^=n[e++]}function A(t,r,n,e,o){v(t,0,r,n+16*(2*o-1),16);for(var i=0;i<2*o;i+=2)g(t,r,n+16*i,e+8*i),g(t,r,n+16*i+16,e+8*i+16*o)}function E(t,r,n){return t[r+16*(2*n-1)]}function m(t){for(var r=[],n=0;n>6),r.push(128|63&e);else if(e<55296)r.push(224|e>>12),r.push(128|e>>6&63),r.push(128|63&e);else{if(n>=t.length-1)throw new Error("invalid string");n++,e=(1023&e)<<10,e|=1023&t.charCodeAt(n),e+=65536,r.push(240|e>>18),r.push(128|e>>12&63),r.push(128|e>>6&63),r.push(128|63&e)}}return r}if(c*u>=1<<30||c>h/128/u||c>h/256||a>h/128/c)throw new Error("scrypt: parameters are too large");"string"==typeof s&&(s=m(s)),"string"==typeof f&&(f=m(f)),"undefined"!=typeof Int32Array?(n=new Int32Array(64*c),e=new Int32Array(32*a*c),i=new Int32Array(16)):(n=[],e=[],i=new Array(16)),o=w(s,f,128*u*c);var x=32*c;function _(t){for(var r=0;r<32*c;r++){var e=t+4*r;n[0+r]=(255&o[e+3])<<24|(255&o[e+2])<<16|(255&o[e+1])<<8|(255&o[e+0])<<0}}function B(t,r){for(var o=t;o>>0&255,o[t+4*r+1]=e>>>8&255,o[t+4*r+2]=e>>>16&255,o[t+4*r+3]=e>>>24&255}}var P="undefined"!=typeof setImmediate?setImmediate:setTimeout;function k(t,r,n,e,o){!function i(){P((function(){e(t,t+n>>18&63]),o.push(n[r>>>12&63]),o.push(n[r>>>6&63]),o.push(n[r>>>0&63]);return e%3>0&&(o[o.length-1]="=",e%3==1&&(o[o.length-2]="=")),o.join("")}(r):"hex"===t?function(t){for(var r="0123456789abcdef".split(""),n=t.length,e=[],o=0;o>>4&15]),e.push(r[t[o]>>>0&15]);return e.join("")}(r):"binary"===t?new Uint8Array(r):r}y<=0?function(){for(var t=0;t>>0,c="input is invalid type";"object"==typeof process&&process.versions&&process.versions.node;var u="0123456789abcdef".split(""),l=[-2147483648,8388608,32768,128],y=[24,16,8,0],p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],d=["hex","array","digest","arrayBuffer"],w=[],g=function(t,r){return function(n){return new E(r,!0).update(n)[t]()}};function b(t){var r=g("hex",t);r.create=function(){return new E(t)},r.update=function(t){return r.create().update(t)};for(var n=0;n>6,s[h++]=128|63&i):i<55296||i>=57344?(s[h++]=224|i>>12,s[h++]=128|i>>6&63,s[h++]=128|63&i):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++e)),s[h++]=240|i>>18,s[h++]=128|i>>12&63,s[h++]=128|i>>6&63,s[h++]=128|63&i);t=s}else{if("object"!==o)throw new Error(c);if(null===t)throw new Error(c);t=new Uint8Array(t)}t.length>64&&(t=new E(r,!0).update(t).array());var a=[],u=[];for(e=0;e<64;++e){var l=t[e]||0;a[e]=92^l,u[e]=54^l}E.call(this,r,n),this.update(u),this.oKeyPad=a,this.inner=!0,this.sharedMemory=n}E.prototype.update=function(t){if(!this.finalized){var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(c);if(null===t)throw new Error(c);t=new Uint8Array(t),r=!0}for(var e,o,i=0,s=t.length,f=this.blocks;i>2]|=t[i]<>2]|=e<>2]|=(192|e>>6)<>2]|=(128|63&e)<=57344?(f[o>>2]|=(224|e>>12)<>2]|=(128|e>>6&63)<>2]|=(128|63&e)<>2]|=(240|e>>18)<>2]|=(128|e>>12&63)<>2]|=(128|e>>6&63)<>2]|=(128|63&e)<=64?(this.block=f[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},E.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,r=this.lastByteIndex;t[16]=this.block,t[r>>2]|=l[3&r],this.block=t[16],r>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},E.prototype.hash=function(){var t,r,n,e,o,i,s,f,h,a=this.h0,c=this.h1,u=this.h2,l=this.h3,y=this.h4,d=this.h5,w=this.h6,g=this.h7,v=this.blocks;for(t=16;t<64;++t)r=((o=v[t-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,n=((o=v[t-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,v[t]=v[t-16]+r+v[t-7]+n<<0;for(h=c&u,t=0;t<64;t+=4)this.first?(this.is224?(i=300032,g=(o=v[0]-1413257819)-150054599<<0,l=o+24177077<<0):(i=704751109,g=(o=v[0]-210244248)-1521486534<<0,l=o+143694565<<0),this.first=!1):(r=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),e=(i=a&c)^a&u^h,g=l+(o=g+(n=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&d^~y&w)+p[t]+v[t])<<0,l=o+(r+e)<<0),r=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),e=(s=l&a)^l&c^i,w=u+(o=w+(n=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&y^~g&d)+p[t+1]+v[t+1])<<0,r=((u=o+(r+e)<<0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),e=(f=u&l)^u&a^s,d=c+(o=d+(n=(w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7))+(w&g^~w&y)+p[t+2]+v[t+2])<<0,r=((c=o+(r+e)<<0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),e=(h=c&u)^c&l^f,y=a+(o=y+(n=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&w^~d&g)+p[t+3]+v[t+3])<<0,a=o+(r+e)<<0;this.h0=this.h0+a<<0,this.h1=this.h1+c<<0,this.h2=this.h2+u<<0,this.h3=this.h3+l<<0,this.h4=this.h4+y<<0,this.h5=this.h5+d<<0,this.h6=this.h6+w<<0,this.h7=this.h7+g<<0},E.prototype.hex=function(){this.finalize();var t=this.h0,r=this.h1,n=this.h2,e=this.h3,o=this.h4,i=this.h5,s=this.h6,f=this.h7,h=u[t>>28&15]+u[t>>24&15]+u[t>>20&15]+u[t>>16&15]+u[t>>12&15]+u[t>>8&15]+u[t>>4&15]+u[15&t]+u[r>>28&15]+u[r>>24&15]+u[r>>20&15]+u[r>>16&15]+u[r>>12&15]+u[r>>8&15]+u[r>>4&15]+u[15&r]+u[n>>28&15]+u[n>>24&15]+u[n>>20&15]+u[n>>16&15]+u[n>>12&15]+u[n>>8&15]+u[n>>4&15]+u[15&n]+u[e>>28&15]+u[e>>24&15]+u[e>>20&15]+u[e>>16&15]+u[e>>12&15]+u[e>>8&15]+u[e>>4&15]+u[15&e]+u[o>>28&15]+u[o>>24&15]+u[o>>20&15]+u[o>>16&15]+u[o>>12&15]+u[o>>8&15]+u[o>>4&15]+u[15&o]+u[i>>28&15]+u[i>>24&15]+u[i>>20&15]+u[i>>16&15]+u[i>>12&15]+u[i>>8&15]+u[i>>4&15]+u[15&i]+u[s>>28&15]+u[s>>24&15]+u[s>>20&15]+u[s>>16&15]+u[s>>12&15]+u[s>>8&15]+u[s>>4&15]+u[15&s];return this.is224||(h+=u[f>>28&15]+u[f>>24&15]+u[f>>20&15]+u[f>>16&15]+u[f>>12&15]+u[f>>8&15]+u[f>>4&15]+u[15&f]),h},E.prototype.toString=E.prototype.hex,E.prototype.digest=function(){this.finalize();var t=this.h0,r=this.h1,n=this.h2,e=this.h3,o=this.h4,i=this.h5,s=this.h6,f=this.h7,h=[t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,e>>24&255,e>>16&255,e>>8&255,255&e,o>>24&255,o>>16&255,o>>8&255,255&o,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s];return this.is224||h.push(f>>24&255,f>>16&255,f>>8&255,255&f),h},E.prototype.array=E.prototype.digest,E.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),r=new DataView(t);return r.setUint32(0,this.h0),r.setUint32(4,this.h1),r.setUint32(8,this.h2),r.setUint32(12,this.h3),r.setUint32(16,this.h4),r.setUint32(20,this.h5),r.setUint32(24,this.h6),this.is224||r.setUint32(28,this.h7),t},m.prototype=new E,m.prototype.finalize=function(){if(E.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();E.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),E.prototype.finalize.call(this)}};const _=b();_.sha256=_,_.sha224=b(!0),_.sha256.hmac=A(),_.sha224.hmac=A(!0);var x={},U=function(t){var r,n=new Float64Array(16);if(t)for(r=0;r>24&255,t[r+1]=n>>16&255,t[r+2]=n>>8&255,t[r+3]=255&n,t[r+4]=e>>24&255,t[r+5]=e>>16&255,t[r+6]=e>>8&255,t[r+7]=255&e}function L(t,r,n,e,o){var i,s=0;for(i=0;i>>8)-1}function K(t,r,n,e){return L(t,r,n,e,16)}function j(t,r,n,e){return L(t,r,n,e,32)}function D(t,r,n,e){!function(t,r,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,f=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,h=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,a=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,c=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,u=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,l=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,d=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,w=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,g=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,v=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,b=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,E=i,m=s,x=f,_=h,B=a,U=c,S=u,P=l,k=y,M=d,I=p,T=w,R=g,z=v,N=b,L=A,K=0;K<20;K+=2)E^=(o=(R^=(o=(k^=(o=(B^=(o=E+R|0)<<7|o>>>25)+E|0)<<9|o>>>23)+B|0)<<13|o>>>19)+k|0)<<18|o>>>14,U^=(o=(m^=(o=(z^=(o=(M^=(o=U+m|0)<<7|o>>>25)+U|0)<<9|o>>>23)+M|0)<<13|o>>>19)+z|0)<<18|o>>>14,I^=(o=(S^=(o=(x^=(o=(N^=(o=I+S|0)<<7|o>>>25)+I|0)<<9|o>>>23)+N|0)<<13|o>>>19)+x|0)<<18|o>>>14,L^=(o=(T^=(o=(P^=(o=(_^=(o=L+T|0)<<7|o>>>25)+L|0)<<9|o>>>23)+_|0)<<13|o>>>19)+P|0)<<18|o>>>14,E^=(o=(_^=(o=(x^=(o=(m^=(o=E+_|0)<<7|o>>>25)+E|0)<<9|o>>>23)+m|0)<<13|o>>>19)+x|0)<<18|o>>>14,U^=(o=(B^=(o=(P^=(o=(S^=(o=U+B|0)<<7|o>>>25)+U|0)<<9|o>>>23)+S|0)<<13|o>>>19)+P|0)<<18|o>>>14,I^=(o=(M^=(o=(k^=(o=(T^=(o=I+M|0)<<7|o>>>25)+I|0)<<9|o>>>23)+T|0)<<13|o>>>19)+k|0)<<18|o>>>14,L^=(o=(N^=(o=(z^=(o=(R^=(o=L+N|0)<<7|o>>>25)+L|0)<<9|o>>>23)+R|0)<<13|o>>>19)+z|0)<<18|o>>>14;E=E+i|0,m=m+s|0,x=x+f|0,_=_+h|0,B=B+a|0,U=U+c|0,S=S+u|0,P=P+l|0,k=k+y|0,M=M+d|0,I=I+p|0,T=T+w|0,R=R+g|0,z=z+v|0,N=N+b|0,L=L+A|0,t[0]=E>>>0&255,t[1]=E>>>8&255,t[2]=E>>>16&255,t[3]=E>>>24&255,t[4]=m>>>0&255,t[5]=m>>>8&255,t[6]=m>>>16&255,t[7]=m>>>24&255,t[8]=x>>>0&255,t[9]=x>>>8&255,t[10]=x>>>16&255,t[11]=x>>>24&255,t[12]=_>>>0&255,t[13]=_>>>8&255,t[14]=_>>>16&255,t[15]=_>>>24&255,t[16]=B>>>0&255,t[17]=B>>>8&255,t[18]=B>>>16&255,t[19]=B>>>24&255,t[20]=U>>>0&255,t[21]=U>>>8&255,t[22]=U>>>16&255,t[23]=U>>>24&255,t[24]=S>>>0&255,t[25]=S>>>8&255,t[26]=S>>>16&255,t[27]=S>>>24&255,t[28]=P>>>0&255,t[29]=P>>>8&255,t[30]=P>>>16&255,t[31]=P>>>24&255,t[32]=k>>>0&255,t[33]=k>>>8&255,t[34]=k>>>16&255,t[35]=k>>>24&255,t[36]=M>>>0&255,t[37]=M>>>8&255,t[38]=M>>>16&255,t[39]=M>>>24&255,t[40]=I>>>0&255,t[41]=I>>>8&255,t[42]=I>>>16&255,t[43]=I>>>24&255,t[44]=T>>>0&255,t[45]=T>>>8&255,t[46]=T>>>16&255,t[47]=T>>>24&255,t[48]=R>>>0&255,t[49]=R>>>8&255,t[50]=R>>>16&255,t[51]=R>>>24&255,t[52]=z>>>0&255,t[53]=z>>>8&255,t[54]=z>>>16&255,t[55]=z>>>24&255,t[56]=N>>>0&255,t[57]=N>>>8&255,t[58]=N>>>16&255,t[59]=N>>>24&255,t[60]=L>>>0&255,t[61]=L>>>8&255,t[62]=L>>>16&255,t[63]=L>>>24&255}(t,r,n,e)}function Z(t,r,n,e){!function(t,r,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,f=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,h=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,a=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,c=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,u=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,l=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,d=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,w=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,g=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,v=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,b=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,E=0;E<20;E+=2)i^=(o=(g^=(o=(y^=(o=(a^=(o=i+g|0)<<7|o>>>25)+i|0)<<9|o>>>23)+a|0)<<13|o>>>19)+y|0)<<18|o>>>14,c^=(o=(s^=(o=(v^=(o=(d^=(o=c+s|0)<<7|o>>>25)+c|0)<<9|o>>>23)+d|0)<<13|o>>>19)+v|0)<<18|o>>>14,p^=(o=(u^=(o=(f^=(o=(b^=(o=p+u|0)<<7|o>>>25)+p|0)<<9|o>>>23)+b|0)<<13|o>>>19)+f|0)<<18|o>>>14,A^=(o=(w^=(o=(l^=(o=(h^=(o=A+w|0)<<7|o>>>25)+A|0)<<9|o>>>23)+h|0)<<13|o>>>19)+l|0)<<18|o>>>14,i^=(o=(h^=(o=(f^=(o=(s^=(o=i+h|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+f|0)<<18|o>>>14,c^=(o=(a^=(o=(l^=(o=(u^=(o=c+a|0)<<7|o>>>25)+c|0)<<9|o>>>23)+u|0)<<13|o>>>19)+l|0)<<18|o>>>14,p^=(o=(d^=(o=(y^=(o=(w^=(o=p+d|0)<<7|o>>>25)+p|0)<<9|o>>>23)+w|0)<<13|o>>>19)+y|0)<<18|o>>>14,A^=(o=(b^=(o=(v^=(o=(g^=(o=A+b|0)<<7|o>>>25)+A|0)<<9|o>>>23)+g|0)<<13|o>>>19)+v|0)<<18|o>>>14;t[0]=i>>>0&255,t[1]=i>>>8&255,t[2]=i>>>16&255,t[3]=i>>>24&255,t[4]=c>>>0&255,t[5]=c>>>8&255,t[6]=c>>>16&255,t[7]=c>>>24&255,t[8]=p>>>0&255,t[9]=p>>>8&255,t[10]=p>>>16&255,t[11]=p>>>24&255,t[12]=A>>>0&255,t[13]=A>>>8&255,t[14]=A>>>16&255,t[15]=A>>>24&255,t[16]=u>>>0&255,t[17]=u>>>8&255,t[18]=u>>>16&255,t[19]=u>>>24&255,t[20]=l>>>0&255,t[21]=l>>>8&255,t[22]=l>>>16&255,t[23]=l>>>24&255,t[24]=y>>>0&255,t[25]=y>>>8&255,t[26]=y>>>16&255,t[27]=y>>>24&255,t[28]=d>>>0&255,t[29]=d>>>8&255,t[30]=d>>>16&255,t[31]=d>>>24&255}(t,r,n,e)}var Y=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function H(t,r,n,e,o,i,s){var f,h,a=new Uint8Array(16),c=new Uint8Array(64);for(h=0;h<16;h++)a[h]=0;for(h=0;h<8;h++)a[h]=i[h];for(;o>=64;){for(D(c,a,s,Y),h=0;h<64;h++)t[r+h]=n[e+h]^c[h];for(f=1,h=8;h<16;h++)f=f+(255&a[h])|0,a[h]=255&f,f>>>=8;o-=64,r+=64,e+=64}if(o>0)for(D(c,a,s,Y),h=0;h=64;){for(D(h,f,o,Y),s=0;s<64;s++)t[r+s]=h[s];for(i=1,s=8;s<16;s++)i=i+(255&f[s])|0,f[s]=255&i,i>>>=8;n-=64,r+=64}if(n>0)for(D(h,f,o,Y),s=0;s>>13|n<<3),e=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(i>>>14|s<<2),f=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|f<<5),h=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(f>>>8|h<<8),this.r[9]=h>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function q(t,r,n,e,o,i){var s=new F(i);return s.update(n,e,o),s.finish(t,r),0}function W(t,r,n,e,o,i){var s=new Uint8Array(16);return q(s,0,n,e,o,i),K(t,r,s,0)}function J(t,r,n,e,o){var i;if(n<32)return-1;for(V(t,0,r,0,n,e,o),q(t,16,t,32,n-32,t),i=0;i<16;i++)t[i]=0;return 0}function X(t,r,n,e,o){var i,s=new Uint8Array(32);if(n<32)return-1;if(G(s,0,32,e,o),0!==W(r,16,r,32,n-32,s))return-1;for(V(t,0,r,0,n,e,o),i=0;i<32;i++)t[i]=0;return 0}function Q(t,r){var n;for(n=0;n<16;n++)t[n]=0|r[n]}function tt(t){var r,n,e=1;for(r=0;r<16;r++)n=t[r]+e+65535,e=Math.floor(n/65536),t[r]=n-65536*e;t[0]+=e-1+37*(e-1)}function rt(t,r,n){for(var e,o=~(n-1),i=0;i<16;i++)e=o&(t[i]^r[i]),t[i]^=e,r[i]^=e}function et(t,r){var n,e,o,i=U(),s=U();for(n=0;n<16;n++)s[n]=r[n];for(tt(s),tt(s),tt(s),e=0;e<2;e++){for(i[0]=s[0]-65517,n=1;n<15;n++)i[n]=s[n]-65535-(i[n-1]>>16&1),i[n-1]&=65535;i[15]=s[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,rt(s,i,1-o)}for(n=0;n<16;n++)t[2*n]=255&s[n],t[2*n+1]=s[n]>>8}function nt(t,r){var n=new Uint8Array(32),e=new Uint8Array(32);return et(n,t),et(e,r),j(n,0,e,0)}function ot(t){var r=new Uint8Array(32);return et(r,t),1&r[0]}function it(t,r){var n;for(n=0;n<16;n++)t[n]=r[2*n]+(r[2*n+1]<<8);t[15]&=32767}function st(t,r,n){for(var e=0;e<16;e++)t[e]=r[e]+n[e]}function ft(t,r,n){for(var e=0;e<16;e++)t[e]=r[e]-n[e]}function at(t,r,n){var e,o,i=0,s=0,f=0,h=0,a=0,c=0,u=0,l=0,y=0,d=0,p=0,w=0,g=0,v=0,b=0,A=0,E=0,m=0,x=0,_=0,B=0,U=0,S=0,P=0,k=0,M=0,I=0,T=0,R=0,z=0,N=0,L=n[0],K=n[1],O=n[2],Z=n[3],C=n[4],Y=n[5],H=n[6],F=n[7],D=n[8],G=n[9],V=n[10],q=n[11],j=n[12],W=n[13],$=n[14],J=n[15];i+=(e=r[0])*L,s+=e*K,f+=e*O,h+=e*Z,a+=e*C,c+=e*Y,u+=e*H,l+=e*F,y+=e*D,d+=e*G,p+=e*V,w+=e*q,g+=e*j,v+=e*W,b+=e*$,A+=e*J,s+=(e=r[1])*L,f+=e*K,h+=e*O,a+=e*Z,c+=e*C,u+=e*Y,l+=e*H,y+=e*F,d+=e*D,p+=e*G,w+=e*V,g+=e*q,v+=e*j,b+=e*W,A+=e*$,E+=e*J,f+=(e=r[2])*L,h+=e*K,a+=e*O,c+=e*Z,u+=e*C,l+=e*Y,y+=e*H,d+=e*F,p+=e*D,w+=e*G,g+=e*V,v+=e*q,b+=e*j,A+=e*W,E+=e*$,m+=e*J,h+=(e=r[3])*L,a+=e*K,c+=e*O,u+=e*Z,l+=e*C,y+=e*Y,d+=e*H,p+=e*F,w+=e*D,g+=e*G,v+=e*V,b+=e*q,A+=e*j,E+=e*W,m+=e*$,x+=e*J,a+=(e=r[4])*L,c+=e*K,u+=e*O,l+=e*Z,y+=e*C,d+=e*Y,p+=e*H,w+=e*F,g+=e*D,v+=e*G,b+=e*V,A+=e*q,E+=e*j,m+=e*W,x+=e*$,_+=e*J,c+=(e=r[5])*L,u+=e*K,l+=e*O,y+=e*Z,d+=e*C,p+=e*Y,w+=e*H,g+=e*F,v+=e*D,b+=e*G,A+=e*V,E+=e*q,m+=e*j,x+=e*W,_+=e*$,B+=e*J,u+=(e=r[6])*L,l+=e*K,y+=e*O,d+=e*Z,p+=e*C,w+=e*Y,g+=e*H,v+=e*F,b+=e*D,A+=e*G,E+=e*V,m+=e*q,x+=e*j,_+=e*W,B+=e*$,U+=e*J,l+=(e=r[7])*L,y+=e*K,d+=e*O,p+=e*Z,w+=e*C,g+=e*Y,v+=e*H,b+=e*F,A+=e*D,E+=e*G,m+=e*V,x+=e*q,_+=e*j,B+=e*W,U+=e*$,S+=e*J,y+=(e=r[8])*L,d+=e*K,p+=e*O,w+=e*Z,g+=e*C,v+=e*Y,b+=e*H,A+=e*F,E+=e*D,m+=e*G,x+=e*V,_+=e*q,B+=e*j,U+=e*W,S+=e*$,P+=e*J,d+=(e=r[9])*L,p+=e*K,w+=e*O,g+=e*Z,v+=e*C,b+=e*Y,A+=e*H,E+=e*F,m+=e*D,x+=e*G,_+=e*V,B+=e*q,U+=e*j,S+=e*W,P+=e*$,k+=e*J,p+=(e=r[10])*L,w+=e*K,g+=e*O,v+=e*Z,b+=e*C,A+=e*Y,E+=e*H,m+=e*F,x+=e*D,_+=e*G,B+=e*V,U+=e*q,S+=e*j,P+=e*W,k+=e*$,M+=e*J,w+=(e=r[11])*L,g+=e*K,v+=e*O,b+=e*Z,A+=e*C,E+=e*Y,m+=e*H,x+=e*F,_+=e*D,B+=e*G,U+=e*V,S+=e*q,P+=e*j,k+=e*W,M+=e*$,I+=e*J,g+=(e=r[12])*L,v+=e*K,b+=e*O,A+=e*Z,E+=e*C,m+=e*Y,x+=e*H,_+=e*F,B+=e*D,U+=e*G,S+=e*V,P+=e*q,k+=e*j,M+=e*W,I+=e*$,T+=e*J,v+=(e=r[13])*L,b+=e*K,A+=e*O,E+=e*Z,m+=e*C,x+=e*Y,_+=e*H,B+=e*F,U+=e*D,S+=e*G,P+=e*V,k+=e*q,M+=e*j,I+=e*W,T+=e*$,R+=e*J,b+=(e=r[14])*L,A+=e*K,E+=e*O,m+=e*Z,x+=e*C,_+=e*Y,B+=e*H,U+=e*F,S+=e*D,P+=e*G,k+=e*V,M+=e*q,I+=e*j,T+=e*W,R+=e*$,z+=e*J,A+=(e=r[15])*L,s+=38*(m+=e*O),f+=38*(x+=e*Z),h+=38*(_+=e*C),a+=38*(B+=e*Y),c+=38*(U+=e*H),u+=38*(S+=e*F),l+=38*(P+=e*D),y+=38*(k+=e*G),d+=38*(M+=e*V),p+=38*(I+=e*q),w+=38*(T+=e*j),g+=38*(R+=e*W),v+=38*(z+=e*$),b+=38*(N+=e*J),i=(e=(i+=38*(E+=e*K))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),d=(e=d+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),i=(e=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),d=(e=d+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),i+=o-1+37*(o-1),t[0]=i,t[1]=s,t[2]=f,t[3]=h,t[4]=a,t[5]=c,t[6]=u,t[7]=l,t[8]=y,t[9]=d,t[10]=p,t[11]=w,t[12]=g,t[13]=v,t[14]=b,t[15]=A}function ht(t,r){at(t,r,r)}function ct(t,r){var n,e=U();for(n=0;n<16;n++)e[n]=r[n];for(n=253;n>=0;n--)ht(e,e),2!==n&&4!==n&&at(e,e,r);for(n=0;n<16;n++)t[n]=e[n]}function ut(t,r){var n,e=U();for(n=0;n<16;n++)e[n]=r[n];for(n=250;n>=0;n--)ht(e,e),1!==n&&at(e,e,r);for(n=0;n<16;n++)t[n]=e[n]}function lt(t,r,n){var e,o,i=new Uint8Array(32),s=new Float64Array(80),f=U(),h=U(),a=U(),c=U(),u=U(),l=U();for(o=0;o<31;o++)i[o]=r[o];for(i[31]=127&r[31]|64,i[0]&=248,it(s,n),o=0;o<16;o++)h[o]=s[o],c[o]=f[o]=a[o]=0;for(f[0]=c[0]=1,o=254;o>=0;--o)rt(f,h,e=i[o>>>3]>>>(7&o)&1),rt(a,c,e),st(u,f,a),ft(f,f,a),st(a,h,c),ft(h,h,c),ht(c,u),ht(l,f),at(f,a,f),at(a,h,u),st(u,f,a),ft(f,f,a),ht(h,f),ft(a,c,l),at(f,a,C),st(f,f,c),at(a,a,f),at(f,c,l),at(c,h,s),ht(h,u),rt(f,h,e),rt(a,c,e);for(o=0;o<16;o++)s[o+16]=f[o],s[o+32]=a[o],s[o+48]=h[o],s[o+64]=c[o];var y=s.subarray(32),d=s.subarray(16);return ct(y,y),at(d,d,y),et(t,d),0}function yt(t,r){return lt(t,r,O)}function pt(t,r){return B(r,32),yt(t,r)}function dt(t,r,n){var e=new Uint8Array(32);return lt(e,n,r),Z(t,S,e,Y)}F.prototype.blocks=function(t,r,n){for(var e,o,i,s,f,h,a,c,u,l,y,d,p,w,g,v,b,A,E,m=this.fin?0:2048,x=this.h[0],_=this.h[1],B=this.h[2],U=this.h[3],S=this.h[4],P=this.h[5],k=this.h[6],M=this.h[7],I=this.h[8],T=this.h[9],R=this.r[0],z=this.r[1],N=this.r[2],L=this.r[3],K=this.r[4],O=this.r[5],Z=this.r[6],C=this.r[7],Y=this.r[8],H=this.r[9];n>=16;)l=u=0,l+=(x+=8191&(e=255&t[r+0]|(255&t[r+1])<<8))*R,l+=(_+=8191&(e>>>13|(o=255&t[r+2]|(255&t[r+3])<<8)<<3))*(5*H),l+=(B+=8191&(o>>>10|(i=255&t[r+4]|(255&t[r+5])<<8)<<6))*(5*Y),l+=(U+=8191&(i>>>7|(s=255&t[r+6]|(255&t[r+7])<<8)<<9))*(5*C),u=(l+=(S+=8191&(s>>>4|(f=255&t[r+8]|(255&t[r+9])<<8)<<12))*(5*Z))>>>13,l&=8191,l+=(P+=f>>>1&8191)*(5*O),l+=(k+=8191&(f>>>14|(h=255&t[r+10]|(255&t[r+11])<<8)<<2))*(5*K),l+=(M+=8191&(h>>>11|(a=255&t[r+12]|(255&t[r+13])<<8)<<5))*(5*L),l+=(I+=8191&(a>>>8|(c=255&t[r+14]|(255&t[r+15])<<8)<<8))*(5*N),y=u+=(l+=(T+=c>>>5|m)*(5*z))>>>13,y+=x*z,y+=_*R,y+=B*(5*H),y+=U*(5*Y),u=(y+=S*(5*C))>>>13,y&=8191,y+=P*(5*Z),y+=k*(5*O),y+=M*(5*K),y+=I*(5*L),u+=(y+=T*(5*N))>>>13,y&=8191,d=u,d+=x*N,d+=_*z,d+=B*R,d+=U*(5*H),u=(d+=S*(5*Y))>>>13,d&=8191,d+=P*(5*C),d+=k*(5*Z),d+=M*(5*O),d+=I*(5*K),p=u+=(d+=T*(5*L))>>>13,p+=x*L,p+=_*N,p+=B*z,p+=U*R,u=(p+=S*(5*H))>>>13,p&=8191,p+=P*(5*Y),p+=k*(5*C),p+=M*(5*Z),p+=I*(5*O),w=u+=(p+=T*(5*K))>>>13,w+=x*K,w+=_*L,w+=B*N,w+=U*z,u=(w+=S*R)>>>13,w&=8191,w+=P*(5*H),w+=k*(5*Y),w+=M*(5*C),w+=I*(5*Z),g=u+=(w+=T*(5*O))>>>13,g+=x*O,g+=_*K,g+=B*L,g+=U*N,u=(g+=S*z)>>>13,g&=8191,g+=P*R,g+=k*(5*H),g+=M*(5*Y),g+=I*(5*C),v=u+=(g+=T*(5*Z))>>>13,v+=x*Z,v+=_*O,v+=B*K,v+=U*L,u=(v+=S*N)>>>13,v&=8191,v+=P*z,v+=k*R,v+=M*(5*H),v+=I*(5*Y),b=u+=(v+=T*(5*C))>>>13,b+=x*C,b+=_*Z,b+=B*O,b+=U*K,u=(b+=S*L)>>>13,b&=8191,b+=P*N,b+=k*z,b+=M*R,b+=I*(5*H),A=u+=(b+=T*(5*Y))>>>13,A+=x*Y,A+=_*C,A+=B*Z,A+=U*O,u=(A+=S*K)>>>13,A&=8191,A+=P*L,A+=k*N,A+=M*z,A+=I*R,E=u+=(A+=T*(5*H))>>>13,E+=x*H,E+=_*Y,E+=B*C,E+=U*Z,u=(E+=S*O)>>>13,E&=8191,E+=P*K,E+=k*L,E+=M*N,E+=I*z,x=l=8191&(u=(u=((u+=(E+=T*R)>>>13)<<2)+u|0)+(l&=8191)|0),_=y+=u>>>=13,B=d&=8191,U=p&=8191,S=w&=8191,P=g&=8191,k=v&=8191,M=b&=8191,I=A&=8191,T=E&=8191,r+=16,n-=16;this.h[0]=x,this.h[1]=_,this.h[2]=B,this.h[3]=U,this.h[4]=S,this.h[5]=P,this.h[6]=k,this.h[7]=M,this.h[8]=I,this.h[9]=T},F.prototype.finish=function(t,r){var n,e,o,i,s=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,s[0]=this.h[0]+5,n=s[0]>>>13,s[0]&=8191,i=1;i<10;i++)s[i]=this.h[i]+n,n=s[i]>>>13,s[i]&=8191;for(s[9]-=8192,e=(1^n)-1,i=0;i<10;i++)s[i]&=e;for(e=~e,i=0;i<10;i++)this.h[i]=this.h[i]&e|s[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;t[r+0]=this.h[0]>>>0&255,t[r+1]=this.h[0]>>>8&255,t[r+2]=this.h[1]>>>0&255,t[r+3]=this.h[1]>>>8&255,t[r+4]=this.h[2]>>>0&255,t[r+5]=this.h[2]>>>8&255,t[r+6]=this.h[3]>>>0&255,t[r+7]=this.h[3]>>>8&255,t[r+8]=this.h[4]>>>0&255,t[r+9]=this.h[4]>>>8&255,t[r+10]=this.h[5]>>>0&255,t[r+11]=this.h[5]>>>8&255,t[r+12]=this.h[6]>>>0&255,t[r+13]=this.h[6]>>>8&255,t[r+14]=this.h[7]>>>0&255,t[r+15]=this.h[7]>>>8&255},F.prototype.update=function(t,r,n){var e,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),e=0;e=16&&(o=n-n%16,this.blocks(t,r,o),r+=o,n-=o),n){for(e=0;e=128;){for(m=0;m<16;m++)x=8*m+j,M[m]=n[x+0]<<24|n[x+1]<<16|n[x+2]<<8|n[x+3],I[m]=n[x+4]<<24|n[x+5]<<16|n[x+6]<<8|n[x+7];for(m=0;m<80;m++)if(o=T,i=R,s=z,f=N,h=L,a=K,c=O,l=C,y=Y,d=H,p=F,w=D,g=G,v=V,U=65535&(B=q),S=B>>>16,P=65535&(_=Z),k=_>>>16,U+=65535&(B=(D>>>14|L<<18)^(D>>>18|L<<14)^(L>>>9|D<<23)),S+=B>>>16,P+=65535&(_=(L>>>14|D<<18)^(L>>>18|D<<14)^(D>>>9|L<<23)),k+=_>>>16,U+=65535&(B=D&G^~D&V),S+=B>>>16,P+=65535&(_=L&K^~L&O),k+=_>>>16,U+=65535&(B=bt[2*m+1]),S+=B>>>16,P+=65535&(_=bt[2*m]),k+=_>>>16,_=M[m%16],S+=(B=I[m%16])>>>16,P+=65535&_,k+=_>>>16,P+=(S+=(U+=65535&B)>>>16)>>>16,U=65535&(B=E=65535&U|S<<16),S=B>>>16,P=65535&(_=A=65535&P|(k+=P>>>16)<<16),k=_>>>16,U+=65535&(B=(C>>>28|T<<4)^(T>>>2|C<<30)^(T>>>7|C<<25)),S+=B>>>16,P+=65535&(_=(T>>>28|C<<4)^(C>>>2|T<<30)^(C>>>7|T<<25)),k+=_>>>16,S+=(B=C&Y^C&H^Y&H)>>>16,P+=65535&(_=T&R^T&z^R&z),k+=_>>>16,u=65535&(P+=(S+=(U+=65535&B)>>>16)>>>16)|(k+=P>>>16)<<16,b=65535&U|S<<16,U=65535&(B=p),S=B>>>16,P=65535&(_=f),k=_>>>16,S+=(B=E)>>>16,P+=65535&(_=A),k+=_>>>16,R=o,z=i,N=s,L=f=65535&(P+=(S+=(U+=65535&B)>>>16)>>>16)|(k+=P>>>16)<<16,K=h,O=a,Z=c,T=u,Y=l,H=y,F=d,D=p=65535&U|S<<16,G=w,V=g,q=v,C=b,m%16==15)for(x=0;x<16;x++)_=M[x],U=65535&(B=I[x]),S=B>>>16,P=65535&_,k=_>>>16,_=M[(x+9)%16],U+=65535&(B=I[(x+9)%16]),S+=B>>>16,P+=65535&_,k+=_>>>16,A=M[(x+1)%16],U+=65535&(B=((E=I[(x+1)%16])>>>1|A<<31)^(E>>>8|A<<24)^(E>>>7|A<<25)),S+=B>>>16,P+=65535&(_=(A>>>1|E<<31)^(A>>>8|E<<24)^A>>>7),k+=_>>>16,A=M[(x+14)%16],S+=(B=((E=I[(x+14)%16])>>>19|A<<13)^(A>>>29|E<<3)^(E>>>6|A<<26))>>>16,P+=65535&(_=(A>>>19|E<<13)^(E>>>29|A<<3)^A>>>6),k+=_>>>16,k+=(P+=(S+=(U+=65535&B)>>>16)>>>16)>>>16,M[x]=65535&P|k<<16,I[x]=65535&U|S<<16;U=65535&(B=C),S=B>>>16,P=65535&(_=T),k=_>>>16,_=t[0],S+=(B=r[0])>>>16,P+=65535&_,k+=_>>>16,k+=(P+=(S+=(U+=65535&B)>>>16)>>>16)>>>16,t[0]=T=65535&P|k<<16,r[0]=C=65535&U|S<<16,U=65535&(B=Y),S=B>>>16,P=65535&(_=R),k=_>>>16,_=t[1],S+=(B=r[1])>>>16,P+=65535&_,k+=_>>>16,k+=(P+=(S+=(U+=65535&B)>>>16)>>>16)>>>16,t[1]=R=65535&P|k<<16,r[1]=Y=65535&U|S<<16,U=65535&(B=H),S=B>>>16,P=65535&(_=z),k=_>>>16,_=t[2],S+=(B=r[2])>>>16,P+=65535&_,k+=_>>>16,k+=(P+=(S+=(U+=65535&B)>>>16)>>>16)>>>16,t[2]=z=65535&P|k<<16,r[2]=H=65535&U|S<<16,U=65535&(B=F),S=B>>>16,P=65535&(_=N),k=_>>>16,_=t[3],S+=(B=r[3])>>>16,P+=65535&_,k+=_>>>16,k+=(P+=(S+=(U+=65535&B)>>>16)>>>16)>>>16,t[3]=N=65535&P|k<<16,r[3]=F=65535&U|S<<16,U=65535&(B=D),S=B>>>16,P=65535&(_=L),k=_>>>16,_=t[4],S+=(B=r[4])>>>16,P+=65535&_,k+=_>>>16,k+=(P+=(S+=(U+=65535&B)>>>16)>>>16)>>>16,t[4]=L=65535&P|k<<16,r[4]=D=65535&U|S<<16,U=65535&(B=G),S=B>>>16,P=65535&(_=K),k=_>>>16,_=t[5],S+=(B=r[5])>>>16,P+=65535&_,k+=_>>>16,k+=(P+=(S+=(U+=65535&B)>>>16)>>>16)>>>16,t[5]=K=65535&P|k<<16,r[5]=G=65535&U|S<<16,U=65535&(B=V),S=B>>>16,P=65535&(_=O),k=_>>>16,_=t[6],S+=(B=r[6])>>>16,P+=65535&_,k+=_>>>16,k+=(P+=(S+=(U+=65535&B)>>>16)>>>16)>>>16,t[6]=O=65535&P|k<<16,r[6]=V=65535&U|S<<16,U=65535&(B=q),S=B>>>16,P=65535&(_=Z),k=_>>>16,_=t[7],S+=(B=r[7])>>>16,P+=65535&_,k+=_>>>16,k+=(P+=(S+=(U+=65535&B)>>>16)>>>16)>>>16,t[7]=Z=65535&P|k<<16,r[7]=q=65535&U|S<<16,j+=128,e-=128}return e}function At(t,r,n){var e,o=new Int32Array(8),i=new Int32Array(8),s=new Uint8Array(256),f=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,vt(o,i,r,n),n%=128,e=0;e=0;--o)mt(t,r,e=n[o/8|0]>>(7&o)&1),Et(r,t),Et(t,t),mt(t,r,e)}function Ut(t,r){var n=[U(),U(),U(),U()];Q(n[0],T),Q(n[1],R),Q(n[2],k),at(n[3],T,R),xt(t,n,r)}function Bt(t,r,n){var e,o=new Uint8Array(64),i=[U(),U(),U(),U()];for(n||B(r,32),At(o,r,32),o[0]&=248,o[31]&=127,o[31]|=64,Ut(i,o),_t(t,i),e=0;e<32;e++)r[e+32]=t[e];return 0}var St=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Ot(t,r){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;o>4)*St[o],n=r[o]>>8,r[o]&=255;for(o=0;o<32;o++)r[o]-=n*St[o];for(e=0;e<32;e++)r[e+1]+=r[e]>>8,t[e]=255&r[e]}function Pt(t){var r,n=new Float64Array(64);for(r=0;r<64;r++)n[r]=t[r];for(r=0;r<64;r++)t[r]=0;Ot(t,n)}function kt(t,r,n,e){var o,i,s=new Uint8Array(64),f=new Uint8Array(64),h=new Uint8Array(64),a=new Float64Array(64),c=[U(),U(),U(),U()];At(s,e,32),s[0]&=248,s[31]&=127,s[31]|=64;var u=n+64;for(o=0;o>7&&ft(t[0],P,t[0]),at(t[3],t[0],t[1]),0)}(h,e))return-1;for(o=0;o=0},x.sign.keyPair=function(){var t=new Uint8Array(32),r=new Uint8Array(64);return Bt(t,r),{publicKey:t,secretKey:r}},x.sign.keyPair.fromSecretKey=function(t){if(It(t),64!==t.length)throw new Error("bad secret key size");for(var r=new Uint8Array(32),n=0;n>16&1),i[n-1]&=65535;i[15]=s[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,Dt(s,i,1-o)}for(n=0;n<16;n++)t[2*n]=255&s[n],t[2*n+1]=s[n]>>8}function Vt(t,r){var n=new Uint8Array(32),e=new Uint8Array(32);return Gt(n,t),Gt(e,r),function(t,r,n,e,o){var i,s=0;for(i=0;i<32;i++)s|=t[0+i]^n[0+i];return(1&s-1>>>8)-1}(n,0,e)}function Ft(t){var r=new Uint8Array(32),n=[Rt(),Rt(),Rt(),Rt()],e=Rt(),o=Rt();if(function(t,r){var n,e,o=Rt(),i=Rt(),s=Rt(),f=Rt(),h=Rt(),a=Rt(),c=Rt();return function(t,r){var n;for(n=0;n<16;n++)t[n]=0|r[n]}(t[2],Nt),function(t,r){var n;for(n=0;n<16;n++)t[n]=r[2*n]+(r[2*n+1]<<8);t[15]&=32767}(t[1],r),$t(s,t[1]),Ht(f,s,Lt),Yt(s,s,t[2]),Zt(f,t[2],f),$t(h,f),$t(a,h),Ht(c,a,h),Ht(o,c,s),Ht(o,o,f),function(t,r){var n,e=Rt();for(n=0;n<16;n++)e[n]=r[n];for(n=250;n>=0;n--)$t(e,e),1!==n&&Ht(e,e,r);for(n=0;n<16;n++)t[n]=e[n]}(o,o),Ht(o,o,s),Ht(o,o,f),Ht(o,o,f),Ht(t[0],o,f),$t(i,t[0]),Ht(i,i,f),Vt(i,s)&&Ht(t[0],t[0],Kt),$t(i,t[0]),Ht(i,i,f),Vt(i,s)?-1:(n=t[0],Gt(e=new Uint8Array(32),n),(1&e[0])==r[31]>>7&&Yt(t[0],Mt,t[0]),Ht(t[3],t[0],t[1]),0)}(n,t))return null;var i=n[1];return Zt(e,Nt,i),Yt(o,Nt,i),function(t,r){var n,e=Rt();for(n=0;n<16;n++)e[n]=r[n];for(n=253;n>=0;n--)$t(e,e),2!==n&&4!==n&&Ht(e,e,r);for(n=0;n<16;n++)t[n]=e[n]}(o,o),Ht(e,e,o),Gt(r,e),r}function qt(r){var n,e=new Uint8Array(64),o=new Uint8Array(32);for(t.lowlevel.crypto_hash(e,r,32),e[0]&=248,e[31]&=127,e[31]|=64,n=0;n<32;n++)o[n]=e[n];for(n=0;n<64;n++)e[n]=0;return o}const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=s("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),n=s("0123456789abcdef"),o=s(r),i={encode:t=>{const n="string"==typeof t?(new TextEncoder).encode(t):new Uint8Array(t),e=3*Math.ceil(n.length/3),i=new Uint8Array(e);i.set(n);const s=o.encode(i).split(""),f=4*e/3;for(;s.length{const r=o.decode(t.replace(/=/g,"A")),n=Math.ceil(3*t.length/4),e=(t.match(/=/g)||[]).length,i=r.length-n;return r.slice(i,r.length-e)}};function s(t){const r={ALPHABET_MAP:{},BASE:t.length,LEADER:t.charAt(0),ALPHABET:t};for(let t=0;tfunction(t,r){if(0===t.length)return"";const n=[0];for(let e of t){for(let t=0;t0;)n.push(e%r.BASE),e=e/r.BASE|0}let e="";for(let n=0;0===t[n]&&n=0;--t)e+=r.ALPHABET[n[t]];return e}(t,r),decode:t=>function(t,r){const n=function(t,r){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return new Uint8Array(0);const n=[0];for(const e of t){const t=r.ALPHABET_MAP[e];if(void 0===t)return;let o=t;for(let t=0;t>=8;for(;o>0;)n.push(255&o),o>>=8}for(let e=0;t[e]===r.LEADER&&ee===Wt?t:(n[o]=t,xr(t*e,r))),Jt),r);return t.reduceRight(((t,e,o)=>e===Wt?t:(n[o]=xr(t*n[o],r),xr(t*e,r))),e),n}(t.map((t=>t.z)));return t.map(((t,n)=>t.toAffine(r[n])))}static normalizeZ(t){return this.toAffineBatch(t).map(this.fromAffine)}equals(t){ar(t);const{x:r,y:n,z:e}=this,{x:o,y:i,z:s}=t,f=xr(r*s),h=xr(o*e),a=xr(n*s),c=xr(i*e);return f===h&&a===c}negate(){return new fr(xr(-this.x),this.y,this.z,xr(-this.t))}double(){const{x:t,y:r,z:n}=this,{a:e}=tr,o=xr(t*t),i=xr(r*r),s=xr(Xt*xr(n*n)),f=xr(e*o),h=t+r,a=xr(xr(h*h)-o-i),c=f+i,u=c-s,l=f-i,y=xr(a*u),d=xr(c*l),p=xr(a*l),w=xr(u*c);return new fr(y,d,w,p)}add(t){ar(t);const{x:r,y:n,z:e,t:o}=this,{x:i,y:s,z:f,t:h}=t,a=xr((n-r)*(s+i)),c=xr((n+r)*(s-i)),u=xr(c-a);if(u===Wt)return this.double();const l=xr(e*Xt*h),y=xr(o*Xt*f),d=y+l,p=c+a,w=y-l,g=xr(d*u),v=xr(p*w),b=xr(d*w),A=xr(u*p);return new fr(g,v,A,b)}subtract(t){return this.add(t.negate())}precomputeWindow(t){const r=1+256/t,n=[];let e=this,o=e;for(let i=0;i>=c,s>f&&(s-=a,t+=Jt),0===s){let t=e[n];r%2&&(t=t.negate()),i=i.add(t)}else{let t=e[n+Math.abs(s)-1];s<0&&(t=t.negate()),o=o.add(t)}}return fr.normalizeZ([o,i])[0]}multiply(t,r){return this.wNAF(kr(t,tr.l),r)}multiplyUnsafe(t){let r=kr(t,tr.l,!1);const n=fr.BASE,e=fr.ZERO;if(r===Wt)return e;if(this.equals(e)||r===Jt)return this;if(this.equals(n))return this.wNAF(r);let o=e,i=this;for(;r>Wt;)r&Jt&&(o=o.add(i)),i=i.double(),r>>=Jt;return o}isSmallOrder(){return this.multiplyUnsafe(tr.h).equals(fr.ZERO)}isTorsionFree(){return this.multiplyUnsafe(tr.l).equals(fr.ZERO)}toAffine(t=Ur(this.z)){const{x:r,y:n,z:e}=this,o=xr(r*t),i=xr(n*t);if(xr(e*t)!==Jt)throw new Error("invZ was invalid");return new yr(o,i)}fromRistrettoBytes(){cr()}toRistrettoBytes(){cr()}fromRistrettoHash(){cr()}}function ar(t){if(!(t instanceof fr))throw new TypeError("ExtendedPoint expected")}function hr(t){if(!(t instanceof ur))throw new TypeError("RistrettoPoint expected")}function cr(){throw new Error("Legacy method: switch to RistrettoPoint")}fr.BASE=new fr(tr.Gx,tr.Gy,Jt,xr(tr.Gx*tr.Gy)),fr.ZERO=new fr(Wt,Jt,Jt,Wt);class ur{constructor(t){this.ep=t}static calcElligatorRistrettoMap(t){const{d:r}=tr,n=xr(er*t*t),e=xr((n+Jt)*ir);let o=BigInt(-1);const i=xr((o-r*n)*xr(n+r));let{isValid:s,value:f}=Sr(e,i),h=xr(f*t);Ar(h)||(h=xr(-h)),s||(f=h),s||(o=n);const a=xr(o*(n-Jt)*sr-i),c=f*f,u=xr((f+f)*i),l=xr(a*nr),y=xr(Jt-c),d=xr(Jt+c);return new fr(xr(u*d),xr(y*l),xr(l*d),xr(u*y))}static hashToCurve(t){const r=_r((t=Pr(t,64)).slice(0,32)),n=this.calcElligatorRistrettoMap(r),e=_r(t.slice(32,64)),o=this.calcElligatorRistrettoMap(e);return new ur(n.add(o))}static fromHex(t){t=Pr(t,32);const{a:r,d:n}=tr,e="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",o=_r(t);if(!function(t,r){if(t.length!==r.length)return!1;for(let n=0;n=e)throw new Error("Expected 0 < hex < P");if(!r&&i>=rr)throw new Error("Expected 0 < hex < 2**256");const s=xr(i*i),f=xr(s-Jt),h=xr(n*s+Jt);let{isValid:a,value:c}=Sr(f,h);if(!a)throw new Error("Point.fromHex: invalid y coordinate");const u=(c&Jt)===Jt;return 0!=(128&t[31])!==u&&(c=xr(-c)),new yr(c,i)}static async fromPrivateKey(t){return(await zr(t)).point}toRawBytes(){const t=vr(this.y);return t[31]|=this.x&Jt?128:0,t}toHex(){return wr(this.toRawBytes())}toX25519(){const{y:t}=this;return vr(xr((Jt+t)*Ur(Jt-t)))}isTorsionFree(){return fr.fromAffine(this).isTorsionFree()}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new yr(xr(-this.x),this.y)}add(t){return fr.fromAffine(this).add(fr.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return fr.fromAffine(this).multiply(t,this).toAffine()}}function pr(...t){if(!t.every((t=>t instanceof Uint8Array)))throw new Error("Expected Uint8Array list");if(1===t.length)return t[0];const r=t.reduce(((t,r)=>t+r.length),0),n=new Uint8Array(r);for(let r=0,e=0;rr.toString(16).padStart(2,"0")));function wr(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let r="";for(let n=0;n=Wt?n:r+n}function Ur(t,r=tr.P){if(t===Wt||r<=Wt)throw new Error(`invert: expected positive integers, got n=${t} mod=${r}`);let n=xr(t,r),e=r,o=Wt,i=Jt;for(;n!==Wt;){const t=e%n,r=o-i*(e/n);e=n,n=t,o=i,i=r}if(e!==Jt)throw new Error("invert: does not exist");return xr(o,r)}function Br(t,r){const{P:n}=tr;let e=t;for(;r-- >Wt;)e*=e,e%=n;return e}function Sr(t,r){const n=xr(r*r*r),e=function(t){const{P:r}=tr,n=BigInt(5),e=BigInt(10),o=BigInt(20),i=BigInt(40),s=BigInt(80),f=t*t%r*t%r,h=Br(f,Xt)*f%r,a=Br(h,Jt)*t%r,c=Br(a,n)*a%r,u=Br(c,e)*c%r,l=Br(u,o)*u%r,y=Br(l,i)*l%r,d=Br(y,s)*y%r,p=Br(d,s)*y%r,w=Br(p,e)*c%r;return{pow_p_5_8:Br(w,Xt)*t%r,b2:f}}(t*xr(n*n*r)).pow_p_5_8;let o=xr(t*n*e);const i=xr(r*o*o),s=o,f=xr(o*er),h=i===t,a=i===xr(-t),c=i===xr(-t*er);return h&&(o=s),(a||c)&&(o=f),Ar(o)&&(o=xr(-o)),{isValid:h||a,value:o}}function Or(t){return Sr(Jt,t)}function Pr(t,r){const n=t instanceof Uint8Array?Uint8Array.from(t):gr(t);if("number"==typeof r&&n.length!==r)throw new Error(`Expected ${r} bytes`);return n}function kr(t,r,n=!0){if(!r)throw new TypeError("Specify max value");if("number"==typeof t&&Number.isSafeInteger(t)&&(t=BigInt(t)),"bigint"==typeof t&&t{if((t=Pr(t)).length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return xr(Er(t),tr.l-Jt)+Jt},randomBytes:(t=32)=>{if(se.web)return se.web.getRandomValues(new Uint8Array(t));throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>Tr.randomBytes(32),sha512:async(...t)=>{const r=pr(...t);if(se.web){const t=await se.web.subtle.digest("SHA-512",r.buffer);return new Uint8Array(t)}throw new Error("The environment doesn't have sha512 function")},precompute(t=8,r=yr.BASE){const n=r.equals(yr.BASE)?r:new yr(r.x,r.y);return n._setWindowSize(t),n.multiply(Xt),n},sha512Sync:void 0};Object.defineProperties(Tr,{sha512Sync:{configurable:!1,get:()=>Cr,set(t){Cr||(Cr=t)}}}),x.setPRNG((async function(t,r){if(!t&&!r)return Math.random();r||"number"!=typeof t||(r=t,t=new Uint8Array(r));const n=r,e=new Uint8Array(r);for(let t=0;t44)throw new ie("too_long","Base58 string too long, see rfc/0009_Duniter_Blockchain_Protocol_V11.md#public-key for details.");if(!/^[A-HJ-NP-Za-km-z1-9]+$/.test(t))throw new ie("not_b58","Character out of base 58, see rfc/0009_Duniter_Blockchain_Protocol_V11.md#public-key for details.");if(e.decode(t).length>32)throw new ie("too_long","binary key too long, see rfc/0009_Duniter_Blockchain_Protocol_V11.md#public-key for details.");return!0}function Wr(t){const r=$r(t);try{yr.fromHex(r)}catch(t){throw new ie("bad_ed25519_point",`Invalid public key : not a valid ed25519 point RFC8032 5.1.3 https://www.rfc-editor.org/rfc/rfc8032#page-11 Internal:${t}`)}return!0}function en(t){try{return Wr(t)}catch(t){return!1}}function Jr(t,r=!0){if(!t)throw new ie("empty","Invalid public key : empty input.");let n;try{const r=$r(t);n="string"==typeof t?t:e.encode(r)}catch(t){if(t.message.match(/base58/))throw new ie("not_b58","Character out of base 58, see rfc/0009_Duniter_Blockchain_Protocol_V11.md#public-key for details.");if("RangeError"===t.name)throw new ie("too_long","Binary key too long, see rfc/0009_Duniter_Blockchain_Protocol_V11.md#public-key for details.");throw t}return!r||(qr(n),Wr(n),!0)}function on(t){try{return Jr(t)}catch(t){return!1}}async function sn(t,r){const n=await Xr(t.trim()+"\n",r);return`${t.trim()}\n${n}`}function Xr(t,r,n="b64"){const o=Qr((new TextEncoder).encode(t),Vr(r).slice(0,32));switch(n.toLocaleLowerCase()){case"raw":case"array":case"uint8array":return o;case"b64":return i.encode(o);case"b58":return e.encode(o);default:throw new Error(`OutputFormat ${n} not handled.`)}}function Qr(t,r){const n=Dr(r);return x.sign.detached(t,n.secretKey)}function te(t,r){return"string"==typeof t?r(t):t}function re(t){const r=new TextEncoder;return"string"==typeof t?r.encode(t):t}function fn(t){return te(t,i.decode)}function ee(t){return te(t,e.decode)}function ne(t){return(new TextDecoder).decode(t)}function oe(t){return ee(t).slice(0,32)}function hn(t,r,o,s=0,f=""){const h=f?e.decode(f):x.randomBytes(24);console.log("Défini : ",o);const a=Ft($r(o)),c=qt(oe(r)),u=t=>i.encode(x.box(re(t),h,a,c)),l=e.encode(Dr(oe(r)).publicKey),y=s||Math.trunc(Date.now()/1e3),d={nonce:e.encode(h),issuer:l,recipient:o,time:y,version:2};return t.title&&(d.title=u(t.title)),t.content&&(d.content=u(t.content)),d.hash=n.encode(Nr.digest(JSON.stringify(d))).toUpperCase(),d.signature=Xr(d.hash,r),d}function an(t,r){const n=e.decode(t.nonce),o=qt(oe(r)),s=Ft($r(t.issuer)),f=t=>ne(x.box.open(i.decode(t),n,s,o)),h={};return t.content&&(h.content=f(t.content)),t.title&&(h.title=f(t.title)),h}class ie extends Error{constructor(t,r){super(r),this.name=t}}export{e as b58,ee as b58orBin2bin,Gr as b58pubKey2bin,Vr as b58secretKey2bin,i as b64,fn as b64orBin2bin,ne as bin2str,qr as checkDuniterPubKey,Wr as checkEd25519PubKey,Jr as checkKey,tn as idSecPass2cleanKeys,Kr as idSecPass2rawAll,nn as isDuniterPubKey,en as isEd25519PubKey,on as isPubKey,Mr as mockRandom,Fr as onlyPubKey,$r as pubKey2bin,Yr as pubKey2checksum,rn as pubKey2shortKey,jr as raw2b58,Qr as rawSign,Zr as saltPass2seed,Dr as seed2keyPair,b as sha256,Xr as sign,sn as signDocument,Hr as sliceInitialsZero,re as strOrBin2bin,an as textDecrypt,hn as textEncrypt,te as typedStrOrBin2Bin}; \ No newline at end of file diff --git a/www/dunikey.html b/www/dunikey.html new file mode 100644 index 00000000..c9880756 --- /dev/null +++ b/www/dunikey.html @@ -0,0 +1,70 @@ + + + + + idSec+password or seed or keys => file.dunikey + + + + + + + + + + + + + +

DunikeyMaker

+
+
+ + +
+
ou
+
+ +
+
ou
+
+ + +
+
+
et
+
+ + +
+ + + + + diff --git a/www/dunikey.js b/www/dunikey.js new file mode 100644 index 00000000..f3059d2a --- /dev/null +++ b/www/dunikey.js @@ -0,0 +1,54 @@ +import * as dKey from "./crypto.js"; + +addEventsListeners([ + document.getElementById("idSec"), + document.getElementById("pass"), + ], "keyup change", + async function () { + const idSec = document.getElementById("idSec").value; + const pass = document.getElementById("pass").value; + const keys = await dKey.idSecPass2cleanKeys(idSec, pass); + document.getElementById("seed").value = keys.seed; + document.getElementById("secretkey").value = keys.secretKey; + document.getElementById("pubkey").value = keys.publicKey; + + }); +addEventsListeners([ + document.getElementById("seed"), + ], "keyup change", + async function () { + let rawSeed; + const seed = document.getElementById("seed").value; + console.log(seed.length); + if (seed.length === 64) rawSeed = dKey.b16.decode(seed); + else rawSeed = dKey.b58.decode(seed); + const keys = await dKey.seed2keyPair(rawSeed); + document.getElementById("secretkey").value = dKey.b58.encode(keys.secretKey); + document.getElementById("pubkey").value = dKey.b58.encode(keys.publicKey); + }); +addEventsListeners([ + document.getElementById("compute"), + ], "click", + async function () { + const filename = document.getElementById("filename").value; + const secretkey = document.getElementById("secretkey").value; + const pubkey = document.getElementById("pubkey").value; + exportAsFile(filename, `pub: ${pubkey}\nsec: ${secretkey}`); + }); + +function exportAsFile(fileName, data) { + const a = document.createElement('a'); + a.setAttribute('download', fileName + '.dunikey.yml'); + a.setAttribute('href', 'data:text/yaml;charset=utf-8,' + encodeURIComponent(data)); + clickOn(a); +} +function clickOn(element) { + const event = new MouseEvent('click', {'view': window, 'bubbles': true, 'cancelable': true}); + element.dispatchEvent(event); +} +function addEventsListeners(triggerNodes, events, functions) { + if (!triggerNodes.length) triggerNodes = [triggerNodes]; + if (typeof events !== "object") events = events.split(" "); + if (typeof functions !== "object") functions = [functions]; + for (let n of triggerNodes) events.forEach(e => functions.forEach(f => n.addEventListener(e, f))); +} diff --git a/www/favicon.ico b/www/favicon.ico new file mode 100755 index 0000000000000000000000000000000000000000..3049be9151c36cc1ed75049d1355e6ec2c6d038a GIT binary patch literal 5430 zcmcgw3v5)!6&Xv)H@#u9w|?yKiUT%=Dax-)h+cj?$`g zba&pH_wJl~@7$R;vo2RJS8vzIkuKCDT?YocTw`1=*I?AVpV!yrs>AhIwBZ%kWC+{s zg7(xBi^clgzkmN{M~)nsv3m9Dzs;XN|Jy~27Ue8nyf}Bsk|ldrtXPqko}Qk+YSpTI zJm0@|?b`k8*RMaYZrwUtlCRmeX3d)YcyHgzl`He1m$z)$vb{@}F3m-s?C&2L85x@j z3JU(**x2~0VHo}I-n~0|_wL;b=FXj4wsq^)mgC2dyU(6I+jj2UxwZ=zF0_}HmU_y{ z%Dm;}<=%>l3U6g)r7cxeRo+zLGrq%jsdMSlCC|l+7d`B&q@<+n#EBE`9Xob3rKP2j zYxV8hx5phmeE3t?cNILrn>TL;nwy)w4<0=5K79Dl>+yIxQ2aihFW~q4gI!%+w&0rg zwxBI>%{IQ<+1cr*K-b4U+S}XNp9lSVnwpwuw;yr2e(>PIIoa9Sf4zM9vZubjK7^PU zt*xyg=mc28;czGti5RA7Mlnt%g~h4uo5w#~od9AJ*s^8Io|7j}=3@NYA%3^p9fGY<_+dhyJVL~U=(IYm+w!)209a2c@p#-8EfEiDn)5ZbqI-x-X}5pcGm-NTrn7_iyqHY~&1qxQ(R z)!X`~z*sd_7pg)nrPOg5*C83wLJAF&&?ISF!alp1)2H*0b9ZP1V*q|%v)OD8 zQ9}~kFRPdJ3^hY0$6>0PDzAxa!fm>ldr@+s&@V5XU^nz=U-zIzdv23C%8td(fWpULwbZqyslo?KLkFOAIp2@J*E|7OCJUDn{%$6 zKES^g@^sft>>KuY7$3GF*BfcqsZ*zNi;9YJc#n5l(AM4+?g}OQ{(<^HQ;!@?R+Frb zS6lw5pFRt?#EBNc*h|hY_-O}$+_0mKwj>MR;k4*}?gn=*{3rh%+6DVP4Q4|$InD$1 zKwTU!7UzL-t6YXf*v=`h;WZd*+Ckp#yp1x>ocHvFKBkD9F=9M82INlVzZAPI!uEn6I3_%rT4w*DlUw_q}`fZucZf{EdtWZEKD+8>w?{ zxE`+atURkOR%d2d8P-C%P!@;+!F7!~)MXqPkDfS_pF8|$`G>Oe}vrJQI@@wmB={Nmc*MhVI{3c_O6n8hS6T+A!Zttyn>o?V#vQ@MSm}am0w4HfCJ0KjJROvul z2e?{kgTqg|_%8imAMCHvs2k7Z)y2co20!! z$c^=Pe>e9N{Dv?@zRuStfuq1*0CJyJr@8*y-ypYi>z@NoT)1AJv(8zxpMEf&Nqwh| zg^%3WmmErZ=du5>h}o=~^(mkja03!32ZAzabK}!y*I%ix68yAdikhMg)39UELoWEp z{U7|Wyhs)4UjaV`*ynG78bASY71y1z)0TQ!uYV6X{&S;*>liTz*Jqq9)G=MT- z1n?~Wm()x8M*N1r{NpDP?mT}DB0u&(2k~C=-1IYV!Vw@I7L(OvnXR*RI`9+VY23Ya zZ~c~fOP9t=$<6O?k8_`#r)iTXsor{2@!)p-4e zdP7fC6ZMDcLz!)5Tke>f`#hVwr@VLg$bIza(G~n|I&Dd{9fuH(5F4$H7H!xdH^>63 zKpq0>t$NuR>omh=II-{Kn)h9~$w_XU*(TN2)|MpkJ~0-|2Y<*P$Pqc_G&xPq0*YhB zX3z-Q`y9sF;qA`1=dQU94>`$=&rH8#$BunkQ&Us&j5yfi0X>`mapr@NCt3KcTas;m z>NPpYMNV>KIdP%xQ(av>k@3KuI2UJ93F+nhPl5k1QVY)JzudfebME%-+e>%t+ExC|H{Vp`IZuImbQM3bDfezGcKSL_@s6^29viQTP$} zd^}5WIFU9nr+RMb7f_ulIMD!^Friv_P0(A-LurE zZ56Q!Bwin#DKq7^_%<;~O_B?(g;u}_g!s+m{OA^*AwBT9h5GQJjJENeBCE*aw~=e{ zP&HJKQDgKg>J_;&zEdFPT=<_@1E`A_Ravb{&;bJx-0o&bpT_ z7R91_4NJ^l>NYeq)KI@LUMME$33?d7J}OnE-k>%l_DY}2&n0YN925G~b@Ufmi>xtv zjQ$0%8Q20Oe^Yq2d5*sCdh~kaGxeFArl;wfz<9vX@2~pn@>scjCT1=;Hjo?hr>gtj zABu#G1#*GJIY*9ABlK`JT)(T{l|`b6@w0Ql(Pd3tvC xqTrP$V^1CGVjPE|&O$7!Zr!@YcwA|?WlNoX&3g!+Il_0TL){Jk#p*=ee*?!dQUd@0 literal 0 HcmV?d00001 diff --git a/www/index.html b/www/index.html deleted file mode 100644 index 68ada18f..00000000 --- a/www/index.html +++ /dev/null @@ -1,275 +0,0 @@ - - - Upload files to Astroport - - - - -
- - -
- Téléverser un fichier vers Astroport -
-
-
- -
- - -
-
- -
- - -
-
-
- - - - - diff --git a/www/index.html b/www/index.html new file mode 120000 index 00000000..6ad44fc8 --- /dev/null +++ b/www/index.html @@ -0,0 +1 @@ +dunikey.html \ No newline at end of file diff --git a/www/upload_to_astroport.html b/www/upload_to_astroport.html new file mode 100644 index 00000000..68ada18f --- /dev/null +++ b/www/upload_to_astroport.html @@ -0,0 +1,275 @@ + + + Upload files to Astroport + + + + +
+ + +
+ Téléverser un fichier vers Astroport +
+
+
+ +
+ + +
+
+ +
+ + +
+
+
+ + + + + From 86a32995ea07ca5b3a9cfa3c54a9a3acf3e4eab8 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 27 Nov 2022 21:54:40 +0100 Subject: [PATCH 6/6] et hop --- ASTROBOT/G1CopierYoutube.sh | 2 +- install.sh | 2 ++ tools/Connect_PLAYER_To_Gchange.sh | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ASTROBOT/G1CopierYoutube.sh b/ASTROBOT/G1CopierYoutube.sh index f3a5e108..61d23137 100755 --- a/ASTROBOT/G1CopierYoutube.sh +++ b/ASTROBOT/G1CopierYoutube.sh @@ -196,5 +196,5 @@ while read LINE; echo "XXXXXXXXXXXXXXXXXXXXXXX" fi -done < ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache # FINISH YID loop 1 +done < ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$WISHKEY # FINISH YID loop 1 exit 0 diff --git a/install.sh b/install.sh index 4825c25e..a0f4bda3 100755 --- a/install.sh +++ b/install.sh @@ -231,6 +231,8 @@ echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt-get" | (sudo su -c 'EDITOR="tee" vis echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/apt') ## USED FOR "systemctl restart ipfs" echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl') +## USED FOR "systemctl restart ipfs" +echo "$USER ALL=(ALL) NOPASSWD:/usr/local/bin/youtube-dl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/youtube-dl') ## brother_ql_print echo "$USER ALL=(ALL) NOPASSWD:/usr/local/bin/brother_ql_print" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/brother_ql_print') diff --git a/tools/Connect_PLAYER_To_Gchange.sh b/tools/Connect_PLAYER_To_Gchange.sh index ebcf437f..e3f04881 100755 --- a/tools/Connect_PLAYER_To_Gchange.sh +++ b/tools/Connect_PLAYER_To_Gchange.sh @@ -128,7 +128,7 @@ do ## GET FRIEND GCHANGE PROFILE ${MY_PATH}/timeout.sh -t 20 \ - ${MY_PATH}/jaklis/jaklis.py \ + ${MY_PATH}/jaklis/jaklis.py get \ -p ${liking_me} > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/gchange.json FRIENDTITLE=$(cat ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/gchange.json | jq -r '.title')