Commit graph

41 commits

Author SHA1 Message Date
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