chore: add workspace proxies to the backend (#7032)

Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
Steven Masley
2023-04-17 19:57:21 +00:00
committed by GitHub
co-authored by Dean Sheather
parent dc5e16ae22
commit 658246d5f2
61 changed files with 3641 additions and 757 deletions
+10 -5
View File
@@ -2,6 +2,7 @@ package coderd
import (
"net/http"
"net/url"
"github.com/coder/coder/buildinfo"
"github.com/coder/coder/coderd/httpapi"
@@ -67,11 +68,15 @@ func (api *API) deploymentStats(rw http.ResponseWriter, r *http.Request) {
// @Tags General
// @Success 200 {object} codersdk.BuildInfoResponse
// @Router /buildinfo [get]
func buildInfo(rw http.ResponseWriter, r *http.Request) {
httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.BuildInfoResponse{
ExternalURL: buildinfo.ExternalURL(),
Version: buildinfo.Version(),
})
func buildInfo(accessURL *url.URL) http.HandlerFunc {
return func(rw http.ResponseWriter, r *http.Request) {
httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.BuildInfoResponse{
ExternalURL: buildinfo.ExternalURL(),
Version: buildinfo.Version(),
DashboardURL: accessURL.String(),
WorkspaceProxy: false,
})
}
}
// @Summary SSH Config