docs: keep only reference documentation, archive one-offs

This commit is contained in:
Pontoporeia
2026-09-18 16:26:36 +02:00
parent 8accb88452
commit d5c1dfb23d
27 changed files with 108 additions and 78 deletions
+26 -11
View File
@@ -56,7 +56,7 @@ Each uploaded file is assigned a `file_type` that controls how it is displayed o
|-----------|-----------|---------|
| `.mp4` | `video/mp4` | `<video>` |
| `.webm` | `video/webm` | `<video>` |
| `.mov` | `video/quicktime` | `<video>` (served as `video/mp4`) |
| `.mov` | `video/quicktime` | `<video>` (served with Range support) |
| `.ogv` | `video/ogg` | `<video>` |
#### Audio
@@ -153,22 +153,37 @@ Labels are stored in `thesis_files.display_label`. If blank, the field falls bac
## Storage layout
Files are stored outside the webroot in `app/storage/`.
Files are stored outside the webroot in `app/storage/`. Each thesis gets its own
folder keyed by object type, year, author slug and a title slug:
```
app/storage/
├── covers/
│ └── <random-hex>.jpg # cover images
└── theses/
└── <year>/
└── <YEAR>_<AUTHOR_SLUG>/
└── <AUTHOR_SLUG>_<sanitized-filename>.<ext>
├── {objet}/ # tfe | these | frart (plus legacy theses/, documents/)
│ └── <year>/
│ └── <YEAR>_<AUTHOR_SLUG>_<TITLE_SLUG>/ # e.g. 2025_EMMA_RENARD_REHABILITATION_..._VERS_UN
│ ├── <PREFIX>_TFE_01.pdf # main files: _TFE_<NN>.<ext>
│ ├── ..._TFE_02.jpg
│ ├── ..._ANNEXE_01.pdf # annexes: _ANNEXE_<NN>.<ext>
│ ├── ..._COUVERTURE.png # cover image (_COUVERTURE.<ext>)
│ ├── ..._NOTE_INTENTION.pdf # note d'intention (_NOTE_INTENTION.pdf)
│ └── ..._TFE_03.vtt # captions share the _TFE_ series
└── covers/ # legacy dir — no longer written to
```
Where `<PREFIX>` = `<YEAR>_<AUTHOR_SLUG>_<TITLE_SLUG>` (the folder name), and the
object type `{objet}` ∈ `tfe`, `these`, `frart` (older/imported rows may live
under legacy `theses/` or `documents/`).
- Author slug: uppercase ASCII, spaces → underscores, accents stripped (e.g. `EMMA_RENARD`).
- Filename: same normalisation applied to the original filename.
- If a folder `<YEAR>_<AUTHOR_SLUG>` already exists a numeric suffix is appended (`_1`, `_2`, …).
- If a filename already exists in the folder a numeric suffix is appended before the extension.
- Title slug: accented chars → ASCII base, other non-alphanumerics → underscores (uppercase).
- The cover and note d'intention are stored **inside** the thesis folder using the
`_COUVERTURE` / `_NOTE_INTENTION` suffixes, recorded as `file_type='cover'` /
`'note_intention'` rows — not in a separate `covers/` directory.
- TFE files (and captions) are numbered `_TFE_<NN>` (`_TFE_01`, …); annexes use
`_ANNEXE_<NN>` so several files of the same kind coexist in the folder.
- If a folder `<PREFIX>` already exists a numeric suffix is appended to the folder
(`_1`, `_2`, …); if a filename already exists in the folder a numeric suffix is
appended before the extension.
Files are never served directly from disk. All access goes through `MediaController` (`/media?path=…`), which enforces:
- Path traversal prevention (character whitelist + `realpath()` jail)