Repository navigation
Create local storage directories as 0755 so web servers can read them - #4
Merged
mtarld merged 5 commits intoOct 21, 2026
Merged
Conversation
mtarld
reviewed
Oct 21, 2026
…ory-permissions # Conflicts: # CHANGELOG.md
mtarld
approved these changes
Oct 21, 2026
Co-authored-by: Mathias Arlaud <mathias.arlaud@gmail.com>
Contributor
Author
|
Your suggestion was anchored on |
Member
|
Really nice one! Thank you @feymo 🙂 |
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.
Fixes #3
When
storageis a local path, the bundle builds aLocalFilesystemAdapterwithout a visibility converter, so Flysystem falls back toPortableVisibilityConverter's default ofVisibility::PRIVATEfor directories. The output root and every directory created under it (e.g.<path>/withclean_urls) end up as0700, which a web server running as a different user (shared hosting, php-fpm vs. Apache, ...) cannot traverse, so the generated pages are not served.A generated static site is public by definition, so this passes a
PortableVisibilityConverterwithdefaultForDirectories: Visibility::PUBLIC(0755). All other Flysystem defaults are kept. Astoragegiven as a@servicereference is left untouched; its permissions remain the user's responsibility.Changes:
BakslashStaticSiteBundle::configureStorage(): pass a public-by-default visibility converter to the local adapter.0022) and asserting the root and subdirectories are0755; it fails without the fix (0700).0755directory mode and how to use other modes through a custom Flysystem operator.Possible follow-up: I kept this minimal, so other modes still require declaring a custom Flysystem operator and referencing it with
storage: '@service_id'. If you'd rather make this configurable from the bundle itself, apermissionsoption could map toPortableVisibilityConverter::fromArray(), e.g.:It would only apply to a local
storage. Happy to add it to this PR or open a separate one, whichever you prefer.