Pick up files added to the Blog folder in Drive, and name nginx errors

Opening Tools → Media → Files (or a Choose a file picker) now looks in
the shared drive's Blog folder, at most every 30 seconds, and adds
anything put there in Drive itself: shared as anyone with the link,
previewed, Google Docs, Sheets and Slides included, folders and
shortcuts left out. A file Drive won't share is named in a note and
tried again every ten minutes.

A reply that isn't the API's (nginx's own error page) now says what it
was: a 413 names nginx's upload limit, a 502 the service, a 504 the
timeout, instead of "Server did not return JSON".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-29 19:14:40 -05:00
parent 5f13273e69
commit 6191322fea
6 changed files with 143 additions and 25 deletions

View file

@ -189,10 +189,24 @@ Drive" above the title.
little after upload. The server asks at once and again over the next
few minutes, and saves it into the image library as an ordinary
upload. Audio and zips get an icon in the admin and no picture.
- **Files put in the Blog folder in Drive itself** (dragged in, made
there, moved there) are listed too: opening the Files tab or a
"Choose a file" picker looks in the folder (at most every 30
seconds), adds anything new, shares it the same way and fetches its
preview. Google's own Docs, Sheets and Slides count; folders inside it
and shortcuts don't. A file Drive won't share with anyone who has the
link is named in a red note instead of listed, and tried again every
ten minutes.
- Deleting a file in the admin deletes it from Drive; the delete says
first which records still link to it (those links stop working).
Deleting it in Drive by hand leaves a broken link and a list entry
that can still be deleted.
- **"Too large for the web server (HTTP 413)"** on upload (older builds
said "Server did not return JSON", with nothing in the journal): nginx
refused the file before it reached the API, because the site has no
`location = /api/admin/files` block (above), so the 64k `/api/` limit
applies. `sudo tail /var/log/nginx/error.log` shows "client intended
to send too large body".
**Sharing has to be allowed.** Uploads fail with "Drive wouldn't share
it with anyone who has the link" unless both allow it: