pillar.git
7 months agoLog exception on each ResourceInvalid to make debugging easier master production
Anna Sirota [Mon, 26 Apr 2021 15:40:03 +0000 (17:40 +0200)]
Log exception on each ResourceInvalid to make debugging easier

8 months agoDon't validate tokens for each static asset URL
Anna Sirota [Fri, 19 Mar 2021 09:28:28 +0000 (10:28 +0100)]
Don't validate tokens for each static asset URL

8 months agoPin poetry deps to work around cryptography requiring Rust issue
Anna Sirota [Thu, 18 Mar 2021 17:49:10 +0000 (18:49 +0100)]
Pin poetry deps to work around cryptography requiring Rust issue

9 months agoRemove debug-log when auth token cannot be found
Sybren A. Stüvel [Tue, 16 Feb 2021 12:55:28 +0000 (13:55 +0100)]
Remove debug-log when auth token cannot be found

16 months agoPillar: Wider scrollbars
Pablo Vazquez [Wed, 29 Jul 2020 20:52:32 +0000 (22:52 +0200)]
Pillar: Wider scrollbars

16 months agoUpdate gulp-sass
Francesco Siddi [Thu, 23 Jul 2020 16:49:12 +0000 (18:49 +0200)]
Update gulp-sass

16 months agoBlender Cloud: Fix responsive issues on navigation.
Pablo Vazquez [Wed, 22 Jul 2020 16:32:48 +0000 (18:32 +0200)]
Blender Cloud: Fix responsive issues on navigation.

16 months agoBlender Cloud: Fix responsive issues on timeline.
Pablo Vazquez [Wed, 22 Jul 2020 16:32:35 +0000 (18:32 +0200)]
Blender Cloud: Fix responsive issues on timeline.

16 months agoBlender Cloud: Fix responsive issues on blog.
Pablo Vazquez [Wed, 22 Jul 2020 16:32:22 +0000 (18:32 +0200)]
Blender Cloud: Fix responsive issues on blog.

19 months agoNotifications: Regulate fetching via cookie
Francesco Siddi [Fri, 17 Apr 2020 11:32:22 +0000 (13:32 +0200)]
Notifications: Regulate fetching via cookie

We introduce a doNotQueryNotifications cookie with a short lifetime,
which is used to determine wether getNotifications should be called
or not. This prevents notifications from being fetched at every page
load, unless the cookie is expired.

19 months agoNotifications: Set timeout from 30 to 60 seconds
Francesco Siddi [Fri, 17 Apr 2020 11:27:41 +0000 (13:27 +0200)]
Notifications: Set timeout from 30 to 60 seconds

This slightly reduces server load, as clients that keep a page open
will query less often.

20 months agoFix T73490 Hyperlink bug
Ankit [Fri, 27 Mar 2020 08:51:40 +0000 (09:51 +0100)]
Fix T73490 Hyperlink bug

Fix typo in the link to Blender Cloud

Maniphest Tasks: T73490

Differential Revision: https://developer.blender.org/D7218

20 months agoFix issue with Cerberus
Sybren A. Stüvel [Thu, 19 Mar 2020 15:57:50 +0000 (16:57 +0100)]
Fix issue with Cerberus

Cerberus has a clause `… and X in self.persisted_document`, which fails
when `persisted_document` is `None` (which is the default value for the
parameter). This code can be found in the function `_normalize_default()`
in `.venv/lib/python3.6/site-packages/cerberus/validator.py:922`.

2 years agoReplaced Gravatar with self-hosted avatars
Sybren A. Stüvel [Fri, 24 May 2019 15:36:06 +0000 (17:36 +0200)]
Replaced Gravatar with self-hosted avatars

Avatars are now obtained from Blender ID. They are downloaded from
Blender ID and stored in the users' home project storage.

Avatars can be synced via Celery and triggered from a webhook.

The avatar can be obtained from the current user object in Python, or
via pillar.api.users.avatar.url(user_dict).

Avatars can be shown in the web frontend by:

- an explicit image (like before but with a non-Gravatar URL)
- a Vue.js component `user-avatar`
- a Vue.js component `current-user-avatar`

The latter is the most efficient for the current user, as it uses user
info that's already injected into the webpage (so requires no extra
queries).

2 years agoReformatted code and added import to resolve PyCharm warnings
Sybren A. Stüvel [Fri, 31 May 2019 10:36:19 +0000 (12:36 +0200)]
Reformatted code and added import to resolve PyCharm warnings

2 years agoRemoved trailing spaces
Sybren A. Stüvel [Fri, 31 May 2019 10:28:25 +0000 (12:28 +0200)]
Removed trailing spaces

2 years agoFix for now-allowed PATCH on users
Sybren A. Stüvel [Fri, 31 May 2019 08:23:42 +0000 (10:23 +0200)]
Fix for now-allowed PATCH on users

Commit 0f0a4be4 introduced using PATCH on users to set the username.
An old unit test failed, as it checks that PATCH is not allowed (e.g.
tests for 405 Method Not Allowed response).

2 years agoMoved `user_to_dict()` function out of pillar.web.jinja module
Sybren A. Stüvel [Fri, 31 May 2019 08:23:25 +0000 (10:23 +0200)]
Moved `user_to_dict()` function out of pillar.web.jinja module

2 years agoFixed unit test by doing late import
Sybren A. Stüvel [Fri, 31 May 2019 08:22:46 +0000 (10:22 +0200)]
Fixed unit test by doing late import

For some reason the old pillar.auth stuck around, failing the
`isinstance(some_object, auth.UserClass)` check because it compared to the
old class and not the reloaded one.

2 years agoFixed updating username in settings view
Sybren A. Stüvel [Wed, 29 May 2019 16:37:01 +0000 (18:37 +0200)]
Fixed updating username in settings view

The timestamps used by the 'last viewed' property of the video progress
feature were converted to strings when sending to the frontend, but never
changed back to timestamps when PUTting via the SDK. I solved it by not
PUTing the user at all, but using PATCH to set the username instead.

2 years agoRan `npm audit fix --force`
Sybren A. Stüvel [Wed, 29 May 2019 15:06:36 +0000 (17:06 +0200)]
Ran `npm audit fix --force`

This fixed 64 security vulnerabilities and hopefully didn't break too much.

2 years agoSuppress warnings from Werkzeug
Sybren A. Stüvel [Wed, 29 May 2019 13:22:45 +0000 (15:22 +0200)]
Suppress warnings from Werkzeug

- Werkzeug deprecated Request.is_xhr, but it works fine with jQuery and we
  don't need a reminder every time a unit test is run. When we upgrade to
  Werkzeug 1.0 (once that's released) we'll see things break and fix them.
- Werkzeug deprecated their Atom feed. This we should act on; tracked in
  https://developer.blender.org/T65274.

2 years agoSuppress Cerberus deprecation warning caused by Eve
Sybren A. Stüvel [Wed, 29 May 2019 12:32:46 +0000 (14:32 +0200)]
Suppress Cerberus deprecation warning caused by Eve

Eve is falling behind on Cerberus. See my bug report on
https://github.com/pyeve/eve/issues/1278 for more info.

2 years agoMongoDB: db.collection_names() is deprecated → db.list_collection_names()
Sybren A. Stüvel [Wed, 29 May 2019 11:43:31 +0000 (13:43 +0200)]
MongoDB: db.collection_names() is deprecated → db.list_collection_names()

2 years agoMongoDB: more changing count() → count_documents()
Sybren A. Stüvel [Wed, 29 May 2019 11:42:42 +0000 (13:42 +0200)]
MongoDB: more changing count() → count_documents()

2 years agoCerberus 1.3 renamed 'validator' → 'check_with'
Sybren A. Stüvel [Wed, 29 May 2019 10:56:13 +0000 (12:56 +0200)]
Cerberus 1.3 renamed 'validator' → 'check_with'

This results in a change in schemas as well as in validator function names.

2 years agoAdded some type declarations
Sybren A. Stüvel [Wed, 29 May 2019 10:54:11 +0000 (12:54 +0200)]
Added some type declarations

2 years agoCerberus 1.3 renamed '{value,key}schema' to '{values,keys}rules'
Sybren A. Stüvel [Wed, 29 May 2019 09:00:27 +0000 (11:00 +0200)]
Cerberus 1.3 renamed '{value,key}schema' to '{values,keys}rules'

'valueschema' and 'keyschema' have been replaced by 'valuesrules' and
'keysrules'. Note the change from 2x singular ('value' and 'schema') to
2x plural ('values' and 'rules').

2 years agoCompatibility with Eve 0.9.1
Sybren A. Stüvel [Wed, 29 May 2019 08:50:55 +0000 (10:50 +0200)]
Compatibility with Eve 0.9.1

Note that Eve's update from 0.9 → 0.9.1 had a breaking API change, as the
return type of `app.data.find(...)` changed...

2 years agoSome extra type annotations
Sybren A. Stüvel [Thu, 23 May 2019 15:35:10 +0000 (17:35 +0200)]
Some extra type annotations

2 years agoMore thorough retrying in Blender ID communication
Sybren A. Stüvel [Thu, 23 May 2019 11:42:30 +0000 (13:42 +0200)]
More thorough retrying in Blender ID communication

2 years agoRemoved and gitignored poetry.lock
Sybren A. Stüvel [Thu, 23 May 2019 14:23:45 +0000 (16:23 +0200)]
Removed and gitignored poetry.lock

The poetry.lock files are only relevant for repeatable deployments,
and the one in this project isn't used for that (only the Blender
Cloud project file is used, and that's still there).

2 years agoRe-locked dependencies
Sybren A. Stüvel [Thu, 23 May 2019 11:47:22 +0000 (13:47 +0200)]
Re-locked dependencies

2 years agoMongoCollection.count() and `update()` are deprecated
Sybren A. Stüvel [Fri, 10 May 2019 15:02:38 +0000 (17:02 +0200)]
MongoCollection.count() and `update()` are deprecated

Eve doesn't have any counting methods on `current_app.data`, so there is
no one-to-one translation for `cursor.count()` in
`file_storage/__init__.py`. Since the call was only used in a debug log
entry, I just removed it altogether.

I removed `pillar.cli.operations.index_users_rebuild()`, as it was
importing `pillar.api.utils.algolia.algolia_index_user_save` which doesn't
exist any more, so the code was dead anyway.

2 years ago`UnitTest.assertEquals` is deprecated, replaced by `assertEqual`
Sybren A. Stüvel [Fri, 10 May 2019 14:28:23 +0000 (16:28 +0200)]
`UnitTest.assertEquals` is deprecated, replaced by `assertEqual`

2 years agoRelaxed required versions of all our dependencies
Sybren A. Stüvel [Fri, 10 May 2019 14:17:02 +0000 (16:17 +0200)]
Relaxed required versions of all our dependencies

Some packages were upgraded; the rename from `CommonMark` to `commonmark`
was the only change breaking the unit tests.

2 years agoDependencies: remove requests, it's pulled in via python-pillar-sdk anyway
Sybren A. Stüvel [Fri, 10 May 2019 13:29:57 +0000 (15:29 +0200)]
Dependencies: remove requests, it's pulled in via python-pillar-sdk anyway

2 years agoDevelopment dependencies updates to their latest versions
Sybren A. Stüvel [Fri, 10 May 2019 13:28:42 +0000 (15:28 +0200)]
Development dependencies updates to their latest versions

2 years agoGenerate Blender ID URL based on configuration
Sybren A. Stüvel [Thu, 23 May 2019 11:47:39 +0000 (13:47 +0200)]
Generate Blender ID URL based on configuration

2 years agoMerge branch 'production'
Sybren A. Stüvel [Wed, 22 May 2019 08:27:25 +0000 (10:27 +0200)]
Merge branch 'production'

2 years agoput_project(project_dict): also log the error when we cannot PUT
Sybren A. Stüvel [Wed, 22 May 2019 08:15:25 +0000 (10:15 +0200)]
put_project(project_dict): also log the error when we cannot PUT

Previously only a ValueError was raised, which was sometimes swallowed.
Instead of looking up the culprit and solving this properly, I just log the
error now.

2 years agoAllow web projects to un-attach project pictures
Sybren A. Stüvel [Wed, 22 May 2019 08:14:19 +0000 (10:14 +0200)]
Allow web projects to un-attach project pictures

This makes it possible to PUT a project after attach_project_pictures()
has been called on it (which embeds the picture file documents).

This will be used in SVNman.

2 years agoAdded 'idna' package as dependency
Sybren A. Stüvel [Tue, 14 May 2019 09:19:03 +0000 (11:19 +0200)]
Added 'idna' package as dependency

It's required by pyopenssl but for some reason wasn't installed by Poetry.

2 years agoGitignore devdeps metadata directory
Sybren A. Stüvel [Fri, 10 May 2019 13:02:58 +0000 (15:02 +0200)]
Gitignore devdeps metadata directory

2 years agoDocumenting use of Poetry for dependency management
Sybren A. Stüvel [Fri, 10 May 2019 13:02:15 +0000 (15:02 +0200)]
Documenting use of Poetry for dependency management

2 years agoREADME: Removed trailing whitespace
Sybren A. Stüvel [Fri, 10 May 2019 13:02:02 +0000 (15:02 +0200)]
README: Removed trailing whitespace

2 years agoMoving to Poetry
Sybren A. Stüvel [Fri, 26 Apr 2019 09:49:38 +0000 (11:49 +0200)]
Moving to Poetry

2 years agoForms: Use own label element for fields instead of wtforms.
Pablo Vazquez [Wed, 24 Apr 2019 19:29:55 +0000 (21:29 +0200)]
Forms: Use own label element for fields instead of wtforms.

This way we can do two things:
* Tag the field for translation
* Use a filter (like undertitle for nicer labels)

2 years agoAttach all project pictures when viewing node
Francesco Siddi [Fri, 19 Apr 2019 13:30:55 +0000 (15:30 +0200)]
Attach all project pictures when viewing node

The Open Graph rendering code is not completely refactored yet,
so it still requires a mix of project.picture_header and
project.picture_16_9. By attaching all project pictures we prevent
unexpected errors.

2 years agoUse picture_16_9 as og_image
Francesco Siddi [Fri, 19 Apr 2019 12:12:43 +0000 (14:12 +0200)]
Use picture_16_9 as og_image

Previously we used picture_header, which did not guarantee a suitable
aspect ratio for an Open Graph image.

2 years agoEnhance project with attach_project_pictures
Francesco Siddi [Fri, 19 Apr 2019 12:11:42 +0000 (14:11 +0200)]
Enhance project with attach_project_pictures

Instead of individually attaching project images, use the utility
function.

2 years agoAdd picture_16_9 when attaching project pictures
Francesco Siddi [Fri, 19 Apr 2019 12:10:19 +0000 (14:10 +0200)]
Add picture_16_9 when attaching project pictures

2 years agoSave 16_9 picture via Project edit form
Francesco Siddi [Fri, 19 Apr 2019 12:09:54 +0000 (14:09 +0200)]
Save 16_9 picture via Project edit form

2 years agoRename 16x9 to 16_9
Francesco Siddi [Fri, 19 Apr 2019 09:50:41 +0000 (11:50 +0200)]
Rename 16x9 to 16_9

We do this to reduce ambiguity about resolution vs aspect ratio.

2 years agoAdd picture_16x9 attribute for Project
Francesco Siddi [Fri, 19 Apr 2019 08:57:46 +0000 (10:57 +0200)]
Add picture_16x9 attribute for Project

This image can be use as a source for Open Graph tags, as well as for
displaying a project thumbnail with a known (or at least expected)
aspect ratio.

2 years agoBumped Jinja2 2.10 → 2.10.1
Sybren A. Stüvel [Thu, 18 Apr 2019 08:15:41 +0000 (10:15 +0200)]
Bumped Jinja2 2.10 → 2.10.1

Github poked us about this being a security update.

2 years agoFix missing icons.
Pablo Vazquez [Mon, 15 Apr 2019 10:42:49 +0000 (12:42 +0200)]
Fix missing icons.

2 years agoCSS: Utility classes for column count property.
Pablo Vazquez [Fri, 12 Apr 2019 15:16:06 +0000 (17:16 +0200)]
CSS: Utility classes for column count property.

2 years agoTimeline: Less prominent project title.
Pablo Vazquez [Wed, 10 Apr 2019 15:08:14 +0000 (17:08 +0200)]
Timeline: Less prominent project title.

2 years agoCleanup CSS.
Pablo Vazquez [Wed, 10 Apr 2019 15:08:01 +0000 (17:08 +0200)]
Cleanup CSS.

Extend Bootstrap classes instead of using own styling.

2 years agoUI Asset List: Add custom class to meta items.
Pablo Vazquez [Wed, 10 Apr 2019 12:14:04 +0000 (14:14 +0200)]
UI Asset List: Add custom class to meta items.

2 years agoAllow PUT method for owner on comment creation
Francesco Siddi [Mon, 8 Apr 2019 23:09:08 +0000 (01:09 +0200)]
Allow PUT method for owner on comment creation

Make use of the permission system and allow PUT method for the creator
of a Node of type comment. This enables comment owners to edit their
own posts.

2 years agoPEP8 formatting
Francesco Siddi [Mon, 8 Apr 2019 23:01:58 +0000 (01:01 +0200)]
PEP8 formatting

2 years agoPEP8 formatting
Francesco Siddi [Mon, 8 Apr 2019 23:01:49 +0000 (01:01 +0200)]
PEP8 formatting

2 years agoCleanup: remove unused import and blank line
Francesco Siddi [Mon, 8 Apr 2019 21:55:26 +0000 (23:55 +0200)]
Cleanup: remove unused import and blank line

2 years agoExtend projects/view.html for page templates
Francesco Siddi [Mon, 8 Apr 2019 14:43:20 +0000 (16:43 +0200)]
Extend projects/view.html for page templates

Using projects/landing.html was causing exception since the landing
template expects project attributes that are available only for
projects that are setup_for_film.

2 years agoCleanup duplicate code.
Pablo Vazquez [Thu, 4 Apr 2019 12:21:25 +0000 (14:21 +0200)]
Cleanup duplicate code.

2 years agoJumbotron: Subtle text shadow on text
Pablo Vazquez [Thu, 4 Apr 2019 12:21:16 +0000 (14:21 +0200)]
Jumbotron: Subtle text shadow on text

2 years agoUI Timeline: Make buttons outline white when dark background.
Pablo Vazquez [Thu, 4 Apr 2019 12:21:04 +0000 (14:21 +0200)]
UI Timeline: Make buttons outline white when dark background.

2 years agoRemove unused import
Tobias Johansson [Thu, 4 Apr 2019 12:15:03 +0000 (14:15 +0200)]
Remove unused import

2 years agoClean up: Whitespace
Tobias Johansson [Thu, 4 Apr 2019 09:34:13 +0000 (11:34 +0200)]
Clean up: Whitespace

2 years agoUse kebab-case for vue names
Tobias Johansson [Thu, 4 Apr 2019 09:33:43 +0000 (11:33 +0200)]
Use kebab-case for vue names

https://vuejs.org/v2/guide/components-custom-events.html#Event-Names

2 years agowhite space clean up
Tobias Johansson [Thu, 4 Apr 2019 08:44:43 +0000 (10:44 +0200)]
white space clean up

2 years agoSpecify prop type
Tobias Johansson [Thu, 4 Apr 2019 08:44:22 +0000 (10:44 +0200)]
Specify prop type

2 years agoSilence warning about changing prop value
Tobias Johansson [Thu, 4 Apr 2019 08:18:24 +0000 (10:18 +0200)]
Silence warning about changing prop value

2 years agoWhitespace cleanup
Tobias Johansson [Wed, 3 Apr 2019 15:51:28 +0000 (17:51 +0200)]
Whitespace cleanup

2 years agoAdd missing closing bracket to components
Tobias Johansson [Wed, 3 Apr 2019 15:50:50 +0000 (17:50 +0200)]
Add missing closing bracket to components

2 years agoBetter initial component values
Tobias Johansson [Wed, 3 Apr 2019 15:50:15 +0000 (17:50 +0200)]
Better initial component values

2 years agoFix wrong prop type
Tobias Johansson [Wed, 3 Apr 2019 15:49:17 +0000 (17:49 +0200)]
Fix wrong prop type

2 years agoBind vue component key
Tobias Johansson [Wed, 3 Apr 2019 15:44:22 +0000 (17:44 +0200)]
Bind vue component key

2 years agoOnly use minified vue if built as production
Tobias Johansson [Wed, 3 Apr 2019 15:43:25 +0000 (17:43 +0200)]
Only use minified vue if built as production

2 years agoWrong type was passed into component
Tobias Johansson [Wed, 3 Apr 2019 15:41:52 +0000 (17:41 +0200)]
Wrong type was passed into component

2 years agoRemove unused parameter
Tobias Johansson [Wed, 3 Apr 2019 15:40:15 +0000 (17:40 +0200)]
Remove unused parameter

2 years agoAdd example of usage
Tobias Johansson [Wed, 3 Apr 2019 15:38:19 +0000 (17:38 +0200)]
Add example of usage

2 years agoUI Page: Fix link on header.
Pablo Vazquez [Wed, 3 Apr 2019 22:26:15 +0000 (00:26 +0200)]
UI Page: Fix link on header.

2 years agoUI Pages: Hide title if there is an image.
Pablo Vazquez [Wed, 3 Apr 2019 22:24:37 +0000 (00:24 +0200)]
UI Pages: Hide title if there is an image.

2 years agoUI Theatre: margin around comments container.
Pablo Vazquez [Wed, 3 Apr 2019 21:15:09 +0000 (23:15 +0200)]
UI Theatre: margin around comments container.

2 years agoCleanup: remove unused font-pillar link.
Pablo Vazquez [Wed, 3 Apr 2019 21:12:17 +0000 (23:12 +0200)]
Cleanup: remove unused font-pillar link.

They are now built into the main stylesheets.

2 years agoCSS: include font-pillar into the main stylesheets.
Pablo Vazquez [Wed, 3 Apr 2019 21:11:57 +0000 (23:11 +0200)]
CSS: include font-pillar into the main stylesheets.

2 years agoUI Alerts: minor style tweaks.
Pablo Vazquez [Wed, 3 Apr 2019 20:47:04 +0000 (22:47 +0200)]
UI Alerts: minor style tweaks.

Remove margin from paragraphs and remove redundant text-align.

2 years agoCleanup: remove blender-cloud specific pug component.
Pablo Vazquez [Wed, 3 Apr 2019 13:28:06 +0000 (15:28 +0200)]
Cleanup: remove blender-cloud specific pug component.

2 years agoUI Breadcrums: Always show.
Pablo Vazquez [Tue, 2 Apr 2019 14:39:54 +0000 (16:39 +0200)]
UI Breadcrums: Always show.

2 years agoUI Fix: Show sidebar on project edit.
Pablo Vazquez [Tue, 2 Apr 2019 13:20:10 +0000 (15:20 +0200)]
UI Fix: Show sidebar on project edit.

2 years agoRemove unused data property
Tobias Johansson [Tue, 2 Apr 2019 09:20:40 +0000 (11:20 +0200)]
Remove unused data property

2 years agoFix typo
Tobias Johansson [Mon, 1 Apr 2019 14:59:11 +0000 (16:59 +0200)]
Fix typo

2 years agoUI Comments: Minor style adjustments and fixes.
Pablo Vazquez [Tue, 2 Apr 2019 11:53:55 +0000 (13:53 +0200)]
UI Comments: Minor style adjustments and fixes.

2 years agoUI jstree: Fix collapse of folders with one click.
Pablo Vazquez [Tue, 2 Apr 2019 10:27:09 +0000 (12:27 +0200)]
UI jstree: Fix collapse of folders with one click.

Two clicks is too much work. It was removed by mistake on previous commit.

2 years agoUI Page: style the Edit bar.
Pablo Vazquez [Mon, 1 Apr 2019 12:29:12 +0000 (14:29 +0200)]
UI Page: style the Edit bar.

With light background color and border, so it stands out.

2 years agoUI Pages: Add page title.
Pablo Vazquez [Mon, 1 Apr 2019 12:28:24 +0000 (14:28 +0200)]
UI Pages: Add page title.

2 years agoUI Timeline: scale the placeholder to almost fit the screen.
Pablo Vazquez [Mon, 1 Apr 2019 12:28:04 +0000 (14:28 +0200)]
UI Timeline: scale the placeholder to almost fit the screen.

So the timeline has some initial height (75% of viewport height), and
once the content shows up the page doesn't jump much.