From 79b257b11e6ae286053b62adf8c06d5b3e5fd191 Mon Sep 17 00:00:00 2001 From: James Walker Date: Sun, 22 Jan 2023 17:33:31 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20add=20dnslink-cloudflare?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 ++ pin.sh | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d0e3785..df1ba45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,8 @@ RUN set -x \ && tar -xzf "$CLUSTER_TAR" --strip-components=1 ipfs-cluster-ctl/ipfs-cluster-ctl \ && mv ipfs-cluster-ctl /usr/local/bin +RUN npm install --global dnslink-cloudflare + ADD pin.sh /usr/local/bin/pin.sh ENTRYPOINT [ "/usr/local/bin/pin.sh" ] \ No newline at end of file diff --git a/pin.sh b/pin.sh index 44df273..eef0278 100755 --- a/pin.sh +++ b/pin.sh @@ -6,12 +6,20 @@ HOST=${PLUGIN_CLUSTER_HOST:-"/dns4/cluster.walkah.cloud"} root_cid=$(ipfs-cluster-ctl \ --host "$HOST" \ --basic-auth "${PLUGIN_CLUSTER_USER}:${PLUGIN_CLUSTER_PASSWORD}" \ + $PLUGIN_CLUSTER_ARGS \ add \ --quieter \ --cid-version 1 \ - --name "${PLUGIN_PIN_NAME}" \ + --name "${PLUGIN_DOMAIN}" \ --recursive \ + --local \ $PLUGIN_EXTRA_ARGS \ "$PLUGIN_PATH" ) -echo "$root_cid" \ No newline at end of file +if [ ! -x "$PLUGIN_CF_EMAIL" ]; then + export CF_API_EMAIL=$PLUGIN_CF_EMAIL + export CF_API_KEY=$PLUGIN_CF_APIKEY + dnslink-cloudflare -d $PLUGIN_DOMAIN -l "/ipfs/${root_cid}" +fi + +echo "Deployed: $root_cid" \ No newline at end of file