From 2ca14901fc4abcc222d9c62dfbf42d3b1b52b619 Mon Sep 17 00:00:00 2001 From: Anders Pitman Date: Sat, 24 Oct 2020 13:27:41 -0600 Subject: [PATCH] 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. --- ui_handler.go | 22 +++++++++++----------- webui/index.tmpl | 8 ++++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/ui_handler.go b/ui_handler.go index 6ff4729..583cc86 100644 --- a/ui_handler.go +++ b/ui_handler.go @@ -320,20 +320,20 @@ func (h *WebUiHandler) handleWebUiRequest(w http.ResponseWriter, r *http.Request h.confirmDeleteToken(w, r) case "/delete-token": h.deleteToken(w, r) - case "/ssh-keys": - h.handleSshKeys(w, r, user, tokenData) - case "/delete-ssh-key": + //case "/ssh-keys": + // h.handleSshKeys(w, r, user, tokenData) + //case "/delete-ssh-key": - r.ParseForm() + // r.ParseForm() - err := h.api.DeleteSshKey(tokenData, r.Form) - if err != nil { - w.WriteHeader(400) - h.alertDialog(w, r, err.Error(), "/#/ssh-keys") - return - } + // err := h.api.DeleteSshKey(tokenData, r.Form) + // if err != nil { + // w.WriteHeader(400) + // h.alertDialog(w, r, err.Error(), "/#/ssh-keys") + // return + // } - http.Redirect(w, r, "/#/ssh-keys", 303) + // http.Redirect(w, r, "/#/ssh-keys", 303) case "/confirm-logout": tmpl, err := h.loadTemplate("confirm.tmpl") diff --git a/webui/index.tmpl b/webui/index.tmpl index 9597f5e..6583539 100644 --- a/webui/index.tmpl +++ b/webui/index.tmpl @@ -13,7 +13,9 @@ +
@@ -109,7 +113,9 @@
+ {{if .IsAdmin}}