{{ message }}
feat: Archive support for Filebrowser#5960
Open
Kosztyk wants to merge 11 commits into
Open
Conversation
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.

Changelog: Archive Browsing and Extraction Support
Summary
This pull request adds archive support to File Browser so users can open supported archive files directly in the web UI, browse their contents like a virtual read-only folder, preview supported files inside the archive, download individual files from inside the archive, and explicitly extract archives or selected archive entries.
The implementation uses the existing
github.com/mholt/archivesdependency already present in the project, avoiding shelling out to external tools such asunzip,tar,7z, orrar.Added
Archive browsing
Users can now open supported archive files from the normal file listing. When an archive is opened, File Browser displays its contents as a virtual folder structure.
Supported first-pass archive formats include:
.zip.tar.tar.gz.tgz.tar.bz2.tbz2.tar.xz.txz.tar.zst.tzst.7z.rarArchive browsing uses URL query state instead of treating archive entries as real filesystem paths. Example:
This keeps archive paths separate from real filesystem paths and avoids ambiguity between a real folder and a file inside an archive.
Virtual archive API
A new archive API layer was added for listing, streaming, and extracting archive contents.
New API behavior:
The list endpoint returns archive contents in a resource-like shape so the existing frontend listing components can render archive folders and files with minimal changes.
The raw endpoint streams a single file from inside an archive so existing preview and download flows can work with archive entries.
The extract endpoint extracts either:
Preview support inside archives
Supported file types can now be previewed directly from inside archives, including:
Preview URLs are routed through the new archive raw endpoint when the current view is inside an archive.
Download support inside archives
Users can download individual files from inside an archive without extracting the full archive first.
When the selected item is inside an archive, the download action now targets the archive raw endpoint with the selected inner path.
Extraction actions
The UI now exposes extraction actions in both toolbar and context-menu flows.
Outside an archive:
Inside an archive:
Extraction is explicit. Opening or browsing an archive never writes files to disk.
Changed
Frontend routing
Archive state is represented by the
archivequery parameter.Example:
This allows the existing file browser route to remain the main navigation entry point while distinguishing normal filesystem browsing from virtual archive browsing.
Read-only behavior inside archives
Archive contents are treated as read-only.
The following write actions are disabled while browsing inside an archive:
This prevents File Browser from implying that archive contents can be modified in place.
Toolbar behavior
The toolbar now adapts depending on context:
Context menu behavior
The right-click menu now includes extraction actions for:
Breadcrumb behavior
Breadcrumbs now understand archive navigation and keep the archive file as the root of the virtual archive path.
Security and safety
The archive implementation includes safeguards to reduce archive-related risks.
Implemented protections:
../paths are blockedArchive browsing and file streaming require the user to have permission to access/download the archive file itself.
Files added
Files modified
Implementation notes
The implementation reuses
github.com/mholt/archives, which was already present in the project for archive creation/download functionality.This keeps archive support inside the Go application and avoids relying on system-level binaries that may not be available in all deployments or containers.
Archive browsing is implemented as a virtual filesystem layer. Archive entries are not extracted during navigation.
Extraction remains a separate user-triggered operation.
Validation performed
The following validation was performed during patch preparation:
gofmtValidation not performed
A full local build/test run was not completed in the sandbox environment because this File Browser source requires Go
>= 1.25.0, while the available sandbox Go version is older and external toolchain download is blocked.Recommended maintainer-side validation:
go test ./... npm install npm run buildor the equivalent frontend package-manager commands used by the project.
User-facing result
After this change, users can: