From 2eb14fd8852c4b9a55b4c8542fe78135ea732e0a Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 2 Jan 2024 00:16:48 +0100 Subject: [PATCH] make message HTML & add FUN --- README.md | 2 +- RUNTIME/VISA.new.sh | 8 ++++---- install.sh | 12 ++++++++++++ tools/mailjet.sh | 19 ++++--------------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 9af356e2..1a083e8e 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ make install ``` If your computer is running 24/24, you can join our "Boostrap list" & officially become a [TW UPlanet hoster](https://talk.tiddlywiki.org/t/uplanet-a-planet-full-of-tws/8193?u=papiche) -> PLEASE REPORT ANY ISSUES +> DOCKER MODE NOT READY TO USE !! FOLLOW AND ADAPT NEXT STEP ## DESKTOP : Using install.sh script diff --git a/RUNTIME/VISA.new.sh b/RUNTIME/VISA.new.sh index fb4ba73c..2b77fc4c 100755 --- a/RUNTIME/VISA.new.sh +++ b/RUNTIME/VISA.new.sh @@ -548,18 +548,18 @@ echo "export ASTROTW=/ipns/$ASTRONAUTENS ASTROG1=$G1PUB ASTROMAIL=$PLAYER ASTROF ### SEND AstroID and ZenCard to EMAIL ( -echo "✅ UPlanet : ZenCard
Print your ZenCard : Public key (and wallet address)" > ~/.zen/tmp/${MOATS}/intro.txt +echo "✅ UPlanet : ZenCard
Print your ZenCard : Public key (and wallet address)" > ~/.zen/tmp/${MOATS}/intro.txt echo "
It is your personal ZenCard. Use it to receive Zen." >> ~/.zen/tmp/${MOATS}/intro.txt -echo "
ẐenCard" >> ~/.zen/tmp/${MOATS}/intro.txt +echo "
ẐenCard
" >> ~/.zen/tmp/${MOATS}/intro.txt $MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/intro.txt #~ mpack -a -s "✅ UPlanet : ZenCard" -d ~/.zen/tmp/${MOATS}/intro.txt \ #~ ~/.zen/tmp/${MOATS}/pseudo.png ${PLAYER} -echo "✅ UPlanet : AstroID ($PASS)
Print your AstroID : Private control key (secured by $PASS)" > ~/.zen/tmp/${MOATS}/intro.txt +echo "✅ UPlanet : AstroID ($PASS)
Print your AstroID : Private control key (secured by $PASS)" > ~/.zen/tmp/${MOATS}/intro.txt echo "
Use it to send Zen to other Uplanet players https://qo-op.com" >> ~/.zen/tmp/${MOATS}/intro.txt -echo "
AstroID" >> ~/.zen/tmp/${MOATS}/intro.txt +echo "
AstroID
" >> ~/.zen/tmp/${MOATS}/intro.txt $MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/intro.txt diff --git a/install.sh b/install.sh index 07145536..b588f462 100755 --- a/install.sh +++ b/install.sh @@ -65,6 +65,18 @@ for i in qrencode pv gnupg pandoc ca-certificates basez jq bc file gawk ffmpeg d fi done +echo "#############################################" +echo "######### FUN INSTALL ASCII ART TOOLS ######" +echo "#############################################" +for i in cmatrix cowsay; do + if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then + echo ">>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" + sudo apt install -y $i + [[ $? != 0 ]] && echo "INSTALL $i FAILED." && echo "INSTALL $i FAILED." >> /tmp/install.errors.log && continue + + fi +done + if [[ $XDG_SESSION_TYPE == 'x11' ]]; then echo "#############################################" echo "######### INSTALL DESKTOP TOOLS ######" diff --git a/tools/mailjet.sh b/tools/mailjet.sh index 43a22eca..2a69fb95 100755 --- a/tools/mailjet.sh +++ b/tools/mailjet.sh @@ -26,14 +26,8 @@ pseudo=$(echo $mail | cut -d '@' -f 1) messfile="$2" # FICHIER A AJOUTER AU CORPS MESSAGEUP SUBJECT="[UPlanet] $pseudo : $(myHostName)" -MESSAGEUP="MESSAGE -=== -" -MESSAGESIGN="--- -Astroport $(myHostName) -$(myIpfsGw)/ipns/$IPFSNODEID -" +MESSAGESIGN="---
Astroport $(myHostName)" echo " ######################################################################## @@ -60,21 +54,14 @@ export MJ_APIKEY_PRIVATE='58256ba8ea62f68965879f53bbb29f90' export SENDER_EMAIL='support@g1sms.fr' export RECIPIENT_EMAIL=${mail} -# MESSAGEUP HEADER -echo "$MESSAGEUP" > ~/.zen/tmp/email.txt # + HTML in FILE [[ -s $messfile ]] && cat $messfile >> ~/.zen/tmp/email.txt \ || echo "$messfile" >> ~/.zen/tmp/email.txt -echo $MESSAGESIGN >> ~/.zen/tmp/email.txt - EMAILZ=$(ipfs add -q ~/.zen/tmp/email.txt) echo "/ipfs/${EMAILZ}" -TEXTPART=$(cat ~/.zen/tmp/email.txt | sed ':a;N;$!ba;s/\n/\\n/g' | tr '"' '\\\"') -HTMLPART=$(cat ~/.zen/tmp/email.txt | sed ':a;N;$!ba;s/\n/
/g' | tr '"' '\\\"') - export TEXTPART="$(myIpfsGw)/ipfs/${EMAILZ}" json_payload='{ @@ -98,7 +85,7 @@ json_payload='{ ], "Subject": "'${SUBJECT}'", "TextPart": "'$(myIpfsGw)/ipfs/${EMAILZ}'", - "HTMLPart": "

You have a
MESSAGE!


May the good vibes be with you!
Astroport UPlanet" + "HTMLPart": "

You have a
MESSAGE!


May the good vibes be with you!
'${MESSAGESIGN}'" } ] }' @@ -115,6 +102,8 @@ curl -s \ -d "$json_payload" # This call sends an email to one recipient. +#~ TEXTPART=$(cat ~/.zen/tmp/email.txt | sed ':a;N;$!ba;s/\n/\\n/g' | tr '"' '\\\"') +#~ HTMLPART=$(cat ~/.zen/tmp/email.txt | sed ':a;N;$!ba;s/\n/
/g' | tr '"' '\\\"') #~ curl -s \ #~ -X POST \ #~ --user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \