- Rust 65.5%
- JavaScript 18.5%
- HTML 14.2%
- CSS 1.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| src | ||
| static | ||
| templates | ||
| tests | ||
| .gitignore | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| dprint.json | ||
| jsconfig.json | ||
| README.md | ||
GiraffePath
A web-based file browser and WebDAV server over SSH/SFTP, with OIDC authentication. No server-side installation required on the remote host — only SSH access.
Features
Core
- Browse files over SSH/SFTP
- Upload files
- Delete files (via FreeDesktop Trash)
- Restore files from Trash
- Create directories
- Create text, CSV and Office files from embedded starters
- Rename / move files and directories (with cross-filesystem support)
- Download files
- Download directories
- Preview text files
Authentication & Security
- OIDC login (Google, etc.)
- CSRF protection + PKCE in OAuth2 flow
- Session fixation prevention
- Safe post-login redirect
- WebDAV Basic Auth with app tokens (argon2id hashed, stored per-user)
- SSH keys stored encrypted
- Multiple SSH key support with host picker
WebDAV
- PROPFIND (directory listing)
- GET / HEAD
- PUT
- DELETE (sends to Trash)
- MKCOL
- MOVE
- COPY
- Per-credential ACL rules (read/write/block per path)
- Account page with WebDAV credential management (create, regenerate and delete)
File Browser UI
- Breadcrumb navigation
- Click-to-edit breadcrumb navigation
- File detail preview pane
- Lazy-load file entries via SSE
- Fuzzy file search (admin-provided index)
- Keyboard shortcuts (j/k/h/l vim navigation)
- Remember selected row when navigating back
- Multi-select with bulk delete and move
- Bookmarks (GTK/Freedesktop
~/.config/gtk-3.0/bookmarks) - Mobile-responsive layout (off-canvas sidebar, touch-friendly)
File Sharing
- Share files/directories with expiry dates
- Allow upload to shared folders
- Rename files in shared folders
Infrastructure
- SSH connection pool
- Atomic file writes (temp file + rename pattern)
- Cross-filesystem move (SSH exec
cpfallback) .envfile support- ACL enforcement in file browser
Set GIRAFFEPATH_MAX_UPLOAD_BYTES to configure the maximum size of browser and WebDAV uploads, in bytes. It defaults to 1000000000 (1 GB); the value is read once when the first upload is handled.
Text editor
Text files up to 2 MiB open in an editor (Markdown has a Preview link). Save with Save or Ctrl/Cmd+S.
Files are decoded as UTF-8, falling back to Windows-1252; other Japanese encodings can be chosen in the options
menu. Saves keep the BOM, consistent line endings and the final newline; mixed line endings become LF. The last
save wins. Binary, oversized and unknown files show a download page instead. Read-only ACLs give a read-only view.
CodeJar and Prism are vendored locally; see static/EDITOR-DEPENDENCIES.md.
Trash
Deleting a file moves it to the remote user's home trash, ~/.local/share/Trash, following the FreeDesktop.org Trash specification: the file goes to files/<id> and its metadata to info/<id>.trashinfo, with a percent-encoded Path= and a DeletionDate= timestamp. Items trashed by other tools using that layout appear in the Trash page and can be restored or deleted permanently, and items trashed here appear in their trash.
This is written to the specification and unit tested, but not yet verified against real file managers. It should work with those that implement the home trash, such as Nautilus (GNOME Files), Thunar, Nemo, PCManFM and Dolphin, and with trash-cli. Known limits:
- Only the home trash is used. Per-volume trashes (
$topdir/.Trash-$uid, for external or other mounted disks) are neither read nor written. - The
directorysizescache is not maintained. Other tools may recompute it. DeletionDatehas no timezone, so GiraffePath reads and writes it as UTC. Times may look shifted when the remote host is not on UTC.- Restoring fails if the original parent directory no longer exists, and refuses paths outside the remote home directory.
- This is a Linux/BSD desktop convention. macOS Finder and Windows use their own trash and will not see these items.
WebDAV credentials
Open Account in the sidebar to create, regenerate or delete WebDAV credentials. Choose a unique connection ID such as finder or phone (1–64 lowercase letters, digits, underscores or hyphens, starting with a letter or digit). The generated app password is shown only once. Regenerating preserves the connection ID and ACL profile, and immediately invalidates the previous password. If the ID no longer exists, regenerating creates it.
Configure your client with:
- URL:
https://your-site/{username}/webdav/ - Basic Auth username: the connection ID, not the account username
- Basic Auth password: the generated app password
ACLs are stored locally in <GIRAFFEPATH_DATA_DIR>/users/<user>/acl/. Browser access uses base.acl, and each credential uses app_{connection_id}.acl, which can only narrow base.acl. App ACLs can be edited from the account page; base.acl is view-only there. A missing ACL is initialized using the existing default rules on first connection. Deleting a credential revokes its password and closes its SSH connection after any operation already in progress. Queued operations do not run, and its ACL file is removed. To replace a password without downtime, create another credential, configure its ACL and update your client before deleting the old credential.
Credential metadata and Argon2id hashes are stored in GIRAFFEPATH_DATA_DIR/users/{username}/app_credentials, one created_at:connection_id:password_hash record per line (dates use YYYY-MM-DD), with mode 0600 and atomic replacement. Each user's credentials are loaded into memory on first access, not at startup. Manage credentials through the Account page; do not edit these files by hand or run multiple application processes against the same credential store.
Fuzzy file search
Search reads the newline-delimited ~/.cache/giraffepath/files.v1 index over SFTP. GiraffePath does not create or update the index and does not scan directories; the administrator controls which files are searchable by maintaining this file. The index itself is not subject to ACL rules, but each line (a path relative to the remote user's home directory) is checked against the user's ACL before it is shown.
For example, from the remote user's home directory:
mkdir -p ~/.cache/giraffepath
cd ~
fdfind -tf | LC_ALL=C sort > ~/.cache/giraffepath/files.v1
fdfind applies its own ignore rules and defaults. Use fdfind --hidden -tf if hidden files should be included. Sorted indexes let directory-scoped queries seek to the directory's range; unsorted indexes still work but require scanning the entries to find that range. The search form has separate Directory and Fuzzy query fields. Opening search from a directory pre-fills Directory with that location; matching includes its descendants. The fuzzy query is matched against each path relative to the selected directory. The index can be refreshed by the administrator at any time and must be smaller than 64 MiB and readable over SFTP.