Commit Graph

5128 Commits

Author SHA1 Message Date
Matt Lee
49f0c7900a Feature-flagged new markdown styles. 2014-12-02 11:04:31 -08:00
Matt Lee
e36d545ce1 Remove markdown styles from reddit.less and wiki.less
Most of them, at least.
2014-12-02 11:04:31 -08:00
Matt Lee
7863ec737d Add markdown.less 2014-12-02 11:04:30 -08:00
Neil Williams
64f4194db2 ratelimit: Remove reddit-dev mailing list link from throttle page.
It's probably best for users not to send their IP address to a public
mailing list.
2014-12-02 10:05:10 -08:00
Neil Williams
4f9553acbb ratelimit: Improve enforcement page text.
This is intended to be more clear about what's going on when the
ratelimit's enforced and what the user's options are.
2014-12-02 10:05:10 -08:00
Jordan Milne
e3fe97a334 Make sure the same request key is used for pagecache gets and sets
Some parts of the key can change between `pre()` and `post()`, most
commonly due to an endpoint forcing a particular `c.extension` or
`c.render_style`.

In particular, endpoints that used `api/json_validate` were affected
when requested with no extension. They would never hit the page cache.
2014-12-01 17:10:39 -04:00
Jordan Milne
88c17cec1b Guard against trying the pagecache twice in one request 2014-12-01 17:10:39 -04:00
Jordan Milne
9f1f5a29fa HTTPSify emailed links containing secret tokens
Thanks to @edent for the report!
2014-12-01 17:10:39 -04:00
Jordan Milne
df75e1697d Don't treat gettext's output as HTML: JS edition
We don't trust gettext's output, so we can't treat its output as raw HTML.
2014-12-01 17:10:39 -04:00
Neil Williams
7040139f46 stylesheets: Add protocol-relative stylesheets.
Now that we have protocol-relative media objects, there's no need to
maintain HTTP and HTTPS variants of subreddit stylesheets. Instead,
we'll start writing all new stylesheets with protocol-relative image
URLs. Old subreddits will continue to use their protocol-specific
stylesheets for now until new stylesheets are uploaded or existing ones
migrated.
2014-12-01 12:03:44 -08:00
Neil Williams
d24a8ebf1d media: Take advantage of HTTP & HTTPS media being on the same domain.
Since we have an HTTPS-capable CDN in front of our S3 static domains
now, it's far faster for clients to use the CDN on HTTPS as well rather
than going straight to (high-latency) S3.

This patch makes it so that we continue to store URLs with explicit HTTP
schemes but instead of conditionally converting to HTTPS, we render
protocol-relative URLs. This should be safe for systems using the
filesystem media provider as we've installed an SSL cert there all
along.
2014-12-01 12:03:44 -08:00
Neil Williams
155342f591 stylesheets: Remove dynamic stylesheet serving.
Since the introduction of the media providers and the default
installation of the filesystem media provider, it's no longer necessary
for local / non-AWS installs to use dynamically served stylesheets.

This patch removes that option to reduce complexity in the stylesheet
flows.
2014-12-01 12:03:44 -08:00
Neil Williams
f92936a582 vote: Track valid_thing and valid_user rates in Graphite.
This will get us a baseline for each of these so that when I refactor
this code I can feel more confident I haven't changed things.
2014-12-01 09:50:12 -08:00
David Wick
122160d3fa Increase minimum password length to 6 2014-11-26 16:51:21 -08:00
David Wick
e417e6cd1d Add subscribe link to verify when coming from /promoted 2014-11-25 11:23:52 -08:00
David Wick
34dece0ed8 Allow modal to be closed with esc 2014-11-25 11:09:40 -08:00
David Wick
239c253e0e Fix https domain for beta 2014-11-25 11:09:37 -08:00
David Wick
c292b0af1b Fix autofocus
Only 1 `autofocus` attribute is allowed per the spec.  Having two
was causing it to randomly choose between the two username fields.
Since we handle this manually in the modal I've removed it there.
On /login we only want it on the login field.
2014-11-25 11:08:14 -08:00
Chad Birch
7e45eb603a Determine if a comment is gildable from can_save
Previously this was being done with can_reply, but that can make
archived comments, comments in subreddits the user is banned from, etc.
ungildable. Now that comment-saving is available to all users (and not
just ones with gold like it was at the time), can_save is a better
indicator to use.
2014-11-24 16:12:46 -07:00
powerlanguage
ff00967e24 Swap contact tel for email. 2014-11-24 16:12:46 -07:00
Neil Williams
87286866d9 graphite: Don't send counters for timers to tallier.
This extra data does tell us how many timer samples were averaged out
before being reported to tallier, but in general it causes us confusion
and takes up space in packets and we've never really needed it.
2014-11-24 12:00:26 -08:00
xiongchiamiov
d30f04636f Improve moderator info page title
Since this page is accessible to non-mods, it doesn't make much sense to title
it "edit moderators" - people who can't edit anything can see it.

Also, while I was messing around in here, I noticed the titles we put on these
pages are awfully generic.  I didn't want to touch too many things, so we're
only adding a subreddit suffix to this page.
2014-11-24 10:51:36 -08:00
xiongchiamiov
fe222e5377 Sidebar: always link to moderator info
[A user suggestion][0] from /u/Motha_Effin_Kitty_Yo.

Aside from the url hacking, the only previous way to get to this page was to
click the more link for subreddits with "too many" mods.  Since this
information is public, we might as well make it easily available no matter how
many mods there are.

[0]: https://www.reddit.com/r/ideasfortheadmins/comments/2mqmj2/provide_a_view_about_link_in_moderator_box_even/
2014-11-24 10:51:35 -08:00
Jack Lawson
d5fedb0a4e Move stats collection sample rate to config
This way, we can update the rate in one place.
2014-11-24 10:18:44 -08:00
Jack Lawson
923f427545 Send all RUM timings to hivemind instead of /web/timings
Use the new hivemind stats server to collect data rather than
/web/timings, so all the data collection goes to once place.
2014-11-24 10:18:32 -08:00
Jack Lawson
3aff785a95 Set GA sample rate through config
reddit uses Google Analytics[0] as a tool to track events on the reddit.com
website, which allows for gathering page load and user event data while
keeping users anonymized. However, with the high volume[1] of traffic
that reddit recieves, the data collection limit[2]-- even with a premium
account-- is often surpassed by a large volume.

Wikpedia states[3] "... sampling is concerned with the selection of a
subset of individuals from within a statistical population to estimate
characteristics of the whole population." We can, using this principle,
send a small portion of user events to Google Analytics collection
endpoints rather than sending the entire data set and achieve a
reasonable approximation of global user behavior without exceeding
reasonable data usage limits as defined by Google Analaytics.

In order to achieve this, the Google Analytics javascript library
provides a method to set a sampling rate[4], a percentage from 1-100.
By calling:

```
_gaq.push(['_setSampleRate', '80']);
```

One can set the sample rate to 80% of users. In reddit's case, I suggest
a default sampling rate of 50%. Here, I have added the `_setSampleRate`
properties to the `_gaq` object created within `utils.html`. It gets its
value from the config, which allows for easy value changes and avoids
using a 'magic value' set multiple places in the code.

[0] - https://www.reddit.com/help/privacypolicy#p_22
[1] - https://www.reddit.com/r/AskReddit/about/traffic
[2] - https://support.google.com/analytics/answer/1070983?hl=en
[3] - http://en.wikipedia.org/wiki/Sampling_(statistics)
[4] -
https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration#_gat.GA_Tracker_._setSampleRate
2014-11-24 10:18:19 -08:00
Jack Lawson
f69f9d5e08 Sample frontend performance stats to 1%. 2014-11-24 10:17:52 -08:00
David Wick
dde6748b8c Add email settings to config spec 2014-11-20 16:56:00 -08:00
David Wick
f752c158e3 Fix compact login styling 2014-11-20 16:55:48 -08:00
xiongchiamiov
2eef0920ae Compact: style rulespage a bit
Port over some colors from the desktop site, add a bit of padding so things
aren't right on the borders of the screen, and remove the brick at the bottom
of the page, since it only makes sense with alt-text and mobile clients don't
tend to support hovering.
2014-11-20 13:05:33 -08:00
xiongchiamiov
1f907717e7 Compact: extend scss compilation docs
This is the only scss file we have, and we don't change it often, so it's not
really integrated into the asset-building pipeline.  In the future, if we don't
get rid of it entirely, we'll probably convert it to less, but in the mean
time, let's make it slightly easier to work with.

I reverse-engineered these instructions, so they might not be exactly what
we've used previously.

In particular, I'm probably using a different version of the gems, which would
explain why the additional import was needed.
2014-11-20 13:05:32 -08:00
xiongchiamiov
fd5c919d7d Compact: add rules page
Our site-wide rules page has been blank when using the compact website
(i.reddit.com).  Oops!
2014-11-20 13:05:32 -08:00
Chad Birch
e8fcb12ca1 Add proxying_for param for proxy gilding accounts
Allows proxy accounts to send the username of the user that the
gilding is being done on behalf of. This will still use a creddit
from the proxy account, but everything else related to the gilding will
be associated with the actual purchaser, to enable things like replying
to the gilding messages, update the gilder's trophy and /gilded page,
etc.
2014-11-20 12:15:06 -07:00
Brian Simpson
a2e41ed4a6 click: Don't unquote destination url.
The url is already unquoted correctly and double unquoting can cause
problems with unicode characters.
2014-11-04 09:21:45 -05:00
Neil Williams
890fc1f215 Ratelimits: add strict enforcement mode.
For some app pools that are selected based on the incoming request
source, such as whoalane, we may want to apply the ratelimit to ALL
kinds of requests to ensure that resources are being used fairly.  This
adds a strict enforcement mode which can be enabled in the config. Oauth
will continue to be enforced per-client ID but all other requests will
get the sitewide ratelimit.
2014-11-19 10:48:12 -08:00
Neil Williams
acf6c5a0fa Ratelimits: OAuth should take precedence.
The CDN exemption should not take precedence over OAuth since OAuth may
be coming through a CDN but will always be configured to bypass CDN
caching.

The non-API exemption moves down as well for consistency though it will
have no direct effect here as all OAuth requests should be API.
2014-11-19 10:48:12 -08:00
MelissaCole
2c98ba42ef Disallow replies to proxy gilding accounts 2014-11-17 17:05:55 -08:00
David Wick
c4f5b6c28a Redesign login 2014-11-17 14:02:34 -08:00
Chad Birch
b18dccf6ad modaction json: add target_permalink 2014-11-14 16:40:41 -07:00
Jordan Milne
9c1ddbbeb8 Warn during installation if total memory is below 2GB 2014-11-14 17:17:19 -04:00
Roger Ostrander
2d040cbe77 Vote Details: Persist IP-less details for > 90 days 2014-11-14 11:27:45 -08:00
Chad Birch
173d50f9f0 Don't collapse distinguished posts due to score 2014-11-12 18:50:07 -07:00
Chad Birch
880ab5ee4d Allow blank min comment score pref in contest mode
Previously we were forcing the comment score collapse threshold to the
default for all users, regardless of what they had it set to. This
allows them to use the blank setting, since there's no method of using
that to determine the hidden scores.
2014-11-12 18:50:02 -07:00
MelissaCole
3a63e3317c Make the gilded message repliable
The gold message is sent to the gildee with the gilder as the author,
but the username is hidden through the user of the display_author attr.
display_author and display_to fields have been added to keep track of
the labels to be displayed. If there is a display_to field, then it is
a reply to an anonymous message (one that started with a display_author).
A warning will be appended to messages that have display_to saying that
their identity will be revealed if they reply.
2014-11-12 12:41:39 -08:00
Neil Williams
38e64dbd9e install-reddit: Add some more helper scripts.
The intent is to further provide simple commands for common tasks in a
way consistent with staging and production as well.

reddit-start: start all reddit code
reddit-stop: stop all reddit code
reddit-restart: restart one or all reddit service(s)
reddit-flush: flush all memcached keys
2014-11-12 10:04:15 -08:00
Robert Ditthardt
05d4481109 install-reddit: Fix intermittent haproxy timeouts
Increase max connections for backend reddit in haproxy.cfg. We have not
nailed down the cause of these timeouts yet, but this definitely solves
it in a VM environment.
2014-11-10 15:47:31 -08:00
xiongchiamiov
7d1f80caf9 Feature flags: allow filtering by subdomain
We'd like to have an easy way to push out changes to a subset of users before
going to everyone.  Like with the previous change to add subreddit filtering,
toggling features by subdomain gives us that ability fairly cheaply.

(There is also a more sophisticated [betamode plugin], but it's designed for
more heavyweight needs and requires more setup for each test.)

[betamode plugin]: https://github.com/reddit/reddit-plugin-betamode
2014-11-05 11:52:56 -08:00
Ricky Ramirez
66d8bb199d template_helpers: Add force_https param to add_sr. 2014-11-05 11:49:35 -08:00
Ricky Ramirez
fa257acc60 template_helpers: Style and documentation tweak. 2014-11-05 11:49:31 -08:00
umbrae
4bf76538db Only force https on reddit URLs in add_sr 2014-11-05 11:49:16 -08:00