Media/reindex in settings - #126
Merged
Merged
Conversation
The CephFS corpus arrives owned by whoever ran the rsync, mode 755, while the backend container runs as uid 10001. Nothing in the read path notices, so uploads fail long after media serving looks healthy -- and the failure surfaces as "failed to store upload" rather than "failed to create upload directory", because MkdirAll returns nil for a directory that already exists and every migrated YYYY/MM directory does. The handler discarded the underlying error, so the log said only "status 500". It now logs it: a full volume, an unmounted tree and a permission problem all reach the client as the same message and need very different fixes. deploy/README.md gains the write check and the setfacl grant. The existing media section only ever verified that Nginx could read. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The CephFS mount carries `acl`, which makes it look like the tooling is present; Ubuntu server images do not ship setfacl. Records the package and a setgid fallback for hosts where installing it is unwelcome. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
adminCommentConditions has always excluded them, which left GetApprovedCommentsByArticleSlug as the one place they still surfaced. They are automated link notifications rather than anything a reader wrote, and in the migrated WordPress data they are almost entirely SEO spam: 155 rows sourced from domains like weddingdressesideas.com and garciniacambogia-reviews.org, every one of them approved by WordPress. Same predicate as the admin path, so the two agree. Rows stay in the table. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…s in RAM The migrated WordPress corpus contains unresized camera originals up to ~77 MiB (largest: 2025/07/BZ9A5771.jpg), so the 25 MiB cap rejected files the newsroom demonstrably produces. Raise the default to 90 MiB, chosen to sit under Cloudflare's 100 MB request-body limit on the tunnel fronting Delta -- past that a body clears Nginx and the backend but dies at the edge with an error the CMS never sees. ParseMultipartForm was being handed the size limit as its argument, but that argument is the in-memory buffer threshold, not the cap (MaxBytesReader has always been what enforces the cap). At 90 MiB that would let a single upload pin its full size in RAM, plus the ~10 MiB of slack Go adds on top. Give it a fixed 8 MiB instead and let the rest spill to temp files; the write path already streams and only reads image headers for dimensions, so a large upload now costs container disk rather than memory. Nginx's client_max_body_size moves to 91m to stay just above the backend, and the body/proxy timeouts go to 300s so a 90 MiB upload over a slow uplink is not killed mid-flight. MEDIA_MAX_UPLOAD_BYTES is also plumbed through Compose and the env template -- it was read by the backend but never passed in, so the cap could previously only be changed by editing Go. Deploying this needs both halves: reinstall the Nginx site and reload, and recreate the backend slots. The smaller of the two limits silently wins. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment out the Newsletter entry and its Mail import, leaving a note on how to restore both. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…itor New CMS users were promoted to admin whenever CMS_AUTO_PROMOTE_ALL_ADMINS was set, and existing users were re-promoted on every login. Drop the flag and give new accounts the editor role instead. The first user to log in against an empty cms_users table is still bootstrapped as an admin so a fresh install has someone who can manage roles. The count and the insert share a transaction with a locking read so two simultaneous first logins can't both come out as admin. Existing admins keep their role; this only governs account creation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.