diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000000000000000000000000000000000000..8bd223e22df425cc87f8419e61ad5c1b5108f7cf --- /dev/null +++ b/.htaccess @@ -0,0 +1,2 @@ +deny from all +DirectoryIndex 404.html diff --git a/README.md~ b/README.txt similarity index 70% rename from README.md~ rename to README.txt index ec4a95c09361ed90cbb8a2f5b8c71fd03742f950..fde237514765b1f717694483cb3f2347e66ea1e9 100644 --- a/README.md~ +++ b/README.txt @@ -24,15 +24,6 @@ connection = at19200 synchronizetime = yes gammucoding = utf8 #logformat = textall -PIN = 0000 - -[gammu1] -device = /dev/ttyUSB1 -name = Phone on USB serial port HUAWEI_Technology HUAWEI_Mobile -connection = at19200 -synchronizetime = yes -gammucoding = utf8 - # SMSD configuration, see gammu-smsdrc(5) [smsd] @@ -91,24 +82,3 @@ Traduire et changer ce code dans init.sh pour un autre pays!! * Synchronise phone accounts with multiple G1SMS servers. * ... -ERROR USB DONGLE !!!! NEED HARD RESET?? -https://askubuntu.com/questions/882278/how-do-i-set-ttyusb-boot-time-defaults - -vi /etc/udev/rules.d/10-ttyUSB.rules -ACTION=="add", SUBSYSTEMS="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003", ATTRS{serial}=="3f980000.usb", SYMLINK+="mydongle", RUN+="/bin/stty -F /dev/%k -crtscts" - -un 2018/11/18 10:17:08 gammu-smsd[887]: Starting phone communication... -Sun 2018/11/18 10:17:08 gammu-smsd[887]: Error at init connection: Error opening device, it doesn't exist. (DEVICENOTEXIST[4]) -Sun 2018/11/18 10:17:08 gammu-smsd[887]: Going to 30 seconds sleep because of too many connection errors -Sun 2018/11/18 10:33:11 gammu-smsd[887]: Starting phone communication... -Sun 2018/11/18 10:33:15 gammu-smsd[887]: Soft reset return code: No error. (NONE[1]) -Sun 2018/11/18 10:33:20 gammu-smsd[887]: Error getting SMS status: Error writing to the device. (DEVICEWRITEERROR[11]) - -CheckSecurity = 0 -ResetFrequency = 0 -HardResetFrequency = 0 -CommTimeout = 5 -SendTimeout = 30 -ReceiveFrequency = 15 - - diff --git a/cron/accounts.sh~ b/cron/accounts.sh~ deleted file mode 100755 index 8aa9988522bce2fed989f1975d6923f03c1bd6e1..0000000000000000000000000000000000000000 --- a/cron/accounts.sh~ +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -source /root/G1SMS/shell/init.sh -source /root/G1SMS/shell/functions.sh - -if [ -d "/root/G1SMS" ] -then - cd "/root/G1SMS" -else - exit -fi - -TOTAL=0 -TOTALG1=0 -NB=0 - -for f in $(ls ./wallets/ -t); do - PHONE="$f" - PIN=$(cat /root/G1SMS/wallets/$PHONE/$PHONE.pin|xargs) - PUBKEY=$(cat /root/G1SMS/wallets/$PHONE/$PHONE.pub|xargs) - AMOUNTG1=$(./silkaj/silkaj amount --auth-scrypt -salt="$PHONE" -password="$PIN") - echo $PHONE / $PUBKEY - echo "Solde ($PHONE) : $AMOUNTG1 G1" - - NB=$(bc <<< "$NB + 1") - TOTALG1=$(bc -l <<< "$AMOUNTG1 + $TOTALG1") - AMOUNTLOVE=$(bc <<< "$AMOUNTG1 * 100 / $DUFACTOR") - TOTAL=$(bc -l <<< "$AMOUNTLOVE + $TOTAL") - -# Use G1SMS with phone -# export SMS_1_NUMBER="$PHONE" -# export SMS_1_TEXT="N" -# $(/root/G1SMS/sms_received.sh) - -# SEND SMS TO phone -#dest="$PHONE" -#mess="[G1SMS] bonjour, vous avez un porte-monnaie Libre ($AMOUNTLOVE LOVE). Envoyez N pour le conserver. 1l0v3. https://qo-op.com" -#gammu-smsd-inject TEXT "$dest" -text "$mess" -#sleep 30 - -done - -echo "Solde TOTAL : $TOTAL LOVE" diff --git a/cron/alpha2beta.sh~ b/cron/alpha2beta.sh~ deleted file mode 100755 index a4e42a1ab703258588cf7ad76647b617641f7a5f..0000000000000000000000000000000000000000 --- a/cron/alpha2beta.sh~ +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -source /root/G1SMS/shell/init.sh -source /root/G1SMS/shell/functions.sh - -if [ -d "/root/G1SMS" ] -then - cd "/root/G1SMS" -else - exit -fi - -TOTAL=0 - -for f in $(ls ./wallets/ -t); do - PHONE="$f" - PIN=$(cat /root/G1SMS/wallets/$PHONE/$PHONE.pin|xargs) - PUBKEY=$(cat /root/G1SMS/keys/$PHONE/$PHONE.pub|xargs) - AMOUNTG1=$(./silkaj/silkaj amount --auth-scrypt -salt="$PHONE" -password="$PIN") - echo $PHONE / $PUBKEY - echo "Solde ($PHONE) : $AMOUNTG1 G1" - - if [[ "$AMOUNTG1" == "0.0" ]]; then echo "REMOVE"; rm -f /root/G1SMS/keys/$PHONE.pub; rm -f /root/G1SMS/keys/$PHONE.pin; fi - - TOTAL=$(bc -l <<< "$AMOUNTG1 + $TOTAL") - AMOUNTLOVE=$(bc <<< "$AMOUNTG1 * 100 / $DUFACTOR") -# Use G1SMS with phone -# export SMS_1_NUMBER="$PHONE" -# export SMS_1_TEXT="N" -# $(/root/G1SMS/sms_received.sh) - -# SEND SMS TO phone -dest="$PHONE" -mess="[G1SMS] bonjour, vous avez un porte-monnaie Libre ($AMOUNTLOVE LOVE). Envoyez N pour le conserver. 1l0v3. https://qo-op.com" -gammu-smsd-inject TEXT "$dest" -text "$mess" -sleep 30 - -done - -echo "Solde TOTAL : $TOTAL G1" diff --git a/fake_silkaj.sh~ b/fake_silkaj.sh~ deleted file mode 100755 index 154ba50ed001480291972b136d32e88e63175895..0000000000000000000000000000000000000000 --- a/fake_silkaj.sh~ +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Handle commands -case "$1" in - amount) - echo 1000 - ;; - transaction) - echo "OK" - ;; - generate_auth_file) - echo "CLEF0PUBLIQUE1DU2PORTE3MONNAIE4LIBRE5" - ;; - *) - echo "KO" - ;; -esac - - -echo "RUN ./silkaj/silkaj $*" >> /tmp/g1sms.log \ No newline at end of file diff --git a/g1sms.priv.key~ b/g1sms.priv.key~ deleted file mode 100644 index efa71949e66e9fee634c3029cd4198156a50b43e..0000000000000000000000000000000000000000 --- a/g1sms.priv.key~ +++ /dev/null @@ -1 +0,0 @@ -REPLACE WITH G1SMS PROVIDER WALLET PRIVATE KEY (authfile créé par 'silkaj generate_auth_file --auth-scrypt -salt="$LOGIN" -password="$PASSWD"')!!! Adjust "g1sms.pub.key" accordingly!!! diff --git a/g1sms.pub.key~ b/g1sms.pub.key~ deleted file mode 100644 index f977874f473e08ffb2d5d262e01e3d962bba5097..0000000000000000000000000000000000000000 --- a/g1sms.pub.key~ +++ /dev/null @@ -1 +0,0 @@ -G1SM_PUBLICKEY diff --git a/shell/sms_SETUNIT.sh~ b/shell/sms_SETUNIT.sh~ deleted file mode 100755 index 895d202b6e7ed94bd4da0f473c98353f93c52766..0000000000000000000000000000000000000000 --- a/shell/sms_SETUNIT.sh~ +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -################################################################################ -# Author: Fred (support@qo-op.com) -# Version: 0.1 -# License: GPL (http://www.google.com/search?q=GPL) -################################################################################ -source /root/G1SMS/shell/init.sh -source /root/G1SMS/shell/functions.sh -log "X sms_SETUNIT.sh ($1=phone, $2=unit)" - -phone="$1" -unit="$2" -UNITFILE="./wallets/$phone/$phone.unit" - -# Initialise PHONE, PIN, PUBKEY, UNIT, HIST -sms_INIT_ACCOUNT "$phone" "NOSMS" -if [[ $result == "unknown" ]]; then - $(sms_ERROR "$phone" "Porte-monnaie inconnu. Envoyez N pour le créer.") - exit -fi - -# No unit received -if [[ $unit == "U" ]]; then - if [[ -f "$UNITFILE" ]]; then - unit=$(cat "$UNITFILE") - else - unit="LOVE"; - fi -fi - -echo "$unit" > "$UNITFILE" - -mess="[G1SMS] -Unité de votre porte-monnaie Libre: $unit" - -sms_SEND "$phone" "$mess" - -exit diff --git a/sms_received.sh~ b/sms_received.sh~ deleted file mode 100755 index 6648e2bcc46f2ab4783ff967e0b78dfed2e5d8ce..0000000000000000000000000000000000000000 --- a/sms_received.sh~ +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -################################################################################ -# Author: Fred (support@qo-op.com) -# Version: 0.1 -# License: GPL (http://www.google.com/search?q=GPL) -################################################################################ -source /root/G1SMS/shell/init.sh -source /root/G1SMS/shell/functions.sh - -#SECURITY -security - -# Get global variables from gammu-smsd -PHONE="$SMS_1_NUMBER" -TEXT="$SMS_1_TEXT" - -log "##################################" -log "$(date)" -log "SMS received $PHONE $TEXT" - -# No Reply to MySelf (or enjoy SMS LOOP of the death) -if [ "$PHONE" == "$MASTERPHONE" ]; then exit; fi - -# Extract Received Command (if new update sms_AIDE.sh) -CMD=$(echo "$TEXT" | cut -d ' ' -f 1) -log "COMMAND $CMD" - -# Handle commands -case "$CMD" in - A) - ./shell/sms_AIDE.sh "$PHONE" & - ;; - N|D) - ./shell/sms_NEW.sh "$PHONE" & - ;; - P) - DEST=$(echo "$TEXT" | cut -d ' ' -f 2) - LOVE=$(echo "$TEXT" | cut -d ' ' -f 3) - checkdest=$(echo "$DEST" | grep -E "^\-?[0-9]+$") # Test if number - checklove=$(echo "$LOVE" | grep -E "^\-?[0-9]+$") # Test number - if [[ ${#DEST} == 10 && "$checkdest" != '' && "$checklove" != '' ]]; then - ./shell/sms_PAY.sh "$PHONE" "$DEST" "$LOVE" & - else - ./shell/sms_ERROR.sh "$PHONE" "$TEXT" & - fi - ;; - C) - ./shell/sms_COUNT.sh "$PHONE" & - ;; - RIB) - NAME=$(echo "$TEXT" | cut -d ' ' -f 2) - ./shell/sms_SETRIB.sh "$PHONE" "$NAME" & - ;; - U) - UNIT=$(echo "$TEXT" | cut -d ' ' -f 2) - ./shell/sms_SETUNIT.sh "$PHONE" "$UNIT" & - ;; - Delivered|Pending) - # If delivered/pending notification come back (gammu/phone config) - exit - ;; - *) - ./shell/sms_ERROR.sh "$PHONE" "$TEXT" & - ;; -esac - -exit - diff --git a/sms_test.sh~ b/sms_test.sh~ deleted file mode 100755 index 262bd15cc508dbbf5076a3a96d0009d37789f67d..0000000000000000000000000000000000000000 --- a/sms_test.sh~ +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -echo "Trash Testeur des Scripts G1SMS ('./sms_test.sh help' => Aide)" -echo "##############################################################" - -if [[ $1 == "help" ]]; then -echo "'help' -Ce testeur permet de tester les scripts G1SMS sans déclencher l'envoi de SMS ni d'interactions avec la blockchain Duniter Ḡ1" -echo "####################################################" -echo "Surveiller l’exécution : 'tail -f /tmp/g1sms.log'" -echo "####################################################" -echo "IMPORTANT! Après utilisation, ne pas oublier de : -1. Restaurer lien Silkaj en répondant NON, ou manuellement: -rm ./silkaj/silkaj && ln -s src/silkaj.py ./silkaj/silkaj -2. Restaurer l'envoi de SMS en commentant la fonction 'gammu-smsd-inject' dans './shell/functions.sh' -3. Adapter les valeurs de './shell/init.sh' pour passer en production - -export SMS_1_NUMBER='+33600000000' -export SMS_1_TEXT='N' -./sms_received.sh - -HAPPY G1SMS" -exit -fi - - -echo "Désactiver Silkaj?? O (O/N)" -read oui -if [[ $oui == "N" ]]; then $(rm ./silkaj/silkaj && ln -s src/silkaj.py ./silkaj/silkaj); -else $(rm ./silkaj/silkaj && ln -s ../fake_silkaj.sh ./silkaj/silkaj); fi - -# Define default numbers, randomly choosen -arr[0]="+33600000000" -arr[1]="+33612345678" -rand=$[$RANDOM % ${#arr[@]}] -num=${arr[$rand]} - -rand2=$[$RANDOM % ${#arr[@]}] -num2=${arr[$rand2]} -num2="0${num2:3:10}" - -# Ask for phone number -echo "Numero ( $num ) ? " -read SMS_1_NUMBER -if [[ $SMS_1_NUMBER == "" ]]; then SMS_1_NUMBER="$num"; fi -export SMS_1_NUMBER - -# Ask for SMS text -echo "SMS ( A - N - C - U G1 - P $num2 100 ... )? A" -read SMS_1_TEXT -if [[ $SMS_1_TEXT == "" ]]; then SMS_1_TEXT="A"; fi -export SMS_1_TEXT - -$(./sms_received.sh) - - diff --git a/z_sync_smspi.sh~ b/z_sync_smspi.sh~ deleted file mode 100755 index 8a20afc65694b62b955b0fd1b5a10df09e3593ab..0000000000000000000000000000000000000000 --- a/z_sync_smspi.sh~ +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -echo "RSYNC code to smspi" -rsync -avz --progress --cvs-exclude --exclude "*.key" --exclude "wallets" --exclude "__pycache__" ~/workspace/G1SMS/ -e ssh root@smspi:/root/G1SMS/