Compare commits

...
78 Commits
Author SHA1 Message Date
Henrique Dias e8a388f840 chore(release): 2.63.23 2026-07-27 21:50:03 +02:00
Henrique Dias 0dfe44649c docs: cleanup header 2026-07-27 21:49:14 +02:00
Henrique Dias 05ee853eef docs: clear inconsistencies, point at repo instead of website 2026-07-27 21:47:58 +02:00
Henrique Dias afeb478ee1 chore(release): 2.63.22 2026-07-27 17:29:26 +02:00
Henrique Dias df2869993a chore: remove renovate.json 2026-07-27 17:29:12 +02:00
transifex-integration[bot] d49ab67904 chore: update translations 2026-07-27 17:24:27 +02:00
superafun cfff84306a fix: use absolute URLs for the PWA manifest icon sources (#6032) 2026-07-27 17:23:54 +02:00
Henrique Dias 72faf6dd3c fix: enforce rules on recursive operations and expired proxy tokens (#6053) 2026-07-27 17:16:58 +02:00
superafun a789f29cee fix: make the sidebar scrollable when content overflows (#6031) 2026-07-27 17:10:57 +02:00
Henrique Dias 74b13db3fa docs: fix date 2026-07-27 17:02:02 +02:00
Henrique Dias 773b30102c docs: add wind down notice 2026-07-27 16:58:50 +02:00
Henrique Dias 0b925cbca9 fix: unblock stalled and frozen uploads
A TUS PATCH rejected before its body was read left the client still streaming
a chunk. net/http gives up draining an unread request body after 256KiB and
then closes the connection, so the status we replied with was lost and the
browser saw a bare transport error instead. The client could not tell a
conflict from a network fault, retried blindly, and the upload stalled after
the first chunk — while curl, which reads the response as it writes, still
reported the status and appeared to work. Drain what is left of a rejected
chunk so the answer arrives on a connection that stays usable. The explicit
r.Body.Close() had to go with it: it ran before the drain, and the server
closes the request body itself once the handler returns.

Pressing Upload awaited a recursive listing of the whole destination subtree
before a single byte was sent, with no sign that anything was happening. On a
large destination that reads as a dead button, and the walk kept running after
the client gave up, then reported the failed write as a 500. A flat upload can
only collide with a direct child of the destination, so walk recursively only
for folder uploads, stop the walk once the request is done, and show the action
as busy while the destination is checked.

Along the way: a failed upload was credited as fully sent, so the progress bar
reported 100% when nothing had been written; the progress timer was recreated
without clearing the previous one; and the chunk size field threw on a value
with no unit and raced its own debounce on submit, so it appeared to refuse
every change.

Fixes #6006
Refs #5987
2026-07-27 16:28:17 +02:00
renovate[bot] 9dd7c7d099 chore(deps): update dependency postcss to v8.5.18 [security] (#6047) 2026-07-27 07:47:17 +02:00
Henrique Dias b24e43b06c chore: fix renovate.json order 2026-07-27 07:42:09 +02:00
renovate[bot] 91e68edb8c chore(deps): update dependency dompurify to v3.4.12 [security] (#6046) 2026-07-27 07:41:48 +02:00
Henrique Dias ac11538f08 chore: update renovate.json 2026-07-26 22:41:19 +02:00
Henrique Dias f6fb8f6bf5 chore(release): 2.63.21 2026-07-26 10:02:11 +02:00
Henrique Dias e6d70cf24c fix(http): canonicalize paths before checking access rules (#6045) 2026-07-26 10:00:18 +02:00
Henrique Dias 41e2b1bbba docs: update CLAUDE.md 2026-07-26 09:58:40 +02:00
Henrique Dias 41b01a7404 chore: update Go deps 2026-07-26 08:01:32 +02:00
Henrique Dias 0dd8905886 Revert "chore(deps): update all non-major dependencies (#5946)"
This reverts commit 032271bafa.
2026-07-26 08:00:07 +02:00
renovate[bot] 032271bafa chore(deps): update all non-major dependencies (#5946) 2026-07-26 07:58:26 +02:00
Henrique Dias 50125a5d21 chore(release): 2.63.20 2026-07-25 22:16:14 +02:00
Henrique Dias bc3d75a94a test(users): cover concurrent provisioning into one scope
Two usernames that normalize to the same home directory must not both be
provisioned when their requests are handled concurrently. Also cover that
an explicit, non-derived scope may still be legitimately shared.

Refs GHSA-j7jh-37pf-mf8h
2026-07-25 22:15:35 +02:00
Henrique Dias fb6aeba9ea fix(users): make the provisioned scope check atomic with the save
The check that stops two usernames normalizing to the same home directory
ran as a storage operation separate from the save, so two first-time users
provisioned concurrently could both observe a free scope and both be saved
into it, ending up sharing one home directory.

Move the check into users.Storage.SaveProvisioned, which holds a single
lock across the lookup and the save, and reduce CreateUserHome to deriving
and creating the directory. This covers all three provisioning paths:
signup, proxy auth and hook auth.

Refs GHSA-j7jh-37pf-mf8h
2026-07-25 22:15:27 +02:00
Henrique Dias 67e893eee7 fix: use aria-selected 2026-07-25 22:09:01 +02:00
Henrique Dias 4a4b0f8c84 docs: update CLAUDE instructions 2026-07-25 22:03:33 +02:00
Henrique Dias 660d84661d docs: update CLAUDE.md 2026-07-25 08:47:34 +02:00
Henrique Dias 392253c563 docs: update SECURITY.md and add CLAUDE.md 2026-07-25 08:42:52 +02:00
Henrique Dias 328f629181 chore(release): 2.63.19 2026-07-25 08:19:11 +02:00
Henrique Dias 4c3cb4bc9b test(http): cover TUS Upload-Length enforcement
Refs GHSA-ffv3-7h97-993q
2026-07-25 08:16:19 +02:00
Henrique Dias 3213b605be test(http): cover scope-safe removal on TUS upload eviction
Refs GHSA-m9f5-2232-frp6
2026-07-25 08:16:19 +02:00
Henrique Dias 610e0b09e9 test(http): cover download-permission gate on the checksum branch
Refs GHSA-7whw-q6gh-xr59
2026-07-25 08:16:19 +02:00
Henrique Dias 7453c78c98 test(storage): cover case-insensitive GetByScope matching
Refs GHSA-576v-w77m-gr84
2026-07-25 08:16:18 +02:00
Henrique Dias cd5749dff8 test(auth): cover per-user scope isolation for proxy and hook provisioning
Unit tests for Settings.CreateUserHome (derives a per-user home, rejects a
colliding scope, preserves an explicit scope) plus proxy and hook regression
tests asserting that with CreateUserDir enabled two provisioned users receive
distinct home directories instead of the server root.

Refs GHSA-j7jh-37pf-mf8h, GHSA-j2fc-28fx-hc8q
2026-07-25 08:16:18 +02:00
Henrique Dias 4daddec6f2 fix(http): enforce declared Upload-Length on TUS uploads
The TUS PATCH handler copied the whole request body to disk and used the
declared Upload-Length only to decide when the upload was complete. A client
could declare a tiny Upload-Length and then stream an arbitrarily large body
in a single PATCH, writing it all to disk, so any user with create permission
could exhaust the filesystem.

Bound each write to the bytes still expected (Upload-Length - Upload-Offset),
reject a PATCH whose offset already exceeds the declared length, and roll back
and reject a body that exceeds it. This complements the existing negative
Upload-Length handling.

Refs GHSA-ffv3-7h97-993q
2026-07-25 08:16:18 +02:00
Henrique Dias 9bd79c3aae fix(http): delete abandoned TUS uploads through the scoped filesystem
The in-memory upload cache deleted expired incomplete uploads with a raw
os.Remove on the absolute path it had stored, bypassing ScopedFs entirely.
Because the stored path is only lexically cleaned (no symlink evaluation) and
os.Remove resolves symlinked parent directories, a Create-only user could
register an upload and then, within the 3-minute TTL, swap an in-scope
ancestor directory for a symlink so the eviction deleted an arbitrary file
outside their scope.

Carry a removal callback with each cache entry and invoke it on eviction
instead of os.Remove. For TUS uploads the callback deletes via the uploading
user's scoped filesystem, whose Remove is guarded by the same within() check
that CVE-2026-55667 added, so eviction can no longer follow a symlink out of
scope. The redis backend ignores the callback (it never deleted partial files).

Refs GHSA-m9f5-2232-frp6
2026-07-25 08:16:18 +02:00
Henrique Dias 6c69b5cd89 fix(http): enforce download permission on the checksum branch
The ?checksum= branch of the resource GET handler read the whole file to
compute its digest and returned it without checking Perm.Download, unlike the
sibling raw, preview, subtitle and X-Encoding paths. A user provisioned with
Perm.Download=false could therefore obtain md5/sha1/sha256/sha512 digests of
files they are not allowed to download, giving a file-content hash oracle, and
force a full-file read.

Return 202 Accepted before computing the checksum when the user lacks
Perm.Download, matching the other read paths. This completes the fix for
CVE-2026-35606, whose original patch gated only the content-returning paths.

Refs GHSA-7whw-q6gh-xr59
2026-07-25 08:16:18 +02:00
Henrique Dias 4b8a8d72ce fix(storage): reject case-folded home directory collisions
GetByScope compared scopes with a case-sensitive exact match, so on a
case-insensitive filesystem two accounts whose scopes differ only in case
(e.g. /users/CaseVictim and /users/casevictim) were treated as distinct even
though both resolve to the same physical home directory. The second account
could then read, overwrite and delete the first account's files.

Match the scope case-insensitively so the collision check performed during
signup, proxy and hook provisioning catches these aliases and rejects the
duplicate.

Refs GHSA-576v-w77m-gr84
2026-07-25 08:16:18 +02:00
Henrique Dias 8ddd3d1db9 fix(auth): isolate auto-provisioned proxy and hook users to their own home
Proxy- and hook-authenticated users were auto-provisioned by applying the
default scope (".") and passing it straight to MakeUserDir, which normalizes
"." to "/". With CreateUserDir enabled, every provisioned user therefore
received the server root as its scope instead of a per-user home directory,
letting one user read, overwrite and delete another user's files.

The signup handler already cleared the scope before deriving the home
directory. Centralize that logic into Settings.CreateUserHome (clear the
scope when CreateUserDir is on and no explicit scope was supplied, derive the
home dir, then reject a scope already owned by another user) and use it from
signup, proxy and hook auth so the three provisioning paths cannot diverge.

Refs GHSA-j7jh-37pf-mf8h, GHSA-j2fc-28fx-hc8q
2026-07-25 08:16:15 +02:00
Henrique Dias 9fffee387f docs: remove go report 2026-07-25 08:00:00 +02:00
Henrique Dias 5a12cad548 docs: update readme 2026-07-25 07:52:21 +02:00
transifex-integration[bot] 6232686e22 chore: update translations 2026-07-25 07:30:18 +02:00
superafun b21b1245ae fix: accessibility and security improvements (#6033) 2026-07-25 07:30:02 +02:00
Archit Goyal 7361d91ea2 fix(upload): handle encoded path conflicts safely (#6040) 2026-07-25 07:29:49 +02:00
Henrique Dias c05c668148 fix: process --FollowExternalSymlinks 2026-07-25 07:25:26 +02:00
Henrique Dias b7dc392838 docs: fix typo 2026-07-21 19:18:51 +02:00
TowyTowyandClaude Fable 5 ac46cf0671 fix: return error instead of panicking on an unreadable directory during copy (#6020)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 07:21:44 +02:00
transifex-integration[bot] f0785391bf chore: update translations (#6019)
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-07-18 07:20:43 +02:00
tianrking 9b78324d77 fix(http): run upload hooks for directories (#6034) 2026-07-17 20:14:41 +02:00
Henrique Dias fe7efb2e6a chore(release): 2.63.18 2026-07-04 08:25:01 +02:00
transifex-integration[bot] 2651260a1c chore: update translations 2026-07-04 08:24:37 +02:00
Henrique Dias 4470288ba1 fix: deduplicate PT language 2026-07-04 08:24:17 +02:00
Henrique Dias 58d22578e8 chore: update dependencies 2026-07-04 08:23:16 +02:00
林桉 dfc2e887e1 fix: avoid recursive conflict checks for copy and move (#6009) 2026-07-04 08:13:31 +02:00
Aditya Raj Singh aac2516637 fix(preview): keep the EPUB table-of-contents button clear of the header (#6010) 2026-07-04 08:09:10 +02:00
Henrique Dias c05ead7e8e docs: warning about hook executor 2026-06-27 09:37:29 +02:00
Henrique Dias d76b7d1610 chore(release): 2.63.17 2026-06-27 09:14:08 +02:00
Henrique Dias f30fca636c fix(share): delete exact directory share on trailing-slash delete (GHSA-pp88-jhwj-5qh5)
DeleteWithPathPrefix queried the share index with the raw path, so deleting a
directory through a trailing-slash path (e.g. DELETE /api/resources/a/) only
matched descendants like /a/child and missed the exact /a share, leaving it in
storage. If the same path was later recreated, the stale public share re-exposed
the new content. Normalize the path before the prefix query so the exact share
and its descendants are both removed. Adds a regression test.
2026-06-27 09:08:57 +02:00
Henrique Dias ec13054671 fix(share): stop exposing password hash and bypass token in share API (GHSA-833g-cqhp-h72j)
The share management endpoints serialized the storage struct directly, returning
the bcrypt password_hash (crackable offline) and the bypass token for every
share an authenticated caller could list, with admins seeing them for all users.
Return a response DTO that exposes only whether a share is password-protected
(hasPassword) and drops both secrets. The storage struct keeps its tags so the
secrets stay persisted and the server-side auth/public flows are unchanged.
Updates the frontend to use hasPassword and adds a regression test.
2026-06-27 09:08:56 +02:00
Henrique Dias 883a36f02f fix(auth): reject signup when normalized home dir collides (GHSA-7rc3-g7h6-22m7)
cleanUsername is many-to-one, so distinct usernames (e.g. "teamone/x" and
"teamone-x") can normalize to the same home directory. With CreateUserDir
enabled, the second registrant silently reused the first user's directory,
breaking per-user isolation. Add a GetByScope lookup and reject a signup whose
derived scope is already taken. The check is gated on CreateUserDir: when it is
off, signups intentionally share the configured default scope. Adds a regression
test for the colliding-username case.
2026-06-27 09:08:56 +02:00
Henrique Dias 8503ba61ff fix(raw): neutralize backslashes in archive entry names (GHSA-83xp-526h-j3ww)
The fix for CVE-2026-54093 rewrote backslashes to the path separator "/" in
archive entry names. On POSIX hosts a backslash is a legal filename byte, so
that rewrite manufactured a traversal sequence ("..\..\x" -> "../../x") out
of a single in-scope file, turning a Windows-only zip-slip into a cross-platform
one. Neutralize backslashes to an inert character instead, and reject any entry
whose name is not already a normalized root-relative path. Adds a regression
test that downloads a folder containing a backslash-named file as a zip.
2026-06-27 08:39:14 +02:00
Henrique Dias 1fb05d65de docs,cmd: warn about broad scope for self-signup users (GHSA-6759-996p-gpj6)
When Signup is enabled with the default scope and createUserDir off, every
self-registered user inherits the served root and can read/modify/delete all
files. Add a startup WARNING for this configuration and document the risk and
the --createUserDir mitigation. No behavior or default change.
2026-06-27 08:18:18 +02:00
Henrique Dias 2472fbcd30 fix: normalize recursive listing paths to forward slashes (#6003) 2026-06-27 08:01:26 +02:00
JinHyuk Sung 43a404ca69 fix: match admin share paths by owner scope (#5992) 2026-06-27 07:43:22 +02:00
Rayan Salhab d9cf2f0100 fix: preserve SRT subtitle line breaks (#6002) 2026-06-27 07:28:55 +02:00
transifex-integration[bot] 6209f8fddd chore: update translations (#5990) 2026-06-27 07:19:42 +02:00
Henrique Dias bd1520fe09 chore(release): 2.63.16 2026-06-23 13:33:10 +02:00
Henrique Dias 8cfa6a175f chore(docs): update CLI documentation 2026-06-23 13:33:00 +02:00
Henrique Dias a1063925e1 fix: restore symlink behavior as opt-in followExternalSymlinks 2026-06-23 13:19:51 +02:00
Henrique Dias 64511ce45e fix: dangling symlink, write, delete scope bugs 2026-06-23 12:35:55 +02:00
Henrique Dias be23ab3a15 chore(release): 2.63.15 2026-06-13 07:20:45 +02:00
Henrique Dias ffb486e05f chore: bump minor Go dependencies 2026-06-13 07:19:01 +02:00
yfzhou 403d2bbd33 fix: restore ScopedFs RealPath (#5986) 2026-06-13 07:17:48 +02:00
Henrique Dias dfe6e5b333 chore(release): 2.63.14 2026-06-07 18:21:40 +02:00
Henrique Dias d9816b1531 chore: add symlink tests 2026-06-07 18:21:13 +02:00
Henrique Dias 7c2c0a11b3 refactor: ScopedFs to avoid escaping symlinks 2026-06-07 18:16:46 +02:00
Henrique Dias 3406d3d7f9 fix: recursive check 2026-06-07 17:12:31 +02:00
163 changed files with 4972 additions and 1754 deletions

No files matched your search

+160
View File
@@ -0,0 +1,160 @@
# CLAUDE.md
Guidance for Claude when working in this repository (File Browser, `filebrowser/filebrowser`).
## Repo orientation
- Go backend (`github.com/filebrowser/filebrowser/v2`, ecosystem `go`) + Vue frontend under `frontend/`.
- The project is in **maintenance-only mode** (see `SECURITY.md`). Prefer small, surgical, well-tested changes.
- Version scheme: `v2.63.x`. Conventional-commit messages (`fix(scope): …`, `feat: …`, `chore: …`).
- Verify with `go build ./...`, `go vet ./...`, `go test ./...`. Reuse existing test harnesses (e.g. `signToken`, `scopedUserStorage`, `handle`, `customFSUser`, `mockUserStore`).
---
# Handling security advisories
Use this playbook when asked to triage, verify, fix, or manage GitHub security advisories.
All advisory state lives on GitHub and is driven with the `gh` CLI. States are
`triage → draft → published`, plus `closed`.
## 1. Fetch
```bash
# List by state (also: published, draft, closed)
gh api '/repos/filebrowser/filebrowser/security-advisories?state=triage&per_page=100' \
--jq '.[] | {ghsa_id, severity, summary, state}'
# Full report for one advisory (read .summary and .description)
gh api /repos/filebrowser/filebrowser/security-advisories/GHSA-xxxx-xxxx-xxxx \
--jq '.summary, "---", .description'
```
Always pull the **published** set too — you need it to dedup against.
## 2. Verify each report — do NOT trust the report text
Read the actual source **at HEAD** and reach one verdict per advisory:
- **CONFIRMED** — defect exists at HEAD. Quote the exact `file:line`.
- **FIXED** — already patched (find the fix commit).
- **FALSE / NOT APPLICABLE** — claim is wrong, or targets a different project.
- **NOT EXPLOITABLE** — pattern exists but no code path can reach the precondition.
- **DUPLICATE** — of a published advisory, or of another triage advisory.
Common traps — check each before accepting a report:
- **"Incomplete fix of a prior advisory."** Read the original fix commit and confirm the *specific*
sibling code path is actually still unguarded — a prior fix may already cover a related path.
- **Wrong project.** Confirm the referenced files, symbols, and endpoints exist in this repo; reports
sometimes describe a fork. If the cited code isn't here, close as not applicable.
- **"Legacy / upgraded / imported records are affected."** Trace the field's git history and confirm that
some released version could actually produce such a record before believing it
(`git log -S'Field' -- path`, `git show <commit>`, `git tag --contains <commit>`).
- **Overlapping reports.** Two triage advisories may share one root cause — consolidate and fix once.
- **Known, intentionally-unaddressed classes.** Some areas are known and tracked but not fixed (see
`SECURITY.md`'s Known Issues); matching reports are duplicates.
Record, per advisory: verdict, the `file:line` evidence, exploitability preconditions
(default config? platform-specific? auth required?), and the disposition.
## 3. Fix (one commit per advisory)
- Branch off `master` first; never commit fixes directly to `master`.
- **One commit per fix**, each referencing the GHSA in the body (`Refs GHSA-xxxx-xxxx-xxxx`).
- When several advisories share a root cause because parallel code paths diverged, **centralize** the logic
(e.g. `settings.CreateUserHome` used by signup, proxy, and hook provisioning) so they cannot drift again.
- Keep it surgical; match surrounding style.
## 4. Add a regression test per fix
- Reuse the existing harnesses; add a focused test asserting the fixed behavior (and that the legitimate
path still works). Commit tests alongside the fixes (`test(scope): …`, `Refs GHSA-…`).
- Run `go test ./... && go vet ./...` before finishing.
## 5. Severity — set a CVSS vector, don't hand-assert
Set a CVSS v3.1 vector; GitHub derives the score **and** severity from it (overriding the plain `severity`
field). Encode the real preconditions in the vector so the band is defensible:
- Requires a specific target configuration/platform (e.g. case-insensitive FS) → **AC:H**.
- Unauthenticated vs needs an account → **PR:N / PR:L**.
- Keep it consistent with the **predecessor CVE's** rating (an incomplete-fix follow-up should not outrank
its parent). Bands: `0.1–3.9` low, `4.0–6.9` medium, `7.0–8.9` high, `9.0–10.0` critical.
```bash
gh api -X PATCH /repos/filebrowser/filebrowser/security-advisories/GHSA-xxxx-xxxx-xxxx \
-f cvss_vector_string='CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H' \
--jq '{ghsa_id, severity, score: .cvss.score, vector: .cvss.vector_string}'
```
## 6. Clean up the title
Rewrite reporter titles to the concise, sentence-case, backtick-free style of the published advisories
(state the vuln; drop "Incomplete fix of…" prefixes and jargon). The title is the `summary` field:
```bash
gh api -X PATCH .../security-advisories/GHSA-xxxx-xxxx-xxxx \
-f summary='Proxy-auth auto-provisioning ignores createUserDir and grants the server root scope'
```
## 7. Rewrite the body into the standard structure
Reporter reports arrive in whatever shape the reporter used. Before drafting, rewrite the
`description` into the sections below — **reusing the reporter's own wording wherever it is
accurate**, rather than paraphrasing it. Drop the greeting, the offer to help, and any claim the
verification in step 2 disproved. Keep sections in this order and omit the ones that don't apply:
| Section | Contents |
| --- | --- |
| `## Summary` | What the defect is, in two or three sentences. Note the version it was reported against and the range it was verified over. |
| `## Details` | Root cause, naming `file.go`, the function, and a short quote of the **pre-fix** code. |
| `## PoC` | The reporter's reproduction steps and observed result, trimmed to the essentials. |
| `## Impact` | Who can exploit it (privilege level, preconditions) and what they get. |
| `## Patches` | Fixed version plus a link to the fix commit, and one sentence on what the fix does. Mention it if the reporter re-tested and confirmed. |
| `## Workarounds` | Real mitigations, or `None. Upgrade to vX.Y.Z.` |
| `## Out of scope` | Anything in the original report deliberately **not** treated as a vulnerability, with the reasoning. Needed whenever the advisory is narrower than the report. |
| `## References` | Fix and regression-test commit links. |
Use `##` headings (matching the published advisories) and keep the body in the maintainer's voice —
first person ("I reproduced…") belongs only inside quoted PoC steps.
Send it as a file so the Markdown survives shell quoting:
```bash
jq -Rs '{description: .}' desc.md \
| gh api -X PATCH .../security-advisories/GHSA-xxxx-xxxx-xxxx --input -
```
## 8. Set affected & patched versions
The package is always `{ecosystem: "go", name: "github.com/filebrowser/filebrowser/v2"}`.
- `vulnerable_version_range` — `<= <latest released version>` (the newest tag; find it with
`git tag --list 'v2.*' --sort=-version:refname | head -1`).
- `patched_versions` — the **next** release that will actually ship the fix. It doesn't exist just
because the branch does; it still has to be cut. **When unsure which version that will be, ask.**
Replace the placeholder versions below before sending:
```bash
printf '%s' '{"vulnerabilities":[{"package":{"ecosystem":"go","name":"github.com/filebrowser/filebrowser/v2"},"vulnerable_version_range":"<= <latest>","patched_versions":"<next>","vulnerable_functions":[]}]}' \
| gh api -X PATCH .../security-advisories/GHSA-xxxx-xxxx-xxxx --input -
```
## 9. Move state / close, by disposition
```bash
gh api -X PATCH .../security-advisories/GHSA-xxxx-xxxx-xxxx -f state=draft # fixed, awaiting release
gh api -X PATCH .../security-advisories/GHSA-xxxx-xxxx-xxxx -f state=closed # duplicate / N-A / not-exploitable
```
- **CONFIRMED & fixed** → metadata done → **draft**. Publish after the patched release ships.
- **DUPLICATE / NOT APPLICABLE / NOT EXPLOITABLE** → **closed**.
- **DEFERRED** (confirmed but not yet fixed) → leave in **triage** with a note.
- The REST API **cannot post advisory comments** — replies to reporters (dup notice, evidence, links to
the relevant tracking issue) must be posted manually in the advisory UI. Draft the text for the maintainer.
## 10. Release & publish
Push the branch, open a PR, merge, tag/release the `patched_versions` you set, then publish the drafts.
Confirm outward-facing/irreversible advisory actions (close, publish) with the maintainer before doing them.
+2 -2
View File
@@ -10,7 +10,7 @@
Before submitting your PR, please indicate which issues are either fixed or closed by this PR. See [GitHub Help: Closing issues using keywords](https://help.github.com/articles/closing-issues-via-commit-messages/).
- [ ] I am aware the project is currently in **maintenance-only** mode and new feature requests won't be accepted. See [README](https://github.com/filebrowser/community/blob/master/README.md)
- [ ] I am aware this project is being **archived on 2026-09-01** and that no further changes will be merged, including bug fixes. See [README](https://github.com/filebrowser/filebrowser/blob/master/README.md)
- [ ] I am aware that translations MUST be made through [Transifex](https://app.transifex.com/file-browser/file-browser/) and that this PR is NOT a translation update
- [ ] I am making a PR against the `master` branch.
- [ ] I am sure File Browser can be successfully built. See [builds](https://github.com/filebrowser/community/blob/master/builds.md) and [development](https://github.com/filebrowser/community/blob/master/development.md).
- [ ] I am sure File Browser can be successfully built. See [CONTRIBUTING.md](https://github.com/filebrowser/filebrowser/blob/master/CONTRIBUTING.md).
-52
View File
@@ -1,52 +0,0 @@
name: Docs
on:
pull_request:
paths:
- 'www'
- '*.md'
push:
branches:
- master
jobs:
build:
name: Build Docs
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Install Task
uses: go-task/setup-task@v2
- name: Build site
run: task docs
build-and-release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
name: Build and Release Docs
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Install Task
uses: go-task/setup-task@v2
- name: Build site
run: task docs
- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v5
with:
path: www/public
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v5
+87
View File
@@ -2,6 +2,93 @@
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
## [2.63.23](https://github.com/filebrowser/filebrowser/compare/v2.63.22...v2.63.23) (2026-07-27)
## [2.63.22](https://github.com/filebrowser/filebrowser/compare/v2.63.21...v2.63.22) (2026-07-27)
### Bug Fixes
* enforce rules on recursive operations and expired proxy tokens ([#6053](https://github.com/filebrowser/filebrowser/issues/6053)) ([72faf6d](https://github.com/filebrowser/filebrowser/commit/72faf6dd3c85628e332d3e567124b86708ce2695))
* make the sidebar scrollable when content overflows ([#6031](https://github.com/filebrowser/filebrowser/issues/6031)) ([a789f29](https://github.com/filebrowser/filebrowser/commit/a789f29ceec4734e7471592921d1ce67f1a10a7e))
* unblock stalled and frozen uploads ([0b925cb](https://github.com/filebrowser/filebrowser/commit/0b925cbca940fe0b2726827cf66783da05c64f5e)), closes [#6006](https://github.com/filebrowser/filebrowser/issues/6006), references [#5987](https://github.com/filebrowser/filebrowser/issues/5987)
* use absolute URLs for the PWA manifest icon sources ([#6032](https://github.com/filebrowser/filebrowser/issues/6032)) ([cfff843](https://github.com/filebrowser/filebrowser/commit/cfff84306af66deedfdc9248300919b3ddd9a7f0))
## [2.63.21](https://github.com/filebrowser/filebrowser/compare/v2.63.20...v2.63.21) (2026-07-26)
### Bug Fixes
* **http:** canonicalize paths before checking access rules ([#6045](https://github.com/filebrowser/filebrowser/issues/6045)) ([e6d70cf](https://github.com/filebrowser/filebrowser/commit/e6d70cf24c0cd79a1787601dc99104ec7e7ca3ef))
### Reverts
* Revert "chore(deps): update all non-major dependencies (#5946)" ([0dd8905](https://github.com/filebrowser/filebrowser/commit/0dd89058867f87a7bc04aa7517d21528a280e27c)), references [#5946](https://github.com/filebrowser/filebrowser/issues/5946)
## [2.63.20](https://github.com/filebrowser/filebrowser/compare/v2.63.19...v2.63.20) (2026-07-25)
### Bug Fixes
* use aria-selected ([67e893e](https://github.com/filebrowser/filebrowser/commit/67e893eee7ee411e166d3fcd759a87b6f0971277))
* **users:** make the provisioned scope check atomic with the save ([fb6aeba](https://github.com/filebrowser/filebrowser/commit/fb6aeba9eae7b8eb401e0db325973781e1ffd08b))
## [2.63.19](https://github.com/filebrowser/filebrowser/compare/v2.63.18...v2.63.19) (2026-07-25)
### Bug Fixes
* accessibility and security improvements ([#6033](https://github.com/filebrowser/filebrowser/issues/6033)) ([b21b124](https://github.com/filebrowser/filebrowser/commit/b21b1245ae1b57f031b2f5d787f32a17532402c0))
* **auth:** isolate auto-provisioned proxy and hook users to their own home ([8ddd3d1](https://github.com/filebrowser/filebrowser/commit/8ddd3d1db9b9f5727d0bf96ea0e7d9a25a8692b4))
* **http:** delete abandoned TUS uploads through the scoped filesystem ([9bd79c3](https://github.com/filebrowser/filebrowser/commit/9bd79c3aaeb4a55b0e69cf8976c4a258db2f5e06))
* **http:** enforce declared Upload-Length on TUS uploads ([4daddec](https://github.com/filebrowser/filebrowser/commit/4daddec6f200b03a721197d8c0b4b652c994894e))
* **http:** enforce download permission on the checksum branch ([6c69b5c](https://github.com/filebrowser/filebrowser/commit/6c69b5cd895e15b29e563200a9a6dfc27b06525e))
* **http:** run upload hooks for directories ([#6034](https://github.com/filebrowser/filebrowser/issues/6034)) ([9b78324](https://github.com/filebrowser/filebrowser/commit/9b78324d773c790951cc6a97840c4b55f66b5f3d))
* process --FollowExternalSymlinks ([c05c668](https://github.com/filebrowser/filebrowser/commit/c05c66814891c3cccef394162e428444b53394e4))
* return error instead of panicking on an unreadable directory during copy ([#6020](https://github.com/filebrowser/filebrowser/issues/6020)) ([ac46cf0](https://github.com/filebrowser/filebrowser/commit/ac46cf06719575477d5125e7472037c204b3702d))
* **storage:** reject case-folded home directory collisions ([4b8a8d7](https://github.com/filebrowser/filebrowser/commit/4b8a8d72ce554dde378b5091da74aa930ea18327))
* **upload:** handle encoded path conflicts safely ([#6040](https://github.com/filebrowser/filebrowser/issues/6040)) ([7361d91](https://github.com/filebrowser/filebrowser/commit/7361d91ea2e8cc200a0f40ac84adcd02aedc9ed2))
## [2.63.18](https://github.com/filebrowser/filebrowser/compare/v2.63.17...v2.63.18) (2026-07-04)
### Bug Fixes
* avoid recursive conflict checks for copy and move ([#6009](https://github.com/filebrowser/filebrowser/issues/6009)) ([dfc2e88](https://github.com/filebrowser/filebrowser/commit/dfc2e887e1a19d54984a0d7e39a2a63caf73ef19))
* deduplicate PT language ([4470288](https://github.com/filebrowser/filebrowser/commit/4470288ba1828a14453a99348fd22c62aa0b9460))
* **preview:** keep the EPUB table-of-contents button clear of the header ([#6010](https://github.com/filebrowser/filebrowser/issues/6010)) ([aac2516](https://github.com/filebrowser/filebrowser/commit/aac25166378422135e624e305c410c54a39374fb))
## [2.63.17](https://github.com/filebrowser/filebrowser/compare/v2.63.16...v2.63.17) (2026-06-27)
### Bug Fixes
* **auth:** reject signup when normalized home dir collides (GHSA-7rc3-g7h6-22m7) ([883a36f](https://github.com/filebrowser/filebrowser/commit/883a36f02fcb69566a8628cb47f18fdc73348387))
* match admin share paths by owner scope ([#5992](https://github.com/filebrowser/filebrowser/issues/5992)) ([43a404c](https://github.com/filebrowser/filebrowser/commit/43a404ca69bf25553bfbbb2b446f0f53077c6302))
* normalize recursive listing paths to forward slashes ([#6003](https://github.com/filebrowser/filebrowser/issues/6003)) ([2472fbc](https://github.com/filebrowser/filebrowser/commit/2472fbcd30502606feb11fbc8b8dc4f3803e6641))
* preserve SRT subtitle line breaks ([#6002](https://github.com/filebrowser/filebrowser/issues/6002)) ([d9cf2f0](https://github.com/filebrowser/filebrowser/commit/d9cf2f0100d2c4892cad8e339eacca96df1aa5b6))
* **raw:** neutralize backslashes in archive entry names (GHSA-83xp-526h-j3ww) ([8503ba6](https://github.com/filebrowser/filebrowser/commit/8503ba61ff51d48a7313896483d130eb6a5abfe0))
* **share:** delete exact directory share on trailing-slash delete (GHSA-pp88-jhwj-5qh5) ([f30fca6](https://github.com/filebrowser/filebrowser/commit/f30fca636c1af9ef401e9a82ff60391cb3db97e1))
* **share:** stop exposing password hash and bypass token in share API (GHSA-833g-cqhp-h72j) ([ec13054](https://github.com/filebrowser/filebrowser/commit/ec130546713c44cd24556907552ac554c7f809c9))
## [2.63.16](https://github.com/filebrowser/filebrowser/compare/v2.63.15...v2.63.16) (2026-06-23)
### Bug Fixes
* dangling symlink, write, delete scope bugs ([64511ce](https://github.com/filebrowser/filebrowser/commit/64511ce45e3be379e965f7f4fb0929a068d5bb81))
* restore symlink behavior as opt-in followExternalSymlinks ([a106392](https://github.com/filebrowser/filebrowser/commit/a1063925e15ef27f9d5dc26aae371bbf52af608c))
## [2.63.15](https://github.com/filebrowser/filebrowser/compare/v2.63.14...v2.63.15) (2026-06-13)
### Bug Fixes
* restore ScopedFs RealPath ([#5986](https://github.com/filebrowser/filebrowser/issues/5986)) ([403d2bb](https://github.com/filebrowser/filebrowser/commit/403d2bbd3357aa57e78745b52dcdad3490901bb3))
## [2.63.14](https://github.com/filebrowser/filebrowser/compare/v2.63.13...v2.63.14) (2026-06-07)
### Bug Fixes
* recursive check ([3406d3d](https://github.com/filebrowser/filebrowser/commit/3406d3d7f98dfc3c16e4ff7ff4a87e3bdfe221dd))
### Refactorings
* ScopedFs to avoid escaping symlinks ([7c2c0a1](https://github.com/filebrowser/filebrowser/commit/7c2c0a11b31b2bb214d741005a0b02b1764208b3))
## [2.63.13](https://github.com/filebrowser/filebrowser/compare/v2.63.12...v2.63.13) (2026-06-06)
+5 -18
View File
@@ -1,6 +1,6 @@
# Contributing
# Building File Browser
If you're interested in contributing to this project, this is the best place to start. Before contributing to this project, please take a bit of time to read our [Code of Conduct](code-of-conduct.md). Also, note that this project is open-source and licensed under [Apache License 2.0](LICENSE).
This project is archived on 2026-09-01. Pull requests are not accepted and no further changes are merged. This document is kept as build documentation for anyone wishing to build the project from source.
## Project Structure
@@ -75,18 +75,10 @@ go run .
## Documentation
We rely on Docker to abstract all the dependencies required for building the documentation.
To build the documentation to `www/public`:
Documentation lives in [`docs`](docs) as plain Markdown and is no longer built into a site. The command line reference in [`docs/cli`](docs/cli) is generated from the commands themselves:
```bash
task docs
```
To start a local server on port `8000` to view the built documentation:
```bash
task docs:serve
task docs:cli:generate
```
## Release
@@ -99,12 +91,7 @@ task release
## Translations
Translations are managed on Transifex, which is an online website where everyone can contribute and translate strings for our project. It automatically syncs with the main language file \(in English\) and,, for you to contribute, you just need to:
1. Go to our Transifex web page: [app.transifex.com/file-browser/file-browser](https://app.transifex.com/file-browser/file-browser/)
2. Click on **Join the project** and pick your language. We'll accept you as soon as possible. If you're language is not on the list, please request it via the interface.
Translations are automatically pushed to GitHub via an integration.
The Transifex integration stopped on 2026-09-01 and translations submitted there no longer reach this repository. Locale files live in [`frontend/src/i18n`](frontend/src/i18n) and can be edited directly.
## Authentication Provider
+23 -21
View File
@@ -1,31 +1,33 @@
<p align="center">
<img src="https://raw.githubusercontent.com/filebrowser/filebrowser/master/branding/banner.png" width="550"/>
</p>
> [!WARNING]
>
> **File Browser is archived on 2026-09-01**. The last planned release has already shipped. There will be no further releases, bug fixes, or security fixes.
[![Build](https://github.com/filebrowser/filebrowser/actions/workflows/ci.yaml/badge.svg)](https://github.com/filebrowser/filebrowser/actions/workflows/ci.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/filebrowser/filebrowser/v2)](https://goreportcard.com/report/github.com/filebrowser/filebrowser/v2)
[![Version](https://img.shields.io/github/release/filebrowser/filebrowser.svg)](https://github.com/filebrowser/filebrowser/releases/latest)
<p align="center">
<img src="./branding/banner.png" width="550"/>
</p>
File Browser provides a file managing interface within a specified directory and it can be used to upload, delete, preview and edit your files. It is a **create-your-own-cloud**-kind of software where you can just install it on your server, direct it to a path and access your files through a nice web interface.
**Background:** [Update On File Browser](https://hacdias.com/2026/03/11/filebrowser/), March 2026.
## Security
Published advisories are listed under [security advisories](https://github.com/filebrowser/filebrowser/security/advisories), and reporting instructions are in [SECURITY.md](SECURITY.md). This project has known security issue classes that remain unaddressed and will not be fixed:
- **Command execution, runner, and hooks** (opt-in, disabled by default, [#5199](https://github.com/filebrowser/filebrowser/issues/5199))
- **Session and JWT handling** ([#5216](https://github.com/filebrowser/filebrowser/issues/5216))
If you keep running File Browser, treat it as unmaintained software:
- **Do not expose it directly to the internet.** Put it behind a reverse proxy that terminates TLS and performs its own authentication.
- **Keep the command runner disabled.** It is off by default, so leave it off. See [#5199](https://github.com/filebrowser/filebrowser/issues/5199) and [`docs/command-execution.md`](docs/command-execution.md).
- **Run it unprivileged, inside a container**, with only the directory you intend to serve mounted into it.
## Documentation
Documentation on how to install, configure, and contribute to this project is hosted at [filebrowser.org](https://filebrowser.org).
Documentation on how to install, configure, and build this project lives in [`docs`](docs) in this repository.
## Project Status
This project is a finished product which fulfills its goal: be a single binary web File Browser which can be run by anyone anywhere. That means that File Browser is currently on **maintenance-only** mode. Therefore, please note the following:
- It can take a while until someone gets back to you. Please be patient.
- [Issues](https://github.com/filebrowser/filebrowser/issues) are meant to track bugs. Unrelated issues will be converted into [discussions](https://github.com/filebrowser/filebrowser/discussions).
- The priority is triaging issues, addressing security issues and reviewing pull requests meant to solve bugs.
- No new features are planned. Pull requests for new features are not guaranteed to be reviewed.
Please read [@hacdias' personal reflection](https://hacdias.com/2026/03/11/filebrowser/) on the project status.
## Contributing
Contributions are always welcome. To start contributing to this project, read our [guidelines](CONTRIBUTING.md) first.
[CONTRIBUTING.md](CONTRIBUTING.md) documents how to build and develop the project, which remains useful to anyone forking it.
## License
+19 -15
View File
@@ -2,25 +2,29 @@
## Supported Versions
Use this section to tell people about which versions of your project are
currently being supported with security updates.
No version receives security fixes. The last planned release has already shipped and no further changes will be merged.
| Version | Supported |
| ------- | ------------------ |
| 2.x | :white_check_mark: |
| < 2.0 | :x: |
| Version | Supported |
| ------- | --------- |
| 2.x | ❌ |
| < 2.0 | ❌ |
## Before Reporting
This project is being wound down. To avoid duplicates, first check the [existing advisories](https://github.com/filebrowser/filebrowser/security/advisories) and open issues, and confirm:
- **It concerns this project, not a fork.** Reports about code, features, or endpoints that don't exist here belong to the relevant fork.
- **It isn't an already-known class** that remains unaddressed. Those are listed under [Security](README.md#security) in the README; reports covering them are likely to be closed as duplicates.
## Reporting a Vulnerability
Vulnerabilities with critical impact should be reported on the [Security](https://github.com/filebrowser/filebrowser/security) page of this repository, which is a private way of communicating vulnerabilities to maintainers. This project is in maintenance-only mode and it can take a while until someone gets back to you.
Until 2026-09-01, report privately via the [Security](https://github.com/filebrowser/filebrowser/security) page. After that date this repository is read-only and reports can no longer be submitted.
If it is not a critical vulnerability, please open an issue and we will categorize it as a security issue. By giving visibility, we can get more help from the community at fixing such issues.
Please include, where possible:
When reporting an issue, where possible, please provide at least:
- The commit the issue was found at
- A plaintext proof of concept (no binaries)
- Steps to reproduce
- Recommended remediation, if any
* The commit version the issue was identified at
* A proof of concept (plaintext; no binaries)
* Steps to reproduce
* Your recommended remediation(s), if any.
The File Browser team is a volunteer-only effort, and may reach back out for clarification.
No fix will ship for any report: the last planned release has already shipped and no further changes will be merged. Reports may still be published as advisories so that people running File Browser can assess their exposure.
+5 -31
View File
@@ -1,14 +1,5 @@
version: '3'
vars:
SITE_DOCKER_FLAGS: >-
-v ./www:/docs
-v ./LICENSE:/docs/docs/LICENSE
-v ./SECURITY.md:/docs/docs/security.md
-v ./CHANGELOG.md:/docs/docs/changelog.md
-v ./CODE-OF-CONDUCT.md:/docs/docs/code-of-conduct.md
-v ./CONTRIBUTING.md:/docs/docs/contributing.md
tasks:
build:frontend:
desc: Build frontend assets
@@ -48,9 +39,9 @@ tasks:
desc: Create a new release
cmds:
- task: docs:cli:generate
- git add www/docs/cli
- git add docs/cli
- |
if [[ `git status www/docs/cli --porcelain` ]]; then
if [[ `git status docs/cli --porcelain` ]]; then
git commit -m 'chore(docs): update CLI documentation'
fi
- task: release:dry-run
@@ -58,26 +49,9 @@ tasks:
docs:cli:generate:
cmds:
- rm -rf www/docs/cli
- mkdir -p www/docs/cli
- rm -rf docs/cli
- mkdir -p docs/cli
- go run . docs
generates:
- www/docs/cli
- docs/cli
docs:docker:generate:
internal: true
cmds:
- docker build -f www/Dockerfile --progress=plain -t filebrowser.site www
docs:
desc: Generate documentation
cmds:
- rm -rf www/public
- task: docs:docker:generate
- docker run --rm {{.SITE_DOCKER_FLAGS}} filebrowser.site build -d "public"
docs:serve:
desc: Serve documentation
cmds:
- task: docs:docker:generate
- docker run --rm -it -p 8000:8000 {{.SITE_DOCKER_FLAGS}} filebrowser.site
+9 -8
View File
@@ -68,7 +68,7 @@ func (a *HookAuth) Auth(r *http.Request, usr users.Store, stg *settings.Settings
case "block":
return nil, os.ErrPermission
case "pass":
u, err := a.Users.Get(a.Server.Root, a.Cred.Username)
u, err := a.Users.Get(a.Server.Root, a.Server.FollowExternalSymlinks, a.Cred.Username)
if err != nil || !users.CheckPwd(a.Cred.Password, u.Password) {
return nil, os.ErrPermission
}
@@ -129,7 +129,7 @@ func (a *HookAuth) GetValues(s string) {
// SaveUser updates the existing user or creates a new one when not found
func (a *HookAuth) SaveUser() (*users.User, error) {
u, err := a.Users.Get(a.Server.Root, a.Cred.Username)
u, err := a.Users.Get(a.Server.Root, a.Server.FollowExternalSymlinks, a.Cred.Username)
if err != nil && !errors.Is(err, fberrors.ErrNotExist) {
return nil, err
}
@@ -157,15 +157,16 @@ func (a *HookAuth) SaveUser() (*users.User, error) {
}
u = a.GetUser(d)
userHome, err := a.Settings.MakeUserDir(u.Username, u.Scope, a.Server.Root)
// A scope explicitly returned by the hook takes precedence over the
// automatic per-user home directory derivation.
_, explicitScope := a.Fields.Values["user.scope"]
derivedScope, err := a.Settings.CreateUserHome(u, a.Server.Root, explicitScope)
if err != nil {
return nil, fmt.Errorf("user: failed to mkdir user home dir: [%s]", userHome)
return nil, err
}
u.Scope = userHome
log.Printf("user: %s, home dir: [%s].", u.Username, userHome)
log.Printf("user: %s, home dir: [%s].", u.Username, u.Scope)
err = a.Users.Save(u)
if err != nil {
if err := a.Users.SaveProvisioned(u, derivedScope); err != nil {
return nil, err
}
} else if p := !users.CheckPwd(a.Cred.Password, u.Password); len(a.Fields.Values) > 1 || p {
+68
View File
@@ -5,6 +5,9 @@ import (
"path/filepath"
"runtime"
"testing"
"github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/v2/users"
)
// writeHookScript writes a POSIX shell script to a temp file and returns its
@@ -86,3 +89,68 @@ fi
t.Fatalf("expected action %q, got %q", "auth", action)
}
}
// newHookAuth builds a HookAuth for a freshly provisioned user with the given
// parsed hook fields (hook.action=auth is added automatically).
func newHookAuth(store *mockUserStore, s *settings.Settings, srv *settings.Server, username string, fields map[string]string) *HookAuth {
fields["hook.action"] = "auth"
return &HookAuth{
Users: store,
Settings: s,
Server: srv,
Cred: hookCred{Username: username, Password: "a-strong-password"},
Fields: hookFields{Values: fields},
}
}
// With CreateUserDir enabled and no explicit scope from the hook, a provisioned
// hook user must receive its own home directory rather than the server root.
func TestHookSaveUserCreateUserDirIsolatesScope(t *testing.T) {
t.Parallel()
store := &mockUserStore{users: make(map[string]*users.User)}
srv := &settings.Server{Root: t.TempDir()}
s := &settings.Settings{
Key: []byte("key"),
CreateUserDir: true,
UserHomeBasePath: "/users",
Defaults: settings.UserDefaults{
Scope: ".",
Perm: users.Permissions{Create: true},
},
}
u, err := newHookAuth(store, s, srv, "alice", map[string]string{}).SaveUser()
if err != nil {
t.Fatalf("SaveUser error: %v", err)
}
if u.Scope != "/users/alice" {
t.Errorf("hook user without explicit scope: expected /users/alice, got %q", u.Scope)
}
}
// A scope explicitly returned by the hook takes precedence over the automatic
// per-user home directory derivation.
func TestHookSaveUserRespectsExplicitScope(t *testing.T) {
t.Parallel()
store := &mockUserStore{users: make(map[string]*users.User)}
srv := &settings.Server{Root: t.TempDir()}
s := &settings.Settings{
Key: []byte("key"),
CreateUserDir: true,
UserHomeBasePath: "/users",
Defaults: settings.UserDefaults{
Scope: ".",
Perm: users.Permissions{Create: true},
},
}
u, err := newHookAuth(store, s, srv, "teamlead", map[string]string{"user.scope": "/shared/team"}).SaveUser()
if err != nil {
t.Fatalf("SaveUser error: %v", err)
}
if u.Scope != "/shared/team" {
t.Errorf("explicit hook scope should win, got %q", u.Scope)
}
}
+1 -1
View File
@@ -55,7 +55,7 @@ func (a JSONAuth) Auth(r *http.Request, usr users.Store, _ *settings.Settings, s
}
}
u, err := usr.Get(srv.Root, cred.Username)
u, err := usr.Get(srv.Root, srv.FollowExternalSymlinks, cred.Username)
hash := dummyHash
if err == nil {
+1 -1
View File
@@ -15,7 +15,7 @@ type NoAuth struct{}
// Auth uses authenticates user 1.
func (a NoAuth) Auth(_ *http.Request, usr users.Store, _ *settings.Settings, srv *settings.Server) (*users.User, error) {
return usr.Get(srv.Root, uint(1))
return usr.Get(srv.Root, srv.FollowExternalSymlinks, uint(1))
}
// LoginPage tells that no auth doesn't require a login page.
+4 -7
View File
@@ -20,7 +20,7 @@ type ProxyAuth struct {
// Auth authenticates the user via an HTTP header.
func (a ProxyAuth) Auth(r *http.Request, usr users.Store, setting *settings.Settings, srv *settings.Server) (*users.User, error) {
username := r.Header.Get(a.Header)
user, err := usr.Get(srv.Root, username)
user, err := usr.Get(srv.Root, srv.FollowExternalSymlinks, username)
if errors.Is(err, fberrors.ErrNotExist) {
return a.createUser(usr, setting, srv, username)
}
@@ -50,15 +50,12 @@ func (a ProxyAuth) createUser(usr users.Store, setting *settings.Settings, srv *
user.Perm.Execute = false
user.Commands = []string{}
var userHome string
userHome, err = setting.MakeUserDir(user.Username, user.Scope, srv.Root)
if err != nil {
var derivedScope bool
if derivedScope, err = setting.CreateUserHome(user, srv.Root, false); err != nil {
return nil, err
}
user.Scope = userHome
err = usr.Save(user)
if err != nil {
if err = usr.SaveProvisioned(user, derivedScope); err != nil {
return nil, err
}
+67 -4
View File
@@ -2,6 +2,7 @@ package auth
import (
"net/http"
"strings"
"testing"
fberrors "github.com/filebrowser/filebrowser/v2/errors"
@@ -13,7 +14,7 @@ type mockUserStore struct {
users map[string]*users.User
}
func (m *mockUserStore) Get(_ string, id interface{}) (*users.User, error) {
func (m *mockUserStore) Get(_ string, _ bool, id interface{}) (*users.User, error) {
if v, ok := id.(string); ok {
if u, ok := m.users[v]; ok {
return u, nil
@@ -22,14 +23,33 @@ func (m *mockUserStore) Get(_ string, id interface{}) (*users.User, error) {
return nil, fberrors.ErrNotExist
}
func (m *mockUserStore) Gets(_ string) ([]*users.User, error) { return nil, nil }
func (m *mockUserStore) Update(_ *users.User, _ ...string) error { return nil }
func (m *mockUserStore) GetByScope(scope string) (*users.User, error) {
for _, u := range m.users {
if strings.EqualFold(u.Scope, scope) {
return u, nil
}
}
return nil, fberrors.ErrNotExist
}
func (m *mockUserStore) Gets(_ string, _ bool) ([]*users.User, error) { return nil, nil }
func (m *mockUserStore) Update(_ *users.User, _ ...string) error { return nil }
func (m *mockUserStore) Save(user *users.User) error {
m.users[user.Username] = user
return nil
}
func (m *mockUserStore) SaveProvisioned(user *users.User, derivedScope bool) error {
if derivedScope {
if _, err := m.GetByScope(user.Scope); err == nil {
return fberrors.ErrExist
}
}
return m.Save(user)
}
func (m *mockUserStore) Delete(_ interface{}) error { return nil }
func (m *mockUserStore) LastUpdate(_ uint) int64 { return 0 }
func (m *mockUserStore) LastUpdate(_ uint) int64 { return 0 }
func TestProxyAuthCreateUserRestrictsDefaults(t *testing.T) {
t.Parallel()
@@ -77,3 +97,46 @@ func TestProxyAuthCreateUserRestrictsDefaults(t *testing.T) {
t.Error("auto-provisioned proxy user should retain Create permission from defaults")
}
}
// With CreateUserDir enabled, two distinct proxy-authenticated users must each
// receive their own home directory instead of both inheriting the server root.
func TestProxyAuthCreateUserDirIsolatesScope(t *testing.T) {
t.Parallel()
store := &mockUserStore{users: make(map[string]*users.User)}
srv := &settings.Server{Root: t.TempDir()}
s := &settings.Settings{
Key: []byte("key"),
AuthMethod: MethodProxyAuth,
CreateUserDir: true,
UserHomeBasePath: "/users",
Defaults: settings.UserDefaults{
Scope: ".",
Perm: users.Permissions{Create: true},
},
}
auth := ProxyAuth{Header: "X-Remote-User"}
provision := func(name string) *users.User {
req, _ := http.NewRequest(http.MethodGet, "/", http.NoBody)
req.Header.Set("X-Remote-User", name)
u, err := auth.Auth(req, store, s, srv)
if err != nil {
t.Fatalf("Auth(%q) error: %v", name, err)
}
return u
}
alice := provision("alice")
bob := provision("bob")
if alice.Scope == "/" || bob.Scope == "/" {
t.Fatalf("provisioned users inherited the server root: alice=%q bob=%q", alice.Scope, bob.Scope)
}
if alice.Scope == bob.Scope {
t.Fatalf("distinct users must get distinct scopes, both got %q", alice.Scope)
}
if alice.Scope != "/users/alice" {
t.Errorf("expected /users/alice, got %q", alice.Scope)
}
}
+26
View File
@@ -5,6 +5,10 @@ import (
"github.com/samber/lo"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/v2/settings"
)
// TestEnvCollisions ensures that there are no collisions in the produced environment
@@ -33,3 +37,25 @@ func testEnvCollisions(t *testing.T, cmd *cobra.Command) {
t.Errorf("Found duplicate environment variable keys for command %q: %v", cmd.Name(), duplicates)
}
}
// TestGetSettingsFollowExternalSymlinks ensures that the followExternalSymlinks
// flag is persisted to the server config when set via "config set".
func TestGetSettingsFollowExternalSymlinks(t *testing.T) {
flags := pflag.NewFlagSet("test", pflag.ContinueOnError)
addConfigFlags(flags)
if err := flags.Parse([]string{"--followExternalSymlinks"}); err != nil {
t.Fatal(err)
}
set := &settings.Settings{AuthMethod: auth.MethodJSONAuth}
ser := &settings.Server{}
if _, err := getSettings(flags, set, ser, &auth.JSONAuth{}, false); err != nil {
t.Fatal(err)
}
if !ser.FollowExternalSymlinks {
t.Error("expected FollowExternalSymlinks to be persisted as true")
}
}
+3
View File
@@ -229,6 +229,7 @@ func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Aut
fmt.Fprintf(w, "\tThumbnails Enabled:\t%t\n", ser.EnableThumbnails)
fmt.Fprintf(w, "\tResize Preview:\t%t\n", ser.ResizePreview)
fmt.Fprintf(w, "\tType Detection by Header:\t%t\n", ser.TypeDetectionByHeader)
fmt.Fprintf(w, "\tFollow External Symlinks:\t%t\n", ser.FollowExternalSymlinks)
fmt.Fprintln(w, "\nTUS:")
fmt.Fprintf(w, "\tChunk size:\t%d\n", set.Tus.ChunkSize)
@@ -313,6 +314,8 @@ func getSettings(flags *pflag.FlagSet, set *settings.Settings, ser *settings.Ser
case "disableImageResolutionCalc":
ser.ImageResolutionCal, err = flags.GetBool(flag.Name)
ser.ImageResolutionCal = !ser.ImageResolutionCal
case "followExternalSymlinks":
ser.FollowExternalSymlinks, err = flags.GetBool(flag.Name)
// Settings flags from [addConfigFlags]
case "signup":
+1 -1
View File
@@ -14,7 +14,7 @@ import (
func init() {
rootCmd.AddCommand(docsCmd)
docsCmd.Flags().String("out", "www/docs/cli", "directory to write the docs to")
docsCmd.Flags().String("out", "docs/cli", "directory to write the docs to")
}
var docsCmd = &cobra.Command{
+44 -13
View File
@@ -13,6 +13,7 @@ import (
"os"
"os/signal"
"path/filepath"
"strings"
"syscall"
"time"
@@ -111,6 +112,7 @@ func addServerFlags(flags *pflag.FlagSet) {
flags.Bool("disableExec", true, "disables Command Runner feature")
flags.Bool("disableTypeDetectionByHeader", false, "disables type detection by reading file headers")
flags.Bool("disableImageResolutionCalc", false, "disables image resolution calculation by reading image files")
flags.Bool("followExternalSymlinks", false, "follow symlinks whose target is outside the user scope (unsafe)")
}
var rootCmd = &cobra.Command{
@@ -190,6 +192,11 @@ user created with the credentials from options "username" and "password".`,
}
setupLog(server.Log)
log.Println("NOTICE: File Browser is being wound down.")
log.Println("NOTICE: The project is archived on 2026-09-01, after which there will be no")
log.Println("NOTICE: further releases and no security fixes. Known unfixed issues are at")
log.Println("NOTICE: https://github.com/filebrowser/filebrowser/security/advisories")
root, err := filepath.Abs(server.Root)
if err != nil {
return err
@@ -353,6 +360,10 @@ func getServerSettings(v *viper.Viper, st *storage.Storage) (*settings.Server, e
server.EnableExec = !v.GetBool("disableExec")
}
if v.IsSet("followExternalSymlinks") {
server.FollowExternalSymlinks = v.GetBool("followExternalSymlinks")
}
if isAddrSet && isSocketSet {
return nil, errors.New("--socket flag cannot be used with --address, --port, --key nor --cert")
}
@@ -369,6 +380,25 @@ func getServerSettings(v *viper.Viper, st *storage.Storage) (*settings.Server, e
log.Println("WARNING: read https://github.com/filebrowser/filebrowser/issues/5199")
}
if server.FollowExternalSymlinks {
log.Println("WARNING: Following external symlinks enabled!")
log.Println("WARNING: Symlinks pointing outside a user's scope will be followed,")
log.Println("WARNING: which can expose files outside that scope. Only enable this if")
log.Println("WARNING: you fully understand and trust the contents of every user scope.")
}
if set, err := st.Settings.Get(); err == nil && set.Signup {
scope := strings.TrimSpace(set.Defaults.Scope)
scopeIsRoot := scope == "" || scope == "." || scope == "/"
if !set.CreateUserDir && scopeIsRoot {
log.Println("WARNING: Signup is enabled without createUserDir and the default scope is")
log.Println("WARNING: the server root, so every self-registered user can read, modify and")
log.Println("WARNING: delete all files File Browser serves, including other users' files.")
log.Println("WARNING: Enable createUserDir, or set a default scope other than the root.")
}
}
return server, nil
}
@@ -446,19 +476,20 @@ func quickSetup(v *viper.Viper, s *storage.Storage) error {
}
ser := &settings.Server{
BaseURL: v.GetString("baseURL"),
Port: v.GetString("port"),
Log: v.GetString("log"),
TLSKey: v.GetString("key"),
TLSCert: v.GetString("cert"),
Address: v.GetString("address"),
Root: v.GetString("root"),
TokenExpirationTime: v.GetString("tokenExpirationTime"),
EnableThumbnails: !v.GetBool("disableThumbnails"),
ResizePreview: !v.GetBool("disablePreviewResize"),
EnableExec: !v.GetBool("disableExec"),
TypeDetectionByHeader: !v.GetBool("disableTypeDetectionByHeader"),
ImageResolutionCal: !v.GetBool("disableImageResolutionCalc"),
BaseURL: v.GetString("baseURL"),
Port: v.GetString("port"),
Log: v.GetString("log"),
TLSKey: v.GetString("key"),
TLSCert: v.GetString("cert"),
Address: v.GetString("address"),
Root: v.GetString("root"),
TokenExpirationTime: v.GetString("tokenExpirationTime"),
EnableThumbnails: !v.GetBool("disableThumbnails"),
ResizePreview: !v.GetBool("disablePreviewResize"),
EnableExec: !v.GetBool("disableExec"),
TypeDetectionByHeader: !v.GetBool("disableTypeDetectionByHeader"),
ImageResolutionCal: !v.GetBool("disableImageResolutionCalc"),
FollowExternalSymlinks: v.GetBool("followExternalSymlinks"),
}
err = s.Settings.SaveServer(ser)
+1 -1
View File
@@ -36,7 +36,7 @@ func runRules(st *storage.Storage, cmd *cobra.Command, usersFn func(*users.User)
}
if id != nil {
var user *users.User
user, err = st.Users.Get("", id)
user, err = st.Users.Get("", false, id)
if err != nil {
return err
}
+1 -1
View File
@@ -15,7 +15,7 @@ var usersExportCmd = &cobra.Command{
path to the file where you want to write the users.`,
Args: jsonYamlArg,
RunE: withStore(func(_ *cobra.Command, args []string, st *store) error {
list, err := st.Users.Gets("")
list, err := st.Users.Gets("", false)
if err != nil {
return err
}
+3 -3
View File
@@ -36,14 +36,14 @@ var findUsers = withStore(func(_ *cobra.Command, args []string, st *store) error
if len(args) == 1 {
username, id := parseUsernameOrID(args[0])
if username != "" {
user, err = st.Users.Get("", username)
user, err = st.Users.Get("", false, username)
} else {
user, err = st.Users.Get("", id)
user, err = st.Users.Get("", false, id)
}
list = []*users.User{user}
} else {
list, err = st.Users.Gets("")
list, err = st.Users.Gets("", false)
}
if err != nil {
+4 -4
View File
@@ -40,7 +40,7 @@ list or set it to 0.`,
}
for _, user := range list {
err = user.Clean("")
err = user.Clean("", false)
if err != nil {
return err
}
@@ -52,7 +52,7 @@ list or set it to 0.`,
}
if replace {
oldUsers, userImportErr := st.Users.Gets("")
oldUsers, userImportErr := st.Users.Gets("", false)
if userImportErr != nil {
return userImportErr
}
@@ -76,7 +76,7 @@ list or set it to 0.`,
}
for _, user := range list {
onDB, err := st.Users.Get("", user.ID)
onDB, err := st.Users.Get("", false, user.ID)
// User exists in DB.
if err == nil {
@@ -88,7 +88,7 @@ list or set it to 0.`,
// with the new username. If there is, print an error and cancel the
// operation
if user.Username != onDB.Username {
if conflictuous, err := st.Users.Get("", user.Username); err == nil {
if conflictuous, err := st.Users.Get("", false, user.Username); err == nil {
return usernameConflictError(user.Username, conflictuous.ID, user.ID)
}
}
+2 -2
View File
@@ -43,9 +43,9 @@ options you want to change.`,
user *users.User
)
if id != 0 {
user, err = st.Users.Get("", id)
user, err = st.Users.Get("", false, id)
} else {
user, err = st.Users.Get("", username)
user, err = st.Users.Get("", false, username)
}
if err != nil {
return err
+49
View File
@@ -0,0 +1,49 @@
<p align="center">
<img src="../branding/banner.png" width="550"/>
</p>
> [!WARNING]
>
> **File Browser is archived on 2026-09-01.** There will be no further releases and no security fixes. Existing releases and Docker images stay online. For the known unaddressed security issues and hardening guidance, read the [README](../README.md#security).
File Browser provides a file managing interface within a specified directory and it can be used to upload, delete, preview and edit your files. It is a **create-your-own-cloud**-kind of software where you can just install it on your server, direct it to a path and access your files through a nice web interface.
![Preview](static/example.gif)
## Contents
- [Installation](installation.md)
- [Customization](customization.md)
- [Authentication](authentication.md)
- [Command Execution](command-execution.md)
- [Deployment](deployment.md)
- [Troubleshooting](troubleshooting.md)
- [Command Line Usage](cli/filebrowser.md)
Project-level documents live in the repository root: [README](../README.md), [Building File Browser](../CONTRIBUTING.md), [Security Policy](../SECURITY.md), [Code of Conduct](../CODE-OF-CONDUCT.md), [Changelog](../CHANGELOG.md) and [License](../LICENSE).
## Features
- **Easy Login System**
![Login screen](static/1.jpg)
- **Sleek Interface**
![File listing](static/2.jpg)
- **User Management**
![User management](static/3.jpg)
- **File Editing**
![File editor](static/4.jpg)
- **Custom Commands**
![Command runner](static/5.jpg)
- **Customization**
![Customization settings](static/6.jpg)
@@ -1,6 +1,6 @@
# Authentication
There are three possible authentication methods. Each one of them has its own capabilities and specification. If you are interested in contributing with one more authentication method, please [check the guidelines](contributing.md).
There are three possible authentication methods. Each one of them has its own capabilities and specification. Adding another authentication method is described in [Building File Browser](../CONTRIBUTING.md#authentication-provider).
## JSON Auth (default)
@@ -46,6 +46,10 @@ The Hook Authentication method in FileBrowser allows developers to delegate user
The hook’s output controls user permissions, scope, locale, and other attributes, making it a powerful and extensible authentication mechanism.
> [!WARNING]
>
> The submitted username and password are attacker-controlled and are handed to your hook command as the `USERNAME` and `PASSWORD` environment variables. File Browser runs the command directly, without a shell, so the values themselves are inert. However, your script must treat them as untrusted: always quote them (`"$USERNAME"`, `"$PASSWORD"`) and never pass them unquoted to a shell, `eval`, `bash -c`, command substitution, or backticks. A hook script that shell-evaluates these values turns any login request into remote code execution.
For example, the following code delegates filebrowser authentication to a PowerShell script on Windows. You can configure any command (for example, a script in Python, Node.js, etc.).
```sh
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -41,6 +41,7 @@ filebrowser config init [flags]
--disableThumbnails disable image thumbnails
--disableTypeDetectionByHeader disables type detection by reading file headers
--fileMode string mode bits that new files are created with (default "0o640")
--followExternalSymlinks follow symlinks whose target is outside the user scope (unsafe)
-h, --help help for init
--hideDotfiles hide dotfiles in file listings
--hideLoginButton hide login button from public pages
@@ -38,6 +38,7 @@ filebrowser config set [flags]
--disableThumbnails disable image thumbnails
--disableTypeDetectionByHeader disables type detection by reading file headers
--fileMode string mode bits that new files are created with (default "0o640")
--followExternalSymlinks follow symlinks whose target is outside the user scope (unsafe)
-h, --help help for set
--hideDotfiles hide dotfiles in file listings
--hideLoginButton hide login button from public pages
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -61,6 +61,7 @@ filebrowser [flags]
--disablePreviewResize disable resize of image previews
--disableThumbnails disable image thumbnails
--disableTypeDetectionByHeader disables type detection by reading file headers
--followExternalSymlinks follow symlinks whose target is outside the user scope (unsafe)
-h, --help help for filebrowser
--imageProcessors int image processors count (default 4)
-k, --key string tls key
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,15 @@
## Self-Registration (Signup)
File Browser allows you to enable user self-registration (signup). This can be enabled via **Settings → Global Settings**, or with `filebrowser config set --signup`. Self-registered users inherit the configured **user defaults**, including the scope.
> [!WARNING]
>
> By default, the user scope is the server's root, so a self-registered user could read,
> modify, and delete every file File Browser serves. To prevent this, either:
>
> a. Enable `createUserDir` so each user gets their own directory; or
> b. If users are meant to share files, set the default scope to something other than the root.
## Fail2ban
File Browser does not natively support protection against brute force attacks. Therefore, we suggest using something like [fail2ban](https://github.com/fail2ban/fail2ban), which takes care of that by tracking the logs of your File Browser instance. For more information on how fail2ban works, please refer to their [wiki](https://github.com/fail2ban/fail2ban/wiki).
@@ -6,29 +6,29 @@ File Browser is a single binary and can be used as standalone executable. Howeve
The quickest and easiest way to install File Browser is to use a package manager, or our download script, which automatically fetches the latest version of File Browser for your platform. Alternatively, you can manually download the binary from the [releases page](https://github.com/filebrowser/filebrowser/releases).
=== "Brew"
### Brew
```sh
brew tap filebrowser/tap
brew install filebrowser
filebrowser -r /path/to/your/files
```
```sh
brew tap filebrowser/tap
brew install filebrowser
filebrowser -r /path/to/your/files
```
=== "Unix"
### Unix
```sh
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
filebrowser -r /path/to/your/files
```
```sh
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
filebrowser -r /path/to/your/files
```
=== "Windows"
### Windows
```sh
iwr -useb https://raw.githubusercontent.com/filebrowser/get/master/get.ps1 | iex
filebrowser -r /path/to/your/files
```
```sh
iwr -useb https://raw.githubusercontent.com/filebrowser/get/master/get.ps1 | iex
filebrowser -r /path/to/your/files
```
File Browser is now up and running. Read some [first boot](#first-boot) for more information.
File Browser is now up and running. Read the ["First Boot"](#first-boot) section for more information.
## Docker
@@ -47,7 +47,7 @@ docker run \
Where `filebrowser_data`, `filebrowser_database` and `filebrowser_config` are Docker [volumes](https://docs.docker.com/engine/storage/volumes/), where the data, database and configuration will be stored, respectively. The default configuration and database will be automatically initialized.
The default user that runs File Browser inside the container has PID 1000 and GID 1000. If, for one reason or another, you want to run the Docker container with a different user, please consult Docker's [user documentation](https://docs.docker.com/engine/containers/run/#user).
The default user that runs File Browser inside the container has UID 1000 and GID 1000. If, for one reason or another, you want to run the Docker container with a different user, please consult Docker's [user documentation](https://docs.docker.com/engine/containers/run/#user).
> [!NOTE]
>
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
+34
View File
@@ -0,0 +1,34 @@
package files
import (
"path/filepath"
"runtime"
"strings"
"github.com/spf13/afero"
)
// CaseInsensitive reports whether the filesystem backing root treats file names
// case-insensitively, as NTFS, APFS, HFS+, exFAT and CIFS do. It creates a
// probe file and looks it up under a different case, mirroring how git detects
// core.ignoreCase.
//
// It probes rather than inferring from runtime.GOOS because neither direction
// holds: macOS can be formatted case-sensitively, and a Linux host commonly
// serves a case-insensitive mount. When the root cannot be written to, it falls
// back to the host's usual default rather than assuming case-sensitivity, since
// a read-only root is still exposed to the disclosure this guards against.
func CaseInsensitive(fs afero.Fs, root string) bool {
probe, err := afero.TempFile(fs, root, "fb-case-probe-")
if err != nil {
return runtime.GOOS == "windows" || runtime.GOOS == "darwin"
}
name := probe.Name()
probe.Close()
defer fs.Remove(name) //nolint:errcheck
dir, base := filepath.Split(name)
_, err = fs.Stat(filepath.Join(dir, strings.ToUpper(base)))
return err == nil
}
+44
View File
@@ -0,0 +1,44 @@
package files
import (
"strings"
"testing"
"github.com/spf13/afero"
)
// MemMapFs keys its entries by exact name, so it is case-sensitive.
func TestCaseInsensitiveReportsCaseSensitiveFs(t *testing.T) {
fs := afero.NewMemMapFs()
if err := fs.MkdirAll("/root", 0o755); err != nil {
t.Fatal(err)
}
if CaseInsensitive(fs, "/root") {
t.Error("CaseInsensitive() = true for a case-sensitive filesystem; want false")
}
assertNoProbeLeft(t, fs, "/root")
}
// Whatever the verdict, the probe file must not be left behind in the user's
// data directory.
func TestCaseInsensitiveRemovesProbe(t *testing.T) {
root := t.TempDir()
fs := afero.NewOsFs()
t.Logf("CaseInsensitive(%s) = %v", root, CaseInsensitive(fs, root))
assertNoProbeLeft(t, fs, root)
}
func assertNoProbeLeft(t *testing.T, fs afero.Fs, root string) {
t.Helper()
entries, err := afero.ReadDir(fs, root)
if err != nil {
t.Fatal(err)
}
for _, e := range entries {
if strings.HasPrefix(e.Name(), "fb-case-probe-") {
t.Errorf("probe file left behind: %s", e.Name())
}
}
}
+12 -74
View File
@@ -22,10 +22,9 @@ import (
"strings"
"time"
"github.com/spf13/afero"
fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/rules"
"github.com/spf13/afero"
)
var (
@@ -129,13 +128,6 @@ func stat(opts *FileOptions) (*FileInfo, error) {
}
}
if file != nil {
ok, scopeErr := WithinScope(opts.Fs, opts.Path)
if scopeErr != nil || !ok {
return nil, os.ErrPermission
}
}
// regular file
if file != nil && !file.IsSymlink {
return file, nil
@@ -173,60 +165,6 @@ func stat(opts *FileOptions) (*FileInfo, error) {
return file, nil
}
// WithinScope reports whether the on-disk target of p — after resolving any
// symbolic links — stays within the scoped root of fsys. It exists to stop a
// symlink that lives lexically inside a user's scope but points outside it
// from being followed for reads, writes, or shares.
//
// Paths that do not exist yet (e.g. a brand-new file being created) are
// validated against their nearest existing ancestor, so legitimate new files
// are always allowed. For a filesystem that is not scoped with BasePathFs the
// check is a no-op and returns true.
//
// Note: a dangling symlink whose target does not yet exist resolves to its
// containing directory and is therefore allowed; writing through such a link
// could still create a file outside the scope. Callers that create files
// should treat this as best-effort and rely on rejecting existing escaping
// symlinks, which covers the disclosure and overwrite vectors.
func WithinScope(fsys afero.Fs, p string) (bool, error) {
bfs, ok := fsys.(*afero.BasePathFs)
if !ok {
// Not a scoped filesystem; nothing to enforce.
return true, nil
}
root, err := filepath.EvalSymlinks(afero.FullBaseFsPath(bfs, "/"))
if err != nil {
return false, err
}
target := afero.FullBaseFsPath(bfs, p)
resolved, err := filepath.EvalSymlinks(target)
for errors.Is(err, fs.ErrNotExist) {
parent := filepath.Dir(target)
if parent == target {
break
}
target = parent
resolved, err = filepath.EvalSymlinks(target)
}
if err != nil {
return false, err
}
// Compare against root with a trailing separator so a sibling like
// "/srvother" is not treated as being inside "/srv". When root is itself
// the filesystem boundary (e.g. "/"), it already ends in a separator, so
// avoid producing "//" — which no path would match — and accept any path
// under it.
prefix := root
if !strings.HasSuffix(prefix, string(filepath.Separator)) {
prefix += string(filepath.Separator)
}
return resolved == root || strings.HasPrefix(resolved, prefix), nil
}
// Checksum checksums a given File for a given User, using a specific
// algorithm. The checksums data is saved on File object.
func (i *FileInfo) Checksum(algo string) error {
@@ -475,19 +413,19 @@ func (i *FileInfo) readListing(checker rules.Checker, readHeader bool, calcImgRe
isSymlink, isInvalidLink := false, false
if IsSymlink(f.Mode()) {
isSymlink = true
// A symlink whose on-disk target escapes the scoped root must not be
// followed, otherwise the listing would leak the target's metadata
// (and downstream access) for files outside the user's scope or the
// shared subtree.
if ok, scopeErr := WithinScope(i.Fs, fPath); scopeErr != nil || !ok {
continue
}
// It's a symbolic link. We try to follow it. If it doesn't work,
// we stay with the link information instead of the target's.
// It's a symbolic link. We try to follow it. The scoped filesystem
// refuses to dereference a link whose target escapes the scope
// (permission error); such a link is omitted from the listing
// entirely so it cannot leak the target's metadata. Any other
// failure means a broken link, which we surface as an invalid link
// rather than the target's information.
info, err := i.Fs.Stat(fPath)
if err == nil {
switch {
case err == nil:
f = info
} else {
case errors.Is(err, os.ErrPermission):
continue
default:
isInvalidLink = true
}
}
+165 -40
View File
@@ -9,54 +9,46 @@ import (
"github.com/spf13/afero"
)
func TestWithinScope(t *testing.T) {
t.Run("non-scoped filesystem is a no-op", func(t *testing.T) {
ok, err := WithinScope(afero.NewOsFs(), "/anything")
if err != nil || !ok {
t.Fatalf("expected (true, nil), got (%v, %v)", ok, err)
}
})
t.Run("path inside a nested scope is allowed", func(t *testing.T) {
func TestScopedFs(t *testing.T) {
t.Run("path inside scope is allowed", func(t *testing.T) {
scope := t.TempDir()
if err := os.WriteFile(filepath.Join(scope, "file.txt"), []byte("x"), 0o644); err != nil {
t.Fatal(err)
}
bfs := afero.NewBasePathFs(afero.NewOsFs(), scope)
fs := NewScopedFs(afero.NewOsFs(), scope)
ok, err := WithinScope(bfs, "/file.txt")
if err != nil || !ok {
t.Fatalf("expected (true, nil), got (%v, %v)", ok, err)
if _, err := fs.Stat("/file.txt"); err != nil {
t.Fatalf("expected in-scope file to be accessible, got %v", err)
}
})
t.Run("new file inside scope is allowed", func(t *testing.T) {
t.Run("new file inside scope can be created", func(t *testing.T) {
scope := t.TempDir()
bfs := afero.NewBasePathFs(afero.NewOsFs(), scope)
fs := NewScopedFs(afero.NewOsFs(), scope)
ok, err := WithinScope(bfs, "/does-not-exist-yet.txt")
if err != nil || !ok {
t.Fatalf("expected (true, nil), got (%v, %v)", ok, err)
f, err := fs.OpenFile("/does-not-exist-yet.txt", os.O_RDWR|os.O_CREATE, 0o644)
if err != nil {
t.Fatalf("expected to create a new in-scope file, got %v", err)
}
_ = f.Close()
})
// Regression for #5975: when the scope resolves to the filesystem root,
// root+separator used to be "//", which no path matched, so every write
// was rejected with os.ErrPermission (HTTP 403).
t.Run("filesystem root scope allows writes", func(t *testing.T) {
t.Run("filesystem root scope allows access", func(t *testing.T) {
f := filepath.Join(t.TempDir(), "file.txt")
if err := os.WriteFile(f, []byte("x"), 0o644); err != nil {
t.Fatal(err)
}
bfs := afero.NewBasePathFs(afero.NewOsFs(), "/")
fs := NewScopedFs(afero.NewOsFs(), "/")
ok, err := WithinScope(bfs, f)
if err != nil || !ok {
t.Fatalf("expected (true, nil) for a path under root scope, got (%v, %v)", ok, err)
if _, err := fs.Stat(f); err != nil {
t.Fatalf("expected a path under root scope to be accessible, got %v", err)
}
})
t.Run("sibling of a nested scope is rejected", func(t *testing.T) {
t.Run("escaping symlink to a sibling is rejected", func(t *testing.T) {
base := t.TempDir()
scope := filepath.Join(base, "srv")
sibling := filepath.Join(base, "srvother")
@@ -65,20 +57,21 @@ func TestWithinScope(t *testing.T) {
t.Fatal(err)
}
}
// A symlink lexically inside the scope pointing at a sibling directory
// must not be followed.
link := filepath.Join(scope, "escape")
if err := os.Symlink(sibling, link); err != nil {
if err := os.WriteFile(filepath.Join(sibling, "secret.txt"), []byte("secret"), 0o644); err != nil {
t.Fatal(err)
}
bfs := afero.NewBasePathFs(afero.NewOsFs(), scope)
ok, err := WithinScope(bfs, "/escape")
if err != nil {
t.Fatalf("unexpected error: %v", err)
// A symlink lexically inside the scope pointing at a sibling directory
// must not be followed for reads or stats.
if err := os.Symlink(sibling, filepath.Join(scope, "escape")); err != nil {
t.Skipf("cannot create symlink: %v", err)
}
if ok {
t.Fatal("expected escaping symlink to a sibling directory to be rejected")
fs := NewScopedFs(afero.NewOsFs(), scope)
if _, err := fs.Stat("/escape"); !os.IsPermission(err) {
t.Fatalf("expected stat of escaping symlink to be rejected, got %v", err)
}
if _, err := fs.Open("/escape/secret.txt"); !os.IsPermission(err) {
t.Fatalf("expected read through escaping symlink to be rejected, got %v", err)
}
})
@@ -93,11 +86,129 @@ func TestWithinScope(t *testing.T) {
if err := os.Symlink(filepath.Join(scope, "real"), filepath.Join(scope, "link")); err != nil {
t.Skipf("cannot create symlink: %v", err)
}
bfs := afero.NewBasePathFs(afero.NewOsFs(), scope)
fs := NewScopedFs(afero.NewOsFs(), scope)
ok, err := WithinScope(bfs, "/link/f.txt")
if err != nil || !ok {
t.Fatalf("expected (true, nil) for an in-scope symlink target, got (%v, %v)", ok, err)
if _, err := fs.Stat("/link/f.txt"); err != nil {
t.Fatalf("expected in-scope symlink target to be accessible, got %v", err)
}
})
// Regression for the dangling-symlink write escape (GHSA-8wc8-hf36-mjh9 /
// GHSA-fh54-6rfh-r8f3): a symlink whose target does not exist yet must not be
// followed for writes. Previously within() validated the link's in-scope
// parent directory, so OpenFile(O_CREATE) dereferenced the link and created
// the file at its out-of-scope target.
t.Run("write through a dangling escaping symlink is rejected", func(t *testing.T) {
base := t.TempDir()
scope := filepath.Join(base, "scope")
outside := filepath.Join(base, "outside")
for _, d := range []string{scope, outside} {
if err := os.MkdirAll(d, 0o755); err != nil {
t.Fatal(err)
}
}
outsideTarget := filepath.Join(outside, "created.txt") // does not exist yet
if err := os.Symlink(outsideTarget, filepath.Join(scope, "evil")); err != nil {
t.Skipf("cannot create symlink: %v", err)
}
fs := NewScopedFs(afero.NewOsFs(), scope)
f, err := fs.OpenFile("/evil", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o644)
if err == nil {
_ = f.Close()
t.Fatal("VULNERABLE: write through a dangling escaping symlink was allowed")
}
if !os.IsPermission(err) {
t.Fatalf("expected permission error, got %v", err)
}
if _, statErr := os.Stat(outsideTarget); statErr == nil {
t.Fatal("VULNERABLE: file was created outside the scope")
}
})
// A dangling *relative* symlink that lives under an escaping directory
// symlink must be resolved against the link's real directory, not its lexical
// parent. Otherwise the symlinked ancestor can shift the computed target back
// into scope while the real OS write lands outside it.
t.Run("write through a dangling relative symlink under a symlinked dir is rejected", func(t *testing.T) {
base := t.TempDir()
scope := filepath.Join(base, "scope")
outside := filepath.Join(base, "outside")
for _, d := range []string{scope, outside} {
if err := os.MkdirAll(d, 0o755); err != nil {
t.Fatal(err)
}
}
// An escaping directory symlink inside the scope: /scope/m -> /base/outside.
if err := os.Symlink(outside, filepath.Join(scope, "m")); err != nil {
t.Skipf("cannot create symlink: %v", err)
}
// A relative dangling symlink inside the escaping dir whose target,
// resolved against the real directory (/base/outside), is /base/escaped —
// outside the scope.
if err := os.Symlink("../escaped", filepath.Join(outside, "evil")); err != nil {
t.Skipf("cannot create symlink: %v", err)
}
fs := NewScopedFs(afero.NewOsFs(), scope)
f, err := fs.OpenFile("/m/evil", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o644)
if err == nil {
_ = f.Close()
t.Fatal("VULNERABLE: write through a dangling relative symlink under a symlinked dir was allowed")
}
if !os.IsPermission(err) {
t.Fatalf("expected permission error, got %v", err)
}
if _, statErr := os.Stat(filepath.Join(base, "escaped")); statErr == nil {
t.Fatal("VULNERABLE: file was created outside the scope")
}
})
// Regression for the symlink-following delete escape (GHSA-hq4g-mpch-f9vp /
// GHSA-fmm7-x4gx-8jhr): Remove/RemoveAll used to skip guard(), so RemoveAll
// followed a symlinked ancestor escaping the scope and deleted an
// out-of-scope file.
t.Run("RemoveAll through an escaping symlink is rejected", func(t *testing.T) {
base := t.TempDir()
scope := filepath.Join(base, "scope")
outside := filepath.Join(base, "outside")
for _, d := range []string{scope, outside} {
if err := os.MkdirAll(d, 0o755); err != nil {
t.Fatal(err)
}
}
victim := filepath.Join(outside, "victim.txt")
if err := os.WriteFile(victim, []byte("keep"), 0o644); err != nil {
t.Fatal(err)
}
if err := os.Symlink(outside, filepath.Join(scope, "link")); err != nil {
t.Skipf("cannot create symlink: %v", err)
}
fs := NewScopedFs(afero.NewOsFs(), scope)
if err := fs.RemoveAll("/link/victim.txt"); !os.IsPermission(err) {
t.Fatalf("expected RemoveAll through escaping symlink to be rejected, got %v", err)
}
if _, statErr := os.Stat(victim); statErr != nil {
t.Fatalf("VULNERABLE: out-of-scope victim file was deleted: %v", statErr)
}
})
// The guard added for the delete escape must not break legitimate deletes of
// in-scope files.
t.Run("RemoveAll of an in-scope file is allowed", func(t *testing.T) {
scope := t.TempDir()
target := filepath.Join(scope, "deleteme.txt")
if err := os.WriteFile(target, []byte("x"), 0o644); err != nil {
t.Fatal(err)
}
fs := NewScopedFs(afero.NewOsFs(), scope)
if err := fs.RemoveAll("/deleteme.txt"); err != nil {
t.Fatalf("expected in-scope RemoveAll to succeed, got %v", err)
}
if _, statErr := os.Stat(target); statErr == nil {
t.Fatal("expected in-scope file to be deleted")
}
})
}
@@ -123,7 +234,7 @@ func TestStatRejectsLinkedAncestorEscape(t *testing.T) {
}
// Filesystem scoped to the shared directory, as a public share would be.
bfs := afero.NewBasePathFs(afero.NewOsFs(), filepath.Join(scope, "shared"))
bfs := NewScopedFs(afero.NewOsFs(), filepath.Join(scope, "shared"))
if _, err := stat(&FileOptions{Fs: bfs, Path: "/link/secret.txt"}); !os.IsPermission(err) {
t.Fatalf("expected permission error for linked-ancestor escape, got %v", err)
@@ -220,3 +331,17 @@ func TestReadListingSkipsInaccessibleChildren(t *testing.T) {
t.Fatalf("expected one listed directory, got %d", got)
}
}
func TestFileInfoRealPathUsesScopedFsRealPath(t *testing.T) {
root := t.TempDir()
file := &FileInfo{
Fs: NewScopedFs(afero.NewOsFs(), root),
Path: "/root/downloads",
}
got := file.RealPath()
want := filepath.Join(root, "root", "downloads")
if got != want {
t.Fatalf("got %q, want %q", got, want)
}
}
+121
View File
@@ -0,0 +1,121 @@
package files
import (
"os"
"path/filepath"
"testing"
"github.com/spf13/afero"
)
// TestNewFs verifies that NewFs picks the right implementation and that the
// follow-external-symlinks toggle flips whether a symlink pointing outside the
// scope is honored.
func TestNewFs(t *testing.T) {
base := t.TempDir()
scope := filepath.Join(base, "srv")
outside := filepath.Join(base, "outside")
for _, d := range []string{scope, outside} {
if err := os.MkdirAll(d, 0o755); err != nil {
t.Fatal(err)
}
}
if err := os.WriteFile(filepath.Join(outside, "secret.txt"), []byte("secret"), 0o644); err != nil {
t.Fatal(err)
}
// A symlink lexically inside the scope whose target resolves outside it.
if err := os.Symlink(outside, filepath.Join(scope, "escape")); err != nil {
t.Skipf("cannot create symlink: %v", err)
}
t.Run("disabled returns a ScopedFs that rejects the escaping symlink", func(t *testing.T) {
fs := NewFs(afero.NewOsFs(), scope, false)
if _, ok := fs.(*ScopedFs); !ok {
t.Fatalf("expected *ScopedFs, got %T", fs)
}
if _, err := fs.Stat("/escape"); !os.IsPermission(err) {
t.Fatalf("expected stat of escaping symlink to be rejected, got %v", err)
}
})
t.Run("enabled returns a BasePathFs that follows the escaping symlink", func(t *testing.T) {
fs := NewFs(afero.NewOsFs(), scope, true)
if _, ok := fs.(*afero.BasePathFs); !ok {
t.Fatalf("expected *afero.BasePathFs, got %T", fs)
}
if _, err := fs.Stat("/escape"); err != nil {
t.Fatalf("expected escaping symlink to be followed, got %v", err)
}
b, err := afero.ReadFile(fs, "/escape/secret.txt")
if err != nil {
t.Fatalf("expected to read through escaping symlink, got %v", err)
}
if string(b) != "secret" {
t.Fatalf("got %q, want %q", b, "secret")
}
// The link must also appear in a directory listing (the symptom in #5998).
entries, err := afero.ReadDir(fs, "/")
if err != nil {
t.Fatal(err)
}
var found bool
for _, e := range entries {
if e.Name() == "escape" {
found = true
}
}
if !found {
t.Fatal("expected escaping symlink to appear in the listing")
}
})
}
// TestBasePath verifies BasePath extracts the underlying *afero.BasePathFs from
// either filesystem NewFs may return, so User.FullPath keeps working.
func TestBasePath(t *testing.T) {
root := t.TempDir()
osFs := afero.NewOsFs()
for _, tc := range []struct {
name string
followExternal bool
}{
{"ScopedFs", false},
{"BasePathFs", true},
} {
t.Run(tc.name, func(t *testing.T) {
fs := NewFs(osFs, root, tc.followExternal)
base := BasePath(fs)
if base == nil {
t.Fatalf("expected non-nil base for %T", fs)
}
got := afero.FullBaseFsPath(base, "/x")
want := filepath.Join(root, "x")
if got != want {
t.Fatalf("FullBaseFsPath: got %q, want %q", got, want)
}
})
}
if got := BasePath(osFs); got != nil {
t.Fatalf("expected nil base for a plain OsFs, got %v", got)
}
}
// TestFileInfoRealPathUsesBasePathFsRealPath mirrors
// TestFileInfoRealPathUsesScopedFsRealPath for the follow-external-symlinks case,
// where the user filesystem is a bare BasePathFs.
func TestFileInfoRealPathUsesBasePathFsRealPath(t *testing.T) {
root := t.TempDir()
file := &FileInfo{
Fs: NewFs(afero.NewOsFs(), root, true),
Path: "/root/downloads",
}
got := file.RealPath()
want := filepath.Join(root, "root", "downloads")
if got != want {
t.Fatalf("got %q, want %q", got, want)
}
}
+253
View File
@@ -0,0 +1,253 @@
package files
import (
"errors"
"io/fs"
"os"
"path/filepath"
"strings"
"time"
"github.com/spf13/afero"
)
// ScopedFs is an afero.Fs that confines every operation to a base directory and
// refuses to follow a symbolic link whose on-disk target resolves outside that
// base. It wraps an *afero.BasePathFs — which already provides the lexical
// confinement — and adds a per-operation scope check on every call that would
// dereference a symlink at the OS layer (open, stat, lstat, chmod, …).
type ScopedFs struct {
base *afero.BasePathFs
}
var (
_ afero.Fs = (*ScopedFs)(nil)
_ afero.Lstater = (*ScopedFs)(nil)
)
// maxSymlinkHops bounds how many dangling symlinks within() will follow before
// giving up, so a pathological chain cannot loop forever. It mirrors the kernel
// MAXSYMLINKS limit; the operation is rejected once the bound is exceeded.
const maxSymlinkHops = 255
func NewScopedFs(source afero.Fs, path string) *ScopedFs {
if s, ok := source.(*ScopedFs); ok {
source = s.base
}
return &ScopedFs{base: afero.NewBasePathFs(source, path).(*afero.BasePathFs)}
}
// NewFs builds a user filesystem rooted at path. When followExternal is true it
// returns a bare BasePathFs, so symlinks whose target resolves outside the scope
// are followed; otherwise it returns a ScopedFs that refuses to follow them.
func NewFs(source afero.Fs, path string, followExternal bool) afero.Fs {
if followExternal {
return afero.NewBasePathFs(source, path)
}
return NewScopedFs(source, path)
}
// BasePath returns the underlying *afero.BasePathFs of a user filesystem built
// by NewFs, whether it is a *ScopedFs or a bare *afero.BasePathFs, or nil if it
// is neither.
func BasePath(fs afero.Fs) *afero.BasePathFs {
switch f := fs.(type) {
case *ScopedFs:
return f.BasePathFs()
case *afero.BasePathFs:
return f
}
return nil
}
// BasePathFs returns the underlying *afero.BasePathFs.
func (s *ScopedFs) BasePathFs() *afero.BasePathFs { return s.base }
// RealPath resolves a scoped path to the real on-disk path by delegating to
// the underlying BasePathFs. This is needed by callers that need the actual
// filesystem path (e.g. disk.UsageWithContext).
func (s *ScopedFs) RealPath(name string) (string, error) {
return s.base.RealPath(name)
}
// guard returns an error if name's on-disk target resolves outside the scope.
func (s *ScopedFs) guard(name string) error {
ok, err := s.within(name)
if err != nil {
return err
}
if !ok {
return os.ErrPermission
}
return nil
}
// within reports whether the on-disk target of p — after resolving any symbolic
// links — stays within the scoped root. It exists to stop a symlink that lives
// lexically inside the scope but points outside it from being followed for
// reads, writes, or shares.
//
// Paths that do not exist yet (e.g. a brand-new file being created) are
// validated against their nearest existing ancestor, so legitimate new files
// are always allowed. A dangling symlink — a link whose target does not exist
// yet — is the exception: it is followed to where it points and validated
// there, so a write cannot dereference the link to create a file outside the
// scope.
func (s *ScopedFs) within(p string) (bool, error) {
root, err := filepath.EvalSymlinks(afero.FullBaseFsPath(s.base, "/"))
if err != nil {
return false, err
}
target := afero.FullBaseFsPath(s.base, p)
resolved, err := filepath.EvalSymlinks(target)
// When target does not resolve, work out where the operation would actually
// land. A non-existent regular path resolves to the file that would be
// created inside its containing directory, so walk up to the nearest
// existing ancestor and validate that. But when target itself is a dangling
// symlink, follow it one level instead: validating its lexical parent would
// wrongly accept a link pointing outside the scope, letting a write follow
// the link and create the file out of bounds.
for hops := 0; errors.Is(err, fs.ErrNotExist); {
if fi, lerr := os.Lstat(target); lerr == nil && fi.Mode()&os.ModeSymlink != 0 {
hops++
if hops > maxSymlinkHops {
return false, os.ErrPermission
}
dest, rerr := os.Readlink(target)
if rerr != nil {
return false, rerr
}
if !filepath.IsAbs(dest) {
// Resolve the link relative to the directory that really contains
// it, not its lexical parent: a symlinked ancestor could otherwise
// shift the computed target back into scope while the real write
// lands outside it. The parent is guaranteed to resolve here
// because os.Lstat above already traversed it.
base, berr := filepath.EvalSymlinks(filepath.Dir(target))
if berr != nil {
return false, berr
}
dest = filepath.Join(base, dest)
}
target = filepath.Clean(dest)
} else {
parent := filepath.Dir(target)
if parent == target {
break
}
target = parent
}
resolved, err = filepath.EvalSymlinks(target)
}
if err != nil {
return false, err
}
// Compare against root with a trailing separator so a sibling like
// "/srvother" is not treated as being inside "/srv". When root is itself the
// filesystem boundary (e.g. "/"), it already ends in a separator, so avoid
// producing "//" — which no path would match — and accept any path under it.
prefix := root
if !strings.HasSuffix(prefix, string(filepath.Separator)) {
prefix += string(filepath.Separator)
}
return resolved == root || strings.HasPrefix(resolved, prefix), nil
}
func (s *ScopedFs) Create(name string) (afero.File, error) {
if err := s.guard(name); err != nil {
return nil, err
}
return s.base.Create(name)
}
func (s *ScopedFs) Mkdir(name string, perm os.FileMode) error {
if err := s.guard(name); err != nil {
return err
}
return s.base.Mkdir(name, perm)
}
func (s *ScopedFs) MkdirAll(path string, perm os.FileMode) error {
if err := s.guard(path); err != nil {
return err
}
return s.base.MkdirAll(path, perm)
}
func (s *ScopedFs) Open(name string) (afero.File, error) {
if err := s.guard(name); err != nil {
return nil, err
}
return s.base.Open(name)
}
func (s *ScopedFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error) {
if err := s.guard(name); err != nil {
return nil, err
}
return s.base.OpenFile(name, flag, perm)
}
func (s *ScopedFs) Remove(name string) error {
if err := s.guard(name); err != nil {
return err
}
return s.base.Remove(name)
}
func (s *ScopedFs) RemoveAll(path string) error {
if err := s.guard(path); err != nil {
return err
}
return s.base.RemoveAll(path)
}
func (s *ScopedFs) Rename(oldname, newname string) error {
if err := s.guard(oldname); err != nil {
return err
}
if err := s.guard(newname); err != nil {
return err
}
return s.base.Rename(oldname, newname)
}
func (s *ScopedFs) Stat(name string) (os.FileInfo, error) {
if err := s.guard(name); err != nil {
return nil, err
}
return s.base.Stat(name)
}
func (s *ScopedFs) Name() string { return "ScopedFs" }
func (s *ScopedFs) Chmod(name string, mode os.FileMode) error {
if err := s.guard(name); err != nil {
return err
}
return s.base.Chmod(name, mode)
}
func (s *ScopedFs) Chown(name string, uid, gid int) error {
if err := s.guard(name); err != nil {
return err
}
return s.base.Chown(name, uid, gid)
}
func (s *ScopedFs) Chtimes(name string, atime, mtime time.Time) error {
if err := s.guard(name); err != nil {
return err
}
return s.base.Chtimes(name, atime, mtime)
}
func (s *ScopedFs) LstatIfPossible(name string) (os.FileInfo, bool, error) {
if err := s.guard(name); err != nil {
return nil, false, err
}
return s.base.LstatIfPossible(name)
}
+124
View File
@@ -0,0 +1,124 @@
package fileutils
import (
"os"
"path"
"path/filepath"
"testing"
"github.com/filebrowser/filebrowser/v2/files"
"github.com/spf13/afero"
)
// failingOpenFs wraps an afero.Fs and makes Open fail for one specific path,
// while every other operation (including Stat) is delegated unchanged. It
// simulates a directory that can be stat-ed but not opened/read — for example
// an unreadable sub-directory, or one whose permissions changed or that was
// removed after its parent was listed (a TOCTOU race) — encountered during a
// recursive copy.
type failingOpenFs struct {
afero.Fs
failOpen string
}
func (f *failingOpenFs) Open(name string) (afero.File, error) {
if path.Clean(name) == path.Clean(f.failOpen) {
return nil, os.ErrPermission
}
return f.Fs.Open(name)
}
// CopyDir is documented to keep going when it hits an error and to report the
// error afterwards. A sub-directory that cannot be opened must therefore yield
// an error (and leave the other, readable entries copied) rather than
// panicking on a nil directory handle.
func TestCopyDirUnreadableSubdirReturnsError(t *testing.T) {
mem := afero.NewMemMapFs()
if err := mem.MkdirAll("/srcdir/sub", 0o755); err != nil {
t.Fatal(err)
}
if err := afero.WriteFile(mem, "/srcdir/ok.txt", []byte("readable"), 0o644); err != nil {
t.Fatal(err)
}
afs := &failingOpenFs{Fs: mem, failOpen: "/srcdir/sub"}
err := Copy(afs, "/srcdir", "/dstdir", 0o644, 0o755)
if err == nil {
t.Fatal("expected an error when a sub-directory cannot be opened")
}
// The readable sibling must still have been copied (continue-on-error).
data, readErr := afero.ReadFile(afs, "/dstdir/ok.txt")
if readErr != nil {
t.Fatalf("readable sibling was not copied: %v", readErr)
}
if string(data) != "readable" {
t.Fatalf("unexpected copied content: %q", string(data))
}
}
// Copying an in-scope directory that contains a symlink whose target escapes
// the user's scope must not dereference that symlink into the destination.
// Otherwise a scoped user could exfiltrate out-of-scope file content via the
// recursive copy path (GHSA-c2gv-wf5f-hjhh, an incomplete fix of
// GHSA-239w-m3h6-ch8v).
func TestCopyDoesNotDereferenceEscapingSymlink(t *testing.T) {
base := t.TempDir()
scope := filepath.Join(base, "scope")
if err := os.MkdirAll(filepath.Join(scope, "srcdir"), 0o755); err != nil {
t.Fatal(err)
}
// A secret living outside the scope.
secret := filepath.Join(base, "secret.txt")
if err := os.WriteFile(secret, []byte("OUT-OF-SCOPE-SECRET"), 0o644); err != nil {
t.Fatal(err)
}
// An escaping symlink planted inside the user's scope.
if err := os.Symlink(secret, filepath.Join(scope, "srcdir", "link.txt")); err != nil {
t.Skipf("cannot create symlink: %v", err)
}
afs := files.NewScopedFs(afero.NewOsFs(), scope)
err := Copy(afs, "/srcdir", "/dstdir", 0o644, 0o755)
if err == nil {
t.Fatal("expected copy of a directory containing an escaping symlink to fail")
}
// The escaping symlink's target content must not have landed in scope.
if data, readErr := afero.ReadFile(afs, "/dstdir/link.txt"); readErr == nil {
t.Fatalf("escaping symlink was dereferenced into scope: got %q", string(data))
}
}
// A symlink whose target stays within scope is legitimate and must still be
// copied (dereferenced) so the fix does not over-block normal usage.
func TestCopyAllowsInScopeSymlink(t *testing.T) {
scope := t.TempDir()
if err := os.MkdirAll(filepath.Join(scope, "srcdir", "real"), 0o755); err != nil {
t.Fatal(err)
}
if err := os.WriteFile(filepath.Join(scope, "srcdir", "real", "f.txt"), []byte("in-scope"), 0o644); err != nil {
t.Fatal(err)
}
if err := os.Symlink(filepath.Join(scope, "srcdir", "real", "f.txt"), filepath.Join(scope, "srcdir", "link.txt")); err != nil {
t.Skipf("cannot create symlink: %v", err)
}
afs := files.NewScopedFs(afero.NewOsFs(), scope)
if err := Copy(afs, "/srcdir", "/dstdir", 0o644, 0o755); err != nil {
t.Fatalf("expected copy of an in-scope symlink to succeed, got: %v", err)
}
data, err := afero.ReadFile(afs, "/dstdir/link.txt")
if err != nil {
t.Fatalf("expected in-scope symlink to be copied, got: %v", err)
}
if string(data) != "in-scope" {
t.Fatalf("unexpected copied content: %q", string(data))
}
}
+6 -1
View File
@@ -23,7 +23,12 @@ func CopyDir(afs afero.Fs, source, dest string, fileMode, dirMode fs.FileMode) e
return err
}
dir, _ := afs.Open(source)
dir, err := afs.Open(source)
if err != nil {
return err
}
defer dir.Close()
obs, err := dir.Readdir(-1)
if err != nil {
return err
+21 -21
View File
@@ -28,7 +28,7 @@ importers:
version: 1.11.20
dompurify:
specifier: ^3.2.6
version: 3.4.4
version: 3.4.12
epubjs:
specifier: ^0.3.93
version: 0.3.93
@@ -131,7 +131,7 @@ importers:
version: 0.9.1(typescript@5.9.3)(vue@3.5.34(typescript@5.9.3))
autoprefixer:
specifier: ^10.4.21
version: 10.5.0(postcss@8.5.14)
version: 10.5.0(postcss@8.5.18)
eslint:
specifier: ^10.0.0
version: 10.4.0
@@ -146,7 +146,7 @@ importers:
version: 10.9.1(@typescript-eslint/parser@8.56.0(eslint@10.4.0)(typescript@5.9.3))(eslint@10.4.0)(vue-eslint-parser@10.4.0(eslint@10.4.0))
postcss:
specifier: ^8.5.6
version: 8.5.14
version: 8.5.18
prettier:
specifier: ^3.6.2
version: 3.8.3
@@ -1990,8 +1990,8 @@ packages:
dom-walk@0.1.2:
resolution: {integrity: sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==}
dompurify@3.4.4:
resolution: {integrity: sha512-r8K7KGKEcztXfA/nfabSYB2hg9tDphORJTdf8xprN/luSLGmNhOBN8dm1/SYjqLLet6YUFEXOcrdTuwryp/Bew==}
dompurify@3.4.12:
resolution: {integrity: sha512-zQvGet8Z2sWbQhCmfFz/T5QWH2oBmjnqK3qvOjaqaNLrLEF912WamU+ohnTp0TCep/MFVHpdJuCZEdFOdTnEFg==}
electron-to-chromium@1.5.340:
resolution: {integrity: sha512-908qahOGocRMinT2nM3ajCEM99H4iPdv84eagPP3FfZy/1ZGeOy2CZYzjhms81ckOPCXPlW7LkY4XpxD8r1DrA==}
@@ -2538,8 +2538,8 @@ packages:
engines: {node: '>=8', npm: '>=5'}
hasBin: true
nanoid@3.3.12:
resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==}
nanoid@3.3.16:
resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
@@ -2639,8 +2639,8 @@ packages:
postcss-value-parser@4.2.0:
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
postcss@8.5.14:
resolution: {integrity: sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==}
postcss@8.5.18:
resolution: {integrity: sha512-xdB1oSLHbz1vRWgCDalrCqEFTWzFlhqFC5tIHLMOSUIjhm3XXQ1qrFy8S/ESr1JYRRXqM3c1QFiMZUJdUTqyMQ==}
engines: {node: ^10 || ^12 || >=14}
prelude-ls@1.2.1:
@@ -2824,8 +2824,8 @@ packages:
systemjs@6.15.1:
resolution: {integrity: sha512-Nk8c4lXvMB98MtbmjX7JwJRgJOL8fluecYCfCeYBznwmpOs8Bf15hLM6z4z71EDAhQVrQrI+wt1aLWSXZq+hXA==}
tabbable@6.4.0:
resolution: {integrity: sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg==}
tabbable@6.5.0:
resolution: {integrity: sha512-wieBHXygIm7OyQOu5hQlkk62/WyCFYGlWg7L6/ZCUZwx0o398Zkn4pVmMyfYhfMG8kGrj/Krt8eIk6UKC6VzwA==}
tar-mini@0.2.0:
resolution: {integrity: sha512-+qfUHz700DWnRutdUsxRRVZ38G1Qr27OetwaMYTdg8hcPxf46U0S1Zf76dQMWRBmusOt2ZCK5kbIaiLkoGO7WQ==}
@@ -4644,7 +4644,7 @@ snapshots:
'@vue/shared': 3.5.34
estree-walker: 2.0.2
magic-string: 0.30.21
postcss: 8.5.14
postcss: 8.5.18
source-map-js: 1.2.1
'@vue/compiler-ssr@3.5.34':
@@ -4808,13 +4808,13 @@ snapshots:
'@babel/parser': 7.29.3
ast-kit: 2.2.0
autoprefixer@10.5.0(postcss@8.5.14):
autoprefixer@10.5.0(postcss@8.5.18):
dependencies:
browserslist: 4.28.2
caniuse-lite: 1.0.30001788
fraction.js: 5.3.4
picocolors: 1.1.1
postcss: 8.5.14
postcss: 8.5.18
postcss-value-parser: 4.2.0
babel-plugin-polyfill-corejs2@0.4.17(@babel/core@7.29.0):
@@ -4946,7 +4946,7 @@ snapshots:
dom-walk@0.1.2: {}
dompurify@3.4.4:
dompurify@3.4.12:
optionalDependencies:
'@types/trusted-types': 2.0.7
@@ -5231,7 +5231,7 @@ snapshots:
focus-trap@8.0.0:
dependencies:
tabbable: 6.4.0
tabbable: 6.5.0
optional: true
fraction.js@5.3.4: {}
@@ -5517,7 +5517,7 @@ snapshots:
'@babel/runtime': 7.28.6
global: 4.4.0
nanoid@3.3.12: {}
nanoid@3.3.16: {}
natural-compare@1.4.0: {}
@@ -5604,9 +5604,9 @@ snapshots:
postcss-value-parser@4.2.0: {}
postcss@8.5.14:
postcss@8.5.18:
dependencies:
nanoid: 3.3.12
nanoid: 3.3.16
picocolors: 1.1.1
source-map-js: 1.2.1
@@ -5802,7 +5802,7 @@ snapshots:
systemjs@6.15.1: {}
tabbable@6.4.0:
tabbable@6.5.0:
optional: true
tar-mini@0.2.0: {}
@@ -5963,7 +5963,7 @@ snapshots:
dependencies:
lightningcss: 1.32.0
picomatch: 4.0.4
postcss: 8.5.14
postcss: 8.5.18
rolldown: 1.0.1
tinyglobby: 0.2.16
optionalDependencies:
+7 -3
View File
@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, user-scalable=no"
content="width=device-width, initial-scale=1"
/>
[{[ if .ReCaptcha -]}]
@@ -55,12 +55,16 @@
short_name: window.FileBrowser.Name || "File Browser",
icons: [
{
src: window.__prependStaticUrl("/img/icons/android-chrome-192x192.png"),
src:
window.location.origin +
window.__prependStaticUrl("/img/icons/android-chrome-192x192.png"),
sizes: "192x192",
type: "image/png",
},
{
src: window.__prependStaticUrl("/img/icons/android-chrome-512x512.png"),
src:
window.location.origin +
window.__prependStaticUrl("/img/icons/android-chrome-512x512.png"),
sizes: "512x512",
type: "image/png",
},
+16
View File
@@ -1,5 +1,6 @@
<template>
<div>
<h1 class="sr-only">{{ name }}</h1>
<router-view></router-view>
</div>
</template>
@@ -9,6 +10,7 @@ import { ref, onMounted, watch } from "vue";
import { useI18n } from "vue-i18n";
import { setHtmlLocale } from "./i18n";
import { getMediaPreference, getTheme, setTheme } from "./utils/theme";
import { name } from "./utils/constants";
const { locale } = useI18n();
@@ -31,3 +33,17 @@ watch(locale, (newValue) => {
newValue && setHtmlLocale(newValue);
});
</script>
<style scoped>
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
</style>
@@ -57,6 +57,9 @@ const container = ref<HTMLDivElement | null>(null);
onMounted(() => {
if (!decodeUTIF() && imgex.value !== null) {
imgex.value.src = props.src;
imgex.value.alt = decodeURIComponent(
props.src.split("/").pop() || "preview"
);
}
props.classList.forEach((className) =>
@@ -88,6 +91,9 @@ watch(
() => {
if (!decodeUTIF() && imgex.value !== null) {
imgex.value.src = props.src;
imgex.value.alt = decodeURIComponent(
props.src.split("/").pop() || "preview"
);
}
scale.value = 1;
@@ -26,6 +26,7 @@
<img
v-if="!readOnly && type === 'image' && isThumbsEnabled"
v-lazy="thumbnailUrl"
:alt="name"
/>
<i v-else class="material-icons"></i>
</div>
+1 -1
View File
@@ -1,6 +1,6 @@
<template>
<header>
<img v-if="showLogo" :src="logoURL" />
<img v-if="showLogo" :src="logoURL" alt="File Browser" />
<Action
v-if="showMenu"
class="menu-button"
+1 -1
View File
@@ -38,7 +38,7 @@
class="action"
:aria-label="$t('buttons.copyDownloadLinkToClipboard')"
:title="$t('buttons.copyDownloadLinkToClipboard')"
:disabled="!!link.password_hash"
:disabled="!!link.hasPassword"
@click="copyToClipboard(buildDownloadLink(link))"
>
<i class="material-icons">content_paste_go</i>
@@ -38,6 +38,7 @@ import { useRoute } from "vue-router";
import { useLayoutStore } from "@/stores/layout";
import * as upload from "@/utils/upload";
import buttons from "@/utils/buttons";
const { t } = useI18n();
const route = useRoute();
@@ -66,9 +67,13 @@ const uploadInput = async (event: Event) => {
const path = route.path.endsWith("/") ? route.path : route.path + "/";
// Checking the destination hits the server, so show it is working rather
// than leaving the action looking inert until the upload starts.
buttons.loading("upload");
const conflict = await upload.checkConflict(uploadFiles, path);
if (conflict.length > 0) {
buttons.done("upload");
layoutStore.showHover({
prompt: "resolve-conflict",
props: {
@@ -71,7 +71,9 @@ const event = {
describe("copy and move conflict prompts", () => {
beforeEach(() => {
vi.clearAllMocks();
vi.mocked(checkConflict).mockResolvedValue(conflict);
vi.mocked(checkConflict).mockResolvedValue(
conflict as ConflictingResource[]
);
});
it("waits for copy conflict detection before calling the copy API", async () => {
+2
View File
@@ -56,6 +56,8 @@ nav {
position: fixed;
top: 4em;
left: 0;
height: calc(100vh - 4em);
overflow-y: auto;
}
html[dir="rtl"] nav {
+7
View File
@@ -29,6 +29,13 @@
.epub-reader .tocButton {
color: var(--text);
/*
* vue-reader positions the TOC toggle at top: 10px, which lands under the
* fixed 4em header bar (see .header) — so clicks hit the header's Close
* button instead of opening the table of contents. Push it just below the
* header, tracking the header's height so it stays clear if that changes.
*/
top: calc(4em + 10px);
}
.epub-reader .tocButton.tocButtonExpanded {
+2 -1
View File
@@ -113,8 +113,9 @@
top: 0;
z-index: 99999;
background: var(--surfaceSecondary);
height: 100%;
height: 100vh;
width: 16em;
overflow-y: auto;
box-shadow: 0 0 5px var(--borderPrimary);
transition: 0.1s ease left;
left: -17em;
+6 -3
View File
@@ -29,8 +29,8 @@
"rename": "Umbenennen",
"replace": "Ersetzen",
"reportIssue": "Problem melden",
"resumeTransfer": "Resume previous transfer",
"resumeTransferTooltip": "Skip all conflicting files, except the ones that are smaller on the server as we suppose that their transfert has been interrupted.",
"resumeTransfer": "Vorherige Übertragung fortsetzen",
"resumeTransferTooltip": "Alle Dateien mit Konflikten überspringen, außer denen, die auf dem Server kleiner sind, da wir davon ausgehen, dass deren Übertragung unterbrochen wurde.",
"save": "Speichern",
"schedule": "Planen",
"search": "Suchen",
@@ -264,6 +264,9 @@
"shareManagement": "Freigabeverwaltung",
"shareDeleted": "Freigabe gelöscht!",
"singleClick": "Einfacher Klick zum Öffnen von Dateien und Verzeichnissen",
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
"sunsetTitle": "File Browser is being archived",
"themes": {
"default": "Systemstandard",
"dark": "Dunkel",
@@ -283,7 +286,7 @@
"currentPassword": "Dein aktuelles Passwort"
},
"sidebar": {
"diskUsed": "{used} of {total} used",
"diskUsed": "{used} von {total} belegt",
"help": "Hilfe",
"hugoNew": "Hugo Neu",
"login": "Anmelden",
+3
View File
@@ -264,6 +264,9 @@
"shareManagement": "Share Management",
"shareDeleted": "Share deleted!",
"singleClick": "Use single clicks to open files and directories",
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
"sunsetTitle": "File Browser is being archived",
"themes": {
"default": "System default",
"dark": "Dark",
+28 -25
View File
@@ -120,12 +120,12 @@
"passwordsDontMatch": "Les mots de passe ne concordent pas",
"signup": "S'inscrire",
"submit": "Se connecter",
"username": "Utilisateur",
"usernameTaken": "Le nom d'utilisateur est déjà pris",
"username": "Identifiant",
"usernameTaken": "L'identifiant est déjà pris",
"wrongCredentials": "Identifiants incorrects !",
"passwordTooShort": "Le mot de passe doit contenir au moins {min} caractères",
"logout_reasons": {
"inactivity": "Vous avez été déconnecté(e) en raison d'une inactivité prolongée."
"inactivity": "Vous avez été déconnecté'e en raison d'une inactivité prolongée."
}
},
"permanent": "Permanent",
@@ -194,12 +194,12 @@
"settings": {
"aceEditorTheme": "Éditeur de Thème Ace",
"admin": "Admin",
"administrator": "Administrateur",
"administrator": "Administrateur'ice",
"allowCommands": "Exécuter des commandes",
"allowEdit": "Éditer, renommer et supprimer des fichiers ou des dossiers",
"allowNew": "Créer de nouveaux fichiers et dossiers",
"allowPublish": "Publier de nouveaux posts et pages",
"allowSignup": "Autoriser les utilisateurs à s'inscrire",
"allowSignup": "Autoriser les utilisateur'ices à s'inscrire",
"hideLoginButton": "Cacher le bouton d’identification sur les pages publiques",
"avoidChanges": "(Laisser vide pour conserver l'actuel)",
"branding": "Image de marque",
@@ -209,34 +209,34 @@
"commandRunner": "Exécuteur de commandes",
"commandRunnerHelp": "Ici, vous pouvez définir les commandes qui seront exécutées lors des événements nommés précédemments. Vous devez en écrire une par ligne. Les variables d'environnement {0} et {1} seront disponibles, {0} étant relatif à {1}. Pour plus d'informations sur cette fonctionnalité et les variables d'environnement disponibles, veuillez lire la {2}.",
"commandsUpdated": "Commandes mises à jour !",
"createUserDir": "Créer automatiquement un dossier pour l'utilisateur",
"createUserDir": "Créer automatiquement un dossier pour l'utilisateur'ice",
"minimumPasswordLength": "Taille minimale du mot de passe",
"tusUploads": "Uploads segmentés",
"tusUploadsHelp": "File Browser prend en charge les uploads segmentés afin de permettre une gestion efficace, fiable et reprenable sur des réseaux instables.",
"tusUploadsChunkSize": "Taille maximale autorisée par segment (les uploads directs seront utilisés pour les fichiers plus petits). Vous pouvez entrer un entier en octets ou une chaîne telle que 10MB, 1GB, etc.",
"tusUploadsRetryCount": "Nombre de tentatives en cas d'échec d'un segment.",
"userHomeBasePath": "Chemin de base pour les dossiers personnels des utilisateurs",
"userHomeBasePath": "Chemin de base pour les dossiers personnels des utilisateur'ices",
"userScopeGenerationPlaceholder": "Le périmètre sera généré automatiquement",
"createUserHomeDirectory": "Créer le dossier personnel de l'utilisateur",
"createUserHomeDirectory": "Créer le dossier personnel de l'utilisateur'ice",
"customStylesheet": "Feuille de style personnalisée",
"defaultUserDescription": "Paramètres par défaut pour les nouveaux utilisateurs.",
"defaultUserDescription": "Paramètres par défaut pour les nouveaux utilisateur'ices.",
"disableExternalLinks": "Désactiver les liens externes (sauf la documentation)",
"disableUsedDiskPercentage": "Désactiver le graphique de pourcentage d'utilisation du disque",
"documentation": "documentation",
"examples": "Exemples",
"executeOnShell": "Exécuter dans le shell",
"executeOnShellDescription": "Par défaut, File Browser exécute les commandes en appelant directement leurs binaires. Si vous voulez les exécuter sur un shell à la place (comme Bash ou PowerShell), vous pouvez le définir ici avec les arguments et les drapeaux requis. S'il est défini, la commande que vous exécutez sera ajoutée en tant qu'argument. Cela s'applique à la fois aux commandes utilisateur et aux crochets d'événements.",
"globalRules": "Il s'agit d'un ensemble global de règles d'autorisation et d'interdiction. Elles s'appliquent à tous les utilisateurs. Vous pouvez définir des règles spécifiques sur les paramètres de chaque utilisateur pour remplacer celles-ci.",
"executeOnShellDescription": "Par défaut, File Browser exécute les commandes en appelant directement leurs binaires. Si vous voulez les exécuter sur un shell à la place (comme Bash ou PowerShell), vous pouvez le définir ici avec les arguments et les drapeaux requis. S'il est défini, la commande que vous exécutez sera ajoutée en tant qu'argument. Cela s'applique à la fois aux commandes utilisateur'ice et aux crochets d'événements.",
"globalRules": "Il s'agit d'un ensemble global de règles d'autorisation et d'interdiction. Elles s'appliquent à tous les utilisateur'ices. Vous pouvez définir des règles spécifiques sur les paramètres de chaque utilisateur'ice pour remplacer celles-ci.",
"globalSettings": "Paramètres globaux",
"hideDotfiles": "Cacher les fichiers de configuration commançant par un point",
"insertPath": "Insérer le chemin",
"insertRegex": "Insérer une expression régulière",
"instanceName": "Nom de l'instance",
"language": "Langue",
"lockPassword": "Empêcher l'utilisateur de changer son mot de passe",
"lockPassword": "Empêcher l'utilisateur'ice de changer son mot de passe",
"newPassword": "Votre nouveau mot de passe",
"newPasswordConfirm": "Confirmation du nouveau mot de passe",
"newUser": "Nouvel utilisateur",
"newUser": "Nouvel'le utilisateur'ice",
"password": "Mot de passe",
"passwordUpdated": "Mot de passe mis à jour !",
"path": "Chemin",
@@ -250,36 +250,39 @@
"share": "Partager des fichiers (autorisation de téléchargement requise)"
},
"permissions": "Permissions",
"permissionsHelp": "Vous pouvez définir l'utilisateur comme étant un administrateur ou encore choisir les permissions individuellement. Si vous sélectionnez \"Administrateur\", toutes les autres options seront automatiquement activées. La gestion des utilisateurs est un privilège que seul l'administrateur possède.\n",
"permissionsHelp": "Vous pouvez définir l'utilisateur'ice comme étant un'e administrateur'ice ou encore choisir les permissions individuellement. Si vous sélectionnez \"Administrateur'ice\", toutes les autres options seront automatiquement activées. La gestion des utilisateur'ices est un privilège que seul l'administrateur'ice possède.\n",
"profileSettings": "Paramètres du profil",
"redirectAfterCopyMove": "Rediriger vers la destination après une copie/déplacement",
"ruleExample1": "Bloque l'accès à tous les fichiers commençant par un point (comme par exemple .git, .gitignore) dans tous les dossiers.\n",
"ruleExample2": "Bloque l'accès au fichier nommé \"Caddyfile\" à la racine du dossier utilisateur",
"ruleExample2": "Bloque l'accès au fichier nommé \"Caddyfile\" à la racine du dossier utilisateur'ice",
"rules": "Règles",
"rulesHelp": "Vous pouvez définir ici un ensemble de règles pour cet utilisateur. Les fichiers bloqués ne seront pas affichés et ne seront pas accessibles par l'utilisateur. Les expressions régulières sont supportées et les chemins d'accès sont relatifs par rapport au dossier de l'utilisateur.\n",
"scope": "Portée du dossier utilisateur",
"rulesHelp": "Vous pouvez définir ici un ensemble de règles pour cet'te utilisateur'ice. Les fichiers bloqués ne seront pas affichés et ne seront pas accessibles par l'utilisateur'ice. Les expressions régulières sont supportées et les chemins d'accès sont relatifs par rapport au dossier de l'utilisateur'ice.\n",
"scope": "Portée du dossier utilisateur'ice",
"setDateFormat": "Définir le format de la date",
"settingsUpdated": "Les paramètres ont été mis à jour !",
"shareDuration": "Durée du partage",
"shareManagement": "Gestion des partages",
"shareDeleted": "Partage supprimé !",
"singleClick": "Utiliser un simple clic pour ouvrir les fichiers et les dossiers",
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
"sunsetTitle": "File Browser is being archived",
"themes": {
"default": "Par défaut du système",
"dark": "Sombre",
"light": "Clair",
"title": "Thème"
},
"user": "Utilisateur",
"user": "Utilisateur'ice",
"userCommands": "Commandes",
"userCommandsHelp": "Une liste séparée par des espaces des commandes permises pour l'utilisateur. Exemple :\n",
"userCreated": "Utilisateur créé !",
"userDefaults": "Paramètres par défaut de l'utilisateur",
"userDeleted": "Utilisateur supprimé !",
"userManagement": "Gestion des utilisateurs",
"userUpdated": "Utilisateur mis à jour !",
"username": "Nom d'utilisateur",
"users": "Utilisateurs",
"userCreated": "Utilisateur'ice créé !",
"userDefaults": "Paramètres par défaut de l'utilisateur'ice",
"userDeleted": "Utilisateur'ice supprimé !",
"userManagement": "Gestion des utilisateur'ices",
"userUpdated": "Utilisateur'ice mis à jour !",
"username": "Nom d'utilisateur'ice",
"users": "Utilisateur'ices",
"currentPassword": "Mot de Passe Actuel"
},
"sidebar": {
+3
View File
@@ -264,6 +264,9 @@
"shareManagement": "Upravljanje Dijeljenjem",
"shareDeleted": "Podjela izbrisana!",
"singleClick": "Koristi jednostruke klikove za otvaranje datoteka i mapa",
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
"sunsetTitle": "File Browser is being archived",
"themes": {
"default": "Zadano - Sustav",
"dark": "Tamno",
+6 -3
View File
@@ -29,8 +29,8 @@
"rename": "이름 바꾸기",
"replace": "대체",
"reportIssue": "문제 보고",
"resumeTransfer": "Resume previous transfer",
"resumeTransferTooltip": "Skip all conflicting files, except the ones that are smaller on the server as we suppose that their transfert has been interrupted.",
"resumeTransfer": "이전 전송을 재개",
"resumeTransferTooltip": "서버에 있는 파일 중 전송이 중단되었을 가능성이 있는 작은 파일을 제외하고 충돌하는 모든 파일을 건너뜁니다.",
"save": "저장",
"schedule": "일정",
"search": "검색",
@@ -264,6 +264,9 @@
"shareManagement": "공유 내역 관리",
"shareDeleted": "공유 삭제됨!",
"singleClick": "단일 클릭으로 파일 및 디렉터리 열기",
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
"sunsetTitle": "File Browser is being archived",
"themes": {
"default": "시스템 기본값",
"dark": "어두운 테마",
@@ -283,7 +286,7 @@
"currentPassword": "현재 비밀번호"
},
"sidebar": {
"diskUsed": "{used} of {total} used",
"diskUsed": "{total} 중 {used} 사용",
"help": "도움말",
"hugoNew": "Hugo New",
"login": "로그인",
+3
View File
@@ -264,6 +264,9 @@
"shareManagement": "Beheer van gedeelde mappen en bestanden",
"shareDeleted": "Delen opheffen!",
"singleClick": "Bestanden en mappen met een enkele klik openen",
"sunsetBody": "Dit project wordt afgebouwd. Het wordt gearchiveerd op 01-09-2026, waarna er geen releases, bugfixes of beveiligingsoplossingen meer zullen worden uitgegeven. Bestaande releases en Docker-afbeeldingen blijven online. Stel deze instantie niet rechtstreeks bloot aan internet zonder authenticatie ervoor.",
"sunsetLink": "Lees de projectstatus, bekende niet-gefixeerde beveiligingsproblemen en verhardingsrichtlijnen",
"sunsetTitle": "File Browser wordt gearchiveerd",
"themes": {
"default": "Systeem standaard",
"dark": "Donker",
+3
View File
@@ -264,6 +264,9 @@
"shareManagement": "Zarządzanie udostępnianiem",
"shareDeleted": "Udostępnienie usunięte!",
"singleClick": "Używaj pojedynczych kliknięć, aby otwierać pliki i foldery",
"sunsetBody": "Ten projekt jest w trakcie zamykania. Zostanie zarchiwizowany 1 września 2026 r., po czym nie będzie żadnych kolejnych wydań, poprawek błędów ani poprawek zabezpieczeń. Istniejące wydania i obrazy Dockera pozostaną online. Nie udostępniaj tej instancji bezpośrednio w internecie bez uwierzytelnienia.",
"sunsetLink": "Przeczytaj stan projektu, znane nierozwiązane problemy bezpieczeństwa i wskazówki dotyczące wzmacniania zabezpieczeń",
"sunsetTitle": "File Browser jest archiwizowany",
"themes": {
"default": "Domyślny systemowy",
"dark": "Ciemny",
+4 -1
View File
@@ -238,7 +238,7 @@
"newPasswordConfirm": "Confirmar a sua palavra-passe",
"newUser": "Novo Utilizador",
"password": "Palavra-passe",
"passwordUpdated": "Palavras-passe não coincidem!",
"passwordUpdated": "Palavra-passe atualizada!",
"path": "Caminho",
"perm": {
"create": "Criar ficheiros e pastas",
@@ -264,6 +264,9 @@
"shareManagement": "Gestão de Partilhas",
"shareDeleted": "Partilha eliminada!",
"singleClick": "Utilizar cliques únicos para abrir ficheiros e pastas",
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
"sunsetTitle": "File Browser is being archived",
"themes": {
"default": "Predefinição do sistema",
"dark": "Escuro",
-309
View File
@@ -1,309 +0,0 @@
{
"buttons": {
"cancel": "Cancelar",
"clear": "Limpar",
"close": "Fechar",
"continue": "Continuar",
"copy": "Copiar",
"copyFile": "Copiar ficheiro",
"copyToClipboard": "Copiar",
"copyDownloadLinkToClipboard": "Copy download link to clipboard",
"create": "Criar",
"delete": "Eliminar",
"download": "Descarregar",
"file": "File",
"folder": "Folder",
"fullScreen": "Toggle full screen",
"hideDotfiles": "Hide dotfiles",
"info": "Info",
"more": "Mais",
"move": "Mover",
"moveFile": "Mover ficheiro",
"new": "Novo",
"next": "Próximo",
"ok": "OK",
"permalink": "Obter link permanente",
"previous": "Anterior",
"preview": "Preview",
"publish": "Publicar",
"rename": "Alterar nome",
"replace": "Substituir",
"reportIssue": "Reportar erro",
"resumeTransfer": "Resume previous transfer",
"resumeTransferTooltip": "Skip all conflicting files, except the ones that are smaller on the server as we suppose that their transfert has been interrupted.",
"save": "Guardar",
"schedule": "Agendar",
"search": "Pesquisar",
"select": "Selecionar",
"selectMultiple": "Selecionar vários",
"share": "Partilhar",
"shell": "Alternar shell",
"submit": "Submit",
"switchView": "Alterar vista",
"toggleSidebar": "Alternar barra lateral",
"update": "Atualizar",
"upload": "Enviar",
"openFile": "Open file",
"openDirect": "View raw",
"discardChanges": "Discard",
"stopSearch": "Stop searching",
"saveChanges": "Save changes",
"editAsText": "Edit as Text",
"increaseFontSize": "Increase font size",
"decreaseFontSize": "Decrease font size",
"overrideAll": "Replace all files in destination folder",
"skipAll": "Skip all conflicting files",
"renameAll": "Rename all files (create a copy)",
"singleDecision": "Decide for each conflicting file"
},
"download": {
"downloadFile": "Descarregar ficheiro",
"downloadFolder": "Descarregar pasta",
"downloadSelected": "Download Selected"
},
"upload": {
"abortUpload": "Are you sure you wish to abort?"
},
"errors": {
"forbidden": "Não tem permissões para aceder a isto",
"internal": "Algo correu bastante mal.",
"notFound": "Esta localização não é alcançável.",
"connection": "The server can't be reached."
},
"files": {
"body": "Corpo",
"closePreview": "Fechar pré-visualização",
"files": "Ficheiros",
"folders": "Pastas",
"home": "Início",
"lastModified": "Última alteração",
"loading": "A carregar...",
"lonely": "Sinto-me sozinho...",
"metadata": "Metadados",
"multipleSelectionEnabled": "Seleção múltipla ativada",
"name": "Nome",
"size": "Tamanho",
"sortByLastModified": "Ordenar pela última alteração",
"sortByName": "Ordenar pelo nome",
"sortBySize": "Ordenar pelo tamanho",
"noPreview": "Preview is not available for this file.",
"csvTooLarge": "CSV file is too large for preview (>5MB). Please download to view.",
"csvLoadFailed": "Failed to load CSV file.",
"showingRows": "Showing {count} row(s)",
"columnSeparator": "Column Separator",
"csvSeparators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
},
"fileEncoding": "File Encoding"
},
"help": {
"click": "selecionar pasta ou ficheiro",
"ctrl": {
"click": "selecionar várias pastas e ficheiros",
"f": "pesquisar",
"s": "guardar um ficheiro ou descarrega a pasta em que está a navegar"
},
"del": "eliminar os ficheiros selecionados",
"doubleClick": "abrir pasta ou ficheiro",
"esc": "limpar seleção e/ou fechar menu",
"f1": "esta informação",
"f2": "alterar nome do ficheiro",
"help": "Ajuda"
},
"login": {
"createAnAccount": "Criar uma conta",
"loginInstead": "Já tenho uma conta",
"password": "Palavra-passe",
"passwordConfirm": "Confirmação da palavra-passe",
"passwordsDontMatch": "As palavras-passe não coincidem",
"signup": "Registar",
"submit": "Entrar na conta",
"username": "Nome de utilizador",
"usernameTaken": "O nome de utilizador já está registado",
"wrongCredentials": "Dados errados",
"passwordTooShort": "Password must be at least {min} characters",
"logout_reasons": {
"inactivity": "You have been logged out due to inactivity."
}
},
"permanent": "Permanente",
"prompts": {
"copy": "Copiar",
"copyMessage": "Escolha um lugar para onde copiar os ficheiros:",
"currentlyNavigating": "A navegar em:",
"deleteMessageMultiple": "Quer eliminar {count} ficheiro(s)?",
"deleteMessageSingle": "Quer eliminar esta pasta/ficheiro?",
"deleteMessageShare": "Are you sure you wish to delete this share({path})?",
"deleteUser": "Are you sure you want to delete this user?",
"deleteTitle": "Eliminar ficheiros",
"displayName": "Nome:",
"download": "Descarregar ficheiros",
"downloadMessage": "Escolha o formato do ficheiro que quer descarregar.",
"error": "Algo correu mal",
"fileInfo": "Informação do ficheiro",
"filesSelected": "{count} ficheiros selecionados.",
"lastModified": "Última alteração",
"move": "Mover",
"moveMessage": "Escolha uma nova casa para os seus ficheiros/pastas:",
"newArchetype": "Criar um novo post baseado num \"archetype\". O seu ficheiro será criado na pasta \"content\".",
"newDir": "Nova pasta",
"newDirMessage": "Escreva o nome da nova pasta.",
"newFile": "Novo ficheiro",
"newFileMessage": "Escreva o nome do novo ficheiro.",
"numberDirs": "Número de pastas",
"numberFiles": "Número de ficheiros",
"rename": "Alterar nome",
"renameMessage": "Insira um novo nome para",
"replace": "Substituir",
"replaceMessage": "Já existe um ficheiro com nome igual a um dos que está a tentar enviar. Quer substituí-lo?\n",
"schedule": "Agendar",
"scheduleMessage": "Escolha uma data para publicar este post.",
"show": "Mostrar",
"size": "Tamanho",
"upload": "Upload",
"uploadFiles": "Uploading {files} files...",
"uploadMessage": "Select an option to upload.",
"optionalPassword": "Optional password",
"resolution": "Resolution",
"discardEditorChanges": "Are you sure you wish to discard the changes you've made?",
"replaceOrSkip": "Replace or skip files",
"resolveConflict": "Which files do you want to keep?",
"singleConflictResolve": "If you select both versions, a number will be added to the name of the copied file.",
"fastConflictResolve": "The destination folder there are {count} files with same name.",
"uploadingFiles": "Uploading files",
"filesInOrigin": "Files in origin",
"filesInDest": "Files in destination",
"override": "Overwrite",
"skip": "Skip",
"forbiddenError": "Forbidden Error",
"currentPassword": "Your password",
"currentPasswordMessage": "Enter your password to validate this action."
},
"search": {
"images": "Imagens",
"music": "Música",
"pdf": "PDF",
"pressToSearch": "Tecla Enter para pesquisar...",
"search": "Pesquisar...",
"typeToSearch": "Escrever para pesquisar...",
"types": "Tipos",
"video": "Vídeos"
},
"settings": {
"aceEditorTheme": "Ace editor theme",
"admin": "Admin",
"administrator": "Administrador",
"allowCommands": "Executar comandos",
"allowEdit": "Editar, renomear e eliminar ficheiros ou pastas",
"allowNew": "Criar novos ficheiros e pastas",
"allowPublish": "Publicar novas páginas e conteúdos",
"allowSignup": "Permitir que os utilizadores criem contas",
"hideLoginButton": "Hide the login button from public pages",
"avoidChanges": "(deixe em branco para manter)",
"branding": "Marca",
"brandingDirectoryPath": "Caminho da pasta de marca",
"brandingHelp": "Pode personalizar a aparência do seu Navegador de Ficheiros, alterar o nome, substituindo o logótipo, adicionando estilos personalizados e mesmo desativando links externos para o GitHub.\nPara mais informações sobre marca personalizada, por favor veja {0}.",
"changePassword": "Alterar palavra-passe",
"commandRunner": "Execução de comandos",
"commandRunnerHelp": "Aqui pode definir comandos que são executados nos eventos nomeados. Tem de escrever um por linha. As variáveis de ambiente {0} e {1} estarão disponíveis, sendo {0} relativo a {1}. Para mais informações sobre esta funcionalidade e as variáveis de ambiente, veja {2}.",
"commandsUpdated": "Comandos atualizados!",
"createUserDir": "Criar automaticamente a pasta de início ao adicionar um novo utilizador",
"minimumPasswordLength": "Minimum password length",
"tusUploads": "Chunked Uploads",
"tusUploadsHelp": "File Browser supports chunked file uploads, allowing for the creation of efficient, reliable, resumable and chunked file uploads even on unreliable networks.",
"tusUploadsChunkSize": "Indicates to maximum size of a request (direct uploads will be used for smaller uploads). You may input a plain integer denoting byte size input or a string like 10MB, 1GB etc.",
"tusUploadsRetryCount": "Number of retries to perform if a chunk fails to upload.",
"userHomeBasePath": "Base path for user home directories",
"userScopeGenerationPlaceholder": "The scope will be auto generated",
"createUserHomeDirectory": "Create user home directory",
"customStylesheet": "Folha de estilos personalizada",
"defaultUserDescription": "Estas são as configurações padrão para novos utilizadores.",
"disableExternalLinks": "Desativar links externos (exceto documentação)",
"disableUsedDiskPercentage": "Disable used disk percentage graph",
"documentation": "documentação",
"examples": "Exemplos",
"executeOnShell": "Executar na shell",
"executeOnShellDescription": "Por padrão, o Navegador de Ficheiros executa os comandos chamando os seus binários diretamente. Se em vez disso, quiser executá-los numa shell (como Bash ou PowerShell), pode definir isso aqui com os argumentos e bandeiras necessários. Se definido, o comando que executa será anexado como um argumento. Isto aplica-se tanto a comandos do utilizador como a hooks de eventos.",
"globalRules": "Isto é um conjunto global de regras de permissão e negação. Elas aplicam-se a todos os utilizadores. Pode especificar regras específicas para cada configuração do utilizador para sobreporem-se a estas.",
"globalSettings": "Configurações globais",
"hideDotfiles": "Hide dotfiles",
"insertPath": "Inserir o caminho",
"insertRegex": "Inserir expressão regular",
"instanceName": "Nome da instância",
"language": "Linguagem",
"lockPassword": "Não permitir que o utilizador altere a palavra-passe",
"newPassword": "Nova palavra-passe",
"newPasswordConfirm": "Confirme a nova palavra-passe",
"newUser": "Novo utilizador",
"password": "Palavra-passe",
"passwordUpdated": "Palavra-passe atualizada!",
"path": "Path",
"perm": {
"create": "Criar ficheiros e pastas",
"delete": "Eliminar ficheiros e pastas",
"download": "Descarregar",
"execute": "Executar comandos",
"modify": "Editar ficheiros",
"rename": "Alterar o nome ou mover ficheiros e pastas",
"share": "Share files (require download permission)"
},
"permissions": "Permissões",
"permissionsHelp": "Pode definir o utilizador como administrador ou escolher as permissões manualmente. Se selecionar a opção \"Administrador\", todas as outras opções serão automaticamente selecionadas. A gestão dos utilizadores é um privilégio restringido aos administradores.\n",
"profileSettings": "Configurações do utilizador",
"redirectAfterCopyMove": "Redirect to destination after copy/move",
"ruleExample1": "previne o acesso a qualquer \"dotfile\" (como .git, .gitignore) em qualquer pasta\n",
"ruleExample2": "bloqueia o acesso ao ficheiro chamado Caddyfile na raiz.",
"rules": "Regras",
"rulesHelp": "Aqui pode definir um conjunto de regras para permitir ou bloquear o acesso do utilizador a determinados ficheiros ou pastas. Os ficheiros bloqueados não irão aparecer durante a navegação. Suportamos expressões regulares e os caminhos dos ficheiros devem ser relativos à base do utilizador.\n",
"scope": "Base",
"setDateFormat": "Set exact date format",
"settingsUpdated": "Configurações atualizadas!",
"shareDuration": "Share Duration",
"shareManagement": "Share Management",
"shareDeleted": "Share deleted!",
"singleClick": "Use single clicks to open files and directories",
"themes": {
"default": "System default",
"dark": "Dark",
"light": "Light",
"title": "Theme"
},
"user": "Utilizador",
"userCommands": "Comandos",
"userCommandsHelp": "Uma lista, separada com espaços, de comandos disponíveis para este utilizados. Exemplo:",
"userCreated": "Utilizador criado!",
"userDefaults": "Configurações padrão do utilizador",
"userDeleted": "Utilizador eliminado!",
"userManagement": "Gestão de utilizadores",
"userUpdated": "Utilizador atualizado!",
"username": "Nome de utilizador",
"users": "Utilizadores",
"currentPassword": "Your Current Password"
},
"sidebar": {
"diskUsed": "{used} of {total} used",
"help": "Ajuda",
"hugoNew": "Hugo New",
"login": "Entrar",
"logout": "Sair",
"myFiles": "Meus ficheiros",
"newFile": "Novo ficheiro",
"newFolder": "Nova pasta",
"preview": "Pré-visualizar",
"settings": "Configurações",
"signup": "Registar",
"siteSettings": "Configurações do site"
},
"success": {
"linkCopied": "Link copiado!"
},
"time": {
"days": "Dias",
"hours": "Horas",
"minutes": "Minutos",
"seconds": "Segundos",
"unit": "Unidades de tempo"
}
}
+100 -97
View File
@@ -28,104 +28,104 @@
"publish": "发布",
"rename": "重命名",
"replace": "替换",
"reportIssue": "报告问题",
"resumeTransfer": "Resume previous transfer",
"resumeTransferTooltip": "Skip all conflicting files, except the ones that are smaller on the server as we suppose that their transfert has been interrupted.",
"reportIssue": "反馈问题",
"resumeTransfer": "恢复之前的传输任务",
"resumeTransferTooltip": "跳过所有同名冲突文件;服务器端文件更小则判定为传输中断,保留该文件并继续传输。",
"save": "保存",
"schedule": "计划",
"search": "搜索",
"select": "选择",
"selectMultiple": "选择多个",
"selectMultiple": "多选",
"share": "分享",
"shell": "激活 Shell",
"shell": "切换终端",
"submit": "提交",
"switchView": "切换显示方式",
"switchView": "切换视图",
"toggleSidebar": "切换侧边栏",
"update": "更新",
"upload": "上传",
"openFile": "打开文件",
"openDirect": "View raw",
"discardChanges": "放弃更改",
"openDirect": "查看原始内容",
"discardChanges": "放弃",
"stopSearch": "停止搜索",
"saveChanges": "保存更改",
"editAsText": "以文本形式编辑",
"increaseFontSize": "增大字体大小",
"decreaseFontSize": "减小字体大小",
"overrideAll": "Replace all files in destination folder",
"skipAll": "Skip all conflicting files",
"renameAll": "Rename all files (create a copy)",
"singleDecision": "Decide for each conflicting file"
"editAsText": "以文本模式编辑",
"increaseFontSize": "放大字体",
"decreaseFontSize": "缩小字体",
"overrideAll": "替换目标文件夹中的所有文件",
"skipAll": "跳过所有冲突文件",
"renameAll": "全部重命名(创建副本)",
"singleDecision": "逐个处理冲突文件"
},
"download": {
"downloadFile": "下载文件",
"downloadFolder": "下载文件夹",
"downloadSelected": "下载已选"
"downloadSelected": "下载选中项"
},
"upload": {
"abortUpload": "你确定要中止吗?"
},
"errors": {
"forbidden": "你无权限访问",
"internal": "服务器出了点问题。",
"notFound": "找不到文件。",
"connection": "无法连接到服务器。"
"forbidden": "权限不足,拒绝访问",
"internal": "服务器内部错误",
"notFound": "该位置无法访问。",
"connection": "无法连接服务器"
},
"files": {
"body": "内容",
"closePreview": "关闭预览",
"files": "文件",
"folders": "文件夹",
"home": "主页",
"lastModified": "最后修改",
"home": "首页",
"lastModified": "修改时间",
"loading": "加载中...",
"lonely": "这里没有任何文件...",
"lonely": "暂无任何文件...",
"metadata": "元数据",
"multipleSelectionEnabled": "多选模式已开启",
"multipleSelectionEnabled": "已开启多选模式",
"name": "名称",
"size": "大小",
"sortByLastModified": "按最后修改时间排序",
"sortByLastModified": "按修改时间排序",
"sortByName": "按名称排序",
"sortBySize": "按大小排序",
"noPreview": "此文件无法预览。",
"csvTooLarge": "CSV文件大到无法预览(>5MB)。请下载查看。",
"csvLoadFailed": "加载 CSV 文件失败。",
"showingRows": "正在显示 {count} 行",
"noPreview": "该文件暂不支持预览",
"csvTooLarge": "CSV 文件过大(>5MB),无法预览,请下载后查看",
"csvLoadFailed": "CSV 文件加载失败",
"showingRows": "当前显示 {count} 行数据",
"columnSeparator": "列分隔符",
"csvSeparators": {
"comma": "逗号 (,)",
"semicolon": "分号 (;)",
"both": "逗号 (,) 和分号 (;)"
},
"fileEncoding": "File Encoding"
"fileEncoding": "文件编码"
},
"help": {
"click": "选择文件或文件夹",
"click": "选中文件或文件夹",
"ctrl": {
"click": "选择多个文件或文件夹",
"click": "多选文件或文件夹",
"f": "打开搜索框",
"s": "保存文件或下载当前文件夹"
},
"del": "删除所选的文件/文件夹",
"doubleClick": "打开文件/文件夹",
"esc": "清除已选项或关闭提示信息",
"f1": "显示该帮助信息",
"f2": "重命名文件/文件夹",
"esc": "取消选中或关闭提示框",
"f1": "打开帮助",
"f2": "重命名文件",
"help": "帮助"
},
"login": {
"createAnAccount": "创建用户",
"loginInstead": "已有用户登录",
"createAnAccount": "注册账号",
"loginInstead": "已有账号",
"password": "密码",
"passwordConfirm": "确认密码",
"passwordsDontMatch": "密码不一致",
"passwordsDontMatch": "两次输入的密码不一致",
"signup": "注册",
"submit": "登录",
"username": "用户名",
"usernameTaken": "用户名已经被使用",
"wrongCredentials": "用户名或密码错误",
"passwordTooShort": "密码必须至少包含 {min} 个字符",
"passwordTooShort": "密码长度至少为 {min} 位字符",
"logout_reasons": {
"inactivity": "由于未活动,您已登出。"
"inactivity": "因长时间未操作,系统已自动登出."
}
},
"permanent": "永久",
@@ -136,58 +136,58 @@
"deleteMessageMultiple": "你确定要删除这 {count} 个文件吗?",
"deleteMessageSingle": "你确定要删除这个文件/文件夹吗?",
"deleteMessageShare": "你确定要删除这个分享({path})吗?",
"deleteUser": "你确定要删除这个用户吗?",
"deleteUser": "确定要删除该用户吗?",
"deleteTitle": "删除文件",
"displayName": "名称:",
"download": "下载文件",
"downloadMessage": "请选择要下载的压缩格式。",
"error": "出了一点问题...",
"downloadMessage": "请选择要下载的压缩包格式。",
"error": "出现未知错误...",
"fileInfo": "文件信息",
"filesSelected": "已选择 {count} 个文件。",
"lastModified": "最后修改",
"filesSelected": "已选中 {count} 个文件",
"lastModified": "修改时间",
"move": "移动",
"moveMessage": "请选择目标目录:",
"newArchetype": "创建一个基于原型的新帖子。你的文件将会创建在内容文件夹中。",
"newArchetype": "基于模板新建文档,文件将创建在内容目录中。",
"newDir": "新建文件夹",
"newDirMessage": "请输入新文件夹的名称。",
"newFile": "新建文件",
"newFileMessage": "请输入新文件的名称。",
"numberDirs": "文件夹数",
"numberFiles": "文件数",
"numberDirs": "文件夹数量",
"numberFiles": "文件数量",
"rename": "重命名",
"renameMessage": "请输入新名称,旧名称为:",
"renameMessage": "请输入新名称",
"replace": "替换",
"replaceMessage": "你尝试上传的文件中有一个与现有文件的名称存在冲突。是否替换现有的同名文件?\n",
"replaceMessage": "你上传的文件与已有文件重名,是否跳过该文件继续上传,或是替换原有文件?\n",
"schedule": "计划",
"scheduleMessage": "请选择发布这篇帖子的日期与时间。",
"show": "点击以显示",
"scheduleMessage": "请选择文档发布的日期和时间",
"show": "显示",
"size": "大小",
"upload": "上传",
"uploadFiles": "正在上传 {files} ...",
"uploadMessage": "选择上传选项。",
"optionalPassword": "密码(选填,不填即无密码)",
"uploadMessage": "请选择上传选项",
"optionalPassword": "密码(选填,留空则无需密码)",
"resolution": "分辨率",
"discardEditorChanges": "你确定要放弃所做的更改吗?",
"replaceOrSkip": "Replace or skip files",
"resolveConflict": "Which files do you want to keep?",
"singleConflictResolve": "If you select both versions, a number will be added to the name of the copied file.",
"fastConflictResolve": "The destination folder there are {count} files with same name.",
"uploadingFiles": "Uploading files",
"filesInOrigin": "Files in origin",
"filesInDest": "Files in destination",
"override": "Overwrite",
"skip": "Skip",
"forbiddenError": "Forbidden Error",
"currentPassword": "Your password",
"currentPasswordMessage": "Enter your password to validate this action."
"discardEditorChanges": "是否放弃已修改的内容?",
"replaceOrSkip": "替换或跳过文件",
"resolveConflict": "保留哪些文件?",
"singleConflictResolve": "若同时保留两个版本,复制的文件会自动追加序号。",
"fastConflictResolve": "目标目录内存在 {count} 个同名文件",
"uploadingFiles": "正在上传文件",
"filesInOrigin": "源文件",
"filesInDest": "目标文件",
"override": "覆盖",
"skip": "跳过",
"forbiddenError": "权限错误",
"currentPassword": "当前密码",
"currentPasswordMessage": "请输入当前密码以验证操作"
},
"search": {
"images": "图像",
"music": "音乐",
"pdf": "PDF",
"pressToSearch": "按回车以搜索...",
"pressToSearch": "按下回车开始搜索...",
"search": "搜索...",
"typeToSearch": "输入以搜索...",
"typeToSearch": "输入内容进行搜索...",
"types": "类型",
"video": "视频"
},
@@ -195,47 +195,47 @@
"aceEditorTheme": "Ace编辑器主题",
"admin": "管理员",
"administrator": "管理员",
"allowCommands": "执行命令(Shell 命令)",
"allowCommands": "允许执行终端命令",
"allowEdit": "编辑、重命名或删除文件/文件夹",
"allowNew": "创建新文件和文件夹",
"allowPublish": "发布新的帖子与页面",
"allowSignup": "允许用户注册",
"hideLoginButton": "从公开页面隐藏登录按钮",
"avoidChanges": "(留空以避免更改)",
"avoidChanges": "(留空则不修改)",
"branding": "品牌",
"brandingDirectoryPath": "品牌信息文件夹路径",
"brandingHelp": "你可以通过改变实例名称,更换 Logo,加入自定义样式,甚至禁用到 Github 的外部链接来自定义 File Browser 的外观和感觉。\n想获得更多信息,请查看 {0}。",
"brandingDirectoryPath": "品牌资源目录路径",
"brandingHelp": "你可以修改站点名称、更换Logo、添加自定义样式,也可以禁用外部GitHub链接,来自定义本文件管理器界面。\n详情请查看 {0}。",
"changePassword": "更改密码",
"commandRunner": "命令执行器",
"commandRunnerHelp": "你可以在此设置在下列事件中执行的命令。每行必须写一条命令。可以在命令中使用环境变量 {0} 和 {1},使 {0} 与 {1} 相关联。关于此功能和可用环境变量的更多信息,请阅读 {2}。",
"commandRunnerHelp": "在此设置事件触发命令,单行单条。环境变量 {0}、{1} 可用,{0} 相对 {1} 生效。功能与变量详情请参考 {2}。",
"commandsUpdated": "命令已更新!",
"createUserDir": "在添加新用户的同时自动创建用户的主目录",
"createUserDir": "新增用户时自动创建用户主目录",
"minimumPasswordLength": "最小密码长度",
"tusUploads": "分块上传",
"tusUploadsHelp": "File Browser 支持分块上传,在不佳的网络下也可进行高效、可靠、可续的文件上传",
"tusUploadsChunkSize": "分块上传大小,例如 10MB 或 1GB",
"tusUploadsHelp": "支持文件分片上传,网络不佳时仍可稳定传输,并支持断点续传。",
"tusUploadsChunkSize": "分块大小(例如:10MB、1GB);小于该值的文件将直接上传。",
"tusUploadsRetryCount": "分块上传失败时的重试次数",
"userHomeBasePath": "用户主目录的路径",
"userScopeGenerationPlaceholder": "自动生成目录范围",
"createUserHomeDirectory": "创建用户主目录",
"customStylesheet": "自定义样式表(CSS)",
"defaultUserDescription": "这些是新用户的默认设置。",
"customStylesheet": "自定义样式表",
"defaultUserDescription": "以下为新用户的默认配置",
"disableExternalLinks": "禁止外部链接(帮助文档除外)",
"disableUsedDiskPercentage": "禁用磁盘已用空间展示",
"documentation": "帮助文档",
"examples": "示例",
"executeOnShell": "在 Shell 中执行",
"executeOnShellDescription": "默认情况下,File Browser 通过直接调用命令的二进制包来执行命令,如果想在 Shell中 执行(如 Bash 或 PowerShell),你可以在这里定义所使用的 Shell 和参数。设置后,你所执行的命令会作为参数追加。本设置对用户命令和事件钩子都生效。",
"globalRules": "这是全局允许与禁止规则。它们作用于所有用户。你可以给每个用户定义单独的特殊规则来覆盖全局规则。",
"executeOnShell": "通过终端执行",
"executeOnShellDescription": "默认直接调用程序执行命令。如需通过终端运行(如Bash、PowerShell 等),可在此配置解释器、参数及选项,执行命令将自动作为参数传入。本设置对用户命令和事件钩子均生效。",
"globalRules": "全局访问规则,对所有用户生效。也可单独为用户设置规则来覆盖全局规则。",
"globalSettings": "全局设置",
"hideDotfiles": "不显示隐藏文件",
"insertPath": "插入路径",
"insertRegex": "插入正则表达式",
"instanceName": "实例名称",
"instanceName": "站点名称",
"language": "语言",
"lockPassword": "禁止用户修改密码",
"newPassword": "你的新密码",
"newPasswordConfirm": "再次输入以确认你的新密码",
"newPassword": "新密码",
"newPasswordConfirm": "再次输入新密码",
"newUser": "新建用户",
"password": "密码",
"passwordUpdated": "密码已更新!",
@@ -247,23 +247,26 @@
"execute": "执行命令",
"modify": "编辑",
"rename": "重命名或移动文件和文件夹",
"share": "Share files (require download permission)"
"share": "分享文件(需开启下载权限)"
},
"permissions": "权限",
"permissionsHelp": "你可以将该用户设置为管理员或单独选择各项权限。如果你选择了“管理员”,则其他的选项会被自动选中,同时该用户可以管理其他用户。\n",
"profileSettings": "个人设置",
"redirectAfterCopyMove": "复制/移动后转到目标位置",
"ruleExample1": "阻止用户访问所有文件夹下任何以 . 开头的文件(隐藏文件, 例如: .git, .gitignore)。\n",
"ruleExample2": "阻止用户访问其目录范围的根目录下名为 Caddyfile 的文件。",
"ruleExample1": "禁止用户访问所有目录下以 . 开头的隐藏文件(隐藏文件, 例如: .git, .gitignore)。\n",
"ruleExample2": "禁止用户访问个人根目录下的 Caddyfile 文件。",
"rules": "规则",
"rulesHelp": "你可以为该用户制定一组黑名单或白名单式的规则,被屏蔽的文件将不会显示在列表中,用户也无权限访问,支持正则表达式和相对于用户范围的路径。\n",
"rulesHelp": "可为用户配置黑白名单规则,被限制的文件将隐藏且无法访问。支持正则表达式、相对用户目录的路径写法。\n",
"scope": "目录范围",
"setDateFormat": "显示精确的日期格式",
"settingsUpdated": "设置已更新!",
"shareDuration": "分享期限",
"shareManagement": "分享管理",
"shareDeleted": "分享已删除!",
"singleClick": "使用单击来打开文件和文件夹",
"singleClick": "单击打开文件/文件夹",
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
"sunsetTitle": "File Browser is being archived",
"themes": {
"default": "系统默认",
"dark": "深色",
@@ -271,30 +274,30 @@
"title": "主题"
},
"user": "用户",
"userCommands": "用户命令(Shell 命令)",
"userCommandsHelp": "指定该用户可以执行的命令(Shell 命令),用空格分隔。例如:\n",
"userCommands": "可用终端命令",
"userCommandsHelp": "指定该用户可执行的终端命令,多个命令用空格分隔。示例:\n",
"userCreated": "用户已创建!",
"userDefaults": "用户默认设置",
"userDeleted": "用户已删除!",
"userManagement": "用户管理",
"userUpdated": "用户已更新!",
"userUpdated": "用户信息已更新!",
"username": "用户名",
"users": "用户",
"currentPassword": "您当前的密码"
"currentPassword": "当前密码"
},
"sidebar": {
"diskUsed": "{used} of {total} used",
"diskUsed": "已使用 {used} / 总容量 {total}",
"help": "帮助",
"hugoNew": "Hugo 新建",
"login": "登录",
"logout": "登出",
"logout": "退出",
"myFiles": "我的文件",
"newFile": "新建文件",
"newFolder": "新建文件夹",
"preview": "预览",
"settings": "设置",
"signup": "注册",
"siteSettings": "网站设置"
"siteSettings": "站点设置"
},
"success": {
"linkCopied": "链接已复制!"
+6 -10
View File
@@ -180,7 +180,7 @@ const router = createRouter({
routes,
});
router.beforeResolve(async (to, from, next) => {
router.beforeResolve(async (to, from) => {
const title = i18n.global.t(titles[to.name as keyof typeof titles]);
document.title = title + " - " + name;
@@ -196,29 +196,25 @@ router.beforeResolve(async (to, from, next) => {
}
if (to.path.endsWith("/login") && authStore.isLoggedIn) {
next({ path: "/files/" });
return;
return { path: "/files/" };
}
if (to.matched.some((record) => record.meta.requiresAuth)) {
if (!authStore.isLoggedIn) {
next({
return {
path: "/login",
query: { redirect: to.fullPath },
});
return;
};
}
if (to.matched.some((record) => record.meta.requiresAdmin)) {
if (authStore.user === null || !authStore.user.perm.admin) {
next({ path: "/403" });
return;
return { path: "/403" };
}
}
}
next();
return;
});
export { router, router as default };
Loaded 100 of 163 files, more files were not shown because too many files have changed in this diff. Show more