Skip to content

Commit

Permalink
change podv2 to podv3
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitloup committed Sep 1, 2022
1 parent 8516669 commit 66e6de8
Show file tree
Hide file tree
Showing 19 changed files with 50 additions and 42 deletions.
2 changes: 1 addition & 1 deletion pod/authentication/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class authenticationViewsTestCase(TestCase):
]

def setUp(self):
User.objects.create(username="pod", password="podv2")
User.objects.create(username="pod", password="podv3")
print(" ---> SetUp of authenticationViewsTestCase: OK!")

def test_authentication_login_gateway(self):
Expand Down
13 changes: 10 additions & 3 deletions pod/custom/settings_local.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ TEMPLATE_VISIBLE_SETTINGS = {
# ce template soit affiché en haut de votre page, le code est ajouté
# juste après la balise body.(Hors iframe)
# Si le fichier créé est
# '/opt/django_projects/podv2/pod/custom/templates/custom/preheader.html'
# '/opt/django_projects/podv3/pod/custom/templates/custom/preheader.html'
# alors la variable doit prendre la valeur 'custom/preheader.html'
'PRE_HEADER_TEMPLATE': '',

Expand All @@ -452,7 +452,7 @@ VIDEO_PLAYBACKRATES = '[0.5, 1, 1.5, 2]'
# Configuration application recherche
# Pour mettre à jour le moteur de recherche, je lance toutes les nuits
# la tache cron suivante :
# 0 5 * * * cd $path_pod/podv2 && $v_env/python manage.py index_videos --all
# 0 5 * * * cd $path_pod/podv3 && $v_env/python manage.py index_videos --all

"""
# adresse du ou des instances d'Elasticsearch utilisées pour l'indexation
Expand Down Expand Up @@ -1467,4 +1467,11 @@ BBB_API_URL = ""
BBB_SECRET_KEY = ""
BBB_LOGOUT_URL = "" # optional
RESTRICT_EDIT_MEETING_ACCESS_TO_STAFF_ONLY = False

# use to disable record if bbb instance not deploy it
MEETING_DISABLE_RECORD = True
# if disable record set to true, this fields will be remove from form
MEETING_RECORD_FIELDS = (
"record",
"auto_start_recording",
"allow_start_stop_recording"
)
12 changes: 6 additions & 6 deletions pod/custom/tenants/create_tenant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,30 @@ sed -i "s/__ID_SITE__/$ID_SITE/g" ./$NAME/initial_data.json
sed -i "s/__DOMAIN_NAME__/$DOMAIN_NAME/g" ./$NAME/initial_data.json
echo "--"
echo "Pour intégrer les données en base concernant ce nouveau site, il faut lancer la commande suivante:"
echo "(django_pod) pod@pod:/usr/local/django_projects/podv2$ python manage.py loaddata pod/custom/tenants/$NAME/initial_data.json --settings=pod.custom.tenants.$NAME."$NAME"_settings"
echo "(django_pod) pod@pod:/usr/local/django_projects/podv3$ python manage.py loaddata pod/custom/tenants/$NAME/initial_data.json --settings=pod.custom.tenants.$NAME."$NAME"_settings"
echo "--"
echo "N'oubliez pas de créer l'index dans elasticseach via cette commande :"
echo "(django_pod) pod@pod:/usr/local/django_projects/podv2$ python manage.py create_pod_index --settings=pod.custom.tenants.$NAME."$NAME"_settings"
echo "(django_pod) pod@pod:/usr/local/django_projects/podv3$ python manage.py create_pod_index --settings=pod.custom.tenants.$NAME."$NAME"_settings"
echo "--"
echo "crontab"
echo "clear session"
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 "cd /usr/local/django_projects/podv3 && /home/pod/.virtualenvs/django_pod/bin/python manage.py clearsessions --settings=pod.custom.tenants.$NAME."$NAME"_settings &>> /usr/local/django_projects/podv3/pod/log/cron_clearsessions_$NAME.log 2>&1" >> $BASEDIR/clearsessions.sh

echo "index videos"
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 "cd /usr/local/django_projects/podv3 && /home/pod/.virtualenvs/django_pod/bin/python manage.py index_videos --all --settings=pod.custom.tenants.$NAME."$NAME"_settings &>> /usr/local/django_projects/podv3/pod/log/cron_index_$NAME.log 2>&1" >> $BASEDIR/index_videos.sh

echo "check_obsolete_videos"
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 "cd /usr/local/django_projects/podv3 && /home/pod/.virtualenvs/django_pod/bin/python manage.py check_obsolete_videos --settings=pod.custom.tenants.$NAME."$NAME"_settings &>> /usr/local/django_projects/podv3/pod/log/cron_obsolete_$NAME.log 2>&1" >> $BASEDIR/check_obsolete_videos.sh

echo "live_viewcounter"
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 "cd /usr/local/django_projects/podv3 && /home/pod/.virtualenvs/django_pod/bin/python manage.py live_viewcounter --settings=pod.custom.tenants.$NAME."$NAME"_settings &>> /usr/local/django_projects/podv3/pod/log/cron_viewcounter_$NAME.log 2>&1" >> $BASEDIR/live_viewcounter.sh

echo "FIN"
12 changes: 6 additions & 6 deletions pod/custom/tenants/source/pod_nginx_tenant.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# the upstream component nginx needs to connect to
upstream django___NAME__ {
# server unix:///path/to/your/mysite/mysite.sock; # for a file socket
server unix:///home/pod/django_projects/podv2/podv2___NAME__.sock;
server unix:///home/pod/django_projects/podv3/podv3___NAME__.sock;
# server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}

Expand Down Expand Up @@ -55,20 +55,20 @@ server {
add_header Cache-Control "public";
gzip on;
gzip_types text/vtt;
alias /usr/local/django_projects/podv2/pod/media; # your Django project's media files - amend as required
alias /usr/local/django_projects/podv3/pod/media; # your Django project's media files - amend as required
}
#location /media {
# alias /home/pod/django_projects/podv2/pod/media; # your Django project's media files - amend as required
# alias /home/pod/django_projects/podv3/pod/media; # your Django project's media files - amend as required
#}
location /static {
expires 1y;
add_header Cache-Control "public";
gzip_static on;
gzip_types text/plain application/xml text/css text/javascript application/javascript image/svg+xml;
alias /usr/local/django_projects/podv2/pod/static; # your Django project's static files - amend as required
alias /usr/local/django_projects/podv3/pod/static; # your Django project's static files - amend as required
}
#location /static {
# alias /home/pod/django_projects/podv2/pod/static; # your Django project's static files - amend as required
# alias /home/pod/django_projects/podv3/pod/static; # your Django project's static files - amend as required
#}
location /shibboleth-sp {
alias /usr/share/shibboleth;
Expand All @@ -79,7 +79,7 @@ server {
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django___NAME__;
include /home/pod/django_projects/podv2/uwsgi_params; # the uwsgi_params file you installed
include /home/pod/django_projects/podv3/uwsgi_params; # the uwsgi_params file you installed
track_uploads uploadp 30s;
}
}
6 changes: 3 additions & 3 deletions pod/custom/tenants/source/pod_uwsgi_tenant.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Django-related settings
# the base directory (full path)
chdir = /home/pod/django_projects/podv2
chdir = /home/pod/django_projects/podv3
# Django's wsgi file
module = pod.wsgi
# the virtualenv (full path)
Expand All @@ -14,7 +14,7 @@ master = true
# maximum number of worker processes
processes = 10
# the socket (use the full path to be safe
socket = /home/pod/django_projects/podv2/podv2___NAME__.sock
socket = /home/pod/django_projects/podv3/podv3___NAME__.sock
# http = :8000
# ... with appropriate permissions - may be needed
chmod-socket = 666
Expand All @@ -24,7 +24,7 @@ env = DJANGO_SETTINGS_MODULE=pod.custom.tenants.__NAME__.__NAME___se

#
#
logger = file:logfile=/usr/local/django_projects/podv2/pod/log/uwsgi-pod___NAME__.log,maxsize=2000000
logger = file:logfile=/usr/local/django_projects/podv3/pod/log/uwsgi-pod___NAME__.log,maxsize=2000000
die-on-term = true
limit-as = 5120
max-requests = 5000
Expand Down
2 changes: 1 addition & 1 deletion pod/custom/tenants/source/uwsgi-pod_tenant.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=Pod uWSGI app __NAME__
After=syslog.target

[Service]
ExecStart=/usr/local/bin/uwsgi --ini /usr/local/django_projects/podv2/pod/custom/tenants/__NAME__/pod_uwsgi___NAME__.ini \
ExecStart=/usr/local/bin/uwsgi --ini /usr/local/django_projects/podv3/pod/custom/tenants/__NAME__/pod_uwsgi___NAME__.ini \
--enable-threads \
--pidfile /tmp/pod___NAME__.pid
ExecStop=/usr/local/bin/uwsgi --stop /tmp/pod___NAME__.pid
Expand Down
2 changes: 1 addition & 1 deletion pod/custom/tenants/source_enc/celeryd-tenant
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CELERYD_NODES="worker1__NAME__" #
DJANGO_SETTINGS_MODULE="pod.custom.tenants.__NAME__.__NAME___enc_settings" # settings de votre Pod
CELERY_BIN="/home/pod/.virtualenvs/django_pod/bin/celery" # répertoire source de celery
CELERY_APP="pod.custom.tenants.__NAME__" # application où se situe celery
CELERYD_CHDIR="/usr/local/django_projects/podv2" # répertoire du projet Pod (où se trouve manage.py)
CELERYD_CHDIR="/usr/local/django_projects/podv3" # répertoire du projet Pod (où se trouve manage.py)
CELERYD_OPTS="--time-limit=86400 --concurrency=1 --maxtasksperchild=1" # options à appliquer en plus sur le comportement du/des worker(s)
CELERYD_LOG_FILE="/var/log/celery/%N.log" # fichier log
CELERYD_PID_FILE="/var/run/celery/%N.pid" # fichier pid
Expand Down
2 changes: 1 addition & 1 deletion pod/live/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LiveViewsTestCase(TestCase):
]

def setUp(self):
user = User.objects.create(username="pod", password="podv2")
user = User.objects.create(username="pod", password="podv3")
building = Building.objects.create(name="bulding1")
if FILEPICKER:
homedir, created = UserFolder.objects.get_or_create(name="Home", owner=user)
Expand Down
3 changes: 3 additions & 0 deletions pod/main/static/css/pod.css
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,8 @@ body {
border: 0;
margin-right: 1.5rem;
background: none;
width:2.5rem;
height: 2.5rem;
}

.pod-navbar__nav-item__nav-link--add-video {
Expand Down Expand Up @@ -1402,3 +1404,4 @@ body {
#login-form label{
min-width: 9rem;
}

10 changes: 5 additions & 5 deletions pod/main/templates/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ <h5 class="offcanvas-title" id="pod-navbar__menuLabel">Menu</h5>
{% if HIDE_CHANNEL_TAB == False %}
<li class="nav-item pod-navbar__nav-item" id="nav-channels">
<button class="nav-link pod-dropdown-item" data-bs-toggle="modal" data-bs-target=".chaines-modal">
<i class="bi bi-youtube pod-nav-link-icon"></i> {% trans "Channels" %}</button>
<i class="bi bi-play-btn pod-nav-link-icon"></i> {% trans "Channels" %}</button> <!-- Changed icon to a fineline one-->
</li>
{% for add_channel_tab in ADD_CHANNELS_TAB %}
<li class="nav-item add-nav-channels pod-navbar__nav-item">
<button class="nav-link pod-dropdown-item " data-bs-toggle="modal" data-bs-target=".chaines-modal-{{add_channel_tab.id}}"><i class="bi bi-youtube pod-nav-link-icon"></i> {{ add_channel_tab.name }}</button>
</li>
<button class="nav-link pod-dropdown-item " data-bs-toggle="modal" data-bs-target=".chaines-modal-{{add_channel_tab.id}}"><i class="bi bi-play-btn pod-nav-link-icon"></i> {{ add_channel_tab.name }}</button>
</li> <!-- Changed icon to a fineline one-->
{% endfor %}
{% endif %}
{% if HIDE_USER_TAB == False and user.is_authenticated %}
Expand Down Expand Up @@ -83,7 +83,7 @@ <h5 class="offcanvas-title" id="pod-navbar__menuLabel">Menu</h5>
{%endif%}
<!-- Ajout Params Buttons -->
<li class="nav-item pod-params pod-navbar__nav-item" id="pod-param-buttons">
<button class="btn bi bi-gear-fill pod-params-button" type="button"
<button class="btn bi bi-gear pod-params-button" type="button"
id="pod-param-buttons__button" title="{% trans 'Toggle configuration panel'%}"
data-bs-toggle="offcanvas" data-bs-target="#pod-navbar__menusettings">
</button>
Expand Down Expand Up @@ -198,7 +198,7 @@ <h5 id="pod-navbar__menuuserLabel">{% if user.get_full_name != '' %}{{ user.get_
</a>
{% endif %}
{% if request.user.owners_channels.all %}
<a class="dropdown-item pod-dropdown-item" href="{% url 'channels:my_channels' %}"><i class="bi bi-youtube pod-nav-link-icon d-lg-none d-xl-inline mx-1" aria-hidden="true"></i>{% trans 'My channels' %}</a>
<a class="dropdown-item pod-dropdown-item" href="{% url 'channels:my_channels' %}"><i class="bi bi-play-btn pod-nav-link-icon d-lg-none d-xl-inline mx-1" aria-hidden="true"></i>{% trans 'My channels' %}</a>
{% endif %}
<a class="dropdown-item pod-dropdown-item" href="{% url 'playlist:my_playlists' %}"><i class="bi bi-cast pod-nav-link-icon d-lg-none d-xl-inline mx-1" aria-hidden="true"></i>{% trans 'My playlists' %}</a>
{% if request.user.is_staff and USE_PODFILE %}
Expand Down
4 changes: 2 additions & 2 deletions pod/main/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MainViewsTestCase(TestCase):

def setUp(self):
"""Create fictive user who will make tests."""
User.objects.create(username="pod", password="podv2")
User.objects.create(username="pod", password="podv3")
print(" ---> SetUp of MainViewsTestCase: OK!")

@override_settings(MEDIA_ROOT=tempfile.gettempdir())
Expand Down Expand Up @@ -112,7 +112,7 @@ class MaintenanceViewsTestCase(TestCase):
]

def setUp(self):
User.objects.create(username="pod", password="podv2")
User.objects.create(username="pod", password="podv3")

def test_maintenance(self):
"""Test Pod maintenance mode."""
Expand Down
2 changes: 0 additions & 2 deletions pod/recorder/plugins/type_studio.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ def generate_intermediate_video(recording, videos, clip_begin, clip_end, present
# Video file output : at the same directory than the XML file
# And with the same name .mp4
video_output = recording.source_file.replace(".xml", ".mp4")
# video_output :
# /usr/local/django_projects/podv2-dev/pod/media/opencast-files/file.mp4
subtime = get_subtime(clip_begin, clip_end)
encode_studio = getattr(encode, ENCODE_STUDIO)
encode_studio(recording.id, video_output, videos, subtime, presenter)
Expand Down
2 changes: 1 addition & 1 deletion pod/recorder/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class recorderViewsTestCase(TestCase):
def setUp(self):
site = Site.objects.get(id=1)
videotype = Type.objects.create(title="others")
user = User.objects.create(username="pod", password="podv2")
user = User.objects.create(username="pod", password="podv3")
recorder = Recorder.objects.create(
id=1,
user=user,
Expand Down
2 changes: 1 addition & 1 deletion pod/video/management/commands/bbb.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
Example: crontab -e */2 * * * * /usr/bin/bash -c 'export
WORKON_HOME=/data/www/%userpod%/.virtualenvs; export
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.6; cd
/data/www/%userpod%/django_projects/podv2; source
/data/www/%userpod%/django_projects/podv3; source
/usr/bin/virtualenvwrapper.sh; workon django_pod; python manage.py bbb
main' """
import os
Expand Down
2 changes: 1 addition & 1 deletion pod/video/management/commands/import_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

AUTHENTICATION = True if apps.is_installed("pod.authentication") else False

BASE_DIR = getattr(settings, "BASE_DIR", "/home/pod/django_projects/podv2/pod")
BASE_DIR = getattr(settings, "BASE_DIR", "/home/pod/django_projects/podv3/pod")

VIDEO_ID_TO_EXCLUDE = getattr(settings, "VIDEO_ID_TO_EXCLUDE", [])

Expand Down
2 changes: 1 addition & 1 deletion pod/video/management/commands/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
Example : crontab -e */5 * * * * /usr/bin/bash -c '
export WORKON_HOME=/data/www/%userpod%/.virtualenvs;
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.6;
cd /data/www/%userpod%/django_projects/podv2;
cd /data/www/%userpod%/django_projects/podv3;
source /usr/bin/virtualenvwrapper.sh; workon django_pod;
python manage.py recorder checkDirectory'
"""
Expand Down
2 changes: 1 addition & 1 deletion pod/video_search/readme
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ $>root@Pod:/etc/elasticsearch# vim elasticsearch.yml
?? Use Cerebro : https://github.com/lmenezes/cerebro

To create pod index :
(django_pod) pod@Pod:~/django_projects/podv2$ python manage.py create_pod_index
(django_pod) pod@Pod:~/django_projects/podv3$ python manage.py create_pod_index
To delete pod index :
$>curl -XDELETE 127.0.0.1:9200/pod
8 changes: 4 additions & 4 deletions pod_nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# the upstream component nginx needs to connect to
upstream django {
# server unix:///path/to/your/mysite/mysite.sock; # for a file socket
server unix://django_projects/podv2/podv2.sock;
server unix://django_projects/podv3/podv3.sock;
# server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}

Expand Down Expand Up @@ -42,21 +42,21 @@ server {
add_header Cache-Control "public";
gzip on;
gzip_types text/vtt;
alias /usr/local/django_projects/podv2/pod/media; # your Django project's media files - amend as required
alias /usr/local/django_projects/podv3/pod/media; # your Django project's media files - amend as required
}

location /static {
expires 1y;
add_header Cache-Control "public";
gzip_static on;
gzip_types text/plain application/xml text/css text/javascript application/javascript image/svg+xml;
alias /usr/local/django_projects/podv2/pod/static; # your Django project's static files - amend as required
alias /usr/local/django_projects/podv3/pod/static; # your Django project's static files - amend as required
}

# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django;
include /usr/local/django_projects/podv2/uwsgi_params; # the uwsgi_params file you installed
include /usr/local/django_projects/podv3/uwsgi_params; # the uwsgi_params file you installed
track_uploads uploadp 30s;
}
}
4 changes: 2 additions & 2 deletions pod_uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Django-related settings
# the base directory (full path)
chdir = /home/pod/django_projects/podv2
chdir = /home/pod/django_projects/podv3
# Django's wsgi file
module = pod.wsgi
# the virtualenv (full path)
Expand All @@ -14,7 +14,7 @@ master = true
# maximum number of worker processes
processes = 10
# the socket (use the full path to be safe
socket = /home/pod/django_projects/podv2/podv2.sock
socket = /home/pod/django_projects/podv3/podv3.sock
# http = :8000
# ... with appropriate permissions - may be needed
chmod-socket = 666
Expand Down

0 comments on commit 66e6de8

Please sign in to comment.