Package: ipfs-publish
IPFS PublishContinuous Delivery of static websites from Git to IPFSAboutThis is a tool that aims to enable automatic publishing of static webpages from Git repositories into IPFS.
It consists of two parts: small web server and management CLI.Web server exposes an endpoint which you use as your Git's webhook. When the hook is invoked, it clones
your repo, build it (if needed), add it to the IPFS node (pin it if configured) and publish the new IPFS address
under configured IPNS name.CLI is in place to manage the repos.FeaturesIgnore files -.ipfs_publish_ignorefile specify entries that should be removed before adding the repo to IPFSPublish directory - you can publish only specific sub-directory inside the repoPublish specific branch - you can specify which branch should be published from the repoBuild script - before adding to IPFS you can run script/binary inside the cloned repoAfter publish script - after the publishing to IPFS, this script is run with argument of the created IPFS addressDirect DNSLink update for CloudFlare DNS providerGit providersCurrently the webhook supports generic mode, where the repo'ssecretis passed through as URL's parameter.There is also special mode for GitHub, where thesecretshould be configured as part of the Webhook's configuration.WarningThis tool is not meant as public service and only trusted Git repos should be used with it.
It can introduce serious security risk into your system as the runtime environment for the scripts is not
isolated from rest of your machine!InstallRequirementsPython 3.7 and higherGitgo-ipfs daemon (tested with version 4.23)UNIX-Like machine with public IPpipYou can install ipfs-publish directly on your machine usingpip:$pipinstallipfs-publishThen you can use the commandipfs-publishto manage your repos and/or start the webhook's server.DockerThere is official Docker image build with name:auhau/ipfs-publishEasiest way to run ipfs-publish is with docker-compose. Here is example for its configuration:version:'3'services:ipfs:image:ipfs/go-ipfs:v0.4.23volumes:-/data/ipfs# or you can mount it directly to some directory on your systemipfs-publish:image:auhau/ipfs-publishenvironment:IPFS_PUBLISH_CONFIG:/data/ipfs_publish/config.tomlIPFS_PUBLISH_VERBOSITY:3IPFS_PUBLISH_IPFS_HOST:ipfsIPFS_PUBLISH_IPFS_PORT:5001volumes:-/data/ipfs_publishdepends_on:-ipfsports:-8080:8000For more information seedocumentation.Usage# Add new repo$ipfs-publishadd[?]GitURLoftherepo:https://github.com/auhau/auhau.github.io[?]Nameofthenewrepo:github_com_auhau_auhau_github_io[?]DoyouwanttopublishtoIPNS?(Y/n):[?]Pathtobuildbinary,ifyouwanttodosomepre-processingbeforepublishing:[?]Pathtoafter-publishbinary,ifyouwanttodosomeactionsafterpublishing:[?]Directorytobepublishedinsidetherepo.Pathrelatedtotherootoftherepo:/

Successfullyaddednewrepo!
UsethisURLforyouwebhook:http://localhost:8080/publish/github_com_auhau_auhau_github_io
Alsosetthisstringasyourhook'sSecret:NIHT4785CVFT358GFE08RDAZG
YourIPNSaddress:/ipns/QmRTqaW3AJJXmKyiNT7MqqZ4VjGtNNxPyTkgo3Q7pmoCeX/# List current enabled repos$ipfs-publishlist
github_com_auhau_auhau_github_io# Show details of repo$ipfs-publishshowgithub_com_auhau_auhau_github_io
github_com_auhau_auhau_github_io
GitURL:https://github.com/auhau/auhau.github.io
Secret:EAHJ43UYT7LUEM4QFRZ4IFAXL
IPNSkey:ipfs_publishg_github_com_auhau_auhau_github_io
IPNSlifetime:24h
IPNSttl:15m
IPNSaddress:/ipns/QmRTqaW3AJJXmKyiNT7MqqZ4VjGtNNxPyTkgo3Q7pmoCeX/
LastIPFSaddress:None
Webhookaddress:http://localhost:8080/publish/github_com_auhau_auhau_github_io# You can manually publish repo$ipfs-publishpublishgithub_com_auhau_auhau_github_io# Starts HTTP server & IPNS republishing service$ipfs-publishserver&Runningonhttp://localhost:8080(CTRL+Ctoquit)ContributingFeel free to dive in, contributions are welcomed!Open an issueor submit PRs.For PRs and tips about development please seecontribution guideline.LicenseMIT ©  Adam Uhlir