In order for "Boostrap Station" to send emails to PLAYERs, we use [mailjet service](https://mailjet.com/).

This commit is contained in:
fred 2024-01-16 15:34:51 +01:00
parent f5011e3ac8
commit 3ed11810c7
2 changed files with 31 additions and 22 deletions

View File

@ -443,6 +443,16 @@ So ASTROBOT while applying ScuttleButt replications will ".chain.ts" data and ch
Data can't be lost, but protocol chain can be break ! Data can't be lost, but protocol chain can be break !
In case of some annoyance, we can monitor IPFS protocol to identify which IPFSNODEID key is acting badly and apply reaction based on DEFCON level (look into astrXbian code) In case of some annoyance, we can monitor IPFS protocol to identify which IPFSNODEID key is acting badly and apply reaction based on DEFCON level (look into astrXbian code)
### MAILJET
In order for "Boostrap Station" to send emails to PLAYERs, we use [mailjet service](https://mailjet.com/).
```
## CREDENTIALS FILE
~/.zen/MJ_APIKEY
# IS USED BY
~/.zen/Astroport.ONE/tools/mailjet.sh
```
### LOW RESSOURCE STATION CAN ACTIVATE LOW MODE (disable ipfs daemon) ### LOW RESSOURCE STATION CAN ACTIVATE LOW MODE (disable ipfs daemon)
``` ```

View File

@ -18,8 +18,28 @@ echo '
########################################################################' ########################################################################'
### PLEASE CHANGE YOUR DOMAIN AND KEY ( OR HELP PAYING TRAFIC ;) ### PLEASE CHANGE YOUR DOMAIN AND KEY ( OR HELP PAYING TRAFIC ;)
## THIS IS A FREE LIMITED ACCOUNT. DO NOT EXAGERATE ;) ## THIS IS A FREE LIMITED ACCOUNT. DO NOT EXAGERATE ;)
[[ ! $1 ]] \
&& echo "MISSING DESTINATION EMAIL" \
&& exit 1
mail="$1" # EMAIL DESTINATAIRE mail="$1" # EMAIL DESTINATAIRE
[[ ! $1 ]] && mail="support@qo-op.com"
############# USING MAILJET API ###############
[[ ! -s ~/.zen/MJ_APIKEY ]] \
&& echo "MISSING ~/.zen/MJ_APIKEY
PLEASE PROVIDE MAILJET KEY : MJ_APIKEY_PUBLIC= & MJ_APIKEY_PRIVATE" \
&& exit 1
## LOAD SENDER API KEYS
###################################
######### ~/.zen/MJ_APIKEY contains
# export MJ_APIKEY_PUBLIC='publickey'
# export MJ_APIKEY_PRIVATE='privatekey'
# export SENDER_EMAIL='me@source.tld'
###################################
source ~/.zen/MJ_APIKEY
export RECIPIENT_EMAIL=${mail}
#~ echo "DEST=$mail" #~ echo "DEST=$mail"
# mail=geg-la_debrouille@super.chez-moi.com # mail=geg-la_debrouille@super.chez-moi.com
@ -44,27 +64,6 @@ echo "
# $SUBJECT + $messfile -> $mail # $SUBJECT + $messfile -> $mail
########################################################################" ########################################################################"
### SMTP RELAY
#~ echo "From: support@g1sms.fr
#~ To: EMAIL
#~ Bcc: support@qo-op.com
#~ Subject: SUBJECT
#~ $MESSAGEUP
#~ " > ~/.zen/tmp/email.txt
#~ [[ -s $messfile ]] && cat $messfile >> ~/.zen/tmp/email.txt \
#~ || echo "$messfile" >> ~/.zen/tmp/email.txt
#~ cat ~/.zen/tmp/email.txt | sed "s~EMAIL~${mail}~g" | sed "s~SUBJECT~${SUBJECT}~g" | /usr/sbin/ssmtp ${mail}
############# USING MAILJET API ###############
export MJ_APIKEY_PUBLIC='02b075c3f28b9797d406f0ca015ca984'
export MJ_APIKEY_PRIVATE='79522360a6e0bcffbfa928a47150d169'
export SENDER_EMAIL='support@g1sms.fr'
export RECIPIENT_EMAIL=${mail}
# + HTML in FILE # + HTML in FILE
rm -f ~/.zen/tmp/email.txt rm -f ~/.zen/tmp/email.txt
[[ -s $messfile ]] \ [[ -s $messfile ]] \