ENH: templatisation
This commit is contained in:
parent
bd2c4d29f9
commit
e1a5106c7b
|
@ -294,100 +294,25 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1)
|
|||
## FIRST REDIRECT PAGE ${MEDIAKEY}/index.html
|
||||
# https://tube.copylaradio.com/ipns/$IPNSLINK
|
||||
#envsubst < ./www/boris/youtube_watch_step2.html > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html
|
||||
cat >~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html <<EOF
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>$TITLE in Astroport</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="Refresh" content="7;URL=http://astroport/ipns/$IPNSLINK/${G1PUB}/">
|
||||
<link rel='stylesheet' href='/styles/astroport/style.css' type='text/css' />
|
||||
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h6>
|
||||
<a href='/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
|
||||
</h6>
|
||||
</header>
|
||||
<main>
|
||||
<article>
|
||||
|
||||
<h1>$TITLE</h1>
|
||||
cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step2.html \
|
||||
| sed "s/\${IPNSLINK}/$IPNSLINK/g" \
|
||||
| sed "s/\${XZUID}/$XZUID/g" \
|
||||
| sed "s/\${G1PUB}/$G1PUB/g" \
|
||||
| sed "s/\${TITLE}/$TITLE/g" \
|
||||
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html
|
||||
|
||||
<p>Lancement de la video dans 7 secondes...</p>
|
||||
|
||||
<p class="pubkey-and-copy-button">
|
||||
Ce fichier vous est servi par une station amie. Faites lui un don pour la remercier :
|
||||
<input type="text" id="pubkey" readonly value="${G1PUB}" />
|
||||
<button id="copy">Tip !</button>
|
||||
</p>
|
||||
|
||||
<p id="successMsg">
|
||||
La clef de la station amie est maintenant copiée dans le presse-papier. Vous pouvez la coller dans le client Ğ1 de votre choix (Cesium par exemple) afin de faire votre don 😉
|
||||
</p>
|
||||
<script>
|
||||
function copy() {
|
||||
|
||||
var copyText = document.querySelector("input#pubkey");
|
||||
copyText.select();
|
||||
document.execCommand("copy");
|
||||
|
||||
var successMsg = document.querySelector("#successMsg");
|
||||
successMsg.style.opacity = "1";
|
||||
|
||||
var copyButton = document.querySelector("button#copy");
|
||||
copyButton.style.animation = "none";
|
||||
|
||||
}
|
||||
|
||||
|
||||
document.querySelector("button#copy").addEventListener("click", copy);
|
||||
</script>
|
||||
</article>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
EOF
|
||||
|
||||
## SECOND REDIRECT PAGE ${MEDIAKEY}/${G1PUB}/index.html
|
||||
# https://tube.copylaradio.com/ipns/$IPNSLINK/${G1PUB}/
|
||||
#envsubst < ./www/boris/youtube_watch_step3.html > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
|
||||
|
||||
cat > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html <<EOF
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>$TITLE in Astroport</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel='stylesheet' href='/styles/astroport/style.css' type='text/css' />
|
||||
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h6>
|
||||
<a href='http://astroport/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
|
||||
</h6>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<article>
|
||||
<video autoplay="autoplay" controls>
|
||||
<source src="/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">
|
||||
<a href="/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">$TITLE</a>
|
||||
</video>
|
||||
|
||||
<h1 class="video-title">
|
||||
$TITLE
|
||||
</h1>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
EOF
|
||||
#envsubst < ../www/boris/youtube_watch_step3.html > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
|
||||
cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step3.html \
|
||||
| sed "s/\${TITLE}/$TITLE/g" \
|
||||
| sed "s/\${XZUID}/$XZUID/g" \
|
||||
| sed "s/\${IPFSREPFILEID}/$IPFSREPFILEID/g" \
|
||||
| sed "s/\${URLENCODE_FILE_NAME}/$URLENCODE_FILE_NAME/g" \
|
||||
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
|
||||
|
||||
|
||||
# echo "<meta http-equiv=\"Refresh\" content=\"0;URL=http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME\">" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
|
||||
|
|
Loading…
Reference in New Issue