Compare commits

..
244 Commits
Author SHA1 Message Date
SantaSpeen 9f777bafbc fix: refresh browser tab icon URLs to bypass legacy favicon cache 2026-10-25 21:45:15 +03:00
SantaSpeen be4a1ac807 fix: match browser and app icons to workspace folder branding 2026-10-25 21:37:56 +03:00
SantaSpeen 55f2474660 fix: make workspace navigation atomic and return home on account switch 2026-10-25 21:19:10 +03:00
SantaSpeen c02bf755f2 feat: adopt shared internal SSO sessions and add no-sso launch mode 2026-10-24 15:41:39 +03:00
SantaSpeen c209f1effc feat: polish workspace transfers and verify Craft server file workflows 2026-10-24 02:01:28 +03:00
SantaSpeen 7fd7ae6733 Add profile 3D preferences and adapt DICOM preview resolution to memory budget 2026-10-22 22:29:28 +03:00
SantaSpeen 705762d57c Raise source and decoded DICOM series limits to 1.5 GiB 2026-10-22 22:15:16 +03:00
SantaSpeen 86dc0e8d95 Log DICOM series sizes and exact volume limit failures 2026-10-22 22:12:56 +03:00
SantaSpeen 68a6801690 Raise DICOM volume limit to 1 GiB and simplify image controls 2026-10-22 21:58:43 +03:00
SantaSpeen 6873f04bfb Fix embedded preview chunks and serve JavaScript without gzip copies 2026-10-22 21:50:55 +03:00
SantaSpeen 6d8faa7d03 Add scoped DICOM series previews with 3D volume and MPR views 2026-10-22 21:06:46 +03:00
SantaSpeen 7371c29111 Fix DeckCraft WASM startup and prefer built-in file previews 2026-10-22 20:16:12 +03:00
SantaSpeen 852140c3a7 Integrate graphics, RAW, audio and CAD Craft tools with protected saves 2026-10-22 19:48:16 +03:00
SantaSpeen 6e36b6c4b7 Add WordCraft and DeckCraft office editors with protected server saves 2026-10-22 19:25:22 +03:00
SantaSpeen bc9709e500 Open Craft editors in standalone tabs and improve addon settings 2026-10-22 19:02:35 +03:00
SantaSpeen 5cb1b463ea Add managed Craft addons with secure installation and document editing 2026-10-22 18:46:46 +03:00
SantaSpeen 1afa755d4f Open create submenu beside context menu and distinguish rename icons 2026-10-22 16:28:41 +03:00
SantaSpeen c05293a948 Rename administrative settings to control panel 2026-10-22 16:16:33 +03:00
SantaSpeen ab7b77de39 Use settings gear for personal settings menu item 2026-10-22 16:14:29 +03:00
SantaSpeen 54761e4ef2 Move settings navigation to account menu and add file creation templates 2026-10-22 16:07:59 +03:00
SantaSpeen 042392f611 Redesign file context menus and download archives using global preference 2026-10-22 15:35:25 +03:00
SantaSpeen 6aca927851 Add expressive unified file icons for popular extension families 2026-10-22 15:19:41 +03:00
SantaSpeen d8bdf5f390 Preserve SVG icon drawing size when action padding is applied 2026-10-22 15:07:36 +03:00
SantaSpeen 2366035c72 Modernize icons and file previews; add bounded ZIP directory viewer 2026-10-22 14:24:50 +03:00
SantaSpeen 9110c8a9d5 fix: align settings, modernize notifications and remove branding overrides 2026-10-22 13:17:18 +03:00
SantaSpeen d3d164910b feat: refresh settings, sync account avatars and link account management 2026-10-22 12:52:37 +03:00
SantaSpeen fa1832dfa7 feat: add explorer sidebar, account menu and preview preferences 2026-10-22 12:33:16 +03:00
SantaSpeen b87f8cb961 fix: widen file information and decode DICOM text encodings 2026-10-22 11:20:33 +03:00
SantaSpeen a69fdf2e09 feat: fit DICOM previews and show searchable file metadata 2026-10-22 11:07:27 +03:00
SantaSpeen 7a1d18dfc6 fix: initialize DICOM decoder modules in browser workers 2026-10-22 01:34:55 +03:00
SantaSpeen dd29258828 feat: add local DICOM and canvas PDF previews 2026-10-22 01:25:48 +03:00
SantaSpeen b569f68300 ui: use compact table in share dialog 2026-10-22 01:04:58 +03:00
SantaSpeen 7fc7465f71 feat: simplify public shares and add compact link management 2026-10-22 00:58:05 +03:00
SantaSpeen 5dda0dc5f3 fix: redesign share management and remove public QR codes 2026-10-22 00:37:34 +03:00
SantaSpeen 618fccd7bb fix: align share actions and collapse advanced options 2026-10-21 22:28:46 +03:00
SantaSpeen a0de540dbd fix: retain active identity when upgrading duplicate SSO records 2026-10-21 21:49:39 +03:00
SantaSpeen bd9bf33bc9 fix: preserve SSO identities and polish sharing interface 2026-10-21 21:47:13 +03:00
SantaSpeen 2e3b56f250 docs: tidy generated setup command reference 2026-10-21 20:58:16 +03:00
SantaSpeen 87bc33e675 feat: add SSO workspace, named shares and Debian release tooling 2026-10-21 20:57:44 +03:00
Henrique Dias 833d908884 docs: update post link 2026-07-28 07:53:06 +02:00
Henrique Dias 1cd18d7ead docs: include issue summary in readme 2026-07-27 22:04:46 +02:00
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
Henrique Dias 67ed670d92 chore(release): 2.63.13 2026-06-06 08:33:27 +02:00
Henrique Dias a1a514dcbb fix: copy/move allow overwrite 2026-06-06 08:28:31 +02:00
Henrique Dias 5f7311d324 refactor: cleanup and simplify upload.ts 2026-06-06 08:15:16 +02:00
Henrique Dias 998bd95bfa chore(release): 2.63.12 2026-06-04 17:17:38 +02:00
Puneet Dixit c1abe8f561 fix: await copy move conflict detection (#5978) 2026-06-04 17:16:30 +02:00
Puneet Dixit 0bb2768754 fix: keep mobile file sort controls visible (#5977) 2026-06-04 12:49:30 +02:00
Puneet Dixit 7b7ff8ae8f fix: skip inaccessible children when listing directories (#5958) 2026-06-04 12:49:07 +02:00
Henrique Dias 1086903c14 chore(release): 2.63.11 2026-06-04 11:03:17 +02:00
Henrique Dias 3471ec2c4b fix: incomplete fix for symlinked directories let scopes users and public-share recipients read and write files outside of scope 2026-06-04 11:02:18 +02:00
Henrique Dias 69c76d11cc chore(release): 2.63.10 2026-06-03 15:42:27 +02:00
Henrique Dias 6b04cbf5e9 fix: allow writes when user scope resolves to filesystem root
WithinScope compared targets against root+separator, which produced
"//" when the scope resolved to "/". No path matched, so every write
was rejected with os.ErrPermission (HTTP 403), breaking saves and
uploads for root-scoped installs. Skip the appended separator when root
already ends in one.
2026-06-03 15:40:26 +02:00
Henrique Dias 503fd6b01f chore(release): 2.63.9 2026-06-03 13:13:03 +02:00
Henrique Dias 35db07d015 fix: set X-Content-Type-Options: nosniff on raw file responses
Prevents browsers from MIME-sniffing uploaded files into a renderable type.
2026-06-03 12:21:23 +02:00
Henrique Dias 19514367ad fix: use constant-time comparison for share access token
Compare the share token with subtle.ConstantTimeCompare instead of ==.
2026-06-03 12:21:23 +02:00
Henrique Dias cdd666fc95 fix: prevent symlink scope escape in copy/move/rename
Check WithinScope for src and dst in resourcePatchHandler before
fileutils.Copy/MoveFile, which follow symlinks and bypassed the
stat()/writeFile() guards (GHSA-239w-m3h6-ch8v).
2026-06-03 12:21:23 +02:00
mehmet turac 103acd15fe fix: force octet-stream for attachment downloads (#5942) 2026-06-03 11:59:17 +02:00
Henrique Dias f5e0c4e2e1 chore(release): 2.63.8 2026-06-03 11:57:30 +02:00
Henrique Dias ca019ae7d9 fix: check if share is within scope when creating 2026-06-03 11:57:10 +02:00
Henrique Dias 4488f5b131 chore(release): 2.63.7 2026-06-03 11:44:54 +02:00
Henrique Dias 166583db63 fix: disallow shares for non-existent paths 2026-06-03 11:43:22 +02:00
Henrique Dias 85b7d2762d chore(release): 2.63.6 2026-06-03 11:31:10 +02:00
Henrique Dias 4edabb9ccc chore(docs): update CLI documentation 2026-06-03 11:30:59 +02:00
transifex-integration[bot] 103683069e chore: Updates for project File Browser (#5947) 2026-06-03 11:25:04 +02:00
Ariel Leyva 5328e80d2e fix: parse csv files with uneven columns in their rows (#5965) 2026-06-03 11:22:05 +02:00
Henrique DiasandClaude Opus 4.8 847d08bdd1 fix: address three security disclosures (archive traversal, login DoS, symlink escape)
- http/raw.go: strip Windows backslash separators from archive entry names
  on any host. filepath.ToSlash is a no-op for "\" on Linux, so a stored
  backslash filename was emitted verbatim and could escape the extraction
  directory on Windows extractors (zip-slip). (GHSA-gxjx-7m74-hcq8)

- http/auth.go: cap the login and signup request bodies with
  http.MaxBytesReader (1 MiB). The JSON decoder previously read an
  arbitrarily large password into memory before bcrypt truncated it,
  enabling unauthenticated memory-exhaustion DoS. (GHSA-w5fm-68j4-fpc4)

- files/file.go, http/resource.go: add files.WithinScope and refuse to
  follow a symlink whose on-disk target escapes the user's scoped root,
  on both the read path (stat) and the write path (writeFile). Prevents a
  scoped user from reading/overwriting/sharing files outside their scope
  via a pre-existing escaping symlink. (GHSA-239w-m3h6-ch8v)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 11:21:00 +02:00
Henrique Dias 0231b7ebdf fix: cross-user unauthorized share-link deletion 2026-06-03 10:31:44 +02:00
Henrique Dias e07c59df0b fix: incorrect access control in public directory shares via rule path rebasing 2026-06-03 10:24:05 +02:00
Henrique Dias 0d3eb9bea9 docs: clarify hide dotfiles 2026-06-03 10:20:12 +02:00
Henrique Dias 34ae34e764 fix: remove undocumented hook auth with shell replacement 2026-06-03 09:59:36 +02:00
Henrique Dias ca0108f070 chore: disable automatic major updates 2026-05-21 16:52:04 +02:00
Henrique Dias a1e442ef9e chore(release): 2.63.5 2026-05-21 15:42:07 +02:00
Jose Olcese 6ad8160aa3 fix(router): handle undefined catchAll param on root redirect (#5955) 2026-05-21 15:39:45 +02:00
Henrique Dias 22b848f26e chore(release): 2.63.4 2026-05-17 15:11:55 +02:00
Henrique Dias a418dd6bb3 chore: revert node dependencies updates 2026-05-17 15:10:16 +02:00
transifex-integration[bot] d978d1ecca chore: sync translations (#5945) 2026-05-17 15:05:08 +02:00
mehmet turac 9cc18a81e3 fix: show item shares from all users to admins (#5941) 2026-05-17 15:01:02 +02:00
Henrique Dias e38c28273a chore: fix typo 2026-05-17 15:00:44 +02:00
transifex-integration[bot] da2dff0933 chore: sync translations 2026-05-17 14:59:45 +02:00
renovate[bot] 261bca67bc chore(deps): update all non-major dependencies (#5929) 2026-05-17 14:59:19 +02:00
Henrique Dias ca5e249e3c chore(release): 2.63.3 2026-05-05 14:26:07 +02:00
Anthony GeourjonandHenrique Dias f4e148523e fix: Fix conflict modal and add a resume transfert option (#5884)
Co-authored-by: Henrique Dias <mail@hacdias.com>
2026-05-05 14:24:06 +02:00
renovate[bot] 1f22fe65ec chore(deps): update all non-major dependencies (#5926)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-05 14:15:22 +02:00
transifex-integration[bot] e2bdf6f747 chore: update translations
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-05-05 14:15:09 +02:00
renovate[bot] d236f1c563 chore(deps): update dependency marked to v18 (#5897)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-28 07:18:13 +02:00
hreczkosiej 4edf425a9f chore(i18n): add a translation for disk usage (#5916) 2026-04-28 07:14:10 +02:00
transifex-integration[bot] a1a7ac4f04 chore: update translations (#5918)
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-04-28 07:11:49 +02:00
renovate[bot] 74917c8037 chore(deps): update all non-major dependencies (#5915)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-28 07:11:23 +02:00
transifex-integration[bot] 7bd27f5e82 chore: sync translations (#5901)
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-04-18 07:50:38 +02:00
Nicholas A. Thompson 9f4288b1b4 docs: Update documentation links in Global.vue (#5905) 2026-04-18 07:49:11 +02:00
savef 41b801d30c fix: correct environment variable in compose.yaml (#5910) 2026-04-18 07:48:43 +02:00
renovate[bot] da6b7ac26b chore(deps): update all non-major dependencies (#5912)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-18 07:48:22 +02:00
renovate[bot] 7f8b920aa4 chore(deps): update actions/upload-pages-artifact action to v5 (#5913)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-18 07:48:08 +02:00
Henrique Dias dd53644acb chore(release): 2.63.2 2026-04-11 07:58:44 +02:00
renovate[bot] 9b80a9aa6c chore(deps): update all non-major dependencies (#5870)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-11 07:54:27 +02:00
transifex-integration[bot] 0321415a15 chore: pull translations (#5871)
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-04-11 07:51:05 +02:00
Henrique Dias 23e84c9974 docs: update PR template 2026-04-11 07:50:31 +02:00
Brumaire 0fadf28b18 fix(preview): let arrow keys seek video instead of switching files (#5895) 2026-04-11 07:48:27 +02:00
renovate[bot] 871f337892 chore(deps): update pnpm/action-setup action to v6 (#5898)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-11 07:43:08 +02:00
Henrique Dias 29c73eaca6 chore(release): 2.63.1 2026-04-04 22:15:49 +02:00
kodareef5andHenrique Dias f13c7c8cff fix: restrict default permissions for proxy-auth auto-provisioned users (#5890)
Co-authored-by: Henrique Dias <mail@hacdias.com>
2026-04-04 22:02:34 +02:00
kodareef5 1e03feadb5 fix: check download permission in resource handler (#5891) 2026-04-04 21:58:17 +02:00
kodareef5 8adf127c7d fix: enforce directory boundary in rule path matching (#5889) 2026-04-04 21:57:40 +02:00
kodareef5 7dbf7a3528 fix: check share owner permissions on public share access (#5888) 2026-04-04 21:56:55 +02:00
Henrique Dias 65a837de49 chore(release): 2.63.0 2026-04-04 10:02:07 +02:00
Ariel Leyva 876cdb3426 feat: enable copy operation on drag‑and‑drop with ctrl key (#5882) 2026-04-04 09:54:19 +02:00
Henrique Dias 2f805de527 docs: update docker compose 2026-04-04 09:19:09 +02:00
Ariel Leyva 7a16129bfc fix(tus): reject negative upload-length to prevent inconsistent cache entry (#5876) 2026-04-04 09:11:50 +02:00
Ariel Leyva 0f39bd055e fix: check download permission when sharing permission is enabled (#5875) 2026-04-04 09:11:21 +02:00
Henrique Dias 860c19ddf5 chore(release): 2.62.2 2026-03-28 20:02:32 +01:00
Henrique Dias a8fc1657b7 fix: shares listing 2026-03-28 20:02:12 +01:00
Henrique Dias c406bda0c7 fix: json escaping 2026-03-28 19:54:21 +01:00
Henrique Dias d9f9460c1e fix: use html/template 2026-03-28 19:16:12 +01:00
Henrique Dias 126227bb27 fix: disable scripted content in epub 2026-03-28 19:14:02 +01:00
Henrique Dias b6a4fb1f27 fix: self-registered users don't get execute perms 2026-03-28 19:08:19 +01:00
renovate[bot] 2368e468b9 chore(deps): update pnpm/action-setup action to v5 (#5869)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-28 19:07:00 +01:00
renovate[bot] 8d8cd26d7f chore(deps): update all non-major dependencies (#5838)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-28 19:04:25 +01:00
lif 8f81b77cf2 fix: include filename in Content-Disposition header for inline downloads (#5860) 2026-03-28 19:03:07 +01:00
transifex-integration[bot] 0616f6811f chore: Updates for project File Browser (#5847)
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-03-28 18:59:51 +01:00
fabb 432f3e60ff fix: double slash in TUS upload path when readEntries returns multiple batches (#5848) 2026-03-28 18:59:28 +01:00
renovate[bot] ae72f93667 chore(deps): update actions/deploy-pages action to v5 (#5866)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-28 18:53:12 +01:00
Arran 4812536555 fix: touch Redis upload cache key on GetLength to prevent TTL expiry (#5850) 2026-03-26 16:27:28 +01:00
renovate[bot] 6d44b3ae1d chore(deps): update pnpm/action-setup action to v5 (#5857)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-21 07:14:02 +01:00
renovate[bot] 811cf2dfe5 chore(deps): update go-task/setup-task action to v2 (#5856)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-21 07:13:58 +01:00
Henrique Dias b5f970731b chore(release): 2.62.1 2026-03-14 09:31:34 +01:00
Henrique Dias fc80f4f44c fix: base url/reverse proxy redirect 2026-03-14 09:30:35 +01:00
Henrique Dias 6aea227617 chore(release): 2.62.0 2026-03-14 08:32:56 +01:00
Henrique Dias 09a26166b4 fix: make perm.share depend on share.download 2026-03-14 08:31:55 +01:00
Henrique Dias a63573b67e fix: signup handler shouldn't create admins 2026-03-14 08:23:10 +01:00
Henrique Dias 4bd7d69c82 fix: clean path in patch handler 2026-03-14 08:13:51 +01:00
Henrique Dias c21af0791a fix: around languages 2026-03-14 08:12:03 +01:00
transifex-integration[bot] 858eb42651 feat: Updates for project File Browser (#5807)
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-03-14 07:57:56 +01:00
Henrique Dias 21709428b1 ci: update transifex settings 2026-03-14 07:57:18 +01:00
renovate[bot] 846fb3333a chore(deps): update dependency vite to v8 (#5831)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-14 07:55:55 +01:00
Henrique Dias 6f772f2b10 ci: update transifex settings 2026-03-14 07:55:25 +01:00
renovate[bot] 3c5d36673f chore(deps): update all non-major dependencies (#5818)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-14 07:53:53 +01:00
renovate[bot] 27afbb8813 chore(deps): update dependency @vitejs/plugin-legacy to v8 (#5830)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-14 07:52:28 +01:00
renovate[bot] 79875bac7f chore(deps): update marocchino/sticky-pull-request-comment action to v3 (#5833)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-14 07:51:04 +01:00
Henrique Dias be8ba18937 docs: add notice on proxy 2026-03-12 07:59:20 +01:00
Andrew Katsikas ef2e9992dc fix: properly surface config parse errors (#5822) 2026-03-12 07:34:11 +01:00
Sergio 0542fc0ba4 fix(tus): preserve percent-encoded upload paths in Location header (#5817) 2026-03-11 19:37:07 +01:00
Ariel Leyva f04af0cac6 fix: allow deleting the user's own account (#5820) 2026-03-11 19:36:05 +01:00
Sergio f5f8b60b33 fix(upload): avoid skipping whole folder upload on conflict modal (#5814) 2026-03-11 19:34:57 +01:00
Sergio 6dcef07f40 fix(upload): don't mark every folder-upload file as conflicting (#5813) 2026-03-11 19:34:49 +01:00
Henrique Dias 6700a981a5 docs: update readme 2026-03-11 19:32:42 +01:00
renovate[bot] 490e5bbf99 chore(deps): update docker/setup-qemu-action action to v4 (#5812)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-07 07:40:47 +01:00
renovate[bot] df63cb595c chore(deps): update docker/setup-buildx-action action to v4 (#5811)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-07 07:40:39 +01:00
renovate[bot] 3cb21c727d chore(deps): update docker/login-action action to v4 (#5810)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-07 07:40:31 +01:00
renovate[bot] c01b6a840c chore(deps): update dependency eslint to v10.0.3 (#5809)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-07 07:40:23 +01:00
Henrique Dias cbcf708d94 chore(release): 2.61.2 2026-03-06 16:17:33 +01:00
Henrique Dias 4d9e6b8218 fix(frontend): do not delete original assets 2026-03-06 16:07:08 +01:00
Henrique Dias 8ee55761a1 fix(frontend): input password type 2026-03-06 16:06:54 +01:00
Marcel Szalbach 8598db2acc fix: added dateFormat to getUserDefaults so this is respected in the … (#5804) 2026-03-06 15:32:04 +01:00
transifex-integration[bot] a7dc7bf88a chore: update translations (#5796)
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-03-06 15:28:29 +01:00
renovate[bot] 9f56826fb2 chore(deps): update all non-major dependencies (#5794)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-06 15:27:14 +01:00
Ariel Leyva d7b00ce5f6 fix: avoid sending the same name in the file/folder rename modal (#5806) 2026-03-06 15:26:54 +01:00
Ariel Leyva 177c7cfcce fix: validate current password with a modal (#5805) 2026-03-06 15:26:41 +01:00
Ariel Leyva 4af3f85e64 fix(csv-viewer): add support for missing text encodings in dropdown list (#5795) 2026-03-06 15:26:13 +01:00
Henrique Dias c950a57df8 chore(release): 2.61.1 2026-03-04 10:04:51 +01:00
Henrique Dias 7ed1425115 fix: check for correct permission in TUS Delete 2026-03-04 10:04:22 +01:00
Henrique Dias 148b3c5942 chore(release): 2.61.0 2026-02-28 10:54:35 +01:00
renovate[bot] a40f80672d chore(deps): update all non-major dependencies (#5791)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-28 10:44:31 +01:00
transifex-integration[bot] 8dc618a24b chore: update translations (#5790)
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-02-28 10:44:24 +01:00
Henrique Dias 31194fb57a fix: correctly clean path 2026-02-28 10:31:09 +01:00
Ariel Leyva aa809096eb feat: improved conflict resolution when uploading/copying/moving files (#5765) 2026-02-27 14:55:49 +01:00
renovate[bot] e3d00d591b chore(deps): update goreleaser/goreleaser-action action to v7 (#5782) 2026-02-22 07:12:45 +01:00
423 changed files with 30180 additions and 9127 deletions

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
*.go text eol=lf
*.sh text eol=lf
*.ps1 text eol=lf
*.service text eol=lf
# Keep frontend checkout consistent with Prettier on Windows.
*.vue text eol=lf
*.ts text eol=lf
*.js text eol=lf
*.cjs text eol=lf
*.css text eol=lf
*.json text eol=lf
-1
View File
@@ -1 +0,0 @@
* @filebrowser/maintainers
+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. 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).
+27 -9
View File
@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v6
with:
package_json_file: "frontend/package.json"
- uses: actions/setup-node@v6
@@ -27,6 +27,24 @@ jobs:
pnpm install --frozen-lockfile
pnpm run lint
test-frontend:
name: Test Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
package_json_file: "frontend/package.json"
- uses: actions/setup-node@v6
with:
node-version: "24.x"
cache: "pnpm"
cache-dependency-path: "frontend/pnpm-lock.yaml"
- working-directory: frontend
run: |
pnpm install --frozen-lockfile
pnpm run test
lint-backend:
name: Lint Backend
runs-on: ubuntu-latest
@@ -59,7 +77,7 @@ jobs:
- uses: actions/setup-go@v6
with:
go-version: '1.26'
- uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v6
with:
package_json_file: "frontend/package.json"
- uses: actions/setup-node@v6
@@ -68,7 +86,7 @@ jobs:
cache: "pnpm"
cache-dependency-path: "frontend/pnpm-lock.yaml"
- name: Install Task
uses: go-task/setup-task@v1
uses: go-task/setup-task@v2
- run: task build
release:
@@ -83,7 +101,7 @@ jobs:
- uses: actions/setup-go@v6
with:
go-version: '1.26'
- uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v6
with:
package_json_file: "frontend/package.json"
- uses: actions/setup-node@v6
@@ -92,19 +110,19 @@ jobs:
cache: "pnpm"
cache-dependency-path: "frontend/pnpm-lock.yaml"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v4
- name: Install Task
uses: go-task/setup-task@v1
uses: go-task/setup-task@v2
- run: task build:frontend
- name: Login to Docker Hub
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
uses: goreleaser/goreleaser-action@v7
with:
version: latest
args: release --clean
-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@v3
- name: Install Task
uses: go-task/setup-task@v1
- 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@v3
- name: Install Task
uses: go-task/setup-task@v1
- name: Build site
run: task docs
- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v4
with:
path: www/public
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
+2 -2
View File
@@ -21,7 +21,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: marocchino/sticky-pull-request-comment@v2
- uses: marocchino/sticky-pull-request-comment@v3
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
@@ -40,7 +40,7 @@ jobs:
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
uses: marocchino/sticky-pull-request-comment@v3
with:
header: pr-title-lint-error
delete: true
+8
View File
@@ -37,3 +37,11 @@ build/
default.nix
Dockerfile.dev
# SSO secrets and local setup
.filebrowser.json
.filebrowser.*.json
# Downloaded optional editor bundles
/addons/*
!/addons/.gitkeep
+281
View File
@@ -2,6 +2,287 @@
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)
### Bug Fixes
* copy/move allow overwrite ([a1a514d](https://github.com/filebrowser/filebrowser/commit/a1a514dcbb216d2080412c5354eea1e1fb033050))
### Refactorings
* cleanup and simplify upload.ts ([5f7311d](https://github.com/filebrowser/filebrowser/commit/5f7311d32437e98d7c14c7b307a4f68109275535))
## [2.63.12](https://github.com/filebrowser/filebrowser/compare/v2.63.11...v2.63.12) (2026-06-04)
### Bug Fixes
* await copy move conflict detection ([#5978](https://github.com/filebrowser/filebrowser/issues/5978)) ([c1abe8f](https://github.com/filebrowser/filebrowser/commit/c1abe8f561208bf36bde70879d1a15ef9de998fa))
* keep mobile file sort controls visible ([#5977](https://github.com/filebrowser/filebrowser/issues/5977)) ([0bb2768](https://github.com/filebrowser/filebrowser/commit/0bb2768754d11b865d68e72dcd7cebb232a6308a))
* skip inaccessible children when listing directories ([#5958](https://github.com/filebrowser/filebrowser/issues/5958)) ([7b7ff8a](https://github.com/filebrowser/filebrowser/commit/7b7ff8ae8f97393b2e6ae6e061c1f780077c32b6))
## [2.63.11](https://github.com/filebrowser/filebrowser/compare/v2.63.10...v2.63.11) (2026-06-04)
### Bug Fixes
* incomplete fix for symlinked directories let scopes users and public-share recipients read and write files outside of scope ([3471ec2](https://github.com/filebrowser/filebrowser/commit/3471ec2c4b6473831c72ee889cb3c1a6849a1fb1))
## [2.63.10](https://github.com/filebrowser/filebrowser/compare/v2.63.9...v2.63.10) (2026-06-03)
### Bug Fixes
* allow writes when user scope resolves to filesystem root ([6b04cbf](https://github.com/filebrowser/filebrowser/commit/6b04cbf5e9db1f5b9c0b1624843607ce2881cfc4))
## [2.63.9](https://github.com/filebrowser/filebrowser/compare/v2.63.8...v2.63.9) (2026-06-03)
### Bug Fixes
* force octet-stream for attachment downloads ([#5942](https://github.com/filebrowser/filebrowser/issues/5942)) ([103acd1](https://github.com/filebrowser/filebrowser/commit/103acd15fe57554fe0246bfe70a49b6cb4ae0c51))
* prevent symlink scope escape in copy/move/rename ([cdd666f](https://github.com/filebrowser/filebrowser/commit/cdd666fc95f569ad583c32391e45646fed676dfd))
* set X-Content-Type-Options: nosniff on raw file responses ([35db07d](https://github.com/filebrowser/filebrowser/commit/35db07d0159c520a6b3c969ac52033593914fadd))
* use constant-time comparison for share access token ([1951436](https://github.com/filebrowser/filebrowser/commit/19514367adf2d9fe5be2b7666e397979ea679b94))
## [2.63.8](https://github.com/filebrowser/filebrowser/compare/v2.63.7...v2.63.8) (2026-06-03)
### Bug Fixes
* check if share is within scope when creating ([ca019ae](https://github.com/filebrowser/filebrowser/commit/ca019ae7d966a7c28de2b2341271cd13e3458ae6))
## [2.63.7](https://github.com/filebrowser/filebrowser/compare/v2.63.6...v2.63.7) (2026-06-03)
### Bug Fixes
* disallow shares for non-existent paths ([166583d](https://github.com/filebrowser/filebrowser/commit/166583db632e088e9f0adce30aec43bb9d9019f4))
## [2.63.6](https://github.com/filebrowser/filebrowser/compare/v2.63.5...v2.63.6) (2026-06-03)
### Bug Fixes
* address three security disclosures (archive traversal, login DoS, symlink escape) ([847d08b](https://github.com/filebrowser/filebrowser/commit/847d08bdd135e5c3659f2e6dea2f0cd36617af9b))
* cross-user unauthorized share-link deletion ([0231b7e](https://github.com/filebrowser/filebrowser/commit/0231b7ebdfbe77a6c54027d30c4856c3fd81ee4d))
* incorrect access control in public directory shares via rule path rebasing ([e07c59d](https://github.com/filebrowser/filebrowser/commit/e07c59df0b850f5924d5b1683e8609661ddcf534))
* parse csv files with uneven columns in their rows ([#5965](https://github.com/filebrowser/filebrowser/issues/5965)) ([5328e80](https://github.com/filebrowser/filebrowser/commit/5328e80d2e88d1c279a1250a7dfee4fc96f703ec))
* remove undocumented hook auth with shell replacement ([34ae34e](https://github.com/filebrowser/filebrowser/commit/34ae34e764d72540c039f1f5ea2ec4c974168c1f))
## [2.63.5](https://github.com/filebrowser/filebrowser/compare/v2.63.4...v2.63.5) (2026-05-21)
### Bug Fixes
* **router:** handle undefined catchAll param on root redirect ([#5955](https://github.com/filebrowser/filebrowser/issues/5955)) ([6ad8160](https://github.com/filebrowser/filebrowser/commit/6ad8160aa3309314c1b471c5090b67c824464396))
## [2.63.4](https://github.com/filebrowser/filebrowser/compare/v2.63.3...v2.63.4) (2026-05-17)
### Bug Fixes
* show item shares from all users to admins ([#5941](https://github.com/filebrowser/filebrowser/issues/5941)) ([9cc18a8](https://github.com/filebrowser/filebrowser/commit/9cc18a81e3e1b8bf96795bfbe3d83ced294ecfd7))
## [2.63.3](https://github.com/filebrowser/filebrowser/compare/v2.63.2...v2.63.3) (2026-05-05)
### Bug Fixes
* correct environment variable in compose.yaml ([#5910](https://github.com/filebrowser/filebrowser/issues/5910)) ([41b801d](https://github.com/filebrowser/filebrowser/commit/41b801d30c736c8ca863e2be6aece7d99e92129e))
* Fix conflict modal and add a resume transfert option ([#5884](https://github.com/filebrowser/filebrowser/issues/5884)) ([f4e1485](https://github.com/filebrowser/filebrowser/commit/f4e148523e0dc9242081831b53544396f995c611))
## [2.63.2](https://github.com/filebrowser/filebrowser/compare/v2.63.1...v2.63.2) (2026-04-11)
### Bug Fixes
* **preview:** let arrow keys seek video instead of switching files ([#5895](https://github.com/filebrowser/filebrowser/issues/5895)) ([0fadf28](https://github.com/filebrowser/filebrowser/commit/0fadf28b18e506ddca0027e83ebe567ac57932bf))
## [2.63.1](https://github.com/filebrowser/filebrowser/compare/v2.63.0...v2.63.1) (2026-04-04)
### Bug Fixes
* check download permission in resource handler ([#5891](https://github.com/filebrowser/filebrowser/issues/5891)) ([1e03fea](https://github.com/filebrowser/filebrowser/commit/1e03feadb550e4414b5589a6a8df57f538efba15))
* check share owner permissions on public share access ([#5888](https://github.com/filebrowser/filebrowser/issues/5888)) ([7dbf7a3](https://github.com/filebrowser/filebrowser/commit/7dbf7a3528234b2a9ee9c4115e8ecf58d258ca51))
* enforce directory boundary in rule path matching ([#5889](https://github.com/filebrowser/filebrowser/issues/5889)) ([8adf127](https://github.com/filebrowser/filebrowser/commit/8adf127c7d33585333b8030869f6f318e6517179))
* restrict default permissions for proxy-auth auto-provisioned users ([#5890](https://github.com/filebrowser/filebrowser/issues/5890)) ([f13c7c8](https://github.com/filebrowser/filebrowser/commit/f13c7c8cffd6d58ff29c4a6763ced1385f69961e))
## [2.63.0](https://github.com/filebrowser/filebrowser/compare/v2.62.2...v2.63.0) (2026-04-04)
### Features
* enable copy operation on drag‑and‑drop with ctrl key ([#5882](https://github.com/filebrowser/filebrowser/issues/5882)) ([876cdb3](https://github.com/filebrowser/filebrowser/commit/876cdb34265b090c2a74a69509f4106f2c5e8726))
### Bug Fixes
* check download permission when sharing permission is enabled ([#5875](https://github.com/filebrowser/filebrowser/issues/5875)) ([0f39bd0](https://github.com/filebrowser/filebrowser/commit/0f39bd055efdadc15abd2f8146cf5da3793f8318))
* **tus:** reject negative upload-length to prevent inconsistent cache entry ([#5876](https://github.com/filebrowser/filebrowser/issues/5876)) ([7a16129](https://github.com/filebrowser/filebrowser/commit/7a16129bfc07dbdc2fa52b99d2985c1bc0ea12e2))
## [2.62.2](https://github.com/filebrowser/filebrowser/compare/v2.62.1...v2.62.2) (2026-03-28)
### Bug Fixes
* disable scripted content in epub ([126227b](https://github.com/filebrowser/filebrowser/commit/126227bb2754eee15cd7c722916c3bb8821084a2))
* double slash in TUS upload path when readEntries returns multiple batches ([#5848](https://github.com/filebrowser/filebrowser/issues/5848)) ([432f3e6](https://github.com/filebrowser/filebrowser/commit/432f3e60ffdf92af6f8f56119a1bac8084f52a60))
* include filename in Content-Disposition header for inline downloads ([#5860](https://github.com/filebrowser/filebrowser/issues/5860)) ([8f81b77](https://github.com/filebrowser/filebrowser/commit/8f81b77cf2a3da0a445f3700fbf4a0091ea46c07))
* json escaping ([c406bda](https://github.com/filebrowser/filebrowser/commit/c406bda0c73ac8b187e23a97c05521edc77efa84))
* self-registered users don't get execute perms ([b6a4fb1](https://github.com/filebrowser/filebrowser/commit/b6a4fb1f27f4d894b384c0f3acacda276d1338a5))
* shares listing ([a8fc165](https://github.com/filebrowser/filebrowser/commit/a8fc1657b796c5da7190466beff13e680721b6d3))
* touch Redis upload cache key on GetLength to prevent TTL expiry ([#5850](https://github.com/filebrowser/filebrowser/issues/5850)) ([4812536](https://github.com/filebrowser/filebrowser/commit/48125365551ce2b27790aaafd7594cf5ce52f1ba))
* use html/template ([d9f9460](https://github.com/filebrowser/filebrowser/commit/d9f9460c1e51d10a25065e10358c12d5ced66ad9))
## [2.62.1](https://github.com/filebrowser/filebrowser/compare/v2.62.0...v2.62.1) (2026-03-14)
### Bug Fixes
* base url/reverse proxy redirect ([fc80f4f](https://github.com/filebrowser/filebrowser/commit/fc80f4f44c856ddc19df3024c245990fffd55630))
## [2.62.0](https://github.com/filebrowser/filebrowser/compare/v2.61.2...v2.62.0) (2026-03-14)
### Features
* Updates for project File Browser ([#5807](https://github.com/filebrowser/filebrowser/issues/5807)) ([858eb42](https://github.com/filebrowser/filebrowser/commit/858eb426515ec55172e9cca47bdf1e25a0d0d81d))
### Bug Fixes
* allow deleting the user's own account ([#5820](https://github.com/filebrowser/filebrowser/issues/5820)) ([f04af0c](https://github.com/filebrowser/filebrowser/commit/f04af0cac6c808b8e7c9a9651380c252c4de9132))
* around languages ([c21af07](https://github.com/filebrowser/filebrowser/commit/c21af0791a5df458c2ddb81ce9ae44b772b6d82d))
* clean path in patch handler ([4bd7d69](https://github.com/filebrowser/filebrowser/commit/4bd7d69c82163b201a987e99c0c50d7ecc6ee5f1))
* make perm.share depend on share.download ([09a2616](https://github.com/filebrowser/filebrowser/commit/09a26166b4f79446e7174c017380f6db45444e32))
* properly surface config parse errors ([#5822](https://github.com/filebrowser/filebrowser/issues/5822)) ([ef2e999](https://github.com/filebrowser/filebrowser/commit/ef2e9992dc3098f6c4722c2a98966cd8abf8bab5))
* signup handler shouldn't create admins ([a63573b](https://github.com/filebrowser/filebrowser/commit/a63573b67eb302167b4c4f218361a2d0c138deab))
* **tus:** preserve percent-encoded upload paths in Location header ([#5817](https://github.com/filebrowser/filebrowser/issues/5817)) ([0542fc0](https://github.com/filebrowser/filebrowser/commit/0542fc0ba43740c967414eebd156bac86ad80376))
* **upload:** avoid skipping whole folder upload on conflict modal ([#5814](https://github.com/filebrowser/filebrowser/issues/5814)) ([f5f8b60](https://github.com/filebrowser/filebrowser/commit/f5f8b60b331a07729a1fed1ed065cb6fc20930ea))
* **upload:** don't mark every folder-upload file as conflicting ([#5813](https://github.com/filebrowser/filebrowser/issues/5813)) ([6dcef07](https://github.com/filebrowser/filebrowser/commit/6dcef07f40d550acee63dd01e0a3bcf78532f690))
## [2.61.2](https://github.com/filebrowser/filebrowser/compare/v2.61.1...v2.61.2) (2026-03-06)
### Bug Fixes
* added dateFormat to getUserDefaults so this is respected in the … ([#5804](https://github.com/filebrowser/filebrowser/issues/5804)) ([8598db2](https://github.com/filebrowser/filebrowser/commit/8598db2accccf5b87353e5e718b2ad1c946e5c44))
* avoid sending the same name in the file/folder rename modal ([#5806](https://github.com/filebrowser/filebrowser/issues/5806)) ([d7b00ce](https://github.com/filebrowser/filebrowser/commit/d7b00ce5f672b7ce0b26ce31abdfc74f8b00b939))
* **csv-viewer:** add support for missing text encodings in dropdown list ([#5795](https://github.com/filebrowser/filebrowser/issues/5795)) ([4af3f85](https://github.com/filebrowser/filebrowser/commit/4af3f85e64e795e8ae1d87d4caee8185028294ac))
* **frontend:** do not delete original assets ([4d9e6b8](https://github.com/filebrowser/filebrowser/commit/4d9e6b821852203cef67233791a922013bd5b64d))
* **frontend:** input password type ([8ee5576](https://github.com/filebrowser/filebrowser/commit/8ee55761a1aa9bc091d8466c44f03c2043a8ca79))
* validate current password with a modal ([#5805](https://github.com/filebrowser/filebrowser/issues/5805)) ([177c7cf](https://github.com/filebrowser/filebrowser/commit/177c7cfcce36779e2c5ebaa4b59a055dd1e17648))
## [2.61.1](https://github.com/filebrowser/filebrowser/compare/v2.61.0...v2.61.1) (2026-03-04)
### Bug Fixes
* check for correct permission in TUS Delete ([7ed1425](https://github.com/filebrowser/filebrowser/commit/7ed1425115be602c2b23236c410098ea2d74b42f))
## [2.61.0](https://github.com/filebrowser/filebrowser/compare/v2.60.0...v2.61.0) (2026-02-28)
### Features
* improved conflict resolution when uploading/copying/moving files ([#5765](https://github.com/filebrowser/filebrowser/issues/5765)) ([aa80909](https://github.com/filebrowser/filebrowser/commit/aa809096eb35fdfbdeb6784b1ebfe2ca1e42f52b))
### Bug Fixes
* correctly clean path ([31194fb](https://github.com/filebrowser/filebrowser/commit/31194fb57a5b92e7155219d7ec7273028fcb2e83))
## [2.60.0](https://github.com/filebrowser/filebrowser/compare/v2.59.0...v2.60.0) (2026-02-21)
+8 -123
View File
@@ -1,128 +1,13 @@
# Contributing
# Сборка и разработка
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).
Go 1.26+, Node.js 24+, pnpm 10.33.4. Разработка ведётся в dev, исходная версия сохранена в master-copy.
## Project Structure
Сборка интерфейса: `cd frontend && pnpm install --frozen-lockfile && pnpm run build`.
Затем из корня: `go build -o filebrowser .` и `./filebrowser init`.
The backend side of the application is written in [Go](https://golang.org/), while the frontend (located on a subdirectory of the same name) is written in [Vue.js](https://vuejs.org/). Due to the tight coupling required by some features, basic knowledge of both Go and Vue.js is recommended.
Проверки: `go test ./...`, `go vet ./...`, `pnpm run typecheck`, `pnpm run test`, `pnpm run lint` в frontend.
Аудит: `govulncheck ./...`, `pnpm audit`; для Linux на другой ОС установите GOOS=linux и GOARCH=amd64 при запуске govulncheck.
* Learn Go: [https://github.com/golang/go/wiki/Learn](https://github.com/golang/go/wiki/Learn)
* Learn Vue.js: [https://vuejs.org/guide/introduction.html](https://vuejs.org/guide/introduction.html)
We encourage you to use git to manage your fork. To clone the main repository, just run:
```bash
git clone https://github.com/filebrowser/filebrowser
```
We use [Taskfile](https://taskfile.dev/) to manage the different processes (building, releasing, etc) automatically.
## Build
You can fully build the project in order to produce a binary by running:
```bash
task build
```
## Development
For development, there are a few things to have in mind.
### Frontend
We use [Node.js](https://nodejs.org/en/) on the frontend to manage the build process. Prepare the frontend environment:
```bash
# From the root of the repo, go to frontend/
cd frontend
# Install the dependencies
pnpm install
```
If you just want to develop the backend, you can create a static build of the frontend:
```bash
pnpm run build
```
If you want to develop the frontend, start a development server which watches for changes:
```bash
pnpm run dev
```
Please note that you need to access File Browser's interface through the development server of the frontend.
### Backend
First prepare the backend environment by downloading all required dependencies:
```bash
go mod download
```
You can now build or run File Browser as any other Go project:
```bash
# Build
go build
# Run
go run .
```
## Documentation
We rely on Docker to abstract all the dependencies required for building the documentation.
To build the documentation to `www/public`:
```bash
task docs
```
To start a local server on port `8000` to view the built documentation:
```bash
task docs:serve
```
## Release
To make a release, just run:
```bash
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.
## Authentication Provider
To build a new authentication provider, you need to implement the [Auther interface](https://github.com/filebrowser/filebrowser/blob/master/auth/auth.go), whose method will be called on the login page after the user has submitted their login data.
```go
// Auther is the authentication interface.
type Auther interface {
// Auth is called to authenticate a request.
Auth(r *http.Request, s *users.Storage, root string) (*users.User, error)
}
```
After implementing the interface you should:
1. Add it to [`auth` directory](https://github.com/filebrowser/filebrowser/blob/master/auth).
2. Add it to the [configuration parser](https://github.com/filebrowser/filebrowser/blob/master/cmd/config.go) for the CLI.
3. Add it to the [`authBackend.Get`](https://github.com/filebrowser/filebrowser/blob/master/storage/bolt/auth.go).
If you need to add more flags, please update the function `addConfigFlags`.
Для интерфейса в режиме разработки выполните `pnpm run dev`; запросы API проксируются на 127.0.0.1:8080. Полный OIDC-вход проверяйте через собранный интерфейс: публичный URL и Origin должны совпадать с конфигурацией SSO.
Готовый Debian-архив: `sh scripts/build-release.sh` либо `./scripts/build-release.ps1`. Инструкция — [docs/deployment.md](docs/deployment.md).
+37 -19
View File
@@ -1,30 +1,48 @@
<p align="center">
<img src="https://raw.githubusercontent.com/filebrowser/filebrowser/master/branding/banner.png" width="550"/>
</p>
# File Browser
[![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)
**Ваши файлы, ссылки и браузерные инструменты — на своём сервере.**
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.
[Скачать](https://git.anidev.ru/SantaSpeen/filebrowser/releases) · [Установка](docs/deployment.md) · [Разработка](#сборка)
## Documentation
![Файловое пространство](docs/images/workspace.png)
Documentation on how to install, configure, and contribute to this project is hosted at [filebrowser.org](https://filebrowser.org).
[Мобильный интерфейс](docs/images/workspace-mobile.png)
## Project Status
- **Общая сессия SSO.** Текущий аккаунт и роли проверяются на сервере; переключение синхронизируется между приложениями.
- **Удобное пространство.** Дерево папок, закладки, поиск, меню действий, светлая и тёмная темы, мобильная вёрстка.
- **Мои ссылки.** Короткие адреса `/s/имя`, несколько ссылок на файл, необязательные пароль и срок действия.
- **Предпросмотр.** Изображения, PDF, DICOM 2D, текст, Markdown, CSV, книги, аудио и видео. ZIP показывает дерево без распаковки.
- **Craft-аддоны.** Установка и обновление из панели управления; совместимые редакторы открывают и сохраняют файлы на сервере.
- **Один бинарник.** Debian amd64 и Windows amd64; отдельная СУБД и Node.js для запуска не нужны.
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).
- No new features will be implemented by maintainers. Pull requests for new features will be reviewed on a case by case basis.
- The priority is triaging issues, addressing security issues and reviewing pull requests meant to solve bugs.
```sh
chmod +x filebrowser
./filebrowser init
./filebrowser
```
## Contributing
На Windows: `filebrowser.exe init`, затем `filebrowser.exe`. Мастер настраивает хранилище и SSO без `.env`. Подробности, systemd и nginx — в [инструкции](docs/deployment.md).
Contributions are always welcome. To start contributing to this project, read our [guidelines](CONTRIBUTING.md) first.
Без SSO и пароля: `./filebrowser --no-sso` — все посетители получают административный доступ. [Как работает вход](docs/authentication.md).
## License
## Сборка
[Apache License 2.0](LICENSE) © File Browser Contributors
Go 1.26+, Node.js 24+, pnpm 10.33.4.
```sh
cd frontend
pnpm install --frozen-lockfile
pnpm run build
pnpm test
cd ..
go test ./...
go build -o filebrowser .
```
Релиз для Debian: `sh scripts/build-release.sh` или `./scripts/build-release.ps1`. Архивы и контрольные суммы находятся в `build/`.
`dev` — разработка · `master` — страница проекта · `master-copy` — исходная версия upstream.
Независимый форк [File Browser](https://github.com/filebrowser/filebrowser). [Apache-2.0](LICENSE). [Безопасность и ограничения](docs/SECURITY-REVIEW.md).
+5 -22
View File
@@ -1,26 +1,9 @@
# Security Policy
# Безопасность
## Supported Versions
Этот репозиторий — независимый форк File Browser. Политика архивированного upstream к нему не относится.
Use this section to tell people about which versions of your project are
currently being supported with security updates.
Ограничения и выполненные проверки: [обзор безопасности](docs/SECURITY-REVIEW.md).
| Version | Supported |
| ------- | ------------------ |
| 2.x | :white_check_mark: |
| < 2.0 | :x: |
При обнаружении уязвимости сообщите владельцу этого форка приватно. Укажите версию или коммит, шаги воспроизведения и влияние. Не публикуйте токены, пароли и реальные медицинские файлы.
## 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.
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.
When reporting an issue, where possible, please provide at least:
* 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.
Для размещения в интернете используйте HTTPS и своевременно обновляйте сервер и аддоны. Наличие проверок не гарантирует отсутствия уязвимостей.
+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
+1
View File
@@ -0,0 +1 @@
+10
View File
@@ -1,6 +1,7 @@
package auth
import (
"errors"
"net/http"
"github.com/filebrowser/filebrowser/v2/settings"
@@ -14,3 +15,12 @@ type Auther interface {
// LoginPage indicates if this auther needs a login page.
LoginPage() bool
}
const MethodSSO settings.AuthMethod = "sso"
type SSOAuth struct{}
func (SSOAuth) Auth(*http.Request, users.Store, *settings.Settings, *settings.Server) (*users.User, error) {
return nil, errors.New("use OpenID Connect")
}
func (SSOAuth) LoginPage() bool { return true }
-301
View File
@@ -1,301 +0,0 @@
package auth
import (
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
"os"
"os/exec"
"slices"
"strings"
fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/files"
"github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/v2/users"
)
// MethodHookAuth is used to identify hook auth.
const MethodHookAuth settings.AuthMethod = "hook"
type hookCred struct {
Password string `json:"password"`
Username string `json:"username"`
}
// HookAuth is a hook implementation of an Auther.
type HookAuth struct {
Users users.Store `json:"-"`
Settings *settings.Settings `json:"-"`
Server *settings.Server `json:"-"`
Cred hookCred `json:"-"`
Fields hookFields `json:"-"`
Command string `json:"command"`
}
// Auth authenticates the user via a json in content body.
func (a *HookAuth) Auth(r *http.Request, usr users.Store, stg *settings.Settings, srv *settings.Server) (*users.User, error) {
var cred hookCred
if r.Body == nil {
return nil, os.ErrPermission
}
err := json.NewDecoder(r.Body).Decode(&cred)
if err != nil {
return nil, os.ErrPermission
}
a.Users = usr
a.Settings = stg
a.Server = srv
a.Cred = cred
action, err := a.RunCommand()
if err != nil {
return nil, err
}
switch action {
case "auth":
u, err := a.SaveUser()
if err != nil {
return nil, err
}
return u, nil
case "block":
return nil, os.ErrPermission
case "pass":
u, err := a.Users.Get(a.Server.Root, a.Cred.Username)
if err != nil || !users.CheckPwd(a.Cred.Password, u.Password) {
return nil, os.ErrPermission
}
return u, nil
default:
return nil, fmt.Errorf("invalid hook action: %s", action)
}
}
// LoginPage tells that hook auth requires a login page.
func (a *HookAuth) LoginPage() bool {
return true
}
// RunCommand starts the hook command and returns the action
func (a *HookAuth) RunCommand() (string, error) {
command := strings.Split(a.Command, " ")
envMapping := func(key string) string {
switch key {
case "USERNAME":
return a.Cred.Username
case "PASSWORD":
return a.Cred.Password
default:
return os.Getenv(key)
}
}
for i, arg := range command {
if i == 0 {
continue
}
command[i] = os.Expand(arg, envMapping)
}
cmd := exec.Command(command[0], command[1:]...)
cmd.Env = append(os.Environ(), fmt.Sprintf("USERNAME=%s", a.Cred.Username))
cmd.Env = append(cmd.Env, fmt.Sprintf("PASSWORD=%s", a.Cred.Password))
out, err := cmd.Output()
if err != nil {
return "", err
}
a.GetValues(string(out))
return a.Fields.Values["hook.action"], nil
}
// GetValues creates a map with values from the key-value format string
func (a *HookAuth) GetValues(s string) {
m := map[string]string{}
// make line breaks consistent on Windows platform
s = strings.ReplaceAll(s, "\r\n", "\n")
// iterate input lines
for val := range strings.Lines(s) {
v := strings.SplitN(val, "=", 2)
// skips non key and value format
if len(v) != 2 {
continue
}
fieldKey := strings.TrimSpace(v[0])
fieldValue := strings.TrimSpace(v[1])
if a.Fields.IsValid(fieldKey) {
m[fieldKey] = fieldValue
}
}
a.Fields.Values = m
}
// 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)
if err != nil && !errors.Is(err, fberrors.ErrNotExist) {
return nil, err
}
if u == nil {
pass, err := users.ValidateAndHashPwd(a.Cred.Password, a.Settings.MinimumPasswordLength)
if err != nil {
return nil, err
}
// create user with the provided credentials
d := &users.User{
Username: a.Cred.Username,
Password: pass,
Scope: a.Settings.Defaults.Scope,
Locale: a.Settings.Defaults.Locale,
ViewMode: a.Settings.Defaults.ViewMode,
SingleClick: a.Settings.Defaults.SingleClick,
RedirectAfterCopyMove: a.Settings.Defaults.RedirectAfterCopyMove,
Sorting: a.Settings.Defaults.Sorting,
Perm: a.Settings.Defaults.Perm,
Commands: a.Settings.Defaults.Commands,
HideDotfiles: a.Settings.Defaults.HideDotfiles,
}
u = a.GetUser(d)
userHome, err := a.Settings.MakeUserDir(u.Username, u.Scope, a.Server.Root)
if err != nil {
return nil, fmt.Errorf("user: failed to mkdir user home dir: [%s]", userHome)
}
u.Scope = userHome
log.Printf("user: %s, home dir: [%s].", u.Username, userHome)
err = a.Users.Save(u)
if err != nil {
return nil, err
}
} else if p := !users.CheckPwd(a.Cred.Password, u.Password); len(a.Fields.Values) > 1 || p {
u = a.GetUser(u)
// update the password when it doesn't match the current
if p {
pass, err := users.ValidateAndHashPwd(a.Cred.Password, a.Settings.MinimumPasswordLength)
if err != nil {
return nil, err
}
u.Password = pass
}
// update user with provided fields
err := a.Users.Update(u)
if err != nil {
return nil, err
}
}
return u, nil
}
// GetUser returns a User filled with hook values or provided defaults
func (a *HookAuth) GetUser(d *users.User) *users.User {
// adds all permissions when user is admin
isAdmin := a.Fields.GetBoolean("user.perm.admin", d.Perm.Admin)
perms := users.Permissions{
Admin: isAdmin,
Execute: isAdmin || a.Fields.GetBoolean("user.perm.execute", d.Perm.Execute),
Create: isAdmin || a.Fields.GetBoolean("user.perm.create", d.Perm.Create),
Rename: isAdmin || a.Fields.GetBoolean("user.perm.rename", d.Perm.Rename),
Modify: isAdmin || a.Fields.GetBoolean("user.perm.modify", d.Perm.Modify),
Delete: isAdmin || a.Fields.GetBoolean("user.perm.delete", d.Perm.Delete),
Share: isAdmin || a.Fields.GetBoolean("user.perm.share", d.Perm.Share),
Download: isAdmin || a.Fields.GetBoolean("user.perm.download", d.Perm.Download),
}
user := users.User{
ID: d.ID,
Username: d.Username,
Password: d.Password,
Scope: a.Fields.GetString("user.scope", d.Scope),
Locale: a.Fields.GetString("user.locale", d.Locale),
ViewMode: users.ViewMode(a.Fields.GetString("user.viewMode", string(d.ViewMode))),
SingleClick: a.Fields.GetBoolean("user.singleClick", d.SingleClick),
RedirectAfterCopyMove: a.Fields.GetBoolean("user.redirectAfterCopyMove", d.RedirectAfterCopyMove),
Sorting: files.Sorting{
Asc: a.Fields.GetBoolean("user.sorting.asc", d.Sorting.Asc),
By: a.Fields.GetString("user.sorting.by", d.Sorting.By),
},
Commands: a.Fields.GetArray("user.commands", d.Commands),
HideDotfiles: a.Fields.GetBoolean("user.hideDotfiles", d.HideDotfiles),
Perm: perms,
LockPassword: true,
}
return &user
}
// hookFields is used to access fields from the hook
type hookFields struct {
Values map[string]string
}
// validHookFields contains names of the fields that can be used
var validHookFields = []string{
"hook.action",
"user.scope",
"user.locale",
"user.viewMode",
"user.singleClick",
"user.redirectAfterCopyMove",
"user.sorting.by",
"user.sorting.asc",
"user.commands",
"user.hideDotfiles",
"user.perm.admin",
"user.perm.execute",
"user.perm.create",
"user.perm.rename",
"user.perm.modify",
"user.perm.delete",
"user.perm.share",
"user.perm.download",
}
// IsValid checks if the provided field is on the valid fields list
func (hf *hookFields) IsValid(field string) bool {
return slices.Contains(validHookFields, field)
}
// GetString returns the string value or provided default
func (hf *hookFields) GetString(k, dv string) string {
val, ok := hf.Values[k]
if ok {
return val
}
return dv
}
// GetBoolean returns the bool value or provided default
func (hf *hookFields) GetBoolean(k string, dv bool) bool {
val, ok := hf.Values[k]
if ok {
return val == "true"
}
return dv
}
// GetArray returns the array value or provided default
func (hf *hookFields) GetArray(k string, dv []string) []string {
val, ok := hf.Values[k]
if ok && strings.TrimSpace(val) != "" {
return strings.Split(val, " ")
}
return dv
}
-122
View File
@@ -1,122 +0,0 @@
package auth
import (
"encoding/json"
"net/http"
"net/url"
"os"
"strings"
"github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/v2/users"
)
// MethodJSONAuth is used to identify json auth.
const MethodJSONAuth settings.AuthMethod = "json"
// dummyHash is used to prevent user enumeration timing attacks.
// It MUST be a valid bcrypt hash.
const dummyHash = "$2a$10$O4mEMeOL/nit6zqe.WQXauLRbRlzb3IgLHsa26Pf0N/GiU9b.wK1m"
type jsonCred struct {
Password string `json:"password"`
Username string `json:"username"`
ReCaptcha string `json:"recaptcha"`
}
// JSONAuth is a json implementation of an Auther.
type JSONAuth struct {
ReCaptcha *ReCaptcha `json:"recaptcha" yaml:"recaptcha"`
}
// Auth authenticates the user via a json in content body.
func (a JSONAuth) Auth(r *http.Request, usr users.Store, _ *settings.Settings, srv *settings.Server) (*users.User, error) {
var cred jsonCred
if r.Body == nil {
return nil, os.ErrPermission
}
err := json.NewDecoder(r.Body).Decode(&cred)
if err != nil {
return nil, os.ErrPermission
}
// If ReCaptcha is enabled, check the code.
if a.ReCaptcha != nil && a.ReCaptcha.Secret != "" {
ok, err := a.ReCaptcha.Ok(cred.ReCaptcha)
if err != nil {
return nil, err
}
if !ok {
return nil, os.ErrPermission
}
}
u, err := usr.Get(srv.Root, cred.Username)
hash := dummyHash
if err == nil {
hash = u.Password
}
if !users.CheckPwd(cred.Password, hash) {
return nil, os.ErrPermission
}
if err != nil {
return nil, os.ErrPermission
}
return u, nil
}
// LoginPage tells that json auth doesn't require a login page.
func (a JSONAuth) LoginPage() bool {
return true
}
const reCaptchaAPI = "/recaptcha/api/siteverify"
// ReCaptcha identifies a recaptcha connection.
type ReCaptcha struct {
Host string `json:"host"`
Key string `json:"key"`
Secret string `json:"secret"`
}
// Ok checks if a reCaptcha responde is correct.
func (r *ReCaptcha) Ok(response string) (bool, error) {
body := url.Values{}
body.Set("secret", r.Secret)
body.Add("response", response)
client := &http.Client{}
resp, err := client.Post(
r.Host+reCaptchaAPI,
"application/x-www-form-urlencoded",
strings.NewReader(body.Encode()),
)
if err != nil {
return false, err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return false, nil
}
var data struct {
Success bool `json:"success"`
}
err = json.NewDecoder(resp.Body).Decode(&data)
if err != nil {
return false, err
}
return data.Success, nil
}
-24
View File
@@ -1,24 +0,0 @@
package auth
import (
"net/http"
"github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/v2/users"
)
// MethodNoAuth is used to identify no auth.
const MethodNoAuth settings.AuthMethod = "noauth"
// NoAuth is no auth implementation of auther.
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))
}
// LoginPage tells that no auth doesn't require a login page.
func (a NoAuth) LoginPage() bool {
return false
}
-68
View File
@@ -1,68 +0,0 @@
package auth
import (
"errors"
"net/http"
fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/v2/users"
)
// MethodProxyAuth is used to identify no auth.
const MethodProxyAuth settings.AuthMethod = "proxy"
// ProxyAuth is a proxy implementation of an auther.
type ProxyAuth struct {
Header string `json:"header"`
}
// 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)
if errors.Is(err, fberrors.ErrNotExist) {
return a.createUser(usr, setting, srv, username)
}
return user, err
}
func (a ProxyAuth) createUser(usr users.Store, setting *settings.Settings, srv *settings.Server, username string) (*users.User, error) {
const randomPasswordLength = settings.DefaultMinimumPasswordLength + 10
pwd, err := users.RandomPwd(randomPasswordLength)
if err != nil {
return nil, err
}
var hashedRandomPassword string
hashedRandomPassword, err = users.ValidateAndHashPwd(pwd, setting.MinimumPasswordLength)
if err != nil {
return nil, err
}
user := &users.User{
Username: username,
Password: hashedRandomPassword,
LockPassword: true,
}
setting.Defaults.Apply(user)
var userHome string
userHome, err = setting.MakeUserDir(user.Username, user.Scope, srv.Root)
if err != nil {
return nil, err
}
user.Scope = userHome
err = usr.Save(user)
if err != nil {
return nil, err
}
return user, nil
}
// LoginPage tells that proxy auth doesn't require a login page.
func (a ProxyAuth) LoginPage() bool {
return false
}
+1 -4
View File
@@ -1,6 +1,3 @@
package cmd
// Execute executes the commands.
func Execute() error {
return rootCmd.Execute()
}
func Execute() error { return rootCmd.Execute() }
+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.MethodSSO}
ser := &settings.Server{}
if _, err := getSettings(flags, set, ser, &auth.SSOAuth{}, false); err != nil {
t.Fatal(err)
}
if !ser.FollowExternalSymlinks {
t.Error("expected FollowExternalSymlinks to be persisted as true")
}
}
+6 -116
View File
@@ -12,7 +12,6 @@ import (
"github.com/spf13/pflag"
"github.com/filebrowser/filebrowser/v2/auth"
fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/settings"
)
@@ -35,26 +34,15 @@ func addConfigFlags(flags *pflag.FlagSet) {
flags.Bool("hideLoginButton", false, "hide login button from public pages")
flags.Bool("createUserDir", false, "generate user's home directory automatically")
flags.Uint("minimumPasswordLength", settings.DefaultMinimumPasswordLength, "minimum password length for new users")
flags.String("shell", "", "shell command to which other commands should be appended")
// NB: these are string so they can be presented as octal in the help text
// as that's the conventional representation for modes in Unix.
flags.String("fileMode", fmt.Sprintf("%O", settings.DefaultFileMode), "mode bits that new files are created with")
flags.String("dirMode", fmt.Sprintf("%O", settings.DefaultDirMode), "mode bits that new directories are created with")
flags.String("auth.method", string(auth.MethodJSONAuth), "authentication type")
flags.String("auth.header", "", "HTTP header for auth.method=proxy")
flags.String("auth.command", "", "command for auth.method=hook")
flags.String("auth.logoutPage", "", "url of custom logout page")
flags.String("recaptcha.host", "https://www.google.com", "use another host for ReCAPTCHA. recaptcha.net might be useful in China")
flags.String("recaptcha.key", "", "ReCaptcha site key")
flags.String("recaptcha.secret", "", "ReCaptcha secret")
flags.String("branding.name", "", "replace 'File Browser' by this name")
flags.String("branding.theme", "", "set the theme")
flags.String("branding.color", "", "set the theme color")
flags.String("branding.files", "", "path to directory with images and custom styles")
flags.Bool("branding.disableExternal", false, "disable external links such as GitHub links")
flags.Bool("branding.disableUsedPercentage", false, "disable used disk percentage graph")
@@ -93,107 +81,8 @@ func getAuthMethod(flags *pflag.FlagSet, defaults ...interface{}) (settings.Auth
return method, defaultAuther, nil
}
func getProxyAuth(flags *pflag.FlagSet, defaultAuther map[string]interface{}) (auth.Auther, error) {
header, err := flags.GetString("auth.header")
if err != nil {
return nil, err
}
if header == "" && defaultAuther != nil {
header = defaultAuther["header"].(string)
}
if header == "" {
return nil, errors.New("you must set the flag 'auth.header' for method 'proxy'")
}
return &auth.ProxyAuth{Header: header}, nil
}
func getNoAuth() auth.Auther {
return &auth.NoAuth{}
}
func getJSONAuth(flags *pflag.FlagSet, defaultAuther map[string]interface{}) (auth.Auther, error) {
jsonAuth := &auth.JSONAuth{}
host, err := flags.GetString("recaptcha.host")
if err != nil {
return nil, err
}
key, err := flags.GetString("recaptcha.key")
if err != nil {
return nil, err
}
secret, err := flags.GetString("recaptcha.secret")
if err != nil {
return nil, err
}
if key == "" {
if kmap, ok := defaultAuther["recaptcha"].(map[string]interface{}); ok {
key = kmap["key"].(string)
}
}
if secret == "" {
if smap, ok := defaultAuther["recaptcha"].(map[string]interface{}); ok {
secret = smap["secret"].(string)
}
}
if key != "" && secret != "" {
jsonAuth.ReCaptcha = &auth.ReCaptcha{
Host: host,
Key: key,
Secret: secret,
}
}
return jsonAuth, nil
}
func getHookAuth(flags *pflag.FlagSet, defaultAuther map[string]interface{}) (auth.Auther, error) {
command, err := flags.GetString("auth.command")
if err != nil {
return nil, err
}
if command == "" {
command = defaultAuther["command"].(string)
}
if command == "" {
return nil, errors.New("you must set the flag 'auth.command' for method 'hook'")
}
return &auth.HookAuth{Command: command}, nil
}
func getAuthentication(flags *pflag.FlagSet, defaults ...interface{}) (settings.AuthMethod, auth.Auther, error) {
method, defaultAuther, err := getAuthMethod(flags, defaults...)
if err != nil {
return "", nil, err
}
var auther auth.Auther
switch method {
case auth.MethodProxyAuth:
auther, err = getProxyAuth(flags, defaultAuther)
case auth.MethodNoAuth:
auther = getNoAuth()
case auth.MethodJSONAuth:
auther, err = getJSONAuth(flags, defaultAuther)
case auth.MethodHookAuth:
auther, err = getHookAuth(flags, defaultAuther)
default:
return "", nil, fberrors.ErrInvalidAuthMethod
}
if err != nil {
return "", nil, err
}
return method, auther, nil
func getAuthentication(_ *pflag.FlagSet, _ ...interface{}) (settings.AuthMethod, auth.Auther, error) {
return auth.MethodSSO, &auth.SSOAuth{}, nil
}
func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Auther) error {
@@ -209,7 +98,6 @@ func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Aut
fmt.Fprintln(w, "\nBranding:")
fmt.Fprintf(w, "\tName:\t%s\n", set.Branding.Name)
fmt.Fprintf(w, "\tFiles override:\t%s\n", set.Branding.Files)
fmt.Fprintf(w, "\tDisable external links:\t%t\n", set.Branding.DisableExternal)
fmt.Fprintf(w, "\tDisable used disk percentage graph:\t%t\n", set.Branding.DisableUsedPercentage)
fmt.Fprintf(w, "\tColor:\t%s\n", set.Branding.Color)
@@ -229,6 +117,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)
@@ -236,6 +125,7 @@ func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Aut
fmt.Fprintln(w, "\nDefaults:")
fmt.Fprintf(w, "\tScope:\t%s\n", set.Defaults.Scope)
fmt.Fprintf(w, "\tDateFormat:\t%t\n", set.Defaults.DateFormat)
fmt.Fprintf(w, "\tHideDotfiles:\t%t\n", set.Defaults.HideDotfiles)
fmt.Fprintf(w, "\tLocale:\t%s\n", set.Defaults.Locale)
fmt.Fprintf(w, "\tView mode:\t%s\n", set.Defaults.ViewMode)
@@ -312,6 +202,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":
@@ -342,8 +234,6 @@ func getSettings(flags *pflag.FlagSet, set *settings.Settings, ser *settings.Ser
set.Branding.Theme, err = flags.GetString(flag.Name)
case "branding.color":
set.Branding.Color, err = flags.GetString(flag.Name)
case "branding.files":
set.Branding.Files, err = flags.GetString(flag.Name)
case "branding.disableExternal":
set.Branding.DisableExternal, err = flags.GetBool(flag.Name)
case "branding.disableUsedPercentage":
+5 -30
View File
@@ -67,37 +67,12 @@ The path must be for a json or yaml file.`,
return err
}
var rawAuther = file.Auther
var auther auth.Auther
var autherErr error
switch file.Settings.AuthMethod {
case auth.MethodJSONAuth:
var a interface{}
a, autherErr = getAuther(auth.JSONAuth{}, rawAuther)
auther = a.(*auth.JSONAuth)
case auth.MethodNoAuth:
var a interface{}
a, autherErr = getAuther(auth.NoAuth{}, rawAuther)
auther = a.(*auth.NoAuth)
case auth.MethodProxyAuth:
var a interface{}
a, autherErr = getAuther(auth.ProxyAuth{}, rawAuther)
auther = a.(*auth.ProxyAuth)
case auth.MethodHookAuth:
var a interface{}
a, autherErr = getAuther(&auth.HookAuth{}, rawAuther)
auther = a.(*auth.HookAuth)
default:
return errors.New("invalid auth method")
file.Settings.AuthMethod = auth.MethodSSO
auther := &auth.SSOAuth{}
if err = st.Settings.Save(file.Settings); err != nil {
return err
}
if autherErr != nil {
return autherErr
}
err = st.Auth.Save(auther)
if err != nil {
if err = st.Auth.Save(auther); err != nil {
return err
}
+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{
+173
View File
@@ -0,0 +1,173 @@
package cmd
import (
"bufio"
"encoding/json"
"errors"
"fmt"
"io"
"net/url"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
fbhttp "github.com/filebrowser/filebrowser/v2/http"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"golang.org/x/term"
)
type initialConfig struct {
CacheDir string `json:"cacheDir"`
ImageProcessors int `json:"imageProcessors"`
Address string `json:"address"`
Port string `json:"port"`
Root string `json:"root"`
Database string `json:"database"`
BaseURL string `json:"baseURL"`
DisableExec bool `json:"disableExec"`
SSO fbhttp.SSOConfig `json:"sso"`
}
func init() {
rootCmd.AddCommand(initCmd)
initCmd.Flags().String("output", ".filebrowser.json", "configuration file to create; existing files are never overwritten")
}
var initCmd = &cobra.Command{
Use: "init", Short: "Initial setup: SSO, file directory and database", Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, _ []string) error {
out, _ := cmd.Flags().GetString("output")
out, err := filepath.Abs(out)
if err != nil {
return err
}
if _, err = os.Stat(out); err == nil {
return errors.New("configuration already exists; edit it or select another --output")
} else if !os.IsNotExist(err) {
return err
}
reader := bufio.NewReader(cmd.InOrStdin())
ask := func(label, fallback string) (string, error) {
fmt.Fprintf(cmd.OutOrStdout(), "%s [%s]: ", label, fallback)
line, err := reader.ReadString('\n')
if err != nil && !(errors.Is(err, io.EOF) && line != "") {
return "", err
}
line = strings.TrimSpace(line)
if line == "" {
line = fallback
}
return line, nil
}
var c initialConfig
fmt.Fprintln(cmd.OutOrStdout(), "File Browser — initial setup\nSSO roles Master Admin and FS Admin grant administrator access.")
if c.SSO.Issuer, err = ask("SSO issuer URL", "https://sso.anidev.ru"); err != nil {
return err
}
if c.SSO.ClientID, err = ask("SSO Client ID", ""); err != nil {
return err
}
if term.IsTerminal(int(os.Stdin.Fd())) && cmd.InOrStdin() == os.Stdin {
fmt.Fprint(cmd.OutOrStdout(), "SSO Client secret (hidden): ")
var secret []byte
secret, err = term.ReadPassword(int(os.Stdin.Fd()))
c.SSO.ClientSecret = strings.TrimSpace(string(secret))
fmt.Fprintln(cmd.OutOrStdout())
} else {
c.SSO.ClientSecret, err = ask("SSO Client secret", "")
}
if err != nil {
return err
}
if c.SSO.PublicURL, err = ask("Public File Browser URL", "https://files.anidev.ru"); err != nil {
return err
}
if err = validateSetupURL(c.SSO.Issuer); err != nil {
return fmt.Errorf("issuer: %w", err)
}
if err = validateSetupURL(c.SSO.PublicURL); err != nil {
return fmt.Errorf("public URL: %w", err)
}
if c.SSO.ClientID == "" || c.SSO.ClientSecret == "" {
return errors.New("Client ID and secret are required")
}
if c.Root, err = ask("File directory", "./files"); err != nil {
return err
}
if c.Database, err = ask("Database path", "./filebrowser.db"); err != nil {
return err
}
if c.Address, err = ask("Listen address", "127.0.0.1"); err != nil {
return err
}
if c.Port, err = ask("Listen port", "8080"); err != nil {
return err
}
port, e := strconv.Atoi(c.Port)
if e != nil || port < 1 || port > 65535 {
return errors.New("invalid port")
}
c.Root, err = filepath.Abs(c.Root)
if err != nil {
return err
}
c.Database, err = filepath.Abs(c.Database)
if err != nil {
return err
}
c.CacheDir = filepath.Join(filepath.Dir(c.Database), "cache")
c.ImageProcessors = min(2, runtime.NumCPU())
public, _ := url.Parse(c.SSO.PublicURL)
c.BaseURL = strings.TrimRight(public.Path, "/")
c.SSO.RedirectURI = strings.TrimRight(c.SSO.PublicURL, "/") + "/auth/callback"
c.DisableExec = true
if err = os.MkdirAll(c.Root, 0750); err != nil {
return err
}
if err = os.MkdirAll(filepath.Dir(c.Database), 0700); err != nil {
return err
}
b, err := json.MarshalIndent(c, "", " ")
if err != nil {
return err
}
f, err := os.OpenFile(out, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600)
if err != nil {
return err
}
_, err = f.Write(append(b, '\n'))
closeErr := f.Close()
if err != nil {
return err
}
if closeErr != nil {
return closeErr
}
bootstrapCmd := &cobra.Command{Use: "bootstrap"}
bootstrapCmd.Flags().String("config", out, "")
bootstrapCmd.Flags().String("database", c.Database, "")
addServerFlags(bootstrapCmd.Flags())
bootstrap := withViperAndStore(func(_ *cobra.Command, _ []string, v *viper.Viper, st *store) error {
if !st.databaseExisted {
return quickSetup(v, st.Storage)
}
return nil
}, storeOptions{allowsNoDatabase: true})
if err = bootstrap(bootstrapCmd, nil); err != nil {
return fmt.Errorf("configuration saved; database setup failed: %w", err)
}
fmt.Fprintf(cmd.OutOrStdout(), "\nSaved %s (0600).\nRegister this callback in SSO:\n%s/auth/callback\nStart: filebrowser --config %q\n", out, strings.TrimRight(c.SSO.PublicURL, "/"), out)
return nil
},
}
func validateSetupURL(raw string) error {
u, err := url.Parse(raw)
if err != nil || u.Host == "" || u.User != nil || u.RawQuery != "" || u.Fragment != "" || (u.Scheme != "https" && !(u.Scheme == "http" && (u.Hostname() == "localhost" || u.Hostname() == "127.0.0.1"))) {
return errors.New("use an HTTPS URL; HTTP is allowed only on loopback")
}
return nil
}
+50
View File
@@ -0,0 +1,50 @@
package cmd
import (
"bytes"
"encoding/json"
"os"
"path/filepath"
"strings"
"testing"
)
func TestInitWizard(t *testing.T) {
dir := t.TempDir()
configPath := filepath.Join(dir, "settings.json")
input := strings.Join([]string{"https://sso.example.test", "client-id", "client-secret", "https://files.example.test", filepath.Join(dir, "files"), filepath.Join(dir, "files.db"), "127.0.0.1", "8080", ""}, "\n")
var output bytes.Buffer
initCmd.SetIn(strings.NewReader(input))
initCmd.SetOut(&output)
defer func() { initCmd.SetIn(nil); initCmd.SetOut(nil) }()
if err := initCmd.Flags().Set("output", configPath); err != nil {
t.Fatal(err)
}
if err := initCmd.RunE(initCmd, nil); err != nil {
t.Fatal(err)
}
var c initialConfig
b, err := os.ReadFile(configPath)
if err != nil {
t.Fatal(err)
}
if err = json.Unmarshal(b, &c); err != nil {
t.Fatal(err)
}
if c.SSO.ClientSecret != "client-secret" || !c.DisableExec || c.Root != filepath.Join(dir, "files") {
t.Fatal("configuration lost")
}
if strings.Contains(output.String(), "client-secret") {
t.Fatal("secret leaked to output")
}
if _, err = os.Stat(c.Database); err != nil {
t.Fatal("database not initialized", err)
}
if !strings.Contains(output.String(), "https://files.example.test/auth/callback") {
t.Fatal("callback missing")
}
initCmd.SetIn(strings.NewReader(input))
if err = initCmd.RunE(initCmd, nil); err == nil {
t.Fatal("existing configuration overwritten")
}
}
+35
View File
@@ -0,0 +1,35 @@
package cmd
import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"os"
"path/filepath"
"testing"
)
func TestOnlyExplicitNoSSOFlagSkipsInitialSSOSetup(t *testing.T) {
for _, enabled := range []bool{false, true} {
dir := t.TempDir()
config := filepath.Join(dir, "config.json")
// A JSON setting must not enable this process-only bypass.
if err := os.WriteFile(config, []byte(`{"no-sso":true}`), 0600); err != nil {
t.Fatal(err)
}
command := &cobra.Command{Use: "filebrowser"}
command.Flags().String("config", config, "")
command.Flags().String("database", filepath.Join(dir, "test.db"), "")
command.Flags().Bool("no-sso", false, "")
if enabled {
command.Flags().Set("no-sso", "true")
}
called := false
err := withViperAndStore(func(_ *cobra.Command, _ []string, _ *viper.Viper, _ *store) error { called = true; return nil }, storeOptions{allowsNoDatabase: true})(command, nil)
if enabled && (err != nil || !called) {
t.Fatalf("explicit flag blocked: %v", err)
}
if !enabled && (err == nil || called) {
t.Fatal("configuration silently enabled no-sso")
}
}
}
+69 -96
View File
@@ -13,6 +13,7 @@ import (
"os"
"os/signal"
"path/filepath"
"strings"
"syscall"
"time"
@@ -84,9 +85,7 @@ func init() {
// Runtime flags for the root command
flags := rootCmd.Flags()
flags.Bool("noauth", false, "use the noauth auther when using quick setup")
flags.String("username", "admin", "username for the first user when using quick setup")
flags.String("password", "", "hashed password for the first user when using quick setup")
flags.Bool("no-sso", false, "start without SSO or passwords; everyone with network access is an administrator")
flags.Uint32("socketPerm", 0666, "unix socket file permissions")
flags.String("cacheDir", "", "file cache directory (disabled if empty)")
flags.String("redisCacheUrl", "", "redis cache URL (for multi-instance deployments), e.g. redis://user:pass@host:port")
@@ -111,6 +110,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{
@@ -120,41 +120,8 @@ var rootCmd = &cobra.Command{
manage your users and all the configurations without accessing the
web interface.
If you've never run File Browser, you'll need to have a database for
it. Don't worry: you don't need to setup a separate database server.
We're using Bolt DB which is a single file database and all managed
by ourselves.
For this command, all flags are available as environmental variables,
except for "--config", which specifies the configuration file to use.
The environment variables are prefixed by "FB_" followed by the flag name in
UPPER_SNAKE_CASE. For example, the flag "--disablePreviewResize" is available
as FB_DISABLE_PREVIEW_RESIZE.
If "--config" is not specified, File Browser will look for a configuration
file named .filebrowser.{json, toml, yaml, yml} in the following directories:
- ./
- $HOME/
- /etc/filebrowser/
**Note:** Only the options listed below can be set via the config file or
environment variables. Other configuration options live exclusively in the
database and so they must be set by the "config set" or "config
import" commands.
The precedence of the configuration values are as follows:
- Flags
- Environment variables
- Configuration file
- Database values
- Defaults
Also, if the database path doesn't exist, File Browser will enter into
the quick setup mode and a new database will be bootstrapped and a new
user created with the credentials from options "username" and "password".`,
RunE: withViperAndStore(func(_ *cobra.Command, _ []string, v *viper.Viper, st *store) error {
Run filebrowser init for initial setup. It creates the configuration file, prepares the database and prints the SSO callback URL. Local password accounts and command execution are not supported. Use --no-sso to start without SSO or passwords, granting administrator access to all visitors. Runtime options can still be overridden using flags or FB_ environment variables.`,
RunE: withViperAndStore(func(cmd *cobra.Command, _ []string, v *viper.Viper, st *store) error {
if !st.databaseExisted {
err := quickSetup(v, st.Storage)
if err != nil {
@@ -190,6 +157,8 @@ user created with the credentials from options "username" and "password".`,
}
setupLog(server.Log)
log.Println("File Browser")
root, err := filepath.Abs(server.Root)
if err != nil {
return err
@@ -235,6 +204,23 @@ user created with the credentials from options "username" and "password".`,
panic(err)
}
// Execution hooks and external symlinks are never enabled in this fork.
server.EnableExec = false
server.FollowExternalSymlinks = false
var authentication interface {
Wrap(http.Handler) http.Handler
}
noSSO, _ := cmd.Flags().GetBool("no-sso")
if noSSO {
authentication, err = fbhttp.NewNoSSO(st.Storage, server)
log.Println("--no-sso: authentication disabled; all visitors have administrator access")
} else {
authentication, err = fbhttp.NewSSO(context.Background(), st.Storage, server, fbhttp.SSOConfig{Issuer: v.GetString("sso.issuer"), ClientID: v.GetString("sso.clientID"), ClientSecret: v.GetString("sso.clientSecret"), PublicURL: v.GetString("sso.publicURL"), RedirectURI: v.GetString("sso.redirectURI")})
}
if err != nil {
return err
}
handler, err := fbhttp.NewHandler(imageService, fileCache, uploadCache, st.Storage, server, assetsFs)
if err != nil {
return err
@@ -244,8 +230,10 @@ user created with the credentials from options "username" and "password".`,
log.Println("Listening on", listener.Addr().String())
srv := &http.Server{
Handler: handler,
ReadHeaderTimeout: 60 * time.Second,
Handler: authentication.Wrap(handler),
ReadHeaderTimeout: 10 * time.Second,
IdleTimeout: 90 * time.Second,
MaxHeaderBytes: 1 << 20,
}
go func() {
@@ -353,6 +341,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 +361,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
}
@@ -408,7 +419,7 @@ func quickSetup(v *viper.Viper, s *storage.Storage) error {
AceEditorTheme: v.GetString("defaults.aceEditorTheme"),
Perm: users.Permissions{
Admin: false,
Execute: true,
Execute: false,
Create: true,
Rename: true,
Modify: true,
@@ -428,37 +439,31 @@ func quickSetup(v *viper.Viper, s *storage.Storage) error {
Rules: nil,
}
var err error
if v.GetBool("noauth") {
set.AuthMethod = auth.MethodNoAuth
err = s.Auth.Save(&auth.NoAuth{})
} else {
set.AuthMethod = auth.MethodJSONAuth
err = s.Auth.Save(&auth.JSONAuth{})
}
set.AuthMethod = auth.MethodSSO
err := s.Auth.Save(&auth.SSOAuth{})
if err != nil {
return err
}
err = s.Settings.Save(set)
if err != nil {
return err
}
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)
@@ -466,37 +471,5 @@ func quickSetup(v *viper.Viper, s *storage.Storage) error {
return err
}
username := v.GetString("username")
password := v.GetString("password")
if password == "" {
var pwd string
pwd, err = users.RandomPwd(set.MinimumPasswordLength)
if err != nil {
return err
}
log.Printf("User '%s' initialized with randomly generated password: %s\n", username, pwd)
password, err = users.ValidateAndHashPwd(pwd, set.MinimumPasswordLength)
if err != nil {
return err
}
} else {
log.Printf("User '%s' initialize wth user-provided password\n", username)
}
if username == "" || password == "" {
log.Fatal("username and password cannot be empty during quick setup")
}
user := &users.User{
Username: username,
Password: password,
LockPassword: false,
}
set.Defaults.Apply(user)
user.Perm.Admin = true
return s.Users.Save(user)
return nil
}
+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
}
+4 -2
View File
@@ -15,7 +15,7 @@ import (
)
func init() {
rootCmd.AddCommand(usersCmd)
// Local password account management is removed; users are provisioned by SSO.
}
var usersCmd = &cobra.Command{
@@ -80,7 +80,7 @@ func addUserFlags(flags *pflag.FlagSet) {
flags.Bool("singleClick", false, "use single clicks only")
flags.Bool("redirectAfterCopyMove", false, "redirect to destination after copy/move")
flags.Bool("dateFormat", false, "use date format (true for absolute time, false for relative)")
flags.Bool("hideDotfiles", false, "hide dotfiles")
flags.Bool("hideDotfiles", false, "hide dotfiles in file listings")
flags.String("aceEditorTheme", "", "ace editor's syntax highlighting theme for users")
}
@@ -138,6 +138,8 @@ func getUserDefaults(flags *pflag.FlagSet, defaults *settings.UserDefaults, all
defaults.Sorting.By, err = flags.GetString(flag.Name)
case "sorting.asc":
defaults.Sorting.Asc, err = flags.GetBool(flag.Name)
case "dateFormat":
defaults.DateFormat, err = flags.GetBool(flag.Name)
case "hideDotfiles":
defaults.HideDotfiles, err = flags.GetBool(flag.Name)
}
+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
+6 -1
View File
@@ -118,7 +118,8 @@ func initViper(cmd *cobra.Command) (*viper.Viper, error) {
// Read in configuration
if err := v.ReadInConfig(); err != nil {
if errors.Is(err, viper.ConfigParseError{}) {
if errors.As(err, &viper.ConfigParseError{}) {
return nil, err
}
@@ -152,6 +153,10 @@ func withViperAndStore(fn func(cmd *cobra.Command, args []string, v *viper.Viper
if err != nil {
return err
}
noSSO, _ := cmd.Flags().GetBool("no-sso")
if cmd.Parent() == nil && cmd.Use == "filebrowser" && !noSSO && (v.GetString("sso.issuer") == "" || v.GetString("sso.clientID") == "" || v.GetString("sso.clientSecret") == "" || v.GetString("sso.publicURL") == "") {
return errors.New("initial setup required: run filebrowser init")
}
path, err := filepath.Abs(v.GetString("database"))
if err != nil {
-17
View File
@@ -1,17 +0,0 @@
# Run using:
# docker compose -f compose.yaml -f compose.redis.yaml up --build
services:
redis:
container_name: redis
image: redis:latest
networks:
- filebrowser
command:
- sh
- -c
- |
cat > /tmp/users.acl <<EOF
user default on >filebrowser ~* +@all
EOF
redis-server --aclfile /tmp/users.acl
+2 -7
View File
@@ -1,12 +1,7 @@
# Run using:
# docker compose up --build
services:
filebrowser:
container_name: filebrowser
build:
dockerfile: Dockerfile
context: .
image: filebrowser/filebrowser:latest
networks:
- filebrowser
ports:
@@ -14,7 +9,7 @@ services:
volumes:
- filebrowser:/flux/vault
environment:
- REDIS_CACHE_URL=redis://default:filebrowser@redis:6379 # Use rediss:// for ssl
- FB_REDIS_CACHE_URL=redis://default:filebrowser@redis:6379 # Use rediss:// for ssl
redis:
container_name: redis
+24
View File
@@ -0,0 +1,24 @@
[Unit]
Description=File Browser SSO workspace
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=filebrowser
Group=filebrowser
WorkingDirectory=/var/lib/filebrowser
ExecStart=/opt/filebrowser/filebrowser --config /var/lib/filebrowser/.filebrowser.json
Restart=on-failure
RestartSec=5
UMask=0027
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/lib/filebrowser /srv/filebrowser
RestrictSUIDSGID=true
LockPersonality=true
[Install]
WantedBy=multi-user.target
+41
View File
@@ -0,0 +1,41 @@
# Проверка 3.1.0
Edge/Chromium, Windows amd64; 1440×1000 и 390×844. Изолированное временное хранилище, настоящие HTTP-обработчики сервера, синтетические файлы. Реальные пользовательские данные и SSO не использовались.
## Интерфейс и файловые операции
- Предпросмотр PNG, JPEG, GIF, BMP, TIFF, WebP, SVG, PDF, DICOM 2D, TXT, Markdown, CSV, JSON, XML, HTML, JavaScript, ZIP, EPUB, WAV; WebM проверен отдельно.
- Настройки, панель управления, пользователи, публичная ссылка и парольная форма, длинные имена, серверный диалог открытия. Проверены снимки экранов и горизонтальное переполнение.
- Создание папки, загрузка, копирование, перемещение, изменение, скачивание и удаление через реальный сервер.
- Загрузка 3 МиБ по частям, новая статистика и отмена; сравнение полученного файла с исходными байтами.
- Несколько ссылок на один файл, независимые пароль и срок действия.
## Craft
| Инструмент | Результат |
| --- | --- |
| WordCraft | Изменённый текст найден внутри DOCX; сохранение и повторное открытие |
| GridCraft | Значение ячейки найдено внутри XLSX; сохранение и повторное открытие |
| DeckCraft | Сохранение и повторное открытие собственного `.deckcraft` |
| PdfCraft | Пометка сохранена в PDF; повторное открытие |
| PhotoCraft | Рисование, сохранение отдельного PSD и повторное открытие; исходный PNG сохранён |
| VectorCraft | SVG открыт, проект сохранён в `.vectorcraft` и открыт повторно |
| DesignCraft | Валидный проект сохранён и повторно открыт |
| CADCraft | DXF сохранён и повторно открыт |
| SoundCraft | Отключён: официальная веб-сборка работает только с демосессией |
| FigCraft | Отключён: надёжная загрузка/выгрузка серверного проекта не подтверждена |
| LightCraft | Отключён: изображение открывается, надёжный экспорт на сервер не подтверждён |
Открытие второго документа из WordCraft через серверный диалог проверено отдельно: изменения записаны во второй файл, первый остался неизменным.
Для проверенных сохранений сопоставлены отправленные данные и файл на диске. Это проверка представительных форматов, а не гарантия совместимости каждого импортируемого формата или сложного документа. Мобильная вёрстка сторонних Craft-инструментов определяется самими инструментами.
DICOM 3D временно выключен; сохранённые предпочтения не удалены. Проверки 2D и декодирования остаются.
## Повторение
Обычные проверки: `pnpm --dir frontend test`, `pnpm --dir frontend lint`, `pnpm --dir frontend build`, `go test ./...`, `go vet ./...`.
Для браузерных сценариев предусмотрен `TestWorkspaceBrowserQA`: задайте `FILEBROWSER_QA=1`, `FILEBROWSER_QA_SCRIPT` (абсолютный путь к `frontend/scripts/check-workspace.cjs` или `check-previews.cjs`), `FILEBROWSER_QA_FIXTURES`, `FILEBROWSER_QA_ADDONS`, `FILEBROWSER_QA_OUTPUT`, `PLAYWRIGHT_MODULE` и `BROWSER_EXECUTABLE`. Затем `go test ./http -run TestWorkspaceBrowserQA -v -count=1`. Сценарии требуют тестовые файлы с именами, перечисленными в их исходниках; авторизация подставляется только внутри тестового бинарника.
Linux-бинарник собран для amd64/v1 без CGO; запуск на Debian в этой среде не проверялся.
+12
View File
@@ -0,0 +1,12 @@
# Проверка 3.2.0
- OIDC: PKCE S256, HTTP Basic, nonce/at_hash/RS256-проверка, повтор callback, изолированные cookies транзакций и host-only Secure/HttpOnly handle.
- Внутренний resolve: запрос на каждую операцию без положительного кеша, строгие client_id/sub/expiry, текущие роли, отказ при ошибке провайдера/невалидном ответе без удаления cookie.
- Два настоящих HTTP-сервера File Browser с тестовыми БД/файлами и общий имитатор SSO: Alice → Bob в двух открытых приложениях без OAuth-обмена, независимое устройство остаётся Alice, отказ Bob, сбой/восстановление SSO, общий logout и недостающий фактор.
- Поздний ответ Alice задержан до перехода на Bob; данные Alice не возвращаются в интерфейс. Старая форма отвергается с 409. Тестируется также недоступный iframe-брокер — работает запасной опрос backend.
- TUS: другой аккаунт или новая версия сессии не продолжает старую загрузку; очередь и запросы отменяются при смене аккаунта.
- Без SSO: административный доступ без cookie/пароля, неизменный локальный профиль, CSRF-защита сохраняется. В этот режим нельзя перейти из-за отказа SSO.
Среда: Windows amd64, Edge/Chromium, изолированные данные и синтетический провайдер. Реальные аккаунты SSO не переключались. Проверка с установленным SSO требует внутреннего клиента и зарегистрированных redirect/origin.
Повторение: обычные `go test ./...`, `go vet ./...`, `pnpm --dir frontend test`, `pnpm --dir frontend lint`, `pnpm --dir frontend build`. Для браузера: `FILEBROWSER_INTERNAL_QA=1`, `FILEBROWSER_INTERNAL_QA_SCRIPT` — абсолютный путь к `frontend/scripts/check-internal-session.cjs`; также задайте `PLAYWRIGHT_MODULE`, `BROWSER_EXECUTABLE`, `FILEBROWSER_QA_OUTPUT`. Запуск: `go test ./http -run TestInternalSessionBrowser -v -count=1`.
+9
View File
@@ -0,0 +1,9 @@
# Документация File Browser SSO
- [Установка на Debian, первоначальная настройка, SSO и systemd](deployment.md)
- [Авторизация и сессии](authentication.md)
- [Проверки безопасности и ограничения](SECURITY-REVIEW.md)
- [Настройка внешнего вида](customization.md)
- [CLI](cli/filebrowser.md)
Актуальная точка входа — `filebrowser init`. Руководства исходного архивированного File Browser по локальным паролям, proxy-auth, hook-auth и выполнению команд к этому форку не применяются.
+34
View File
@@ -0,0 +1,34 @@
# Проверки безопасности и ограничения
Проверено 21 октября 2026 года. Это результат проверок конкретного состояния исходников, а не гарантия отсутствия всех возможных уязвимостей.
## Сделано
- Удалены JSON/password, no-auth, proxy и hook способы входа, регистрация, выпуск и продление JWT File Browser. Локальные пароли в существующей базе при миграции заменяются заблокированным значением.
- OIDC Authorization Code с PKCE S256, state, nonce, RS256, issuer/audience/expiry и at_hash. Идентичность привязана к issuer и sub; совпадение имени с локальным пользователем не повышает права.
- Административная роль берётся только из подтверждённого SSO-входа: Master Admin / FS Admin. Флаг admin в локальном профиле не даёт административный доступ.
- С версии 3.2.0: host-only Secure/HttpOnly cookie с внутренним handle; свежий resolve для каждого защищённого запроса, общий logout и защита изменений ожидаемым session_state. Самостоятельных локальных SSO-сессий нет.
- Проверка Origin и специального заголовка для меняющих состояние запросов, запрет cross-site запросов. CSP с nonce для HTML bootstrap, запрет скриптов при выдаче пользовательских файлов, nosniff.
- Выполнение команд и файловые хуки принудительно выключены; /api/command не зарегистрирован. Внешние симлинки запрещены. Старый вспомогательный CLI-код локальных аккаунтов не подключён к корневой команде; часть legacy-кода оставлена отключённой.
- Короткие ссылки: валидация имени, атомарная вставка в BoltDB, отказ 409 при занятом имени; случайные ключи увеличены с 48 до 128 бит.
- Исправлено удаление соседних просроченных ссылок: прежний цикл менял срез во время range и мог пропускать записи или выходить за границы.
- Исправлен откат слишком большого TUS-чанка на Windows: используется запись с явным смещением, позволяющая Truncate; проверены последовательные чанки и повторное использование HTTP-соединения.
- Ошибка чтения настроек больше не завершает процесс сервера через log.Fatalf.
- Обновлены frontend-зависимости и x/net, x/crypto, x/image. Удалена цепочка линтера с неисправленной advisory braces; вместо неё используется flat config typescript-eslint. Режимы и темы Ace включены в бинарник, загрузка с CDN больше не нужна.
## Результаты
- go test ./... — успешно на Windows, включая OIDC, роли, logout, отказе/смене аккаунта, CSRF, callback replay, короткие ссылки и конкурентную вставку.
- go vet ./... — успешно.
- Frontend: TypeScript, production build, 29 тестов и ESLint без ошибок — успешно. У старых неизменённых файлов при полном lint остаются предупреждения Prettier из-за CRLF-выгрузки Windows.
- pnpm audit — 0 известных уязвимостей в установленном дереве.
- govulncheck для linux/amd64 — 0 уязвимостей в вызываемом коде и импортируемых пакетах. Одна advisory остаётся на уровне требуемого модуля: GO-2026-5932 (неиспользуемый пакет golang.org/x/crypto/openpgp). Приложение openpgp не импортирует и не вызывает; исправленной версии для этого устаревшего пакета нет.
- В браузере: тестовый локальный OIDC-провайдер, список файлов, создание именованной ссылки и маршрут /s/{key}. Настоящие Client ID/secret не использовались и в репозиторий не добавлялись.
## Ограничения эксплуатации
Новый контракт и проверки общей сессии описаны в [авторизации](authentication.md). При недоступности SSO доступ закрыт без резервной локальной авторизации. Режим без входа включается только явным `--no-sso` и предоставляет всем посетителям административный доступ.
Debian-бинарник собирается из Windows для linux/amd64 с отключённым CGO и GOAMD64=v1. Нативный запуск и тесты на Debian в этой среде не выполнялись. POSIX-тест с именами, содержащими обратные слеши, не применим к файловой системе Windows и пропускается там.
Конфигурация содержит Client secret и должна принадлежать только пользователю службы (0600). Рекомендуемый systemd-файл отделяет исполняемые файлы от изменяемых данных. Обновляйте зависимости и повторяйте аудит перед публикацией новых версий.
+45
View File
@@ -0,0 +1,45 @@
# Craft-аддоны
В «Панель управления → Аддоны» доступны 11 инструментов: скачать/обновить, включить/отключить, увидеть версию, этап загрузки и ошибку. Настройки доступны администратору; для редактирования нужны права скачивания и изменения файла. Создание и «Сохранить как» дополнительно требуют права создания.
| Инструмент | Открытие | Сохранение |
| --- | --- | --- |
| WordCraft / GridCraft / PdfCraft | DOCX / XLSX / PDF | Исходный формат, PDF |
| DeckCraft | PPTX, DeckCraft | Штатное сохранение DeckCraft; экспорт PPTX/PDF |
| PhotoCraft | PCraft, PSD/PSB, PNG/JPEG/WebP/GIF/BMP/TIFF | Эти же форматы |
| VectorCraft | VectorCraft/DrawCraft, SVG | Нативный формат, SVG/PDF/PNG/JPEG |
| LightCraft | DNG/CR2/CR3/NEF/NRW/ARW/PEF/ORF/RW2/RAF, JPEG/PNG/TIFF | Экспорт JPEG/PNG/TIFF отдельным файлом |
| DesignCraft | DesignCraft, IDML | Нативный формат, IDML/PDF/PNG/JPEG |
| FigCraft | FigCraft | Нативный формат, SVG/PDF/PNG/JPEG |
| SoundCraft | SCraftZ, WAV/FLAC/MP3/Ogg/AIFF/M4A, MIDI | SCraftZ со встроенными аудио, поддерживаемые аудио/MIDI-экспорты |
| CADCraft | DXF/DWG | DXF/PDF/SVG/PNG; DWG не перезаписывается |
Для нескольких подходящих редакторов доступны отдельные команды «Открыть в…». Двойной клик использует встроенный быстрый просмотр; PDF открывается в доступном PdfCraft. Для форматов без быстрого просмотра выбирается первый подходящий установленный включённый инструмент. У LightCraft каждая вкладка использует отдельный каталог в памяти (`store=memory`); настройки обработки и каталог не синхронизируются с сервером. RAW-оригиналы не перезаписываются, экспорт требует права создания.
FilmCraft и EffectCraft изучены, но не включены: для сохранения и повторного открытия их проектов на другом устройстве нужна привязка ссылок на исходные видео, аудио и прочие медиа к файловому серверу. Простой перенос одного проекта этого не обеспечивает.
Веб-сборки хранятся в `addons` относительно рабочего каталога процесса. Для штатного Debian systemd unit это `/var/lib/filebrowser/addons`. Папка не входит в бинарник и архивы релиза: на другом сервере инструменты скачиваются кнопкой или переносится вся готовая папка `addons` с сохранением структуры. Отдельных служб редакторов нет.
Структура: `addons/<id>/active.json` — активная версия; `addons/<id>/versions/<tag>-<sha>/` — неизменяемые веб-файлы и оригинальные лицензии. Установка берёт только стабильный официальный GitHub Release из фиксированного каталога репозиториев `storytold`, заданного в `internal/addons/catalog.go`. Проверяются размер и SHA-256 из метаданных GitHub, затем ZIP распаковывается в отдельную временную папку. Ограничения: архив 128 МиБ, распакованные файлы суммарно 512 МиБ, отдельный файл 128 МиБ, 4096 записей, 16 уровней. Запрещены ссылки, пути наружу и совпадающие без учёта регистра имена. После успешной проверки указатель версии заменяется атомарно. Неудачное обновление оставляет прежнюю версию. Повторная проверка уже установленного релиза не скачивает архив заново.
Для HTML, JS и WASM создаются gzip-копии; корректные MIME, CSP для WASM и same-origin iframe задаются только страницам аддонов. Основная CSP File Browser не ослабляется. Старые версии остаются на диске: открытые редакторы продолжают загружать свои файлы. Удалять старые версии и оставшиеся после аварийной остановки `.install-*` можно вручную при остановленном сервере. Каталог `addons` закрыт от чтения/изменения через обычный файловый API, включая псевдонимы через ссылки и операции над родительскими папками.
В ПКМ и панели предпросмотра появляется «Открыть в WordCraft/GridCraft/DeckCraft/PdfCraft». В «Создать» — DOCX/XLSX/PPTX/PDF, если соответствующий аддон установлен и включён; сервер генерирует корректные пустые документы. Двойной клик сначала использует встроенный быстрый просмотр; PDF открывается в установленном включённом PdfCraft. Для файлов без быстрого просмотра открывается подходящий редактор в отдельной вкладке без панелей File Browser. Команда «Открыть в…» и создание документов также открывают отдельную вкладку. Для остальных файлов сохраняется обычное открытие.
CADCraft/GridCraft/PdfCraft используют официальный `?host=parent`/`postMessage`. Для остальных редакторов сервер добавляет собственный адаптер в отдаваемую HTML-страницу: открытие через штатную обработку перетаскивания, сохранение разрешённых форматов через перехват браузерного сохранения. Успех асинхронного сохранения подтверждается после ответа сервера. Остальные экспорты остаются обычными скачиваниями браузера. Исходные файлы установленных сборок не изменяются; HTML с адаптером не кешируется. Для обоих способов проверяются origin и конкретное окно iframe. Данные передаются без токенов SSO. Файлы загружаются и сохраняются через собственный API File Browser, с проверкой области доступа, правил и текущих разрешений. Размер документа ограничен 64 МиБ; Архивные документы и проекты дополнительно ограничены 4096 записями и суммарно 256 МиБ заявленного распакованного содержимого. Одновременно обрабатываются не более двух запросов документов.
Сохранение сначала пишет временный файл и выполняет Sync; затем проверяет SHA-256 ETag и заменяет оригинал. Если документ изменился, возвращается 412; «Сохранить как» не перезаписывает занятое имя (409). Проверка и замена синхронизированы с файловыми операциями данного процесса File Browser. Изменения сторонними процессами не блокируются. Успех показывается только после ответа сервера, а при ошибке доступны повтор, другое имя и скачивание копии. При истечении сессии можно войти в соседней вкладке и повторить запись без автоматического ухода из редактора. Активность пользователя в iframe поддерживает текущую сессию, но простаивающая вкладка её не продлевает.
Инструменты исполняются в браузере: нужны современный браузер и WebGL2/WebGPU. Совместного редактирования в реальном времени нет. Для редакторов с адаптером состояние изменений определяется консервативно по действиям пользователя: предупреждение перед закрытием возможно и после действий, которые не меняют документ. Графический запуск проверяет пользователь; автоматические проверки не запускают GPU-интерфейс.
Проверка официальных сборок вручную: установить `FB_TEST_OFFICIAL_ADDONS=1`, при необходимости `FB_TEST_ADDONS_DIR` в абсолютный путь целевого `addons`, затем выполнить `go test ./internal/addons -run TestOfficialBundles -v -count=1`. Обычно тест пропускается и не использует сеть.
## Совместимость DeckCraft v0.9.0
Официальная WASM-сборка вызывает `std::process::id()` в `recovery::instance_id`, что паникует на wasm32. `http/deckcraft_compat.js` перед `__wbindgen_start` инициализирует этот `OnceLock<u64>` случайным идентификатором браузера с теми же ограничениями: меньше 2^53, младшие 24 бита нулевые. Последующий счётчик документов остаётся штатным.
Обход добавляется только для `v0.9.0-38076027b9c1` и независимо сверяет полный SHA-256 WASM (`e0849d8de375fe7726a621f7e98112b76a7b0d0bc361d701bcae66b639c8e354`), размер памяти и исходное нулевое состояние. Другие сборки не затрагиваются. Файлы аддона на диске и SRI остаются исходными. При обновлении DeckCraft это исправление необходимо перепроверять; адрес внутренней структуры нельзя переносить на другую WASM-сборку.
Редактор запускается с `blank`, чтобы не открывать демонстрационную презентацию перед документом пользователя. Штатное браузерное Save сохраняет `.deckcraft` (архив с `presentation.json` и встроенными медиа); этот формат теперь открывается и сохраняется через FS с теми же лимитами, правами и ETag. Для PPTX используется экспорт редактора. Первая запись в новом формате запрашивает имя отдельной копии.
Проверено программным тестом в фоновом Edge/WebGL2: запуск, импорт тестового PPTX, Ctrl+S и получение `smoke.deckcraft`. Снимки экрана и визуальная оценка не выполнялись. `http/testdata/deckcraft-blank.deckcraft` — результат этого теста без пользовательских данных.
+29
View File
@@ -0,0 +1,29 @@
# Авторизация
## Общая сессия SSO
File Browser использует внутренний контракт общей браузерной сессии. В SSO приложение должно иметь тип **«Внутреннее»**, PKCE S256 и точный callback. Настройка — через `filebrowser init`; секрет хранится только в конфигурации сервера.
Первичный вход: discovery → Authorization Code + PKCE S256 с `internal_sync=1`. Проверяются одноразовый state, nonce, RS256/JWKS, issuer, audience, exp и at_hash. Параллельные попытки входа имеют отдельные cookies. Для восстановления привязки доступен `prompt=none`; при необходимости фактора продолжается обычный поток без принудительного запроса пароля.
SSO выдаёт `session_handle`. Он хранится в собственной cookie `__Host-internal_session`: Secure, HttpOnly, SameSite=Lax, Path=/, без Domain. Срок не превышает выданный SSO и 30 суток. Cookie не заменяет родительскую сессию SSO и не продлевает её. Access/ID tokens и watch не сохраняются; handle не передаётся в JavaScript, URL или localStorage.
**Каждый защищённый запрос** обращается к `/internal/session/resolve` с Basic client ID/secret. Используются только текущие `sub` и роли из resolve; положительный результат между запросами не кешируется. Локальная база хранит настройки и файловые права, а не самостоятельный вход. Связка issuer + sub сохраняет прежние ID, настройки и ссылки. Роли `Master Admin` и `FS Admin` дают административный доступ.
`GET /auth/session` возвращает текущий статус и разрешённый профиль без credentials. Копия SDK `internal-session.js` синхронизирует открытые вкладки: смена аккаунта отменяет запросы/загрузки, очищает данные и монтирует интерфейс нового аккаунта. Старые формы отвергаются по `X-FB-Session-State` с `409 session_changed`. TUS-загрузка привязана к аккаунту и версии сессии; продолжить её от другого аккаунта нельзя. Долгие чтения/записи перепроверяются не реже чем при следующем чтении/записи после двух секунд, сохранение Craft — также перед атомарной заменой файла.
При отказе в доступе данные скрываются; при недостающем факторе предлагается пройти TOTP/Passkey. Подключение фактора выполняется в настройках аккаунта. Ошибка SSO/TLS/ответа закрывает защищённые действия с 503, сохраняя cookie для восстановления. Автоматического перехода на старую локальную сессию нет.
Выход — защищённый POST, общий для текущей браузерной сессии SSO. Другие устройства не выходят. Если аккаунт успел смениться, logout получает 409 и не повторяется для нового пользователя. «Сменить аккаунт» сначала выполняет этот выход, затем открывает обычный поток входа.
При обновлении старые восьмичасовые сессии File Browser больше не принимаются. Требуется новая PKCE-привязка; существующий вход SSO обычно позволяет сделать её без повторного пароля. Для всех приложений используйте одинаковый issuer; общие Domain-cookies не нужны.
## Без входа
```sh
./filebrowser --no-sso
```
Этот явный флаг запускает приложение без SSO и пароля. Все посетители получают права администратора в настроенном файловом корне. Конфигурация SSO и доступность провайдера не проверяются. Настройки локального профиля сохраняются между запусками. Без флага обязательна проверка через SSO; ошибка провайдера режим без входа не включает.
Пароли публичных ссылок остаются независимыми и работают в обоих режимах.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -19,15 +19,10 @@ filebrowser config init [flags]
```
--aceEditorTheme string ace editor's syntax highlighting theme for users
-a, --address string address to listen on (default "127.0.0.1")
--auth.command string command for auth.method=hook
--auth.header string HTTP header for auth.method=proxy
--auth.logoutPage string url of custom logout page
--auth.method string authentication type (default "json")
-b, --baseURL string base url
--branding.color string set the theme color
--branding.disableExternal disable external links such as GitHub links
--branding.disableUsedPercentage disable used disk percentage graph
--branding.files string path to directory with images and custom styles
--branding.name string replace 'File Browser' by this name
--branding.theme string set the theme
-t, --cert string tls certificate
@@ -41,8 +36,9 @@ 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
--hideDotfiles hide dotfiles in file listings
--hideLoginButton hide login button from public pages
-k, --key string tls key
--locale string locale for users (default "en")
@@ -58,13 +54,9 @@ filebrowser config init [flags]
--perm.rename rename perm for users (default true)
--perm.share share perm for users (default true)
-p, --port string port to listen on (default "8080")
--recaptcha.host string use another host for ReCAPTCHA. recaptcha.net might be useful in China (default "https://www.google.com")
--recaptcha.key string ReCaptcha site key
--recaptcha.secret string ReCaptcha secret
--redirectAfterCopyMove redirect to destination after copy/move
-r, --root string root to prepend to relative paths (default ".")
--scope string scope for users (default ".")
--shell string shell command to which other commands should be appended
-s, --signup allow users to signup
--singleClick use single clicks only
--socket string socket to listen to (cannot be used with address, port, cert nor key flags)
@@ -16,15 +16,10 @@ filebrowser config set [flags]
```
--aceEditorTheme string ace editor's syntax highlighting theme for users
-a, --address string address to listen on (default "127.0.0.1")
--auth.command string command for auth.method=hook
--auth.header string HTTP header for auth.method=proxy
--auth.logoutPage string url of custom logout page
--auth.method string authentication type (default "json")
-b, --baseURL string base url
--branding.color string set the theme color
--branding.disableExternal disable external links such as GitHub links
--branding.disableUsedPercentage disable used disk percentage graph
--branding.files string path to directory with images and custom styles
--branding.name string replace 'File Browser' by this name
--branding.theme string set the theme
-t, --cert string tls certificate
@@ -38,8 +33,9 @@ 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
--hideDotfiles hide dotfiles in file listings
--hideLoginButton hide login button from public pages
-k, --key string tls key
--locale string locale for users (default "en")
@@ -55,13 +51,9 @@ filebrowser config set [flags]
--perm.rename rename perm for users (default true)
--perm.share share perm for users (default true)
-p, --port string port to listen on (default "8080")
--recaptcha.host string use another host for ReCAPTCHA. recaptcha.net might be useful in China (default "https://www.google.com")
--recaptcha.key string ReCaptcha site key
--recaptcha.secret string ReCaptcha secret
--redirectAfterCopyMove redirect to destination after copy/move
-r, --root string root to prepend to relative paths (default ".")
--scope string scope for users (default ".")
--shell string shell command to which other commands should be appended
-s, --signup allow users to signup
--singleClick use single clicks only
--socket string socket to listen to (cannot be used with address, port, cert nor key flags)
File renamed without changes.
File renamed without changes.
+25
View File
@@ -0,0 +1,25 @@
# filebrowser init
Initial setup: SSO, file directory and database
```
filebrowser init [flags]
```
## Options
```
-h, --help help for init
--output string configuration file to create; existing files are never overwritten (default ".filebrowser.json")
```
## Options inherited from parent commands
```
-c, --config string config file path
-d, --database string database path (default "./filebrowser.db")
```
## See Also
* [filebrowser](filebrowser.md) - A stylish web-based file browser
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -17,7 +17,7 @@ filebrowser users add <username> <password> [flags]
--commands strings a list of the commands a user can execute
--dateFormat use date format (true for absolute time, false for relative)
-h, --help help for add
--hideDotfiles hide dotfiles
--hideDotfiles hide dotfiles in file listings
--locale string locale for users (default "en")
--lockPassword lock password
--perm.admin admin perm for users
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -18,7 +18,7 @@ filebrowser users update <id|username> [flags]
--commands strings a list of the commands a user can execute
--dateFormat use date format (true for absolute time, false for relative)
-h, --help help for update
--hideDotfiles hide dotfiles
--hideDotfiles hide dotfiles in file listings
--locale string locale for users (default "en")
--lockPassword lock password
-p, --password string new password
File renamed without changes.
File renamed without changes.
@@ -8,40 +8,7 @@ File Browser CLI lets you create the database to use with File Browser,
manage your users and all the configurations without accessing the
web interface.
If you've never run File Browser, you'll need to have a database for
it. Don't worry: you don't need to setup a separate database server.
We're using Bolt DB which is a single file database and all managed
by ourselves.
For this command, all flags are available as environmental variables,
except for "--config", which specifies the configuration file to use.
The environment variables are prefixed by "FB_" followed by the flag name in
UPPER_SNAKE_CASE. For example, the flag "--disablePreviewResize" is available
as FB_DISABLE_PREVIEW_RESIZE.
If "--config" is not specified, File Browser will look for a configuration
file named .filebrowser.{json, toml, yaml, yml} in the following directories:
- ./
- $HOME/
- /etc/filebrowser/
**Note:** Only the options listed below can be set via the config file or
environment variables. Other configuration options live exclusively in the
database and so they must be set by the "config set" or "config
import" commands.
The precedence of the configuration values are as follows:
- Flags
- Environment variables
- Configuration file
- Database values
- Defaults
Also, if the database path doesn't exist, File Browser will enter into
the quick setup mode and a new database will be bootstrapped and a new
user created with the credentials from options "username" and "password".
Run filebrowser init for initial setup. It creates the configuration file, prepares the database and prints the SSO callback URL. Local password accounts and command execution are not supported. Runtime options can still be overridden using flags or FB_ environment variables.
```
filebrowser [flags]
@@ -61,19 +28,17 @@ 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
-l, --log string log output (default "stdout")
--noauth use the noauth auther when using quick setup
--password string hashed password for the first user when using quick setup
-p, --port string port to listen on (default "8080")
--redisCacheUrl string redis cache URL (for multi-instance deployments), e.g. redis://user:pass@host:port
-r, --root string root to prepend to relative paths (default ".")
--socket string socket to listen to (cannot be used with address, port, cert nor key flags)
--socketPerm uint32 unix socket file permissions (default 438)
--tokenExpirationTime string user session timeout (default "2h")
--username string username for the first user when using quick setup (default "admin")
```
## See Also
@@ -82,7 +47,7 @@ filebrowser [flags]
* [filebrowser completion](filebrowser-completion.md) - Generate the autocompletion script for the specified shell
* [filebrowser config](filebrowser-config.md) - Configuration management utility
* [filebrowser hash](filebrowser-hash.md) - Hashes a password
* [filebrowser init](filebrowser-init.md) - Initial setup: SSO, file directory and database
* [filebrowser rules](filebrowser-rules.md) - Rules management utility
* [filebrowser users](filebrowser-users.md) - Users management utility
* [filebrowser version](filebrowser-version.md) - Print the version number
+5
View File
@@ -0,0 +1,5 @@
# Выполнение команд
В этом форке выполнение команд, shell API и файловые хуки отключены без возможности включения через пользовательские настройки. Веб-маршрут `/api/command` отсутствует.
Если нужна автоматическая обработка файлов, запускайте её отдельной службой ОС с самостоятельными разрешениями.
+11
View File
@@ -0,0 +1,11 @@
# Customization
The interface assets are embedded in the executable. The administrator can configure the instance name, default theme, external links and storage usage indicator in **Settings → Global Settings**.
The same options are available through the CLI:
```sh
filebrowser config set --branding.name "My Files" --branding.theme dark
```
To change the built-in icons or styles, edit the frontend sources and rebuild the executable. Runtime branding directories and custom stylesheet overrides are no longer supported.
+113
View File
@@ -0,0 +1,113 @@
# File Browser SSO — Debian amd64
Сборка для `linux/amd64`, базовый набор инструкций `GOAMD64=v1`, `CGO_ENABLED=0`.
Node.js и Go на сервере не нужны: интерфейс встроен в исполняемый файл.
## Первоначальная настройка
Распакуйте архив в `/opt/filebrowser`. Пример отдельного системного пользователя:
```sh
sudo useradd --system --home /opt/filebrowser --shell /usr/sbin/nologin filebrowser
sudo install -d -m 0750 -o filebrowser -g filebrowser /var/lib/filebrowser /srv/filebrowser
sudo chmod 0755 /opt/filebrowser/filebrowser
cd /var/lib/filebrowser
sudo -u filebrowser /opt/filebrowser/filebrowser init
```
Мастер запросит issuer SSO, Client ID, Client secret (без эха в терминале),
публичный URL File Browser, папку файлов, путь базы, адрес и порт прослушивания.
Для приведённого systemd-файла используйте `/srv/filebrowser` как папку файлов,
`/var/lib/filebrowser/filebrowser.db` как базу и `127.0.0.1:8080` как адрес сервера.
Публичный URL — внешний HTTPS-адрес, например `https://files.anidev.ru`.
Конфигурация сохраняется в `.filebrowser.json` с правами `0600`. Настройка через
`.env` не нужна. Мастер не перезаписывает существующую конфигурацию; для другого
файла используйте `./filebrowser init --output /полный/путь/settings.json`.
Запуск с нестандартной конфигурацией: `./filebrowser --config /полный/путь/settings.json`.
В вашем SSO зарегистрируйте приложение с PKCE S256 и callback, напечатанным мастером:
```text
https://files.anidev.ru/auth/callback
```
Если приложение размещено в подпапке, например `https://example.com/files`,
мастер сохранит `baseURL=/files`, а callback будет `/files/auth/callback`.
Нужны scopes `openid profile email`. Claim `roles` — массив строк;
точные имена `Master Admin` и `FS Admin` дают права администратора.
Остальные пользователи получают локальные файловые разрешения по умолчанию.
Создавать пароли и пользователей File Browser не нужно: профиль создаётся при
первом входе. Идентичность привязана к issuer и `sub`, а не к логину или почте.
## Сессии
В SSO выберите тип приложения **«Внутреннее»**. Используется общая браузерная сессия: каждый защищённый запрос проверяется через `/internal/session/resolve`, роли и текущий аккаунт обновляются без нового OAuth-обмена. Смена аккаунта и общий выход распространяются на открытые приложения; другие устройства независимы.
Конфигурация содержит точный `sso.redirectURI` (мастер заполняет его автоматически). Прежние конфигурации без этого поля используют callback, полученный из `sso.publicURL`. Все приложения установки должны использовать одинаковый issuer. Настройка cookie Domain не требуется; для SSO используйте HTTPS.
Для запуска без SSO и пароля: `./filebrowser --no-sso`. В этом режиме все посетители получают административный доступ к настроенному корню.
Подробности и миграция старых сессий: [авторизация](authentication.md).
## Запуск через systemd
```sh
sudo install -m 0644 filebrowser.service /etc/systemd/system/filebrowser.service
sudo systemctl daemon-reload
sudo systemctl enable --now filebrowser
sudo journalctl -u filebrowser -f
```
Перед приложением нужен reverse proxy с HTTPS. Пример nginx:
```nginx
server {
listen 443 ssl;
server_name files.anidev.ru;
# Укажите свои ssl_certificate и ssl_certificate_key.
client_max_body_size 0;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_request_buffering off;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
}
}
```
Исполняемые команды и хуки всегда выключены, внешние симлинки запрещены.
Файлы, которые разрешено отдавать пользователям, держите в отдельном каталоге.
При изменении пути файлов поправьте `ReadWritePaths` и `ProtectHome` в systemd-файле.
Публичные ссылки создаются как `/s/{key}`. Можно задать имя длиной 2–64 символа
из латинских букв, цифр, `_` и `-`. Имена чувствительны к регистру. Занятое имя
возвращает 409 и никогда не перезаписывает существующую ссылку. Без имени генерируется
случайный ключ из 128 бит. Старые `/share/{key}` остаются доступными.
Понятные имена легче угадать; для приватных материалов используйте пароль ссылки и срок действия.
## Обновление и резервное копирование
Остановите службу, сохраните `.filebrowser.json`, базу и пользовательские файлы,
замените бинарник и запустите службу. Перед миграцией старой установки особенно
важно сохранить базу: при запуске удаляются пригодные для входа локальные пароли.
Старые локальные пользователи автоматически не связываются с SSO по имени — это
предотвращает захват аккаунта совпадающим логином. Их файловые области при необходимости
назначьте новым SSO-профилям через настройки администратора.
## Сборка из исходников
Нужны Go 1.26+, Node.js 24+ и pnpm 10.33.4. Сборка использует системные шрифты,
переводы и тяжёлые экраны загружаются по требованию. Для старых ПК используйте
поддерживаемый браузер с JavaScript Proxy (Vue 3); Internet Explorer не поддерживается.
```sh
sh scripts/build-release.sh
```
На Windows: `./scripts/build-release.ps1`. Архив и SHA256 появятся в `build/`.
+31
View File
@@ -0,0 +1,31 @@
# DICOM 2D/3D в браузере
Для текущего интерфейса FS предпочтителен **Cornerstone3D**: библиотека для собственного просмотрщика на Vue, с отдельными Stack/Volume/Volume3D viewport, инструментами измерений, MPR и объёмным рендерингом. Загрузчик `@cornerstonejs/dicom-image-loader` умеет получать DICOM P10 через HTTP; отдельный PACS для такого варианта не обязателен. Лицензия MIT.
Источники: [область применения и загрузчики](https://www.cornerstonejs.org/docs/getting-started/scope/), [построение объёма](https://www.cornerstonejs.org/docs/tutorials/basic-volume/), [лицензия](https://github.com/cornerstonejs/cornerstone3D/blob/main/LICENSE).
**OHIF** — готовый просмотрщик с собственным интерфейсом и расширениями. Его можно раздавать как статические файлы и встраивать через iframe. Потребуется настроить источник данных. Помимо DICOMweb есть JSON-манифест с метаданными исследования/серий и URL отдельных DICOM-файлов. Лицензия MIT.
Источники: [развёртывание](https://docs.ohif.org/deployment/), [источник DICOM JSON](https://docs.ohif.org/configuration/datasources/dicom-json/), [лицензия](https://github.com/OHIF/Viewers/blob/master/LICENSE).
Для FS потребуется индексировать файлы выбранной папки по StudyInstanceUID и SeriesInstanceUID, учитывать ориентацию, положение и расстояние между срезами. Объём строится из согласованной серии срезов или подходящего многокадрового DICOM; из одиночной обычной 2D-проекции полноценный объём не получается. Доступ к файлам и метаданным должен наследовать текущие права пользователя либо публичной ссылки.
## Реализация в FS
В предпросмотр встроен лёгкий 2D-режим на Daikon и отдельный, лениво загружаемый объёмный просмотр на Cornerstone3D. Внешний PACS и отдельный сервер просмотрщика не нужны. Декодирование выполняется в существующем Web Worker; поддерживаются те же пиксельные форматы и кодеки, что и в 2D. Cornerstone получает готовые значения с применёнными rescale slope/intercept.
Если открыто имя вида `prefix_123.dcm` и все файлы родительской папки принадлежат этой нумерованной серии, появляется кнопка **Открыть как 3D**. Подпапки не учитываются. Имена определяют только предложение: после нажатия проверяются Study/Series/FrameOfReference UID, уникальность SOPInstanceUID, размеры, ориентация, PixelSpacing и ImagePositionPatient. Порядок определяется координатами пациента, а не именами. Дубликаты позиций, неравномерный шаг, несовпадающие серии и наклонённые относительно сетки срезы отклоняются. Обычные одиночные снимки и многокадровые файлы остаются в 2D; сборка объёма сейчас поддерживает серии однокадровых монохромных файлов с обычными верхнеуровневыми тегами геометрии.
Объёмный режим включает вращение и масштабирование 3D, аксиальную/сагиттальную/корональную реконструкцию, прокрутку срезов, перемещение, яркость/контрастность и непрозрачность. Нужен WebGL2. На неподходящем устройстве сохраняется 2D.
В настройках профиля есть раздел **DICOM — 3D-просмотр**: качество (автоматическое, исходное, половинное, четверть), лимит памяти вокселей 128–1536 МиБ и начальная непрозрачность. Настройки хранятся в аккаунте. По умолчанию автоматический режим подбирает разрешение под 1536 МиБ: большие срезы уменьшаются билинейной интерполяцией с сохранением поля обзора, координат пациента и физического масштаба; все срезы сохраняются. В просмотрщике показывается уменьшенное разрешение. Исходные DICOM-файлы не изменяются. При выборе исходного или фиксированного качества превышение персонального лимита по-прежнему останавливает просмотр.
Ограничения: до 2048 файлов, 64 МиБ на исходный файл, 1,5 ГиБ суммарной загрузки и 1,5 ГиБ Float32-вокселей. Это лимит массива объёма, а не всей памяти браузера: сборка и GPU требуют дополнительной памяти. Файлы читаются последовательно только после нажатия кнопки, загрузку можно отменить. При закрытии удаляются движок, GPU-ресурсы и принадлежащие просмотру записи кеша.
При запуске 3D в консоль браузера выводятся сообщения `[DICOM 3D]`: число файлов, общий и максимальный исходный размер, а после декодирования первого среза — размеры сетки и оценка Float32-объёма. При превышении лимита выводятся конкретная причина, фактическое значение и порог. Размеры указаны в байтах и ГиБ; пути, токены и медицинские теги не логируются.
Для приватных файлов используются обычные авторизованные API; для публичных — только API текущей ссылки с её токеном. Публичная ссылка на отдельный файл не запрашивает содержимое его родительской папки.
В сборщике `xmlbuilder2` направлен на официальный браузерный bundle: серверный entry зависимости VTK требует Node EventEmitter и не запускается в браузере. CSP страницы не ослабляется, сторонние CDN не используются.
Встроенные ресурсы включают служебные чанки Vite с начальным `__`; сервер отдаёт исходный JS, если gzip-копия не создана из-за малого размера. Go-тесты проверяют полноту встраивания и оба варианта отдачи. Дополнительная функциональная проверка: `DICOM_BROWSER_TEST=1 go test ./http -run TestProductionDICOMPreviewBrowser -v`. Нужны собранный frontend, Node 24, Playwright (путь можно задать в `PLAYWRIGHT_MODULE`) и браузер (`BROWSER_EXECUTABLE`). Проверка использует синтетические DICOM, настоящий встроенный сервер и CSP, без скриншотов и пользовательских данных.
Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

@@ -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]
>
+22
View File
@@ -0,0 +1,22 @@
# Навигация и миниатюры
Переходы выполняются внутри SPA: текущая папка остаётся на экране, пока сервер готовит следующую. Список и адрес обновляются вместе; шапка, поиск и дерево каталогов сохраняют свои компоненты. Для долгих запросов показывается тонкая полоса загрузки с задержкой 160 мс. Быстрый повторный переход отменяет предыдущий; запоздавшие ответы и ответы прежнего аккаунта не применяются. Крупные модули просмотра загружаются по необходимости до переключения страницы.
При смене аккаунта открывается его домашняя папка, в том числе после промежуточного выхода или OAuth-перехода. Обычный повторный вход в тот же аккаунт сохраняет прямую ссылку.
Боковая панель содержит закладки и раскрывающееся дерево каталогов. Текущий путь раскрывается автоматически; для остальных папок запрашивается только непосредственное содержимое при раскрытии. Обновления текущего каталога берутся из уже загруженного списка файлов. Скрытые каталоги учитывают настройку профиля. Права и область доступа проверяются существующим API.
Кнопка закладки закрепляет текущую папку. Закладки хранятся в браузере отдельно для каждого аккаунта и базового URL приложения. Крестик удаляет только закладку. Нижняя строка аккаунта открывает профиль, управление ссылками, административные разделы и выход в соответствии с правами пользователя. Меню поддерживает клавиатуру и закрывается по Escape или нажатию снаружи.
«Настройки профиля → Показ превью» сохраняется в базе пользователя и действует после повторного входа. По умолчанию показ включён, если миниатюры разрешены сервером. При отключении запросов миниатюр нет. Изображения загружаются по мере приближения к видимой области как в таблице, так и в плитках; ошибки миниатюр заменяются иконкой типа файла. DICOM отображается отдельной иконкой `.dcm`, без попытки генерации серверной миниатюры.
Настройки интерфейса находятся в разделе «Интерфейс»: внешний вид, работа с файлами, язык и даты. Кнопка «Управление» напротив профиля ведёт через `/auth/account` на `/settings` настроенного провайдера входа. Аватар берётся из проверенного `picture` при входе, преобразуется в небольшую PNG-миниатюру и хранится только в локальной сессии. Загружаются только изображения из `/avatars/` того же провайдера, без перенаправлений и передачи cookies или токенов. Если аватара нет, отображается первая буква имени.
Раздел ссылок называется «Мои ссылки» (My Shares). Уведомления отображаются справа под верхней панелью, учитывают тему и уменьшаются по ширине на мобильных устройствах. Ошибки остаются видимыми до закрытия; успешные действия закрываются автоматически.
Меню действий открывается правой кнопкой на файле или на пустой области, а также кнопкой «Действия» в шапке. ПКМ на пустом месте снимает выделение и показывает действия с текущей папкой. Меню ограничено размерами экрана, прокручивается, поддерживает стрелки и Escape. Верхняя панель освобождена для поиска, доступного и на мобильных устройствах.
Скачивание начинается сразу. Для папок и нескольких файлов формат задаётся в «Глобальные настройки → Скачивание → Формат архива», по умолчанию ZIP. Настройка действует и на публичные ссылки; отдельный файл передаётся без упаковки. Старые URL с явным параметром algo продолжают работать.
Навигация настроек находится в меню аккаунта: «Аккаунт» ведёт на управление аккаунтом, «Настройки» — личные предпочтения, «Мои ссылки» — созданные ссылки, «Административные настройки» — серверные параметры (только для администратора). Вкладок больше нет. Плитка «Управление пользователями» открывает таблицу и редактирование доступа в одном модальном окне; старые адреса управления пользователями перенаправляются туда.
Подменю «Создать» содержит папку и шаблоны текстовых форматов. Расширение добавляется автоматически без дублирования; JSON, HTML и XML получают корректное начальное содержимое. Реестр frontend/src/utils/file-templates.ts предназначен для расширения типов при подключении редакторов. Office-документы пока не создаются, чтобы не выдавать пустой файл за корректный DOCX/XLSX.
+21
View File
@@ -0,0 +1,21 @@
# Предпросмотр файлов
PDF отображается локальным PDF.js в canvas, без плагинов браузера и внешних CDN. Страницы рисуются по одной; доступны переключение страницы и масштаб. CSP `object-src 'none'` сохраняется. Шрифты и таблицы символов входят в сборку.
В панели PDF есть кнопка открытия в новой вкладке: там документ отображает сам браузер. Общая кнопка «Открыть файл» удалена.
Обычные и публичные страницы поддерживают изображения, аудио и видео в форматах браузера, TIFF, текст, Markdown, CSV и EPUB. Текстовые форматы ограничены 5 МиБ, TIFF — 64 МиБ и 16 миллионами пикселей. HTML показывается текстом; Markdown очищается от активного содержимого. Если формат не поддерживается, остаются иконка и скачивание.
ZIP показывает только дерево имён из центрального каталога, без чтения содержимого записей, распаковки или открытия вложенных архивов. Используются частичные HTTP-запросы; ответ без поддержки Range отклоняется. Лимиты: 4 МиБ центрального каталога, 10 000 записей, 20 000 узлов с учётом папок, 32 уровня вложенности, 1024 байта на имя. Одновременно отображаются до 1000 строк. Проверяются границы записей и ответа сервера; пути с переходом к родителю отклоняются. ZIP64 и составные архивы не поддерживаются. Заявленный распакованный размер не используется для выделения памяти; ZIP-бомбы не распаковываются. Время загрузки ограничено 30 секундами.
Параметры DICOM подписаны «Контраст (ширина окна)» и «Яркость (уровень окна)». Это медицинское окно отображения интенсивности: его ширина задаёт диапазон, а уровень — центр диапазона; исходные пиксели не изменяются.
Файлы `.dcm` и `.dicom` открываются локальным DICOM-декодером в отдельном Worker. Поддерживаются 8/16-битные монохромные изображения (MONOCHROME1/2), 8-битный RGB и сжатые данные, поддерживаемые декодером Daikon. Доступны выбор кадра, ширина/уровень окна и сброс настроек. Неподдерживаемый формат сообщает об ошибке; файл остаётся доступен для скачивания.
Изображение DICOM целиком вписывается в доступную область под панелью инструментов с сохранением пропорций. Большие изображения уменьшаются, небольшие не увеличиваются.
Окно сведений показывает свойства файла и таблицу DICOM-тегов с поиском по коду, имени и значению: данные пациента, исследования, серии, оборудования и параметры изображения, если они присутствуют в файле. Чтение метаданных не требует распаковки пикселей и работает независимо от поддержки формата изображения. Бинарные данные и последовательности не выводятся; таблица ограничена 512 тегами, 64 значениями на тег и 2048 символами на значение. Метаданные обрабатываются локально, без внешних сервисов.
Для ограничения памяти DICOM-предпросмотр принимает файлы до 64 МиБ, изображения до 16 миллионов пикселей на кадр и до 128 МиБ распакованных пикселей. Первичное декодирование ограничено 30 секундами. Просмотр доступен в файловом менеджере и по публичным ссылкам с теми же проверками доступа, что и скачивание.
Текстовые теги декодируются из исходных байтов. Автоматический режим распознаёт корректный UTF-8 и учитывает объявленную кодировку; при неверной маркировке UTF-8 использует Windows-1256. Для неоднозначных файлов кодировку можно выбрать вручную, в том числе Windows-1251 и Windows-1256, без повторной загрузки файла. Тег Specific Character Set сохраняет исходное значение из файла, а поле «Используется» показывает фактическую кодировку отображения.
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.
+2 -1
View File
@@ -21,8 +21,9 @@ var (
ErrPermissionDenied = errors.New("permission denied")
ErrInvalidRequestParams = errors.New("invalid request params")
ErrSourceIsParent = errors.New("source is parent")
ErrRootUserDeletion = errors.New("user with id 1 can't be deleted")
ErrRootUserDeletion = errors.New("the sole admin can't be deleted")
ErrCurrentPasswordIncorrect = errors.New("the current password is incorrect")
ErrShareRequiresDownload = errors.New("permission to share requires permission to download")
)
type ErrShortPassword struct {
+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
}
Loaded 100 of 423 files, more files were not shown because too many files have changed in this diff. Show more