Skip to content

Fixed theme zip extraction permissions#853

Merged
sagzy merged 1 commit into
mainfrom
fix-perm-issues-2
Jun 25, 2026
Merged

Fixed theme zip extraction permissions#853
sagzy merged 1 commit into
mainfrom
fix-perm-issues-2

Conversation

@sagzy

@sagzy sagzy commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

ref TryGhost/framework#761
ref https://linear.app/ghost/issue/ONC-1838/timeout-on-theme-upload

Some theme zip files have read-only folder permissions. When an user uploads one of these themes, GScan needs to unzip the archive and create files inside those folders. If the folders are not writable by the owner, extraction can get stuck and the theme upload appears to freeze in the UI without a useful error message.

With this change, GScan opts into the new @tryghost/zip@3.5.0 owner-permission normalization while extracting theme uploads. Directories are normalized so the owner can read, write, and traverse them, and files are normalized so the owner can read and write them. The original zip is not modified; only the temporary extracted copy is made usable for validation and installation.

The result is that themes with incorrect folder permissions can still be uploaded successfully instead of leaving the user stuck on a frozen upload.

no issue

GScan validates and installs theme zips from its extracted temp directory. Some customer archives preserve read-only directory modes, which can block validation or later cleanup. Use the new @tryghost/zip owner-permission normalization option so uploaded themes are extracted with writable owner permissions while keeping the source archive unchanged.
@sagzy sagzy changed the title 🐛 Fixed theme zip extraction permissions Fixed theme zip extraction permissions Jun 25, 2026
@sagzy sagzy merged commit 2d17fa2 into main Jun 25, 2026
6 checks passed
@sagzy sagzy deleted the fix-perm-issues-2 branch June 25, 2026 12:55
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@sagzy, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 18 minutes and 23 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eac60922-a827-4c72-bcda-00ddc79aacc0

📥 Commits

Reviewing files that changed from the base of the PR and between 7675c69 and d18e5f9.

📒 Files selected for processing (2)
  • lib/read-zip.js
  • test/read-zip.test.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-perm-issues-2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

sagzy added a commit to TryGhost/Ghost that referenced this pull request Jun 25, 2026
ref https://linear.app/ghost/issue/ONC-1838
ref TryGhost/framework#761
ref TryGhost/gscan#853

Theme uploads could hang without any visible error when a zip contained
folders without sufficient write permissions. GScan needs to write into
those folders while extracting and validating the theme.

Updated `gscan` to include the permission handling fix so missing
permissions are restored during upload and the theme can be installed
successfully instead of leaving the UI frozen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant