From 1195c3b388ca2f0e4228a013683bd437e5c8446a Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Wed, 21 Oct 2015 23:23:55 +0200 Subject: [PATCH] update to new config of the ICP media server --- deploy/cron.rule | 1 + deploy/nginx.conf | 40 ++++++++++++++++++++++++ deploy/stream.conf | 74 ++++++++++++++++++++++++++++++++++++++++++++ deploy/tc_import.sh | 8 +++++ deploy/uwsgi.ini | 27 ++++++++++++++++ settings.py | 31 ++++++++++--------- settings.pyc | Bin 5937 -> 5858 bytes update_static.sh | 3 ++ urls.py | 4 +-- wsgi.py | 2 +- 10 files changed, 172 insertions(+), 18 deletions(-) create mode 100644 deploy/cron.rule create mode 100644 deploy/nginx.conf create mode 100644 deploy/stream.conf create mode 100755 deploy/tc_import.sh create mode 100644 deploy/uwsgi.ini create mode 100755 update_static.sh diff --git a/deploy/cron.rule b/deploy/cron.rule new file mode 100644 index 0000000..29d95df --- /dev/null +++ b/deploy/cron.rule @@ -0,0 +1 @@ +0 */3 * * * parisson ~/tc/instance/deploy/tc_import.sh diff --git a/deploy/nginx.conf b/deploy/nginx.conf new file mode 100644 index 0000000..fc25423 --- /dev/null +++ b/deploy/nginx.conf @@ -0,0 +1,40 @@ +# the upstream component nginx needs to connect to +upstream teleforma { + server unix:///run/uwsgi/app/teleforma/socket; # for a file socket + #server 127.0.0.1:9500; # for a web port socket (we'll use this first) + } + +server { + # the port your site will be served on + listen 80; + # the domain name it will serve for + server_name srvpodcast.icp.fr; # substitute your machine's IP address or FQDN + charset utf-8; + + # max upload size + client_max_body_size 75M; # adjust to taste + + # Django media + location /media/ { + alias /media/podcast/; # your Django project's media files - amend as required + autoindex on; + } + + location /static/ { + alias /var/www/static/; # your Django project's static files - amend as required +# autoindex on; + } + + # Finally, send all non-media requests to the Django server. + location / { + uwsgi_pass teleforma; + include /etc/nginx/uwsgi_params; # the uwsgi_params file you installed + #uwsgi_pass_request_body on; + } + + error_log /var/log/nginx/teleforma-error.log; + access_log /var/log/nginx/teleforma-access.log; + + +} + diff --git a/deploy/stream.conf b/deploy/stream.conf new file mode 100644 index 0000000..9b5efa4 --- /dev/null +++ b/deploy/stream.conf @@ -0,0 +1,74 @@ + +# server.bindAddress +# example: 127.0.0.1, 192.168.1.1 +# localhost. www.example.com also work +#server.bindAddress = 192.168.0.12 + +# server.port +# listening port +server.port=8080 + +streams.safe=true +streams.safe.password=source2parisson +streams.safe.limit=100 + +streams.monitor=true +streams.monitor.password=source2parisson +streams.monitor.limit=100 + + +streams.icp-ca23103080-14-cours=true +streams.icp-ca23103080-14-cours.password=source2parisson +streams.icp-ca23103080-14-cours.limit=1000 + +streams.icp-ca23103073-14-cours=true +streams.icp-ca23103073-14-cours.password=source2parisson +streams.icp-ca23103073-14-cours.limit=1000 + +streams.icp-ca23103074-14-cours=true +streams.icp-ca23103074-14-cours.password=source2parisson +streams.icp-ca23103074-14-cours.limit=1000 + +streams.icp-ca23203099-14-cours=true +streams.icp-ca23203099-14-cours.password=source2parisson +streams.icp-ca23203099-14-cours.limit=1000 + +streams.icp-ca23203100-14-cours=true +streams.icp-ca23203100-14-cours.password=source2parisson +streams.icp-ca23203100-14-cours.limit=1000 + +streams.icp-ca23103073-13-cours=true +streams.icp-ca23103073-13-cours.password=source2parisson +streams.icp-ca23103073-13-cours.limit=1000 + +streams.icp-ca23103074-13-cours=true +streams.icp-ca23103074-13-cours.password=source2parisson +streams.icp-ca23103074-13-cours.limit=1000 + +streams.icp-ca23103072-13-cours=true +streams.icp-ca23103072-13-cours.password=source2parisson +streams.icp-ca23103072-13-cours.limit=1000 + +streams.icp-ca23203092-13-cours=true +streams.icp-ca23203092-13-cours.password=source2parisson +streams.icp-ca23203092-13-cours.limit=1000 + +streams.icp-test-cours=true +streams.icp-test-cours.password=source2parisson +streams.icp-test-cours.limit=1000 + +streams.icp-ca23103045-15-cours=true +streams.icp-ca23103045-15-cours.password=source2parisson +streams.icp-ca23103045-15-cours.limit=1000 + +streams.icp-ca23103065-15-cours=true +streams.icp-ca23103065-15-cours.password=source2parisson +streams.icp-ca23103065-15-cours.limit=1000 + +streams.icp-ca23103044-15-cours=true +streams.icp-ca23103044-15-cours.password=source2parisson +streams.icp-ca23103044-15-cours.limit=1000 + +streams.icp-ca23103053-15-cours=true +streams.icp-ca23103053-15-cours.password=source2parisson +streams.icp-ca23103053-15-cours.limit=1000 diff --git a/deploy/tc_import.sh b/deploy/tc_import.sh new file mode 100755 index 0000000..11c5ad6 --- /dev/null +++ b/deploy/tc_import.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +media_dir=/media/podcast/ICP/ +media_tmp=/tmp/ + +python ~/tc/telemeta/tools/scripts/transcode/remux_fix_media.py $media_dir $media_tmp >> ~/log/remux.log +python ~/tc/telemeta/tools/scripts/transcode/transcode.py $media_dir ~/log/transcode.log +python ~/tc/instance/manage.py teleforma-import-conferences-2 ICP ~/log/import.log diff --git a/deploy/uwsgi.ini b/deploy/uwsgi.ini new file mode 100644 index 0000000..175c692 --- /dev/null +++ b/deploy/uwsgi.ini @@ -0,0 +1,27 @@ +# mysite_uwsgi.ini file +[uwsgi] + +projectdomain = srvpodcast.icp.fr + +# Django-related settings +# the base directory (full path) +chdir = /home/parisson/tc/instance/ +# Django's wsgi file +module = wsgi +# the virtualenv (full path) +#home = /home/parisson/teleforma/ + +# process-related settings +# master +master = true +# maximum number of worker processes +processes = 4 +## the socket (use the full path to be safe +#socket = /tmp/tc.sock +# ... with appropriate permissions - may be needed +chmod-socket = 664 +# clear environment on exit +vacuum = true +buffer-size = 65535 +limit-post = 8192000000 +touch-reload = /home/parisson/tc/instance/wsgi.py diff --git a/settings.py b/settings.py index 47d02f6..46835db 100644 --- a/settings.py +++ b/settings.py @@ -22,7 +22,7 @@ DATABASES = { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'teleforma', # Or path to database file if using sqlite3. 'USER': 'teleforma', # Not used with sqlite3. - 'PASSWORD': 'Lashjium5', # Not used with sqlite3. + 'PASSWORD': 'feryisBesh6', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. } @@ -56,12 +56,12 @@ USE_L10N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = '/home/telecaster/archives/' +MEDIA_ROOT = '/media/podcast/' # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" -MEDIA_URL = 'http://192.168.1.65:8040/' +MEDIA_URL = 'http://srvpodcast.icp.fr/media/' # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files @@ -108,6 +108,7 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.locale.LocaleMiddleware', 'pagination.middleware.PaginationMiddleware', + 'teleforma.middleware.XsSharing', ) ROOT_URLCONF = 'urls' @@ -116,7 +117,7 @@ TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. - '/usr/local/lib/telecaster/teleforma/teleforma/templates' + '/home/parisson/tc/teleforma/teleforma/templates' ) INSTALLED_APPS = ( @@ -140,7 +141,7 @@ INSTALLED_APPS = ( 'timezones', 'jqchat', # 'googletools', - 'telecaster', +# 'telecaster', ) TEMPLATE_CONTEXT_PROCESSORS = ( @@ -151,12 +152,12 @@ TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.media", 'django.core.context_processors.static', 'teleforma.context_processors.periods', - 'telecaster.context_processors.host', +# 'telecaster.context_processors.host', ) -TELEMETA_ORGANIZATION = 'Pre-Barreau' -TELEMETA_SUBJECTS = ('barreau', 'crfpa', 'e-learning') -TELEMETA_DESCRIPTION = "Plateforme e-learning du CRFPA" +TELEMETA_ORGANIZATION = 'ICP' +TELEMETA_SUBJECTS = ('institut', 'catholique', 'paris', 'e-learning') +TELEMETA_DESCRIPTION = "D01" TELEMETA_GMAP_KEY = 'ABQIAAAArg7eSfnfTkBRma8glnGrlxRVbMrhnNNvToCbZQtWdaMbZTA_3RRGObu5PDoiBImgalVnnLU2yN4RMA' TELEMETA_CACHE_DIR = MEDIA_ROOT + 'cache' TELEMETA_EXPORT_CACHE_DIR = TELEMETA_CACHE_DIR + "/export" @@ -174,15 +175,15 @@ LOGIN_URL = '/login/' LOGIN_REDIRECT_URL = reverse_lazy('teleforma-desk') SESSION_EXPIRE_AT_BROWSER_CLOSE = False -EMAIL_HOST = 'smtp.free.fr' +EMAIL_HOST = 'smtp.icp.fr' DEFAULT_FROM_EMAIL = 'webmaster@parisson.com' SERVER_EMAIL = 'webmaster@parisson.com' EMAIL_SUBJECT_PREFIX = '[' + TELEMETA_ORGANIZATION.decode('utf8') + '] ' POSTMAN_AUTO_MODERATE_AS = True -TELECASTER_MASTER_SERVER = 'teleforma.parisson.com' -TELECASTER_RSYNC_SERVER = 'telecaster@jimi.parisson.com:archives/' +TELECASTER_MASTER_SERVER = '10.10.253.15' +TELECASTER_RSYNC_SERVER = 'parisson@10.10.253.15:archives/' TELECASTER_RSYNC_LOG = '/var/log/telecaster/rsync.log' TELECASTER_CONF = [{'type':'mp3','server_type':'icecast', 'conf':'/etc/telecaster/deefuzzer/telecaster_mp3_default.xml', @@ -192,9 +193,9 @@ TELECASTER_CONF = [{'type':'mp3','server_type':'icecast', 'port':'8080'}, ] TELEFORMA_E_LEARNING_TYPE = 'CRFPA' -TELEFORMA_GLOBAL_TWEETER = False -TELEFORMA_PERIOD_TWEETER = True +TELEFORMA_GLOBAL_TWEETER = True +TELEFORMA_PERIOD_TWEETER = False -ROUTER_IP = '81.57.221.26' +ROUTER_IP = '46.218.185.235' diff --git a/settings.pyc b/settings.pyc index 0eb2148799e37df310d486f9ff2103be1c8c817a..50523b83671c6f82297eea4adff17cee1fc95b55 100644 GIT binary patch delta 629 zcma)2%Wl&^6rFJ#r=%@u6Jc6j1zHt@+Hswd$gqN@ETD@e>7DhhA!72 zeSDEGz~$@^IPK0ZaXOQ+e`&k*XXVYuIzD|8=-0cX?YP8oJEXnavD8DdueHm@!aUZM zZn<1tDZ7h@_}YJXW3`}zx8&`rDKq1(JZRjjS~b8XhV(3D-Qb)G=T%T<^S{TQC>UH; v)pZD#a$&Hc!W1j5^kAC7 delta 645 zcmaJ;zi-n(6uxtuG(Q?8gfuiMMQMk|s+x0cNSd|_g^B?oHDt6{uJ#4Hvg7pb%)rjZ zf^G&O^)HCLBQYcOj{qbF#*Qr9DUsR^a3?*z_kG{{?&;n4?hMs3SLI^i{m+*!Se*KY z+OK8@IIF-jfYSutIdEFQqrh1M-f>!kdAPI#oP9uav7vn{7i8ZH%>1(;iF)FX79O@F zV)}7JOin`LV#WzIF?Idm4Php0O4{dqdSIH?zKyK@09mNtI~eRf+D$)Z&b1ELr6i#t zV|&UfVbly`7l&pToZj$Ehq<@#4lhd0^+Rk+oK!b2K38CcZQf#pm9M|@W5!uY;zLTh zPcWqfCwxiPr;9u*bC-^%m?>Y<4GE@`VDg$hP)#A`WE|6ow6B@Am$aXbo(+%EhXoCm zm!*zHe2T`D5OGv&9X2GQ22_n0O)(7^izmp9Beu1m=1Y2f7DT}c=2-fpdZn);3H