Prefetch moved to a separate python:3.10-slim stage that only sees weights.py/fetch-weights.py, so editing app.py or vendor/ no longer invalidates the 360 MB weights layer. Weight catalog and download helpers extracted to photo-ai/weights.py; fetch-weights.py no longer imports app (torch). Cache mount switched to sharing=shared: a canceled build could leave the exclusive lock held and hang the next build forever; downloads now use a pid-unique tmp file, so concurrent builds cannot corrupt it. Docs recommend 'docker compose up -d --build app' for app updates instead of rebuilding photo-ai/face-id.
Check pg_constraint by conname + conrelid so a same-named CHECK on another table cannot skip creation, add the constraint as NOT VALID and validate separately to avoid a long ACCESS EXCLUSIVE lock at boot. Mark lib/students.js as partially extracted in the migration plan.
Generate a 10-year root CA in entrypoint.sh and sign the server leaf with it. Only the root CA is distributed to clients (including GPO); the leaf is served by the app and is reissued automatically when CERT_HOSTNAMES changes. Update the Windows installer, ZIP package, settings UI and docs for the two-tier scheme.
- validate group_photos.photo_original_path with the same tolerant helper
as entries, so /uploads/.originals/<file> no longer fails restore with
"Invalid upload path"
- accept legacy flat values in both photo_original_path columns
- preserve users.avatar in normalizeRestoreData and the restore INSERT
- add selftests for originals paths and avatars
- default BACKUP_UPLOAD_LIMIT_MB to 0 (no hard cap, disk is the limit);
a positive value still enables multer fileSize
- scale request timeout by the configured limit and keep up to 24h when
unlimited, cap headersTimeout at 120s
- check Content-Length and free space before upload (413/507) and map
multer ENOSPC to 507
- drop the hardcoded 500 MB fallback in the settings restore pre-check
- cover new limit/timeout helpers in backup.selftest.js
- update env template, compose, README, AGENTS and API docs
- extract restore helpers into lib/restore.js (space check, tar entry
filter, temp dir sweep)
- reject tar entries outside staging and symlinks/hardlinks
- map ENOSPC/EQUOT to 507 with clear messages, keep data_restored flag
when files fail after commit
- raise request timeout using BACKUP_UPLOAD_LIMIT_MB and expose
backup_upload_limit_mb via public settings
- upload restore archive via XHR with progress, size pre-check and
readable server errors in settings UI
- document large-archive restore on a remote server
- re-bind input listeners for #enhanceBrightness/#enhanceContrast/#enhanceSaturate/#enhanceDenoise/#enhanceSharp -> scheduleEnhancePreview (lost in f5910d9)
- new "Только эффекты" button in #cpuEnhanceModal footer: applies slider effects via CPU pipeline (mode=cpu, face=off) in one click, no photo-ai/model
- harden saveEnhance: null-guard enhanceEntryId/enhanceSourceImg/btn, AbortController timeouts on applyAiResult (15s), canvas upload (30s), refreshEntryCard; guard runPhotoAi btn.disabled
Notes:
- soft delete via deleted_at/purge_at with trashPurgeDays(), restore and
permanent-delete routes, ?deleted=1 list switch
- GET /api/notes now always returns only own notes (admin included)
- purge user_notes in purgeScheduledDeletions(), skip deleted rows in
reorder and in the note title worker
- deleted_at/purge_at in init.sql, migration.sql, ensureUserNotesTable(),
normalizeRestoreData and restore-insert
Profile:
- POST /api/user-settings/models/test probes a personal model from the
client payload (works before save), shared probeAiModel() with the admin
profile test, AI_MODEL_TEST_TIMEOUT_MS env in .env.example/compose
- "Проверить" button in the model list and in the model form
- password fields: autocomplete hints, values cleared on every toggle
Notes page: #notesDeleted trash toggle, deleted card state, restore/permanent
actions; fmtTs() uses the global fmtDateTime() instead of the non-existent
window.datetime.
Add public/profile.html + public/js/profile.js: hash-routed page with
tabs for personal data, password, AI models, prompts and branches
(admin-only), plus clickable counters for the user's own work.
Server:
- users gains email/phone/avatar (init.sql, migration.sql, ensureUserTables)
- GET /api/users/:id — self or admin, returns created_at and branch_ids
- GET /api/users/:id/stats — entries/shorts/feedbacks/lessons/groups counts
- PUT /api/users/:id/profile — name/email/phone/password, audit user.profile.update
- POST /api/users/:id/avatar — upload.single('photo'), audit user.avatar.update
- safeUser() now exposes email/phone/avatar/created_at
- users.avatar added to sweepOrphanedUploads and BROKEN_IMAGE_SOURCES
- getPersonalAiModels()/resolveUserAiProfile() for personal AI profiles;
POST /api/shorts/ai-correct resolves them and 400s on unknown profile
Frontend:
- sidebar entry "Профиль"; .btn-secondary/.btn-xs/.muted in admin.css
- profile.js saves AI and prompt tabs as two independent PUTs
- feedback.js and shorts.js now fill model selects from
GET /api/ai/profiles/options by role (admin sees system profiles,
tutor sees native + own models) so the choice is actually persisted
Docs: AGENTS.md 3h updated, new section 3p.
- эндпоинты /api/students/image-files-by-name и /api/students/works-by-name (requireAuth, branchScope)
- галерея вложений карточки грузится асинхронно по имени ученика, кэш по имени
- новый тумблер «Фото на занятиях» (localStorage reportCardStudentWorks)
- выравнивание высоты галереи, обработка landscape-фото, CSS .sc-w__*
- shorts: правка выравнивания автора в строке
- enhance-модалка: индикатор «размышления» с прогрессом, иконки Lucide
вместо эмодзи, подсветка готового результата, защита от гонок опроса
- index.js: лимит модулей 1000, повторные попытки загрузки списка,
таймаут и ретрай отправки записи, требование вложений по флагу модуля
- journal.js/groups.js: `data-img` получает полный путь (лайтбокс вместо
миниатюры), thumbSrc отдаёт `/uploads/thumb/` и оригиналы из `.originals/`
- shorts.js: переключение «Использовано» без полной перезагрузки списка
- AGENTS.md: правила миниатюр (`thumbSrc`) и `data-img`
- переключатель «Вложения» слева от «Количество занятий» в модалке модуля,
бейдж «Вложения» в списке модулей
- колонка modules.has_attachments: db/init.sql, db/migration.sql,
ensureModulesTable(), POST/PUT/GET /api/modules, GET /api/v1/modules, backup
- на главной странице у выбранного модуля с вложениями показывается
подсказка «К этой теме нужно приложить файлы»
Также вошла ранее незакоммиченная работа:
- битые изображения: скан и карантин, раздел «Битые изображения» в корзине
(таблица broken_images, /api/broken-images/*, trash.html + trash.js)
- отзывы: фото ученика и цветовая полоса оценки работ в модалке
(#fbResidentPhoto, #fbMarkStripe, GET /api/feedbacks/work-marks)
- фото и галереи: photo_key/photo_id в /api/photos и inline-карантин битых фото
- поля пароля на journal.html и links.html обёрнуты в no-op form
thumbSrc() в admin.js для /uploads/ отдаёт полный размер, поэтому сетка
"Фото групп" и превью "Последних записей" тянули оригиналы (~1.6 MB на фото,
13 MB на блок). Добавлен локальный dashThumb() по образцу photos.js/students.js:
/uploads/<name> -> /uploads/thumb/<name> (WebP ~36 KB), прочее — как было.
Лайтбокс по-прежнему открывает оригинал через data-img.