77 Commits

Author SHA1 Message Date
Christopher Allan Webber
7c563e91bf Attach the MediaGoblinApp to the engine, and provide a way for models to access
This allows SQLAlchemy models to gain access to app-level configuration
without the need for global variables.

This commit sponsored by Peter Hogg.  Thank you, Peter!
2014-12-03 15:40:58 -06:00
Christopher Allan Webber
b8e2ab2f55 Starting to deprecate the app_config, global_config by attaching stuff to app
- app.global_config, app.app_config
 - making setup_crypto use app.app_config
 - setting app.workbench_manager
2014-12-03 15:40:57 -06:00
Jessica Tallon
11f0e2f89b Add documentation on changing data dir and Fix stylistic changes 2014-09-29 09:04:04 +01:00
Christopher Allan Webber
2b1e0af03b defaults now pulled from a mashup of mediagoblin.ini and config_spec.ini
This commit sponsored by Thomas Løcke.  Thank you!
2014-09-24 18:13:19 +01:00
Christopher Allan Webber
a6252cbf21 Merge branch 'merge-python3-port'
Conflicts:
	setup.py
2014-09-22 13:58:13 -05:00
Matt Molyneaux
584520e325 The scheduled garbage collection task was not being called due to it being misnamed
Fix #968
2014-09-16 21:05:32 +01:00
Christopher Allan Webber
f6bad0eb26 Merge branch 'master' into merge-python3-port
Has some issues, will iteratively fix!

Conflicts:
	mediagoblin/gmg_commands/__init__.py
	mediagoblin/gmg_commands/deletemedia.py
	mediagoblin/gmg_commands/users.py
	mediagoblin/oauth/views.py
	mediagoblin/plugins/api/views.py
	mediagoblin/tests/test_api.py
	mediagoblin/tests/test_edit.py
	mediagoblin/tests/test_oauth1.py
	mediagoblin/tests/test_util.py
	mediagoblin/tools/mail.py
	mediagoblin/webfinger/views.py
	setup.py
2014-09-16 14:01:43 -05:00
Jessica Tallon
9246a6ba89 Tidy up federation code and add tests to cover more of the APIs 2014-08-18 10:51:32 -05:00
Jessica Tallon
d8f55f2b41 Add unseralize for API objects 2014-07-22 23:13:16 +01:00
Jessica Tallon
0679545f19 Add garbage collection task 2014-07-22 23:13:16 +01:00
Berker Peksag
386c9c7c55 Use six.iteritems() instead of dict.iteritems(). 2014-05-26 19:50:38 +03:00
Emily O'Leary
4a698535bc Improved test runtime from 352 seconds to 59 seconds by implementing an in-memory sqlite DB and including an option to run migrations on this newly created database by adding a config option called run_migrations to the config_spec and passing it along in app.py to the setup_database function. 2013-06-25 20:57:50 -04:00
Joar Wandborg
2d7b6bdef9 New notifications
- Added request.notifications
- Email configuration fixes
  - Set config_spec default SMTP port to `0` and switch to SSL/non-SSL
    default if `port == 0`
  - Added email_smtp_use_ssl configuration setting
- Added migrations for notification tables
- Added __repr__ to MediaComment(Mixin)
- Added MediaComment.get_entry => MediaEntry
- Added CommentSubscription, CommentNotification, Notification,
  ProcessingNotification tables
- Added notifications.task to celery init
- Fixed a bug in the video transcoder where pygst would hijack the
  --help argument.
- Added notifications
  - views
    - silence
    - subscribe
  - routes
  - utility methods
  - celery task
- Added half-hearted .active comment CSS style
- Added quick JS to show header_dropdown
- Added fragment template to show notifications in header_dropdown
- Added fragment template to show subscribe/unsubscribe buttons on
  media/comment pages
- Updated celery setup tests with notifications.task
- Tried to fix test_misc tests that I broke
- Added notification tests
- Added and extended tests.tools fixtures
- Integrated new notifications into media_home, media_post_comment views
- Bumped SQLAlchemy dependency to >= 0.8.0 since we need polymorphic for
  the notifications to work
2013-06-09 21:18:37 +02:00
Christopher Allan Webber
df69695d9e Various fixes to plugin assetlinking command.
Actually trying to run the command helps figure out what needs to be
fixed :)

This commit sponsored by Justin Nichol.  Thank you!
2013-05-23 13:33:07 -05:00
Christopher Allan Webber
5ccb16ca20 Work towards getting plugin static linking/serving to work
- add link_plugin_assets.  For now, incorrectly running from
   ./bin/gmg theme assetlink... uh, will fix ;)
 - Update paste and config_spec.ini configs to handle the locations
   and serving of the plugins' static resources

This commit sponsored by Marko Dimjašević.  Thank you!
2013-05-23 13:33:07 -05:00
Christopher Allan Webber
d6d2c771bd Start of ability to have plugins provide static resources!
Note I have not tested any of this yet ;)  But we're already on our way:
 - We've got docs
 - The hook is there

Lots to do still though.  But, progress! :)

This commit sponsored by Laura Arjona Reina.  Thanks larjona!
2013-05-23 13:33:07 -05:00
Christopher Allan Webber
a98c95b41d Tests should no longer use the environment-variable-related-setup and set up in app instead
This should remove a bunch of confusing cruft.  I hate using that
environment variable!  Also that old code was fragile.

This commit sponsored by Stephen Milton.  Thanks!
2013-05-12 15:55:59 -05:00
Christopher Allan Webber
e5cdd74294 Fix the new config "plugin spec" loading code so it doesn't break on no plugins section 2013-05-08 15:21:15 -05:00
Christopher Allan Webber
7fadc33b80 Allow plugins to install their own config_spec.ini if they like.
This commit sponsored by Timothy Vollmer.  Thanks Tim!
2013-05-08 11:02:20 -05:00
Christopher Allan Webber
c5d8d30182 removing old callable utilities and porting stuff over. 2013-04-19 16:51:14 -05:00
Christopher Allan Webber
761e26bb29 Merge branch '637_friendlier_hooks' 2013-04-10 17:53:05 -05:00
Christopher Allan Webber
04f295e20d Switch several functions over to using the new callable_run* tools! 2013-04-10 17:52:49 -05:00
Brett Smith
9e1fa2396f Remove beaker stuff from the code.
This is all obsoleted by It's Dangerous.
2013-03-24 15:10:08 -04:00
Joar Wandborg
f3f530286f Updated raven plugin
- Added wrap_wsgi, celery_setup, celery_logging_setup hooks
- Updated raven plugin docs
- Updated production considerations docs
- Added raven logging setup
2013-03-03 02:32:03 +01:00
Christopher Allan Webber
86f0ff75e3 You can now set the PASTE_CONFIG environment variable to control logging setup
So this should work:

  PASTE_CONFIG=/path/to/paste_foo.ini ./lazycelery.sh

Thanks to Laurent Fournier for sponsoring this commit!
2013-02-25 12:15:12 -06:00
Joar Wandborg
9d7c69fb74 Use logging.config.fileConfig()
Instead of the monster I had built before.
2013-02-07 22:35:42 +01:00
Elrond
626a093ccc Move workbench into tools directory. 2013-01-17 22:15:57 +01:00
Sebastian Spaeth
bc142abc55 RIP out mongo
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
2012-12-25 20:06:03 +01:00
Sebastian Spaeth
826919c97c en_US is always available
We were using "en" as fallback only when no preferred language matched.
This is obviously bad. Always insert en_US as available locale, so we
can match it with the accept_languages.

Don't set available_locales as mg_global, per discussion with paroneaya,
make it a global var in translate.py

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-02 02:46:50 +01:00
Sebastian Spaeth
6ef75af50e Honor user's browser language (#558)
Previously we would attempt to satisfy the user's first language
preference, immediately falling back to english if that was not
possible. Now, we will get the best match of the user's preferred
languages.

This requires storing the available locales on app startup, so we
have mg_globals.available_locales ready to compare them against the
list of preferred user languages.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-02 00:29:30 +01:00
Joar Wandborg
2806a857dd Removed debugging stuff from master 2012-09-30 14:49:50 +02:00
Joar Wandborg
b4ab702f10 Use RawConfigParser instead of dict.viewitems
dict.viewitems breaks python 2.6 compatibility.
2012-09-30 14:42:12 +02:00
Joar Wandborg
b1bb15d1f9 Set up celery logging from paste ini 2012-09-30 12:43:36 +02:00
Will Kahn-Greene
05d8f314c6 [Issue 466] Implement e-z plugin disabling 2012-07-17 21:14:45 -04:00
Will Kahn-Greene
05e007c1db Rework plugin infrastructure to nix side-effects
This reworks the plugin infrastructure so as to remove module-loading
side-effects which were making things a pain in the ass to test.

With the new system, there's no auto-registering meta class. Instead
plugins do whatever they want and then specify a hooks dict that maps
hook names to callables for the things they're tying into. The most
common one (and the only one we've implemented so far) is "setup".

This also simplifies the sampleplugin a little by moving the code
to __init__.py.
2012-07-17 21:02:12 -04:00
Will Kahn-Greene
8545dd50f0 Flatpages first pass
This fixes the template loader so that it can load plugin templates.

This adds code for registering template paths so that plugins can add
their own templates.

This adds the base code for the flatpagesfile plugin. It doesn't serve
pages, yet, but it's pretty close.
2012-07-16 09:26:28 -04:00
Christopher Allan Webber
9a422c1fd0 Add the theme domain to the application's staticdirector 2012-07-14 12:55:14 -05:00
Christopher Allan Webber
5377114c4d Update staticdirect stuff so it can handle "domains" of staticdirection 2012-07-14 12:55:14 -05:00
Christopher Allan Webber
00eda826cb Kill MultiRemoteStaticDirect... nobody was really using it anyway
Since we're adding the new "domain" staticdirect system we should
clean this up.
2012-07-14 12:55:13 -05:00
Christopher Allan Webber
e8d4e58214 Moving staticdirect to tools/ 2012-07-14 12:55:13 -05:00
Christopher Allan Webber
3b47da8eab Themes are now registered and can have their templates loaded properly 2012-07-14 12:55:13 -05:00
Christopher Allan Webber
a8acb5a387 from_celery.setup_self() didn't pay attention to default_conf_file kwarg, fixed. 2012-05-20 15:17:49 -05:00
Will Kahn-Greene
29b6f91740 401. Plugin infrastructure
* implements installing, loading and setup for plugins
* codifies configuration
* has a sample plugin
* docs
* tests
2012-05-13 00:00:08 -04:00
Christopher Allan Webber
80dc071b79 Making celeryd consistent: look for mediagoblin_local.ini
Use mediagoblin_local.ini as default conf file if it exists, else use
mediagoblin.ini, just like everything else.
2012-04-22 14:09:47 -05:00
Christopher Allan Webber
d693f6bd86 SQL based tests and refactored Celery setup stuff
- Changed config files of test configs to use SQL
 - Updated celery initialization tools, factored them to be able to
   use the "big instance" application stuff
2012-03-26 11:14:11 -05:00
Elrond
4114e54df5 And fix the in-celeryd import.
So that celeryd also loads the task.
2012-03-21 12:17:52 +01:00
Elrond
b829595334 Create load_models().
So all models are ready when connecting to the db and so
our "db" object has all models listed on it, create a
function to load all models from the media_types, etc. Call
it in setup_database()

Problem: This gives celery warnings, because celery is
imported before being setup properly. No idea how to fix
this now. So media-type loading is excluded from
load_models for now.
2012-03-20 12:45:40 +01:00
Luke Slater
4f9f969dec Accidentally overwrote the celery/__init__.py, fixed this and removed the upper correctly 2012-02-28 16:47:38 +00:00
Luke Slater
6bcdd4dc70 Changed celery config keys to upper case and removed upper casing of keys when initialising the config as per issue #214 2012-02-28 16:40:37 +00:00
Christopher Allan Webber
e629cde0b3 Should be all that's needed to switch celery/kombu settings to sqlalchemy 2012-02-25 22:39:38 -06:00