diff --git a/.github/workflows/pod_encoding.yml b/.github/workflows/pod_encoding.yml new file mode 100644 index 0000000000..32899dc835 --- /dev/null +++ b/.github/workflows/pod_encoding.yml @@ -0,0 +1,87 @@ +name: Pod Encoding Full Docker +run-name: ${{ github.actor }} is testing Pod encoding 🚀 + +on: + push: + branches: + - main + - master + - develop + - features/** + - dependabot/** + pull_request: + branches: + - main + - master + - develop +env: + DJANGO_SUPERUSER_USERNAME: "admin" + DJANGO_SUPERUSER_PASSWORD: "passwd" + DJANGO_SUPERUSER_EMAIL: "noreplay@uni.fr" + ELASTICSEARCH_TAG: "elasticsearch:7.17.18" + ELASTICSEARCH_VERION: "elasticsearch:7.17.18" + NODE_TAG: "node:19" + PYTHON_TAG: "python:3.9-buster" + REDIS_TAG: "redis:alpine3.16" + DOCKER_ENV: "full" + GECKODRIVER_VER: "v0.29.0" + FIREFOX_VER: "87.0" + +jobs: + Pod-Docker-Encoding-Actions: + runs-on: ubuntu-latest + 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!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "đŸ–„ïž The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." + - name: Create settings local file + run: | + mv pod/custom/settings_local_docker_full_test.py pod/custom/settings_local.py + - name: cat settings local + run: cat pod/custom/settings_local.py + - name: Create env file containers + run: | + touch .env.dev + echo DJANGO_SUPERUSER_USERNAME=$DJANGO_SUPERUSER_USERNAME >> .env.dev + echo DJANGO_SUPERUSER_PASSWORD=$DJANGO_SUPERUSER_PASSWORD >> .env.dev + echo DJANGO_SUPERUSER_EMAIL=$DJANGO_SUPERUSER_EMAIL >> .env.dev + echo ELASTICSEARCH_TAG=$ELASTICSEARCH_TAG >> .env.dev + echo ELASTICSEARCH_VERSION=$ELASTICSEARCH_TAG >> .env.dev + echo NODE_TAG=$NODE_TAG >> .env.dev + echo PYTHON_TAG=$PYTHON_TAG >> .env.dev + echo REDIS_TAG=$REDIS_TAG >> .env.dev + echo DOCKER_ENV=full >> .env.dev + echo GECKODRIVER_VER=v0.29.0 + echo FIREFOX_VER=87.0 + - name: cat env + run: cat .env.dev + - name: make Build container + 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.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.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 + run: docker ps + - run: | + echo "🍏 Docker is UP ${{ job.status }}." + docker exec pod-back-with-volumes ps auxf + - name: run test in docker + run: docker exec pod-back-with-volumes coverage run --source='.' manage.py test_encode_transcript + - name: Stop containers + if: always() + run: docker-compose -f ./docker-compose-full-dev-with-volumes.yml down + - run: echo "END" diff --git a/CONFIGURATION_FR.md b/CONFIGURATION_FR.md index 13e5eaad94..99f96f0298 100644 --- a/CONFIGURATION_FR.md +++ b/CONFIGURATION_FR.md @@ -79,7 +79,7 @@ Voici les configurations des applications tierces utilisĂ©es par Esup-Pod.
>> Mise en place du mode PWA grĂące Ă  l'application Django-pwa
>> Voici la configuration par défaut pour Pod, vous pouvez surcharger chaque variable dans votre fichier de configuration.
>> PWA_APP_NAME = "Pod"
- >> PWA_APP_DESCRIPTION = _(
+ >> PWA_APP_DESCRIPTION = (
>> "Pod is aimed at users of our institutions, by allowing the publication of "
>> "videos in the fields of research (promotion of platforms, etc.), training "
>> "(tutorials, distance training, student reports, etc.), institutional life (video "
@@ -1164,6 +1164,12 @@ Vous pouvez tout à fait rajouter des langues comme vous le souhaitez. Il faudra + - `OIDC_CLAIM_PREFERRED_USERNAME` + + > valeur par défaut : `preferred_username` + + >> Noms des Claim permettant de récupérer l'attribut login mais dépendant de l'attribut du client dans l'IDP
+ - `OIDC_CLAIM_GIVEN_NAME` > valeur par défaut : `given_name` @@ -1444,6 +1450,27 @@ Mettre `USE_IMPORT_VIDEO` à True pour activer cette application.
>> Activation de l’application d'import des vidĂ©os
+ - `USE_IMPORT_VIDEO_BBB_RECORDER` + + > valeur par défaut : `False` + + >> Utilisation du plugin bbb-recorder pour le module import-vidéo;
+ >> utile pour convertir une présentation BigBlueButton en fichier vidéo.
+ + - `IMPORT_VIDEO_BBB_RECORDER_PLUGIN` + + > valeur par défaut : `/home/pod/bbb-recorder/` + + >> Répertoire du plugin bbb-recorder (voir la documentation https://github.com/jibon57/bbb-recorder).
+ >> bbb-recorder doit ĂȘtre installĂ© dans ce rĂ©pertoire, sur tous les serveurs d'encodage.
+ >> bbb-recorder crĂ©e un rĂ©pertoire Downloads, au mĂȘme niveau, qui nĂ©cessite de l'espace disque.
+ + - `IMPORT_VIDEO_BBB_RECORDER_PATH` + + > valeur par défaut : `True` + + >> Répertoire qui contiendra les fichiers vidéo générés par bbb-recorder.
+ ### Configuration application live - `AFFILIATION_EVENT` @@ -2578,9 +2605,9 @@ Attention, il faut configurer Celery pour l’envoi des instructions pour l'enco - `CELERY_BROKER_URL` - > valeur par dĂ©faut : `amqp://pod:xxx@localhost/rabbitpod` + > valeur par dĂ©faut : `redis://127.0.0.1:6379/5` - >> URL de Celery pour la gestion des taches d’encodage.
+ >> URL du courtier de messages oĂč Celery stocke les ordres d’encodage et de transcription.
- `CELERY_TO_ENCODE` @@ -2662,13 +2689,27 @@ Attention, il faut configurer Celery pour l’envoi des instructions pour l'enco >> >> ``` - - `USE_DISTANT_ENCODING_TRANSCODING` + - `USE_REMOTE_ENCODING_TRANSCODING` > valeur par dĂ©faut : `False` >> Si True, active l'encodage et la transcription sur un environnement distant via redis+celery
+ - `POD_API_URL` + + > valeur par défaut : `` + + >> Adresse de l'API rest a appeler en fin d'encodage distant ou de transcription à distance.
+ >> Exemple : https://pod.univ.fr/rest/
+ + - `POD_API_TOKEN` + + > valeur par défaut : `` + + >> Token d'authentification utilisé pour l'appel en fin d'encodage distant ou de transcription à distance.
+ >> Pour le créer, il faut aller dans la partie Admin > Jeton d'authentification > token.
+ - `VIDEO_RENDITIONS` > valeur par dĂ©faut : `[]` diff --git a/dockerfile-dev-with-volumes/README.adoc b/dockerfile-dev-with-volumes/README.adoc index a902038a23..8097bcc2ae 100755 --- a/dockerfile-dev-with-volumes/README.adoc +++ b/dockerfile-dev-with-volumes/README.adoc @@ -102,7 +102,7 @@ SESSION_REDIS = { MIGRATION_MODULES = {'flatpages': 'pod.db_migrations'} # Si DOCKER_ENV = full il faut activer l'encodage et la transcription distante -# USE_DISTANT_ENCODING_TRANSCODING = True +# USE_REMOTE_ENCODING_TRANSCODING = True # ENCODING_TRANSCODING_CELERY_BROKER_URL = "redis://redis:6379/7" # pour avoir le maximum de log sur la console diff --git a/dockerfile-dev-with-volumes/pod-back/Dockerfile b/dockerfile-dev-with-volumes/pod-back/Dockerfile index 6f509e568c..e4733869fd 100755 --- a/dockerfile-dev-with-volumes/pod-back/Dockerfile +++ b/dockerfile-dev-with-volumes/pod-back/Dockerfile @@ -32,7 +32,7 @@ RUN mkdir /tmp/node_modules/ COPY --from=source-build-js /tmp/pod/node_modules/ /tmp/node_modules/ # TODO remove ES version - move it into env var RUN pip3 install --no-cache-dir -r requirements-conteneur.txt \ - && pip3 install elasticsearch==8.9.0 + && pip3 install elasticsearch==7.17.7 # ENTRYPOINT : COPY ./dockerfile-dev-with-volumes/pod-back/my-entrypoint-back.sh /tmp/my-entrypoint-back.sh diff --git a/dockerfile-dev-with-volumes/pod-back/my-entrypoint-back.sh b/dockerfile-dev-with-volumes/pod-back/my-entrypoint-back.sh index 5e785f880c..67d58b7229 100644 --- a/dockerfile-dev-with-volumes/pod-back/my-entrypoint-back.sh +++ b/dockerfile-dev-with-volumes/pod-back/my-entrypoint-back.sh @@ -25,7 +25,5 @@ fi # Le serveur de dĂ©veloppement permet de tester vos futures modifications facilement. # N'hĂ©sitez pas Ă  lancer le serveur de dĂ©veloppement pour vĂ©rifier vos modifications au fur et Ă  mesure. # À ce niveau, vous devriez avoir le site en français et en anglais et voir l'ensemble de la page d'accueil. -celery -A pod.video_encode_transcript.importing_tasks worker -l INFO -Q importing --concurrency 1 --detach -n import_encode -celery -A pod.video_encode_transcript.importing_transcript_tasks worker -l INFO -Q importing_transcript --concurrency 1 --detach -n import_transcript python3 manage.py runserver 0.0.0.0:8080 --insecure sleep infinity diff --git a/pod/authentication/backends.py b/pod/authentication/backends.py index 82d2139ea9..3385bb704d 100644 --- a/pod/authentication/backends.py +++ b/pod/authentication/backends.py @@ -70,6 +70,9 @@ def update_owner_params(user, params): # #changing-how-django-users-are-created OIDC_CLAIM_GIVEN_NAME = getattr(settings, "OIDC_CLAIM_GIVEN_NAME", "given_name") OIDC_CLAIM_FAMILY_NAME = getattr(settings, "OIDC_CLAIM_FAMILY_NAME", "family_name") +OIDC_CLAIM_PREFERRED_USERNAME = getattr( + settings, "OIDC_CLAIM_PREFERRED_USERNAME", "preferred_username" +) OIDC_DEFAULT_AFFILIATION = getattr( settings, "OIDC_DEFAULT_AFFILIATION", DEFAULT_AFFILIATION ) @@ -87,6 +90,7 @@ def create_user(self, claims): user.first_name = claims.get(OIDC_CLAIM_GIVEN_NAME, "") user.last_name = claims.get(OIDC_CLAIM_FAMILY_NAME, "") + user.username = claims.get(OIDC_CLAIM_PREFERRED_USERNAME, "") user.owner.affiliation = OIDC_DEFAULT_AFFILIATION for code_name in OIDC_DEFAULT_ACCESS_GROUP_CODE_NAMES: try: @@ -105,6 +109,7 @@ def update_user(self, user, claims): """Update OIDC user.""" user.first_name = claims.get(OIDC_CLAIM_GIVEN_NAME, "") user.last_name = claims.get(OIDC_CLAIM_FAMILY_NAME, "") + user.username = claims.get(OIDC_CLAIM_PREFERRED_USERNAME, "") user.save() user.owner.auth_type = "OIDC" diff --git a/pod/bbb/templates/bbb/list_meeting.html b/pod/bbb/templates/bbb/list_meeting.html index eed06c22a2..5e60cb96e9 100644 --- a/pod/bbb/templates/bbb/list_meeting.html +++ b/pod/bbb/templates/bbb/list_meeting.html @@ -4,9 +4,6 @@ {% block page_extra_head %} - {% endblock %} {% block breadcrumbs %} @@ -18,8 +15,8 @@

{% trans "Create a video from a BigBlueButton presentation" %}

{% if records.paginator.count == 0 %} -

{% trans "No record found"%}

- +

{% trans "No record found" %}

+ {% else %}

{% blocktrans count counter=records.paginator.count %}{{ counter }} record found{% plural %}{{ counter }} records found{% endblocktrans %}

{% trans "This is the list of the recorded BigBlueButton sessions for which you were moderator. This module allows you to create a video from a BigBlueButton presentation." %}
@@ -61,6 +58,9 @@