1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Commit Graph

143 Commits

Author SHA1 Message Date
Peter Bengtsson
d3fe424810 only include productGroups in main context on homepage (#31640) 2022-10-17 20:27:19 +00:00
Peter Bengtsson
74103cd650 redirect /search to /api/search/legacy (#31566) 2022-10-10 19:23:54 +00:00
Sarah Schneider
b7f48ea2c1 Support GHAE internal-only semantic versioning (#29178)
Co-authored-by: Peter Bengtsson <mail@peterbe.com>
Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com>
2022-09-22 08:26:58 +02:00
Peter Bengtsson
edc25dd421 re-read content on every request (#30646) 2022-09-13 13:06:33 +00:00
Kevin Heis
688a274f1f Remove CSRF check (#29910)
* Use color_mode for gating "sign up" button

* Remove csrf check

* Add `res.removeHeader('set-cookie')` to cache-control

* Update static-assets.js

* Remove package

* Remove tough-cookie

* Update cache-control.js

* Update cache-control.js

* Update cache-control.js
2022-08-15 19:28:42 +00:00
Peter Bengtsson
f8f20605f4 search api with elasticsearch (#29053)
* indexing records into Elasticsearch

* @elastic/elasticsearch@8.2.0

* mv

* fix the code

* pipe

* lfs

* use sha

* change how index names work

* search api with Elasticsearch

* works

* refactor client

* better snowballing

* remove dbg

* wip

* highlights and fuzzy search

* improvements and upgrade

* also upgrade

* wip

* index more explicitly

* better validation

* change max size

* popularity by ordinal ranking instead

* playing

* fix package-lock

* rearranging

* catchMiddlewareError

* fix indexing

* match_phrase_prefix on wrapped search

* refactorings

* escape html in content

* wip

* search by URL

* update lock file

* v1 api

* inroads on jest testing the search

* valid yaml hopefully

* index fixtures into local elasticsearch

* specific versions to index only

* small fixes

* feedbacked

* fix tests

* use the npm script
2022-08-05 19:40:38 +00:00
Peter Bengtsson
67c1ff3441 Remove overload protection (#29659) 2022-08-05 15:04:33 +00:00
Kevin Heis
bb1f30a39b Update HTML cache control to 10 minutes (#29586)
* Update HTML cache control to 10 minutes

* A little clean up

* Remove quick-lru
2022-08-03 20:39:54 +00:00
Rachael Sewell
467459af7c Reactify graphql pages (#28547) 2022-08-03 10:51:21 -07:00
Kevin Heis
bee3b5c9f3 Enable up to one minute of HTML caching (#29572)
* Enable up to one minute of HTML caching

* Skip a test that isn't the level of cache control we now want
2022-08-03 16:26:53 +00:00
Kevin Heis
a16aeac936 Prepare render-page for re-enabling HTML caching (#29473)
* Prepare render-page for re-enabling HTML caching

* Prepare render-page for re-enabling HTML caching

* Prepare render-page for re-enabling HTML caching

* Update healthz.js

* Pre calculate cache control directives

* Update render-page.js
2022-07-29 19:49:36 +00:00
Kevin Heis
bb3cb78dd1 Move events under api (#29298) 2022-07-26 18:00:58 +00:00
Kevin Heis
564e3a5e2a Move CSRF response back to XHR (Node.js prep) (#29179)
* Move CSRF response back to XHR

* Update events.js

* Pass through cookieJar

* Enable session route test

* Skip next x csrf test

* Add other fields to endpoint for future issues

* Remove client side parts

* Revert test skip

* Use nested router pattern

* ugh forgot a file

* Update naming

* Update tests/rendering/session.js

Co-authored-by: Peter Bengtsson <peterbe@github.com>

* Updating to use cache control

* Use req.langauge and req.userLanguage

Co-authored-by: Peter Bengtsson <peterbe@github.com>
2022-07-22 18:17:22 +00:00
Peter Bengtsson
642c971049 morgan logging off by default in tests (#28987) 2022-07-12 20:53:34 +00:00
Kevin Heis
71fedb1f31 Update to helmet 5 (#28488)
* Update to helmet 5

* Disable cross-origin-embedder-policy

* Update helmet.js

* Update helmet.js

* Add CORS on get / options

* Update helmet.js

* Update helmet.js

* Update helmet.js

* Update helmet.js

* Revert "Update helmet.js"

This reverts commit 61ad2fb641ca16a31bf148164c395f2ba91e1734.

* Open up github domains

* Include self

* Update helmet.js

* Update helmet.js
2022-06-14 21:43:25 +00:00
brannon
000a34a1a7 Add explicit config value to enable Fastly testing. 2022-06-03 09:52:02 -06:00
brannon
e7ec9ad487 Merge branch 'main' into brannon-serve-stale-content 2022-06-02 17:33:13 -06:00
brannon
d575b8edd6 Update Fastly test middleware to run in staging ONLY.
Add ability to set more headers to mimic real content responses.
Add ability to inject errors, to help in validating behavior.
2022-06-02 17:19:53 -06:00
Peter Bengtsson
d014f36222 fix external redirects (#28063)
* fix external redirects

* oops

* feedbacked
2022-06-02 02:06:29 +00:00
Peter Bengtsson
7e614adc12 wrap async middlewares correctly (#28030)
* wrap async middlewares correctly

* clean up more

* feedbacked
2022-06-01 15:13:23 +00:00
Mike Surowiec
8baf00154f disable per-request logging in production (#28056)
* disable per-request logging in production

* cleanup log disabling

Co-authored-by: Peter Bengtsson <mail@peterbe.com>
2022-05-31 21:34:10 +00:00
Peter Bengtsson
0340760554 remove spotContentFlaws middleware (#28068) 2022-05-31 18:19:16 +00:00
Peter Bengtsson
75c0ec5cab /en/ permanent redirects to /en should be CDN cacheable (#27976) 2022-05-25 13:51:16 +00:00
Mike Surowiec
fac6d5a85c feat: remove sigsci (#27932) 2022-05-24 09:49:19 -05:00
Peter Bengtsson
bfd9ae0aed fast root redirect (#27925) 2022-05-23 21:36:58 +00:00
Peter Bengtsson
18504871b9 cache full rendering (#25424)
* cache full rendering

* still not working with gzip

* progress progress progress

* smaller

* hacky progress

* small fixes

* wip

* lock file

* wip

* wip

* package-lock updates

* wip

* search DOM in lowercase

* simplify

* with instrument

* improve test coverage

* mutateCheeriobodyByRequest

* fix

* remove renderContentCacheByContex

* disable render caching in sync-search

* diables things in github/github link checker

* gzip lru

* tidying up

* updated

* correct tests

* fix: move userLanguage to LanguagesContext

* Revert "fix: move userLanguage to LanguagesContext"

This reverts commit d7c05d958c71eaad496eb46764eb845d80b866ca.

* contexts ftw

* fixed rendering tests

* oops for got new file

* nits addressed

Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>
2022-05-23 12:12:09 +00:00
brannon
6f5255cb92 Add comments explaining the purpose of the fastly-cache-test middleware. 2022-05-19 14:50:56 -06:00
brannon
671b9a81b9 Add endpoint for testing different cache settings in Fastly 2022-05-19 12:59:35 -06:00
Peter Bengtsson
b0d1d5cd20 fix use of DISABLE_OVERLOAD_PROTECTION (#27711) 2022-05-16 13:51:38 +00:00
Peter Bengtsson
5630a4139a process.env.DISABLE_OVERLOAD_PROTECTION (#27692) 2022-05-13 15:29:52 -07:00
Peter Bengtsson
1108ecda90 remove loader.io middleware (#27678) 2022-05-13 08:16:19 -07:00
Peter Bengtsson
8580fb5e42 fast HEAD requests (#27672)
* fast HEAD requests

* update test
2022-05-13 14:46:57 +00:00
Mike Surowiec
b93a3ec387 feat: add overload-protection (#27612)
* feat: add overload-protection

* Update middleware/overload-protection.js

Co-authored-by: Peter Bengtsson <mail@peterbe.com>

* fix: tests

Co-authored-by: Peter Bengtsson <mail@peterbe.com>
2022-05-12 16:34:25 +00:00
Mike Surowiec
ed8eda1f60 feat: add signal sciences (#27640)
* tmp: add sigsci

* add sigsci.js

* add sigsci.js

* feat: add sigsci to middleware

* convert sigsci to esmodule

* add sigsci-agent to docker-compose.tmpl
2022-05-12 16:15:17 +00:00
Peter Bengtsson
6605154221 Revert "Fastly Signal Science agent and module (#27529)" (#27624)
This reverts commit aae78966ef.
2022-05-11 14:39:47 -07:00
Peter Bengtsson
aae78966ef Fastly Signal Science agent and module (#27529)
* Fastly Signal Science agent and module

* create an assets/build.txt

* try that

* don't experiment with build-args

* do it not just for public builds

* fix comment

* remove experimentation

* actually try using it

* bit louder

* correction

* remove debug logging
2022-05-11 21:18:01 +00:00
Peter Bengtsson
36da8f2c73 expose build SHA (#27542)
* expose build SHA

* dbg

* dbg

* dbg

* sub

* oops

* oops

* try this

* debugging

* debugging

* debugging

* debugging

* debugging

* without quotes

* typo

* typo

* singular

* mention in Dockerfile

* plural

* does this work

* does this work

* tidying up

* no cache

* Update middleware/index.js

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
2022-05-11 19:14:30 +00:00
Rachael Sewell
749efd7b99 Rest redirect endpoint (#27027) 2022-04-25 16:14:04 +00:00
Peter Bengtsson
a4def10b2c remove rate limiter and slow-down middleware (#26709)
* remove rate limiter and slow-down middleware

* update package-lock.json after node-fetch removal in main
2022-04-05 19:38:25 +00:00
Peter Bengtsson
0a0c83db5b refactor early access breadcrumbs (#26558)
* refactor early access breadcrumbs

* Update permissions metadata to include users and teams with explicit access

* Inform users of permission requirement for dependabot alerts

* Apply suggestions from code review

* version previews (#26571)

* update search indexes

* New translation batch for pt (#26591)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/fix-translation-errors.js

* Run script/i18n/lint-translation-files.js --check rendering

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=pt

* run script/i18n/reset-known-broken-translation-files.js

* Update subcategories for Codespaces (#25812)

* Version actions for GHES, use reusables (#26004)

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
Co-authored-by: Sarah Edwards <skedwards88@github.com>

* New translation batch for ja (#26599)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/lint-translation-files.js --check rendering

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=ja

* run script/i18n/reset-known-broken-translation-files.js

* Check in ja CSV report

Co-authored-by: Grace Park <gracepark@github.com>

* New translation batch for cn (#26598)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/lint-translation-files.js --check rendering

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=cn

* run script/i18n/reset-known-broken-translation-files.js

* Check in cn CSV report

Co-authored-by: Grace Park <gracepark@github.com>

* New translation batch for es (#26597)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/fix-translation-errors.js

* Run script/i18n/lint-translation-files.js --check rendering

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=es

* run script/i18n/reset-known-broken-translation-files.js

* Check in es CSV report

Co-authored-by: Grace Park <gracepark@github.com>

* update search indexes

* Rename xxtest-devcontainer.json to devcontainer.json

* Delete .devcontainer/java-environment directory

* Delete .devcontainer/ruby-environment directory

* Update development.md

* Update CONTRIBUTING.md

* Add link to troubleshooting (#26514)

* update search indexes

* fix old tests

Co-authored-by: Anthony Swierkosz <anthony@swierkosz.dev>
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
Co-authored-by: Sarah Edwards <skedwards88@github.com>
Co-authored-by: GitHub Actions <action@github.com>
Co-authored-by: docubot <67483024+docubot@users.noreply.github.com>
Co-authored-by: Brian McManus <bdmac@github.com>
Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com>
Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
Co-authored-by: Grace Park <gracepark@github.com>
Co-authored-by: hubwriter <hubwriter@github.com>
2022-04-01 10:25:07 -04:00
Mike Surowiec
31acea648d feat: add slow down middleware (#26207)
* feat: add slow down middleware

Co-authored-by: Peter Bengtsson <mail@peterbe.com>
2022-03-15 13:31:12 -05:00
Rachael Sewell
2ade7d8489 reactify rest pages (#25005) 2022-02-28 18:30:54 +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
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
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
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
94d976c1fa faster 404 for missing static assets (#25124) 2022-02-08 18:30:07 +00:00