noxz-sites

A collection of a builder and various scripts creating the noxz.tech sites
git clone https://noxz.tech/git/noxz-sites.git
Log | Files | README | LICENSE

commit: 1ecd90413bd8ad49522273ebeb31c0b56b89f310
parent: 94b3406910a58c5fb710181ae15a0272d6ee56f5
author: Chris Noxz <chris@noxz.tech>
date:   Fri, 22 Jul 2022 11:02:03 +0200
no longer using ipfs for site
MMakefile5---
Dipfs-publish43--------------------
2 files changed, 48 deletions(-)
diff --git a/Makefile b/Makefile
@@ -19,11 +19,6 @@ publish:
 	@[ -f "${ASSEMBLE_TAR}" ] || { echo "'${ASSEMBLE_TAR}' is missing, must build first"; exit 1; }
 	@./publish "${ASSEMBLE_TAR}" "${PUBLISH_PATH}"
 
-ipfs:
-	@echo publishing to IPFS...
-	@[ -f "${ASSEMBLE_TAR}" ] || { echo "'${ASSEMBLE_TAR}' is missing, must build first"; exit 1; }
-	@./ipfs-publish "${ASSEMBLE_TAR}"
-
 clean:
 	@echo cleaning
 	@find ./noxz.tech/ -name '*.html' -type f -exec sh -ec 'rm "$$0"' {} \;
diff --git a/ipfs-publish b/ipfs-publish
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-# extract site
-tmpdir="$(mktemp -d /tmp/.noxz.tech.sites.XXXXXX)"
-tar -xf "${1}" -C "$tmpdir" \
-&& echo "noxz.tech extracted to '$tmpdir'"
-
-if [ $? -eq 0 ]; then
-	# publish to IPFS
-	ipfshash="$(ipfs add -Qr "$tmpdir/noxz.tech")" \
-	&& echo "new hash is '$ipfshash'"
-
-	if [ $? -eq 0 ]; then
-		# add to MFS
-		ipfs files rm -r /noxz.tech
-		ipfs files cp /ipfs/$ipfshash /noxz.tech
-
-		# pin hash to pinata
-		curl                                                                \
-		-H "Content-Type: application/json"                                 \
-		-H "pinata_api_key: $(pass ipfs/pinata.cloud/api/key)"              \
-		-H "pinata_secret_api_key: $(pass ipfs/pinata.cloud/api/secret)"    \
-		-X POST                                                             \
-		-d "{
-			\"pinataMetadata\": {
-				\"name\": \"noxz.tech\"
-			},
-			\"hashToPin\": \"$ipfshash\"
-		}" https://api.pinata.cloud/pinning/pinByHash
-
-		# publish new DNS record
-		pass ipfs/updateZoneRecord/script | sh -s "$ipfshash"
-	fi
-fi
-
-# remove site extraction
-rm -rf "$tmpdir"
-
-# publish to IPNS
-if [ ! -z $ipfshash ]; then
-	echo "publishing to IPNS..."
-	ipfs name publish --key=noxz.tech "$ipfshash"
-fi