Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Using Dat with a github.io domain

https://i.imgur.com/akOrIOq.png

My personl site is hosted at hashbase.io (link) so that you can access it via dat and https. My canonical dat url is dat://pfrazee.hashbase.io.

Before I used hashbase I used Github Pages, and today it dawned on me that I can have dat://pfrazee.github.io work too. It's pretty simple if you know the dat dns spec.

All I had to do was add /.well-known/dat to my site (click to view). I put the raw dat URL of my site in that file, along with a TTL.

dat://40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755896cdeb80bd2f9/
TTL=3600

I'm still hosted at hashbase.io, but the dat site is "available" at the github.io domain now too!

@millette
Copy link

millette commented Jul 10, 2017

Seems you also need to edit _config.yml and add

include: [".well-known"]

@millette
Copy link

millette commented Jul 10, 2017

At the minimum, you need that single line in a _config.yml file. You can see my basic example here: https://github.com/millette/millette.github.io/.

@pfrazee
Copy link
Author

pfrazee commented Jul 10, 2017

^ Millette is right, sorry folks

@specious
Copy link

specious commented Dec 26, 2017

Just got it working thanks to @millette's great advice!

Right away, Beaker Browser advertises "P2P version available" on https://specious.github.io and dat://specious.github.io works as a URL.

Big thanks to @cmrberry from GitHub support for helping me figure this out, as I was perplexed why it wasn't working when I only added the .well-known/dat file.

@millette
Copy link

millette commented Mar 1, 2018

Also note that it probably won't work for custom domains, since github doesn't (yet) support https for those.

Details: isaacs/github#156 (comment)

@ChildishGiant
Copy link

ChildishGiant commented Apr 7, 2018

Is there any way to get this to work on a project page? I have the dat file in place at https://childishgiant.github.io/perdola/.well-known/dat and also the _config.yml in place but the button to switch isn't appearing.

@KarlesP
Copy link

KarlesP commented Jul 12, 2018

@ChildishGiant did you get it to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment