Commit Graph

90 Commits

Author SHA1 Message Date
Willem Grobler
a7fccf99ff Merge branch 'boringproxy:master' into update-upstream 2022-02-25 07:46:42 +02:00
Anders Pitman
197e202d69 Implement raw server TLS tunnels
Also cleaned up things a bit by moving the ProxyTcp logic into
a separate file and sharing it between the client and server.
2022-02-24 14:12:09 -07:00
Willem@105.pve1.lan
60ba341205 print web UI token (fix after v0.9.0 changes) 2022-02-24 18:57:14 +02:00
Anders Pitman
3b639adec8 Fix client TLS bug
Wasn't properly handling the ACME protocol for raw TLS tunnels.
2022-02-23 17:30:02 -07:00
Willem@105.pve1.lan
58a2727f84 accept-ca-terms 2022-02-23 12:33:36 +02:00
Anders Pitman
d90342bd60 Merge pull request #160 from dmahmalat/db-dir-flag
Add db-dir to specify where to save boringproxy_db.json
2022-02-22 11:52:50 -07:00
Dany Mahmalat
32d2ef14ee Add db-dir to specify where to save boringproxy_db.json 2022-02-21 14:32:31 -05:00
Dany Mahmalat
7b2d4cffcb Add acme-email flag to server 2022-02-21 14:29:08 -05:00
Anders Pitman
b7dd326c96 Fix token bug
When creating a fresh DB, it was setting the first token client
to "any" instead of "", which prevented initial login.
2022-02-19 08:45:38 -07:00
Anders Pitman
4ca1b5959d Merge branch 'master' into limit-tokens 2022-02-17 14:09:34 -07:00
Anders Pitman
ca6667cede Add flag to use Let's Encrypt staging 2022-02-17 14:08:32 -07:00
Anders Pitman
6f12fc2633 Support IPv6 for namedrop records 2022-02-16 12:45:55 -07:00
Anders Pitman
0a23c2fc0e Limit token permissions
Added the ability to scope tokens to a specific client. If
enabled, this has the affect of limiting the token to being used
to list tunnels for that specific client. It can't be used for
the web UI or for any state-changing actions such as creating
new tunnels.
2022-02-16 11:44:24 -07:00
Anders Pitman
272acb9d95 Merge branch 'master' of github.com:boringproxy/boringproxy into raw-tls-tunnels 2022-02-14 12:37:06 -07:00
Willem@105.pve1.lan
7d740b7c31 proxyRequest with ClientAddress and not localhost 2022-02-14 17:38:52 +02:00
Anders Pitman
3be1f0b48c Implement raw TLS tunnels
My testing shows this works for WebSockets.
2022-02-11 13:04:59 -07:00
Anders Pitman
28a919f861 Implement IPv6 support for logs 2022-02-11 12:27:36 -07:00
Anders Pitman
6bfa3e9a47 Only use X-Forwarded-For if not behind proxy
Since you can't trust it when it comes directly from clients.
2022-01-07 12:33:43 -07:00
Anders Pitman
85902ca944 Allow manually setting public IP 2022-01-05 22:49:42 -07:00
Anders Pitman
e5cee3bbb9 Warning instead of fail if no public IP 2022-01-05 22:42:11 -07:00
Anders Pitman
7b4d8c40c0 Update to namedrop 0.3.0 2022-01-04 21:01:33 -07:00
Anders Pitman
af4ec03240 Improve admin domain UI
Print QR code for TakingNames.io link
2022-01-04 18:29:33 -07:00
Anders Pitman
a17c04fc15 Fix typo 2022-01-02 00:22:28 -07:00
Anders Pitman
d2ad2571f5 Automatically log in after getting admin domain 2022-01-02 00:20:41 -07:00
Anders Pitman
46bb670b8f Disable ACME when using custom ports
LetsEncrypt currently only supports ports 80/443 for ACME, so if
custom ports are used we need to disable automatically getting
certs.

Also changed it to only emit a warning when ports aren't
reachable from the internet, rather than failing.
2022-01-01 16:32:51 -07:00
Anders Pitman
20eeeb53e9 Move a bunch more code into namedrop 2021-12-30 22:05:29 -07:00
Anders Pitman
f8281d95a4 Move some stuff into namedrop library 2021-12-30 20:57:28 -07:00
Anders Pitman
f087863a4b Remove remaining dnsapi code 2021-12-30 17:20:55 -07:00
Anders Pitman
ca885d3a02 Implement creating records with namedrop 2021-12-30 16:43:13 -07:00
Anders Pitman
42f0580690 Move namdrop into separate library 2021-12-30 14:52:59 -07:00
Anders Pitman
988bb37bad First draft namedrop API integration 2021-12-30 01:00:52 -07:00
Anders Pitman
ad133cb4bb Use TakingNames.io to get public IP
Keepin it in the family
2021-12-23 14:10:18 -07:00
Anders Pitman
a3140efb20 Implement domain request failure 2021-12-21 15:18:08 -07:00
Anders Pitman
53946e878f Removed unused tunMan from ui_handler.go 2021-12-21 14:05:14 -07:00
Anders Pitman
38cb381051 HTTPS by default, but allow HTTP 2021-12-20 22:37:50 -07:00
Anders Pitman
30358d7808 Implement binding non-default ports
Can now bind to ports other than 80/443, using the -http-port and
-https-port arguments.

Assuming you already have the certs you need, HTTPS even works.

Unfortunately you can't get the certs automatically because
LetsEncrypt doesn't support ports other than 80/443 as far as I
know.
2021-12-20 12:56:50 -07:00
Anders Pitman
8f39130674 Add QR code to printed login info 2021-12-20 00:46:26 -07:00
Anders Pitman
7c6077a0fe Implement admin domain with bootstrap domain
TakingNames.io now provides bootstrap domains, which simply
creates an A record based off the ip address of the requesting
server, without requiring any authorization. This allows
boringproxy to always use HTTPS, even when getting the admin
domain.
2021-12-19 21:24:52 -07:00
Anders Pitman
49c467f85c Rename webdo to dnsapi
Still need a better name
2021-12-19 17:08:11 -07:00
Anders Pitman
5db952a069 Improve security of TakingNames.io integration
The requests themselves now must be retrieve from the boringproxy
server by TakingNames.io, over HTTPS. This provides several
security benefits:

* You can tell the user the request is coming from a specific
  domain.
* Requests are tied to an ephemeral request-id, to prevent
  prebuilt phishing links.

There is currently a single hard-coded exception for setting a
single A record for an IP address. This is needed for
bootstrapping a service that doesn't have any certs yet (ie the
boringproxy admin domain), and will need to display a big scary
message to users.
2021-12-18 17:40:59 -07:00
Anders Pitman
5b4c148bec Implement TakingNames.io integration
For getting the admin domain. This is particularly nice since it
works using just the IP address over plain HTTP.
2021-12-17 22:18:55 -07:00
Anders Pitman
4093472109 Enable ACME http-01 challenge
Only for server TLS termination
2021-12-17 20:26:20 -07:00
Anders Pitman
aa6ab77a05 Verify public IP on startup
Currently checks to make sure ports 80 and 443 are accessible.
Using api.ipify.org to determine public IP. Need to add fallbacks
in case that fails.
2021-12-15 14:33:01 -07:00
Anders Pitman
4150f87aec Merge branch 'update-master' into merge-upstream 2021-01-06 10:22:11 -07:00
Anders Pitman
abe36a58d1 Merge pull request #29 from arp242/admin-domain
Use "fmt.Print()" instead of "log.Print()" when asking for admin domain
2021-01-05 09:31:16 -07:00
Martin Tournoij
384b42ef54 Use "fmt.Print()" instead of "log.Print()" when asking for admin domain
When using "boringproxy server" it asks for the admin domain. All grand,
but it looks rather strange:

	2021/01/05 22:11:05 Starting up
	2021/01/05 22:11:05 Enter Admin Domain:
	[cursor is here]

It wasn't really clear to me this was asking a question, as it includes
the date like a log message and the cursor is on the next line.

So, change it to just fmt.Print()

Maybe the "starting up" should also be moved a bit further down, but
that would conflict with my other PR 🙃
2021-01-05 22:12:25 +08:00
Martin Tournoij
a67253c55a Add usage information
Before not giving any command didn't really give much feedback beyond
"invalid arguments". This adds a basic usage message, and tells people
that you can use "boringproxy server -h".

I moved the "Starting up" log message because otherwise that would get
printed when asking for "server -h".

I also added error checks for the flag parsing; I think this isn't
*strictly* needed, but I remember running in to problems once by
omitting it (although I've forgotten what that problem was, exactly).
2021-01-05 22:04:08 +08:00
Anders Pitman
20f7d53c0f Rename instances of BoringProxy
Full name isn't necessary now that it's a library.

BoringProxy -> Server
BoringProxyClient -> Client
BoringProxyConfig -> Config
2020-12-07 21:50:33 -07:00
Anders Pitman
45f609b8ba Move executable into separate package
Enables us to move towards being able to import as a library.
2020-12-07 21:41:45 -07:00
Anders Pitman
140c102c32 Implement specifying cert directory
Also fixed a bug where client TLS termination was failing to get
new certs I believe because the TLS listener hadn't started up
yet. I didn't notice it before because I'm running the client and
server on the same machine and the server currently gets certs on
startup even for non-server TLS tunnels
2020-11-27 21:20:38 -07:00