aboutsummaryrefslogtreecommitdiff
path: root/cmd/golangorg/server.go
AgeCommit message (Collapse)Author
9 hours[DO-NOT-MERGE] cmd/golangorg: support socket based activation with systemdHEADmainShulhan
Change-Id: I12e667f1945eb9440147842c3374756dbd8b09ef
9 hours[DO-NOT-MERGE] cmd/golangorg: realign structsShulhan
This affects declaring fields in struct using field name instead of naked names.
9 hours[DO-NOT-MERGE] cmd/golangorg: allow serving in local as "go.local"Shulhan
Change-Id: I73aa112ba125b56dbdaf2727a3a7165c03de9b3f
6 dayscmd/golangorg: use _goroot.zip during deploy tests tooDmitri Shuralyov
The deploy process constructs a _goroot.zip file which is used as the source of main Go repository content when serving go.dev. Start using the same _goroot.zip file when running tests in Cloud Build. Also move the flag.Parse to happen at the top of main, before some of the flag values are accessed and potentially overridden. For golang/go#78211. Change-Id: Iaf182301836917d062c5f4c329db6bbc171415da Reviewed-on: https://go-review.googlesource.com/c/website/+/763840 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2025-07-29_content/css: style tables produced from markdownAlan Donovan
We emit a <div class=markdown> around the whole output of goldmark, so that CSS style rules can easily select them (without affecting HTML tables in the spec, for example). The default style for markdown tables now has thin grey lines, grey headings, and a little padding. Also, remove the FS middleware used to inject default.tmpl into x/tools/gopls/doc, since that file is now actually present. And add it to the fake data at _content/gopls/doc. Fixes golang/go#67368 Change-Id: If91e702c394d73a181bd780711e8be6f661f2e59 Reviewed-on: https://go-review.googlesource.com/c/website/+/691616 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Alan Donovan <adonovan@google.com>
2025-07-29cmd/golangorg: serve latest commit on gopls' latest release branchAlan Donovan
Rather than serving docs at the gopls release itself, this CL causes us to serve whatever is on the release branch. This allows us to cherrypick doc fixes into the branch without all the fuss of a gopls release. Change-Id: I5f99458407388747a093219cac16e178f28ba527 Reviewed-on: https://go-review.googlesource.com/c/website/+/691415 Reviewed-by: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Alan Donovan <adonovan@google.com>
2025-07-08cmd/golangorg: serve gopls docs at go.dev/goplsAlan Donovan
The go.dev/gopls endpoint serves the gopls/doc directory at the latest release of gopls; the tip.golang.dev/gopls endpoint serves the latest x/tools commit. The GOLANGORG_LOCAL_X_TOOLS environment variable specifies a local directory, overriding the use of git, for previewing local doc changes. Also, a command to recursively check links within the go.dev/gopls subtree. Fixes golang/go#68977 Change-Id: I5d92e6f0e5fdbed721a57f0a1ace2ac98e562fc8 Reviewed-on: https://go-review.googlesource.com/c/website/+/685635 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-02-11cmd/golangorg: fix local run directory pathCherry Mui
FileInfo.Name returns the base name, not the path. Here we need the path. This makes "go run ." from cmd/golangorg directory work again. Change-Id: Iec7533758cf8a696a2696c28107caebf84bbed91 Reviewed-on: https://go-review.googlesource.com/c/website/+/648575 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2024-12-16cmd/golangorg: redirect /issue(s) on tip.golang.orgDmitri Shuralyov
The /issue and its alias /issues subtrees were missed in CL 634915. Also group related subtrees together. For golang/go#58484. Change-Id: I598e2c7aa70f56bdfd3ec069347dca3d96f8e6d5 Reviewed-on: https://go-review.googlesource.com/c/website/+/636215 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2024-12-10cmd/golangorg: redirect various dynamic content on tip.golang.orgRuss Cox
This makes links in package docs work better. Fixes golang/go#58484. Change-Id: Ie399bf94262b0aaeb5eed7c0ef18a2a938e9ef7c Reviewed-on: https://go-review.googlesource.com/c/website/+/634915 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-12-05all: remove unreachable codeSean Liao
While running go test -vet=all I saw a failure from unreachable code, which lead me to run deadcode on the entire repo. Change-Id: I20a7cd83f54595d12d46d1bdb714975e1efaf5e3 Reviewed-on: https://go-review.googlesource.com/c/website/+/633895 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-06-21cmd,internal: replace deprecated ioutil with io and osOleksandr Redko
Change-Id: I1d66a5c7b087d9329628efb6ce8849a004663b51 Reviewed-on: https://go-review.googlesource.com/c/website/+/592895 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2024-06-03cmd/golangorg: fall back to embedded content when _content is not nearbyDmitri Shuralyov
If golangbuild is run from a directory other than x/website root or its cmd/golangbuild directory, it's more useful to use the embedded content than a directory that does not exist. This was previously possible by explicitly setting the -content flag to the empty string. This change makes it possible to leave the flag unset, which can be handy for go run golang.org/x/website/cmd/golangorg@latest. Change-Id: Id0e33515b15934fdfcd1cbe594ad4c7b969a1d21 Reviewed-on: https://go-review.googlesource.com/c/website/+/589936 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-22cmd/golangorg: add doc/next page to preview draft release notesDmitri Shuralyov
The improved release note process is being used starting with Go 1.23. That means instead of a single doc/go1.23.html draft file in the main Go repository, doc/next contains a set of release note fragments. Having small, orthogonal files avoids merge conflicts, and a release note test requires that release notes are written and included in the same CL that's adding new APIs. As a result, the set of completed release notes even before we enter the release freeze is greater than ever before. While it's possible to view those fragments using tip.golang.org (e.g., by visiting https://tip.golang.org/doc/next), reading them that way isn't practical. The relnote generate tool exists to merge fragments into a complete Markdown document, and this tool will be used when eventually moving a complete draft of Go 1.23 release notes to x/website. To aid the remaining work of completing the release note draft, this change adds a dynamic /doc/next page to preview what the relnote generate tool will produce. Combined with existing functionality of the -tip flag, it makes https://tip.golang.org/doc/next display a live preview of the checked-in release notes draft. It can also be used to preview release note draft locally. For example, if $HOME/gotip is a Go checkout where one is editing doc/next content: go run golang.org/x/website/cmd/golangorg@latest -goroot=$HOME/gotip Will serve a live preview at http://localhost:6060/go.dev/doc/next. It can be slightly more convenient to refresh a browser without having to re-run 'relnote generate'. For golang/go#64169. For golang/go#65614. Change-Id: Ie1d3650076421a95a691dd84a554a113dd1187b1 Reviewed-on: https://go-review.googlesource.com/c/website/+/587436 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com>
2023-12-15_content: serve wiki pages on go.devRuss Cox
The wiki pages have been copied to go.googlesource.com/wiki and will be code reviewed using Gerrit, like other Go repos. Unlike other Go repos, self-review will be permitted, and there is no requirement for Googlers to be involved to make a change. These relaxations are possible because the wiki has no production code. The set of wiki +2'ers is a superset of the usual code +2'ers. Fixes golang/go#61940. Change-Id: I01823720091fbaa24e95e9c82abeaadba867a17c Reviewed-on: https://go-review.googlesource.com/c/website/+/518297 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-08-03cmd/golangorg: fix CachedURL, update rebuild templateRuss Cox
The "not modified" response code is 304, not 206. Oops. Use named constants to avoid similar mistakes in the future. Also update rebuild template to show more version information. For golang/go#57120. For golang/go#58884. Change-Id: I2c3ddf25cede0b5a853fa971226463a997f168c7 Reviewed-on: https://go-review.googlesource.com/c/website/+/515455 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-08-03_content: add rebuild page with reproducible build informationRuss Cox
We now have a command to reproduce Go builds posted on go.dev/dl. Add a dashboard that people can check to see its results. We should be able to link to this page from https://reproducible-builds.org/citests/. For golang/go#57120. For golang/go#58884. Change-Id: I0bd1f9c26a9a003aa1f301125083195fdeb048b4 Reviewed-on: https://go-review.googlesource.com/c/website/+/513700 Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-04-19cmd/golangorg: remove go-source meta tag for golang.org/x reposDmitri Shuralyov
The go-source meta tag was added in CL 2719 so that godoc.org could link to source code for golang.org/x repos. godoc.org is now served by golang.org/x/pkgsite rather than by github.com/golang/gddo, and x/pkgsite maintains this mapping for golang.org/x repos itself in x/pkgsite/internal/source. Drop the tag since it has become unused and stale (we've since switched to https://cs.opensource.google/go for viewing x/ repo source code). Updates golang/go#40477. Change-Id: Id029e58bfdb838e040241d6bf7677349cec6e04a Reviewed-on: https://go-review.googlesource.com/c/website/+/484515 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2023-03-31cmd/golangorg: add support for module form of Go distributionsRuss Cox
Add https://golang.org/toolchain serving appropriate meta tags with mod redirect to https://go.dev/dl/mod. Add https://go.dev/dl/mod/golang.org/toolchain/@v/ redirecting to files in https://dl.google.com/go/. Add https://go.dev/dl/mod/golang.org/toolchain/@v/list listing stable toolchain versions. For golang/go#57001. Change-Id: Ib3283cab1d8ead0373ca7549f0e17ccba7cfaa22 Reviewed-on: https://go-review.googlesource.com/c/website/+/480840 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-12-12internal/backport: deleteDmitri Shuralyov
Now that the deploy happens with Go 1.19, it's viable to start using these packages from the standard library instead of their backported temporary copies. Keeping Go 1.18 happy during its last two months of support requires a tiny complication in pkgdoc package. An alternative path is to not drop internal/backport/go/doc and all of its dependencies right away, but getting to zero backported packages sooner was hard to resist... For golang/go#51800. Change-Id: Ieb7a137a033d6b6850dfc019c8c0c767756cc30d Reviewed-on: https://go-review.googlesource.com/c/website/+/456522 Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2022-03-15all: handle Go 1.18 code on Go 1.16 AppEngine using new internal/backport/go/*Russ Cox
The immediate need was go/build, because the Go 1.16 go/build rejects code that has //go:build without // +build, as Go 1.18 code now does. But displaying code using generics would also have failed, for inability to parse that code. Add the full go/ast, go/doc, go/format, go/parser, go/printer, go/scanner, and go/token to fix those failures, which would become more frequent as generics are used more inside the standard library. The code is all from the go1.18 tag of the Go repo, post-processed to rewrite imports and apply gofmt -w -r 'any -> interface{}' to keep it building with the other backports and with Go 1.16 syntax. For golang/go#51686. Change-Id: I1e14f4634d8bc09bdaa04c014eadb1be97ea5047 Reviewed-on: https://go-review.googlesource.com/c/website/+/393194 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-01-06cmd,internal: move typescript transform to web packageJamal Carvalho
To transform .ts files from any path on a site and to ensure it works for all domains the transform logic is moved to the web package. Change-Id: I1ce62eb35dbdfb987ccc2f48e79c558bcdadfbbe Reviewed-on: https://go-review.googlesource.com/c/website/+/374994 Trust: Jamal Carvalho <jamalcarvalho@google.com> Run-TryBot: Jamal Carvalho <jamal@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alex Rakoczy <alex@golang.org>
2022-01-04website: 2022 and onwards are the Years of the GopherDmitri Shuralyov
The Go contribution guide was created in 2009 (commit 38a41eec67e5) as part of the initial public release of Go. It defined the standard copyright header for files in the Go tree. Since files are copyrighted the year they are added, having the current year in the header means it can be copied and pasted into newly created files without further modification. Given the year (2009 at the time) was written in a plain HTML file, it needed to be updated every year to stay current. Over the last 12 years, gophers assembled and performed this task: • commit 38a41eec67e5 contribute.html (initial commit) • go.dev/cl/184055 doc/contribute.html: change copyright year • go.dev/cl/3907042 doc: contribution copyright year 2011 • go.dev/cl/5531048 doc: use 2012 for year in model standard copyright header • go.dev/cl/7034044 doc: update standard copyright header • go.dev/cl/46660043 2014: Year of the Gopher. • go.dev/cl/2087 doc: 2015 will be the Year of the Gopher. • go.dev/cl/18117 doc: 2016 is the Year of the Gopher. • go.dev/cl/35240 doc: 2017 is the Year of the Gopher • go.dev/cl/85775 doc: 2018 is the Year of the Gopher • go.dev/cl/155928 doc: 2019 is the Year of the Gopher • go.dev/cl/213017 doc: 2020 is the Year of the Gopher • go.dev/cl/280163 doc: 2021 is the Year of the Gopher In a way, this yearly tradition of updating HTML by hand was fun¹, but we've now reached a convenient time to share the joy with our friendly robot gophers. Previously, the contribution guide lived in the main Go repository, and a part of the website serving code was still in x/tools/godoc. In 2021, Russ consolidated the remaining Go website content and code all in x/website (for example, see CL 291693 and CL 293420). So now everything we need is in one repo, making this trivial to automate, and in doing so mark 2022 and beyond as the Years of the Gopher. ¹ See the commit messages and conversations in the linked CLs. Change-Id: Ieab904b77d764c3e191f75923369ce461d7102c6 Reviewed-on: https://go-review.googlesource.com/c/website/+/375056 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Trust: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Jamal Carvalho <jamalcarvalho@google.com>
2021-12-29website: create typescript file handlerJamal Carvalho
To allow for the use of TypeScript in go.dev pages added a handler for TypeScript files served from _content/ts. Files requested from this directory are first transformed from TypeScript to JavaScript using github.com/evanw/esbuild. JavaScript output is written to a simple cache so subsequent requests skip the tranformation step. Change-Id: I0a161ce3dd20eaddddd5d369d359c65c90d9f607 Reviewed-on: https://go-review.googlesource.com/c/website/+/373718 Run-TryBot: Jamal Carvalho <jamal@golang.org> Trust: Jamal Carvalho <jamalcarvalho@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alex Rakoczy <alex@golang.org>
2021-12-02cmd/golangorg: create datastore connection bofore using itCarlos Amedee
This change creates a datastore connection before it is used by any of the handlers. Change-Id: I694f3c13bac0433935cf7879d90e7f6ca9b48eca Reviewed-on: https://go-review.googlesource.com/c/website/+/368974 Trust: Carlos Amedee <carlos@golang.org> Run-TryBot: Carlos Amedee <carlos@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Website-Publish: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
2021-11-30_content/tour: fix links, fix CSP policy for tourRuss Cox
Some links were missing the /tour/ at the front. The tour also has links like <a href="javascript:next()">, which require us to set unsafe-inline (or else enumerate the SHA256 of every link) in the CSP header. Also make the local server a bit more tour-friendly. Fixes golang/go#49880. Change-Id: Ice746571db1a34e1c02b4b2a16c4e9f30dc164d1 Reviewed-on: https://go-review.googlesource.com/c/website/+/368034 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org> Website-Publish: Russ Cox <rsc@golang.org>
2021-11-30cmd/golangorg: add support for multiple play backendsRuss Cox
This lets people choose between the release version of Go (play.golang.org) and the dev branch version (gotipplay.golang.org). After CL 365854 goes live, it will offer Go 1.17, Go 1.16, and Go dev branch. Change-Id: I7480a0cb4f1b09636f5728c41af507aac5a72026 Reviewed-on: https://go-review.googlesource.com/c/website/+/366056 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-24cmd/golangorg: redirect play.go.dev etc to go.dev/play etcRuss Cox
People might learn to type go.dev instead of golang.org but not the subdirectory part, meaning we expect to get requests for things like play.go.dev. Make them work. Change-Id: I2827fff42e896abe2df409ddc4f67e28d881ae95 Reviewed-on: https://go-review.googlesource.com/c/website/+/366375 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Website-Publish: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22talks: serve go.dev/talks for talks.golang.org contentRuss Cox
This is the last user-facing golang.org domain. Now everything is on go.dev. Change-Id: I8d9f4b7609a019f077848825cbd417d38058a5ac Reviewed-on: https://go-review.googlesource.com/c/website/+/365494 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22tour: serve from cmd/golangorg as go.dev/tourRuss Cox
tour.golang.org is the last independent server in this repository and almost the last golang.org domain with user-facing content. (talks.golang.org remains.) We need to keep golang.org/x/website/tour as a runnable binary, but move the logic into internal/tour so it can be used from both the tour binary and cmd/golangorg. After this is deployed, we will need to delete the current tour app from the golang-org project, and then requests for tour.golang.org will default to the main server (cmd/golangorg). This will make the tour available in China for the first time, at golang.google.cn/tour. Change-Id: I0f025d8ae89e12489d26bb3bc380a833eeb57bcc Reviewed-on: https://go-review.googlesource.com/c/website/+/365100 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22cmd/golangorg: hide $GOROOT/*.mdRuss Cox
We do not intend $GOROOT/README.md to be served as go.dev/README, and so on. Worst of all, on Macs and Windows (with case-insensitive file systems), SECURITY.md overrides _content/security.html. Change-Id: I4ac53508c34a4799aa4afd45db7e7e266e179936 Reviewed-on: https://go-review.googlesource.com/c/website/+/365098 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22go.dev: merge go.dev/_content into root _contentRuss Cox
Many renames. And then adjust references. Change-Id: I4d03c76dbc0bf4d070208d568861ee820904c0dc Reviewed-on: https://go-review.googlesource.com/c/website/+/365097 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22cmd/golangorg: default to go.dev for testing serverRuss Cox
When running server locally, requests for /foo redirect to /golang.org/foo, and you can specify other hosts at the start of the URL instead. Preparing for the move to go.dev, redirect /foo to /go.dev/foo instead. This just makes local development and testing a little nicer. It doesn't have any effect on the actual server. Change-Id: Iabc4186559cbf498f9b361060412702153859a6d Reviewed-on: https://go-review.googlesource.com/c/website/+/362958 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22website: merge golang.org → go.devRuss Cox
As described in https://go.dev/blog/tidy-web, redirect golang.org to go.dev. The golang.org home page is retired - go.dev now has all the same info and links, and it doesn't have ten-year-old videos of me. All the other golang.org pages are now served directly from go.dev, styled differently but with the same content. A followup CL will merge the _content directories. Change-Id: Ib7f3d951842c021280981f9b926c4943f4d9cb52 Reviewed-on: https://go-review.googlesource.com/c/website/+/364859 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22go.dev: add /playRuss Cox
This is a replacement for the UI of play.golang.org, although it still uses play.golang.org as the backend and probably always will, to keep the playground backend deployment separate from the rest of the web site. Change-Id: Ia39000e80368b98d9cc273d246f2c83670fbacc4 Reviewed-on: https://go-review.googlesource.com/c/website/+/364815 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-17cmd/golangorg: refactor go.dev setup to make golang.org merge easierRuss Cox
No semantic changes here, just replacing the godevHandler function with the same site setup that golang.org already uses. Change-Id: Id25cf3ce98cc8bea7da4e2b367a05b648a270522 Reviewed-on: https://go-review.googlesource.com/c/website/+/362955 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-17internal/short: allow registering on a specific hostRuss Cox
This makes internal/short like most of the other registrations. Preparation for the golang.org -> go.dev move. Change-Id: I55039d6d668ac38ddb8e2412b7ab7ff44db8dd97 Reviewed-on: https://go-review.googlesource.com/c/website/+/362497 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-17internal/dl: make download page testable offlineRuss Cox
Added a copy of the datastore content for use offline. This lets us test download page rendering locally. Preparation for the golang.org -> go.dev move. Change-Id: Ic0c49a96329eed4310dd91e03c4ea832189ef65a Reviewed-on: https://go-review.googlesource.com/c/website/+/362496 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-09cmd/golangorg: redirect /x/ to pkgsite subrepo pageSean Liao
For golang/go#47281 Change-Id: I065e6cb1d301701304228a3e4f263f3e576f8cbe Reviewed-on: https://go-review.googlesource.com/c/website/+/355809 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Jamal Carvalho <jamal@golang.org>
2021-11-06cmd/golangorg: provide helpful error for git clone https://golang.org/x/repoRuss Cox
People try git clone https://golang.org/x/website (for example) to clone the website repo. Tell them the right command. Change-Id: I7dc32190c959afff9908dde0727837b068bfecba Reviewed-on: https://go-review.googlesource.com/c/website/+/361203 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-09-16cmd/golangorg: more go-discovery exit cleanupRuss Cox
Remove the go-discovery app yaml file and the code paths it used. Change-Id: I13df0433ce1b7c069061cfad29080d1f80ca9b7d Reviewed-on: https://go-review.googlesource.com/c/website/+/344490 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-09-15cmd/golangorg: improve go.dev local server redirect handling and docsFilippo Valsorda
Previously, following a cross-domain redirect would not get caught by the local server link rewriter. Change-Id: I2ba6c1b9a8c03cf155928be0c68eced0de6a5c42 Reviewed-on: https://go-review.googlesource.com/c/website/+/349851 Trust: Filippo Valsorda <filippo@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2021-08-30cmd/golangorg: add missing /dl/ redirect on tip.golang.orgtoolb0x
Due to a missing redirect there is unfortunately a 404 when trying to download golang from the subdomain tip.golang.org. Change-Id: Ia14f419152769ccdf1ef5ede29a0d0e11c6bae6a GitHub-Last-Rev: a825e2183a6bf9556de235b589af23a35d025153 GitHub-Pull-Request: golang/website#85 Reviewed-on: https://go-review.googlesource.com/c/website/+/345591 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Jamal Carvalho <jamal@golang.org> Website-Publish: DO NOT USE <dmitshur@google.com>
2021-08-23cmd/golangorg: use embedded content on App EngineRuss Cox
Change-Id: If211bdb2ba60fbb799cb4dfe67fd066094afc40f Reviewed-on: https://go-review.googlesource.com/c/website/+/343936 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-08-23all: delete unmodified Go 1.16 backportsRuss Cox
Go 1.16 is available on App Engine now, so use it. Also, Go 1.17 has been released, meaning we don't need to keep Go 1.15 builders working. Delete all the Go 1.16 backports except the template packages, which contain modifications we need. Change-Id: I4612441a1484ce9272a22268da73d67f7624309b Reviewed-on: https://go-review.googlesource.com/c/website/+/343935 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-08-20cmd/golangorg: disable China detection on go.devRuss Cox
Go.dev has never had golang.org's China detection (which is there for historical reasons), so we don't need to start now. This fixes a problem with go.dev/blog redirecting to golang.google.cn for users who are not actually in China. Fixes golang/go#47846. Change-Id: Ie1545c46aa881fd0ff3bccecf03002659a397c73 Reviewed-on: https://go-review.googlesource.com/c/website/+/344010 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Julie Qiu <julie@golang.org> Website-Publish: Russ Cox <rsc@golang.org>
2021-08-19cmd/golangorg: don't serve tip.golang.org in go-discoveryDmitri Shuralyov
Serving tip.golang.org requires more memory, so app.yaml for golang-org was configured accordingly in CL 328214: # We need ~200 megabytes of RAM for tip.golang.org's GOROOT (including GC overhead). # Use F4 instance for 1GB RAM (4X the default size, 4X the default price). # Accept 4X the default maximum concurrent requests to balance out. instance_class: F4 automatic_scaling: max_concurrent_requests: 40 The web server for go.dev is still running in go-discovery project for a bit longer as mentioned in CL 342898. Since it doesn't need to serve tip.golang.org, godevapp.yaml is not configured to have more memory. So, disable the memory-intensive and unneeded code path. Change-Id: I74114bd7954616430801f4a8e591379bc6867118 Reviewed-on: https://go-review.googlesource.com/c/website/+/343450 Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-08-18cmd/golangorg: add blog to valid hostsRuss Cox
Also hard-code EnforceHosts behavior. It was only optional to enable the old tip.golang.org server, but that code is dead or at least no longer pointed to by DNS. Hard-coding the EnforceHosts behavior makes for fewer prod-only test failures. Change-Id: Ib958b3f088c8175e67708efcd07426b9628b207b Reviewed-on: https://go-review.googlesource.com/c/website/+/343311 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
2021-08-18cmd/golangorg: move blog from blog.golang.org to go.dev/blogRuss Cox
This is the first of a sequence of consolidations of web sites into the single site go.dev. An accompanying blog post (next CL) will explain the change. The blog/_content tree moves to go.dev/_content/blog. The *.article files were converted to *.md files using rsc.io/tmp/blog2md. The old dot directives are now template function invocations, so that blog content files are now exactly the same format and semantics as regular site content files. All the old blog redirects are carried forward, of course. Also add exhaustive test that every .md file renders correctly. Also rename rawhtml to raw, because it gets used for raw Markdown too. The raw Markdown issue is working around a bigger problem (html/template is not really right for Markdown) that we will have to solve at some point, but not in this CL. Change-Id: Ifa9b3b8d656a72af30d0d4e57e4c7bc8dacbc386 Reviewed-on: https://go-review.googlesource.com/c/website/+/342091 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-08-18go.dev: update to new interim menusRuss Cox
Also fix site footer to file x/website issue, not x/pkgsite. Change-Id: I6549b7b4108ef51b41c2715577beb785943a50a6 Reviewed-on: https://go-review.googlesource.com/c/website/+/342093 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>