23 Commits

Author SHA1 Message Date
David Wick
faac2af02f tracker.py: Ensure /click endpoint doesn't modify destination urls
Omitting `keep_blank_values` was dropping blank query parameters.
Furthermore, converting the output of `parse_qsl` to a dictionary
was unnecessarily modifying the order of parameters since dicts
are not ordered. Fortunately `urllib.urlencode` also accepts a
sequence of two-element tuples and the order of parameters in
the encoded string will match the order of parameter tuples in the
sequence.
2016-09-13 15:34:41 -07:00
David Wick
db34bcaf40 Ads: Do not unescape click urls 2015-11-16 15:49:59 -08:00
umbrae
0850bd3044 Tracker: URL decode session cookie 2015-02-20 23:58:51 -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
John-William Trenholm
9e64e56960 tracker.py: use env var for configuration file
Upstart needs to use a environment variable to determine the
configuration file.
2015-02-12 16:00:04 -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
Brian Simpson
af04006baf click: unquote destination before unmangling query string. 2014-12-10 13:09:19 -08:00
Brian Simpson
966bb14675 Click redirect: fix encoding of destination url.
Some advertisers set their ad's url to an intermediate tracker so
they can independently track clicks. This results in a series of
redirects like this:

reddit tracker > intermediate tracker > final destination

The ad's url is communicated to the reddit tracker through a query
parameter which is urlencoded on reddit.com and then unquoted when
being handled by the reddit tracker. This unquoting causes problems
if there is an intermediate tracker with its own query string
that needs to be urlencoded. This commit adds handling for those query
strings.
2014-12-10 13:09:18 -08: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
Brian Simpson
78631fa746 Properly encode arguments for click tracker. 2014-10-09 05:55:50 -04:00
Brian Simpson
4bd2eb6ab8 Remove support for old click and impression hashes. 2014-10-09 05:55:50 -04:00
Brian Simpson
0a67287684 tracker: Delete unused adtracker_url. 2014-10-07 16:21:59 -04:00
Brian Simpson
4a9d7457bd tracker: Use constant_time_compare for hash check. 2014-10-07 16:21:54 -04:00
Brian Simpson
5a012fb789 Support new click and impression hashes that don't include IP.
Support new and old style hashes in verify.c and the click redirect app,
but only generate old style hashes.
2014-10-07 16:21:26 -04: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
Brian Simpson
17fcb723fc fetch_trackers: allow up to 100 ids. 2014-04-01 21:41:39 -04:00
Neil Williams
8af415476b Update and fix license headers for 2013.
Angst!
2013-03-19 20:03:40 -07:00
Neil Williams
73f518adea fetch_trackers: Use X-Forwarded-For when behind a trusted reverse proxy. 2013-01-28 12:08:22 -08:00
Neil Williams
417e8e6bb5 fetch_trackers: Make trackers.py self-packaging for Elastic Beanstalk.
This should have no effect on actually running the script, but is useful
if you do want to use Eb or likely some other service like GAE.
2013-01-28 12:08:22 -08:00
Neil Williams
914b949286 Update / add license headers.
I'm actually quite excited to do this.
2012-06-19 14:02:42 -07:00
Keith Mitchell
3ff6d3a66c Avoid iri_to_uri in flask redirect 2012-02-09 11:54:24 -08:00
Neil Williams
93a65a6a3a Move onload out of the app.
We need onload to be able to get a client-IP based
tracking validation hash, but it doesn't actually need
to do any database work to make those hashes. It also
fails a huge number of times per day. This moves the hash
calculation out to an external app with no db dependencies.
2011-10-06 08:22:16 -07:00