prompt-a-thon

Files and conversion

Wiki home ยท prompt-a-thon.bitilia.com

Participant files land in UPLOAD_FOLDER. The web app and the converter do not share a directory for the conversion itself. The web process sends DOCX bytes over a Unix socket. The daemon, running as promptathon-convert, writes only inside its own temp directory and returns PDF bytes.

Protocol:

CONVERT <job_id> <byte_count>\n
<docx bytes>

Reply is OK <job_id> <byte_count> plus PDF bytes, or ERROR <job_id> <message>.

The daemon runs LibreOffice Writer headless (--convert-to pdf:writer_pdf_Export) with a 90 second timeout and a small concurrency limit. pandoc is not part of this path. WeasyPrint is not part of this path. WeasyPrint is used for certificate PDFs.

After conversion, or for a PDF uploaded directly, the app:

Preview helpers in viewer_workers/ can read CSV, DOCX, and XLSX for admin viewing. They are separate from the submission store.

The admin server page reports whether prompt-a-thon-convert is active and whether the socket accepts a connection. Gunicorn writes logs/error.log and logs/access.log. The Flask logger also writes logs/app.log. The server page shows error.log when that file exists, otherwise app.log.