Commit Graph

7669 Commits

Author SHA1 Message Date
Joshua Uziel
805a9a4b79 Onboarding: Featured subreddits API endpoint
Endpoint for retrieving subreddits to make new
users aware of without actually subscribing
them while doing the onboarding process.

The list of featured subreddits will be managed
separately from the default ones.

For testing purposes, we add a subreddit to show
up via the inject_test_data script.
2016-06-20 16:19:37 -07:00
Brian Simpson
c94ea00fd2 Subreddit._by_name: Use g.gencache 2016-06-20 16:07:03 -07:00
Brian Simpson
18fb269f1b rising: Use g.gencache 2016-06-20 16:06:53 -07:00
Brian Simpson
753039574e promote: Use g.gencache 2016-06-20 16:06:53 -07:00
Brian Simpson
004895b8ef geoip: Use g.gencache 2016-06-20 16:06:49 -07:00
Brian Simpson
7e0a7678da voting: Use g.gencache for queued votes 2016-06-20 16:06:42 -07:00
Brian Simpson
260268df5b captcha: Store solutions in g.gencache 2016-06-20 16:06:37 -07:00
Brian Simpson
6f78328c5d VOneTimePassword: Use g.gencache to check for code reuse 2016-06-20 16:06:30 -07:00
Brian Simpson
cf73f43adc api: Use g.gencache for storing otp secret 2016-06-20 16:06:30 -07:00
Brian Simpson
e81a93cba4 Add g.gencache for moving keys to mcrouter but still in the g.cache pool 2016-06-20 16:06:24 -07:00
Chris Slowe
1a452edf81 Re-allow announcements ("stickies") to apply to any type of link. 2016-06-20 15:56:16 -07:00
Shawn Krisman
c5c1c901c9 All pages include a canonical link.
The main points we hit on for canonicalization are that:

1) All pages should be https
2) All pages should end in a '\'
3) All language specific subdomains (de, pt, etc ...) are canonicalized to 'www'.

For comment pages we also do extra logic to ensure that pages of the form:

https://www.reddit.com/r/hiphopheads/comments/4nc0ln/

are canonicalized to:

https://www.reddit.com/r/hiphopheads/comments/4nc0ln/fresh_clams_casino_all_nite_feat_vince_staples/
2016-06-20 15:18:51 -07:00
Kevin O'Connor
dc501488ca Send .compact traffic to m.reddit.com instead of h.reddit.com. 2016-06-20 13:07:18 -07:00
MelissaCole
d43d7f9ff9 Disassociate preview object when deleting a Link object 2016-06-20 12:58:09 -07:00
Strix
f56e810a48 fix closing parens/braces in fn reply() 2016-06-17 11:11:13 -07:00
Brian Simpson
8123b9917c TryLater: ready_items key should be the original uuid, not datetime 2016-06-15 13:49:54 -07:00
Brian Simpson
1f93cbbd23 Modaction.create: Don't pass request or c to mod_event if out of request 2016-06-15 13:49:49 -07:00
birakattack
9581950ada Add already exists error to form for duplicate links 2016-06-15 12:08:59 -07:00
Brian Simpson
2cc7c85294 TryLater.run: Make a copy of the all_hooks items to avoid RuntimeError 2016-06-15 11:33:47 -07:00
Brian Simpson
94acb322aa TryLater: Attempt row/timestamp delete to avoid generating tombstones 2016-06-15 11:18:59 -07:00
Brian Simpson
a4bf06235c TryLater: move all processing and cleanup into class method
Previously it was split between the class and the script handler
2016-06-15 11:18:59 -07:00
Brian Simpson
4292df773f TryLater: Use xget to process ALL ready items 2016-06-15 11:18:59 -07:00
Brian Simpson
d4cb4087b5 run_trylater: Flush the stats 2016-06-15 11:18:59 -07:00
Brian Simpson
791e117245 TryLater: Add stats for number of ready items 2016-06-15 11:18:59 -07:00
Brian Simpson
3c031c8db6 TryLater.multi_handle: Document context manager magic 2016-06-15 11:18:59 -07:00
Brian Simpson
777c655f80 VOneTimePassword: Change name to otp_ratelimit to avoid UnboundLocalError 2016-06-15 11:18:59 -07:00
Neil Williams
0d74afb00c Install ZooKeeper in dev and make liveconfig/secrets easier
This installs a ZooKeeper server in development and adds two
configuration options. Live config and Secrets can now be sourced from
either ZooKeeper or the local config. This allows local installs to
continue with the easy workflow of just modifying the INI file to test
out changes, while allowing us to develop ZK features locally as well
(such as throttles).
2016-06-15 11:15:52 -07:00
Greg Taylor
4107deec8b Always pull Drone build image to ensure freshness. 2016-06-15 11:10:31 -07:00
Greg Taylor
2342becdb9 Explicitly set Drone clone path to avoid pathing issues. 2016-06-15 11:10:26 -07:00
Greg Taylor
31b83a3350 Incorporating PEP8 checking on PRs. 2016-06-15 11:10:21 -07:00
Greg Taylor
ade6dfd0c1 Add post-build Drone->Slack notifications. 2016-06-15 11:10:16 -07:00
Greg Taylor
f232301489 Add .drone.yml and install/drone.sh for Drone CI
.drone.yml is used by Drone CI to execute builds in response to pushes to
the repo. install/drone.sh is similar to the existing install/travis.sh in
that it does some final work to prep the environment for running tests.
2016-06-15 11:10:10 -07:00
Brian Simpson
d6eac78d7d VOneTimePassword: Use SimpleRateLimit for ratelimiting 2016-06-14 12:31:59 -07:00
Brian Simpson
922be87457 VRatelimit: Separate name and cache_prefix
Force cache_prefix to start with "rl:" for future routing by mcrouter
2016-06-14 12:31:59 -07:00
Brian Simpson
4eb26ccb2a VRatelimit: Use ratelimitcache 2016-06-14 12:31:55 -07:00
Brian Simpson
363c7ca5ff emailer: Move email reset throttling to SimpleRateLimit 2016-06-14 12:31:29 -07:00
Brian Simpson
4b5a785161 api: Move subreddit quota counts to SimpleRateLimit
This moves them out of g.cache and into g.ratelimitcache
2016-06-14 12:30:37 -07:00
Brian Simpson
7bdc106585 SimpleRateLimit: Prefix key with "rl:" for routing by mcrouter 2016-06-14 12:30:37 -07:00
Brian Simpson
db6f9e4631 Add SimpleRateLimit class for creating simple ad hoc ratelimiters 2016-06-14 12:30:37 -07:00
Brian Simpson
84bea274f6 VRatelimitImproved: Remove call to _record_event when user is exempt
VRatelimitImproved._record_event doesn't exist
2016-06-14 12:30:37 -07:00
Brian Simpson
f5c601299b app_globals: Add "sr_muted_quota" to ConfigValue.int 2016-06-14 12:30:31 -07:00
Chris Slowe
7e5f4a415d Re-allow mods to sticky non-moderator self-posts. 2016-06-13 16:13:50 -07:00
Chris Slowe
599628a6a5 Only check stickyable on unstickied posts. 2016-06-13 16:11:50 -07:00
Chris Slowe
ba9dc13eb5 Change 'sticky' posts to 'announcements' and restrict to self-posts by mods 2016-06-13 15:29:49 -07:00
Brian Simpson
3a97cd0cac Thing._incr: Rollback postgres transaction if cache write fails
This will prevent prevent repeatedly incrementing the postgres value if
the cache operation fails and the entire incr is retried.
2016-06-13 11:03:51 -07:00
Chris Slowe
29e271cc37 Add better explanation around bucketing variant truncation. 2016-06-10 08:53:16 -07:00
Chris Slowe
e448e6a2f7 Fix unit tests, and remove old ones. 2016-06-08 14:27:20 -07:00
Chris Slowe
f2da4f4716 Handle error codes on post_tests.py 2016-06-08 14:18:28 -07:00
Chris Slowe
7cb0085a65 Add new (signed) APIv1 login handler with tests. 2016-06-08 14:00:14 -07:00
Chris Slowe
77acb16055 Re-enable (and fix) login and pref tests.
This fix encountered two python warts: unicode handling and missing __init__.py files.
2016-06-08 11:22:55 -07:00