This change replaces the env package with a new golangorgenv package.
The previous env package existed primarily to configure the godoc
instance that was running golang.org. By now, the golang.org website
has been factored out to x/website, which has its own env package,
but ends up still using this env package indirectly via x/tools/godoc.
The goal of this change is to make env available for other services
that run on subdomains of golang.org, so they can continue to safely
rely on the x/tools/playground, which will be modified in the next
commit to also use the new golangorgenv.
The golangorgenv package replaces the IsProd function with a more
specific one. Start using it in packages x/tools/{,cmd}/godoc. Also,
re-arrange the order of checks to give the host suffix check higher
priority than the environment variable check. This way, if the
environment variable isn't set, the host suffix check gets a chance
to run.
When getting the value of "X-AppEngine-Country" header, use its
canonical format "X-Appengine-Country" to avoid an allocation.
This does not change behavior.
Updates golang/go#30486
Change-Id: I97b47211a45ca0351f31fcb4fa6d408a4b0c4c7c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/165459
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
- This shaves off 12.8KB (unzipped) / 3.8KB (zipped)
downloadable data and around 6ms of javascript parse time
when the files are not injected.
- Also, conditionally rendering the callgraph html only when
callgraph is actually present.
- Removed the "text/javascript" attribute as it is the default
value now.
Change-Id: I70c030bdda2a054c181b2b3a693842bafed88d1a
Reviewed-on: https://go-review.googlesource.com/c/115875
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
See bug for more details on exactly what was migrated.
Notably:
* No more Google-internal deployment scripts; see README.godoc-app and
the Makefile for details.
* Build tag "golangorg" is used for the godoc configuration used for
golang.org.
* Use of App Engine libraries replaced with GCP client libraries.
* Redis is used to replace App Engine memcache.
* Google analytics is controlled by an environment variable.
* Regression tests have been migrated from Google-internal.
* hg -> git hash map is moved from Google-internal.
Updates golang/go#27205.
Change-Id: Ia0a983f239c50eda8be2363494c8b784f60c2c6d
Reviewed-on: https://go-review.googlesource.com/133355
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Use that property to determine whether to show share functionality
or link to sites that are blocked in mainland China.
This change requires https://go-review.googlesource.com/c/52872
Change-Id: I47327f9dbd2624206564fa99eb1cc6a10b4f46db
Reviewed-on: https://go-review.googlesource.com/52873
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Exposing the full paths to files is considered possible
source of vulnerabilities.
Change-Id: Ie9ae3791e51fcff5f1df711f84db9879d7e6ce37
Reviewed-on: https://go-review.googlesource.com/29445
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
These codes were initially included because of a miscommunication.
They should not be in the list at all.
Fixesgolang/go#12747
Change-Id: I1a53e9c7be8edf5e1dbb95cd03101b93023a12c1
Reviewed-on: https://go-review.googlesource.com/15082
Reviewed-by: Andrew Gerrand <adg@golang.org>
This will permit us to serve *.golang.org to Chinese users.
Change-Id: I5217753aa67931522c7e6be106477534c99a20b2
Reviewed-on: https://go-review.googlesource.com/14194
Reviewed-by: Andrew Gerrand <adg@golang.org>
cmd/godoc/godoc.go is now merged into main.go, which is now
only 530 lines.
App Engine mode is still broken, but should be easy to fix up.
(just needs a global *godoc.Presentation created in init)
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/11498044