Skip to content

Commit

Permalink
Merge pull request #627 from EsupPortail/dev
Browse files Browse the repository at this point in the history
[DONE] Dev#2.9.3
  • Loading branch information
ptitloup authored Jul 11, 2022
2 parents a5790bd + 0bd8a7b commit 09ececa
Showing 74 changed files with 8,689 additions and 1,508 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -16,3 +16,4 @@ omit = pod/*settings*.py
pod/*/forms.py
pod/video/bbb.py
scripts/bbb-pod-live/*.*
pod/live/pilotingInterface.py
1 change: 1 addition & 0 deletions .github/workflows/pod.yml
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ jobs:
pip install -r requirements.txt
pip install flake8
pip install coveralls
pip install httmock
- name: Flake8 compliance
run: |
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

[![Licence LGPL 3.0](https://img.shields.io/github/license/EsupPortail/Esup-Pod)](https://github.com/EsupPortail/Esup-Pod/blob/master/LICENSE) [![Testing Status](https://github.com/EsupPortail/Esup-Pod/actions/workflows/pod.yml/badge.svg)](https://github.com/EsupPortail/Esup-Pod/actions) [![Coverage Status](https://coveralls.io/repos/github/EsupPortail/Esup-Pod/badge.svg?branch=master)](https://coveralls.io/github/EsupPortail/Esup-Pod?branch=master)


[FR]
## Plateforme de gestion de fichier vidéo

Créé en 2014, le projet Pod a connu de nombreux changement ces dernières années. Initié à l’[Université de Lille](https://www.univ-lille.fr/), il est depuis septembre 2015 piloté par le consortium [Esup Portail](https://www.esup-portail.org/) et soutenu également par le [Ministère de l’Enseignement supérieur, de la Recherche et de l’Innovation](http://www.enseignementsup-recherche.gouv.fr/).
@@ -12,6 +12,14 @@ Le projet et la plateforme qui porte le même nom ont pour but de faciliter la m
### Documentation technique
* Accédez à toute la documentation (installation, paramétrage etc.) [sur notre wiki](https://www.esup-portail.org/wiki/display/ES/esup-pod "Documentation")

[EN]
## Platform management of video files
Created in 2014 at the university of [Lille](https://www.univ-lille.fr/), the POD project has been managed by the [Esup Portail consortium](https://www.esup-portail.org/) and supported by the [Ministry of Higher Education, Research and Innovation](http://www.enseignementsup-recherche.gouv.fr/) since September 2015 .

The project and the platform of the same name are 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 of events), offering several days of content.

### 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
:-----:|:-----:|:----:
7 changes: 7 additions & 0 deletions pod/authentication/admin.py
Original file line number Diff line number Diff line change
@@ -113,6 +113,13 @@ def clickable_email(self, obj):
if USE_ESTABLISHMENT_FIELD:
list_display = list_display + ("owner_establishment",)

# readonly_fields=('is_superuser',)
def get_readonly_fields(self, request, obj=None):
if request.user.is_superuser:
return []
self.readonly_fields += ("is_superuser",)
return self.readonly_fields

def owner_hashkey(self, obj):
return "%s" % Owner.objects.get(user=obj).hashkey

2 changes: 1 addition & 1 deletion pod/authentication/models.py
Original file line number Diff line number Diff line change
@@ -170,7 +170,7 @@ def create_groupsite_profile(sender, instance, created, **kwargs):

class AccessGroup(models.Model):
display_name = models.CharField(max_length=128, blank=True, default="")
code_name = models.CharField(max_length=128, unique=True)
code_name = models.CharField(max_length=250, unique=True)
sites = models.ManyToManyField(Site)
users = select2_fields.ManyToManyField(
Owner,
16 changes: 9 additions & 7 deletions pod/authentication/populatedCASbackend.py
Original file line number Diff line number Diff line change
@@ -219,14 +219,16 @@ def populate_user_from_entry(user, owner, entry):
)
else ""
)
user.last_name = (
entry[USER_LDAP_MAPPING_ATTRIBUTES["last_name"]].value
if (
USER_LDAP_MAPPING_ATTRIBUTES.get("last_name")
and entry[USER_LDAP_MAPPING_ATTRIBUTES["last_name"]]
user.last_name = ""
if (
USER_LDAP_MAPPING_ATTRIBUTES.get("last_name")
and entry[USER_LDAP_MAPPING_ATTRIBUTES["last_name"]]
):
user.last_name = (
entry[USER_LDAP_MAPPING_ATTRIBUTES["last_name"]].value[0]
if (isinstance(entry[USER_LDAP_MAPPING_ATTRIBUTES["last_name"]].value, list))
else entry[USER_LDAP_MAPPING_ATTRIBUTES["last_name"]].value
)
else ""
)
user.save()
owner.affiliation = (
entry[USER_LDAP_MAPPING_ATTRIBUTES["primaryAffiliation"]].value
2 changes: 2 additions & 0 deletions pod/authentication/rest_views.py
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ class Meta:
"email",
"groups",
)
filter_fields = ("id", "username", "email")


class GroupSerializer(serializers.HyperlinkedModelSerializer):
@@ -87,6 +88,7 @@ class OwnerViewSet(viewsets.ModelViewSet):
class UserViewSet(viewsets.ModelViewSet):
queryset = User.objects.all().order_by("-date_joined")
serializer_class = UserSerializer
filter_fields = ("id", "username", "email")


class GroupViewSet(viewsets.ModelViewSet):
59 changes: 54 additions & 5 deletions pod/custom/settings_local.py.example
Original file line number Diff line number Diff line change
@@ -996,6 +996,11 @@ CREATE_GROUP_FROM_GROUPS = False
"""
AFFILIATION_STAFF = ('faculty', 'employee', 'staff')

"""
# Groupes ou affiliations des personnes autorisées à créer un évènement
"""
AFFILIATION_EVENT = ['faculty', 'employee', 'staff']

"""
# Valeurs possibles pour l'Affiliation du compte
"""
@@ -1170,11 +1175,6 @@ DS_PARAM = {
}
}

"""
# La liste des utilisateurs regardant le direct sera réservée au staff
"""
VIEWERS_ONLY_FOR_STAFF = False

"""
# Temps (en seconde) entre deux envois d'un signal au serveur,
# pour signaler la présence sur un live
@@ -1361,3 +1361,52 @@ COOKIE_LEARN_MORE = ""
# 'TRACKING_TEMPLATE': 'custom/tracking.html',
"""
USE_VIDEO_EVENT_TRACKING = False

"""
# Affiche ou non les prochains évènements sur la page d'accueil
"""
SHOW_EVENTS_ON_HOMEPAGE = False

"""
# Chemin racine du répertoire où sont déposés temporairement les
# enregistrements des évènements éffectués depuis POD pour
# converstion en ressource vidéo (VOD)
"""
DEFAULT_EVENT_PATH = ""

"""
# Types de logiciel de serveur de streaming utilisés.
# Actuellement disponible Wowza.
# Si vous utilisez une autre logiciel, il faut développer une interface dans pod/live/pilotingInterface.py
"""
BROADCASTER_PILOTING_SOFTWARE = ['Wowza',]

"""
# Image par défaut affichée comme poster ou vignette,
# utilisée pour présenter l'évènement'.
# Cette image doit se situer dans le répertoire static.
"""
DEFAULT_EVENT_THUMBNAIL = "/img/default-event.svg"

"""
# Type par défaut affecté à un évènement direct
# (en général, le type ayant pour identifiant '1' est 'Other')
"""
DEFAULT_EVENT_TYPE_ID = 1


"""
# Si True, un courriel est envoyé aux managers
# et à l'auteur (si DEBUG est à False) à la création/modification d'un event
"""
EMAIL_ON_EVENT_SCHEDULING = True

"""
# Si True, un courriel est également envoyé à l'admin (si DEBUG est à False)
# à la création/modification d'un event
"""
EMAIL_ADMIN_ON_EVENT_SCHEDULING = True
"""
# Durée (en nombre de jours) sur laquelle on souhaite compter le nombre de vues récentes
"""
VIDEO_RECENT_VIEWCOUNT = 180
4 changes: 0 additions & 4 deletions pod/custom/tenants/check_obsolete_videos.sh

This file was deleted.

3 changes: 0 additions & 3 deletions pod/custom/tenants/clearsessions.sh

This file was deleted.

12 changes: 8 additions & 4 deletions pod/custom/tenants/create_tenant.sh
Original file line number Diff line number Diff line change
@@ -73,19 +73,23 @@ echo "(django_pod) pod@pod:/usr/local/django_projects/podv2$ python manage.py cr
echo "--"
echo "crontab"
echo "clear session"
echo "# $ID_SITE $NAME " >> $BASEDIR/clearsessions.sh
echo "" >> $BASEDIR/sh_tenants/clearsessions.sh
echo "# $ID_SITE $NAME " >> $BASEDIR/sh_tenants/clearsessions.sh
echo "cd /usr/local/django_projects/podv2 && /home/pod/.virtualenvs/django_pod/bin/python manage.py clearsessions --settings=pod.custom.tenants.$NAME."$NAME"_settings &>> /usr/local/django_projects/podv2/pod/log/cron_clearsessions_$NAME.log 2>&1" >> $BASEDIR/clearsessions.sh

echo "index videos"
echo "# $ID_SITE $NAME " >> $BASEDIR/index_videos.sh
echo "" >> $BASEDIR/sh_tenants/index_videos.sh
echo "# $ID_SITE $NAME " >> $BASEDIR/sh_tenants/index_videos.sh
echo "cd /usr/local/django_projects/podv2 && /home/pod/.virtualenvs/django_pod/bin/python manage.py index_videos --all --settings=pod.custom.tenants.$NAME."$NAME"_settings &>> /usr/local/django_projects/podv2/pod/log/cron_index_$NAME.log 2>&1" >> $BASEDIR/index_videos.sh

echo "check_obsolete_videos"
echo "# $ID_SITE $NAME " >> $BASEDIR/check_obsolete_videos.sh
echo "" >> $BASEDIR/sh_tenants/check_obsolete_videos.sh
echo "# $ID_SITE $NAME " >> $BASEDIR/sh_tenants/check_obsolete_videos.sh
echo "cd /usr/local/django_projects/podv2 && /home/pod/.virtualenvs/django_pod/bin/python manage.py check_obsolete_videos --settings=pod.custom.tenants.$NAME."$NAME"_settings &>> /usr/local/django_projects/podv2/pod/log/cron_obsolete_$NAME.log 2>&1" >> $BASEDIR/check_obsolete_videos.sh

echo "live_viewcounter"
echo "# $ID_SITE $NAME " >> $BASEDIR/live_viewcounter.sh
echo "" >> $BASEDIR/sh_tenants/live_viewcounter.sh
echo "# $ID_SITE $NAME " >> $BASEDIR/sh_tenants/live_viewcounter.sh
echo "cd /usr/local/django_projects/podv2 && /home/pod/.virtualenvs/django_pod/bin/python manage.py live_viewcounter --settings=pod.custom.tenants.$NAME."$NAME"_settings &>> /usr/local/django_projects/podv2/pod/log/cron_viewcounter_$NAME.log 2>&1" >> $BASEDIR/live_viewcounter.sh

echo "FIN"
3 changes: 0 additions & 3 deletions pod/custom/tenants/index_videos.sh

This file was deleted.

3 changes: 0 additions & 3 deletions pod/custom/tenants/live_viewcounter.sh

This file was deleted.

6 changes: 6 additions & 0 deletions pod/custom/tenants/source/tenant_settings.py
Original file line number Diff line number Diff line change
@@ -44,3 +44,9 @@
DEFAULT_DC_RIGHTS = "BY-NC-SA"

CELERY_BROKER_URL = CELERY_BROKER_URL + "-__NAME__" # Define a broker


########################################################## A LAISSER EN DERNIER !!!!!!!!!!!!!
the_update_settings = update_settings(locals())
for variable in the_update_settings:
locals()[variable] = the_update_settings[variable]
5 changes: 5 additions & 0 deletions pod/custom/tenants/source_enc/tenant_enc_settings.py
Original file line number Diff line number Diff line change
@@ -21,3 +21,8 @@

CELERY_TO_ENCODE = True # Active encode
CELERY_BROKER_URL = CELERY_BROKER_URL + "-__NAME__" # Define a broker

########################################################## A LAISSER EN DERNIER !!!!!!!!!!!!!
the_update_settings = update_settings(locals())
for variable in the_update_settings:
locals()[variable] = the_update_settings[variable]
Loading

0 comments on commit 09ececa

Please sign in to comment.