Skip to content

Update backends.py #1259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 79 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
73ed68a
* UPGRADE Django to v4.2.16
Badatos Oct 24, 2024
e50187e
Merge branch 'develop' into pod_V4
Badatos Oct 28, 2024
7e4cd06
* Remove USE_L10N deprecated param
Badatos Oct 28, 2024
af15471
Remove `USE_L10N` from test_settings
Badatos Oct 28, 2024
7c01d4b
Merge branch 'develop' into pod_V4
Badatos Oct 29, 2024
a721a03
* Correct video_edit slect2 display with tagulous (remove duplicated …
Badatos Oct 29, 2024
4deb722
* Remove Python 3.8 from compatible py versions, and add 3.12
Badatos Oct 30, 2024
b2975a6
Merge branch 'develop' into pod_V4
Badatos Oct 30, 2024
645b930
Upgrade dependencies
Badatos Oct 30, 2024
7c5d362
several corrections for 4.0. Prepare to say goodbye to CKEditor
Badatos Nov 13, 2024
917a006
correct video/models.py
Badatos Nov 13, 2024
9a4ab7f
Remove Compatibility with ES 6
Badatos Nov 21, 2024
097edab
Replace js_asset by django.templatetags.static, as js_asset is deprec…
Badatos Nov 21, 2024
151af7c
Fix code scanning alert no. 81: URL redirection from remote source
Badatos Nov 21, 2024
ccfebc3
Improve security in pod playlists, as suggested by CodeQL
Badatos Nov 21, 2024
5941015
Disable some video_tags functions
Badatos Nov 21, 2024
bf7dc21
Flake8 compliance
Badatos Nov 21, 2024
cb32056
Disable Debug in test_settings
Badatos Nov 21, 2024
c9de8e1
only add debug toolbar when not in testing mode
Badatos Nov 21, 2024
d28b3dc
Add title_en to sample videos.json
Badatos Nov 21, 2024
6bd0164
Reset ES-INDEX for tests as "Pod"
Badatos Nov 21, 2024
3c17c09
Use Elasticsearch 7 in github workflows
Badatos Nov 21, 2024
b54952b
set Video tags as "not required" + correct bug on video tags indexing
Badatos Nov 21, 2024
fd9fbaa
Adapt Video views and video-info to Tagulous
Badatos Nov 25, 2024
bf5cabd
adapt video get_json_to_index() function to Tagulous
Badatos Nov 25, 2024
92ac5b2
Adapt Video Recorder to Tagulous
Badatos Nov 25, 2024
cecec76
Only do dressing tests when `USE_DRESSING==True
Badatos Nov 25, 2024
f7d1a21
* Only run `cut` tests when `USE_CUT==True`
Badatos Nov 25, 2024
44a9a5b
Merge branch 'develop' into pod_V4
Badatos Nov 28, 2024
dfd0662
+ Upgrade all py packages
Badatos Dec 2, 2024
14c3457
Drop compatibility with ES 7
Badatos Dec 2, 2024
ff15569
Upgrade importlib-metadata to 7.2.1 for compatibility with ralph-malp…
Badatos Dec 2, 2024
e6ed3f7
replace "order" by "date_added" in channel video sorting
Badatos Dec 3, 2024
abd6cdc
Display a tag cloud with tags assigned to videos
Badatos Dec 3, 2024
4698507
apply GH actions "pod_dev" and "code_formatting" on pod_V4 branch
Badatos Dec 3, 2024
2501b45
Fixup. Format code with Prettier
invalid-email-address Dec 3, 2024
a18ea13
Fixup. Format code with Black
invalid-email-address Dec 3, 2024
76e6191
Auto-update configuration files
invalid-email-address Dec 3, 2024
7b58f99
Merge branch 'main' into pod_V4
Badatos Dec 4, 2024
c2d1011
Bump ELASTICSEARCH_TAG to 8.16.1
Badatos Dec 4, 2024
b5fc92a
Change elastic-github-actions to master to avoid ES 8 issue
Badatos Dec 4, 2024
92fa056
Set ES_VERSION=8 in settings_local_docker
Badatos Dec 5, 2024
4853cdd
Fixup. Format code with Black
invalid-email-address Dec 5, 2024
12d0c3f
test ES with CURL after create_pod_index
Badatos Dec 5, 2024
e62575b
Merge branch 'pod_V4' of https://github.com/EsupPortail/Esup-Pod into…
Badatos Dec 5, 2024
68d7f5f
test with es1:9200 url
Badatos Dec 5, 2024
3216702
Return to elasticsearch.localhost url
Badatos Dec 5, 2024
6eeedd4
add --insecure to curl command
Badatos Dec 5, 2024
8cfc848
Disable elastic-github-actions security
Badatos Dec 9, 2024
50c5437
replace https by http in curl
Badatos Dec 9, 2024
7343fa0
increase sqlite timeout in test settings to have less "sqlite3.Operat…
Badatos Dec 9, 2024
5115cb4
Replace `assertNotEquals`by `assertNotEqual`for Python 3.12 compatibi…
Badatos Dec 9, 2024
2f928f9
Replace remaining assertEquals by assertEqual
Badatos Dec 9, 2024
ec9addf
Bump Django to 4.2.17 (fix 2 CVE, see https://docs.djangoproject.com/…
Badatos Dec 9, 2024
241712f
Replace unmaintained django-cas-client by django-cas-ng
Badatos Jan 9, 2025
c80323a
* Add pod_affiliation_handler() func to set staff status to CAS user …
Badatos Jan 9, 2025
06301b5
Flake8 compliance + Black formatting
Badatos Jan 9, 2025
bd764a4
Replace `CAS_RESPONSE_CALLBACKS` by `cas_user_authenticated_callback
Badatos Jan 17, 2025
e91aa1a
Remove typing for compatibility with Python 3.9
Badatos Jan 17, 2025
4dfae61
Force `CAS_APPLY_ATTRIBUTES_TO_USER` to True when `POPULATE_USER==CAS`
Badatos Jan 17, 2025
e91fea4
Bump Django to 4.2.18
Badatos Jan 17, 2025
6ab6f93
Merge branch 'pod_V4' into replace_cas
Badatos Jan 17, 2025
385937a
Set CAS_APPLY_ATTRIBUTES_TO_USER to True in settings
Badatos Jan 17, 2025
1b02e4f
Merge branch 'main' into pod_V4
Badatos Jan 24, 2025
31aae7a
Merge branch 'pod_V4' into replace_cas
Badatos Jan 31, 2025
5359641
Update backends.py
FBrosset Feb 3, 2025
3c0a15b
Update CONFIGURATION_FR.md
FBrosset Feb 3, 2025
ab86186
Update CONFIGURATION_EN.md
FBrosset Feb 3, 2025
1c16298
Update configuration.json
FBrosset Feb 3, 2025
17fce3f
Update test_populated.py
FBrosset Feb 3, 2025
e2df422
Update backends.py
FBrosset Feb 4, 2025
79bd664
Update test_populated.py
FBrosset Feb 4, 2025
10fa81b
correct some bugs after unit testing with @Fbrosset
Badatos Feb 4, 2025
e62bb86
Correct test_populated to test presence of group from OIDC_DEFAULT_AF…
Badatos Feb 5, 2025
a7bac5b
Add english translations for configs
Badatos Feb 6, 2025
ebcc0d2
Merge branch 'main' into replace_cas
Badatos Feb 10, 2025
2d6f6b0
Cleanup merge artifacts
Badatos Feb 10, 2025
3a014b9
Merge branch 'main' into replace_cas
Badatos Feb 13, 2025
4df1dd2
Merge branch 'replace_cas' into replace_cas_fbrosset
Badatos Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.dev-exemple
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DJANGO_SUPERUSER_USERNAME=<USER>
DJANGO_SUPERUSER_PASSWORD=<PWD>
DJANGO_SUPERUSER_EMAIL=<MAIL>
### You can use internal registry
ELASTICSEARCH_TAG=elasticsearch:8.13.0
ELASTICSEARCH_TAG=elasticsearch:8.16.1
NODE_TAG=node:23
PYTHON_TAG=python:3.9-bullseye
REDIS_TAG=redis:alpine3.16
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Code Formatting

on:
push:
branches: [master, develop]
branches: [master, develop, main, pod_V4]
workflow_dispatch:

jobs:
Expand Down
32 changes: 20 additions & 12 deletions .github/workflows/pod_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ on:
push:
branches:
- develop
- dev_v4
- features/**
- dependabot/**
pull_request:
branches:
- develop
- dev_v4
workflow_dispatch:

env:
PYTHON_VERSION: '3.9'
DJANGO_SUPERUSER_USERNAME: "admin"
DJANGO_SUPERUSER_PASSWORD: "passwd"
DJANGO_SUPERUSER_EMAIL: "[email protected]"
ELASTICSEARCH_TAG: "elasticsearch:7.17.18"
ELASTICSEARCH_TAG: "elasticsearch:8.16.1"
NODE_VERSION: "20"
NODE_TAG: "node:20"
PYTHON_TAG: "python:3.9-bullseye"
Expand Down Expand Up @@ -86,58 +88,64 @@ jobs:
echo PYTHON_TAG=$PYTHON_TAG >> .env.dev
echo REDIS_TAG=$REDIS_TAG >> .env.dev
echo DOCKER_ENV=$DOCKER_ENV >> .env.dev

- name: cat env
run: cat .env.dev
- name: make Build container

- name: Build containers
run: |
sudo rm -rf ./pod/log
sudo rm -rf ./pod/static
sudo rm -rf ./pod/node_modules
docker compose -f ./docker-compose-full-dev-with-volumes-test.yml -p esup-pod build --build-arg ELASTICSEARCH_VERSION=$ELASTICSEARCH_TAG --build-arg NODE_VERSION=$NODE_TAG --build-arg PYTHON_VERSION=$PYTHON_TAG --no-cache
docker compose -f ./docker-compose-full-dev-with-volumes-test.yml up --detach --force-recreate --always-recreate-deps

- name: Sleep for 60 seconds to wait run server on pod back
uses: jakejarvis/wait-action@master
with:
time: '60s'
- name: show running container

- name: Show running containers
run: |
docker ps
echo "🍏 Docker is UP ${{ job.status }}."
docker exec pod-back-with-volumes ps auxf
docker exec pod-back-with-volumes python manage.py loaddata pod/video/fixtures/sample_videos.json
- name: run test in docker

- name: Run test_remote_encode_transcode in docker
run: docker exec pod-back-with-volumes coverage run --append manage.py test -v 3 --keepdb pod.video_encode_transcript.tests.test_remote_encode_transcode

- name: Run pa11y-ci full
- name: Run pa11y-ci
run: docker exec pa11y-ci pa11y-ci -c /usr/src/app/dockerfile-dev-with-volumes/pa11y-ci/config.json

- name: Run pa11y-ci mobile
run: docker exec pa11y-ci pa11y-ci -c /usr/src/app/dockerfile-dev-with-volumes/pa11y-ci/config_mobile.json

- name: show pa11y results
- name: Show pa11y results
run: cat pa11y-results.json

- name: Stop containers
if: always()
run: docker compose -f ./docker-compose-full-dev-with-volumes-test.yml down
- name: delete unused file and change owner
- name: Delete unused file and change owner
run: |
sudo rm -f pod/custom/settings_local.py
sudo chown -R runner:runner .

## Start unit test test ##
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@refactor_with_plugins
- name: Run Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
# stack-version: 7.6.0
stack-version: 6.8.23
stack-version: 8.16.1
plugins: analysis-icu
security-enabled: false

- name: Setup Pod
run: |
coverage run --append manage.py create_pod_index --settings=pod.main.test_settings
python manage.py makemigrations --settings=pod.main.test_settings
python manage.py migrate --settings=pod.main.test_settings
coverage run --append manage.py create_pod_index --settings=pod.main.test_settings
curl -XGET "http://elasticsearch.localhost:9200/pod/_search?pretty=true&q=fr"

- name: Run Tests with coverage
env:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/pod_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
max-parallel: 2
matrix:
python-version: ['3.8', '3.10']
python-version: ['3.10', '3.12']
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
Expand Down Expand Up @@ -53,17 +53,18 @@ jobs:
pip install -r requirements-dev.txt
sudo npm install -g yarn

## Start unit test test ##
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@refactor_with_plugins
## Start unit tests ##
- name: Run Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
# stack-version: 7.6.0
stack-version: 6.8.23
stack-version: 8.16.1
plugins: analysis-icu
security-enabled: false

- name: Setup Pod
run: |
python manage.py create_pod_index --settings=pod.main.test_settings
curl -XGET "http://elasticsearch.localhost:9200/pod/_search?pretty=true&q=fr"
python manage.py makemigrations --settings=pod.main.test_settings
python manage.py migrate --settings=pod.main.test_settings
cd pod
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ pod/static/
.cache_ggshield
htmlcov
compile-model
pod/activitypub/*.pub

# IDE Files #
#############
.idea
.vscode
*.code-workspace

# Certificates #
################
Expand Down
3 changes: 3 additions & 0 deletions CONFIGURATION_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,9 @@ Set `USE_AI_ENHANCEMENT` to True to activate this application.<br>
* `OIDC_DEFAULT_AFFILIATION`
> default value: ``
>>
* `OIDC_DEFAULT_AFFILIATION`
> valeur par défaut : ``
>> Affiliation par défaut d’un utilisateur authentifié par OIDC.<br>
* `OIDC_NAME`
> default value: ``
>>
Expand Down
Loading