forked from axiom-team/astrXbian
zurl IPFS or IPNS
This commit is contained in:
parent
75ffc4244b
commit
ef48f249db
@ -58,12 +58,19 @@ do
|
|||||||
## USE .ipfs.filelink
|
## USE .ipfs.filelink
|
||||||
if [[ -f ~/.zen/ipfs_swarm/.${ipfnodesource}/KEY/${mediakey}/${g1pubsource}/${G1PUB}/.ipfs.filelink.encrypt ]]; then
|
if [[ -f ~/.zen/ipfs_swarm/.${ipfnodesource}/KEY/${mediakey}/${g1pubsource}/${G1PUB}/.ipfs.filelink.encrypt ]]; then
|
||||||
$MY_PATH/tools/natools.py decrypt -f pubsec -k "$HOME/.zen/secret.dunikey" -i "$HOME/.zen/ipfs_swarm/.${ipfnodesource}/KEY/${mediakey}/${g1pubsource}/${G1PUB}/.ipfs.filelink.encrypt" -o "/tmp/filelink_$mediakey.txt"
|
$MY_PATH/tools/natools.py decrypt -f pubsec -k "$HOME/.zen/secret.dunikey" -i "$HOME/.zen/ipfs_swarm/.${ipfnodesource}/KEY/${mediakey}/${g1pubsource}/${G1PUB}/.ipfs.filelink.encrypt" -o "/tmp/filelink_$mediakey.txt"
|
||||||
|
hipfs=$(cat /tmp/filelink_$mediakey.txt | cut -d '/' -f 3)
|
||||||
|
gname="$(cat /tmp/filelink_$mediakey.txt | cut -d '/' -f 4 | jq -Rr @uri)"
|
||||||
|
zurl="https://$mynodename/ipfs/$hipfs/$gname"
|
||||||
|
else
|
||||||
|
echo ".ipfs.filelink.encrypt is missing"
|
||||||
|
ipnsid=$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/KEY/$mediakey/$g1pubsource/.ipns.link)
|
||||||
|
zurl="https://$mynodename/ipns/$ipnsid"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 1=DIY, Habiter=2, Guerir=3, Divertir=4, Déplacer=5, Energie=6, Cultiver=7
|
# 1=DIY, Habiter=2, Guerir=3, Divertir=4, Déplacer=5, Energie=6, Cultiver=7
|
||||||
cd /var/www/wordpress/
|
cd /var/www/wordpress/
|
||||||
# isWPuser=$(wp user list | grep "$xzuid")
|
# isWPuser=$(wp user list | grep "$xzuid")
|
||||||
wp post create --post_author="$xzuid" --post_content="<h1><a href=\"https://$mynodename$(cat /tmp/filelink_$mediakey.txt | jq -Rr @uri)\" target=\"_blank\" rel=\"noreferrer noopener\">$title</a></h1><p>$description</p>" --post_title="$title" --post_excerpt="$description" --post_category="105" --tags_input="$tags" --porcelain
|
wp post create --post_author="$xzuid" --post_content="<h1><a href=\"$zurl\" target=\"_blank\" rel=\"noreferrer noopener\">$title</a></h1><p>$description</p>" --post_title="$title" --post_excerpt="$description" --post_category="105" --tags_input="$tags" --porcelain
|
||||||
|
|
||||||
# REPLY IN ~/.zen/ipfs/.$ipfnodesource/astroport/wordpress/$mediakey/done
|
# REPLY IN ~/.zen/ipfs/.$ipfnodesource/astroport/wordpress/$mediakey/done
|
||||||
responsedir="$(echo "$wpcall" | sed 's/ipfs_swarm/ipfs/g')"
|
responsedir="$(echo "$wpcall" | sed 's/ipfs_swarm/ipfs/g')"
|
||||||
|
Loading…
Reference in New Issue
Block a user