Commit graph

2169 commits

Author SHA1 Message Date
jeffin sam
e92b005d02 Move caching of reaction to rediscache (#4819) 2019-11-15 13:38:46 -05:00
jeffin sam
7cc5ef5e40 Write to RedisCache to avoid cache miss in add html_css_to_image (#4821) [deploy] 2019-11-15 13:09:18 -05:00
jeffin sam
fbbb02e241 Move bufferized tags to RedisCache (#4817) 2019-11-14 17:37:20 -05:00
Molly Struve
672d64c2ca
Avoid N+1 queries when sending notifications for reactions (#4822) [deploy] 2019-11-14 14:36:20 -06:00
Molly Struve
d1b82dfdaf Move cached_followed_tag_names to Redis (#4812)
* Move cached_followed_tag_names to Redis and change key to use following_tags_count rather than updated_at

* use last_followed_at for cache key as well

* format last_followed_at with rfc3339
2019-11-14 09:57:33 -05:00
aRtoo
9b5b2ee98d Redo JSitor (#4762) [deploy]
* Redo JSitor
- can now accept full url with params
- added more test
- redo jsitor guide

* Jsitor redo guide
- moved below JSFiddle
- add more instructions

* Refactor JSitor liquid tag
- Change the iframe size to 400
- can accept ID with or without params
- added ID_REGEX to check for id
- add more information on error
- added more test
  - test for id with invalid link
  - test for id with params
  - test for id without params

* Refactor
- simplified regex, removed unnecessary groupings
- changed method name from link_valid? to validate_link
- changed error message
2019-11-14 09:17:47 -05:00
Anna Buianova
41ab013050 Normalize podcast url before checking for reachability (#4806)
* Normalize podcast url before checking for reachability

* Added to_s when normalizing episode url and simplified tests
2019-11-14 08:58:29 -05:00
Molly Struve
880f60beff
Move user_data async controller cache to Redis (#4809) [deploy] 2019-11-13 10:25:17 -06:00
Michael Kohl
b57ced5466 CacheBuster refactoring (#4766)
* Turn CacheBuster into a module

This class used no internal state, so repeatedly creating short-lived objects seems wasteful.

* Consistently use string interpolation and parenthesis

* Destructure arrays into meaningful names, formatting

* Fix request spec for internal classified listings controller

Interestingly this works when asserting directly on the module, but not on a double.
Asserting directly in the module seems sufficient for this test so the indirection
was removed.

* Turn CacheBuster into a module

This class used no internal state, so repeatedly creating short-lived objects seems wasteful.

* Fix specs after rebasing
2019-11-13 10:51:23 -05:00
jeffin sam
61788e5dec Add tag_colors cache to redis (#4716) [deploy] 2019-11-13 09:43:22 -06:00
Molly Struve
57250ade63
Expire Frequently Updated Cache Keys Sooner (#4793) [deploy] 2019-11-12 13:39:50 -06:00
Ben Halpern
af04fd7959
Add additional conditions to internal/reports page (#4800) [deploy]
* Add additional conditions to internal/reports page

* Add higher number for randomness
2019-11-12 13:19:08 -05:00
Andy Zhao
0f3c4a5a9a Add additional cache value for block (#4790) [deploy] 2019-11-12 10:59:54 -06: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
Aleksandr
4d0392a17a Add link to /community-moderation on all /mod pages (#4567) [deploy] 2019-11-12 10:11:26 -05:00
Ben Halpern
d3635d5553
Add latest articles and possible spam users to internal/reports (#4791) [deploy] 2019-11-12 09:40:18 -05:00
jeffin sam
6ff1c3d913 Add AnalyticsService to redis cache (#4755) [deploy] 2019-11-11 17:30:26 -05:00
jeffin sam
6e87a1d1e1 add suggester sidebar class suggest to RedisRailsCache (#4754) [deploy] 2019-11-11 17:23:54 -05:00
Anna Buianova
8c58be75f5 Self-deleting user account (#4480) [deploy]
* Start with self deleting account

* Moved deleting user content and activity out of moderator hierarchy

* Added tests for the users delete services

* Tests for Users::DeleteComments

* User self-deletion (start)

* Some tests for user self-delete

* Specs for user self-deletion

* Test flash settings on users delete

* Added basic specs for the Users::DeleteJob

* Send notification when a user was destroyed

* Rename Users::DeleteJob to SelfDelete

* Change texts about self-deletion

* Fix users delete job spec

* Rescue and log exceptions while self-deleting user

* Added visible flash notices after deleting user

* Remove unneeded css for flash notice

* Fix link to a ghost account

* Remove redundant css

* Added github and twitter oauth apps links
2019-11-11 14:59:01 -05:00
rhymes
bb28f301e9 Add site config and remove sail (#4729)
* Add SiteConfig model based on rails-settings-cached

* Remove sail
2019-11-08 13:27:44 -05:00
rhymes
80ab485eb6 Fix http status code for rate limiting (#4742) 2019-11-07 14:11:11 -05:00
leewynne
3fad464765 Generalise feed text to use the community name variable (#4730) [deploy] 2019-11-07 13:58:32 -05:00
brian bethencourt
f0e367996a Freely color social icon backgrounds for each theme (#4372) 2019-11-07 12:48:55 -05:00
rhymes
40155812bd Comments API: simplify controller code, add tests (#4731) [deploy]
* Use ancestry in the index and add test

* Add tests for show action
2019-11-07 11:37:58 -05:00
Ben Halpern
6a3fc43381
Remove hacktoberfest from sidebar (#4740) 2019-11-07 11:34:20 -05:00
Ben Halpern
c76cfa6e97
Add missing div to internal permissions (#4737) [deploy] 2019-11-06 18:18:35 -05:00
Ben Halpern
fc1239b21d
Remove follow limit for single request (#4738) 2019-11-06 18:17:40 -05:00
Omar Bahareth
dca66bd6a8 Rate limit daily user follows to 500 (#4647) [deploy]
* Rate limit daily user follows to 500 per day
Return an error in `POST /follows` JSON response when a user tries to follow more than 500 accounts in a single day.

Other Changes:
- Add a spec for follows#create.

* Turn daily account follow limit into an env var

* Avoid executing today follow count query when possible
user.following_users_count is a counter cache on how many users the person is already following, so if it's less than the limit we don't need to run the query and can just return it instead.

* Simplify today follow count query
Stop needlessly checking into the future, only check from the beginning of the day until now.

* Raise account follow limit error if followable_id count is over limit
Other changes:
- Always return JSON, the `respond_to` block from before was unnecessary since this endpoint always returns JSON.
- Rescue `DailyFollowAccountLimitReached` on the method and remove begin block, since the error can be raised from two places in the same method.

* Index created_at on users table

* Make adding created_at index on users table happen concurrently

* Rename DAILY_ACCOUNT_FOLLOW_LIMIT to RATE_LIMIT_FOLLOW_COUNT_DAILY

* Add RATE_LIMIT_FOLLOW_COUNT_DAILY to Envfile

* Move RATE_LIMIT_FOLLOW_COUNT_DAILY from env var to ApplicationConfig
2019-11-06 16:24:43 -05:00
rianadon
47ca9b5139 Wrap <figcaption> elements and content inside <figure> elements (#4645) 2019-11-06 15:05:45 -05:00
Ben Halpern
1b5f702c96 Add noopener to sponsor links (#4733) [deploy] 2019-11-06 14:21:40 -05:00
Sam Rae
732aea764f Fix CSS on onboarding page (#4512) 2019-11-06 14:19:24 -05:00
rhymes
64adc3114c Enable viewport scaling for a11y (#2150) 2019-11-06 13:45:55 -05:00
Jacob Herrington
afc9351399 Onboarding a11y fixes (#4728) [deploy]
* Fix some eslint complaints

* Fix some basic a11y issues in onboarding

- Missing a main element
- TODO to enable zooming
- Rename a duplicate ID attribute

I may need some context on the zooming thing, why did we decided to
disable that in the first place? It is a pretty bad a11y issue, we will
need to fix whatever that is a workaround for instead of making it
difficult for some people to use our onboarding.

* Update screenshots
2019-11-06 12:51:13 -05:00
Mike Rogers
39a774dc98 Listings Page: Adding spacing around the word must (#4732) 2019-11-06 10:26:15 -05:00
Andreas Müller
f0fa221a47 improve editor guide: typos and formatting issues (#4726) [deploy]
I fixed some typos, corrected (maybe due to copy pasting) description mistakes in the "Glitch embed" section and improved formatting of code blocks (to many spaces, wrong indentation, additional blank lines)
2019-11-05 17:05:03 -05:00
Colby Melvin
4531679c23 fix tag input swallowing numeric keycodes [deploy] (#4283)
* fix tag input swallowing numeric keycodes

* add AR validation for Tags class

* allow whitespace in Tag.name

* fix specs

* whitespace

* reformat
2019-11-05 16:20:34 -05:00
Mike Rogers
cf475779d0 Setting width & height attributes to SVGs on articles#show page (#4705)
* Adding spec around adding width/height to images

* Adding width/height to svgs on article page

* Improving the englishing of the test description

* Re-read final test description, this felt the clearest

* Just checking attriutes are present - not to fussed about much else
2019-11-05 13:13:44 -05:00
aRtoo
b421ad908b Add JSitor liquid tag (#4657) [deploy]
* Request change
- Added specific error message
- changed jsitor to JSitor
- changed JSITOR_URL constant to URL_REGEXP
- added space between URL_REGEXP and initialize method

* created jsitor liquid tag
- created a jsitor_tag.rb for jsitor liquid core
- created partial (_jsitor.html.erb) for jsitor liquid tag

* created test for jsitor liquid tag
- created spec for jsitor liquid tag
- generated jsitor_liquid_tag.approved.html

* added suggestion change
- removed regex
- change the full link to embeddable id
- removed dead code(methods) due to change logic
- removed checking of link since embeddable id will be parse as string
- removed parts of the test
- change the guide explanation

* Added lazy loading on iframe
2019-11-05 09:43:52 -05:00
jeffin sam
2569a0ac3d Move cached_followed_tags to redis (#4714) 2019-11-05 09:34:58 -05:00
jeffin sam
71b144da8d move cached_follow_check to redis (#4715) 2019-11-05 09:34:42 -05:00
Ibrahim Khan
961bef0173 Moved classic-article-for-tag to Redis (#4706) 2019-11-04 17:06:15 -05:00
Ibrahim Khan
9c0bb311bf Moved user-github-token to Redis (#4710) 2019-11-04 17:05:24 -05:00
Ibrahim Khan
73de48e370 Moved following_users_ids to Redis (#4708) 2019-11-04 17:04:46 -05:00
Tamas Fodor
76e099599b Fix eslint lints in chat's jsx files (#4302) [deploy] 2019-11-04 15:51:30 -05:00
Andy Zhao
85d8f52789 Hide a blocked user's content [deploy] (#4678)
* Hide blocked users' content appropriately

* Use RESTful create route

* Update functionality to block the user

* Fix specs for new route

* Use const instead of var

* Add noopener and noreferrer

* Remove caching for blocked user ids

* Add new rule for lack of noopener noreferrer

* Update snapshot
2019-11-04 14:47:26 -05:00
rhymes
027dbb027b Return 401 instead of 500 when a channel is blocked (#4721) 2019-11-04 10:39:18 -05:00
Ibrahim Khan
f988cba9d8 Moved reading_list_ids_of_articles to Redis (#4711) 2019-11-04 10:15:06 -05:00
Ibrahim Khan
d4347bf3e3 Move article_flare_tag to Redis (#4709) 2019-11-04 10:13:38 -05:00
tariq-abughofa
40fddab7e2 Move cached_user_reactions-* keys to Redis (#4696) 2019-11-04 10:12:12 -05:00
tariq-abughofa
33a1330033 Move count_for_reactable-* keys to redis (#4695) 2019-11-04 10:11:47 -05:00