AstXbian ipfs sharing
This commit is contained in:
parent
418b0a27bb
commit
5846b4607b
14
ISOconfig.sh
14
ISOconfig.sh
|
@ -82,19 +82,19 @@ mv /tmp/config.ipfs ~/.ipfs/config
|
||||||
# WRITE ~/.zen/ipfs.sync CONFIG
|
# WRITE ~/.zen/ipfs.sync CONFIG
|
||||||
echo "IPFS_SYNC_DIR=$IPFS_sync_directory" > ~/.zen/ipfs.sync
|
echo "IPFS_SYNC_DIR=$IPFS_sync_directory" > ~/.zen/ipfs.sync
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
echo "INIT ~/.zen/ipfs/.${IPFSNODEID}"
|
||||||
|
########################################################################
|
||||||
|
rm -Rf ~/.zen/ipfs
|
||||||
|
mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB
|
||||||
########################################################################
|
########################################################################
|
||||||
# Give $(hostname)-$ZUID to your (gchange friends) to add in Vstream Astroport and access your sharings
|
# Give $(hostname)-$ZUID to your (gchange friends) to add in Vstream Astroport and access your sharings
|
||||||
# IPNS link to "pastebin list" http://localhost:8080/ipns/$IPNSKEY/xbian/$(hostname)-$ZUID
|
# IPNS link to "pastebin list" http://localhost:8080/ipns/$IPNSKEY/xbian/$(hostname)-$ZUID
|
||||||
########################################################################
|
########################################################################
|
||||||
ZUID=$(~/.zen/astroport/zen/tools/diceware.sh 1 | xargs)$(hostname -I | cut -d ' ' -f 1 | cut -d "." -f 4 )
|
ZUID=$(~/.zen/astroport/zen/tools/diceware.sh 1 | xargs)$(hostname -I | cut -d ' ' -f 1 | cut -d "." -f 4 )
|
||||||
echo "CREATE ~/.zen/ipfs/xbian/$(hostname)-$ZUID"
|
echo "CREATE ~/.zen/ipfs/xbian/$(hostname)-$ZUID"
|
||||||
touch ~/.zen/ipfs/xbian/$(hostname)-$ZUID # https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films
|
touch ~/.zen/ipfs/xbian/$(hostname)-$ZUID
|
||||||
|
# https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films
|
||||||
########################################################################
|
|
||||||
echo "INIT ~/.zen/ipfs/.${IPFSNODEID}"
|
|
||||||
########################################################################
|
|
||||||
mkdir -Rf ~/.zen/ipfs
|
|
||||||
mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB
|
|
||||||
echo "$(hostname)-$ZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid
|
echo "$(hostname)-$ZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
|
@ -95,6 +95,12 @@ fi
|
||||||
[[ $(($minute % 12)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/gchange_IPFS_swarm.sh &
|
[[ $(($minute % 12)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/gchange_IPFS_swarm.sh &
|
||||||
[[ $(($minute % 15)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/ipfs_SWARM_refresh.sh &
|
[[ $(($minute % 15)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/ipfs_SWARM_refresh.sh &
|
||||||
|
|
||||||
|
# Transfert ~/astroport/files to IPFS and make Astroport(pastebin) index for Xbian/Vstream
|
||||||
|
if [[ "$timebar" == "03:03" ]]; then
|
||||||
|
$MY_PATH/zen/xbian_vstream.sh &
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## TODO investigate could breaks "ipfs p2p" forwards ?
|
## TODO investigate could breaks "ipfs p2p" forwards ?
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
#!/bin/bash
|
||||||
|
########################################################################
|
||||||
|
# Author: Fred (support@qo-op.com)
|
||||||
|
# Version: 2020.12.05
|
||||||
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||||
|
########################################################################
|
||||||
|
# Transfert ~/astroport/files to IPFS and create Astroport(pastebin) index for Xbian/Vstream
|
||||||
|
########################################################################
|
||||||
|
[[ -f ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid ]] && echo "ERROR no _xbian.zuid" && exit 1
|
||||||
|
|
||||||
|
# GET xbian-ZUID
|
||||||
|
XZUID=$(cat ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid)
|
||||||
|
|
||||||
|
# CREATE Vstream/Pastebin file format
|
||||||
|
# https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films
|
||||||
|
|
||||||
|
ASHARE=$(ipfs add -rq ~/astroport/ | tail -n 1)
|
||||||
|
|
||||||
|
[[ $ASHARE == "" ]] && echo "ERROR adding ~/astroport to IPFS" && exit 1
|
||||||
|
|
||||||
|
echo "TITLE;URLS" > ~/.zen/ipfs/xbian/$XZUID
|
||||||
|
for file in ~/astroport/*
|
||||||
|
do
|
||||||
|
filename=$(basename -- "$file")
|
||||||
|
extension="${filename##*.}"
|
||||||
|
filena="${filename%.*}"
|
||||||
|
echo "$filena;http://localhost:8080/ipfs/$ASHARE/$filename"
|
||||||
|
echo "$filena;http://localhost:8080/ipfs/$ASHARE/$filename" >> ~/.zen/ipfs/xbian/$XZUID
|
||||||
|
done
|
Loading…
Reference in New Issue