diff options
| -rw-r--r-- | cmd/within.website/main.go | 8 | ||||
| -rw-r--r-- | vanity/vanity.go | 6 |
2 files changed, 6 insertions, 8 deletions
diff --git a/cmd/within.website/main.go b/cmd/within.website/main.go index a6100bb..8302c83 100644 --- a/cmd/within.website/main.go +++ b/cmd/within.website/main.go @@ -57,15 +57,15 @@ func main() { } for _, repo := range *githubRepos { - http.Handle("/"+repo, vanity.GitHubHandler(*domain+"/"+repo, *githubUsername, repo, "https", *goProxyServer)) - http.Handle("/"+repo+"/", vanity.GitHubHandler(*domain+"/"+repo, *githubUsername, repo, "https", *goProxyServer)) + http.Handle("/"+repo, vanity.GitHubHandler(*domain+"/"+repo, *githubUsername, repo, "https")) + http.Handle("/"+repo+"/", vanity.GitHubHandler(*domain+"/"+repo, *githubUsername, repo, "https")) ln.Log(ctx, ln.F{"github_repo": repo, "github_user": *githubUsername}, ln.Info("adding github repo")) } for _, repo := range *gogsRepos { - http.Handle("/"+repo, vanity.GogsHandler(*domain+"/"+repo, *gogsDomain, *gogsUsername, repo, "https", *goProxyServer)) - http.Handle("/"+repo+"/", vanity.GogsHandler(*domain+"/"+repo, *gogsDomain, *gogsUsername, repo, "https", *goProxyServer)) + http.Handle("/"+repo, vanity.GogsHandler(*domain+"/"+repo, *gogsDomain, *gogsUsername, repo, "https")) + http.Handle("/"+repo+"/", vanity.GogsHandler(*domain+"/"+repo, *gogsDomain, *gogsUsername, repo, "https")) ln.Log(ctx, ln.F{"gogs_domain": *gogsDomain, "gogs_username": *gogsUsername, "gogs_repo": repo}, ln.Info("adding gogs repo")) } diff --git a/vanity/vanity.go b/vanity/vanity.go index 933d7ed..b637817 100644 --- a/vanity/vanity.go +++ b/vanity/vanity.go @@ -169,22 +169,20 @@ func WithGogsStyleSource(importPath, repoPath, ref string) Option { } // Creates a Handler that serves a GitHub repository at a specific importPath. -func GitHubHandler(importPath, user, repo, gitScheme, proxyServer string) http.Handler { +func GitHubHandler(importPath, user, repo, gitScheme string) http.Handler { ghImportPath := "github.com/" + user + "/" + repo return Handler( WithImport(importPath, "git", gitScheme+"://"+ghImportPath), - WithGoModProxy(importPath, proxyServer), WithGitHubStyleSource(importPath, "https://"+ghImportPath, "master"), ) } // Creates a Handler that serves a repository hosted with Gogs at host at a // specific importPath. -func GogsHandler(importPath, host, user, repo, gitScheme, proxyServer string) http.Handler { +func GogsHandler(importPath, host, user, repo, gitScheme string) http.Handler { gogsImportPath := host + "/" + user + "/" + repo return Handler( WithImport(importPath, "git", gitScheme+"://"+gogsImportPath), - WithGoModProxy(importPath, proxyServer), WithGogsStyleSource(importPath, "https://"+gogsImportPath, "master"), ) } |
