Skip to content

Commit

Permalink
Merge pull request #993 from EsupPortail/develop
Browse files Browse the repository at this point in the history
[DONE] Develop -> 3.5.0 (#980)
  • Loading branch information
ptitloup authored Feb 6, 2024
2 parents 07ed2c5 + 2bf7d2d commit 8e1bd1d
Show file tree
Hide file tree
Showing 347 changed files with 10,478 additions and 4,306 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ module.exports = {
"globals": {
"Cookies": "readonly",
"gettext": "readonly",
"ngettext": "readonly",
"interpolate": "readonly",
"bootstrap": "readonly",
"videojs": "readonly",
"CKEDITOR": "readonly",
"send_form_data": "writable",
"showalert": "writable",
"showLoader": "writable",
"manageDisableBtn": "writable"
}
};
2 changes: 2 additions & 0 deletions .gitguardian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exclude_paths:
- pod/enrichment/tests/test_views.py
4 changes: 2 additions & 2 deletions .github/workflows/pod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
python-version: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Configure sysctl limits (for ES)
run: |
Expand All @@ -27,7 +27,7 @@ jobs:
sudo sysctl -w vm.max_map_count=262144
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
29 changes: 18 additions & 11 deletions CONFIGURATION_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -739,13 +739,13 @@ Vous pouvez tout à fait rajouter des langues comme vous le souhaitez. Il faudra

> valeur par défaut : `False`

>> Si True, permet de ne pas afficher les cursus dans la colonne de droite <br>
>> Si True, permet de ne pas afficher les cursus dans la colonne de droite. <br>

- `HIDE_DISCIPLINES`

> valeur par défaut : `False`

>> Si True, permet de ne pas afficher les disciplines dans la colonne de droite <br>
>> Si True, permet de ne pas afficher les disciplines dans la colonne de droite. <br>

- `HIDE_LANGUAGE_SELECTOR`

Expand All @@ -769,7 +769,7 @@ Vous pouvez tout à fait rajouter des langues comme vous le souhaitez. Il faudra

> valeur par défaut : `False`

>> si True, permet de ne pas afficher la liste des types dans la colonne de droite <br>
>> Si True, permet de ne pas afficher la liste des types dans la colonne de droite. <br>

- `HIDE_TYPES_TAB`

Expand Down Expand Up @@ -1552,13 +1552,13 @@ Mettre `USE_IMPORT_VIDEO` à True pour activer cette application.<br>
- `USE_BBB`
> valeur par défaut : `True`
> valeur par défaut : `False`
>> Utilisation de BigBlueButton - [TODO] À retirer dans les futures versions de Pod <br>
- `USE_BBB_LIVE`
> valeur par défaut : `False `
> valeur par défaut : `False`
>> Utilisation du système de diffusion de Webinaires en lien avec BigBlueButton - [TODO] À retirer dans les futures versions de Pod <br>
Expand Down Expand Up @@ -1882,15 +1882,15 @@ Mettre `USE_PLAYLIST` à True pour activer cette application.<br>
}
```
>> Les clés VAPID sont nécessaires à la lib [django-webpush](https://github.com/safwanrahman/django-webpush). Elles peuvent être générées avec [https://web-push-codelab.glitch.me/]() <br>
>> Les clés VAPID sont nécessaires à la lib [django-webpush](https://github.com/safwanrahman/django-webpush). Elles peuvent être générées avec [https://web-push-codelab.glitch.me/](). <br>
### Configuration application recorder
- `ALLOW_MANUAL_RECORDING_CLAIMING`
> valeur par défaut : `False`
>> si True, active un lien dans le menu de l’utilisateur permettant de réclamer un enregistrement <br>
>> Si True, active un lien dans le menu de l’utilisateur permettant de réclamer un enregistrement. <br>
- `ALLOW_RECORDER_MANAGER_CHOICE_VID_OWNER`
Expand All @@ -1916,7 +1916,7 @@ Mettre `USE_PLAYLIST` à True pour activer cette application.<br>
> valeur par défaut : `1`
>> Identifiant du type de vidéo par défaut (si non spécifié). <br>
>> (Exemple : 3 pour Colloque/conférence, 4 pour Cours...) <br>
>> (Exemple : 3 pour Colloque/conférence, 4 pour Cours) <br>
- `DEFAULT_RECORDER_USER_ID`
Expand Down Expand Up @@ -2357,7 +2357,7 @@ Mettre `USE_PLAYLIST` à True pour activer cette application.<br>
>> _(
>> "In this field you can select and add additional owners to the "
>> "video. These additional owners will have the same rights as "
>> "you except that they can't delete this video."
>> "you except that they cant delete this video."
>> )
>> ],
>> ),
Expand Down Expand Up @@ -2512,7 +2512,7 @@ Mettre `USE_PLAYLIST` à True pour activer cette application.<br>
>> "{0}".format(_("Restricted access")),
>> [
>> _(
>> "If you don't select “Draft mode”, you can restrict "
>> "If you dont select “Draft mode”, you can restrict "
>> "the content access to only people who can log in"
>> )
>> ],
Expand All @@ -2521,7 +2521,7 @@ Mettre `USE_PLAYLIST` à True pour activer cette application.<br>
>> "{0}".format(_("Password")),
>> [
>> _(
>> "If you don't select “Draft mode”, you can add a password "
>> "If you dont select “Draft mode”, you can add a password "
>> "which will be asked to anybody willing to watch "
>> "your content."
>> ),
Expand Down Expand Up @@ -2747,6 +2747,13 @@ Attention, il faut configurer Celery pour l’envoi des instructions pour l'enco
>> et pour la 8, `pip3 install elasticsearch==8.8.1`. <br>
>> Voir [https://elasticsearch-py.readthedocs.io/]() pour plus d'information. <br>
- `ES_OPTIONS`
> valeur par défaut : `{}`
>> Options d’ElasticSearch, notamment utilisées pour ES8 en SSL et avec un user en paramètre <br>
>> Voir [https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/config.html]() pour plus d'informations. <br>
### Configuration application xapi
Application pour l’envoi d‘instructions xAPI à un LRS.<br>
Expand Down
17 changes: 16 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Start reading our code and you'll get the hang of it. We optimize for readabilit

* Configuration variables are uppercase and can be called in all modules keeping the same name. For example, MAVAR = getattr(settings, "MAVAR", default value)
* Global variables to a module are also in uppercase but are considered private to the module and therefore must be prefixed and suffixed with a double underscore
* We indent using two spaces (soft tabs)
* All .py files must be indented using 4 spaces, and all other files (.css, .html, .js) with 2 spaces (soft tabs)
* This is open source software. Consider the people who will read your code, and make it look nice for them. It's sort of like driving a car: Perhaps you love doing donuts when you're alone, but with passengers the goal is to make the ride as smooth as possible.

### JavaScript Styleguide
Expand All @@ -150,3 +150,18 @@ All JavaScript code is linted with [eslint](https://eslint.org/).

All python code is linted with [flake8](https://flake8.pycqa.org/en/latest/)

### Typography

Please use these typographic characters in all displayed strings:

* Use Apostrophe (’) instead of single quote (')
* English samples: don’t, it’s
* French samples : J’aime, l’histoire
* Use the ellipsis (…) instead of 3 dots (...)
* English sample: Loading…
* French sample : Chargement…
* Use typographic quotes (“ ”) instead of neutral quotes (" ")
* English sample: You can use the “Description” field below.
* French sample : Utilisez le champ « Description » ci-dessous


10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ start:
starts:
# nécessite les django-extensions
# cf https://timonweb.com/django/https-django-development-server-ssl-certificate/
(sleep 15 ; open https://localhost:8000) &
python3 manage.py runserver_plus --cert-file cert.pem --key-file key.pem
(sleep 15 ; open https://localhost:9090) &
python3 manage.py runserver_plus localhost:9090 --cert-file cert.pem --key-file key.pem

# Première installation de pod (BDD SQLite intégrée)
install:
Expand Down Expand Up @@ -49,9 +49,9 @@ createDB:
# Mise à jour des fichiers de langue
lang:
echo "Processing python files..."
python3 manage.py makemessages --all -i "opencast-studio/*" -i "pod/custom/settings_local.py" --add-location=file
python3 manage.py makemessages --all -i "opencast-studio/*" -i "pod/custom/*" --add-location=file
echo "Processing javascript files..."
python3 manage.py makemessages -d djangojs -l fr -l nl -i "*.min.js" -i "pod/static/*" -i "opencast-studio/*" -i "*/node_modules/*" --add-location=file
python3 manage.py makemessages -d djangojs -l fr -l nl -i "*.min.js" -i "pod/static/*" -i "opencast-studio/*" -i "*/node_modules/*" -i "node_modules/*" -i "pod/custom/*" --add-location=file

#compilation des fichiers de langue
compilelang:
Expand All @@ -76,7 +76,7 @@ pystyle:

# Collects all static files inside all apps and put a copy inside the static directory declared in settings.py
statics:
cd pod; yarn upgrade
cd pod; yarn install; yarn upgrade
# --clear Clear the existing files before trying to copy or link the original file.
python3 manage.py collectstatic --clear

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ The project and the platform of the same name are aimed at users of our institut
### Technical documentation
* The documentation (to install, customize, etc…) is on the [ESUP Wiki](https://www.esup-portail.org/wiki/display/ES/esup-pod "Documentation")

<img src="https://www.univ-lille.fr/typo3conf/ext/ul2fpfb/Resources/Public/assets/img/UL-ROSE-dark-2014.svg" height="50"> | <img src="https://www.esup-portail.org/sites/default/files/logo-esupportail_1.png" height="50"> | <img src="http://cache.media.enseignementsup-recherche.gouv.fr/image/Global/35/8/Marianne_seule_MESRI_head_www_766358.jpg" height="50"> Ministère de lʼEnseignement supérieur, de la Recherche et de lʼInnovation
<img src="https://www.univ-lille.fr/typo3conf/ext/ul2fpfb/Resources/Public/assets/img/UL-ROSE-dark-2014.svg" height="50"> | <img src="https://www.esup-portail.org/sites/default/files/logo-esupportail_1.png" height="50"> | <img src="https://upload.wikimedia.org/wikipedia/fr/5/50/Bloc_Marianne.svg" height="30"> Ministère de lʼEnseignement supérieur et de la Recherche
:-----:|:-----:|:----:

2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
## Retrouvez toute la documentation à cette adresse : https://www.esup-portail.org/wiki/display/ES/esup-pod


[<img src="https://www.univ-lille.fr/typo3conf/ext/ul2fpfb/Resources/Public/assets/img/UL-ROSE-dark-2014.svg" height="50" loading="lazy">](https://www.univ-lille.fr "Université de Lille") | [<img src="https://www.esup-portail.org/sites/default/files/logo-esupportail_1.png" height="50" loading="lazy">](https://www.esup-portail.org "Esup Portail") | [<img src="http://cache.media.enseignementsup-recherche.gouv.fr/image/Global/35/8/Marianne_seule_MESRI_head_www_766358.jpg" height="50" loading="lazy"> Ministère de lʼEnseignement supérieur, de la Recherche et de lʼInnovation](http://www.enseignementsup-recherche.gouv.fr "Ministère de lʼEnseignement supérieur, de la Recherche et de lʼInnovation")
[<img src="https://www.univ-lille.fr/typo3conf/ext/ul2fpfb/Resources/Public/assets/img/UL-ROSE-dark-2014.svg" height="50" loading="lazy">](https://www.univ-lille.fr "Université de Lille") | [<img src="https://www.esup-portail.org/sites/default/files/logo-esupportail_1.png" height="50" loading="lazy">](https://www.esup-portail.org "Esup Portail") | [<img src="https://upload.wikimedia.org/wikipedia/fr/5/50/Bloc_Marianne.svg" height="30" loading="lazy"> Ministère de lʼEnseignement supérieur et de la Recherche](http://www.enseignementsup-recherche.gouv.fr "Ministère de lʼEnseignement supérieur et de la Recherche")
:-----:|:-----:|:----:
10 changes: 10 additions & 0 deletions pod/authentication/backends.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Esup-Pod Authentication backends."""

from shibboleth.backends import ShibbolethRemoteUserBackend
from mozilla_django_oidc.auth import OIDCAuthenticationBackend
from django.contrib.sites.shortcuts import get_current_site
Expand All @@ -14,10 +16,13 @@


def is_staff_affiliation(affiliation):
"""Check if user affiliation correspond to AFFILIATION_STAFF."""
return affiliation in AFFILIATION_STAFF


class ShibbBackend(ShibbolethRemoteUserBackend):
"""Shibboleth backend authentication."""

def authenticate(self, request, remote_user, shib_meta):
"""
Username passed as `remote_user` is considered trusted.
Expand All @@ -44,6 +49,7 @@ def authenticate(self, request, remote_user, shib_meta):

@staticmethod
def update_owner_params(user, params):
"""Update owner params from Shibboleth."""
user.owner.auth_type = "Shibboleth"
if get_current_site(None) not in user.owner.sites.all():
user.owner.sites.add(get_current_site(None))
Expand Down Expand Up @@ -73,7 +79,10 @@ def update_owner_params(user, params):


class OIDCBackend(OIDCAuthenticationBackend):
"""OIDC backend authentication."""

def create_user(self, claims):
"""Create user connectd by OIDC."""
user = super(OIDCBackend, self).create_user(claims)

user.first_name = claims.get(OIDC_CLAIM_GIVEN_NAME, "")
Expand All @@ -93,6 +102,7 @@ def create_user(self, claims):
return user

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.save()
Expand Down
7 changes: 7 additions & 0 deletions pod/authentication/populatedCASbackend.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Esup-Pod CAS & LDAP authentication backend."""

from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
Expand Down Expand Up @@ -72,6 +74,7 @@


def populateUser(tree):
"""Populate user form CAS or LDAP attributes."""
username_element = tree.find(
".//{http://www.yale.edu/tp/cas}%s" % AUTH_CAS_USER_SEARCH
)
Expand Down Expand Up @@ -130,6 +133,7 @@ def get_server():


def get_ldap_conn():
"""Open and get LDAP connexion."""
try:
server = get_server()
conn = Connection(
Expand All @@ -145,6 +149,7 @@ def get_ldap_conn():


def get_entry(conn, username, list_value):
"""Get LDAP entries."""
try:
conn.search(
AUTH_LDAP_USER_SEARCH[0],
Expand Down Expand Up @@ -256,6 +261,7 @@ def populate_user_from_entry(user, owner, entry):


def populate_user_from_tree(user, owner, tree):
"""Populate user from CAS attributes."""
if DEBUG:
print_xml_tree(tree)
# Mail
Expand Down Expand Up @@ -307,6 +313,7 @@ def populate_user_from_tree(user, owner, tree):


def print_xml_tree(tree):
"""Print XML tree for debug purpose."""
import xml.etree.ElementTree as ET
import xml.dom.minidom
import os
Expand Down
2 changes: 0 additions & 2 deletions pod/authentication/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class OwnerTestCase(TestCase):

"""OwnerTestCase"""

def setUp(self):
Expand All @@ -34,7 +33,6 @@ def test_suppression_owner(self):


class AccessGroupTestCase(TestCase):

"""AcessGroupTestCase"""

def setUp(self):
Expand Down
1 change: 1 addition & 0 deletions pod/authentication/tests/test_populated.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""test populated authentication."""

import random
from django.conf import settings
from django.test import TestCase, override_settings
Expand Down
1 change: 1 addition & 0 deletions pod/authentication/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test authentication utils."""

import json

from django.test import TestCase
Expand Down
1 change: 1 addition & 0 deletions pod/authentication/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* run with 'python manage.py test pod.authentication.tests.test_views'
"""

from django.test import TestCase
from django.test import Client
from django.contrib.auth.models import User
Expand Down
1 change: 1 addition & 0 deletions pod/authentication/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Authentication views."""

from django.http import HttpResponse
from django.shortcuts import render
from django.shortcuts import redirect
Expand Down
2 changes: 2 additions & 0 deletions pod/bbb/forms.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Esup-Pod BBB forms."""

from django import forms
from django.conf import settings
from .models import BBB_Meeting
Expand Down
1 change: 1 addition & 0 deletions pod/bbb/management/commands/bbb.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
/data/www/%userpod%/django_projects/podv3; source
/usr/bin/virtualenvwrapper.sh; workon django_pod; python manage.py bbb
main' """

import os
import traceback
from django.utils import translation
Expand Down
8 changes: 4 additions & 4 deletions pod/bbb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ class Livestream(models.Model):
)
# If the user wants to download the video of this meeting after the live
download_meeting = models.BooleanField(
verbose_name=_("Save meeting in My videos"),
verbose_name=_("Save meeting in dashboard"),
help_text=_(
"Do you want to save the video of "
'this meeting, at the end of the live, directly in "My videos"?'
"this meeting, at the end of the live, directly in “Dashboard”?"
),
default=False,
)
Expand All @@ -241,8 +241,8 @@ class Livestream(models.Model):
verbose_name=_("Enable chat"),
help_text=_(
"Do you want a chat on the live page "
"for students? Messages sent in this live page's chat will "
"end up in BigBlueButton's public chat."
"for students? Messages sent in this live pages chat will "
"end up in BigBlueButtons public chat."
),
default=False,
)
Expand Down
Loading

0 comments on commit 8e1bd1d

Please sign in to comment.