no matomo

This commit is contained in:
fred 2023-10-09 10:52:18 +02:00
parent 998af2376d
commit 6e62165480
5 changed files with 29 additions and 56 deletions

View File

@ -133,7 +133,16 @@ while true; do
if [[ $URL == "/" ]]; then
echo "/ CONTACT : $HOSTP"
mySalt | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
if [ -z "$isLAN" ]; then
echo $(mySalt) | \
sed "s~http://127.0.0.1:12345~http://${myIP}:${PORT}~g" | \
sed "s~http://${myIP}:${PORT}~${myASTROPORT}/${PORT}~g" | \
nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
else
echo $(mySalt) | \
sed "s~http://127.0.0.1:12345~http://${myIP}:${PORT}~g" | \
nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
fi
#~ echo "$HTTPCORS
#~ <html>

View File

@ -18,10 +18,10 @@ PEPPER="$2"
PLAYER="$3"
PSEUDO="$4"
## Fill UP TW with VIDEO URL
## Fill UP TW with VIDEO URL or UMAP NS
URL="$5"
## UPLANET PLAYER
## UPLANET SECTOR
LAT="$6"
LON="$7"
@ -29,19 +29,20 @@ LON="$7"
YOU=$(myIpfsApi);
LIBRA=$(head -n 2 ${MY_PATH}/../A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2)
################################################################################
## LIST TW MODELS
################################################################################
TWMODEL="/ipfs/bafybeiaaf52awrqliwn5mqleua6tcv4qv5oxjfa6j2web6nh42vzdtjkiu"
# ipfs cat $TWMODEL > templates/twdefault.html
MINIMAL="/ipfs/bafybeidp2vvvtdi3hdq3tknwfzuhjqqa6tfkepc233bdr2rg2ws4qnbvum"
# ipfs cat $MINIMAL > templates/minimal.html
################################################################################
## CHECK if PLAYER resolve any ASTRONAUTENS
#~ [[ ${PLAYER} ]] && ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
#~ [[ ${ASTRONAUTENS} ]] && echo "WARNING IPNS ${PLAYER} EXISTANT ${myIPFS}/ipns/${ASTRONAUTENS} - EXIT -" && exit 0
mkdir -p ~/.zen/tmp/${MOATS}/TW
## Chargement TW !!!
if [[ $SALT != "" && PEPPER != "" ]]; then
ASTRO=""
## Creating SALT/PEPPER IPNS KEY
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/player.key "$SALT" "$PEPPER" 2>/dev/null
ASTRONAUTENS=$(ipfs key import ${MOATS} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/player.key 2>/dev/null)
# echo "/ipns/${ASTRONAUTENS}"
@ -57,6 +58,7 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
&& read ENTER \
&& [[ $ENTER != "" ]] && rm ~/.zen/tmp/${MOATS}/TW/index.html
# EXTEND SEARCH IN WEB2.0
#~ [[ ! -s ~/.zen/tmp/${MOATS}/TW/index.html ]] \
#~ && echo "Trying curl on $LIBRA" \
#~ && curl -m 30 -so ~/.zen/tmp/${MOATS}/TW/index.html "$LIBRA/ipns/${ASTRONAUTENS}"
@ -65,11 +67,7 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
## AUCUN RESULTAT
if [ ! -s ~/.zen/tmp/${MOATS}/TW/index.html ]; then
ipfs key rm ${MOATS} 2>/dev/null ## CLEANING
#~ echo "CREATION TW Astronaute" ## Nouveau Compte Astronaute
#~ echo
#~ echo "***** Activation du Canal TW Astronaute ${PLAYER} *****"
# COPY TW TEMPLATE
[[ ${LON} && ${LAT} ]] \
&& cp ${MY_PATH}/../templates/minimal.html ~/.zen/tmp/${MOATS}/TW/index.html \
|| cp ${MY_PATH}/../templates/twdefault.html ~/.zen/tmp/${MOATS}/TW/index.html
@ -102,18 +100,13 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
fi
ipfs key rm ${MOATS} 2>/dev/null ## CLEANING
fi
ipfs key rm ${MOATS} 2>/dev/null ## CLEANING MOATS KEY
fi
################################################################################
TWMODEL="/ipfs/bafybeiaaf52awrqliwn5mqleua6tcv4qv5oxjfa6j2web6nh42vzdtjkiu"
# ipfs cat $TWMODEL > templates/twdefault.html
MINIMAL="/ipfs/bafybeidp2vvvtdi3hdq3tknwfzuhjqqa6tfkepc233bdr2rg2ws4qnbvum"
# ipfs cat $MINIMAL > templates/minimal.html
##################################################### # NEW PLAYER ###############
################################################################################
#~ echo "=============================================
@ -148,8 +141,8 @@ PLAYER=${PLAYER,,}
[[ ! $PSEUDO ]] && PSEUDO="Anonymous"
# echo "Crypto ID PLAYER :"; sleep 1; echo "${PLAYER}"; sleep 2
# 6 DIGIT PASS CODE TO PROTECT QRSEC
PASS=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-7)
# 4 DIGIT PASS CODE TO PROTECT QRSEC
PASS=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-5)
############################################################
######### TODO Ajouter d'autres clefs IPNS, GPG ?
@ -508,13 +501,13 @@ echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "$(${MY_PATH}/../tools/face.sh cool)"
echo " 'Astronaute' $PSEUDO"
echo
echo "* Public Key : G1Visa
echo "* G1Visa : Public Key and Wallet
${NID}/ipns/${ASTRONAUTENS}#G1Visa"
echo " "
echo "* AstroID : G1Card with PASS : $PASS"
echo "${NID}/ipns/${ASTRONAUTENS}#AstroID"
echo
echo "* UMap_$LAT_$LON
echo "* UMap registration : ${LAT}, ${LON}
${myIPFS}${URL}"
echo
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"

View File

@ -232,20 +232,5 @@ function testLatency(cb) {
}
// promptUser();
</script>
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//g1sms.fr/matomo/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
</html>

View File

@ -420,7 +420,8 @@ myIP="$(myIp)" # "127.0.0.1"
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
myUPLANET="https://ipfs.copylaradio.com/ipns/copylaradio.com"
myUPLANET="https://ipfs.copylaradio.com/ipns/copylaradio.com" ## WRITE IPFS GATEWAY
myLIBRA="https://ipfs.asycn.io" ## READ IPFS GATEWAY
myASTROPORT="http://astroport.localhost:1234"
myASTRONEF="http://astroport.localhost:1234"

View File

@ -297,20 +297,5 @@ a {
}, 3000); // 👈️ delay in milliseconds
</script>
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//g1sms.fr/matomo/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
</body></html>