From a1123725cc5f25c74abdde28838b44bf7d3e0c50 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 11 May 2021 09:51:29 +0200 Subject: [PATCH] update docker env --- .gitmodules | 3 + Dockerfile | 18 ++- app/__init__.py | 21 +++ app/local_settings.py.sample | 76 +++++++++ app/manage.py | 26 +++- app/settings.py | 292 +++++++++++++++++++---------------- app/urls.py | 8 +- app/wsgi.py | 31 +++- bin | 1 + docker-compose.yml | 79 +++------- requirements-1.3.txt | 52 +++++-- requirements-debian.txt | 9 +- requirements-dev.txt | 4 +- requirements.txt | 19 +-- 14 files changed, 399 insertions(+), 240 deletions(-) create mode 100644 app/local_settings.py.sample create mode 160000 bin diff --git a/.gitmodules b/.gitmodules index e69de29b..5d9a988f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "bin"] + path = bin + url = https://github.com/Ircam-Web/mezzo-bin.git diff --git a/Dockerfile b/Dockerfile index 3db02d4a..eb989980 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,8 +21,7 @@ MAINTAINER Guillaume Pellerin ENV PYTHONUNBUFFERED 1 RUN mkdir -p /srv/app -RUN mkdir -p /srv/lib/ -RUN mkdir -p /srv/lib/telemeta +RUN mkdir -p /srv/lib/teleforma WORKDIR /srv @@ -40,15 +39,18 @@ ENV LANG fr_FR.UTF-8 ENV LANGUAGE fr_FR:fr ENV LC_ALL fr_FR.UTF-8 -RUN pip install cython -RUN mkdir -p /srv/lib/teleforma -COPY . /srv/lib/teleforma -WORKDIR /srv/lib/teleforma -RUN pip install -r requirements.txt - COPY requirements-dev.txt /srv RUN pip install -r requirements-dev.txt --src /srv/lib +COPY requirements.txt /srv +RUN pip install -r requirements.txt + +WORKDIR /srv/lib/teleforma +COPY setup.py /srv/lib/teleforma +COPY teleforma /srv/lib/teleforma +COPY README.rst /srv/lib/teleforma +RUN python setup.py develop + WORKDIR /srv/app EXPOSE 8000 diff --git a/app/__init__.py b/app/__init__.py index e69de29b..12176181 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2016-2017 Ircam +# Copyright (c) 2016-2017 Guillaume Pellerin +# Copyright (c) 2016-2017 Emilie Zawadzki + +# This file is part of mezzanine-organization. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. + +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + diff --git a/app/local_settings.py.sample b/app/local_settings.py.sample new file mode 100644 index 00000000..054934a0 --- /dev/null +++ b/app/local_settings.py.sample @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2016-2017 Ircam +# Copyright (c) 2016-2017 Guillaume Pellerin +# Copyright (c) 2016-2017 Emilie Zawadzki + +# This file is part of mezzanine-organization. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. + +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import os +from django.utils.translation import ugettext_lazy as _ +from datetime import datetime, date + +DEBUG = True if os.environ.get('DEBUG') == 'True' else False + +# -*- coding: utf-8 -*- +# +# Copyright (c) 2016-2017 Ircam +# Copyright (c) 2016-2017 Guillaume Pellerin +# Copyright (c) 2016-2017 Emilie Zawadzki + +# This file is part of mezzanine-organization. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. + +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import os +from django.utils.translation import ugettext_lazy as _ +from datetime import datetime, date + +DEBUG = True if os.environ.get('DEBUG') == 'True' else False + +ADMINS = ( + ('Your Name', 'contact@you.org'), +) + +# Make these unique, and don't share it with anybody. +SECRET_KEY = "H7665jhuyUTGuhuUYT6è-ertyezçuàçi'09Iikrpokfàçir" +NEVERCACHE_KEY = "87654RFGhju7665rdfGyuàiPOpkM;?NbGFr'(3(ezrTYuiJK" + +EMAIL_HOST = 'localhost' # please specify your smtp server address +EMAIL_PORT = '25' +SERVER_EMAIL = 'no-reply@no-reply.org' # a no reply address +DEFAULT_FROM_EMAIL = 'default@default.org' # another address, default one +DEFAULT_TO_EMAIL = 'recipient@recipient.org' # default recipient, for your tests +EMAIL_SUBJECT_PREFIX = "[PREFIX]" # prefix title in email +SITE_TITLE = 'Your Site' +SITE_TAGLINE = 'This is a Mezzo site' + +AUTHENTICATION_BACKENDS = ( + # "organization.core.backend.OrganizationLDAPBackend", + "mezzanine.core.auth_backends.MezzanineBackend", + "guardian.backends.ObjectPermissionBackend", +) diff --git a/app/manage.py b/app/manage.py index c632a8a3..46e20ddd 100755 --- a/app/manage.py +++ b/app/manage.py @@ -1,9 +1,29 @@ #!/usr/bin/env python -import os, sys +# -*- coding: utf-8 -*- +# +# Copyright (c) 2016-2017 Ircam +# Copyright (c) 2016-2017 Guillaume Pellerin +# Copyright (c) 2016-2017 Emilie Zawadzki + +# This file is part of mezzanine-organization. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. + +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import os +import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") - from django.core.management import execute_from_command_line - execute_from_command_line(sys.argv) diff --git a/app/settings.py b/app/settings.py index fce72cbe..c2aa29e1 100644 --- a/app/settings.py +++ b/app/settings.py @@ -8,30 +8,29 @@ import environ sys.dont_write_bytecode = True -env = environ.Env(DEBUG=(bool, False), - CELERY_ALWAYS_EAGER=(bool, False), - ) - -# Django settings for server project. -DEBUG = env('DEBUG') # False if not in os.environ +DEBUG = False TEMPLATE_DEBUG = DEBUG -ALLOWED_HOSTS = ['*'] +import warnings +warnings.showwarning = lambda *x: None ADMINS = ( ('Guillaume Pellerin', 'webmaster@parisson.com'), + ('Gael le Mignot', 'gael@pilotsystems.net'), +# ('Admin CRFPA', 'admin-crfpa@pre-barreau.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { - 'ENGINE': env('ENGINE'), # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. - 'USER': env('MYSQL_USER'), # Not used with sqlite3. - 'PASSWORD': env('MYSQL_PASSWORD'), # Not used with sqlite3. - 'NAME': env('MYSQL_DATABASE'), - 'HOST': 'db', # Set to empty string for localhost. Not used with sqlite3. - 'PORT': '3306', # Set to empty string for default. Not used with sqlite3. + 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': 'teleforma_crfpa', # Or path to database file if using sqlite3. + 'USER': 'teleforma', # Not used with sqlite3. + 'PASSWORD': '8ShaqueWrac', # Not used with sqlite3. + 'HOST': 'db', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '', # Set to empty string for default. Not used with sqlite3. + 'OPTIONS' : { 'init_command' : 'SET storage_engine=InnoDB', }, } } @@ -46,7 +45,7 @@ TIME_ZONE = 'Europe/Paris' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html -#LANGUAGE_CODE = 'fr_FR' +LANGUAGE_CODE = 'fr_FR' LANGUAGES = [ ('fr', 'French'), ('en', 'English'), ] @@ -63,21 +62,19 @@ USE_L10N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media/') - -if not os.path.exists(MEDIA_ROOT): - os.mkdir(MEDIA_ROOT) +MEDIA_ROOT = '/srv/crfpa/var/media/' # 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://localhost:8040/' +#MEDIA_URL = 'http://pre-barreau.com/archives/' +MEDIA_URL = '/media/' # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/home/media/media.lawrence.com/static/" -STATIC_ROOT = '/var/www/static/' +STATIC_ROOT = '/srv/crfpa/var/static/' # URL prefix for static files. # Example: "http://media.lawrence.com/static/" @@ -102,12 +99,12 @@ STATICFILES_FINDERS = ( SECRET_KEY = 'a8l7%06wr2k+3=%#*#@#rvop2mmzko)44%7k(zx%lls^ihm9^5' # List of callables that know how to import templates from various sources. -#TEMPLATE_LOADERS = ( -# ('django.template.loaders.cached.Loader', ( -# 'django.template.loaders.filesystem.Loader', -# 'django.template.loaders.app_directories.Loader', -# )), -#) +TEMPLATE_LOADERS = ( + ('django.template.loaders.cached.Loader', ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + )), +) MIDDLEWARE_CLASSES = ( @@ -118,18 +115,21 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.locale.LocaleMiddleware', 'pagination.middleware.PaginationMiddleware', + 'teleforma.middleware.XsSharing', + 'django_user_agents.middleware.UserAgentMiddleware', ) ROOT_URLCONF = 'urls' -TEMPLATE_DIRS = ( +#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. - '/home/momo/dev/teleforma/teleforma/teleforma/templates/', -) +# '/var/teleforma/crfpa/lib/teleforma-crfpa/teleforma/templates/', +#) INSTALLED_APPS = ( + 'suit', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', @@ -137,10 +137,13 @@ INSTALLED_APPS = ( 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', + 'teleforma', + 'teleforma.webclass', 'telemeta', 'jsonrpc', - # 'south', 'teleforma', + 'south', + 'teleforma.exam', 'sorl.thumbnail', 'django_extensions', 'pagination', @@ -151,106 +154,41 @@ INSTALLED_APPS = ( # 'jquery', 'timezones', 'jqchat', - # 'follow', - # 'googletools', - 'telecaster', +# 'follow', + 'googletools', +# 'devserver', + #'timeside', + 'extra_views', + 'captcha', + 'django_nvd3', + 'bootstrap3', + 'bootstrap_pagination', + 'django_user_agents', + 'tinymce', 'multichoice', 'true_false', 'essay', 'quiz', + 'unique_session', + #'webviewer', + 'pdfannotator', + 'captcha', ) TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', 'django.contrib.auth.context_processors.auth', + "django.contrib.messages.context_processors.messages", 'postman.context_processors.inbox', - "django.core.context_processors.i18n", - "django.core.context_processors.media", + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', 'django.core.context_processors.static', - "teleforma.context_processors.periods", + 'teleforma.context_processors.periods', ) -BROKER_URL = env('BROKER_URL') -CELERY_IMPORTS = ("timeside.server.tasks",) -CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend' -CELERY_TASK_SERIALIZER = 'json' -CELERY_RESULT_SERIALIZER = 'json' -CELERY_ACCEPT_CONTENT = ['application/json'] - -from worker import app - -HAYSTACK_CONNECTIONS = { - 'default': { - #'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', - 'ENGINE': 'telemeta.util.backend.CustomElasticEngine', - 'URL': env('HAYSTACK_URL'), - 'INDEX_NAME': env('HAYSTACK_INDEX_NAME'), - 'INLUDE_SPELLING': True, - 'EXCLUDED_INDEXES': ['telemeta.search_indexes.LocationIndex', - 'telemeta.search_indexes.LocationAliasIndex', - 'telemeta.search_indexes.InstrumentIndex', - 'telemeta.search_indexes.InstrumentAliasIndex' - ] - }, - 'autocomplete': { - # 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', - 'ENGINE': 'telemeta.util.backend.CustomElasticEngine', - 'URL': env('HAYSTACK_URL'), - 'INDEX_NAME': env('HAYSTACK_INDEX_NAME_AUTOCOMPLETE'), - 'INLUDE_SPELLING': True, - 'EXCLUDED_INDEXES': ['telemeta.search_indexes.MediaItemIndex', - 'telemeta.search_indexes.MediaCollectionIndex', - 'telemeta.search_indexes.MediaCorpusIndex', - 'telemeta.search_indexes.MediaFondsIndex' - ] - }, -} - -HAYSTACK_ROUTERS = ['telemeta.util.search_router.AutoRouter', 'haystack.routers.DefaultRouter'] -# HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' -HAYSTACK_SIGNAL_PROCESSOR = 'telemeta.util.search_signals.RealTimeCustomSignal' -HAYSTACK_SEARCH_RESULTS_PER_PAGE = 50 - -BOWER_COMPONENTS_ROOT = '/srv/bower/' -BOWER_PATH = '/usr/local/bin/bower' -BOWER_INSTALLED_APPS = ( - 'jquery#2.2.4', - 'jquery-migrate#~1.2.1', - 'underscore#1.8.3', - 'bootstrap#3.3.7', - 'bootstrap-select#1.5.4', - 'font-awesome#4.4.0', - 'angular#1.2.26', - 'angular-bootstrap-select#0.0.5', - 'angular-resource#1.2.26', - 'raphael#2.2.7', - 'soundmanager#V2.97a.20150601', - 'jquery-ui#1.11.4', - 'tablesorter', - 'video.js', - 'sass-bootstrap-glyphicons', - # 'https://github.com/Parisson/loaders.git', - # 'https://github.com/Parisson/ui.git', -) - -NOTEBOOK_DIR = MEDIA_ROOT + 'notebooks' -if not os.path.exists(NOTEBOOK_DIR): - os.makedirs(NOTEBOOK_DIR) - -NOTEBOOK_ARGUMENTS = [ - '--ip=0.0.0.0', # reach notebooks from outside - '--port=8888', # std port - '--no-browser', # don't start browser on start - '--allow-root', - '--notebook-dir', NOTEBOOK_DIR -] - -SILENCED_SYSTEM_CHECKS = ['fields.W342',] - - -TELEMETA_ORGANIZATION = 'Pre-Barreau - CRFPA' -TELEMETA_SUBJECTS = ('test', 'telemeta', 'sandbox') -TELEMETA_DESCRIPTION = "Telemeta TEST sandbox" +TELEMETA_ORGANIZATION = 'Pré-Barreau - CRFPA' +TELEMETA_SUBJECTS = ('Barreau', 'CRFPA', 'e-learning') +TELEMETA_DESCRIPTION = "E-learning Pré-Barreau - CRFPA" TELEMETA_GMAP_KEY = 'ABQIAAAArg7eSfnfTkBRma8glnGrlxRVbMrhnNNvToCbZQtWdaMbZTA_3RRGObu5PDoiBImgalVnnLU2yN4RMA' TELEMETA_CACHE_DIR = MEDIA_ROOT + 'cache' TELEMETA_EXPORT_CACHE_DIR = TELEMETA_CACHE_DIR + "/export" @@ -268,12 +206,14 @@ LOGIN_URL = '/login/' LOGIN_REDIRECT_URL = reverse_lazy('teleforma-desk') SESSION_EXPIRE_AT_BROWSER_CLOSE = False -EMAIL_HOST = 'smtp.numericable.fr' -DEFAULT_FROM_EMAIL = 'webmaster@parisson.com' -SERVER_EMAIL = 'webmaster@parisson.com' +EMAIL_HOST = 'localhost' +DEFAULT_FROM_EMAIL = 'crfpa@pre-barreau.com' +SERVER_EMAIL = 'crfpa@pre-barreau.com' EMAIL_SUBJECT_PREFIX = '[' + TELEMETA_ORGANIZATION.decode('utf8') + '] ' -POSTMAN_AUTO_MODERATE_AS = True +POSTMAN_AUTO_MODERATE_AS=True + +#FILE_PROTECTION_METHOD = 'xsendfile' TELEFORMA_E_LEARNING_TYPE = 'CRFPA' TELEFORMA_GLOBAL_TWEETER = False @@ -281,30 +221,110 @@ TELEFORMA_PERIOD_TWEETER = True TELEFORMA_EXAM_TOPIC_DEFAULT_DOC_TYPE_ID = 4 TELEFORMA_EXAM_SCRIPT_UPLOAD = True TELEFORMA_REGISTER_DEFAULT_DOC_ID = 5506 -TELEFORMA_PERIOD_DEFAULT_ID = 12 +TELEFORMA_PERIOD_DEFAULT_ID = 22 TELEFORMA_EXAM_MAX_SESSIONS = 15 TELEFORMA_EXAM_SCRIPT_MAX_SIZE = 20480000 TELEFORMA_EXAM_SCRIPT_SERVICE_URL = '/webviewer/teleforma.html' -TELECASTER_LIVE_STREAMING_SERVER = 'stream.parisson.com' +TELECASTER_LIVE_STREAMING_SERVER = 'stream4.parisson.com' TELECASTER_LIVE_STREAMING_PORT = 443 +TELECASTER_LIVE_ICECAST_STREAMING_PORT = 8000 +TELECASTER_LIVE_STREAM_M_STREAMING_PORT = 8080 -TELECASTER_CONF = [{'type':'mp3','server_type':'icecast','conf':'/etc/telecaster/deefuzzer_mp3.xml', 'port':'8000'}, - {'type':'webm','server_type':'stream-m','conf':'/etc/telecaster/deefuzzer_webm.xml', 'port':'8080'}, ] +JQCHAT_DISPLAY_COUNT = 100 +JQCHAT_DISPLAY_TIME = 72 +JQCHAT_DATE_FORMAT = "D-H:i" -TELECASTER_RSYNC_SERVER = 'telecaster@jimi.parisson.com:archives/' -TELECASTER_RSYNC_LOG = '/var/log/telecaster/rsync.log' -TELECASTER_MASTER_SERVER = 'angus.parisson.com' +PASSWORD_HASHERS = [ + 'django.contrib.auth.hashers.PBKDF2PasswordHasher', +] -TELECASTER_LIVE_STREAMING_SERVER = 'stream.parisson.com' -TELECASTER_LIVE_STREAMING_PORT = 443 -TELECASTER_LIVE_ICECAST_STREAMING_PORT = 8000 -TELECASTER_LIVE_STREAM_M_STREAMING_PORT = 8888 +BOX_API_TOKEN = 'D2pBaN8YqjGIfS0tKrgnMP93' -# CRFPA or AE or PRO -TELEFORMA_E_LEARNING_TYPE = 'CRFPA' -TELEFORMA_GLOBAL_TWEETER = False -TELEFORMA_PERIOD_TWEETER = True +FILE_UPLOAD_TEMP_DIR = '/srv/crfpa/var/tmp' + +#SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies" +SESSION_ENGINE = "unique_session.backends.session_backend" +UNIQUE_SESSION_WHITELIST = (1, 2042) + +SOUTH_MIGRATION_MODULES = { + 'captcha': 'captcha.south_migrations', +} + +SUIT_CONFIG = { + 'ADMIN_NAME': 'TeleForma Admin', +} + +# Cache backend is optional, but recommended to speed up user agent parsing +#CACHES = { +# 'default': { +# 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', +# 'LOCATION': '127.0.0.1:11211', +# } +#} + +# Name of cache backend to cache user agents. If it not specified default +# cache alias will be used. Set to `None` to disable caching. +USER_AGENTS_CACHE = 'default' + +AUTH_USER_MODEL = 'auth.User' + +TINYMCE_DEFAULT_CONFIG = { + 'plugins': "table,spellchecker,paste,searchreplace", + 'theme': "advanced", + 'cleanup_on_startup': True, + 'custom_undo_redo_levels': 10, +} + +# Sherlock's online payment +PAYMENT_SHERLOCKS_PATH='/opt/sherlocks2' +PAYMENT_PARAMETERS = { 'merchant_id' : { 'Semestrielle': "040109417200053", + 'Estivale': "040109417200054", }, + 'merchant_country': 'fr', + 'currency_code': '978', + 'language': 'fr' +} + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'formatters': { + 'verbose': { + 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' + }, + 'simple': { + 'format': '%(levelname)s %(asctime)s %(module)s %(message)s' + }, + }, + 'handlers': { + 'file': { + 'level': 'DEBUG', + 'class': 'logging.FileHandler', + 'filename': "/srv/crfpa/var/log/app.log", + 'formatter': 'simple', + }, + }, + 'loggers': { + 'payment': { + 'handlers': ['file'], + 'level': 'DEBUG', + 'propagate': True, + }, + }, +} + + +from django.utils.encoding import force_text +def show_user_as(user): + professor = user.professor.all() + is_corrector = False + if user.quotas.count() and not professor and not user.is_superuser: + return "#"+str(user.id) + else: + return force_text(user) +POSTMAN_SHOW_USER_AS = show_user_as + +#THUMBNAIL_FORCE_OVERWRITE = True JQCHAT_DISPLAY_COUNT = 50 JQCHAT_DISPLAY_TIME = 48 diff --git a/app/urls.py b/app/urls.py index 8bacff02..448c6d44 100644 --- a/app/urls.py +++ b/app/urls.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- from django.conf.urls.defaults import * +from django.http import HttpResponse # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() js_info_dict = { - 'packages': ('telemeta','telecaster'), + 'packages': ('telemeta', 'teleforma'), } urlpatterns = patterns('', @@ -20,10 +21,13 @@ urlpatterns = patterns('', # TeleForma (r'^', include('teleforma.urls')), - (r'^telecaster/', include('telecaster.urls')), # Languages (r'^i18n/', include('django.conf.urls.i18n')), (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict), + (r'^robots\.txt$', lambda r: HttpResponse("User-agent: *\nDisallow: /", mimetype="text/plain")), + #url(r'^pdfviewer/', include('webviewer.urls')), + url(r'^pdfannotator/', include('pdfannotator.urls')), + url(r'^captcha/', include('captcha.urls')), ) diff --git a/app/wsgi.py b/app/wsgi.py index d71b3b73..e63f8351 100644 --- a/app/wsgi.py +++ b/app/wsgi.py @@ -1,8 +1,31 @@ -import os +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Copyright (c) 2016-2017 Ircam +# Copyright (c) 2016-2017 Guillaume Pellerin +# Copyright (c) 2016-2017 Emilie Zawadzki + +# This file is part of mezzanine-organization. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . -# This application object is used by the development server -# as well as any WSGI server configured to use this file. +# -*- coding: utf-8 -*- + +import os +import sys from django.core.wsgi import get_wsgi_application + +sys.path.append(os.path.dirname('.')) +os.environ.setdefault("DJANGO_SETTINGS_MODULE", 'settings') application = get_wsgi_application() diff --git a/bin b/bin new file mode 160000 index 00000000..e7183613 --- /dev/null +++ b/bin @@ -0,0 +1 @@ +Subproject commit e71836138a2c3c189a615641790a550217bf770a diff --git a/docker-compose.yml b/docker-compose.yml index ec061fe2..d66d6811 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,72 +1,41 @@ -version: '2' +version: '3' services: - var: - image: debian:jessie - volumes: - - ./var/media/:/srv/media - - ./var/static/:/srv/static - - ./var/backup/:/srv/backup - command: "true" - - db: - image: mariadb:10 - env_file: - - env/debug.env - volumes: - - ./var/lib/mysql/:/var/lib/mysql - - broker: - image: redis:5 - - search: - image: elasticsearch:1.7 - app: build: . - command: /bin/bash bin/app.sh + command: /bin/sh app/bin/app.sh volumes: - ./app/:/srv/app + - ./bin:/srv/bin - ./teleforma/:/srv/lib/teleforma/teleforma - volumes_from: - - var + - ./var/media:/srv/media + - ./var/backup:/srv/backup + - ./var/static:/srv/static ports: - "8000:8000" links: - db - - broker - - search - env_file: - - env/debug.env - - worker: - build: . - command: /bin/bash bin/worker.sh - volumes_from: - - app - - var - env_file: - - env/debug.env - command: /bin/bash bin/worker.sh - links: - - broker - - db - web: - image: nginx - ports: - - "80:80" + db: + image: mariadb + environment: + - MYSQL_ROOT_PASSWORD=mysecretrootpassword + - MYSQL_DATABASE=teleforma + - MYSQL_USER=teleforma + - MYSQL_PASSWORD=mysecretpassword volumes: - - ./app/deploy/nginx-app.conf:/etc/nginx/conf.d/default.conf - - ./var/log/nginx/:/var/log/nginx - volumes_from: - - var - links: - - app + - ./var/lib/mysql/:/var/lib/mysql + - ./var/log/mysql/:/var/log/mysql + - ./var/backup/:/srv/backup + + memcached: + image: memcached:alpine + entrypoint: + - memcached + - -m 1024 + - -I 128m + - -v volumes: - var: app: db: - web: - diff --git a/requirements-1.3.txt b/requirements-1.3.txt index eb404536..3516f98a 100644 --- a/requirements-1.3.txt +++ b/requirements-1.3.txt @@ -1,10 +1,13 @@ +amqp==1.0.13 amqplib==1.0.2 anyjson==0.3.1 +arabic-reshaper==2.1.1 asv==0.2 Babel==2.1.1 backports.shutil-get-terminal-size==1.0.0 backports.ssl-match-hostname==3.5.0.1 beautifulsoup4==4.6.0 +bigbluebutton-api-python==0.0.9 bleach==3.3.0 bs4==0.0.1 cached-property==1.3.0 @@ -13,9 +16,11 @@ certifi==14.5.14 chardet==2.1.1 cl==0.0.3 configobj==4.7.2 +configparser==4.0.2 crocodoc==0.1.1 +debtcollector==1.22.0 decorator==4.0.10 -Django==1.4.10 +Django==1.4.19 django-bootstrap-pagination==1.5.1 django-bootstrap3==6.1.0 django-cacheops==2.1.1 @@ -23,10 +28,10 @@ django-celery==2.5.5 django-debug-toolbar==1.0.1 django-email-extras==0.1.13 django-extensions==1.2.1 -#django-extra-views==0.6.5 -django-extra-views==0.7 +django-extra-views==0.7.0 django-forms-builder==0.8.5 django-google-tools==1.0.0 +django-jqchat==0.2 django-json-rpc==0.6.1 django-linguo==1.3.3 django-longerusernameandemail==0.5.6 @@ -37,12 +42,15 @@ django-notes==0.2.2 django-nvd3==0.8.2 django-pagination==1.0.7 django-picklefield==0.2.1 +-e git+/var/git/django-postman.git@e432d9e2341d785091a02615c214563f97d31430#egg=django_postman +django-quiz-app==0.5.1 django-redis-cache==0.13.0 django-registration==1.0 -django-simple-captcha==0.4.4 +django-simple-captcha==0.4.6 django-suit==0.2.12 django-timezones==0.2 django-tinymce==1.5.4 +django-unique-session==1.0 django-user-agents==0.3.0 docopt==0.6.2 docutils==0.8.1 @@ -53,7 +61,9 @@ fpconst==0.7.2 funcsigs==0.4 functools32==3.2.3.post2 funcy==1.2 +future==0.18.2 gdata==2.0.18 +h5py==2.10.0 html5lib==1.1 httplib2==0.8 ipaddress==1.0.17 @@ -64,12 +74,15 @@ Jinja2==2.7.2 jsonpatch==1.12 jsonpointer==1.10 jsonschema==2.5.1 -jxmlease +jxmlease==1.0.3 keyring==3.8 keystoneauth1==2.1.0 +kombu==2.5.16 +lazr.uri==1.0.5 lockfile==0.8 +logilab-astng==0.24.3 +logilab-common==1.4.4 longerusername==0.4 -#lxml==3.3.1 mailer==0.7 Mako==0.7.0 Markdown==2.1.1 @@ -78,11 +91,11 @@ mock==1.0.1 monotonic==0.5 msgpack-python==0.4.6 mutagen==1.20 -#MySQL-python==1.2.3 -mysqlclient +mysqlclient==1.4.6 NavAdd==0.1.1 netaddr==0.7.18 netifaces==0.10.4 +numpy==1.7.0 oauth==1.0.1 oauth2==1.5.211 oauthlib==0.6.0 @@ -90,24 +103,32 @@ oslo.config==3.2.0 oslo.i18n==3.1.0 oslo.serialization==2.2.0 oslo.utils==3.3.0 +packaging==20.9 paramiko==1.10.1 pathlib2==2.1.0 +pbr==1.8.1 pexpect==4.2.1 pickleshare==0.7.4 -Pillow==2.4.0 +Pillow==2.5.0 +pkg-resources==0.0.0 prettytable==0.7.2 prompt-toolkit==1.0.7 +psutil==5.8.0 +ptyprocess==0.7.0 pycosat==0.6.1 pycrypto==2.6 pydot==1.0.28 pygit==0.1 Pygments==2.1.3 pylint==0.25.1 +pymemcache==3.4.1 pyparsing==2.0.2 pyPdf==1.13 +PyPDF2==1.26.0 +python-bidi==0.4.2 python-dateutil==1.5 -#python-ebml==0.2 -#python-irclib==0.4.8 +python-ebml==0.2.1 +python-gnupg==0.4.7 python-keystoneclient==2.0.0 python-nvd3==0.13.7 python-openid==2.2.5 @@ -124,11 +145,14 @@ scipy==0.10.1 simplegeneric==0.8.1 simplejson==2.5.2 six==1.10.0 -sorl-thumbnail==11.12 +sorl-thumbnail==12.3 South==0.8.2 Sphinx==1.1.3 sphinx-me==0.2.1 sqlparse==0.1.10 +stevedore==1.32.0 +-e git+git@git.parisson.com:git/teleforma.git@d72e7afb4f6ec0ea7a665fb7f31e69761c99e952#egg=TeleForma +-e git+git@git.parisson.com:git/telemeta.git@2fced3bcac3055830dab4d3d708d89ff0cc7ddb5#egg=Telemeta texttable==0.8.7 TimeSide==0.5.3 traitlets==4.3.1 @@ -139,14 +163,14 @@ urllib3==1.7.1 user-agents==0.3.2 uwsgitop==0.10 vatnumber==1.1 -#vobject==0.8.1rc0 wadllib==1.3.4 warlock==1.2.0 wcwidth==0.1.7 +webencodings==0.5.1 websocket-client==0.40.0 Werkzeug==0.9.4 wrapt==1.10.6 -xhtml2pdf +xhtml2pdf==0.2.5 xlrd==0.6.1 xlwt==0.7.5 zipstream==1.0.2 diff --git a/requirements-debian.txt b/requirements-debian.txt index 0a3dae0e..7eba8bc7 100644 --- a/requirements-debian.txt +++ b/requirements-debian.txt @@ -2,9 +2,8 @@ git netcat vim locales +ipython +python-setuptools +python-mysqldb +python-psycopg2 python-yaml -libshout3-dev -librtmp-dev -liblo-dev -libcurl4-openssl-dev -cython diff --git a/requirements-dev.txt b/requirements-dev.txt index b2354682..8a46e19d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,2 @@ --e git+https://github.com/Parisson/django_quiz.git#egg=django_quiz-0.6.0 --e git+https://github.com/Parisson/telecaster-client.git#egg=telecaster_client-0.8 +-e git+https://github.com/Parisson/django_quiz.git#egg=django_quiz-0.5.1 # a supprimer +-e git+https://github.com/Parisson/django-jqchat.git@master#egg=django-jqchat diff --git a/requirements.txt b/requirements.txt index c454c82a..3c768f83 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,22 +1,19 @@ setuptools django==1.4.19 -telemeta==1.4.6 south # a supprimer django-pagination==1.0.7 # a supprimer django-postman==3.2.0 -django-extensions==0.9 +django-extensions==1.2.1 django-notes # a supprimer django-timezones==0.2 -django-jqchat crocodoc # a supprimer django-registration==0.8 django-extra-views==0.6.5 # a supprimer -django-simple-captcha # a maj -django-suit # a maj -django-nvd3 -django-user-agents -html5lib>=1.0 -xhtml2pdf==0.2.3 -markdown<2.5 +django-simple-captcha==0.4.6 # a maj +django-suit==0.2.12 # a maj +django-nvd3==0.8.2 +django-user-agents==0.3.0 +xhtml2pdf +html5lib==1.1 django-tinymce==1.5.4 -django-quiz # a supprimer +sorl-thumbnail==11.12 -- 2.39.5