1
0
mirror of synced 2025-12-23 03:44:00 -05:00
Commit Graph

490 Commits

Author SHA1 Message Date
Peter Bengtsson
bada144c36 lower rate limit in production much higher in dev and test (#25688)
* lower rate limit in production much higher in dev and test

* custom rate limit for browser tests

* feedbacked
2022-02-28 16:58:48 -05:00
Rachael Sewell
2ade7d8489 reactify rest pages (#25005) 2022-02-28 18:30:54 +00:00
Peter Bengtsson
77bfe49215 don't record temporary redirects (#25668) 2022-02-25 13:45:31 -05:00
Peter Bengtsson
6a6dafaedb Enable rate limiting (#25642)
* Enable rate limiting

* higher limit specifically when running tests
2022-02-24 23:58:01 +00:00
Peter Bengtsson
970a3cd5fe remove x-soft-rate-limit debugging header (#25635) 2022-02-24 19:38:07 +00:00
Peter Bengtsson
d0524e5124 make sure req.ip becomes correct (#25628)
* make sure req.ip becomes correct

* feedbacked
2022-02-24 17:54:09 +00:00
Peter Bengtsson
17b44323f9 it's fastly-client-ip not Fastly-Client-IP (#25623) 2022-02-24 12:03:32 -05:00
Peter Bengtsson
43f03575a1 use namespace for consistency (#25615) 2022-02-24 14:41:24 +00:00
Peter Bengtsson
cf59025a0e use x-forwarded-for instead of ip in rate limit incr tag (#25585) 2022-02-23 21:11:16 +00:00
Peter Bengtsson
c976b9da6a formate /_ip with JSON instead (#25574) 2022-02-23 17:58:39 +00:00
Peter Bengtsson
177e197d8d soft rate limit all requests (#25556)
* rate limit all requests

* set IP in tags to statsd

* expose _ip route for assuring we get the right IP

* remove old unit test

* nit
2022-02-23 16:46:29 +00:00
Robert Sese
c200473442 Don't show hidden items with '/articles' (#25441) 2022-02-16 23:28:01 +00:00
Peter Bengtsson
19b246022a handle search with colon (#25128)
* handle search with colon

* nicer 400 errors

* split up by words first to avoid dangerous regex

* code comment
2022-02-15 21:56:50 +00:00
Peter Bengtsson
a867973876 serve /apple-touch-icon.png (#25371)
* serve apple-touch-icon.png

* rename

* 'directives'

* use a lazy but caching pattern

* update code comment
2022-02-15 21:35:08 +00:00
Peter Bengtsson
07c8fc3c2a Decouple redirects from language (#24597)
* experimenting with redirects

* cleanup developer.json

* wip

* clean console.log

* progress

* some progress

* progress

* much progress

* debugging tests

* hacky progress

* ditch latest -> number redirects

* minor

* hacky progress

* lots of progress

* some small fixes

* fix rendering tests

* small fixes

* progress

* undo debugging

* better

* routing tests OK

* more cleaning

* unit tests

* undoing lineending edit

* undoing temporary debugging

* don't ever set this.redirects on Page

* cope with archived version redirects

* adding code comments on the major if statements

* address all feedback

* update README about redirects

* delete invalid test

* fix feedback
2022-02-14 20:19:10 +00:00
Peter Bengtsson
caf0791694 support archived enterprise assets (#25224)
* support archived enterprise assets

* better tests
2022-02-11 15:58:05 -05:00
Peter Bengtsson
24d3ea6814 remove catch-bad-accept-language middleware (#25231) 2022-02-10 18:51:30 +00:00
Peter Bengtsson
5c9a83be7c Stop doing Gzip in the middleware (#25227) 2022-02-10 11:01:56 -05:00
Peter Bengtsson
e535e52280 minimize caching on static asset 404s (#25192) 2022-02-09 20:03:15 +00:00
Peter Bengtsson
1f93fe29ee denormalize archived-redirects-from-213-to-217.json by language (#24996)
* denormalize archived-redirects-from-213-to-217.json by language

* refactor again

* oops
2022-02-09 18:58:34 +00:00
Peter Bengtsson
a1c78717d5 cache the search API (#25068)
* cache the search API

* extend tests
2022-02-09 17:21:49 +00:00
Peter Bengtsson
94d976c1fa faster 404 for missing static assets (#25124) 2022-02-08 18:30:07 +00:00
Peter Bengtsson
8cea28a9b0 use manual surrogate key for nextjs static assets (#25096)
* use manual surrogate key for nextjs static assets

* refactor
2022-02-08 00:01:38 +00:00
Peter Bengtsson
f33ab1cf89 set 'manul-purge' surrogate key on assets/cb- URLs (#25028) 2022-02-04 11:55:40 -05:00
Peter Bengtsson
5252288755 archived asset redirects (#25025) 2022-02-04 16:32:01 +00:00
Peter Bengtsson
cc79340595 cache individual renderContent instead of page.render (#24955)
* cache individual renderContent() instead of page.render()

* remove commented code

* unbreak unit tests
2022-02-03 16:56:05 +00:00
Peter Bengtsson
6361591c45 serve a /favicon.ico (#24935)
* serve a /favicon.ico

* fix exception

* avoid res.sendFile() bcause CodeQL is worried
2022-02-03 00:11:59 +00:00
Mike Surowiec
2be0c5e09b Remove help-to-docs redirect; it's handled by fastly now (#24870) 2022-02-01 15:49:08 +00:00
Peter Bengtsson
896439c3c3 unbreak thinking the site's in AIRGAP mode (#24863) 2022-02-01 14:30:14 +00:00
Mike Surowiec
26829bbae2 Update logging format for azure (#24830)
* update logging format for azure
2022-01-31 16:54:39 +00:00
Peter Bengtsson
7acccdac9b load webhook versions at runtime instead of import-time (#24788)
* load webhook versions at runtime instead of import-time

* fix tests
2022-01-28 18:27:00 +00:00
Mike Surowiec
c5c148ab80 Use the same tags across connect-datadog and hot-shots (#24741)
* use the same tags across connect-datadog and hot-shots
2022-01-27 21:31:35 +00:00
Peter Bengtsson
b0586d0e09 don't allow data: in script-src (#24730) 2022-01-27 18:28:00 +00:00
Peter Bengtsson
9512ea52d3 graphql-explorer.githubapp.com is no more (#24720) 2022-01-27 16:08:01 +00:00
Peter Bengtsson
acf3699ff3 wrap 'rest' middleware in asyncMiddleware (#24636) 2022-01-25 23:10:18 +00:00
Kevin Heis
cd958e350e Cache all pages in-memory (#24555) 2022-01-24 18:39:25 +00:00
Peter Bengtsson
c42823af9d use 302 when redirecting from enterprise-server@latest to enterprise-server@<version> (#24494)
* use 302 when redirecting from enterprise-server@latest to enterprise-server@<version>

* correct tests
2022-01-21 17:10:09 +00:00
Peter Bengtsson
bc73bde6e5 Fix exclusion of English search indexes (#24501)
* debug search on stage

* debugging more

* keep more

* try again
2022-01-21 17:00:30 +00:00
dependabot[bot]
acc178e571 Bump express-rate-limit from 5.5.1 to 6.0.4 (#24046)
* Bump express-rate-limit from 5.5.1 to 6.0.4

Bumps [express-rate-limit](https://github.com/nfriedly/express-rate-limit) from 5.5.1 to 6.0.4.
- [Release notes](https://github.com/nfriedly/express-rate-limit/releases)
- [Changelog](https://github.com/nfriedly/express-rate-limit/blob/master/changelog.md)
- [Commits](https://github.com/nfriedly/express-rate-limit/compare/v5.5.1...v6.0.4)

---
updated-dependencies:
- dependency-name: express-rate-limit
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* MemoryStore()

* better

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
Co-authored-by: Peter Bengtsson <mail@peterbe.com>
2022-01-18 20:02:59 +00:00
Peter Bengtsson
fd32d3a4e2 fix local dev with Safari (#24205)
* fix local dev with Safari

* refactoring

* refactoring
2022-01-11 17:41:20 +00:00
Rachael Sewell
a340162d84 reorganize repository apis (#23728)
Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com>
Co-authored-by: Peter Bengtsson <peterbe@github.com>
2022-01-11 11:53:12 +10:00
Peter Bengtsson
4e4b2d25c0 Next v12 (#24082)
* next v12

* stick to exact

* avoid segfault
2022-01-07 18:34:10 +00:00
Rachael Sewell
0da2942dd3 remove storybook (#24122) 2022-01-06 12:11:58 -08:00
Peter Bengtsson
d15d4a29a2 delete disableCachingOnSafari middleware (#24094) 2022-01-06 14:45:56 +00:00
Mike Surowiec
6e2ee359dc Enable morgan logging in azure deployed environments (#24066)
* enable morgan logging in azure deployed environments

* include note about heroku logging
2022-01-05 18:06:11 +00:00
Peter Bengtsson
454375234e Mini-toc rendered twice for special case GraphQL pages (#24041) 2022-01-04 17:47:27 +00:00
Robert Sese
a2bd8ae67f Add support for videos to landing pages (#23801)
* Add new video properties frontmatter

* Handle video links in the middleware

* Video links don't have intros, authors, or full titles

* Make videos available from context

* Add default video heading

* Add basic tests for videos

* tmp videos test

* Remove stray test debugging

* more tmp videos testing

* Add videos test fixture

* Revert "more tmp videos testing"

This reverts commit 382946a5603ff217014797f77f37216bb8bb6c9c.

* Revert "tmp videos test"

This reverts commit 8767d0eaf08bd4ca04e2dacd12d476a2506c0367.
2021-12-17 11:09:00 -06:00
Kevin Heis
4be9444023 Cache API pages attempt 2 (#23762)
* Update render-page.js

* Update render-page.js

* Update render-page.js

* Update render-page.js

* Consistently use const path = req.pagePath || req.path

* Update render-page.js

* Run memory cache even on test and CI

* feedbacked

* Add an exception for caching the GraphQL Explorer

See https://github.com/github/docs-internal/pull/19611

* pretty-fy

Co-authored-by: Peter Bengtsson <mail@peterbe.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
Co-authored-by: James M. Greene <JamesMGreene@github.com>
2021-12-16 18:14:02 +00:00
Peter Bengtsson
9782b804a0 refactor redirecting specifically for the old query string key (#23749)
* refactor redirecting specifically for the old query string key

* fix tests
2021-12-16 13:09:37 +00:00
Rachael Sewell
45f1a41e79 prerender graphql mutations page (#23757) 2021-12-15 12:28:39 -08:00