Commit Graph

113 Commits

Author SHA1 Message Date
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
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