Commit Graph

5553 Commits

Author SHA1 Message Date
Neil Williams
f501106d9c zookeeper: gzip live config payload.
This takes our current config payload from 4700 bytes to 1700. The goal
is to reduce zookeeper network load during config changes as well as app
restarts during deploys.
2015-03-02 10:41:07 -08:00
Neil Williams
85b185e1e5 zookeeper: Decompress live config if zipped.
In preparation for compressed payloads.
2015-03-02 10:41:07 -08:00
Neil Williams
f00e90f0ed zookeeper: Remove obsolete LiveDict class.
This is no longer used since the relevant consumers have switched to
Cassandra as a backing store.
2015-03-02 10:41:07 -08:00
Neil Williams
fecde82921 cloudsearch: Add timeout to HTTP requests.
This prevents apps from hanging forever if something goes wrong.
2015-02-27 15:37:54 -08:00
Florence Yeun
e344be366f Catch image upload IOError and TypeError
Handle errors triggered by invalid image types and other file upload errors.
2015-02-27 14:08:47 -08:00
jaflo
887bf4b7a0 CSS Filter: allow text-size-adjust and appearance.
New allowed property: `appearance`. Used to normalize text inputs
in webkit browsers:
http://stackoverflow.com/questions/7599533/ios-forces-rounded-corners-and-glare-on-inputs.

New allowed property: `text-size-adjust`. Used to stop iOS from
enlarging text automatically:
http://css-tricks.com/prevent-iphone-text-enlargement/.
2015-02-27 12:25:07 -08:00
Gavin
342fd84665 CSS Filter: allow text-rendering CSS properties. 2015-02-27 12:25:07 -08:00
Chance Carey
e2ecdc903a CSS Filter: allow background-position-x and background-position-y. 2015-02-27 12:25:07 -08:00
Brian Simpson
e6b966d17f Decrease cache ttl to 5 days for Thing and Query. 2015-02-26 12:59:05 -05:00
Brian Simpson
711c4c2580 Remove min_promote_future, max_promote_future. 2015-02-26 12:58:59 -05:00
Jordan Milne
9e09ac70da Rewrite markdown validation for safety and log-friendliness
* Large chunks of code related to (X)HTML validation have been moved to
  `r2.lib.souptest`
* Moved from a SAX-based validator to iterating over every node in
  the document fragment. This was done for performance reasons, and
  because lxml doesn't expose comments via its SAX interface unless
  you use Python 3
* We now raise a descriptive exception if we didn't recognize an entity,
  and return a 400 in the validator rather than raising the exception
  up the chain
* Fixed a few filter bypasses: using CDATA sections, conditional
  comments, and processing instructions.
* Added unit tests to ensure future souptest changes don't introduce
  security issues

This goes hand-in-hand with https://github.com/reddit/snudown/pull/61
to reduce the number of spurious `SyntaxError`s that end up in the
applogs.
2015-02-26 15:15:05 -08:00
Brian Simpson
ce4c06235b Collect stats on stalecache hits and misses. 2015-02-26 05:48:57 -05:00
Brian Simpson
8e72645077 Stats: remove unused cache_count() method. 2015-02-26 05:48:57 -05:00
Brian Simpson
28fd413d75 CacheStats: group hit/miss + total together.
This will play nicer with sampling.
2015-02-26 05:48:57 -05:00
Brian Simpson
ebc7021c5b Stats.cache_count_multi: remove unused cache_name argument. 2015-02-26 05:48:52 -05:00
Brian Simpson
8e2dbcd636 VDate: remove unused advanced logic. 2015-02-26 05:48:20 -05:00
Brian Simpson
f6891b5339 promote: Stop using VDate for advance date checking.
The logic was getting too complicated so has been moved into
promote.get_date_limits().
2015-02-26 05:48:19 -05:00
Brian Simpson
2dac08e8df Remove VDateRange. 2015-02-26 05:48:18 -05:00
MelissaCole
785a082544 Add hide_subscribers_srs to example.ini 2015-02-26 14:31:16 -08:00
xiongchiamiov
fa19ced156 comment_tree: fill out some docstrings
Through the power of code reading and the Python REPL, we now have a little bit
more documentation on `link_comments_and_sort()` and its helper functions.
2015-02-26 12:28:42 -08:00
Chad Birch
00066d191a Dropdown menus: hide selected option from dropdown
Previously, the option that was already selected was still present in
the dropdown, which was a little confusing/non-standard.
2015-02-26 13:11:34 -07:00
Keith Mitchell
42ab2bab77 VRatelimit: Check user_is_loggedin before calling hook 2015-02-26 11:53:27 -08:00
Keith Mitchell
88cb68cc8f Multi API: List of other users' public multis 2015-02-26 11:53:27 -08:00
Keith Mitchell
aa87a4e944 Use unidecode for better slugs 2015-02-26 11:53:26 -08:00
Keith Mitchell
5324ac1bd7 Import cleanup in utils.py 2015-02-26 11:53:26 -08:00
Keith Mitchell
3899c47a9d Multi API: Allow for auto-sluggification of name
This updates some multi endpoints to allow for passing in or using
"display_name" instead of a multi path when creating a new multi. In such
a case, the display_name will be converted into a "slug" for the multi (a
string valid for use as a multi name), and that slug will be used.

This affects:

* POST /api/multi/
* POST /api/multi/rename
* POST /api/multi/copy

(PUT /api/multi/{path} is not affected, as it requires the caller to have
a slug in mind already for an existing or new multi)
2015-02-26 11:53:26 -08:00
Chris Stephens
301bc90d19 install-reddit: change curl to wget
curl isn't installed by default on minimal linux installs, so removing
the dependency on it
2015-02-25 20:39:06 -08:00
Chad Birch
165ca78803 Create subreddit: add support for min age/karma
This allows setting (via live config) minimum age and karma requirements
to be able to create a subreddit. The age requirement and at least one
of the karma requirements must be met. A hook was added as well for
potential private-code use.
2015-02-25 18:44:43 -07:00
Chad Birch
9c8be783e1 Account.needs_captcha: add hook, use live_config
This allows the minimum amount of karma needed to be exempt from the
captcha to be modified via live config. In addition, it adds the
ability to set a comment karma minimum, where previously it was required
to get link karma in order to be exempt from the captcha.

A hook has also been added to the function for private-code purposes.
2015-02-25 18:44:37 -07:00
Chad Birch
6812738ebe admin_ratelimit: replace with hook 2015-02-25 18:44:33 -07:00
MelissaCole
1f36ebb562 Fix gilding a user with creddits 2015-02-25 17:39:57 -08:00
umbrae
0850bd3044 Tracker: URL decode session cookie 2015-02-20 23:58:51 -08:00
MelissaCole
6cf527235c Prevent race condition during inline gilding
The gold-button submits the form at the same time that setGildingProperties is
called, so this disables the submit function and manually calls submit for
buttons that have a form parent (creddits and PayPal). This should prevent the
locked payment blob errors.
2015-02-25 13:05:19 -08:00
umbrae
ea5aa9c538 Tracker: add domain prefix to redirect domain 2015-02-20 21:49:46 -08:00
umbrae
76fb41a3f8 Tracker: add session tracking redirector
This adds in two redirects - `event_click` and `event_redirect` - `event_click`
to allow appending in a user ID to an event before redirect, if we require one,
and `event_redirect` to service a local evented redirect, similar to ad clicks.

`event_click` is necessary for tracking clicks from users on embeds, which are
served via redditmedia, and therefore are always anonymous. When a user clicks
through, we want to know who they were and redirect them on their way. Because
of the way we're using nginx to store events as an access log right now, this
means we'll need to use two redirects: one to append the session ID and
another to store the event with the proper session ID.
2015-02-20 21:23:09 -08:00
MelissaCole
1a352bfa20 Show error for creating gold only sr without gold 2015-02-24 16:33:25 -08:00
MelissaCole
42f9fa74a6 Fix validator bug for promotions in disabled ad subreddits 2015-02-24 15:23:34 -08:00
adam
5e407807a2 PromoteReport: add totals row to campaign report 2015-02-24 15:16:25 -08:00
Neil Williams
1da41d8063 Don't include pixel tracker URL in response headers if not enabled.
If the tracker URL isn't configured, we shouldn't include the header in
the response.  This uses the same criteria (truthiness of g.tracker_url)
as the templates to determine whether or not to include the URL.
2015-02-24 14:58:19 -08:00
Keith Mitchell
946e721cbe Multi API: Flag for expanding (some) SR info 2015-02-24 14:51:00 -08:00
Florence Yeun
e8b52963e5 Remove duplicate hidden sr input 2015-02-24 12:02:59 -08:00
Florence Yeun
91b2059aa4 Subreddit settings: mobile settings
New subreddit fields for mobile, hidden behind feature flag.
Basic functionality with limited validation.

* community rules - list, no markdown
* related subreddits - list, no markdown
* key color - hex color

These fields are optional for `/api/site_admin`.
2015-02-24 12:02:46 -08:00
Florence Yeun
ff76c8fc0e Subreddit settings: mobile icon and banner
Upload and delete endpoints for new mobile subreddit icon and banner.

* icon - square, exactly 240x240px
* banner - 16:9 aspect ratio, min 640x360px, max 1280x720px
2015-02-24 11:58:02 -08:00
MelissaCole
a45218804b Remove check for lounge contributors
This is no longer necessary when /r/lounge is a gold_only subreddit
2015-02-24 11:53:57 -08:00
MelissaCole
c24a01497a Gold only subreddits
Users that have gold (or gold charter status) will be able to create and access
gold_only subreddits. Mods will be able to access gold_only status regardless of
their gold status. Approved submitters will not be able to access these subreddits.

To have a gold only subreddit, it must be created as gold only by a gold user or
have admin mode to convert it to gold only (requested via modmail to /r/reddit.com.
There is a default style (gold-only) applied to each gold_only subreddit.

Mods can choose to hide the sidebar adbox for gold-only subreddits. A "reddit gold"
('/subreddits/gold') tab is in '/subreddits' so that gold users can see all of the
gold only subreddits.

Being added as an approved submitter in gold_only and employee_only subreddits
don't allow you to see the subreddit. This will remove the link and ability to
edit the approved submitters so as to not confuse the mods.
2015-02-24 11:53:20 -08:00
powerlanguage
b1761f1cb4 Add gold only subreddit style. 2015-02-24 11:51:02 -08:00
powerlanguage
a5f1d2c1db Optimize subreddit interstitial pngs. 2015-02-24 11:50:56 -08:00
powerlanguage
61f701c3e1 Add gold only subreddit interstitial image. 2015-02-24 11:50:50 -08:00
Robert Ditthardt
80b55f6940 Multis: Make path for multireddit include user 2015-02-24 11:43:40 -08:00
Keith Mitchell
ab93da58da Update web interface for modifying multis
* Set description using the base model endpoint
* Add feature-flagged interface for setting:
  - key_color
  - icon
  - visibility == 'hidden'
2015-02-24 09:49:38 -08:00