diff --git a/_chain b/_chain index d4047b1..f09e9e6 100755 --- a/_chain +++ b/_chain @@ -1 +1 @@ -QmdKvkQL65ibGXEBXGxZZu9a58udDCZPutC1NZQfFm9sDT +QmbVfLJ9UsnyV3Si9UgZVS4srCnL1c2Gqt7XissCV4iC83 diff --git a/_comments b/_comments index 8fbc500..b7bbce3 100755 --- a/_comments +++ b/_comments @@ -177,3 +177,4 @@ OK 2019-12-18: RAZ 2019-12-20: NOW 2019-12-21: Various +2019-12-24: diff --git a/_nanodate b/_nanodate index e24818e..506b75f 100755 --- a/_nanodate +++ b/_nanodate @@ -1 +1 @@ -1576935242369880952 +1577203467543924569 diff --git a/_publishkey.gpg b/_publishkey.gpg index 17c8a49..d9c30e2 100755 Binary files a/_publishkey.gpg and b/_publishkey.gpg differ diff --git a/shell/Portefeuille.png b/shell/G1Anar.png similarity index 100% rename from shell/Portefeuille.png rename to shell/G1Anar.png diff --git a/shell/cron_SSH.activate.sh b/shell/cron_IPFS_open_SSH.sh similarity index 100% rename from shell/cron_SSH.activate.sh rename to shell/cron_IPFS_open_SSH.sh diff --git a/shell/functions.sh b/shell/functions.sh index a63d6e9..b7367e0 100755 --- a/shell/functions.sh +++ b/shell/functions.sh @@ -494,8 +494,8 @@ log "__SUB:sms_INIT_ACCOUNT: ($1=phone, $2=NOSMS)" ################################################################################################################################# function check_account (){ -log "__SUB:check_account: SILKAJ...... max 15 sec....." -AMOUNTG1=$(./shell/timeout.sh -t 15 ./silkaj/silkaj amount "$PUBKEY") +log "__SUB:check_account: SILKAJ...... max 21 sec....." +AMOUNTG1=$(./shell/timeout.sh -t 21 ./silkaj/silkaj amount "$PUBKEY") AMOUNTDU=$(bc <<< "scale=2; $AMOUNTG1 / $DUFACTOR") AMOUNTLOVE=$(bc <<< "$AMOUNTG1 * 100 / $DUFACTOR") diff --git a/shell/good.nodes.txt b/shell/good.nodes.txt index 659f426..b5b717b 100644 --- a/shell/good.nodes.txt +++ b/shell/good.nodes.txt @@ -1,3 +1,4 @@ +duniter.dethegeek.eu.org:443 g1.duniter.fr:443 g1.duniter.org:443 g1.le-sou.org:443 diff --git a/shell/sms_BILLET.sh b/shell/sms_BILLET.sh index 059c09a..f902841 100755 --- a/shell/sms_BILLET.sh +++ b/shell/sms_BILLET.sh @@ -7,7 +7,7 @@ # Create and print 6 G1Billets de nn LOVE source ./shell/init.sh source ./shell/functions.sh -log "X sms_BILLET.sh ($1=phone, $2=VALbillet)" +log "__SUB:sms_BILLET.sh: ($1=phone, $2=VALbillet)" phone="$1" VALbillet="$2" @@ -20,7 +20,7 @@ sms_INIT_ACCOUNT "$phone" "NOSMS" # FIXED LOVE UNIT (6 month maximum validity) UNIT="LOVE" -log "MEMBER? $PHONE => $MEMBER" +log "__SUB:sms_BILLET.sh: MEMBER? $PHONE => $MEMBER" if [[ $UNKNOWN == "unknown" || "$MEMBER" == "" ]]; then sms_ERROR "$phone" "Porte-monnaie non identifié. @@ -56,7 +56,7 @@ VIR=$(bc -l <<< "scale=2; $amount * $DUFACTOR / 100") # Need at least $MIN G1 available! $BILLCOM G1 commission MIN=$(bc -l <<< "$AMOUNTG1 - $LIMIT - 21") testmin=$( echo "${VIR} < ${MIN}" | bc -l ) -log "TEST : $VIR < $MIN ? $testmin" +log "__SUB:sms_BILLET.sh: TEST : $VIR < $MIN ? $testmin" # silkaj NODE CHANGE !!! #SILKAJNODE=$(./shell/checknodes.sh) @@ -88,19 +88,21 @@ then boucle=$(bc -l <<< "$boucle + 1") - log "->BILLET:$PHONE:$NUMBER:$VALbillet:$UNIT" + log "__SUB:sms_BILLET.sh: ->BILLET:$PHONE:$NUMBER:$VALbillet:$UNIT" # CREATE "NUMBER SECRET SALT" ACCOUNT for G1 transfert TRANSAC=$(bc -l <<< "scale=2; $VIR / $NBbillets") BILLETPUBKEY=$(./silkaj/silkaj generate_auth_file --auth-scrypt -salt="$NUMBER" -password="$SECRET$SALT") # COPY authfile for easier usage in 6 month... + log "__SUB:sms_BILLET.sh: authfile KEY : ./billets/$bpath/note.authfile.GPGPASS.gpg" + mkdir -p "./billets/$bpath" echo "${GPGPASS}" | gpg -q --output "./billets/$bpath/note.authfile.GPGPASS.gpg" --yes --pinentry-mode loopback --symmetric --passphrase-fd 0 "./authfile" + rm -f "./authfile" - log_history $PHONE "G1BILLET, $TRANSAC, $BILLETPUBKEY, $NUMBER, $SECRET$SALT" + log_history $PHONE "G1BILLET, $TRANSAC, $BILLETPUBKEY" sleep 3 # Fill BILLET with TRANSAC amount PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$TRANSAC" --output="$BILLETPUBKEY" --comment="G1Billet $NUMBER" -y) if [[ "$(echo $PAY | cut -d '|' -f 1)" != "KO" ]]; then - mkdir -p "./billets/$bpath" # NOTES ARE FILES STORED IN DICEWARE COMPOSED SUBDIR echo "$(date +%Y%m%d)" > "./billets/$bpath/note.creationdate" echo "$MEMBER" > "./billets/$bpath/note.creator" @@ -123,30 +125,36 @@ then # PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$NUMBER" -password="$SECRET $SALT" --amount="0.05" --output="$MEMRIB" --comment="THIRD_PARTY_MANAGER:$NODE_G1PUBKEY:G1SMS:BILLET:$VALbillet:$UNIT:$NUMBER" -y) else sms_ERROR "$PHONE" "Un problème est survenu. Contactez $ADMINPSEUDO au $ADMINPHONE" - log "ERROR SILKAJ" + # Copy & Send produiced files + zip /tmp/$PHONE_Bills_$bpath.zip ./billets/MEMBERS/$MEMBER/*.* + mpack -s "[G1sms+]_G1Billets ($bpath) Erreur... création G1Billets..." -d /tmp/message_body.txt /tmp/$PHONE_Bills_$bpath.zip $MAIL && mv /tmp/$PHONE_Bills_$bpath.zip ./billets/MEMBERS/$MEMBER/ && log "__SUB:sms_BILLET.sh: ALERT sent....." + + log "__SUB:sms_BILLET.sh: ERROR SILKAJ $(cat ./silkaj/src/constants.py)" exit fi done # + G1SMS Commission sleep 2 - COM=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$BILLCOM" --output="$NODE_G1PUBKEY" --comment="[G1SMS] Achat G1Billets" -y) + COM=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$BILLCOM" --output="$NODE_G1PUBKEY" --comment="[G1sms+] Achat G1Billets" -y) # POUR IMPRIMER LES BILLETS! Brancher votre imprimante, configurer cups, activer code lp ;) num=$(date +%Y%m%d) - log "PRINT $num $MEMBER" - montage ./billets/MEMBERS/$MEMBER/*.jpg -tile 2x3 -geometry 964x459 /tmp/$PHONE_Bills_$bpath.pdf && rm -f ./billets/MEMBERS/$MEMBER/*.jpg && log "PDF made /tmp/$PHONE_Bills_$bpath.pdf" - zip /tmp/$PHONE_Bills_$bpath.zip /tmp/$PHONE_Bills_$bpath.pdf && rm -f /tmp/$PHONE_Bills_$bpath.pdf && log "Zip done. Remove PDF" + log "__SUB:sms_BILLET.sh: PRINT $num $MEMBER" + montage ./billets/MEMBERS/$MEMBER/*.jpg -tile 2x3 -geometry 964x459 /tmp/$PHONE_Bills_$bpath.pdf && rm -f ./billets/MEMBERS/$MEMBER/*.jpg && log "__SUB:sms_BILLET.sh: PDF made /tmp/$PHONE_Bills_$bpath.pdf" + cd /tmp && zip $PHONE_Bills_$bpath.zip $PHONE_Bills_$bpath.pdf && log "__SUB:sms_BILLET.sh: Zip DONE :: /tmp$PHONE_Bills_$bpath.zip !!" && cd - + # rm -f /tmp/$PHONE_Bills_$bpath.pdf # SEND EMAIL ZIP attached echo "Commande #$NANODATE/$bpath >> Planche de 6 G1Billets : $VALbillet LOVE << -Ecrivez-nous vos remarques... -Cesium: https://cesium.app -SMS: https://g1sms.fr" > /tmp/message_body.txt - mpack -s "[G1sms+]_G1Billets ($bpath) Imprimer + Scotch à gratter! Détruire cet email..." -d /tmp/message_body.txt /tmp/$PHONE_Bills_$bpath.zip $MAIL && rm /tmp/$PHONE_Bills_$bpath.zip && log "EMAIL sent....." - mpack -s "[G1sms+]_G1Billets ($bpath) imprimer recto/verso vos G1Billets?!" -d /tmp/message_body.txt ./Dos_G1Billets.odt $MAIL && log "+ EMAIL recto: OK" - log "G1Billets $PHONE_Bills_$bpath.pdf envoyé par email à $MEMBER : $MAIL " +Envoyez-nous vos remarques... + +https://g1sms.fr" > /tmp/message_body.txt + mpack -s "[G1sms+]_G1Billets ($bpath) A IMPRIMER et détruire cet email..." -d /tmp/message_body.txt /tmp/$PHONE_Bills_$bpath.zip $MAIL && log "__SUB:sms_BILLET.sh: EMAIL sent....." +# rm -f /tmp/$PHONE_Bills_$bpath.zip +# mpack -s "[G1sms+]_G1Billets ($bpath) imprimer recto/verso vos G1Billets?!" -d /tmp/message_body.txt ./Dos_G1Billets.odt $MAIL && log "__SUB:sms_BILLET.sh: + EMAIL recto: OK" + log "__SUB:sms_BILLET.sh: G1Billets $PHONE_Bills_$bpath.pdf envoyé par email à $MEMBER : $MAIL " mess="[G1SMS] $NBbillets G1Billets de $VALbillet $UNIT ($TRANSAC G1) créé(s). Envoyés vers $MAIL, vérifiez vos SPAM... @@ -154,8 +162,9 @@ Support: $ADMINPSEUDO ($ADMINPHONE) " sms_SEND "$phone" "$mess" - # ADMIN ALERT + # ADMIN ALERT SMS + TODO Add ADMINEMAIL parameter in "install.sh" sms_SEND "$ADMINPHONE" "$MEMBER vient de créer $NBbillets G1Billets de $VALbillet $UNIT ($TRANSAC G1): $MAIL" + cat ./email.txt | sed s/EMAIL/frenault@linkeo.com/g | sed s/SUBJECT/Creation_G1Billets/g | sed s/MESSAGE/"$MEMBER ($PHONE) vient de creer $NBbillets G1Billets de $VALbillet $UNIT ($TRANSAC G1) vers $MAIL"/g | ssmtp "frenault@linkeo.com" ##################################### # Amount too High, solde insuffisant @@ -169,7 +178,7 @@ Insuffisant pour créer $NBbillets billet(s) de $VALbillet $UNIT https://g1.duniter.fr/api/#/v1/payment/$PUBKEY?amount=$VIR" fi -log "END sms_BILLET.sh" +log "__SUB:sms_BILLET.sh: END sms_BILLET.sh" log "~~~~~~~~~~~~~~~~~~~~~~~~~~~~" exit diff --git a/shell/sms_BILLET_MAKE.sh b/shell/sms_BILLET_MAKE.sh index 2eb457e..18c1493 100755 --- a/shell/sms_BILLET_MAKE.sh +++ b/shell/sms_BILLET_MAKE.sh @@ -22,7 +22,7 @@ NOTERIB="$6" MEMBER="$7" TRANSAC="$8" PHONE="$9" -log "X ./shell/sms_BILLET_MAKE.sh \"$1\" \"$2\" \"$3\" \"$4\" \"$5\" \"$6\" \"$7\" \"$8\"" +log "X sudo ./shell/sms_BILLET_MAKE.sh \"$1\" \"$2\" \"$3\" \"$4\" \"$5\" \"$6\" \"$7\" \"$8\"" if [[ "$NOTERIB" == "" || "$MEMBER" == "" ]] then @@ -48,6 +48,9 @@ valid="0${valid:0:2}" if [[ $(file "./wallets/$PHONE/$PHONE.avatar.png" | grep 'PNG') ]]; then composite -compose Over -gravity East -geometry +15+0 -dissolve 33% "./wallets/$PHONE/$PHONE.avatar.png" "./shell/Oeuro.jpg" "/tmp/$NUMERO.jpg" composite -compose Over -gravity West -geometry +15+0 -dissolve 33% "./wallets/$PHONE/$PHONE.avatar.png" "/tmp/$NUMERO.jpg" "/tmp/$NUMERO.jpg" +else + composite -compose Over -gravity East -geometry +15+0 -dissolve 33% "./shell/G1Anar.png" "./shell/Oeuro.jpg" "/tmp/$NUMERO.jpg" + composite -compose Over -gravity West -geometry +15+0 -dissolve 33% "./shell/G1Anar.png" "/tmp/$NUMERO.jpg" "/tmp/$NUMERO.jpg" fi # Add G1Billet_LOVE.png logo (250px) @@ -101,11 +104,11 @@ SIMPLEPHONE=$(echo $MASTERPHONE | sed 's/\+33/0/g') convert -font 'Liberation-Sans' \ -pointsize 120 -fill black -draw 'text 200,220 "'"$DUPART DU"'"' \ -pointsize 45 -draw 'text 550,270 "'"$MONTANT $UNIT"'"' \ --pointsize 35 -draw 'text 50,60 "'"$JUNE G1 [https://g1sms.fr]"'"' \ +-pointsize 35 -draw 'text 50,60 "'"https://g1sms.fr _ G1Billet _ $JUNE G1"'"' \ -pointsize 30 -draw 'text 60,100 "'"Identifiant: $NUMERO"'"' \ --pointsize 22 -fill black -draw 'text 400,340 "'"Code Secret: $SECRET"'"' \ --pointsize 22 -fill black -draw 'text 280,410 "'"Porte Monnaie Libre!! A utiliser avant le 01/$valid/$year"'"' \ --pointsize 20 -draw 'text 50,444 "'"Envoyer CHK $NUMERO (+ code secret) par SMS au $SIMPLEPHONE ou https://cesium.app"'"' \ +-pointsize 22 -fill black -draw 'text 380,340 "'"Code Secret: $SECRET"'"' \ +-pointsize 22 -fill black -draw 'text 260,408 "'"Porte Monnaie Libre!! A utiliser avant le 01/$valid/$year"'"' \ +-pointsize 20 -draw 'text 15,442 "'"Utilisation: CHK $NUMERO (+ code secret) par SMS au $SIMPLEPHONE ou https://cesium.app"'"' \ "/tmp/$NUMERO.jpg" "/tmp/BILL.$year.$valid.$NUMERO.$MONTANT.$UNIT.jpg" # Payable par SMS en envoyant les codes grattant la case comportant le SECRET diff --git a/shell/sms_G1TAG.sh b/shell/sms_G1TAG.sh index 787b80e..4d4d528 100755 --- a/shell/sms_G1TAG.sh +++ b/shell/sms_G1TAG.sh @@ -220,7 +220,7 @@ TAGCHAIN="./TAG/${RR}/TAG_chain" # contains IPFS current ipfs hash # if [[ $(file "./wallets/$PHONE/$PHONE.avatar.png" | grep 'PNG') ]]; then # composite -compose Over -resize 150% -gravity Center "./wallets/$PHONE/$PHONE.avatar.png" "./TAG/${RR}/${RR}.png" "./TAG/${RR}/${RR}.png" # else -# composite -compose Over -resize 100% -gravity Center "./shell/Portefeuille.png" "./TAG/${RR}/${RR}.png" "./TAG/${RR}/${RR}.png" +# composite -compose Over -resize 100% -gravity Center "./shell/G1Anar.png" "./TAG/${RR}/${RR}.png" "./TAG/${RR}/${RR}.png" # fi # WRITE G1Tag G1 amount diff --git a/shell/sms_VIR.sh b/shell/sms_VIR.sh index d74fa41..5847be3 100755 --- a/shell/sms_VIR.sh +++ b/shell/sms_VIR.sh @@ -33,7 +33,7 @@ testmin=${accounting[0]} VIR=${accounting[1]} PERCENT=${accounting[2]} if [[ $testmin -eq 0 ]]; then - sms_ERROR "$PHONE" "Solde de votre Porte-monnaie G1sms insuffisant. Minimum $charge G1! Rechargez par Cesium." + sms_ERROR "$PHONE" "Solde de votre Porte-monnaie G1sms insuffisant. Minimum $VIR G1! Rechargez par Cesium." exit fi @@ -73,7 +73,7 @@ else fi if [[ "$DESTRIB" != "" ]]; then - PAY=$(./shell/timeout.sh -t 20 ./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$VIR" --output="$DESTRIB" --comment="[G1sms+] VIR $VIR G1" -y) + PAY=$(./shell/timeout.sh -t 30 ./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$VIR" --output="$DESTRIB" --comment="[G1sms+] VIR $VIR G1" -y) if [[ "$(echo $PAY | cut -d '|' -f 1)" != "KO" && "$PAY" != "" ]]; then log "__SUB:sms_VIR.sh: VIREMENT VERS $DESTMEM OK" mess="[G1sms+] $MEMBER