mirror of
https://github.com/boringproxy/boringproxy.git
synced 2025-02-25 18:55:29 -06:00
Implement using actual domain list for waygates
This commit is contained in:
parent
4d8b9aeaae
commit
1215162f49
@ -11,13 +11,12 @@
|
||||
<input type="hidden" name="state" value="{{.AuthRequest.State}}" required>
|
||||
|
||||
<div>
|
||||
<input type="text" name="host" placeholder="Subdomain optional">
|
||||
<input type="text" name="host" placeholder="Subdomain" required>
|
||||
<span>.</span>
|
||||
<select id="domain-input" name="domain">
|
||||
{{ range .Domains}}
|
||||
<option>{{.DomainName}}</option>
|
||||
{{range $domainName := $.Domains}}
|
||||
<option>{{$domainName}}</option>
|
||||
{{ end }}
|
||||
<option>takingnames.co</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
@ -181,36 +181,22 @@ func (h *WebUiHandler) handleWebUiRequest(w http.ResponseWriter, r *http.Request
|
||||
return
|
||||
}
|
||||
|
||||
//user, exists := db.GetUser(tokenData.Owner)
|
||||
//if !exists {
|
||||
// sendLoginPage(w, r)
|
||||
// return
|
||||
//}
|
||||
wildcardDomains := []string{}
|
||||
|
||||
//domains := db.GetDomainsForUser(tokenData.Owner)
|
||||
domains := h.api.GetDomains(tokenData)
|
||||
|
||||
//displayClientId := authReq.ClientId
|
||||
|
||||
//if strings.HasSuffix(authReq.ClientId, ".ip.takingnames.live") {
|
||||
// domainParts := strings.Split(authReq.ClientId, ".ip.takingnames.live")
|
||||
// ip := strings.Replace(domainParts[0], "-", ".", -1)
|
||||
// displayClientId = ip
|
||||
//}
|
||||
for domainName, _ := range domains {
|
||||
if strings.HasPrefix(domainName, "*.") {
|
||||
wildcardDomains = append(wildcardDomains, domainName[2:])
|
||||
}
|
||||
}
|
||||
|
||||
data := struct {
|
||||
// LoggedIn bool
|
||||
Domains []string
|
||||
// FreeDomains []string
|
||||
// User User
|
||||
Domains []string
|
||||
AuthRequest *waygate.AuthRequest
|
||||
// DisplayClientId string
|
||||
}{
|
||||
// LoggedIn: loggedIn,
|
||||
Domains: []string{},
|
||||
// FreeDomains: FreeDomains(),
|
||||
// User: user,
|
||||
Domains: wildcardDomains,
|
||||
AuthRequest: authReq,
|
||||
// DisplayClientId: displayClientId,
|
||||
}
|
||||
|
||||
err = h.tmpl.ExecuteTemplate(w, "authorize.tmpl", data)
|
||||
|
Loading…
Reference in New Issue
Block a user