that's what we do - forking
https://github.com/golang/gddo and adding the custom authentication logic and fetching data from the GHE.
I'd recommend to concentrate on building and customizing gddo-server and gosrc (don't try to build everything in gddo). We changed or added the following files:
* gddo-server/main.go
- added a new command-line option tlsdir = flag.String("tlsdir", "/custom/tls/path", "directory with TLS key/certificate")
- at the end of main(), instead of appengine.Main(), put the custom authentication and http.ListenAndServeTLS with the authentication
* gosrc/newfile.go - implements fetching code from the internal Git instance
addService(&service{
pattern: regexp.MustCompile(`^go\.corp\.company\.com/(?P<owner>[a-z0-9A-Z_.\-]+)/(?P<repo>[a-z0-9A-Z_.\-]+)(?P<dir>/.*)?$`),
get: getCustomGitDir,
getPresentation: getCustomGitPresentation,
getProject: getCustomGitProject,
})
and then implementation of the three getCustomGit* functions
* httputil/transport.go - adds patch for authentication GHE instance
I think that's mostly it. I wish someone would take time to make and opensource a fork of gddo that would be free from the GHE/appenging stuff which complicates the matters somewhat when you have to host it on your own :)