Temporarily disable CSV uploads
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
+1
-2
@@ -22,7 +22,7 @@ if _sys_path_root not in sys.path:
|
||||
sys.path.insert(0, _sys_path_root)
|
||||
|
||||
# Версия приложения (меняется при изменениях)
|
||||
VERSION = "1.0.3"
|
||||
VERSION = "1.0.4"
|
||||
|
||||
|
||||
def setup_logging():
|
||||
@@ -98,4 +98,3 @@ app = create_app()
|
||||
if __name__ == "__main__":
|
||||
from waitress import serve
|
||||
serve(app, host="0.0.0.0", port=5000, threads=8)
|
||||
|
||||
|
||||
@@ -42,13 +42,20 @@ def _disconnect_exceptions():
|
||||
def upload():
|
||||
"""Upload files to session (один или несколько)."""
|
||||
sid = request.form.get("session", "")
|
||||
if not sid:
|
||||
sid = create_session()
|
||||
uploaded = request.files.getlist("files")
|
||||
if not uploaded:
|
||||
log.warning("upload: no files, sid=%s", sid)
|
||||
return jsonify({"ok": False, "error": "No file"}), 400
|
||||
|
||||
# CSV input is temporarily disabled so reliability testing can focus on the
|
||||
# other document formats. Keep the CSV processing code in the core intact.
|
||||
if any(safe_name(f.filename).lower().endswith(".csv") for f in uploaded):
|
||||
log.warning("upload: CSV input is disabled")
|
||||
return jsonify({"ok": False, "error": "CSV uploads are temporarily disabled"}), 400
|
||||
|
||||
if not sid:
|
||||
sid = create_session()
|
||||
|
||||
added = 0
|
||||
had_unnamed = False
|
||||
for f in uploaded:
|
||||
|
||||
@@ -457,7 +457,7 @@
|
||||
<div class="card-header">Обфускация документов</div>
|
||||
<div class="card-body">
|
||||
<p class="sub">
|
||||
Загрузите документы (.docx, .doc, .pdf, .txt, .md, .csv, .zip) — получите ZIP с обезличенными копиями.<br>
|
||||
Загрузите документы (.docx, .doc, .pdf, .txt, .md, .zip) — получите ZIP с обезличенными копиями.<br>
|
||||
CSV с таблицей замен скачивается отдельно.<br>
|
||||
<span style="color:#c0392b;">Ограничения: один файл не более 50 МБ, суммарно не более 500 МБ. Файлы сверх
|
||||
лимитов помечаются статусом «пропущен» и не участвуют в обфускации. Пустые, повреждённые файлы и сканы без
|
||||
@@ -507,7 +507,7 @@
|
||||
</div>
|
||||
<script src="/file-picker/file-picker.iife.js?v={{ version }}"></script>
|
||||
<script>
|
||||
const DOC_EXTS = ['.pdf', '.doc', '.docx', '.txt', '.md', '.csv'];
|
||||
const DOC_EXTS = ['.pdf', '.doc', '.docx', '.txt', '.md'];
|
||||
const ub = document.getElementById('uploadBtn');
|
||||
const cb = document.getElementById('cancelBtn');
|
||||
const nb = document.getElementById('newSessionBtn');
|
||||
@@ -932,7 +932,7 @@
|
||||
onclick="event.stopPropagation()">
|
||||
<h3 style="margin-bottom:12px">Obfuscator — обфускация документов</h3>
|
||||
<p style="font-size:13px;color:var(--muted);line-height:1.6">
|
||||
Загрузите документы (.docx, .doc, .pdf, .txt, .md, .csv, .zip) — получите ZIP-архив с обезличенными копиями.
|
||||
Загрузите документы (.docx, .doc, .pdf, .txt, .md, .zip) — получите ZIP-архив с обезличенными копиями.
|
||||
Персональные данные, реквизиты компаний, телефоны, email и другие приватные сведения заменяются на обезличенные
|
||||
коды.
|
||||
CSV-файл с таблицей соответствия оригинал→замена скачивается отдельно.
|
||||
|
||||
Reference in New Issue
Block a user