174 Commits
Author SHA1 Message Date
Anders Pitman f6fee2b8c0 Check permissions for deleting tunnels 2020-10-27 14:39:44 -06:00
Anders Pitman b3f1636be6 Fix some security issues
* The CSS styles were leaking information about tunnels, even for
  things like the login page, which can be sent to anyone.
* Tokens could be created for any user by any user.
2020-10-26 12:18:51 -06:00
Anders Pitman 8e8045cde7 Update notes and todo 2020-10-26 11:11:14 -06:00
Anders Pitman 7f595c2b0d Start client tunnels concurrently 2020-10-24 17:00:42 -06:00
Anders Pitman 1abc141d13 Make client selection a dropdown
Also implemented adding and deleting clients through the API.
2020-10-24 16:48:53 -06:00
Anders Pitman 1607d41e5c Add button for downloading private keys
Allows users to access tunnels using standard SSH clients.
2020-10-24 14:12:18 -06:00
Anders Pitman 2ca14901fc Disable custom SSH keys for now
Not sure the feature is boring enough to keep. There are some tricky
things that still need to be solved like figuring out how to let
tunnels share the same public key, since the OpenSSH server seems to
only pick up the first instance of each key in the authorized_keys
file.

Also, what happens if someone wants to use their normal SSH key for
the server for a boringproxy tunnel. I could easily introduce a bug
that would lock someone out of their server in certain corner cases.

I think adding the ability to download the private key for each tunnel
will handle most cases for now.
2020-10-24 13:27:41 -06:00
Anders Pitman 8477391273 Implement using custom SSH keys 2020-10-23 20:56:55 -06:00
Anders Pitman 4158ea5777 Improve shadows on logo 2020-10-22 10:08:20 -06:00
Anders Pitman 0014ad5ce9 Add a couple shadows to logo 2020-10-21 15:01:57 -06:00
Anders Pitman ed0133bc7b Add logo file 2020-10-21 10:55:28 -06:00
Anders Pitman f9f2155ab1 Add logo for favicon 2020-10-21 10:53:51 -06:00
Anders Pitman afd58db9b7 Add logo concept svg 2020-10-21 09:50:12 -06:00
Anders Pitman fd0451fa3b Implement password-protected tunnels 2020-10-20 20:03:59 -06:00
Anders Pitman 85a5004cc7 Implement raw TCP tunnels
Just needed to add an option to allow external connections to the
ports from the server, then set the proper values in the
authorized_keys file and on the client.
2020-10-20 19:14:04 -06:00
Anders Pitman 9882017d5a Add ClientAddress
Allows tunnels to specify what address the client with connect to
for upstream connections.

Also changed the tunnel-adder UI.

Also fixed a bug where invalid domains would crash. Needed to
properly return an error dialog.
2020-10-20 18:52:32 -06:00
Anders Pitman ef660f61ae Fix loading page 2020-10-20 17:58:19 -06:00
Anders Pitman 80d7f2115b Clean up UI a ton 2020-10-19 12:25:04 -06:00
Anders Pitman 84e00161bd Implement request logging
Added logs to stdout, and cleaned up some of the stderr ones.
2020-10-18 19:29:57 -06:00
Anders Pitman 0e39e9dd57 Add QR code login URLs for tokens
Also set cookies to max age of a year rather than session cookies.
2020-10-18 18:39:30 -06:00
Anders Pitman 0df20b2e1e Update notes and todo 2020-10-18 10:48:23 -06:00
Anders Pitman 44e3cc7d2c Add notes file 2020-10-17 16:11:40 -06:00
Anders Pitman 91d82ff987 Switch client to use go SSH client
Was previously shelling out to `ssh`.

As part of this, I also needed to fix a standing bug where
connections weren't properly being closed.
2020-10-17 16:07:56 -06:00
Anders Pitman 2d7f985311 Fix Firefox silently deleted tunnels
Debugging notes:

* The act of refreshing a page can delete tunnels created by other UI
  sessions, I think because it has local CSS checkbox state.
  * Happens on firefox desktop and mobile. Here's how to reproduce:
    1. Load the UI in Chrome and FF.
    2. Delete the last tunnel from FF.
    3. Add it back in Chrome.
    4. Refresh FF. The tunnel will be silently deleted.
  * I'm pretty sure this is bugged behavior in FF, because the checkboxes have
    completely unique ids, but it's treating them like the same checkbox.
  * Setting autocomplete='off' on the input elements seems to fix the problem.
    Not sure if it will work correctly in all browsers.
2020-10-17 09:48:29 -06:00
Anders Pitman ca89553354 Make UI more consistent 2020-10-17 09:19:59 -06:00
Anders Pitman 18e09120a7 Change delete to work without a page navigation.
Uses more CSS checkbox hackery.
2020-10-17 08:42:29 -06:00
Anders Pitman bdc1721870 Delete pending requests 2020-10-16 11:24:13 -06:00
Anders Pitman cca211de0e Implement loading screen for slow requests 2020-10-16 11:21:41 -06:00
Anders Pitman 9aafa18254 Change delete buttons to forms 2020-10-16 10:25:09 -06:00
Anders Pitman e51b304275 Make tunnel delete buttons pure CSS 2020-10-16 09:40:46 -06:00
Anders Pitman 2eafde030e Clean up menu stuff
Also only send /users page when isAdmin is true
2020-10-15 13:20:59 -06:00
Anders Pitman 7df93c0821 Highlight selected page
Needed to change HTML architecture to inline multiple independent
copies of the menu. There might be a cleaner way to do this, but
it will work for now.
2020-10-15 13:01:15 -06:00
Anders Pitman 102bb152de Remove references to colored buttons 2020-10-15 10:45:07 -06:00
Anders Pitman 20b473e61f Switch to monochrome buttons 2020-10-15 10:42:38 -06:00
Anders Pitman f911ca3b1a Implement logout button 2020-10-15 10:05:09 -06:00
Anders Pitman 4c78059e66 Overhaul UI architecture
Learned about the :target CSS selector, which can be used to
replace content depending on the current URL hash. This allows
making a sort of single page app without JavaScript.

Currently experimenting with returning all the pages in a single
request, then switching between them with :target. Seems to be
working quite well so far.
2020-10-15 09:50:12 -06:00
Anders Pitman 770440ef79 Handle DeleteTunnel for UI in API 2020-10-14 10:42:54 -06:00
Anders Pitman b0c888221d Clean up CreateTunnel error handling 2020-10-14 10:33:06 -06:00
Anders Pitman fb8d379663 Create UI tunnels through API 2020-10-14 10:29:19 -06:00
Anders Pitman a4fa2862e4 Use random server ports for tunnels 2020-10-14 09:47:46 -06:00
Anders Pitman cfcd781276 Filter UI requests through API
API is now the central control point for making authorized
requests. The current architecture is:

* db simply returns all data
* api uses tokens to filter data from db. It includes methods for
  returning objects, and HTTP endpoints for return JSON.
* ui calls the api functions to get filtered data.
2020-10-14 09:17:04 -06:00
Anders Pitman df6daa5bbd Forgot to add some of the templates 2020-10-13 11:29:56 -06:00
Anders Pitman 85d67e262a Do more authorization checking
Limit certain information based on user and whether they're an
admin.
2020-10-13 11:21:42 -06:00
Anders Pitman f6faa9c6a7 Add tokens page 2020-10-13 10:32:46 -06:00
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