Using HashBase for DAT Hosting - xerocrypt/Misc GitHub Wiki

One of the main problems in hosting a P2P site is it's only accessible when the local machine is running and on the Internet, at least until other peers have fetched the site and are seeding it. With DAT, fortunately, there is a hosting service called 'HashBase'.

First step is to design the site in Beaker's editor. Mine is a very basic site using Bootstrap.css.

Next, register an account with HashBase.io. There isn't much in the way of account configuration here, so we can get straight to uploading the site's files. But my site wasn't accessible immediately, and I assumed that it was simply taking a while for HashBase to share the site with peers and add changes to the routing. It turned out that dat.json needed to be modified in order to enable HashBase to host it - this isn't mentioned on the Hashbase site, but instead in their documentation on GitHub.

The information for deployment is actually on their GitHub page, not the HashBase site. The following configurations need to be added to dat.json:

{

"title": "SAPPHIRE-DAT"

"dir": "./.hashbase"

"brandname": "Hashbase"

"hostame": "hashbase.local"

"port": "8080"

"csrf": "true"

"bandwidthLimit":

"up": "1mb"

"down": "1mb"

}

This was enough to make the site reachable at dat:sapphire-dat.hashbase.io after re-uploading the archive.

Probably need to add this line also: sites: per-archive

If you want to enable HTTPS, HashBase can sort the certificate provisioning if the following lines are also added:

letsencrypt:

debug: false

agreeTos: true

email: '[email protected]'

If you want to configure the way HashBase handles JSON Web Tokens for the site, add/modify the following lines:

sessions:

algorithm: HS256

secret: THIS MUST BE REPLACED!

expiresIn: 1h

References

HashBase.io HashBase @ GitHub