1
0
mirror of synced 2025-12-21 02:46:50 -05:00
Commit Graph

11 Commits

Author SHA1 Message Date
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
23bcc0bb06 Use node-redis for rate limiter (#18416)
* Use [node-]redis as a direct dependency
* Extract Redis client creation to its own module
* Attach extensive logging in the Redis client creation module
* Allow the rate limiter to pass requests when Redis is disconnected
* Update rate-limit-redis
* Default error input to empty object for formatRedisError method
* Provide a name for the rate limiter's Redis client

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
2021-03-25 23:54:25 +00:00
James M. Greene
e94b52d7b5 Conditionally disable the TLS unauthorized cert check based on REDIS_URL (#17978)
* Conditionally disable the TLS unauthorized cert check based on REDIS_URL

* Update middleware/rate-limit.js
2021-02-24 23:35:39 +00:00
James M. Greene
8148677058 "Enable TLS" for Heroku Redis by ignoring self-signed TLS certificates (#17911)
* 'Enable TLS' for Heroku Redis by ignoring self-signed TLS certificates when creating Redis connections

https://devcenter.heroku.com/articles/heroku-redis#ioredis-module

* Clarify comments
2021-02-18 14:39:18 -06:00
Chiedo John
29be6be5c9 Make rate limiter configuration verbose (#17184)
Make rate limiter configuration verbose to prevent confusion in the
future.

Co-authored-by: chiedo <chiedo@users.noreply.github.com>
Co-authored-by: James M. Greene <JamesMGreene@github.com>
2021-01-07 16:40:50 +00:00
James M. Greene
ae20d046c5 Pass the Redis database number as an option rather than in the URL (#17194)
* Pass the Redis database number as an option rather than in the URL

* Remove rogue 'console.log'
2021-01-06 18:48:21 -06:00
James M. Greene
068c472084 Cache rendered pages in Redis (#17106)
* Explicitly set the Redis database number used for rate limiting

* Switch to using ioredis as the Redis client for rate limiting

* Install ioredis-mock as a primary dependency

* Create a Redis BasicAccessor class and tests

* Switch rendered page caching to use Redis for storage

* Add support for additional Redis SET options like TTLs

* Remove currently unused methods

* Rename redis-accessors/basic to redis-accessor and remove extra fluff

* Change default behavior for cache setting to throw if an error occurs

Add option allowSetFailures to facilitate graceful failures

* Allow SET failures to fail gracefully for the rendered page cache

* Remove as-yet unneeded serialization options from RedisAccessor

* Move Redis client construction into RedisAccessor constructor, just pass in databaseNumber as option

* Remove rendered-page-cache in favor of direct RedisAccessor use

* Add tests for RedisAccessor constructor param validations

* Eliminate one roundtrip to Redis for the cached HTML existence check

Are we fast yet?

* Set a rendered page cache TTL of 24 hours
2021-01-06 15:30:51 -06:00
Kevin Heis
4d2e25b429 Use Redis Store for rate limiting when available (#16484) 2020-11-16 15:55:07 -08:00
Chiedo John
89e546ffd1 Make Rate Limiter Aggressive on statuses > 400 (#15888)
Make Rate Limiter Aggressive on statuses > 400

This is based on the hypothesis that the Node
application shouldn't be getting hit with a large number of requests in
general thanks to Fastly and certainly shouldn't be getting hit with a
large number of requests that have status codes greater than 400 unless
a user or bot is trying to guess random URLs and as a result. For
example, see this IP address that caused some site issues on October 3

Co-authored-by: Chiedo <chiedo@users.noreply.github.com>
Co-authored-by: Jason Etcovitch <jasonetco@github.com>
2020-10-05 10:36:13 -04:00
Vanessa Yuen
3df90fc9b8 Hello git history spelunker!
Are you looking for something? Here is all of the GitHub Docs history in one single commit. Enjoy! 🎉
2020-09-27 14:10:11 +02:00