The official Blender Extensions platform. https://extensions.blender.org
Go to file
Anna Sirota 729ce453ac Fix deletion task, protect more account-linked data
Account deletion task had a bug in it: its was skipping all accounts
that were deactivated, but accounts are deactivated as soon as
date_deletion_requested is received via webhook, so no
deletion/anonymisation would have happened.

In addition to fixing that (now the task will exclude all account records
that look like they were already anonymized), this also changes several on-delete properties:

  * abuse reports about a deleted account are deleted along with it;
  * abuse reports made by a deleted account remain;
  * ratings made by a deleted account remain;
  * approval activity protects against deletion: account cannot be deleted if it authored any approval activity;

This change also makes sure that API tokens and OAuth info/tokens
are deleted when account deleted or anonymized.
2024-06-05 13:20:51 +02:00
.gitea/issue_template Gitea: Fix templates 2024-05-29 16:03:54 +02:00
abuse Fix deletion task, protect more account-linked data 2024-06-05 13:20:51 +02:00
access Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
apitokens Profile: Add page titles 2024-05-29 15:59:09 +02:00
assets_shared@35a222528d Chore: Update git submodule assets_shared to v2.0.0-alpha.16 2024-05-27 12:53:01 +02:00
blender_extensions API Tokens (#134) 2024-05-27 12:53:29 +02:00
common Fix deletion task, protect more account-linked data 2024-06-05 13:20:51 +02:00
constants Mass rename INCOMPLETE -> DRAFT 2024-05-23 18:26:20 +02:00
emails Admin: only show notification email previews in DEBUG 2024-05-02 14:20:22 +02:00
extensions Extension page should be 404 for everyone unless publicly listed (#167) 2024-06-05 12:12:13 +02:00
files Permissions: change from list to key/value pairs in manifest (#168) 2024-06-04 17:34:31 +02:00
notifications Reuse files as previews, icons or featured images (#161) 2024-06-04 12:23:25 +02:00
playbooks Playbooks: fix grammar 2024-05-27 21:20:39 +02:00
public/media Reuse files as previews, icons or featured images (#161) 2024-06-04 12:23:25 +02:00
ratings Fix deletion task, protect more account-linked data 2024-06-05 13:20:51 +02:00
releases Releases: Make 4.3 deactive by default 2024-02-18 15:52:16 +01:00
reviewers Fix deletion task, protect more account-linked data 2024-06-05 13:20:51 +02:00
stats Tags: Make tags dependent on type, and remove taggit 2024-02-29 15:52:47 +01:00
teams Profile: Add page titles 2024-05-29 15:59:09 +02:00
users Fix deletion task, protect more account-linked data 2024-06-05 13:20:51 +02:00
.eslintignore Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
.eslintrc.js Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
.gitignore Git: ignore DS_Store files 2024-05-29 16:01:20 +02:00
.gitmodules UI: Web Assets v2 upgrade (#85) 2024-04-30 17:57:31 +02:00
.pre-commit-config.yaml Revert "Run API schema update as part of the pre-commit hook" 2024-02-20 19:25:56 +01:00
AUTHORS Add license and authors 2024-06-03 17:17:43 +02:00
deploy.sh Make deploy.sh support extra arguments --check --diff 2024-02-29 18:14:52 +01:00
LICENSE Add license and authors 2024-06-03 17:17:43 +02:00
logo-source.svg Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
manage.py Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
pyproject.toml Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
README.md Add license and authors 2024-06-03 17:17:43 +02:00
requirements_dev.txt Revert "Deps: install faker and factory in prod too (used in the admin)" 2024-05-02 14:18:08 +02:00
requirements_prod.txt Replace gunicorn with uwsgi, use persistent db connections (#90) 2024-04-25 15:11:07 +02:00
requirements.txt Move changes of the tasks admin to the fork 2024-05-28 16:46:11 +02:00
setup.cfg PEP: flake8 no longer supports inline comments in setup.cfg 2024-04-04 12:04:44 +02:00
utils.py Basic email template for notifications (#96) 2024-05-02 14:04:22 +02:00

Blender Extensions

Free and open source add-ons and themes for Blender.

Requirements

  • Python 3.10
  • libmagic: sudo apt-get install libmagic1 in Debian/Ubuntu, brew install libmagic on OSX.

Development

Extra requirements

  • virtualenv

Setup

Checkout Blender Web Assets submodule first:

git submodule update --init --recursive

Create and activate a virtual environment using your favourite method, e.g.

virtualenv .venv -p python
source .venv/bin/activate

Install required packages:

pip install -r requirements_dev.txt

Create the database tables and load some basic data to work with using the following commands:

./manage.py migrate
./manage.py loaddata **/fixtures/*.json

It's also possible to generate fake add-on data using the following command:

./manage.py generate_fake_data

Run development server

./manage.py runserver 8111

Update /etc/hosts to point to extensions.local, e.g.:

127.0.0.1	extensions.local

Now http://extensions.local:8111 should be ready to work with and it should be possible to log into http://extensions.local:8111/admin/ with admin/admin.

Blender ID

Blender Extensions, as all other Blender web services, uses Blender ID. Blender Extensions can also receive Blender ID account modifications such as badge updates via a webhook.

For development, Blender ID's code contains a fixture with an OAuth app and a webhook that should work without any changes to default configuration. To load this fixture, go to your development Blender ID and run the following:

./manage.py loaddata blender_extensions_devserver

N.B.: the webhook view delegates the actual updating of the user profile to a background task, so in order to see the updates locally, start the processing of tasks using the following:

./manage.py process_tasks

Blender ID and staging/production

For staging/production, create an OAuth2 application in Blender ID using Admin Blender-ID OAuth2 applications -> Add:

  • Redirect URIs: https://staging.extensions.blender.org/oauth/authorized (https://extensions.blender.org for production);
  • Client type: "Confidential";
  • Authorization grant type: "Authorization code";
  • Name: "Blender Extensions Staging" (or "Blender Extensions" for production);

Copy client ID and secret and save them as BID_OAUTH_CLIENT and BID_OAUTH_SECRET into a .env file:

export BID_OAUTH_CLIENT=<CLIENT ID HERE>
export BID_OAUTH_SECRET=<SECRET HERE>

Create a webhook using Admin Blender-ID API Webhooks > Add:

  • Name: "Blender Extensions Staging" (or "Blender Extensions" for production)";
  • URL: https://staging.extensions.blender.org/webhooks/user-modified/ (or https://extensions.blender.org/webhooks/user-modified/ for production);
  • App: choose the app created in the previous step;

Copy webhook's secret into the .env file as BID_WEBHOOK_USER_MODIFIED_SECRET:

export BID_WEBHOOK_USER_MODIFIED_SECRET=<WEBHOOK SECRET HERE>

Pre-commit hooks

Make sure to enable pre-commit hooks after installing requirements from requirements_dev.txt:

pre-commit install

This will enable formatting pre-commit checks for Django templates, Python and JS modules.

Testing

To simply run the test suit use

./manage.py test

To run tests and generate a coverage report use

coverage run manage.py test && coverage html

and then open htmlcov/index.html with your favourite browser.

Deploy

See playbooks.

Feature Flags

At the moment there are the following feature flags:

  • is_alpha
  • is_beta

To create them run

./manage.py waffle_switch --create is_alpha on

./manage.py waffle_switch --create is_beta off

They can optionally be setup on the deployment platform to set the release stage of the site. These settings will be removed once the site is officially launched.

License and Copyright

The platform source code is available under the GPLv3 or later. Early versions of the platform are inspired by Mozilla Addons Server. List of authors is available in the AUTHORS file.