mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Extract shared filepond logic into src/FilepondHandler.php class. Admin filepond endpoints delegate to the handler after AdminAuth check. New partage filepond endpoints at /partage/actions/filepond/ verify share_active session flag + CSRF token, no admin auth required. JS reads filepond-base meta tag to determine endpoint path: - Admin pages: /admin/actions/filepond (via head.php isAdmin check) - Partage form: /partage/actions/filepond (explicit meta) partage/index.php sets share_active = true on form render, cleans up on successful submit. Partage process endpoint rate-limited to 30/5min per session. No nginx changes needed — /partage/ location already handles PHP without auth_basic.
4.2 KiB
4.2 KiB
Current tasks
- Fix: partage FilePond asks admin password — shared handler + separate partage endpoints with share_active session gate
- Deploy: just deploy (includes new partage/actions/filepond/ + FilepondHandler.php)
Current tasks
- Mandatory auto-generated passwords on share links (no custom passwords, regenerate-only in edit, rate limit on password gate)
- .gitignore / .ignore: exclude *.db-wal and *.db-shm
- CSS: FilePond pool file block border yellow → green on upload complete
- Move shared fichiers-fragment.php from partage/ to templates/partials/form/ and update all links
- Remove Écriture and Image format types (migration 035 + schema seed + query filter)
- FilePond image previews: use site light colors (--bg-secondary, --text-secondary, --accent-green, --error)
- Edit mode: remove custom file preview list above FilePond pools; use FilePond pools for preexisting files
- Cover + note_intention: add data-existing-files to their FilePond inputs (per-queue-type JSON arrays)
- Remove upload-progress bar at bottom (FilePond handles its own progress)
- Remove upload-progress.js from edit/add/partage page extraJs arrays
FilePond Refactor — Merge video/audio into TFE pool
- A.
fichiers-fragment.php— Remove separate video/audio pools, merge into TFE; include PeerTube in data-existing-files - B.
file-upload-filepond.js— Remove peertube_video/peertube_audio/video/audio from QUEUE_CONFIG, remove acceptedFileTypesPeerTube, remove data-peertube-active logic - C.
process.php— When queue_type=tfe and video/audio + PeerTube enabled, upload to PeerTube, return peertube:UUID - D.
load.php— Handle peertube DB files: return placeholder SVG blob - E.
form.php— Include PeerTube files in existingFilesJsonForTfe for edit mode - F.
ThesisEditController.php— Remove separate video/audio/peertube_* handleFilePondQueueFiles calls; also legacy $_FILES path - G.
ThesisCreateController.php— Same as F
HTMX Fragment Architecture Reorganization
- Create shared templates
_licence.phpand_format-website.phpintemplates/partials/form/ - Create
src/FragmentRenderer.phphelper - Create
public/admin/fragments/andpublic/partage/fragments/subdirectories - Create thin fragment endpoint files (auth + data prep + render shared template)
- Update all hx-post references in templates to point to new
fragments/paths - Update
partage/index.phprouting for new fragments - Keep old fragment files as thin delegates to new
fragments/for backward compat - Update nginx config for partage fragment PHP handling
Maintenance mode + partage fragment fix
bootstrap.php: add/partageas allowed path prefix in maintenance gateSystemController.php: update maintenance detail messageadmin/parametres.php: always-visible accessibility table (Normal vs Maintenance)admin.css:.param-access-tablestyles (border-radius via overflow:hidden, green/secondary colours)partage/index.php: fix fragment routing —$slugwas'fragments'but check usedstr_starts_with($slug, 'fragments/'), causing HTMX fragments to redirect to / (main page)- Deploy:
just deploy+just deploy-nginx
Previous items
- Step 1 — Build 4 PHP endpoints (process.php, revert.php, load.php, remove.php)
- Step 2 — Update ThesisFileHandler to accept file_ids instead of $_FILES
- Step 3 — Update file-upload-filepond.js (async server model + all fixes)
- Step 4 — Update templates (data-queue-type on all inputs, data-existing-files in edit)
- Step 5 — Update upload-progress.js (new collectFileNames, pending-uploads guard)
- Step 6 — QA / integration testing
- Step 7 — Cleanup: remove transition flags, remove INPUT_ID_TO_TYPE
CSP & Deploy Fixes (May 2026)
- Track vendor JS files in jj (they were moved to vendor/ but never
jj file tracked) - Add
script-src 'self' 'unsafe-inline'to main CSP header (public pages use inline scripts + onclick handlers) - Add
storage/tmp/filepond/*to .gitignore + rsync exclude, with .gitkeep - Deploy:
just deployto sync vendor JS files + updated CSP + .gitkeep to server