33 Commits
Author SHA1 Message Date
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 98a6ff52fc Delete tokens when user is deleted
Also added DeleteUser to API
2020-10-30 18:50:24 -06:00
Anders Pitman 6b9f9aa413 Implement creating users and tokens from REST API 2020-10-29 17:56:38 -06:00
Anders Pitman 4fd830167f Fix more security holes 2020-10-27 15:21:56 -06:00
Anders Pitman 3a705cf252 Fix QR codes not rendering for admin 2020-10-27 14:51:59 -06:00
Anders Pitman 51dce1876d Fix token delete security bug 2020-10-27 14:48:22 -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 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 f9f2155ab1 Add logo for favicon 2020-10-21 10:53:51 -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 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 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 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 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 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 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