Commit Graph

1084 Commits

Author SHA1 Message Date
Tim Orling
79172de651 jquery: upgrade 3.4.1 -> 3.7.1
Use minified version in templates/base.html

Fixes some vulernabilities:
https://nvd.nist.gov/vuln/search/results?adv_search=true&isCpeNameSearch=true&query=cpe%3A2.3%3Aa%3Ajquery%3Ajquery%3A3.4.1%3A*%3A*%3A*%3A*%3Anode.js%3A*%3A*

CVE: CVE-2020-23064
CVE: CVE-2020-11022
CVE: CVE-2020-11023

For full changelog see:
https://github.com/jquery/jquery/compare/3.4.1...3.7.1

License-Update: Copyright OpenJS Foundation (from JS Foundation)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-16 17:37:37 -07:00
Tim Orling
378ae0d018 docker/settings.py: add CSRF_TRUSTED_ORIGINS
In addition to ALLOWED_HOSTS, we now must have CSRF_TRUSTED_ORIGINS defined.
This variable requires the scheme (http:// or https://).

Like ALLOWED_HOSTS, CSRF_TRUSTED_ORIGINS is a list of strings, with one
entry for each host which is trusted for POST requests.

https://docs.djangoproject.com/en/4.2/ref/settings/#csrf-trusted-origins

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-06 08:43:18 -07:00
Tim Orling
7dcdd0e2a1 password_validation.py: fix deprecated ugettext
Use django.utils.translation.gettext instead

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 21:04:41 -07:00
Tim Orling
7989e61fae requirements.txt: update dependencies
Use results of:
pipenv install
pipenv update
pip freeze > requirements-freeze.txt

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 20:51:39 -07:00
Tim Orling
eceb742205 requirements.txt: upgrade all to latest
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 20:49:35 -07:00
Tim Orling
fcce3cdcde Dockerfile: drop python3-pil
This prevents upgrading Pillow in requirements.txt

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 20:12:27 -07:00
Tim Orling
abef2b6a19 Refactor usage of django.conf.urls
django.conf.urls.url() was removed in Django 4.0:
https://docs.djangoproject.com/en/4.2/releases/4.0/#features-removed-in-4-0

Replace all usage with django.urls.re_path()
Replace all django.conf.urls imports with equivalent django.urls modules

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 20:10:09 -07:00
Tim Orling
bd58fbe7df bootstrap_pagination: disable via comment
Wrap the is_pagination usage of bootstrap_pagination with comment/endcomment
to avoid incompatible module.

We will need to re-write the pagination code.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 20:09:12 -07:00
Tim Orling
e86a2c2610 Drop django-bootstrap-pagination: incompatible
Upstream django-bootstrap-pagination is no longer maintained and is
incompatible with Django 4.x.

https://github.com/staticdev/django-pagination-bootstrap was archived on June 26, 2023.

ugettext was removed in Django 4.0:
https://docs.djangoproject.com/en/4.2/releases/4.0/#features-removed-in-4-0

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 20:06:21 -07:00
Tim Orling
bb79b3885e docker-compose.yml: bump mariadb from 10.3 to 10.4
Django 4.2 requires a minimum of 10.4

https://docs.djangoproject.com/en/4.2/releases/4.2/#dropped-support-for-mariadb-10-3

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 20:04:57 -07:00
Tim Orling
082f5aab79 requirements.txt: upgrade Django 3.2 -> 4.2
Update to 4.2 LTS release

https://docs.djangoproject.com/en/4.2/releases/4.2/
https://docs.djangoproject.com/en/4.1/releases/4.1/
https://docs.djangoproject.com/en/4.0/releases/4.0/

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 20:04:38 -07:00
Tim Orling
b4d9c92d5d requirements: bump django-simple-captcha to 0.5.20
https://raw.githubusercontent.com/mbi/django-simple-captcha/master/CHANGES

Version 0.5.20
--------------
* Still support Django 3.2 (#222, thanks @petrklus)

Version 0.5.19
--------------
* SECURITY ISSUE: reset the random seed after an image was generated (#221, thanks @ibuler)

Version 0.5.18
--------------
* Fix some typos in documentation (#210, thanks @stweil)
* Test against Django 4.2
* Stopped testing Django < 3.2
* BaseCaptchaTextInput should set autocomplete=off on the hashkey HiddenInput (#201, thanks @eerotal)
* Test against Django 4.2a
* Fix some deprecation warnings in Pillow 9.2+
* Removed old unused conditional imports
* Format code with pre-commit and black

Version 0.5.17
--------------
* English translation created from Spanish ones (#209, thanks @tpazderka)

Version 0.5.16
--------------
* Adds a migration missing from 0.5.15 (#208, thanks @atodorov)

Version 0.5.15
--------------
* Updated test matrix, drop tests against Python3.6, test against Python3.9
* Remove dependency on six
* Test against Django 4.0a1
* Test with Python 3.10 (Django 3.2 and Django 4.0)
* Remove warning for django 3.2 (#206, thanks @MiStErLu)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 19:28:35 -07:00
Tim Orling
d020a5c04e dockersetup.py: databasefile zstd compression
zstd compression and decompression are significantly faster than gzip.
zstd is also "splittable" and is streaming/real-time friendly.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 18:33:49 -07:00
dependabot[bot]
d447eb7e45 build(deps): bump pillow from 9.3.0 to 10.0.1
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.3.0 to 10.0.1.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.3.0...10.0.1)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 17:57:38 -07:00
Tim Orling
a2e23f1e20 build(deps): bump gitpython from 3.1.32 to 3.1.37
This release contains another security fix that further improves validation
of symbolic references and thus properly fixes this CVE:
https://github.com/advisories/GHSA-cwvm-v4w8-q58c (CVE-2023-41040).

https://github.com/gitpython-developers/GitPython/blob/main/doc/source/changes.rst

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-09-29 08:06:53 -07:00
Tim Orling
7b316cddfb layerindex/urls.py: fix submit/thanks/ url
The url returned by the reverse lookup ends in /submit/thanks/ but
the regex was improperly searching for a string without the terminating "/".

Thank you to Pawel Zalewski for reporting the 404 error.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-09-29 07:57:59 -07:00
dependabot[bot]
a3a5a209a4 build(deps): bump gitpython from 3.1.30 to 3.1.32
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.30 to 3.1.32.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.30...3.1.32)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-08-25 13:08:00 -07:00
dependabot[bot]
6b56e5c067 build(deps): bump pillow from 9.2.0 to 9.3.0
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.2.0 to 9.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.2.0...9.3.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-08-25 13:08:00 -07:00
Chee Yang Lee
7e6854335a requirements.txt: bump gitpython and pillow
bump gitpython and pillow to version with fixes for these CVEs

pillow: CVE-2022-22817 CVE-2022-24303 CVE-2022-45198

gitpython: CVE-2022-24439

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
2023-08-25 13:08:00 -07:00
Robert Yang
5976f9fc68 layerindex/utils.py: Add to baseconfig=True for bb.parse.handle()
Bitbake's api has been changed via:
afb8478d3 parse: Add support for addpylib conf file directive and BB_GLOBAL_PYMODULES

The conf file won't be parsed without baseconfig=True:
bb.parse.ParseError: ParseError at /path/to/oe-core/meta/conf/layer.conf:132: unparsed line: 'addpylib ${LAYERDIR}/lib oe'

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-12-20 08:38:45 -08:00
Tim Orling
0cc6d8eb1f global: replace deprecated distutils
Replace distutils.version.LooseVersion with pkg_resource.parse_version

https://majornetwork.net/2021/05/comparing-version-numbers-in-python/

[YOCTO #14990]

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-12-16 08:59:37 -08:00
Michael Halstead
13c94088b4 Dockerfile: switch to ubuntu:jammy for >python3.8
ubuntu:jammy provides python 3.10.6 which supports current bitbake.
Dropped unneeded python2 packages.
Moved locale generation high to reduce error messages during image building.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-12-16 08:59:37 -08:00
Robert Yang
61c857a7df utils.py: Fix for is_commit_ancestor()
The runcmd() would print an "ERROR" on failure which causes confusion since
the failure is expected on old branches, so subprocess.getstatusoutput to fix
the problem.

Minor rewording.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-12-16 08:59:37 -08:00
Robert Yang
2d7906ff3b admin.py: Remove has_delete_permission()
The following commit has added on_delete=models.CASCADE to the ForeignKey:

===
commit 2d526f9b0d
Author: Amber Elliot <amber.n.elliot@intel.com>
Date:   Thu Jun 25 15:57:34 2020 -0700

    Updating models and imports for Django 2.2 upgrade.
===

The on_delete=models.CASCADE will remove the objects which reference the
removed objects, so there will be errors when removing a LayerBranch
with admin permissions:

===
Cannot delete layer branch
Deleting the selected layer branch would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:

Append
distro
===

This is because has_delete_permission() always return False, remove it to use
Django's implementation to fix the problem.

Minor rewording.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-12-16 08:59:37 -08:00
Robert Yang
edb574ae7e utils.py: Use get_layer_var() to get BBFILE_COLLECTIONS
The commit 38e6288c7d has added oe-core to
BBLAYERS by default, and then there will be multiple BBFILE_COLLECTIONS which
causes update.py failure to update layers (most of the dependencies or
recommends are missing), use get_layer_var() to get BBFILE_COLLECTIONS to fix
the problem since it can ignore the extra oe-core from BBFILE_COLLECTIONS.

Fix minor typos. Minor rewording.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-12-16 08:59:37 -08:00
Michael Halstead
c7b02096e0 Dockerfile: add captcha dependencies
The current version of django-simple-captcha requires libz and freetype
development libraries.

Refactor to apply. Fix typo. Fix previous mixed use of space vs tab.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-12-16 08:59:37 -08:00
Tim Orling
d8ab1beebe layerindex/utils.py: ignore 'core' in BBFILES_COLLECTIONS
Many layers append BBFILE_COLLECTIONS and therefore have 'core <layer>'

During update.py, this means we are likely not handling the collection we
expect:

WARNING: /opt/workdir/git___git_openembedded_org_meta-openembedded/meta-oe: multiple collections found, handling first one (core) only
BBFILE_COLLECTIONS = "core"

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-04-28 08:15:22 -07:00
Tim Orling
242db27bf9 recipe{desc,parse}.py: BB_ENV_PASSTHROUGH_ADDITIONS
ERROR: Variable BB_ENV_EXTRAWHITE has been renamed to BB_ENV_PASSTHROUGH_ADDITIONS
ERROR: Variable BB_ENV_EXTRAWHITE from the shell environment has been renamed to BB_ENV_PASSTHROUGH_ADDITIONS
ERROR: Exiting to allow enviroment variables to be corrected

Replace BB_ENV_EXTRAWHITE with new variable BB_ENV_PASSTHROUGH_ADDITIONS

In order to be backward compatible with older branches, we must first check
for the presence of the bitbake commit which implemented the variable name
change, using layerindex.utils.is_commit_ancestor().

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-04-28 08:15:22 -07:00
Tim Orling
ee30a2e037 layerindex/utils.py: add is_commit_ancestor check
Add a helper function to check if a given SHA1 hash is an ancestor in
the currently checked out branch, using:

git merge-branch --is-ancestor <commit> HEAD

NOTE: This will not match commits which have been cherry-picked.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-04-28 08:15:22 -07:00
Tim Orling
4dd7f0ee8f layerindex/models.py: add Inactive-Upstream
Add the newish Inactive-Upstream upstream status.

Add 0046_alter_patch_status.py migration.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>

layerindex/migrations: update patch status

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-04-18 12:56:51 -07:00
Tim Orling
7ef8152266 layerindex/urls.py: fix about url pattern
The url pattern was not including the trailing /

[YOCTO #14445]

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-04-18 12:56:51 -07:00
Tim Orling
796d2455bb templates/*: staticfiles -> static
In Django 3.0 the staticfiles tag was changed to static

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 23:36:22 -08:00
Tim Orling
f074aece70 requirements.txt: bump all to latest
Run pip-upgrade and update all to latest

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 21:16:46 -08:00
Tim Orling
88b13592c3 Dockerfile: add back python2 dependencies
We have some layers and especially older releases that still support
python2. Add python2 dependencies back to the container so that the
older releases still function.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 21:00:38 -08:00
Tim Orling
722f1f3a37 rrs: add 0030_alter_recipeupgrade_maintainer.py miagration
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 21:00:36 -08:00
Tim Orling
c99a1ed4e7 Dockerfile: fix warnings
* Define LANGUAGE to quiet perl warnings
* Set DEBIAN_FRONTEND=noninteractive before apt call to quiet TERM/Dialog
  warnings

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 21:00:33 -08:00
Tim Orling
743c8f449d rrs/admin.py: drop curry import
Dropped in Django 3.0 [1]
Suggested replacements are functools.partial() or
functools.partialmethod() [2]

[1] https://docs.djangoproject.com/en/4.0/releases/3.0/
[2] 5b1c389603

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 21:00:14 -08:00
Tim Orling
8f648093c7 README.devel: update versions
This updated code-base should be compatible with
Django 3.1 and obviously 3.2 (but not 3.0 or earlier).

Django 3.2 requires Python 3.6+.

With the upgrade to Celery 5, it is safer to recommend
RabbitMQ 3.8.x, since that is what we are using.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 21:00:03 -08:00
Tim Orling
f1dbcde4c4 docker-compose: fix celery
In celery 5, the --workdir argument must come
before the 'worker' subcommand.

Without this, celery cannot load the layerindex
module and this causes the celery container to
continually restart.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:59:54 -08:00
Tim Orling
67679306b0 settings: set DEFAULT_AUTO_FIELD
New in Django 3.2

To quiet warnings, set DEFAULT_AUTO_FIELD to the
default value 'django.db.models.AutoField'

NOTE: The default value for newly created Django 3.2
      projects is django.db.models.BigAutoField, but
      this causes the need for a migration in 'captcha'.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:59:44 -08:00
Tim Orling
314d29deda requirements.txt: bump to Django 3.2 LTS
Upgrade to the latest Django 3.2.x LTS for
extended support up until April 2024.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:59:31 -08:00
Tim Orling
08d7f96e10 requirements.txt: update all to latest
Since we are on a "modern" version of Python in
Debian buster container (3.7) and a modern version
of Django (3.1.x) we should be able to run with
the latest of all dependencies.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:59:22 -08:00
Tim Orling
ecd1005ae2 docker-compose: bump mariadb to 10.3
10.2 was based on Ubuntu bionic 18.04,
bumping to 10.3 as it is the first release
on Ubuntu focal 20.04

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:59:10 -08:00
Tim Orling
49b41802e4 requirements.txt: bump to Django 3.1
Another incremental upgrade towards 3.2 LTS

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:59:02 -08:00
Tim Orling
a027959343 Updates for Django 3.0
* Update requirements.txt versions
  - Mostly update to latest pre-Django 3.1 versions
* Fix deprecated axes.backends.AxesModelBackend
  - settings.py
  - docker/settings.py
* Fix template syntax 'staticfiles' -> 'static'
  - base.html
* Add migrations for layerbranch classicrecipe

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:58:52 -08:00
Tim Orling
094c89bc70 requirements.txt: bump to Django 3.0
Incremental upgrade towards 3.2 LTS version.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:58:40 -08:00
Tim Orling
4e857f68f4 layerindex/*: make all shebangs python3
Several scripts still had /usr/bin/env python

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:58:28 -08:00
Tim Orling
1f41512758 dockersetup.py: letsencrypt 2048 bit rsa
The minimum length for an RSA pem is 2048 for the dummy cert.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:58:14 -08:00
Tim Orling
f9c640a7c0 Dockerfile: cleanup, install python3-wheel
Remove duplicate python3-pip, etc. lines
Need python3-wheel for bdist_wheel command

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:57:42 -08:00
Tim Orling
df4a764d59 dockersetup.py: fix EMAIL_USE_SSL/TLS
Need to concatenate str(boolean), not bool

Signed-off-by: Tim Orling <timothy.t.orling@intel.com>
2022-01-13 09:15:50 -08:00