Commit graph

132 commits

Author SHA1 Message Date
Molly Struve
1156aff711
Ignore ActiveRecord::QueryCanceled errors in Honeybadger (#5165) [deploy] 2019-12-18 13:09:49 -06:00
Ben Halpern
630c1b7425
Migrate to streaming app shell via serviceworkers (#5020) [deploy]
* Initial work for streaming app shell way of using serviceworkers

* Close in on serviceworker adjustment finalization

* Add docs and loading indicator

* Remove useless code

* Don't run on API

* Update app/javascript/contentDisplayPolicy/hideBlockedContent.js

* Fix small details

* Don't run serviceworker.js code in test env

* Fix JS in serviceworker

* Move private keyword to proper place in async controller

* Change shell_version to HEROKU_SLUG_COMMIT

* Update caching config

* Add test for async_info/shell_version
2019-12-16 12:21:33 -05:00
Keith Bennett
70e1ffbbc3 Fix rubocop Rails.root.path complaints (#5114) 2019-12-16 12:13:15 -05:00
Molly Struve
a2bef6aeec
Group Internal Errors when sending to HoneyBadger (#5067) 2019-12-10 13:48:06 -06:00
Molly Struve
7c650dcb1c
Remove RedisRailsCache and replace with Rails.cache (#5059) [deploy] 2019-12-10 13:11:08 -06:00
Molly Struve
b2872eb2f3 Don't alert Honeybadger until right before a job is going to fail (#5058) [deploy] 2019-12-09 14:58:14 -05:00
Molly Struve
90712f61c6
Remove memcache dalli gem and setup code (#5057) [deploy] 2019-12-09 11:37:53 -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
Molly Struve
834eb51e98
Replace Airbrake with Honeybadger (#5007) [deploy] 2019-12-05 11:29:51 -06:00
rhymes
193bbd7349 Explain why we can't enable certain Rails 5.2 features just yet (#5005) 2019-12-04 11:08:02 -06:00
rhymes
e4b0331184 Update initializer and locales to doorkeeper 5.2.2 (#5004) 2019-12-04 11:44:46 -05:00
rhymes
d9803fef13 Enable default protect from forgery (#4827) [deploy] 2019-12-03 14:53:39 -05:00
Mac Siri
2ee4e703eb
Remove disable_indented_code_blocks (#4988) [deploy]
We have decided enable indented-code-block because it is an expected
markdown feature. The trade-off here is that backticks will cause
rendering issues in codeblock.
2019-12-03 13:04:53 -05:00
rhymes
d76c914f68 Set default Fastly Rails caching back to 30 days (#4996)
* Set default Fastly Rails caching back to 30 days

* Update reactions spec to use Fastly values instead of harcoded ones
2019-12-03 11:29:25 -05:00
Ben Halpern
585d672742
Replace serviceworker-rails gem with custome implementation (#4987) [deploy]
* Customize UserContext in Timber logs

* Replace serviceworker-rails gem with custome implementation
2019-12-03 08:50:56 -05:00
Ben Halpern
ff9b1cdeaa
Customize UserContext in Timber logs (#4972) [deploy] 2019-12-02 13:21:52 -05:00
rhymes
c08e5f0a25 Remove rubyzip initializer (#4935) [deploy]
No longer necessary on Rubyzip 2
2019-11-26 11:25:16 -05:00
rhymes
71b25f9bc7 Enable AES-256-GCM on encrypted messages (#4826) [deploy] 2019-11-22 16:54:28 -05:00
leewynne
5b50d52b5f Replaced hard coded AWS region in carrierwave.rb and sitemaps.rb. Updated legacy migration files to include pre rails 5 version (this resolved new instances on Heroku) (#4874) [deploy]
* missing rails version 4.2 added to pre 5 migrations

* updated carrierwave.rb and sitemap.rb with AWS_DEFAULT_REGION
2019-11-22 09:07:59 -05:00
rhymes
c15d48265a Routine rubocop fixes (#4859) 2019-11-19 10:46:47 -05:00
rhymes
05bd144cde Enable action_view.form_with_generates_ids (#4829) [deploy] 2019-11-19 09:32:48 -05:00
rhymes
2ca23c8983 Enable AES-256-GCM on encrypted cookies (#4216) [deploy] 2019-11-14 13:08:47 -05:00
rhymes
9d347e5e81 Use REDIS_SESSIONS_URL and default to REDIS_URL (#4801) [deploy] 2019-11-12 12:45:35 -05:00
Andy Zhao
b2e18aeb72 Use Redis for session storage (#4004) [deploy]
* WIP use redis-session-store for sessions

* Use Redis as session storage

* Add redis-server to Travis

* Use integer for SESSION_EXPIRY_SECONDS env variable

Co-Authored-By: rhymes <rhymesete@gmail.com>

* Remove sessions b/c no custom sessions logic

* Use ApplicationConfig instead

* Rename default value

* Remove rememberable module

* Persist the user for the test

* Remove remember_me related tests

* Revert 'undo remember_me' commits

* Add redis to procfile

* Cleanup devise configuration

* Move REDIS configuration in the basic configuration section

* Make sure the expiration time can't zero

* Restore old order and remove useless comment line

* Delete legacy session cookie after login

Once deployed the server will start using the new session cookie, this makes sure the legacy one is deleted on the user's browser

* Remove redis from Procfile

* Add signed, secure and httponly to the Redis session cookie
2019-11-12 10:10:34 -06:00
Kate Studwell
a7e03c89d6 Disable indented code blocks in markdown renderer (#4438) 2019-11-05 14:15:39 -05:00
Ben Halpern
d34dbae4c2
Add /future redirect (#4724)
* Add /future redirect

* Add check for HONEYCOMB_API_KEY

* Whoops wrong branch
2019-11-05 08:41:25 -05:00
Ben Halpern
628c044f3f
Check for existence of honeycomb before using it (#4725) 2019-11-05 08:38:42 -05:00
rhymes
0591362756 Use libhoney explicitly and group initializers (#4699) [deploy]
* Use libhoney explicitly and group initializers

* Use Libhoney TestClient during tests

* Use test client for Honeycomb during tests as well
2019-11-04 11:55:04 +00:00
Molly Struve
faaf6e35f1 Create custom HoneycombClient (#4692) [deploy] 2019-11-01 17:11:57 -04:00
Molly Struve
00e3ee811b Use ActiveSupport::Cache::RedisCacheStore As RedisRailsCache (#4676) [deploy] 2019-11-01 12:19:12 -04:00
Molly Struve
dc72b4f1fa Add Honeycomb beeline gem for monitoring and observability (#4649) 2019-10-30 12:02:31 -04:00
Molly Struve
69e35dc1b3 Add Redis gem and Create RedisClient (#4582)
* Add redis gem and client

* use keyword arguments in redis initializer

* check for REDISCLOUD_URL and fallback on REDIS_URL when connecting to redis

* dont parse Redis url in initializer
2019-10-30 10:32:59 -04:00
rhymes
8989a52aba Strip EXIF and GPS data from uploaded images (#4450)
* Add specs for ArticleImageUploader

* Add specs for BadgeUploader

* Add specs for CoverImageUploader

* Add specs for ProfileImageUploader

* Refactor uploaders to inherit from BaseUploader

* Strip EXIF and GPS data from uploaded images

* Add ImageMagick to the docs

* Protect strip_exif
2019-10-24 16:35:10 -04:00
Branko Arnaudovski
efbb108061 Implement Moderators audit logs (#3449) 2019-10-23 10:30:45 -04:00
rhymes
e461f0d799 Routine rubocop fixes after gem update (#4309)
* Regenerate rubocop todo

* Fix outstanding problems

* Fix Style/FormatStringToken

* Final update to rubocop todo file

* Set RSpec/ExampleLength to max 10 and regenerate todo file
2019-10-10 17:27:01 -04:00
Allan Klaus
4402cc212c Create tests to PingAdmins (#4169) [ci skip] 2019-10-03 11:18:53 -04:00
rhymes
178e752239 Require rubyzip (#4141) 2019-09-30 10:41:58 -04:00
rhymes
280f314123 Update rubyzip to 1.3.0 to fix vulnerability (#4133) 2019-09-30 09:58:41 -04:00
Anna Buianova
9778ada44a Doorkeeper default scope (#4066)
* Start with the doorkeeper scopes

* Added read_articles scope

* Proper doorkeeper authorization for the API articles#me
2019-09-24 11:11:12 -07:00
rhymes
c8abbe9d60 Pro: memberships (#3461)
* Add ProMembership model

* Implement ProMembershipsController#create

* Implement basic ProMembershipsController#show

* Add ProMembership to ledger

* Populate user history after pro subscription is created

* Add fields for expiration notifications

* Add ProMemberships::ExpirationNotifier to notify users of expiring memberships

* Add tasks for recurring jobs to notify users of expiration

* Add auto_recharge column to ProMembership

* Add ProMemberships::Biller (incomplete)

* Fix specs

* Add ProMembership to Administrate

* Fix spec

* Add has_enough_credits? to User and Organization

* Add Payments::Customer class

* Finish ProMembership::Biller functionality

* Fix ProMemberships::Creator check for credits

* Disable destroy actions for ProMembershipsController

* Correctly authenticate ProMembershipsController actions

* Make sure only pro user's history can be indexed

* Add ProMembershipsController#update action for auto recharge

* Use regular AR to save new credits and add touch to the purchaser

* Clarify Pro membership create policy

* Display information about an existing pro membership

* Add UI to show page

* Add system test for Pro membership creation

* Implement edit membership

* Make sure users with pro memberships can access history and dashboard pro

* Fix padding issue

* Show a different text for a user that has credits but not enough for Pro

* Move Pro Membership functionality inside settings

* Update Pro Membership link in email notifications

* Bust all relevant caches

* Add the Pro checkmark around the website

* Use Users::ResaveArticlesJob instead of delay

* Add/remove user from pro-members chat channel

* Use the appropriate Pro checkmark

* Remove unfinished pro elements

* Remove checkmark JS
2019-09-24 10:38:54 -07:00
Mac Siri
6fa8dfd7aa Ignore page_views (#4063) 2019-09-19 09:06:14 -07:00
Anna Buianova
c07eb8d9cd Define Doorkeeper::Application association (#4065) [ci skip] 2019-09-19 10:28:55 -04:00
Mac Siri
3b32b29937 Update core API endpoints to support access_token (#3644)
* Update specs for doorkeeper test

* Add bang

* Create #authenticate

* Create /api/articles/ endpoint

* Update specs

* Update me.json.jbuilder

* Fix typo and spacing

* Support pagination for #me

* Update #authenticate! to support cookies

* Make per_page a param

* Disable method-complexity check

* Enable refresh_token

* Create /api/users/me endpoint
2019-08-08 15:55:23 -03:00
rhymes
fea8ad1e87 Hash OAuth2 access tokens (#3596) 2019-08-01 11:05:57 -04:00
Mac Siri
fc9272fe71 Make Doorkeeper inherit from ApplicationController (#3591)
* Resolve doorkeeper issue

* Refactor spec

* Remove comment
2019-07-31 18:41:44 -04:00
Mac Siri
3071ac8c76 Implement Doorkeeper gem (#3504)
* Add doorkeeper gem

* Generate files with Doorkeeper's generator

* Create Doorkeeper tables

* Add new associations to User

* Update associations

* Remove confusing schemas

* Change oauth2_provider name
2019-07-31 10:30:58 -04:00
Ali Spittel
52c60ce37e Feature/refactored onboarding (#3333)
* set up refactored onboarding

* create onboarding page

* add in first slide and change slide functionality

* fix test suite

* profile refactor

* profile refactor

* refactor to api

* add checkbox fields

* add checkbox fields

* remove puts

* add basic css

* add styling

* add redirect

* hide back and next at first and last slides

* test refactored onboarding

* test refactored onboarding

* remove article edits

* Fix schema

* Add deleted file back in

* Add default value for checked_t&c column

* Adjust HTML structure to keep nav buttons in place

* Fix ESLint issues on Onboarding.jsx file

* Handling for undefined or empty followedTags on getUserTags

* Fix codeclimate issues

* Fix codeclimate issues

* Fix more codeclimate issues

* Fix more codeclimate issues

* Update Onboarding snapshots

* Uncheck the CoC and T&C checkboxes on render

* Update snapshots

* Return false instead of raising error

* Update spec to use new onboarding

* Redirect to onboarding if haven't seen it yet

* Prevent redirect to onboarding from /signout_confirm

* Use assign_attributes instead of saving twice

* Move COC and T&C checkbox page to second slide

* Add 'go back to original page' functionality

* Reuse ready prototype logic

* Keep track of the last visited onboarding page

* Fix email subscription bug

* Fix overflow issue for tags page

* Remove height to prevent page container scrolling

* Check for CoC and T&C for displaying onboarding

* Add InstantClick redirect and preserve referrer in client

* Fix async update + check by using localStorage

* Turn off onboarding for tests

* Finalize design for onboarding

* Finalize design for onboarding

* Make bulk follows during onboarding

* Fix bulk follow test
2019-07-26 15:53:32 -04:00
Kitten King
6290451273 Fix Typos (#3510) 2019-07-22 12:56:48 -04:00
Andy Zhao
22e76bee84 Add functionality to remove and recover identity (#3377)
* Lint some quotation marks

* Add BackupData table

* Add identity and removal functionality

* Test additional functionality

* Remove dependent destroy for backup data

* Add auth_data_dump column

* Add challenge to reserved words

* Add more shoulda matchers
2019-07-03 12:01:16 -04:00