Commit Graph

92 Commits

Author SHA1 Message Date
8e02de32ab Pillar Extensions can now determine which user roles to index in Algola 2017-06-15 11:31:48 +02:00
13b67702b4 Let Pillar extensions register new roles.
These will be available via the app.user_roles property.
2017-06-15 11:06:01 +02:00
efa2321ac3 Pillar extensions can now register global Jinja2 context processors. 2017-06-14 16:10:11 +02:00
5bde262ad7 Ping Celery workers when starting up.
This makes debugging Celery/RabbitMQ/Redis issues much easier, as it
happens at application startup, rather than when we first create a Celery
task.
2017-06-02 17:33:15 +02:00
5af54237b9 Integrated Celery startup / management / config with PillarServer. 2017-06-02 10:44:37 +02:00
1ce13b71a3 Add type annotation to app.pillar_extensions 2017-05-24 15:48:27 +02:00
4e268510f2 Declare pillar.current_app before importing other Pillar modules.
This makes it easier/possible to just do "from pillar import current_app"
in submodules.
2017-05-24 15:48:27 +02:00
ef2d8d14a0 Added PillarServer.validator_for_resource()
This makes it possible to perform Cerberus validation on documents.
2017-05-18 16:32:05 +02:00
1f0a855510 Added pillar.current_app local proxy
This proxy is annotated as PillarServer instance, so using it in an IDE
will give you much better autocompletion.
2017-05-18 16:31:43 +02:00
59a95450e5 Updated Eve, Flask, and Werkzeug. Adjusted code to make Pillar work again.
Eve     : 0.6.3   → 0.7.3
Flask   : 0.10.1  → 0.12.2
Werkzeug: 0.11.10 → 0.11.15

Also updated some secondary requirements.
2017-05-18 15:46:02 +02:00
e4f221ab13 Take default crappy secret key from config.py
This forces anyone installing Pillar to actually generate a proper secret.
2017-05-18 15:46:02 +02:00
47b81055fd PEP8 formatting 2017-05-18 15:46:02 +02:00
19d9684a67 Raise ConfigurationMissingError instead of SystemExit 2017-05-18 15:46:02 +02:00
d2f548faf9 Proper type annotations for PillarServer.db() 2017-05-12 13:55:55 +02:00
a6617cae68 Allow current_app.db('collections-name')
This mimics the use in Flamenco (current_flamenco.db('collection_name')),
and makes calling code a bit nicer (db('coll') instead of db()['coll'])
2017-05-10 12:08:11 +02:00
1ed31d26e5 Be more explicit in logging which video encoding service is used 2017-03-22 17:08:15 +01:00
8934eb8b8d Fix for crash on extension blueprints loading
It the extension was registered with url_prefix=None, we set url_prefix to empty string so it can be added to blueprint.url_prefix.
2017-03-22 15:49:51 +01:00
e0c525389f Renamed static.py to staticfile.py
Python 3 supports 'namespace packages', and thus can see a directory
without __init__.py as something importable. This caused a name conflict,
since there were both the file static.py and the dir static.
2017-03-22 15:49:51 +01:00
663627358f Ran 2to3 on pillar + some manual fixups
The 'manual fixups' are:

- incorrect use of dict.items() where dict.iteritems() was meant; this
  results in list(dict.items()), which I changed to dict.items().
- removal of 'from __future__ import' lines, which 2to3 changes into
  empty lines; I removed the empty lines.
2017-03-22 15:49:51 +01:00
8115bc2ad5 Collections are now named flamenco_xxx instead of flamenco.xxx
The dot notation disallowed Eve hooks, as the collection names weren't
valid Python identifiers.
2016-12-14 14:40:38 +01:00
a100d73a8b Collections in extension eve_settings now should start with the ext name.
Instead of Pillar automagically prepending 'attract.' or 'flamenco.' to the
names this should now be done explicitly in the extension's Eve settings.
This allows for more explicit configuration, and ensures foreign key
definitions are unambiguous.
2016-12-14 11:26:28 +01:00
7be8e9b967 Show a nicer 404 error when something was deleted (instead of just "not there") 2016-10-21 15:27:17 +02:00
f4b34f1d02 Error handler: set 'code' and 'description' defaults separately. 2016-10-12 10:22:25 +02:00
4eb8319697 Better logging of OAuth issues, in the hope to figure out what's going on. 2016-10-11 17:09:02 +02:00
5dd49fa5dd Pillar Extensions can now add links to the sidebar. 2016-10-11 16:33:44 +02:00
407aefb9ad Added CLI command for moving top-level nodes between projects.
Also introduces a slightly nicer way to get the database interface, and
an object-oriented way to allow dependency injection.
2016-09-27 12:57:57 +02:00
e0f92b6185 Don't log entire exception when forwarding a 412 Precondition Failed. 2016-09-23 09:40:05 +02:00
0f23ee7a08 Added handler for 412 Precondition Failed from SDK. 2016-09-22 18:09:43 +02:00
7f9f89853d Properly handle embed/non-embed error renders for some SDK exceptions. 2016-09-22 09:25:59 +02:00
40896fc70b Better logging when bad extension class is given.
This was necessary to debug an issue with different unit tests influencing
each other in Attract.
2016-09-20 15:59:39 +02:00
9e6b998c50 Refactored static file handling so that extensions can provide static files 2016-09-07 16:36:25 +02:00
b2e8711ac4 Moved Jinja2 stuff to its own module, and added |undertitle filter. 2016-09-07 16:03:40 +02:00
2730a7a2b2 Added error handlers for some PillarSDK exceptions. 2016-09-07 12:23:48 +02:00
f21b708085 Made it easier for extensions to register multiple blueprints at different URLs
The blueprint's own url_prefix='/xxx' setting is now taken into account.
2016-09-07 11:40:24 +02:00
4ae36a0dc3 Allow custom template dirs for extensions 2016-09-06 18:39:35 +02:00
49c08cba10 Custom error handlers: also properly handle non-Werkzeug exceptions. 2016-09-06 17:10:50 +02:00
ab5a4a6b6c Custom error pages.
These make a distinction between API requests on /api/ (which will return
a JSON response) and other requests (which will return HTML).

Fixes T49212
2016-09-06 14:22:52 +02:00
3d9b9e40d4 Added PillarExtension.setup_app(app)
It's called on each extension after all extensions have been processed,
and after all built-in Pillar modules have had their setup_app() called.
Call order is random.
2016-08-31 16:03:45 +02:00
4cf779e040 Keep reference to loaded extension, and refuse to load twice.
The Pillar extensions are now stored, by their name, in a dictionary.
2016-08-31 16:02:55 +02:00
b9b993fe4a Extension system: allow empty Eve settings.
Extensions are now able to return an empty dict from their eve_settings()
method.
2016-08-30 13:55:43 +02:00
07691db874 Check subscription status on login. 2016-08-23 16:09:47 +02:00
2c5dc34ea2 Introducing Pillar Framework
Refactor of pillar-server and pillar-web into a single python package. This
simplifies the overall architecture of pillar applications.

Special thanks @sybren and @venomgfx
2016-08-19 09:19:06 +02:00