aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools
Commit message (Collapse)AuthorAgeFilesLines
* Fix sessions so they work across the site.Christopher Allan Webber2013-04-101-3/+1
|
* Make session cookies more secure.Elrond2013-04-091-3/+6
| | | | | | | | | 1. Our session cookies only need to be available to http, so mark them appropiately. 2. Send the cookie to the subpath for mediagoblin. And instantiate a session manager on the app, once.
* Fix left over from variable renaming.Elrond2013-04-091-1/+4
|
* Call is_updated instead of testing it boolean.Brett Smith2013-03-251-1/+1
|
* Harden It's Dangerous key management.Brett Smith2013-03-241-20/+45
| | | | | | | | | | The previous code was theoretically subject to timing attacks, where an attacker could read the key in between the time it was saved to the file and when the chmod happened. This version prevents that by using umasks to ensure the files always have the right permissions. This version also avoids using a key that cannot be saved due to some system setup bug.
* Set a starting value for session.send_new_cookie.Brett Smith2013-03-241-1/+5
| | | | | | This makes session.__init__ slightly more complicated but probably simplifies everything else, especially if we make the class smarter later by having it track changes itself.
* Delete the session cookie on an empty session.Brett Smith2013-03-241-1/+4
|
* Back sessions with It's Dangerous.Brett Smith2013-03-242-1/+61
| | | | This is a contribution to #668.
* Improve fs security for itsdangerous secret.Elrond2013-03-221-2/+6
| | | | Set mode 700 on the directory, mode 600 on the file.
* Docs for get_timed_signer_url.Elrond2013-03-221-0/+26
|
* Basic itsdangerous infrastructure.Elrond2013-03-221-0/+55
| | | | | Implement the basic infrastructure for using itsdangerous in mediagoblin. Usage instructions will follow.
* A more realistic "con" explaination in the docstring of ↵Christopher Allan Webber2013-03-151-1/+4
| | | | | | | | exif_fix_image_orientation Thanks to dnet for catching this. This commit sponsored by Chester Zeller. Thanks!
* Huge amount of work to (mostly) allow .ogg (and maybe other) formats to skip ↵Christopher Allan Webber2013-03-021-1/+0
| | | | | | | | | | | | | | | | | | | transcode - Update get_display_media in several ways: - now uses the media type's own declaration of the order of things - returns both the media_size and the media_path, as per the docstring - implicitly uses self.media_files as opposed to forcing you to pass it in - update videos to use get_display_media - update images to declare media_fetch_order in the media manager (videos also) - update stl to use media.media_files['original'] instead of weird use of get_display_media - update sidebar to only conditionally show webm_640 TODO still: identify video type information *during* processing, show that in the <video><source /></video> element. This commit sponsored by Nathan Yergler. Thanks, nyergler!
* simplified get_usefulAndrás Veres-Szentkirályi2013-02-221-6/+1
|
* use dict.iteritems() instead of dict.items()András Veres-Szentkirályi2013-02-221-1/+1
|
* use list expression instead of 3-deep forAndrás Veres-Szentkirályi2013-02-221-7/+2
|
* simplified clean_exifAndrás Veres-Szentkirályi2013-02-221-6/+2
|
* close file properly and remove unneeded variableAndrás Veres-Szentkirályi2013-02-221-6/+2
|
* typofix in commentAndrás Veres-Szentkirályi2013-02-221-1/+1
|
* use key in dict instead of key in dict.keys()András Veres-Szentkirályi2013-02-221-1/+1
|
* Merge remote-tracking branch 'pythonsnake/537_version'Elrond2013-02-191-0/+2
|\ | | | | | | | | | | * pythonsnake/537_version: Added "version" before the version Fix bug 537
| * Fix bug 537pythonsnake2013-02-101-0/+2
| |
* | Fix deleting media with attachments.Elrond2013-02-181-1/+1
|/ | | | | | | | | | | | | | If one deletes a media with attachments, there have been various problems: 1) If the file in the storage did not exist any more (maybe because due to a previous deletion attempt?), the error propagation failed, because the wrong thing was gathered. 2) The attachment database entries were not deleted. Using cascade for this, for now. Also add a simple unit test, that tests both by having a broken attachment on a media.
* Use system wide EXIF package, if available.Elrond2013-02-071-1/+5
| | | | | | Created and tested by Simon Fondrie-Teitler. Thanks!
* Improve formatting for hook template docs.Elrond2013-01-311-1/+8
|
* Switching set syntax to python2.6 compatibleChristopher Allan Webber2013-01-311-1/+1
|
* Even better documentation for get_hook_templates!Christopher Allan Webber2013-01-301-1/+9
| | | | Tells how you *can* use it in templates if you really like.
* Improved documentation for get_hook_templates, noting the template tagChristopher Allan Webber2013-01-301-0/+9
|
* Moved the docstring for the plugin template stuff from the class to module ↵Christopher Allan Webber2013-01-301-13/+19
| | | | method
* No need for an __init__ at all in the TemplateHookExtension, really.Christopher Allan Webber2013-01-301-4/+1
|
* Move template hook over to a template_hook tag. Seems to work! :)Christopher Allan Webber2013-01-301-1/+37
|
* Geolocation stuff, including including templates seems to be working-ishChristopher Allan Webber2013-01-302-1/+12
| | | | | | | - I'm having trouble seeing if the geolocation stuff actually works, but plugins are included - including a list of template hooks works, however the macro to include them does not, so it's kinda verbose
* Very start of plugin hooks and openstreetmap pluginificationChristopher Allan Webber2013-01-301-0/+27
| | | | | | | | - Added start of template hook code to pluginapi.py - Started to break openstreetmap into plugin; moved templates - Added plugin hooks in media and image media templates ... almost certainly, none of this works yet. :)
* Better Py3 compat: d.has_key(k) -> k in dElrond2013-01-303-4/+3
| | | | | | | | py3 does not have dict.has_key any more. You have to use "key in dict" instead. As that works in python2 as well, let's use that. Also some small bits of pep8.
* Merge branch '216_cwebber_style_unique_slugs'Christopher Allan Webber2013-01-251-1/+1
|\
| * Disallow ":" as part of a media slugSebastian Spaeth2013-01-151-1/+1
| | | | | | | | | | | | | | We might want to use "id:IDN" as a special case slug to point to a media's id. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Normalize the email address in the same way in all placesSebastian Spaeth2013-01-211-0/+13
| | | | | | | | | | | | | | | | | | We were case normalizing the email address for registration, but not at all for the forgotten password retrieval. Make a tools.mail.normalize_email helper that can be used to normalize the email in the same way in all places. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Move workbench into tools directory.Elrond2013-01-171-0/+164
|/
* Move db.sql.models* to db.models*Sebastian Spaeth2013-01-071-1/+1
|
* Make translitcodec optional, and work nicely without it.Christopher Allan Webber2013-01-061-3/+12
|
* Fix up symlinks in exif bumpSebastian Spaeth2012-12-262-1916/+1
| | | | | | | | | | | | | | Previous exif bump copied the newer version into mediagoblin/tools/extlib/exif but not in extlib/exif. Fix this by bumping extlib/exif and symlinking to tools/extlib/exif. Do note that this is still the version fetched from http://sourceforge.net/projects/exif-py/ while the upstream maintainer seems to be active on: https://github.com/ianare/exif-py (The sf.net download is quite new though) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Remove ObjectId from the treeSebastian Spaeth2012-12-252-2/+2
| | | | | | | This was one of the last remaining Mongo holdouts and has been removed from the tree herewith. Good bye, ObjectId. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Remove InvalidIdSebastian Spaeth2012-12-251-9/+3
| | | | | | It was a NoOp in our Non-mongo world. So it is safe to remove. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* RIP out mongoSebastian Spaeth2012-12-251-1/+1
| | | | | | | | | Since sqlalchemy is providing our database abstraction and we have moved away from Mongo as the underlying database, it is now time to simplify things and rip out mongo. This provides the bulk of the changes, and can stand on its own. There are some followup tasks that can be done, such as removing now unneeded abstraction layers, e.g. db.sql.fake.py
* Update extlib/EXIFSebastian Spaeth2012-12-253-3/+1917
| | | | | | | | | | | | Bump bundled EXIF lib to 1.0.10 as release in Sep 2012. Also skip unused detailed EXIF tags for reading, we might turn that on when we need them. Adapt test to wording change in EXIF Flas field and due to the fact that we use "details=False" by default now (we did not use these anyway) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Rewrite routing using new MGRoute classElrond2012-12-231-12/+15
| | | | | | | | | | | MGRoute subclasses Rule(): Rule doesn't have a way to tag extra data, like the controller function, we need. So MGRoute has a new attribute .gmg_controller, which holds this. Rewrite everything to use this new Rule variant and drop all the other stuff that mapped endpoints to controller functions, mostly.
* Move things from routing.py to tools/routing.pyElrond2012-12-231-0/+63
| | | | | | | This stops a cyclic import. Move add_route, mount and endpoint_to_controller into tools/routing.py and change all callers.
* Provide tools.response.render_http_exception and use thatSebastian Spaeth2012-12-231-0/+19
| | | | | | | | | | | | | | | | | | | | | | | After the webob->werkzeug transition, controller functions can raise werkzeug.HttpExceptions. We need to catch these in app.py when calling the controller and handle them, rendering the corresponding error Response() object. For consistency, we also want to allow meddleware functions to raise HttpExceptions (e.g. the csrf meddleware needs to complain about lack of cookies), so wrap the request and response parts of the meddleware too. Finally, the urlmap.match() can also raise HttpExceptions, so we give it the same treatment (render_http_exception). I am not sure, if we do not need to handle the Redirect exception there in any different way though... The new function render_http_exception makes use of the render_error infrastructure to return a nicely templated error page. It also checks if the stock error messages was used in cases where we have localizations (403, 404) and use those. It is now possible to do things like "raise Forbidden(_('You suckr'))" or raise NotFound(_('where is my left show again')) if you want to return customized error messages to the user. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Remove Mongoism query.skip()Sebastian Spaeth2012-12-211-2/+5
| | | | | | | | | | sqlalchemy supports slice() or [n:m] just fine. Right now, it seems we cannot distinguish beween "empty" results and out-of bound slices. It would be nice if we could distinguish these somehow. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Remove webob from render_to_responseSebastian Spaeth2012-12-211-1/+5
| | | | | | | | | | We were still using webob's Response objects for template rendering. Transition to werkzeug's Response object. One caveat was that it seemed to have used the default mimetype "text/plain" for all pages, so we override the default Response class, setting the default mime type to "text/html". Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>