diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a87dde2..4f9ea01 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,6 +10,12 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + allow: + - dependency-type: "direct" + ignore: + - dependency-name: "django" + versions: + - "> 4.2" # This ignores versions above 4.2, allowing only 4.2.x LTS upgrades # Maintain dependencies for npm - package-ecosystem: "npm" directory: "/frontend" diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..c0cfa93 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,22 @@ +{ + "version": "0.2.0", + "configurations": [ + + { + "name": "IPT Django", + "type": "debugpy", + "request": "attach", + "pathMappings": [ + { + "localRoot": "${workspaceFolder}", + "remoteRoot": "/code" + } + ], + "connect": { + "port": 5020, + "host": "localhost", + }, + "justMyCode": false + } + ] +} \ No newline at end of file diff --git a/backend/debugpy.py b/backend/debugpy.py new file mode 100644 index 0000000..2b1435b --- /dev/null +++ b/backend/debugpy.py @@ -0,0 +1,15 @@ +import os +import debugpy +import logging + +def config_to_bool(value): + return str(value).lower() in ('true', '1', 'yes', 'on') + +def check_and_enable_debugpy(): + debugpy_enable = config_to_bool(os.getenv('DEBUGPY_ENABLE', False)) + debugpy_address = '0.0.0.0' + debugpy_port = 5020 + + if debugpy_enable: + logging.debug('DEBUGPY: Enabled Listening on ({0}:{1})'.format(debugpy_address, debugpy_port)) + debugpy.listen((debugpy_address, debugpy_port)) \ No newline at end of file diff --git a/backend/wsgi.py b/backend/wsgi.py index c3a803c..eca573b 100644 --- a/backend/wsgi.py +++ b/backend/wsgi.py @@ -11,6 +11,10 @@ from django.core.wsgi import get_wsgi_application +from backend.debugpy import check_and_enable_debugpy + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') +check_and_enable_debugpy() + application = get_wsgi_application() diff --git a/docker-compose.yml b/docker-compose.yml index f262d51..1341b78 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.9" - services: mysql: image: mysql:8-oracle @@ -31,6 +29,7 @@ services: - ${HOME}/mylasecrets:/secrets ports: - "5000:5000" + - "5020:5020" container_name: canvas_app_explorer env_file: - .env diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index 48c19b2..6263121 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -1,7 +1,7 @@ # FROM directive instructing base image to build upon # This could be used as a base instead: # https://hub.docker.com/r/nikolaik/python-nodejs -FROM python:3.8-slim +FROM python:3.10-slim-bookworm # NOTE: requirements.txt not likely to change between dev builds COPY requirements.txt . diff --git a/frontend/package-lock.json b/frontend/package-lock.json index d08bd88..34f627e 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -28,7 +28,7 @@ "eslint": "^8.20.0", "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^4.6.0", - "mini-css-extract-plugin": "^2.6.1", + "mini-css-extract-plugin": "^2.9.2", "ts-loader": "^9.3.1", "ts-node": "^10.9.1", "typescript": "^4.7.4", @@ -3421,12 +3421,13 @@ } }, "node_modules/mini-css-extract-plugin": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.6.1.tgz", - "integrity": "sha512-wd+SD57/K6DiV7jIR34P+s3uckTRuQvx0tKPcvjFlrEylk6P4mQ2KSWk1hblj1Kxaqok7LogKOieygXqBczNlg==", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.9.2.tgz", + "integrity": "sha512-GJuACcS//jtq4kCtd5ii/M0SZf7OZRH+BxdqXZHaJfb8TJiVl+NgQRPwiYt2EuqeSkNydn/7vP+bcE27C5mb9w==", "dev": true, "dependencies": { - "schema-utils": "^4.0.0" + "schema-utils": "^4.0.0", + "tapable": "^2.2.1" }, "engines": { "node": ">= 12.13.0" @@ -7568,12 +7569,13 @@ } }, "mini-css-extract-plugin": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.6.1.tgz", - "integrity": "sha512-wd+SD57/K6DiV7jIR34P+s3uckTRuQvx0tKPcvjFlrEylk6P4mQ2KSWk1hblj1Kxaqok7LogKOieygXqBczNlg==", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.9.2.tgz", + "integrity": "sha512-GJuACcS//jtq4kCtd5ii/M0SZf7OZRH+BxdqXZHaJfb8TJiVl+NgQRPwiYt2EuqeSkNydn/7vP+bcE27C5mb9w==", "dev": true, "requires": { - "schema-utils": "^4.0.0" + "schema-utils": "^4.0.0", + "tapable": "^2.2.1" }, "dependencies": { "ajv": { diff --git a/frontend/package.json b/frontend/package.json index 58feb57..c8c365d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -29,7 +29,7 @@ "eslint": "^8.20.0", "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^4.6.0", - "mini-css-extract-plugin": "^2.6.1", + "mini-css-extract-plugin": "^2.9.2", "ts-loader": "^9.3.1", "ts-node": "^10.9.1", "typescript": "^4.7.4", diff --git a/requirements.txt b/requirements.txt index 5f5f0b9..4375368 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,29 +1,31 @@ -gunicorn==22.0.0 +gunicorn==23.0.0 mysqlclient==2.1.1 # Django and related Django==4.2.16 django-csp==3.7 # For Content Security Policy -django-db-file-storage==0.5.5 # Support for storage in the database +django-db-file-storage==0.5.6.1 # Support for storage in the database django-mysql==4.15.0 django-tinymce==4.1.0 # Rich text editor django-watchman==1.3 django-webpack-loader==1.6.0 -Pillow==10.3.0 +Pillow==11.0.0 whitenoise==6.2.0 # For serving static files # DRF djangorestframework==3.15.2 -django-filter==22.1 # Filtering support +django-filter==24.3 # Filtering support drf-spectacular==0.22.1 markdown==3.4.1 # Markdown support for the browsable API # LTI -pycryptodome==3.19.1 # For generating LTI keys -PyLTI1p3==1.12.1 +pycryptodome==3.21.0 # For generating LTI keys +PyLTI1p3==2.0.0 # Canvas -canvasapi==2.2.0 +canvasapi==3.3.0 + +debugpy==1.8.8 # Not in pypi https://github.com/Harvard-University-iCommons/django-canvas-oauth -https://github.com/Harvard-University-iCommons/django-canvas-oauth/archive/v1.1.0.tar.gz +https://github.com/Harvard-University-iCommons/django-canvas-oauth/archive/v1.1.1.tar.gz