Commit graph

50 commits

Author SHA1 Message Date
Mac Siri
140f85695b
Add forgot_password_throttle (#19175) 2023-02-27 09:25:29 -05:00
Fernando Valverde
2517a4dac9
Remove rack attack throttle for admin users in API requests (#18612)
* remove rack attack throttle for admin users

* Add tests

* Optimize cache admin secrets for 24h with invalidation when needed

* Make ApiSecret callback only execute on create
2022-10-25 09:26:38 -06:00
Mac Siri
2413ece281
Use remote_ip in Rack::Attack (2nd attempt) (#18409) 2022-09-06 10:06:29 -04:00
Mac Siri
0ea60867d4
Revert all Rack::Attack changes (#18407) 2022-08-31 18:11:56 -04:00
Mac Siri
05f0e72c24
Simplify Rack::Attack (#18403) 2022-08-31 16:58:34 -04:00
Mac Siri
560bff9403
Move rack_attack.rb (#18402) 2022-08-31 14:28:26 -04:00
Mac Siri
9c0fc6b918
Use remote_ip in Rack::Attack (#18397) 2022-08-31 10:50:26 -04:00
Jamie Gaskins
a9cdb2bae2
A suspended user returns 403 instead of 500 (#16408) 2022-02-04 09:42:23 -05:00
Michael Kohl
09828853f6
✂✂✂ Remove Connect (#14734)
* Remove Connect

* Remove more Connect specs

* Remove a lot more Connect code

* 🚮

* It all has to go

* Explicitly add httpclient

* Update application layout

* Remove messages association from User

* Start fixing specs

* reintroduce util function and refactor references

* Remove Connect Cypress test

* Fix more specs

* Remove Connect from listings

* Ignore contact_via_connect column on listings

* Remove contact_via_connect usages

* Ignore mod_chat_channel_id on tags

* Drop Connect tables

* Remove email_connect_messages from user notification settings

* Re-add httpclient 2.8.3

This was mistakenly removed as a merge conflict

* Don't need to exclude removed chat channel file

* Remove unneeded style for chat channels

* Remove unneeded channel list prop type

* Remove chat channels index/connect-link from getPageEntries

* Re-add comment from httpclient in Gemfile

* Remove connect references from mailers

Tag Moderators no longer have a chat channel

No longer will users be notified about new messages (there won't be
any)

No longer will users be notified about channel invites (you can't
invite anyone anymore)

* Don't configure Pusher and remove PUSHER_* from .env_sample

since it's removed from gemfile, the Pusher constant will not resolve, if this is
configured in the environment variables we'll fail to boot.

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Dan Uber <dan@forem.com>
2021-11-18 08:21:00 -06:00
Michael Kohl
c7ba9d81db
Clean up feed-related code (#14707)
* Start cleaning up feed code

* Move published_articles_by_tag to service

* Add timeframe and latest feed services

* fixup! Move published_articles_by_tag to service

* Move constant to correct location

* Fix spec
2021-09-17 09:23:32 +07:00
dependabot[bot]
f24d3d157f
Bump rubocop-rails from 2.10.1 to 2.11.0 (#14043)
* Bump rubocop-rails from 2.10.1 to 2.11.0

Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.10.1...v2.11.0)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

* Enable new cops and fix violations

* Remove expected string literal

As we're passing a block (that yields a string) there are no arguments
to the debug call.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rhymes <github@rhymes.dev>
Co-authored-by: Dan Uber <dan@forem.com>
2021-06-22 11:25:28 -05:00
dependabot[bot]
609afc71c7
Bump rubocop from 1.15.0 to 1.16.0 (#13894)
* Bump rubocop from 1.15.0 to 1.16.0

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.15.0...v1.16.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

* Enable new cops and fix violations

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rhymes <github@rhymes.dev>
2021-06-02 09:11:38 -04:00
Chien-Wei Huang (Michael)
a4c06d3207
Extract tag stories to tag articles controller (#13457) 2021-05-24 13:44:43 -04:00
Michael Kohl
6dfabd578f
Rename SiteConfig to Settings::General (#13573)
* Rename SiteConfig

* More renaming

* Update spec

* Update mandatory settings mapping

* More renaming

* e2e test fixes

* You have a rename, and you have a rename

* Spec fix

* More changes

* Temporarily disable specs

* After-merge update

* Undo rename for migration

* undo rename of DUS

* Fix DUS

* Fix merge problem

* Remove redundant DUS

* Fix specs

* Remove unused code

* Change wrong class name

* More cleanup

* Re-add missing values to constant

* Fix constant

* Fix spec

* Remove obsolete fields

* Add accidentally removed field

* Update spec

* Move methods from Settings::General to ForemInstance

* Remove unneeded model

* Change mentions of 'site config'
2021-05-21 14:45:37 +02:00
rhymes
70e0e9b83a
[15 min fix] Fix some autoloading deprecation warnings (#13793)
* Fix autoloading for RateLimitChecker

* Fix autoloading for ForemStatsClient

* Fix autoloading for middlewares

* Move things to their proper place

* Move middleware usage to the proper place

* Re-add rest-client in datadog driver correctly

* Already required in config/initializers/middlewares.rb

* Bring that back

* Fix Honeybadger spec
2021-05-20 18:10:25 +02:00
Alex
a0ddb6a848
Cleanup search classes and serializers (#13645) 2021-05-05 09:20:59 -04:00
Alex
393ba00221
Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606)
* Attempt number 1

* Fix rack_attack specs

* Fix users_searches_users spec

* Fix display_users_search_spec

* Fix comment typo

* Remove search:destroy task from cypress

* Remove port 9300 from gitpod

* Stub response in attack_spec
2021-05-03 11:09:45 -04:00
rhymes
351d4f8da7
Fix regression in Honeybadger.config.exceptions.ignore (#12796) 2021-02-23 19:08:29 +01:00
Mac Siri
677203d225
Optimize StoriesController's tagged article count (#12581) 2021-02-04 15:59:46 -05:00
Molly Struve
2e6397d319
Optimization:Throttle Tag Index Endpoints (#12520) 2021-02-03 11:14:54 -05:00
Molly Struve
a741dceace
Refactor:Implement Carrierwave Monkeypatch in all Envs (#11233)
* Refactor:Implement Carrierwave Monkeypatch for all Envs

* add a spec for monkey patch
2020-11-03 10:51:53 -06:00
rhymes
caad342033
Small Rubocop fixes (#11182) 2020-10-30 14:45:55 +01:00
Molly Struve
ad2184ebf6
[deploy] Refactor:Change Unset Var Warnings to Debug Level (#9985) 2020-08-25 09:45:42 +02:00
Molly Struve
0a64ac067b
[deploy] Remove ENVied Gem, Use dotenv Take 2 (#9767) 2020-08-14 12:20:47 -05:00
rhymes
e727956640
Revert "[deploy] Refactor:Remove ENVied Gem, Use dotenv Instead for Test and Development (#9621)" (#9757)
This reverts commit 1be8c72206.
2020-08-12 13:28:38 -04:00
Molly Struve
1be8c72206
[deploy] Refactor:Remove ENVied Gem, Use dotenv Instead for Test and Development (#9621)
* Refactor:Remove ENVied Gem in Favor of Default application.yml

* Copy sample_application.yml for Travis

* Create .env_sample file, Warn of missing ENV variables, ignore .env file

* Use dotenv For ENV variables and create Rake Task to Populate

* Update docs to copy .env_sample file

* make application config a bit more resilient

* update more documentation and only initialize dotenv in dev and test

* Update doc code snippet types and refactor rake task and app config

* remove push defaults

* Make initializers more resilient, remove unused ENV from travis

* Exit new rake task if application.yml does not exist, include dotenv in docs
2020-08-12 11:01:38 -04:00
rhymes
f1ec04a0c9
Rubocop: move dot in multi-line calls to leading position (#9262) 2020-07-16 15:51:11 +02:00
rhymes
ffc96db209
Rubocop: fix additional violations in todo file (#9218) 2020-07-09 10:25:44 -04:00
rhymes
5b62811c98
[deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
rhymes
90c6e30972
Remove unused test for Redis cache store (#9102) 2020-07-05 14:13:19 -05:00
Dmitry Maksyoma
be07697d6d
Adapt dev env to run on a remote box (#8232)
* Adapt dev env to run on a remote box

* webpack-dev-server ignores CLI arguments, so switched to environment
  variables.
* Dynamically determine remote webpack host via APP_DOMAIN environment
  variable, defined in application.yml.
* Setup content security policy to allow connecting to webpack on a
  remote box, defined by APP_DOMAIN environment variable.

* Make Webpacker listen on 0.0.0.0

* Account for APP_DOMAIN port

* Add support for URI scheme and tests

* Fix a spec by disabling a Rubocop linter
2020-06-18 13:01:49 +02:00
Molly Struve
14c2372ae7
[deploy] Add API Key to API Write Throttle (#8110) 2020-05-28 09:45:01 -05:00
Molly Struve
7dd249ac21
[deploy] Add Back Tracking API-keys in Honeycomb (#7868) 2020-05-14 15:10:15 -05:00
Molly Struve
8ae486a362
[deploy] Track and Limit API writes by IP Address (#7847) 2020-05-14 14:13:56 -05:00
Molly Struve
96aefa873a
[deploy] Limit User Email Changes (#7746) 2020-05-11 10:42:37 -05:00
Molly Struve
81c9b27a7f
Track IPs and API Tokens for Throttled Requets, Send Retry After Header (#7735) 2020-05-08 10:16:49 -04:00
Molly Struve
f190f4c6c0
[deploy] Track Client IPs to Help Block Bad Actors (#7730) 2020-05-07 12:45:30 -05:00
Molly Struve
2ba6c98e81
Limit 1 message every second for single user (#7631)
* limit 1 message every second for  single user

* increase message limit to 2 in a second
2020-04-30 19:06:19 -04:00
Tam Chau
ffba42cf43
Add expires_in option for ActiveSupport::Cache::RedisStore#increment method (#7515)
* rails patch to fix expires_in for increment method

* fixup! rails patch to fix expires_in for increment method

correct test case

* fix redundant file name & class name

* add comment to explain monkey patch for RedisCacheStore#increment
2020-04-27 16:40:49 +02:00
Molly Struve
edcd019e9c
[deploy] Throttle General Site Requests (#7418) 2020-04-23 08:58:27 -05:00
Molly Struve
b652147e7a
throttle API get and write endpoints (#7167) 2020-04-08 19:17:51 -04:00
Molly Struve
55fe5a40a8
Add Rack::Attack Gem to Throttle Requests, Only Search to start (#6841) [deploy]
* throttle requests made to search endpoints

* stub elasticsearch requests in rack attack specs and disable for running specs unless tagged

* use original client IP from fastly to throttle requests to search endpoints
2020-03-30 12:09:40 -04:00
rhymes
e27c9b77a3
Refactor Elasticsearch client access (#6307) [deploy]
* Add Transport module to Search
* Test public methods only
* Add Search::Client with exception handling
* Remove Transport and request do
* Replace SearchClient with Search::Client
2020-02-28 11:38:37 -05:00
Molly Struve
2207f795b1
Hookup Elasticsearch in travis (#5871) 2020-02-04 08:20:14 -05:00
Molly Struve
a19ce5518e
combine Rack::Timeout::RequestTimeoutErrors with Exceptions in Honeybadger (#5789) [deploy] 2020-01-28 16:55:51 -05:00
Molly Struve
25e985cfce
Group all PG::TRDeadlockDetected and PG::QueryCanceled errors together (#5681) [deploy] 2020-01-23 17:54:46 -05:00
Molly Struve
9638e3da26
Group Honeybadger Rack::Timeout::RequestTimeoutExceptions (#5231) [deploy] 2019-12-23 19:34:08 -06:00
Molly Struve
a2bef6aeec
Group Internal Errors when sending to HoneyBadger (#5067) 2019-12-10 13:48:06 -06:00
Molly Struve
addec4b72d
Group all BANNED errors in Honeybadger (#5027) [deploy] 2019-12-06 10:59:27 -06:00
Molly Struve
8097b7f8cb Group SIGTERM fetch_all_rss rake task Honeybadgers together (#5021) [deploy] 2019-12-05 17:38:35 -05:00