GRI-2131: rasterise PowerPoint slides with pdftoppm, drop ghostscript (forge #229) #288

Merged
vivy merged 3 commits from fix/GRI-2131-pptx-pdftoppm into dev 2026-11-16 15:35:30 +00:00
Member

Second half of #229, after #243 fixed the packages and gave LibreOffice its own profile. This follows the product owner's decision of 2026-11-15 17:32 UTC.

Cause: PowerPoint slides were rasterised with gs. Ubuntu 26.04 ships an enforcing AppArmor profile for /usr/bin/gs that only allows writes under a home directory, /mnt, /media and the user's temp folder. It refused the server's data folder, so every PPTX upload failed on a fresh install. The real gs error went to stdout, and stdout was thrown away.

What changes:

  • PPTX goes soffice --convert-to pdf (own -env:UserInstallation profile per conversion, unchanged from #243), then crate::pdf::render_pages. That is the same pdftoppm code path as a PDF upload, at the same 150 dpi. Ubuntu ships no AppArmor profile for pdftoppm.
  • pptx_video.rasterizer_path now defaults to pdftoppm (was gs). If both uploads use the same binary, the start-up converter warning names it once ("PDF and PowerPoint uploads fail").
  • gs is no longer called anywhere. ghostscript is removed from install.sh (install and upgrade server), the container image and plan/operations/deployment.md. The installer test now fails if either install path lists it.
  • A failing soffice or ffmpeg now reports its exit status, stderr and stdout. Above 2 KB the end is kept, because both tools print the fatal line last. A failing pdftoppm reports its status and stderr.

Measured on the build host (Ubuntu 24.04, no gs profile):

  • New ignored test the_sample_deck_renders_with_the_real_soffice_and_pdftoppm, run with HOME=/nonexistent, real LibreOffice 24.2 and real pdftoppm 24.02: passes in 5.2 s, one PNG per visible slide.
  • cargo test -p server filtered to pptx_video and pdf: 40 passed. pptx_video_acceptance_integration with SIGNAGE_TEST_DATABASE_URL set: 6/6 passed. clippy --all-targets -D warnings: clean. scripts/tests/install-server-converters-test.sh: all assertions held.

Not measured yet: the acceptance condition, a PPTX converting on a fresh Ubuntu 26.04 with AppArmor on and nothing changed by hand. That needs the test server after merge and install.sh upgrade server, with the hand-made /etc/apparmor.d/local/gs rule and the scryglass-soffice wrapper removed first, so the result proves the fix and not the workaround.

Refs #229

Second half of #229, after #243 fixed the packages and gave LibreOffice its own profile. This follows the product owner's decision of 2026-11-15 17:32 UTC. **Cause:** PowerPoint slides were rasterised with `gs`. Ubuntu 26.04 ships an enforcing AppArmor profile for `/usr/bin/gs` that only allows writes under a home directory, `/mnt`, `/media` and the user's temp folder. It refused the server's data folder, so every PPTX upload failed on a fresh install. The real `gs` error went to stdout, and stdout was thrown away. **What changes:** - PPTX goes `soffice --convert-to pdf` (own `-env:UserInstallation` profile per conversion, unchanged from #243), then `crate::pdf::render_pages`. That is the same `pdftoppm` code path as a PDF upload, at the same 150 dpi. Ubuntu ships no AppArmor profile for `pdftoppm`. - `pptx_video.rasterizer_path` now defaults to `pdftoppm` (was `gs`). If both uploads use the same binary, the start-up converter warning names it once ("PDF and PowerPoint uploads fail"). - `gs` is no longer called anywhere. `ghostscript` is removed from `install.sh` (install and `upgrade server`), the container image and `plan/operations/deployment.md`. The installer test now fails if either install path lists it. - A failing `soffice` or `ffmpeg` now reports its exit status, stderr and stdout. Above 2 KB the end is kept, because both tools print the fatal line last. A failing `pdftoppm` reports its status and stderr. **Measured on the build host (Ubuntu 24.04, no `gs` profile):** - New ignored test `the_sample_deck_renders_with_the_real_soffice_and_pdftoppm`, run with `HOME=/nonexistent`, real LibreOffice 24.2 and real pdftoppm 24.02: passes in 5.2 s, one PNG per visible slide. - `cargo test -p server` filtered to `pptx_video` and `pdf`: 40 passed. `pptx_video_acceptance_integration` with `SIGNAGE_TEST_DATABASE_URL` set: 6/6 passed. `clippy --all-targets -D warnings`: clean. `scripts/tests/install-server-converters-test.sh`: all assertions held. **Not measured yet:** the acceptance condition, a PPTX converting on a fresh Ubuntu 26.04 with AppArmor on and nothing changed by hand. That needs the test server after merge and `install.sh upgrade server`, with the hand-made `/etc/apparmor.d/local/gs` rule and the `scryglass-soffice` wrapper removed first, so the result proves the fix and not the workaround. Refs #229
GRI-2131: keep the end of ffmpeg's output in a join error; real-tool render test for the sample deck (forge #229)
All checks were successful
CI / the pre-push hook (pull_request) Successful in 3s
CI / cargo fmt (pull_request) Successful in 3s
CI / install.sh client upgrade (pull_request) Successful in 13s
CI / cargo deny (pull_request) Successful in 13s
CI / cargo deny advisories (pull_request) Successful in 20s
CI / repository boundary (pull_request) Successful in 4s
CI / cargo clippy (pull_request) Successful in 1m3s
CI / frontend-web (pull_request) Successful in 1m1s
CI / cargo test (pull_request) Successful in 3m24s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 1s
a1fea0f2eb
vivy merged commit 7c8e2e7a7e into dev 2026-11-16 15:35:30 +00:00
vivy deleted branch fix/GRI-2131-pptx-pdftoppm 2026-11-16 15:35:30 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!288
No description provided.