1
0
mirror of synced 2025-12-23 11:54:18 -05:00
Commit Graph

102 Commits

Author SHA1 Message Date
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
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
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
Mike Surowiec
26829bbae2 Update logging format for azure (#24830)
* update logging format for azure
2022-01-31 16:54:39 +00:00
Peter Bengtsson
acf3699ff3 wrap 'rest' middleware in asyncMiddleware (#24636) 2022-01-25 23:10:18 +00: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
26f4a568d4 spot-content-flaws middleware (#23451)
* spot-content-flaws

* now with 100% more color

* use kleur instead
2021-12-15 20:21:15 +00:00
Peter Bengtsson
10ca315bd5 Static assets should set ETag and Last-Modified (#23459)
* Static assets should set ETag and Last-Modified

* tests to prevent this ever happening again

* fix tests

Co-authored-by: docubot <67483024+docubot@users.noreply.github.com>
2021-12-15 16:57:39 +00:00
Mike Surowiec
d51ba61456 Add /healthz endpoint for liveness / readiness probe (#23716) 2021-12-14 21:24:10 +00:00
Peter Bengtsson
ae3dadfc66 cache asset images more aggressively (#23553)
* cache asset images more aggressively

* more careful about which gets the manual surrogate key

* fix rendered-content-link-checker script too

* feedbacked
2021-12-10 13:01:48 +00:00
Peter Bengtsson
7b5711e095 cache archived enterproxy proxy responses much longer (#23456)
* cache archived enterproxy proxy responses much longer

* Update middleware/archived-enterprise-versions.js

Co-authored-by: Rachael Sewell <rachmari@github.com>

Co-authored-by: Rachael Sewell <rachmari@github.com>
2021-12-08 19:55:12 +00:00
Peter Bengtsson
7c66d4456f static assets should not use csrf (Set-Cookie) (#23357)
* static assets should not use csrf (Set-Cookie)

Part of #1316

* move setFastlySurrogateKey up too
2021-12-06 13:00:34 +00:00
Kevin Heis
86b6b1ad6f Remove storybook (#21037)
* Remove storybook

* Update index.js
2021-08-23 12:07:54 -07:00
Kevin Heis
8d7bb82e47 Add basic auth to storybook (#20955)
* Add basic auth to storybook

* Update index.js

* Update index.js
2021-08-18 14:03:35 -07:00
Kevin Heis
ae7b652463 Create a storybook with callout component (#20902)
* Create a storybook with callout component

* Add to dist/storybook

* Remove references to dist dir, storybook takes place

* Update Callout.stories.tsx

* Update Dockerfile

* Update Dockerfile
2021-08-17 20:28:59 +00:00
Grace Park
27aa5d92ea Remove FEATURE_NEXTJS Flag Part 1 (#20176)
* cleanup FEATURE_NEXTJS

* fixing some server tests

* updating article a for server tests

* update h2 to h4 map topic tests

* data off on TOCs

* updating dropdown article versions links

* Update so markdown renders in intros

* updating typo and all server tests are now passing

* remove nextjs feature flag

* head.js tests pass

* updating article-version-picker

* remove nextjs feature flag browser test

* update header.js tests

* fix page-titles.js test

* fix deprecated-enterprise versions

* adding early access

* testing

* getting childTocItem

* fixing table of contents to show child toc items

* updated to 2 because the sidebar article also has the same link

* remove comment

* updating pick

* Update TocLandingContext.tsx

* update package.json and change className to h4 for h2

* updating with mikes feedback

* remove a.active test

* React clean up: Delete unnecessary layouts/includes Part 2 (#20143)

* Delete unnecessary layouts

* setting back tests failing :(

* update layouts

* delete unnecessary includes

* remove github-ae-release-notes and updating layouts

* remove a.active test
2021-07-16 14:54:25 -07:00
Kevin Heis
8a56437c93 Pretty format (#20352)
* Update prettier flow to include JS

* Run prettier

* ...run prettier
2021-07-14 14:35:01 -07:00
Kevin Heis
42e785b0a8 Migrate CommonJS to ESM (#20301)
* First run of script

* Get the app running --- ish

* Get NextJS working

* Remove `node:`

* Get more tests passing in unit directory

* Update FailBot test to use nock

* Update test.yml

* Update Dockerfile

* tests/content fixes

* Update page.js

* Update build-changelog.js

* updating tests/routing

* Update orphan-tests.js

* updating tests/rendering

* Update .eslintrc.js

* Update .eslintrc.js

* Install jest/globals

* "linting" tests

* staging update to server.mjs

* Change '.github/allowed-actions.js' to a ESM export

* Lint

* Fixes for the main package.json

* Move Jest to be last in the npm test command so we can pass args

* Just use 'npm run lint' in the npm test command

* update algolia label script

* update openapi script

* update require on openapi

* Update enterprise-algolia-label.js

* forgot JSON.parse

* Update lunr-search-index.js

* Always explicitly include process.cwd() for JSON file reads pathed from project root

* update graphql/update-files.js script

* Update other npm scripts using jest to pass ESM NODE_OPTIONS

* Update check-for-enterprise-issues-by-label.js for ESM

* Update create-enterprise-issue.js for ESM

* Import jest global for browser tests

* Convert 'script/deploy' to ESM

Co-authored-by: Grace Park <gracepark@github.com>
Co-authored-by: James M. Greene <jamesmgreene@github.com>
2021-07-14 13:49:18 -07:00
James M. Greene
2dbae93c53 Try to prevent late/duplicate response errors (#20077)
* Ensure all Express 'next' calls include 'return's

* Add headersSent checks during archived versions flow

* Return a 404 earlier if archived resource fetch fails

* Short-circuit responses for archived stuff

* Be more careful about responding to and short-circuiting after search requests

* Fix tests
2021-06-28 19:31:54 +00:00
Sarah Schneider
7e3e75616c Merge branch 'main' of github.com:github/docs-internal into feature-versioning 2021-06-23 15:59:37 -04:00
James M. Greene
7ee7a1aaaa Merge branch 'main' into feature-versioning 2021-06-22 15:28:34 -05:00
Grace Park
23f586bb93 merge and fix conflicts 2021-06-22 11:41:10 -07:00
Grace Park
d3d1902414 Merge pull request #20017 from github/upgrade-esm
Enforce and Move to Top Level require
2021-06-22 11:27:48 -07:00
Mike Surowiec
a24d01f78a Fix NextJS 500s (#20048)
* feat: allow server to contextualize request when on a /_next/data path

* add client side routing test, run lint

* enable nextjs client side routing
2021-06-22 17:30:40 +00:00
Grace Park
7f6a277a8e clear out dynamic require 2021-06-18 13:08:28 -07:00
Grace Park
b688ac036c update instrument middleware 2021-06-18 12:14:08 -07:00
Grace Park
0762734b43 fixed easy global requires 2021-06-17 18:39:38 -07:00
Sarah Schneider
a1c1a81b94 Merge branch 'main' of github.com:github/docs-internal into feature-versioning 2021-06-15 19:41:29 -04:00
Mike Surowiec
306f6fc75e Enable more react pages (#19935)
* enable more react landing pages

* move nextjs page logic to separate middleware

* enable codespaces landing page + fixes

* enable /education

* enable /admin

* use pathToRegexp to match routes for react rendering

* run lint

* fix: typo in url

* update sidebar test
2021-06-15 13:31:17 -07:00
Sarah Schneider
a200a74a0f Merge branch 'main' into support-short-versions 2021-06-14 19:52:04 -04:00
Mike Surowiec
6fbfa7d263 feat: add catch for bad accept-language header, prevent downstream 500 (#19909) 2021-06-14 22:45:29 +00:00
Sarah Schneider
7466e24a9b Merge branch 'main' of github.com:github/docs-internal into support-short-versions 2021-06-11 15:25:20 -04:00
Felicity Chapman
23b0b84111 Add Code security landing and guides pages (#19650) 2021-06-10 20:14:56 +00:00
Sarah Schneider
5d6d2d2cb7 Merge branch 'main' of github.com:github/docs-internal into support-short-versions 2021-06-09 17:00:37 -04:00
Sarah Schneider
d1cf56abd5 add short names = true to context object so we can access them in Liquid conditionals 2021-06-09 16:58:19 -04:00
Sarah Schneider
52daa592d3 Merge branch 'main' of github.com:github/docs-internal into middleware-perf-part2 2021-06-04 13:58:30 -04:00
Sarah Schneider
3a75d49a4f add middleware to enable feature-based versioning 2021-05-28 19:46:18 -04:00
Sarah Schneider
4008de0e4f Merge branch 'main' into github-ae-release-notes 2021-05-28 15:17:35 -04:00