Commit Graph

80 Commits

Author SHA1 Message Date
Anders Pitman
617444946d Break menu into separate file 2020-10-13 10:04:12 -06:00
Anders Pitman
5cd911f310 Automatically create admin user on first start
Also changed order that extractToken looks for tokens. Used to
be cookies then headers then query. Now in reverse, to make it
easier to override, ie for replacing cookies during login.
2020-10-13 09:48:03 -06:00
Anders Pitman
8d6e4c2fe8 Rename file 2020-10-12 22:26:56 -06:00
Anders Pitman
02f9887b9d Implement alert dialog 2020-10-12 22:26:33 -06:00
Anders Pitman
9cc1a8afa6 Implement user delete 2020-10-12 22:17:36 -06:00
Anders Pitman
d3b25d5c38 Implement adding users from UI 2020-10-12 19:51:13 -06:00
Anders Pitman
238b66fb9b Handle webui auth in central location 2020-10-12 19:13:43 -06:00
Anders Pitman
a749fc0b46 Share HTML head section amongst pages 2020-10-12 18:39:35 -06:00
Anders Pitman
96611f4804 Simplify public key generation
Intermediate string builder wasn't necessary.
2020-10-12 18:37:46 -06:00
Anders Pitman
bf3f79fc63 Clean up unused attributes 2020-10-12 18:22:08 -06:00
Anders Pitman
31ea48365f Use Post/Redirect/Get pattern for login 2020-10-11 15:22:58 -06:00
Anders Pitman
2ca7800ca6 Replace email login with direct token login 2020-10-11 15:18:33 -06:00
Anders Pitman
1e25527ab2 Rename sessions to tokens/tokenData 2020-10-11 14:27:32 -06:00
Anders Pitman
9da8ca987e Run go fmt 2020-10-11 14:16:49 -06:00
Anders Pitman
d04804e8ac Include styles on login page 2020-10-11 14:10:30 -06:00
Anders Pitman
e4c3379ed2 Move web ui into separate struct and rename file 2020-10-11 13:45:46 -06:00
Anders Pitman
1b4e6beb61 Implement confirm dialog
Also moved shared styles to separate file which is included by
templates.
2020-10-11 13:32:10 -06:00
Anders Pitman
af539f4d68 Add menu to ui 2020-10-11 11:13:08 -06:00
Anders Pitman
1070c53107 Add some color to the buttons 2020-10-11 10:35:30 -06:00
Anders Pitman
6d6c0b46bc Reduce number of client panics 2020-10-10 10:04:37 -06:00
Anders Pitman
eb4d6903c7 Implement client tunnel synchronization
Client now polls server state and updates tunnels to match.
2020-10-10 09:55:07 -06:00
Anders Pitman
41bd4759eb Add ETag hash to tunnel responses 2020-10-10 08:20:17 -06:00
Anders Pitman
eaddc4441a Change delete link into button 2020-10-09 10:15:55 -06:00
Anders Pitman
ffc0d27338 Start implementing remote-controlled clients 2020-10-09 10:05:31 -06:00
Anders Pitman
6c2db42c2a Store full tunnel information in db
Now have a single Tunnel type which is returned on creation and
when querying the current tunnels.
2020-10-08 12:51:52 -06:00
Anders Pitman
274725b5c5 Add HTTP>HTTPS redirection
Required switching to TLS for LetsEncrypt, so I could disable
the HTTP ACME handler. Pretty sure there's a way to keep them
both enabled but this is fine for now.
2020-10-07 10:44:37 -06:00
Anders Pitman
f234049877 Add X-Forwarded-Host header to upstream requests 2020-10-07 09:18:04 -06:00
Anders Pitman
13e998e87d Restrict file permissions before writing key 2020-10-07 09:04:01 -06:00
Anders Pitman
bf54f27815 Add tunnel creation script 2020-10-06 19:00:40 -06:00
Anders Pitman
03baac2c7b Implement tunnel delete for /api 2020-10-06 19:00:20 -06:00
Anders Pitman
57e2e80ed4 Reuse httpClient 2020-10-06 10:22:03 -06:00
Anders Pitman
6ee5a5d3f4 Move /tunnels GET to /api 2020-10-05 23:37:03 -06:00
Anders Pitman
5b5f474853 Move sessions and tunnels into database 2020-10-05 23:25:36 -06:00
Anders Pitman
2c4b97c0e2 Switch from TLS to HTTP proxying
Allows a few things:

* Can terminate HTTP/2 without the upstream needing to implement
  it
* Allows modification of headers in both directions
* Allows logging at the proxy
2020-10-05 18:12:31 -06:00
Anders Pitman
80556785d0 Move admin page stuff into separate file 2020-10-05 16:13:01 -06:00
Anders Pitman
f712499773 Get username and home dir from system 2020-10-03 20:40:14 -06:00
Anders Pitman
2134407616 Remove deleted tunnels from authorized_keys file 2020-10-02 20:53:46 -06:00
Anders Pitman
7a91738029 Implement basic client
It pretty much only accomplishes what you can already do with a
normal SSH client. The difference is that keys are generated on
the fly by the server and transmitted for the client to use for
the tunnel.
2020-10-02 20:36:28 -06:00
Anders Pitman
c285f0990f Run go fmt 2020-10-02 17:09:14 -06:00
Anders Pitman
be91ff62ef Use AdminDomain for ssh server address 2020-10-02 17:07:24 -06:00
Anders Pitman
8a37355bb6 Implement openssh key management
I had been moving in the direction of implementing a custom SSH
server in golang. That would be pretty easy if using a custom
application protocol, but I want to support tcpip-forward which
looks like it would be a lot more work. It also would be nice to
support generic CLI clients like OpenSSH.

The point of using SSH in the first place is that it's known to be a
solid tunneling solution. To that end, I've decided to rely on
OpenSSH for now, since that program may have tunneled more bits than any
other since the dawn of time. This requires a bit of hackery to generate
SSH keys and place them in authorized_keys (as well as shipping the
private key to the client), but I think this will work well for now.

Plus OpenSSH is already installed on pretty much every server
I'd expect to run boringproxy.
2020-10-02 16:57:09 -06:00
Anders Pitman
95ab97f043 Move password handling so we can extract it 2020-10-01 17:42:38 -06:00
Anders Pitman
59c824bfca Start implementing custom ssh server
Turns out SSH has robust semantics for opening generic channels.
Looks like I'll be able to set up tunnels without ever needing to
forward ports on the server, since I can connect the channels with
a custom protocol.

Of course I'll eventually want to support generic SSH clients, but
this makes starting much easier.
2020-10-01 17:22:54 -06:00
Anders Pitman
84b7c0828e Start implementing custom client
Basic SSH plumbing in place. Go makes this way too easy.
2020-09-30 23:49:03 -06:00
Anders Pitman
10f79beec6 Add error handling for cert failure 2020-09-29 23:24:22 -06:00
Anders Pitman
9bd415af50 Implement add/delete tunnels from UI 2020-09-29 23:10:06 -06:00
Anders Pitman
bcd786e5d8 Get basic UI plumbing in place 2020-09-29 22:29:30 -06:00
Anders Pitman
bae4eaf02d Modify login for browser forms instead of API 2020-09-29 22:03:34 -06:00
Anders Pitman
0cb3250711 Add go.rice dependency 2020-09-29 20:51:57 -06:00
Anders Pitman
b83fd6eb41 Start using go modules 2020-09-29 20:26:02 -06:00