From 13c027fc19c34935ee1aa7448df86b7bbf889633 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 18 Sep 2021 21:59:54 +0200 Subject: [PATCH] =?UTF-8?q?Adapte=20assistance=20=C3=A0=20ScoDoc=209?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_dump_db.py | 6 ++--- app/scodoc/sco_utils.py | 1 + sco_version.py | 2 +- tools/anonymize_db.py | 57 ++++++++++++++++++++++----------------- tools/debian/postinst | 2 +- tools/etc/scodoc9.nginx | 1 + tools/install_debian11.sh | 2 +- 7 files changed, 41 insertions(+), 30 deletions(-) diff --git a/app/scodoc/sco_dump_db.py b/app/scodoc/sco_dump_db.py index 5ee01a63..457e2d0e 100644 --- a/app/scodoc/sco_dump_db.py +++ b/app/scodoc/sco_dump_db.py @@ -65,7 +65,7 @@ from app.scodoc.sco_exceptions import ScoValueError SCO_DUMP_LOCK = "/tmp/scodump.lock" -def sco_dump_and_send_db(REQUEST=None): +def sco_dump_and_send_db(): """Dump base de données et l'envoie anonymisée pour debug""" H = [html_sco_header.sco_header(page_title="Assistance technique")] # get currect (dept) DB name: @@ -94,7 +94,7 @@ def sco_dump_and_send_db(REQUEST=None): _anonymize_db(ano_db_name) # Send - r = _send_db(REQUEST, ano_db_name) + r = _send_db(ano_db_name) if ( r.status_code == requests.codes.INSUFFICIENT_STORAGE # pylint: disable=no-member @@ -172,7 +172,7 @@ def _get_scodoc_serial(): return 0 -def _send_db(REQUEST, ano_db_name): +def _send_db(ano_db_name): """Dump this (anonymized) database and send it to tech support""" log("dumping anonymized database {}".format(ano_db_name)) try: diff --git a/app/scodoc/sco_utils.py b/app/scodoc/sco_utils.py index b352c735..1b0acdca 100644 --- a/app/scodoc/sco_utils.py +++ b/app/scodoc/sco_utils.py @@ -297,6 +297,7 @@ SCO_DEV_MAIL = "emmanuel.viennet@gmail.com" # SVP ne pas changer # Adresse pour l'envoi des dumps (pour assistance technnique): # ne pas changer (ou vous perdez le support) SCO_DUMP_UP_URL = "https://scodoc.iutv.univ-paris13.fr/scodoc-installmgr/upload-dump" +# SCO_DUMP_UP_URL = "http://192.168.56.1:5000/upload_dump" CSV_FIELDSEP = ";" CSV_LINESEP = "\n" diff --git a/sco_version.py b/sco_version.py index cbe32586..a7ecb58a 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.0.29" +SCOVERSION = "9.0.30" SCONAME = "ScoDoc" diff --git a/tools/anonymize_db.py b/tools/anonymize_db.py index 2b8224c2..6f733801 100755 --- a/tools/anonymize_db.py +++ b/tools/anonymize_db.py @@ -1,4 +1,4 @@ -#!/opt/zope213/bin/python +#!/opt/scodoc/venv/bin/python # -*- coding: utf-8 -*- # -*- mode: python -*- @@ -68,42 +68,51 @@ anonymize_null = "NULL" ANONYMIZED_FIELDS = { "identite.nom": anonymize_name, "identite.prenom": anonymize_name, + "identite.nom_usuel": anonymize_null, + "identite.civilite": "'X'", "identite.date_naissance": anonymize_date, "identite.lieu_naissance": anonymize_question_str, + "identite.dept_naissance": anonymize_question_str, "identite.nationalite": anonymize_question_str, - "identite.foto": anonymize_null, + "identite.statut": anonymize_null, + "identite.boursier": anonymize_null, + "identite.photo_filename": anonymize_null, "identite.code_nip": anonymize_null, "identite.code_ine": anonymize_null, - "identite.nom_usuel": anonymize_null, + "identite.scodoc7_id": anonymize_null, "adresse.email": "'ano@nyme.fr'", "adresse.emailperso": anonymize_null, "adresse.domicile": anonymize_null, + "adresse.codepostaldomicile": anonymize_null, + "adresse.villedomicile": anonymize_null, + "adresse.paysdomicile": anonymize_null, "adresse.telephone": anonymize_null, "adresse.telephonemobile": anonymize_null, "adresse.fax": anonymize_null, + "admissions.nomlycee": anonymize_name, "billet_absence.description": anonymize_null, "etud_annotations.comment": anonymize_name, - "entreprises.nom": anonymize_name, - "entreprises.adresse": anonymize_null, - "entreprises.ville": anonymize_null, - "entreprises.codepostal": anonymize_null, - "entreprises.pays": anonymize_null, - "entreprises.contact_origine": anonymize_null, - "entreprises.secteur": anonymize_null, - "entreprises.note": anonymize_null, - "entreprises.privee": anonymize_null, - "entreprises.localisation": anonymize_null, - "entreprise_correspondant.nom": anonymize_name, - "entreprise_correspondant.prenom": anonymize_name, - "entreprise_correspondant.phone1": anonymize_null, - "entreprise_correspondant.phone2": anonymize_null, - "entreprise_correspondant.mobile": anonymize_null, - "entreprise_correspondant.mail1": anonymize_null, - "entreprise_correspondant.mail2": anonymize_null, - "entreprise_correspondant.note": anonymize_null, - "entreprise_correspondant.fax": anonymize_null, - "entreprise_contact.description": anonymize_null, - "entreprise_contact.enseignant": anonymize_null, + # "entreprises.nom": anonymize_name, + # "entreprises.adresse": anonymize_null, + # "entreprises.ville": anonymize_null, + # "entreprises.codepostal": anonymize_null, + # "entreprises.pays": anonymize_null, + # "entreprises.contact_origine": anonymize_null, + # "entreprises.secteur": anonymize_null, + # "entreprises.note": anonymize_null, + # "entreprises.privee": anonymize_null, + # "entreprises.localisation": anonymize_null, + # "entreprise_correspondant.nom": anonymize_name, + # "entreprise_correspondant.prenom": anonymize_name, + # "entreprise_correspondant.phone1": anonymize_null, + # "entreprise_correspondant.phone2": anonymize_null, + # "entreprise_correspondant.mobile": anonymize_null, + # "entreprise_correspondant.mail1": anonymize_null, + # "entreprise_correspondant.mail2": anonymize_null, + # "entreprise_correspondant.note": anonymize_null, + # "entreprise_correspondant.fax": anonymize_null, + # "entreprise_contact.description": anonymize_null, + # "entreprise_contact.enseignant": anonymize_null, "notes_appreciations.comment": anonymize_name, } diff --git a/tools/debian/postinst b/tools/debian/postinst index 3332779f..10c62758 100755 --- a/tools/debian/postinst +++ b/tools/debian/postinst @@ -52,7 +52,7 @@ else SN="" fi -CMD="curl --fail --connect-timeout 5 --silent http://scodoc.iutv.univ-paris13.fr/scodoc-installmgr/version?mode=$mode\&release=${SCODOC_RELEASE}\&sn=${SN}" +CMD="curl --fail --connect-timeout 5 --silent https://scodoc.iutv.univ-paris13.fr/scodoc-installmgr/version?mode=$mode\&release=${SCODOC_RELEASE}\&sn=${SN}" SVERSION="$(${CMD})" if [ "$?" == 0 ]; then diff --git a/tools/etc/scodoc9.nginx b/tools/etc/scodoc9.nginx index 8df2b9d4..4c41dd81 100644 --- a/tools/etc/scodoc9.nginx +++ b/tools/etc/scodoc9.nginx @@ -28,6 +28,7 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; + client_max_body_size 16m; } location /ScoDoc/static { # handle static files directly, without forwarding to the application diff --git a/tools/install_debian11.sh b/tools/install_debian11.sh index 70cc61fa..8d94187a 100755 --- a/tools/install_debian11.sh +++ b/tools/install_debian11.sh @@ -83,7 +83,7 @@ su -c "(cd $SCODOC_DIR && source venv/bin/activate && pip install wheel && pip i # ------------ SCODOC_RELEASE=$(grep SCOVERSION sco_version.py | awk '{ print substr($3, 2, length($3)-2) }') -SVERSION=$(curl --silent http://scodoc.iutv.univ-paris13.fr/scodoc-installmgr/version?mode=install\&release="$SCODOC_RELEASE") +SVERSION=$(curl --silent https://scodoc.iutv.univ-paris13.fr/scodoc-installmgr/version?mode=install\&release="$SCODOC_RELEASE") echo "$SVERSION" > "${SCODOC_VERSION_DIR}/scodoc.sn"