mirror of
https://github.com/boringproxy/boringproxy.git
synced 2025-02-25 18:55:29 -06:00
Clean up Tunnel struct a bit
Removed unused CssId and moved members that should eventually be removed from the API surface (ie internal values) to be together so they're easier to identify later.
This commit is contained in:
14
database.go
14
database.go
@@ -41,7 +41,6 @@ type DNSRecord struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Tunnel struct {
|
type Tunnel struct {
|
||||||
Owner string `json:"owner"`
|
|
||||||
Domain string `json:"domain"`
|
Domain string `json:"domain"`
|
||||||
ServerAddress string `json:"server_address"`
|
ServerAddress string `json:"server_address"`
|
||||||
ServerPort int `json:"server_port"`
|
ServerPort int `json:"server_port"`
|
||||||
@@ -49,14 +48,17 @@ type Tunnel struct {
|
|||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
TunnelPort int `json:"tunnel_port"`
|
TunnelPort int `json:"tunnel_port"`
|
||||||
TunnelPrivateKey string `json:"tunnel_private_key"`
|
TunnelPrivateKey string `json:"tunnel_private_key"`
|
||||||
ClientName string `json:"client_name"`
|
|
||||||
ClientAddress string `json:"client_address"`
|
ClientAddress string `json:"client_address"`
|
||||||
ClientPort int `json:"client_port"`
|
ClientPort int `json:"client_port"`
|
||||||
AllowExternalTcp bool `json:"allow_external_tcp"`
|
AllowExternalTcp bool `json:"allow_external_tcp"`
|
||||||
AuthUsername string `json:"auth_username"`
|
|
||||||
AuthPassword string `json:"auth_password"`
|
// TODO: These are not used by clients and shouldn't be returned in
|
||||||
CssId string `json:"css_id"`
|
// API calls.
|
||||||
TlsTermination string `json:"tls_termination"`
|
Owner string `json:"owner"`
|
||||||
|
ClientName string `json:"client_name"`
|
||||||
|
AuthUsername string `json:"auth_username"`
|
||||||
|
AuthPassword string `json:"auth_password"`
|
||||||
|
TlsTermination string `json:"tls_termination"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDatabase() (*Database, error) {
|
func NewDatabase() (*Database, error) {
|
||||||
|
|||||||
@@ -96,8 +96,6 @@ func (h *WebUiHandler) handleWebUiRequest(w http.ResponseWriter, r *http.Request
|
|||||||
tunnels := h.api.GetTunnels(tokenData)
|
tunnels := h.api.GetTunnels(tokenData)
|
||||||
|
|
||||||
for domain, tun := range tunnels {
|
for domain, tun := range tunnels {
|
||||||
// TODO: might yield non-unique names
|
|
||||||
tun.CssId = strings.ReplaceAll(domain, ".", "-")
|
|
||||||
tunnels[domain] = tun
|
tunnels[domain] = tun
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user