Repository navigation
Conversation
The OpenShip edge proxy accepts request bodies up to 50 MB by default (`EDGE_CLIENT_MAX_BODY_SIZE`). FrankenPHP base images run without a `php.ini`, leaving PHP at its built-in defaults: `upload_max_filesize = 2M` and `post_max_size = 8M`. Uploads between 2 MB and 50 MB pass through the edge proxy but silently fail inside PHP (which cannot be raised via `ini_set()` since `upload_max_filesize` is `PHP_INI_PERDIR`). Write `upload_max_filesize = 50M` and `post_max_size = 50M` into `$PHP_INI_DIR/conf.d/zz-openship.ini` in the runtime stage before copying project files and dropping privileges to `USER www-data`. This ensures it runs as root, caches across rebuilds, and applies to web, worker, and release containers sharing the image. Fixes oblien#1774 Signed-off-by: Yash Kaushik <yash005kaushik@gmail.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.
Summary
Fixes #1774. The OpenShip edge proxy accepts request bodies up to 50 MB by default (
EDGE_CLIENT_MAX_BODY_SIZE). However, FrankenPHP base images run without aphp.ini, leaving PHP at its built-in defaults:upload_max_filesize = 2Mandpost_max_size = 8M. Uploads between 2 MB and 50 MB pass through the edge proxy but silently fail inside PHP (which cannot be raised viaini_set()sinceupload_max_filesizeisPHP_INI_PERDIR).Solution
Write
upload_max_filesize = 50Mandpost_max_size = 50Minto$PHP_INI_DIR/conf.d/zz-openship.iniin the runtime stage right after extension installation and before copying application code and dropping privileges toUSER www-data.$PHP_INI_DIR/conf.d/zz-openship.initakes advantage of PHP's automatic scan directory and ensures directives override any default values.Verification
packages/adapters/src/runtime/docker-build-plan.test.tsverifying that$PHP_INI_DIR/conf.d/zz-openship.iniis populated withupload_max_filesize = 50Mandpost_max_size = 50Min the runtime stage prior to copying app code.npx vitest run src/runtime/docker-build-plan.test.ts(all 47 tests passed).