106 Commits

Author SHA1 Message Date
Brian Simpson
24d71d7a87 Add RavenErrorReporter to report exceptions to Sentry 2016-10-04 13:34:41 -07:00
MelissaCole
7b58b61b1f Add FastlyCdnProvider 2016-09-20 15:45:37 -07:00
Chris Slowe
b9fcc7c556 Add httpagentparser and add parsed UA to events. 2016-04-08 15:56:10 -07:00
Brian Simpson
c65a8e1897 Add email provider for sending emails. 2016-03-03 15:51:06 -08:00
David King
e349f1317f Add snappy dependency for upcoming feature 2016-03-03 14:43:06 -08:00
Neil Williams
487699f637 setup: Add comment about why baseplate's in a try block 2016-03-02 10:54:55 -08:00
Chris Slowe
af49fa322b Testing: add vote unit test and coverage script 2016-01-21 13:45:25 -08:00
Neil Williams
6e60419984 Add early baseplate integration
This adds simple integration with the new baseplate library so we can
use thrift clients. Further down the line we can hopefully replace
config parsing and metrics with the baseplate equivalents.
2015-12-16 16:22:07 -08:00
Brian Simpson
4c6d5fdf17 setup.py: Drop support for precise. 2015-10-26 11:55:50 -07:00
Brian Simpson
905783ac6d setup.py: Requirements are based on ubuntu version.
This will let us simultaneously support precise and trusty.
2015-10-06 03:30:36 -04:00
Brian Simpson
b6d1207694 Un-pin sqlalchemy.
We use the default ubuntu package.
2015-10-06 03:30:36 -04:00
Brian Simpson
6dcb729407 Un-pin requests.
The pinning was added in 7d93774781
and the response.json/response.json() incompatibility was fixed
by 644f0988d7.
2015-10-06 03:30:35 -04:00
Brian Simpson
741844a503 Un-pin python-routes and python-pylons.
We are using the default ubuntu packages.
2015-10-06 03:30:35 -04:00
Brian Simpson
69d89f3cd8 setup.py: Remove check for distribute>=0.6.16.
This check was in place for c20db7e11d to make
sure that we were using a new enough version of distribute to handle
the "cythonize" command. distribute was a now-deprecated fork of setuptools,
and the versions of setuptools on precise and trusty are new enough to not
need this check.
2015-10-06 03:30:35 -04:00
Brian Simpson
d990533d0b Upgrade pylons from 0.9.7 to 1.0.
http://pylons-webframework.readthedocs.org/en/latest/upgrading.html

This requires several code changes:
* pylons `config` option must be explicitly passed during setup
* the pylons global has been renamed from `g` to `app_globals`
* the pylons global has been renamed from `c` to `tmpl_context`
* set pylons.strict_tmpl_context = False (instead of pylons.strict_c)
* redirect_to() has been swapped for redirect()
* must implement `ErrorDocuments` middleware ourselves

pylons 1.0 also required an upgrade of routes from 1.11 to 1.12. This
required the following changes:
* set Mapper.minimization = True (the default value changed)
* set Mapper.explicit = False (the default value changed)
2015-09-15 06:35:31 -04:00
Chris Stephens
19d569696e Tests: Refactor test initialization
Change RedditTest so that it maintains global state and will only fire up the app
context a single time. Inject mocks for the database manager and avoid making
calls to the database during thing initialization.
2015-07-29 10:01:04 -07:00
Brian Simpson
17c626b084 Revert "Tests: Refactor test initialization"
This reverts commit 6c8999d4ba8fc0d494428e6cc4e8c3f14aaf13ec.

That commit was preventing plugin hooks from registering in
reddit-run and reddit-shell contexts.
2015-07-24 04:01:48 -04:00
Chris Stephens
d6d69e60b4 Tests: Refactor test initialization
Change RedditTest so that it maintains global state and will only fire up the app
context a single time. Inject mocks for the database manager and avoid making
calls to the database during thing initialization.
2015-07-22 15:03:05 -07:00
xiongchiamiov
d3f9e1e1ce First cut at hosting multiple-size thumbnails
We'd like to display multiple sizes of thumbnails for the mobile apps, rather
than just the one size we currently use.  The first step to this is storing the
source image, rather than just the one resized version, so we can create all
the differently-sized versions from it.

The resizing is implemented using the provider system because that gives us
flexibility - just as open-source and dev installs can use local file storage
rather than S3, so they can use a no-op resizer or one that pulls in correct
image sizes from a placeholder image site.
2015-05-26 11:47:44 -07:00
Keith Mitchell
15d7e9333f Search providers
Separate search logic into provider system. Move existing logic into a
cloudsearch implementation of a search provider, and add a Solr
implementation of a search provider.
2015-05-13 12:47:41 -07:00
weffey
35e3997921 Takedown tool
Conflicts:

	r2/r2/models/account.py
2015-05-13 12:22:30 -07:00
Chad Birch
0fbea80d45 Integrate AutoModerator into the site 2015-03-31 14:56:19 -06:00
Neil Williams
653c6e5113 Upgrade authentication providers to modern system.
This is more consistent with other providers and makes it possible for
providers to live outside r2.
2015-03-19 11:52:06 -07:00
Neil Williams
2b4c3d1fd3 Move CDN client IP verification to a provider.
This makes the base controller a bit cleaner and should be more
flexible.
2015-03-19 11:51:39 -07:00
xiongchiamiov
d3919b9357 Install python-mock for tests
We've been using the `mock` module for one of our tests, but seem to have never
added it to any of the installation scripts.
2015-03-16 14:00:43 -07:00
Keith Mitchell
aa87a4e944 Use unidecode for better slugs 2015-02-26 11:53:26 -08:00
Neil Williams
af09fa8dee Update license headers to 2015.
The highlight of each year for me.
2015-01-08 13:35:03 -08:00
Keith Mitchell
7d93774781 setup.py: Pin requests version to <1.0.0
The requests lib changed significantly and incompatible to
our usage in version 1.0.0.

(Specifically, response.json became response.json())
2014-10-06 10:26:41 -07:00
Neil Williams
90cfcaaecc Update license headers to 2014.
Ok, now I'm getting some angst in my commit messages like my
predecessors had.  I understand now.  It's a terrible burden.  Why must
the calendar progress?  Why must numbers increment?  The world is
forever turning.

The future is here.

It is 2014.
2014-05-02 16:26:31 -04:00
Neil Williams
dce6b6d84f CSS Filter: replace cssutils with tinycss2.
The aim of this patch is to allow a mostly equivalent subset of CSS
through as the cssutils-based parser did.

The subset of valid properties represented in this are the entirety of
CSS2.1 plus a handful of newer ones that are already in active use on
reddit.

Several IE hacks like the "filter" property, "_height", etc. are no
longer allowed.
2014-04-29 11:09:43 -07:00
Neil Williams
a681324228 Remove obviated workaround for babel bug.
This bug is no longer an issue since we upgraded to Babel 1.3.
2014-01-24 11:43:51 -08:00
Neil Williams
8f7db4f3da Media Provider: Add "filesystem" provider for local nginx.
This media provider is for simple single-server installations where an
HTTP server running on the same machine handles serving of the static
media files.

An appropriate setup with nginx is now the default in the new install
script.
2013-10-14 13:55:56 -07:00
Neil Williams
5cbea9cdf4 Factor S3 media uploads out to new provider system.
This introduces a new "provider" system which allows core pieces of
code to be swapped out for different hosting setups.
2013-10-14 13:55:56 -07:00
Brian Simpson
53c6a41e49 Update Babel to 1.0. 2013-10-09 16:28:43 -04:00
Neil Williams
c20db7e11d Use cythonize to manage translation of .pyx -> .c.
This removes the need to run `make pyx` before running setup.py on an
initial install which had stopped working due to various imports needed
for the makefile. Additionally, cythonize is capable of tracking
dependencies the cython files have, such as external headers or other
cython files.

I had to upgrade setuptools to distribute to get v0.6.16 which is the
minimum required to properly use `cythonize` due to a bug in setuptools:

https://bitbucket.org/tarek/distribute/issue/195/
2013-09-27 14:05:38 -07:00
Neil Williams
ad08a19060 setup.py: Ensure we get WebTest <= 1.4.3.
The 2.x series of WebTest requires WebOb >= 1.2 which won't work for us.
2013-09-27 14:05:38 -07:00
Neil Williams
a035d8b9e2 setup.py: Remove obsolete line.
This should've gone away in 8b7b3a307b.
2013-09-27 14:05:38 -07:00
Neil Williams
89a56de538 setup.py: Include a dependency link for PyCAPTCHA 0.4.
PyPI only has versions for Python 2.3 and 2.4. Modern installs that
don't use our PPA to get a debianized copy of this library fail when
trying to resolve the setup.py install_requires dependencies. This fixes
the problem by using a reddit-hosted tarball of the 0.4 source (taken
directly from the source SVN repo).
2013-09-27 14:05:38 -07:00
Brian Simpson
ed18fc5b21 Delete g.countries. 2013-09-27 15:20:41 -04:00
bsimpson63
5967acfa83 Use an ad server to select promos for spotlight.
Replaces client side weighted random selection.
2013-09-18 19:40:38 -04:00
Neil Williams
928e51e886 i18n: Work around bug in babel's "extract_messages". 2013-07-24 13:54:41 -07:00
Neil Williams
e408d2903d setup.py: Remove unnecessary babel commands.
These are defined by default when babel is around. No need to
specify them manually.
2013-07-24 13:54:41 -07:00
Neil Williams
8af415476b Update and fix license headers for 2013.
Angst!
2013-03-19 20:03:40 -07:00
Neil Williams
3574a64992 Add an optional paste-filter compatible Gzipping middleware.
The paste-supplied gzip middleware is primarily for testing and is
insufficient in that it:

1) is unable to require a minimum size for gzipping
2) does not correctly add the "Vary: Accept-Encoding" header

it is also somewhat difficult to add those features given its structure.
2013-03-07 15:21:01 -08:00
bsimpson63
3d511075a0 Stripe payments for reddit gold. 2013-02-15 14:12:15 -05:00
Neil Williams
7a81779ad7 Upgrade to Pylons 0.9.7. 2013-02-01 14:39:29 -08:00
Neil Williams
ce6450841e setup.py: Update snudown link to new GitHub download URL. 2013-01-16 10:20:50 -08:00
Neil Williams
3e73f5769c setup.py: Remove unused and potentially confusing commands. 2013-01-02 15:27:11 -08:00
Neil Williams
54223e8825 Make it possible to run all automated tests via nosetests.
This setup assumes the existence of a `test.ini` file. No current tests
mutate backend state, but that may happen in the future so don't make
your test.ini point at production!
2013-01-02 15:27:11 -08:00
Logan Hanks
1468f32a2a Drop in replacement code for python-statsd. 2012-10-23 14:30:13 -07:00