telebit-relay.js/README.md

125 lines
3.0 KiB
Markdown
Raw Normal View History

2018-05-23 11:12:39 +00:00
# Telebit Relay
2016-09-30 22:49:08 +00:00
2018-05-23 11:12:39 +00:00
Friends don't let friends localhost™
A server that works in combination with [Telebit Remote](https://git.coolaj86.com/coolaj86/telebit.js)
2016-09-30 22:49:08 +00:00
to allow you to serve http and https from any computer, anywhere through a secure tunnel.
2018-05-23 11:12:39 +00:00
| Sponsored by [ppl](https://ppl.family) | **Telebit Relay** | [Telebit Remote](https://git.coolaj86.com/coolaj86/telebit.js) |
2018-05-15 07:49:27 +00:00
2018-05-23 11:12:39 +00:00
Features
========
2016-09-30 22:49:08 +00:00
2018-05-23 11:12:39 +00:00
* [x] Expose your bits even in the harshest of network environments
* [x] NAT, Home Routers
* [x] College Dorms, HOAs
* [x] Corporate Firewalls, Public libraries, Airports
* [x] and even Airplanes, yep
* [x] Automated HTTPS (Free SSL)
2016-09-30 22:49:08 +00:00
2018-05-23 11:12:39 +00:00
Install
=======
Mac & Linux
-----------
Open Terminal and run this install script:
2016-09-30 22:49:08 +00:00
```bash
2018-05-23 11:12:39 +00:00
curl -fsS https://get.telebit.cloud/ | bash
2016-09-30 22:49:08 +00:00
```
2018-05-23 11:12:39 +00:00
This will install Telebit Relay to `/opt/telebitd` and
put a symlink to `/opt/telebitd/bin/telebitd` in `/usr/local/bin/telebitd`
for convenience.
2017-10-04 23:37:07 +00:00
2018-05-23 11:12:39 +00:00
You can customize the installation:
2017-10-04 23:37:07 +00:00
2018-05-23 11:12:39 +00:00
```bash
export NODEJS_VER=v8.11.2
2018-05-23 11:12:39 +00:00
export TELEBITD_PATH=/opt/telebitd
curl -fsS https://get.telebit.cloud/ | bash
```
2018-04-24 01:49:56 +00:00
2018-05-23 11:12:39 +00:00
This will change which version of node.js is bundled with Telebit Relay
and the path to which Telebit Relay installs.
2018-04-24 01:49:56 +00:00
2018-05-23 11:12:39 +00:00
Windows & Node.js
-----------------
2018-04-24 01:49:56 +00:00
2018-05-23 11:12:39 +00:00
1. Install [node.js](https://nodejs.org)
2. Open _Node.js_
2. Run the command `npm install -g telebitd`
2016-09-30 22:49:08 +00:00
2018-05-23 11:12:39 +00:00
**Note**: Use node.js v8.x or v10.x
2016-09-30 22:49:08 +00:00
2018-05-23 11:12:39 +00:00
There is [a bug](https://github.com/nodejs/node/issues/20241) in node v9.x that causes telebitd to crash.
2016-09-30 22:49:08 +00:00
2018-05-23 11:12:39 +00:00
Service Install
===
2016-09-30 22:49:08 +00:00
2018-05-23 11:12:39 +00:00
TODO automate this:
`./dist/etc/systemd/system/telebitd.service` should be copied to `/etc/systemd/system/telebitd.service`.
2016-09-30 22:49:08 +00:00
2018-05-23 11:12:39 +00:00
The user and group `telebit` should be created.
**Privileged Ports without sudo**:
2016-10-01 06:39:20 +00:00
```bash
# Linux
sudo setcap 'cap_net_bind_service=+ep' $(which node)
```
2018-05-23 11:12:39 +00:00
Usage
====
2016-09-30 22:49:08 +00:00
2018-05-23 11:12:39 +00:00
```bash
telebitd --config /etc/telebit/telebitd.yml
```
2016-09-30 22:49:08 +00:00
2018-05-23 11:12:39 +00:00
Options
2016-09-30 22:49:08 +00:00
2018-05-23 11:12:39 +00:00
`/etc/telebit/telebitd.yml:`
```
servernames:
- telebit.example.com
- telebit.example.net
email: 'jon@example.com'
agree_tos: true
community_member: true
secret: 'xxxyyyzzzaaabbbccc'
```
2016-09-30 22:49:08 +00:00
Security
========
The bottom line: As with everything in life, there is no such thing as anonymity
2018-05-23 11:12:39 +00:00
or absolute security. Only use Telebit Relays that you trust or self-host. :D
2016-09-30 22:49:08 +00:00
2018-05-23 11:12:39 +00:00
Even though the traffic is encrypted end-to-end, you can't just trust any Telebit Relay
2016-09-30 22:49:08 +00:00
willy-nilly.
2018-05-23 11:12:39 +00:00
A man-in-the-middle attack is possible using Let's Encrypt since an evil Telebit Relay
2016-09-30 22:49:08 +00:00
would be able to complete the http-01 and tls-sni-01 challenges without a problem
(since that's where your DNS is pointed when you use the service).
Also, the traffic could still be copied and stored for decryption is some era when quantum
computers exist (probably never).
2018-05-23 11:12:39 +00:00
Why?
====
We created this for anyone to use on their own server or VPS,
but those generally cost $5 - $20 / month and so it's probably
cheaper to purchase data transfer (which we supply, obviously),
which is only $1/month for most people.
TODO show how to do on
* Node WS Tunnel (zero setup)
* Heroku (zero cost)
* Chunk Host (best deal per TB/month)