fix: restore StorageFactory legacy env fallback and S3 bucket root#241
fix: restore StorageFactory legacy env fallback and S3 bucket root#241ChiragAgg5k wants to merge 5 commits into
Conversation
Appwrite still configures remote storage via OPR_EXECUTOR_STORAGE_* while CONNECTION_STORAGE defaults to local://localhost. Fall back to the legacy env vars in that case, and prepend the bucket to the root for generic S3 devices that encode the bucket in the path. Co-authored-by: Cursor <cursoragent@cursor.com>
Greptile SummaryThis PR restores remote-storage support for self-hosted Appwrite setups that ship
Confidence Score: 5/5Safe to merge — the new fallback path is additive and only activates when OPR_EXECUTOR_CONNECTION_STORAGE is empty or a local/file DSN while a remote OPR_EXECUTOR_STORAGE_DEVICE is configured. The existing DSN-based branch is unchanged. The change is narrowly scoped to a single factory class. The env fallback triggers only under the specific condition (local/empty connection + non-local device) that was always broken after the refactor. DSN-based paths are untouched. withBucketRoot is applied only in the legacy env path, not in the DSN branch, so existing DSN-based deployments see no behaviour change. No files require special attention. Important Files Changed
Reviews (4): Last reviewed commit: "fix: apply Rector new-method-call-withou..." | Re-trigger Greptile |
PHPStan reports getEnv with a default is non-nullable, so ?? was invalid. Co-authored-by: Cursor <cursoragent@cursor.com>
Limit withBucketRoot to the legacy env path so existing DSN-based S3 configs keep their previous root behavior. Detect local/file DSN schemes instead of matching a fixed string list. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
What does this PR do?
Restores remote-storage support for self-hosted Appwrite setups that still configure the executor with legacy
OPR_EXECUTOR_STORAGE_*env vars whileOPR_EXECUTOR_CONNECTION_STORAGEdefaults tolocal://localhost.After the StorageFactory refactor, those legacy vars were ignored, so custom S3 (and other providers) no longer received the bucket/credentials. This also prepends the bucket to the root path for generic S3 devices (endpoint/host), matching the previous Adapter behavior.
Test Plan
OPR_EXECUTOR_CONNECTION_STORAGE=local://localhostand:OPR_EXECUTOR_STORAGE_DEVICE=s3OPR_EXECUTOR_STORAGE_S3_*(access key, secret, region, bucket, endpoint)StorageFactory::getDevice('/')returns an S3 device whose root includes the buckets3://key:secret@host/bucket?region=...), confirm bucket is still applied to the S3 rootRelated
OPR_EXECUTOR_STORAGE_*alongsideCONNECTION_STORAGE=local://localhost