Skip to content

Commit

Permalink
Merge pull request #1054 from EsupPortail/develop
Browse files Browse the repository at this point in the history
[DONE] Develop #3.5.1
  • Loading branch information
ptitloup authored Mar 5, 2024
2 parents 8e1bd1d + 6a190f0 commit 0cea8e9
Show file tree
Hide file tree
Showing 122 changed files with 4,181 additions and 1,484 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/pod_encoding.yml
Original file line number Diff line number Diff line change
@@ -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: "[email protected]"
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"
49 changes: 45 additions & 4 deletions CONFIGURATION_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Voici les configurations des applications tierces utilisées par Esup-Pod.<br>
>> Mise en place du mode PWA grâce à l'application Django-pwa <br>
>> Voici la configuration par défaut pour Pod, vous pouvez surcharger chaque variable dans votre fichier de configuration. <br>
>> PWA_APP_NAME = "Pod" <br>
>> PWA_APP_DESCRIPTION = _( <br>
>> PWA_APP_DESCRIPTION = ( <br>
>> "Pod is aimed at users of our institutions, by allowing the publication of " <br>
>> "videos in the fields of research (promotion of platforms, etc.), training " <br>
>> "(tutorials, distance training, student reports, etc.), institutional life (video " <br>
Expand Down Expand Up @@ -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 <br>
- `OIDC_CLAIM_GIVEN_NAME`
> valeur par défaut : `given_name`
Expand Down Expand Up @@ -1444,6 +1450,27 @@ Mettre `USE_IMPORT_VIDEO` à True pour activer cette application.<br>
>> Activation de l’application d'import des vidéos <br>
- `USE_IMPORT_VIDEO_BBB_RECORDER`
> valeur par défaut : `False`
>> Utilisation du plugin bbb-recorder pour le module import-vidéo; <br>
>> utile pour convertir une présentation BigBlueButton en fichier vidéo. <br>
- `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). <br>
>> bbb-recorder doit être installé dans ce répertoire, sur tous les serveurs d'encodage. <br>
>> bbb-recorder crée un répertoire Downloads, au même niveau, qui nécessite de l'espace disque. <br>
- `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. <br>
### Configuration application live
- `AFFILIATION_EVENT`
Expand Down Expand Up @@ -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. <br>
>> URL du courtier de messages où Celery stocke les ordres d’encodage et de transcription. <br>
- `CELERY_TO_ENCODE`
Expand Down Expand Up @@ -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 <br>
- `POD_API_URL`
> valeur par défaut : ``
>> Adresse de l'API rest a appeler en fin d'encodage distant ou de transcription à distance. <br>
>> Exemple : https://pod.univ.fr/rest/ <br>
- `POD_API_TOKEN`
> valeur par défaut : ``
>> Token d'authentification utilisé pour l'appel en fin d'encodage distant ou de transcription à distance. <br>
>> Pour le créer, il faut aller dans la partie Admin > Jeton d'authentification > token. <br>
- `VIDEO_RENDITIONS`
> valeur par défaut : `[]`
Expand Down
2 changes: 1 addition & 1 deletion dockerfile-dev-with-volumes/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dockerfile-dev-with-volumes/pod-back/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions dockerfile-dev-with-volumes/pod-back/my-entrypoint-back.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions pod/authentication/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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:
Expand All @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions pod/bbb/templates/bbb/list_meeting.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

{% block page_extra_head %}
<link rel="stylesheet" href="{% static 'css/bbb.css' %}?ver={{VERSION}}">
<script>
window.setInterval("location.reload(true)",30000);
</script>
{% endblock %}

{% block breadcrumbs %}
Expand All @@ -18,8 +15,8 @@

<h2 class="h3">{% trans "Create a video from a BigBlueButton presentation" %}</h2>
{% if records.paginator.count == 0 %}
<h3 class="h4">{% trans "No record found"%}</h3>
<p class="alert alert-info" role="alert">{% trans 'There are no BigBlueButton records.'%}</p>
<h3 class="h4">{% trans "No record found" %}</h3>
<p class="alert alert-info" role="alert">{% trans "There are no BigBlueButton records." %}</p>
{% else %}
<h3 class="h4">{% blocktrans count counter=records.paginator.count %}{{ counter }} record found{% plural %}{{ counter }} records found{% endblocktrans %}</h4>
{% 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." %}<br>
Expand Down Expand Up @@ -61,6 +58,9 @@ <h2 class="modal-title" id="previewModalLabel">{% trans "BigBlueButton presentat
{% block page_aside %}{% endblock page_aside %}

{% block more_script %}
<script>
window.setInterval("location.reload(true)",30000);
</script>
<script src="{% static 'waypoints/lib/jquery.waypoints.min.js' %}?ver={{VERSION}}"></script>
<script src="{% static 'waypoints/lib/shortcuts/infinite.min.js' %}?ver={{VERSION}}"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion pod/bbb/templates/bbb/live_list_meeting.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h2 class="h3">{% blocktrans count counter=records.paginator.count %}{{ counter
</p>

{% if records.paginator.count == 0 %}
<p class="alert alert-info" role="alert">{% trans 'There are no BigBlueButton sessions in progress.'%}</p>
<p class="alert alert-info" role="alert">{% trans "There are no BigBlueButton sessions in progress." %}</p>
{% else %}
{% include "bbb/live_record_list.html" %}
{% endif %}
Expand Down
3 changes: 2 additions & 1 deletion pod/bbb/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class MeetingTestCase(TestCase):
]

def setUp(self):
"""Set up MeetingTestCase."""
Meeting.objects.create(
id=1,
meeting_id="id1",
Expand All @@ -32,8 +33,8 @@ def setUp(self):

print(" ---> SetUp of MeetingTestCase: OK!")

# Test attributes
def test_attributes(self):
"""Test Meeting attributes."""
meeting = Meeting.objects.get(id=1)
self.assertEqual(meeting.meeting_name, "Session BBB1")
self.assertEqual(meeting.internal_meeting_id, "internalid1")
Expand Down
32 changes: 12 additions & 20 deletions pod/chapter/templates/video_chapter.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
{% block page_title %}{% trans 'Chapter video' %} "{{video.title}}" {% endblock page_title %}
{% block page_extra_head %}
{% include 'videos/video-header.html' %}
<script src="{% static 'js/chapters.js' %}?ver={{VERSION}}"></script>
<script>
const video_duration = {{ video.duration }};
</script>
{% endblock page_extra_head %}
{% block breadcrumbs %}
{{block.super}}
<li class="breadcrumb-item"><a href="{% url 'video:dashboard'%}">{% trans 'Dashboard' %}</a></li>
<li class="breadcrumb-item"><a href="{% url 'video:dashboard' %}">{% trans "Dashboard" %}</a></li>
<li class="breadcrumb-item">
<a href="{% url 'video:video' slug=video.slug %}" title="{{video.title}}">
{{video.title|title|truncatechars:45}}
Expand All @@ -39,7 +35,7 @@
</div>
<span class="float-end">
<a href="{% url 'video:video' slug=video.slug %}" title="{% blocktrans with video_title=video.title %}Back to the video “{{ video_title }}”{% endblocktrans %}" class="btn btn btn-secondary btn-sm" data-bs-toggle="tooltip" data-bs-placement="bottom">
<i class="bi bi-film" aria-hidden="true"></i>&nbsp;{% trans "Back to the video"%}
<i class="bi bi-film" aria-hidden="true"></i>&nbsp;{% trans "Back to the video" %}
</a>
</span>
{% if not form_chapter %}
Expand Down Expand Up @@ -67,22 +63,18 @@ <h2 class="card-header card-title pod-card__title h4">{% trans "Help"%}</h2>
{% trans 'Chapters' %}
</button>
<div id="collapse-0" class="card-body collapse card-text small">
<p>{% trans '“Add a new chapter” allows you to add a chapter to the video, “modify” allows you to edit it and “delete” allows you to remove the chapter.' %}</p>
<p>{% trans 'Start playback of the video, pause the video and click on “Get time from the player” to fill in the field untitled “Start time”.' %}</p>
<p>{% trans 'The chapters cannot start at the same time.' %}</p>
<p>{% trans 'You must save your chapters to view the result.' %}</p>
</div>
</div>
<div class="card mt-1" id="card-mandatory-fields">
<h2 class="h4 card-header card-title pl-2">{% trans "Mandatory fields" %}</h2>
<div class="card-body card-text">
<p>
<span class="required_star">*</span>
{% trans "Fields marked with an asterisk are mandatory." %}
</p>
<p>{% trans "“Add a new chapter” allows you to add a chapter to the video, “modify” allows you to edit it and “delete” allows you to remove the chapter." %}</p>
<p>{% trans "Start playback of the video, pause the video and click on “Get time from the player” to fill in the field untitled “Start time”." %}</p>
<p>{% trans "The chapters cannot start at the same time." %}</p>
<p>{% trans "You must save your chapters to view the result." %}</p>
</div>
</div>
{% include "main/mandatory_fields.html" %}
{% endblock page_aside %}
{% block more_script %}
{% include 'videos/video-script.html'%}
<script src="{% static 'js/chapters.js' %}?ver={{VERSION}}"></script>
<script>
const video_duration = {{ video.duration }};
</script>
{% include "videos/video-script.html" %}
{% endblock more_script %}
4 changes: 2 additions & 2 deletions pod/completion/templates/video_caption_maker.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

{% block breadcrumbs %}
{{block.super}}
<li class="breadcrumb-item"><a href="{% url 'video:dashboard' %}">{% trans 'Dashboard' %}</a></li>
<li class="breadcrumb-item"><a href="{% url 'video:dashboard' %}">{% trans "Dashboard" %}</a></li>

<li class="breadcrumb-item">
<a href="{% url 'video:video' slug=video.slug %}">
Expand Down Expand Up @@ -221,5 +221,5 @@ <h2 class="modal-title" id="confirmSaveLabel">{% trans "Save captions file."%}</
</script>
<script src="{% static 'js/caption_maker.js' %}?ver={{VERSION}}"></script>
<script src="{% static 'js/completion.js' %}?ver={{VERSION}}"></script>
{% include 'videos/video-script.html'%}
{% include "videos/video-script.html" %}
{% endblock more_script %}
2 changes: 1 addition & 1 deletion pod/completion/templates/video_completion.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% endblock page_extra_head %}
{% block breadcrumbs %}
{{block.super}}
<li class="breadcrumb-item"><a href="{% url 'video:dashboard'%}">{% trans 'Dashboard' %}</a></li>
<li class="breadcrumb-item"><a href="{% url 'video:dashboard' %}">{% trans "Dashboard" %}</a></li>
<li class="breadcrumb-item">
<a href="{% url 'video:video' slug=video.slug %}" title="{{video.title}}">
{{video.title|title|truncatechars:45}}
Expand Down
Loading

0 comments on commit 0cea8e9

Please sign in to comment.