1811 Commits

Author SHA1 Message Date
660b7a3811 Added 'maintenance refresh_content_disposition' CLI command
This command fixes the filename in the Content-Disposition header of file
variations on Google Cloud Storage. This is to fix the existing files after
fixing T51477.
2018-01-26 16:03:11 +01:00
e5fb156224 Fix logging in check_home_project_groups CLI command 2018-01-26 15:05:49 +01:00
de1eab4596 GCS: the slash is a separator, and not part of the directory name itself. 2018-01-26 14:58:42 +01:00
de1c227ccd GCS storage: use self.subdir instead of hard-coded '_' 2018-01-26 14:58:25 +01:00
230b2c669c Implement rename-after-Zencoder-is-done using our Storage API.
This means it's no longer GCS-specific, and can be tested using the local
storage implementation.

Required implementation of a rename operation. To mirror Google's API, I've
implemented the renaming of a Blob as a function on the Bucket class.
To me this makes sense, as it requires creating a new Blob instance, which
shouldn't be done by another Blob.
2018-01-26 14:54:34 +01:00
2e2314c16b Replace storage backend 'pillar' with 'local'
The backend 'pillar' is obsolete; 'local' is the modernity and uses our
nice storage API.
2018-01-26 14:13:03 +01:00
75e2402420 Removed unused import 2018-01-26 12:49:53 +01:00
fb121a9601 Test actual Zencoder notification.
This notification was taken from our API history and was actually sent to
us by Zencoder.
2018-01-26 12:49:45 +01:00
f8c3408f18 Properly handle errors when saving updated file doc after Zencoder notif.
We never checked the return values from the put_internal() call, so errors
would have passed silently into the night.
2018-01-26 12:49:15 +01:00
89ca0516a9 Better handling of Zencoder error notifications. 2018-01-26 12:29:22 +01:00
5ae98507e3 Added missing unittest for encoding.size_descriptor() 2018-01-26 12:15:56 +01:00
66ac8c6587 Modernised ZencoderNotificationTest 2018-01-26 12:15:42 +01:00
fd95135f66 PEP 8 formatting and removal of unused import 2018-01-26 11:42:56 +01:00
987d6d03a6 Fix T49280: Make texture files (in texture node) sortable
Rather than making them sortable, I made them automatically sorted upon
saving the node. The colour map comes first, then the other maps in
alphabetical order.
2018-01-26 11:42:42 +01:00
9b3a836c83 Fix for project-less files 2018-01-26 10:45:11 +01:00
741cdf6e12 Elastic: regenerate picture URL before inserting into ElasticSearch
This ensures the thumbnail URL is public so that it won't expire.
Since this now requires API calls to Google, I've increased the number of
parallel threads used for indexing, since they'll be waiting for network
I/O more.
2018-01-26 10:29:28 +01:00
0744aeb42f app → current_app
'app' doesn't exist.
2018-01-26 09:37:25 +01:00
ae7489d8e7 Don't hide form items in CSS
If those should be hidden, it should be done in the form_schema of the
node types, and not with CSS.
2018-01-25 17:31:13 +01:00
666da0adda Show status in texture view_embed 2018-01-25 16:17:26 +01:00
889b5dc1c5 Removed redundant if around for 2018-01-25 16:17:18 +01:00
b3a36f2833 Fix T49930: bug in texture count 2018-01-25 15:51:15 +01:00
dd8d19178b Removed unused function 2018-01-25 15:50:48 +01:00
840e8ba29b Fix issue when editing org without IP range.
Stupid JavaScript ''.split('\n') results in Array('') instead of Array().
2018-01-25 14:35:33 +01:00
6a17949fdf Added Roles & Capabilities page to user settings
Thanks @fsiddi for helping with the explanatory text.
2018-01-25 14:01:28 +01:00
0a0c47205f Use Jinja2 inheritance to render settings pages.
This gives us more flexibility than using {% include %}.
2018-01-25 14:01:28 +01:00
fd3e795824 Store IP-based org-given roles in the user document.
This is a two-stage approach that happens when a new token is verified
with Blender ID and stored in our local MongoDB:

  - Given the remote IP address of the HTTP request, compute and store the
    org roles in the token document.
  - Recompute the user's roles based on their own roles, regular org roles,
    and the roles stored in non-expired token documents.

This happens once per hour, since that's how long we store tokens in our
database.
2018-01-25 14:01:28 +01:00
270bb21646 Support IP range editing in Organization view_embed 2018-01-25 14:01:28 +01:00
d3f97358d9 Work around Eve not supporting returning binary data 2018-01-25 14:01:28 +01:00
c44f0489bc Backend support for organization IP ranges.
We can now store IP ranges with Organizations. The aim is to have any user
logging in with a remote IP address within such a race will get the
organization roles assigned to the user object stored in the Flask session.

This commit just contains the MongoDB storage and querying, and not yet the
updates to the user.
2018-01-25 14:01:28 +01:00
9bd41ed5d7 Added urljoin Jinja2 filter
Use as {{ config['THESERVER'] | urljoin('path/on/server') }}. It uses
the urllib.parse.urljoin() function to do this.
2018-01-25 14:01:28 +01:00
0eca0c706f Introducing overridable comments list rendering
By refactoring part of comments_for_node into a dedicated function called render_comments_for_node, we enable Pillar apps to override the comment url and determine in each app what are the conditions that allow a user to post.
Further, we introduce an extensible and overridable list_embed.pug, which currently defines custom blocks for when the user is allowed and not allowed to post a comment,
2018-01-20 00:43:54 +01:00
4da7a84c86 Fix for broken urls in blog list
This actually undoes commits 90c62664a6713a9330a4fe44f2cfe58124b29ed3 and 18fe240b931ab8dbd3a8a9fb6760c8b8cdba7ad3 and simply adds the node.url property when rendering a post in the posts_view function. This is what the template macro actually expected in the first place.
2018-01-18 16:02:29 +01:00
2b2910a1ac Fix typo in comment 2018-01-18 15:59:45 +01:00
90c62664a6 Fix for broken url in blog post title and meta 2018-01-18 12:30:06 +01:00
18fe240b93 Fix for broken url in blog post header image 2018-01-18 11:37:55 +01:00
bdff391440 Support for rendering of video file attachments 2018-01-17 15:55:25 +01:00
46beaece75 Implemented pillar.flask_extra.ensure_schema(url)
This function ensures that the URL has the correct schema, given the
app configuration. This is required because the Flask instance can sit
behind an SSL-terminating proxy like HAProxy and not know that it is
reachable via HTTPS.
2018-01-12 17:21:38 +01:00
15ce143356 Include Last-Modifed HTTP header in Blog feed response 2018-01-12 16:49:43 +01:00
7245dac1ca Elastic: reverted previous two commits
The ngrams cause too much noise in the search results.
2018-01-12 16:27:09 +01:00
6748fd0006 Elastic: use ngrams for user search but not assets 2018-01-12 15:36:15 +01:00
b2bd01117e Elastic: tweaked user indexing
This makes it a bit more "fuzzy", so users are also matched on N-grams
and not just N-grams-from-the-start-of-the-word.
2018-01-12 15:28:33 +01:00
31ca4f3d23 Gracefully handle Elastic errors in user search 2018-01-12 15:27:56 +01:00
8326d8e7fe Elastic query: remove matching on document type.
ElasticSearch 6 removes support for different document types in one index,
so we don't have to match for it any more. Furthermore, elasticsearch_dsl
seems to save with the generic 'doc' type, so this check is
counter-productive.
2018-01-12 11:17:52 +01:00
3e5ccaf8fd Elastic indexing: explicitly save into the configured index. 2018-01-12 11:16:42 +01:00
68b6e43649 Upgraded ElasticSearch to 6.1.x. 2018-01-11 10:29:15 +01:00
ca3d99c52c Search JS: fixed node type display 2018-01-10 17:23:11 +01:00
55ccd39960 removed debug log entries 2018-01-10 17:23:06 +01:00
61673ef273 Search: implemented pagination
- Got rid of the nasty off-by-one logic in the JavaScript.
- Implemented pagination at the API.
2018-01-10 17:07:21 +01:00
82a2e9a523 Search: Disable Algolia backend 2018-01-10 15:53:56 +01:00
36da289746 user search: boost exact matches on username 2018-01-10 15:12:39 +01:00