Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

feat/bring that dns #84

Merged
merged 10 commits into from
Jan 22, 2017
Merged

feat/bring that dns #84

merged 10 commits into from
Jan 22, 2017

Conversation

daviddias
Copy link
Member

@daviddias daviddias commented Jan 20, 2017

@lgierth I've updated the module to support DNS and I've confirmed it works. To reproduce, npm run test:dns

Requires:

Now all we need is that Certificate and that Reverse Proxy for WebSockets :)

@daviddias daviddias added the status/in-progress In progress label Jan 20, 2017
} else {
if (ma.protos()[2].name === 'ws') {
return 'http://' + maStrSplit[3]
} else if (ma.protos()[3].name === 'wss') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong, why 2 in the ws case and 3 in the wss case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is wrong indeed (I couldn't test https without the cert)

@daviddias daviddias force-pushed the feat/bring-that-dns branch from fe1ab16 to d47197b Compare January 20, 2017 19:27
return 'https://' + maStrSplit[3]
} else {
throw new Error('invalid multiaddr' + ma.toString())
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe simplify the code to avoid issues like before.

const wsToHttp = (name) => {
  if (name === 'ws') {
    return 'http'
  } 

  if (name === 'wss') {
    return 'https'
  } 

  throw new Error('sad face')
}

const protocol = wsToHttp(ma.protos()[2].name)
return `${protocol}://${maStrSplit[3]}`


### Deployment

We have a [dokku](https://github.com/ipfs/ops-requests/issues/31) setup ready for this to be deployed, to deploy simple do (you have to have permission first):

```sh
# if you already have added the remote, you don't need to do it again
> git remote add dokku dokku@cloud.ipfs.team:webrtc-star-signalling
> git remote add dokku dokku@cloud.ipfs.team:star-signall
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo, should be star-signal I'm assuming

const maLS = '/ip4/127.0.0.1/tcp/15555'
const maGen = (base, id) => multiaddr(`/libp2p-webrtc-star${base}/ws/ipfs/${id}`)

if (process.env.DNS) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should prefix this env var so it becomes WEBRTC_START_DNS instead, just to avoid any collisions.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The currently deployed thing is called webrtc-star-signalling(.cloud.ipfs.team), is it gonna change? (No problem with that, just checking)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgierth I would like it to be shorter, like star-signal. or signal., but I'm happy with any, really.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, just make a call and deploy :) and I'll take care of setting up Let's Encrypt for all cloud.ipfs.team apps.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

» ssh dokku@cloud.ipfs.team apps
=====> My Apps
star-signal

@lgierth do your magic 🎩 :D

@daviddias
Copy link
Member Author

» ssh dokku@cloud.ipfs.team apps
=====> My Apps
star-signal

@lgierth do your magic 🎩 :D

@daviddias daviddias merged commit 5d851d3 into master Jan 22, 2017
@daviddias daviddias deleted the feat/bring-that-dns branch January 22, 2017 16:46
@daviddias daviddias removed the status/in-progress In progress label Jan 22, 2017
@ghost
Copy link

ghost commented Jan 23, 2017

Here: 🔒 https://star-signal.cloud.ipfs.team/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants