Fix file permissions for uploaded assets to prevent 403 errors#33
Open
Copilot wants to merge 3 commits into
Open
Fix file permissions for uploaded assets to prevent 403 errors#33Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: sander-lameco <25500086+sander-lameco@users.noreply.github.com>
Co-authored-by: sander-lameco <25500086+sander-lameco@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix image file permissions to ensure accessibility
Fix file permissions for uploaded assets to prevent 403 errors
Oct 7, 2025
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.
Problem
When uploading assets via the
lameco:upload_assetstask, files could retain their local permissions (e.g., 600), which causes 403 Permission Denied errors when the web server tries to serve them. Since file permissions are not tracked in Git, this is a local environment issue that needs to be handled during deployment.Solution
This PR ensures all uploaded asset files have at least 644 permissions (read/write for owner, read for group and others) by automatically setting permissions on the server side after upload.
Changes Made
For asset directories:
After uploading each directory, the task now runs:
find {{release_path}}/<dir> -type f -exec chmod 644 {} +This recursively sets 644 permissions on all files within the uploaded directory.
For individual asset files:
After uploading each file, the task now runs:
chmod 644 {{release_path}}/<file>This ensures the individual file has the correct permissions.
Example Output
When running the task, you'll now see:
This provides visibility into the permission-setting process and confirms the operation completed successfully.
Benefits
Fixes #32
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.