Conversation
- Add is_symlink and symlink_target_fsp fields to FileInfo model - Implement symlink detection in from_stat method using lstat - Resolve symlink targets to file share paths when session is provided - Add session parameter to get_file_info, yield_file_infos, and helper methods
Update /api/files endpoint to open a database session and pass it to filestore methods, enabling symlink target resolution.
Add 7 comprehensive pytest test cases for symlink support: - Symlink detection and basic properties - Same-share symlink resolution via directory listing - Cross-share symlink resolution via directory listing - Relative symlink resolution - Symlink listing in directory (yield_file_infos) - Broken symlink handling (filtered from listings) - Symlink to directory detection All tests use mocked database sessions and verify: - is_symlink flag is correctly set - symlink_target_fsp contains correct fsp_name and subpath - Broken symlinks are skipped in directory listings - Symlinks to directories preserve is_dir=True
Add comprehensive E2E tests for symlink support: - Display symlink icon and type in file table - Navigate to symlink target within same share - Directory symlinks display as Symlink type (not Folder) - Context menu works on symlinks - Broken symlinks are not displayed - Selection shows symlink in properties panel Uses custom Playwright fixtures to create symlink test data.
…on files opens them
…in path expression Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
- flagged by CodeQL - Adds root_path parameter to _safe_readlink and from_stat to verify the symlink's parent directory is within the allowed root before calling os.readlink(). Uses parent directory check (not realpath) to preserve cross-share symlink support.
7474b38 to
4a9981e
Compare
Keep all filesystem I/O in the same method as the path validation so CodeQL can trace the sanitizer to the os.stat calls.
…nd double-hop symlinks
|
Note: commit 08fff7f adds tests for these cases we discussed - can you access sensitive data from a data link to a directory that contains a symlink to a:
It simulates a data link by using /api/content/. |
neomorphic
left a comment
There was a problem hiding this comment.
@allison-truhlar I haven't looked at the changes, but I did check out the code and create a broken symbolic link in my home directory and it is not being displayed on the site. I am guessing it is being ignored. Is there any way to show broken links in the same way that disallowed links are displayed?
@neomorphic This was added to this branch - it should look like the below. Maybe try |
I tried the dev-install and now I can see one of the broken links. I will investigate further as to why the other is not being displayed as expected. |
- Adds os.path.exists(target) check before attempting file share resolution - Returns None immediately for broken symlinks - Valid symlinks proceed to normal resolution logic
neomorphic
left a comment
There was a problem hiding this comment.
Everything looks good to me now.
…in path expression Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…rent directory - this fixes the case where the user clicks on a subdirectory and then makes a data link from the properties panel
|
@neomorphic The properties panel should now display the symlink (or broken symlink) info when a symlink is selected. Also, I confirmed that you can access data from a data link to symlink, including accessing data in subdirectories of the linked directory, and that you cannot access data via a data link to a symlink that points to a directory that is not in a valid file share path, as determined by the database file share paths. |
|
I can see the correct info in the properties panel now. Let's merge it |



Clickup id: 86aewngc6
This PR adds full support for symlinks in the file browser of Fileglancer, with visual distinction and navigation. Users can identify symlinks by a link icon and "Symlink" type label in the file table and the properties panel. Broken symlinks show a broken link icon. Clicking on a working symlink navigates to its target location within the same or different file share.
This PR also contains two related, but not symlink functionality/display only, changes:
To verify working symlink detection, display, and navigation:
/nrs/cellmap/data/jrc_22ak351-leaf-2l. You should see the N5 directory identified as a symlink. Clicking on the name, you can navigate to the symlinked path.Tests
@krokicki