Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
833d908884 | ||
|
|
1cd18d7ead | ||
|
|
e8a388f840 | ||
|
|
0dfe44649c | ||
|
|
05ee853eef | ||
|
|
afeb478ee1 | ||
|
|
df2869993a | ||
|
|
d49ab67904 | ||
|
|
cfff84306a | ||
|
|
72faf6dd3c | ||
|
|
a789f29cee | ||
|
|
74b13db3fa | ||
|
|
773b30102c | ||
|
|
0b925cbca9 | ||
|
|
9dd7c7d099 | ||
|
|
b24e43b06c | ||
|
|
91e68edb8c | ||
|
|
ac11538f08 |
No files matched your search
@@ -10,7 +10,7 @@
|
||||
|
||||
Before submitting your PR, please indicate which issues are either fixed or closed by this PR. See [GitHub Help: Closing issues using keywords](https://help.github.com/articles/closing-issues-via-commit-messages/).
|
||||
|
||||
- [ ] I am aware the project is currently in **maintenance-only** mode and new feature requests won't be accepted. See [README](https://github.com/filebrowser/community/blob/master/README.md)
|
||||
- [ ] I am aware this project is being **archived on 2026-09-01** and that no further changes will be merged, including bug fixes. See [README](https://github.com/filebrowser/filebrowser/blob/master/README.md)
|
||||
- [ ] I am aware that translations MUST be made through [Transifex](https://app.transifex.com/file-browser/file-browser/) and that this PR is NOT a translation update
|
||||
- [ ] I am making a PR against the `master` branch.
|
||||
- [ ] I am sure File Browser can be successfully built. See [builds](https://github.com/filebrowser/community/blob/master/builds.md) and [development](https://github.com/filebrowser/community/blob/master/development.md).
|
||||
- [ ] I am sure File Browser can be successfully built. See [CONTRIBUTING.md](https://github.com/filebrowser/filebrowser/blob/master/CONTRIBUTING.md).
|
||||
@@ -1,52 +0,0 @@
|
||||
name: Docs
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'www'
|
||||
- '*.md'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Docs
|
||||
if: github.event_name == 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
- name: Install Task
|
||||
uses: go-task/setup-task@v2
|
||||
- name: Build site
|
||||
run: task docs
|
||||
|
||||
build-and-release:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
name: Build and Release Docs
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
- name: Install Task
|
||||
uses: go-task/setup-task@v2
|
||||
- name: Build site
|
||||
run: task docs
|
||||
- name: Upload static files as artifact
|
||||
uses: actions/upload-pages-artifact@v5
|
||||
with:
|
||||
path: www/public
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: actions/deploy-pages@v5
|
||||
@@ -2,6 +2,15 @@
|
||||
|
||||
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
|
||||
|
||||
+5
-18
@@ -1,6 +1,6 @@
|
||||
# Contributing
|
||||
# Building File Browser
|
||||
|
||||
If you're interested in contributing to this project, this is the best place to start. Before contributing to this project, please take a bit of time to read our [Code of Conduct](code-of-conduct.md). Also, note that this project is open-source and licensed under [Apache License 2.0](LICENSE).
|
||||
This project is archived on 2026-09-01. Pull requests are not accepted and no further changes are merged. This document is kept as build documentation for anyone wishing to build the project from source.
|
||||
|
||||
## Project Structure
|
||||
|
||||
@@ -75,18 +75,10 @@ go run .
|
||||
|
||||
## Documentation
|
||||
|
||||
We rely on Docker to abstract all the dependencies required for building the documentation.
|
||||
|
||||
To build the documentation to `www/public`:
|
||||
Documentation lives in [`docs`](docs) as plain Markdown and is no longer built into a site. The command line reference in [`docs/cli`](docs/cli) is generated from the commands themselves:
|
||||
|
||||
```bash
|
||||
task docs
|
||||
```
|
||||
|
||||
To start a local server on port `8000` to view the built documentation:
|
||||
|
||||
```bash
|
||||
task docs:serve
|
||||
task docs:cli:generate
|
||||
```
|
||||
|
||||
## Release
|
||||
@@ -99,12 +91,7 @@ task release
|
||||
|
||||
## Translations
|
||||
|
||||
Translations are managed on Transifex, which is an online website where everyone can contribute and translate strings for our project. It automatically syncs with the main language file \(in English\) and,, for you to contribute, you just need to:
|
||||
|
||||
1. Go to our Transifex web page: [app.transifex.com/file-browser/file-browser](https://app.transifex.com/file-browser/file-browser/)
|
||||
2. Click on **Join the project** and pick your language. We'll accept you as soon as possible. If you're language is not on the list, please request it via the interface.
|
||||
|
||||
Translations are automatically pushed to GitHub via an integration.
|
||||
The Transifex integration stopped on 2026-09-01 and translations submitted there no longer reach this repository. Locale files live in [`frontend/src/i18n`](frontend/src/i18n) and can be edited directly.
|
||||
|
||||
## Authentication Provider
|
||||
|
||||
|
||||
@@ -1,30 +1,35 @@
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/filebrowser/filebrowser/master/branding/banner.png" width="550"/>
|
||||
</p>
|
||||
> [!WARNING]
|
||||
>
|
||||
> **File Browser is archived on 2026-09-01**. The last planned release has already shipped. There will be no further releases, bug fixes, or security fixes.
|
||||
|
||||
[](https://github.com/filebrowser/filebrowser/actions/workflows/ci.yaml)
|
||||
[](https://github.com/filebrowser/filebrowser/releases/latest)
|
||||
<p align="center">
|
||||
<img src="./branding/banner.png" width="550"/>
|
||||
</p>
|
||||
|
||||
File Browser provides a file managing interface within a specified directory and it can be used to upload, delete, preview and edit your files. It is a **create-your-own-cloud**-kind of software where you can just install it on your server, direct it to a path and access your files through a nice web interface.
|
||||
|
||||
**Background:** [Goodbye File Browser, for Real This Time](https://hacdias.com/2026/07/28/filebrowser/), July 2026.
|
||||
|
||||
## Security
|
||||
|
||||
Published advisories are listed under [security advisories](https://github.com/filebrowser/filebrowser/security/advisories),
|
||||
and reporting instructions are in [SECURITY.md](SECURITY.md). Two known issue classes
|
||||
remain unaddressed and will not be fixed:
|
||||
|
||||
- **Command execution, runner, and hooks.** This feature is plagued with vulnerabilities across many published advisories, and would need a full rewrite to be made safe. It is disabled by default; if you re-enable it with `--disable-exec=false`, treat the ability to run commands as equivalent to shell access on the host. Background: [#5199](https://github.com/filebrowser/filebrowser/issues/5199).
|
||||
- **Session and JWT handling.** Sessions are self-contained JWTs rather than server-side identifiers, so they cannot be revoked, which means that logout, password changes, and renewal leave previously issued tokens valid until they expire, and the same refresh token can be redeemed repeatedly. Assume a leaked token is valid until expiry. Background: [#5216](https://github.com/filebrowser/filebrowser/issues/5216).
|
||||
|
||||
If you keep running File Browser, treat it as unmaintained software:
|
||||
|
||||
- **Do not expose it directly to the internet.** Put it behind a reverse proxy that terminates TLS and performs its own authentication.
|
||||
- **Keep the command runner disabled.** It is off by default, so leave it off. See [#5199](https://github.com/filebrowser/filebrowser/issues/5199) and [`docs/command-execution.md`](docs/command-execution.md).
|
||||
- **Run it unprivileged, inside a container**, with only the directory you intend to serve mounted into it.
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation on how to install, configure, and contribute to this project is hosted at [filebrowser.org](https://filebrowser.org).
|
||||
Documentation on how to install, configure, and build this project lives in [`docs`](docs) in this repository.
|
||||
|
||||
## Project Status
|
||||
|
||||
This project is a finished product which fulfills its goal: be a single binary web File Browser which can be run by anyone anywhere. That means that File Browser is currently on **maintenance-only** mode. Therefore, please note the following:
|
||||
|
||||
- It can take a while until someone gets back to you. Please be patient.
|
||||
- [Issues](https://github.com/filebrowser/filebrowser/issues) are meant to track bugs. Unrelated issues will be converted into [discussions](https://github.com/filebrowser/filebrowser/discussions).
|
||||
- The priority is triaging issues, addressing security issues and reviewing pull requests meant to solve bugs.
|
||||
- No new features are planned. Pull requests for new features will not be reviewed.
|
||||
|
||||
Please read [@hacdias' personal reflection](https://hacdias.com/2026/03/11/filebrowser/) on the project status.
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions are always welcome. To start contributing to this project, read our [guidelines](CONTRIBUTING.md) first.
|
||||
[CONTRIBUTING.md](CONTRIBUTING.md) documents how to build and develop the project, which remains useful to anyone forking it.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
+8
-11
@@ -2,26 +2,23 @@
|
||||
|
||||
## Supported Versions
|
||||
|
||||
No version receives security fixes. The last planned release has already shipped and no further changes will be merged.
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | --------- |
|
||||
| 2.x | ✅ |
|
||||
| < 2.0 | ❌ |
|
||||
| 2.x | ❌ |
|
||||
| < 2.0 | ❌ |
|
||||
|
||||
## Before Reporting
|
||||
|
||||
This project is in maintenance-only mode. To avoid duplicates, first check the [existing advisories](https://github.com/filebrowser/filebrowser/security/advisories) and open issues, and confirm:
|
||||
This project is being wound down. To avoid duplicates, first check the [existing advisories](https://github.com/filebrowser/filebrowser/security/advisories) and open issues, and confirm:
|
||||
|
||||
- **It concerns this project, not a fork.** Reports about code, features, or endpoints that don't exist here belong to the relevant fork.
|
||||
- **It isn't an already-known class** that remains unaddressed:
|
||||
- Command execution, runner, and hooks (opt-in, disabled by default) — [#5199](https://github.com/filebrowser/filebrowser/issues/5199)
|
||||
- Session and JWT handling — [#5216](https://github.com/filebrowser/filebrowser/issues/5216)
|
||||
|
||||
Reports covering these are likely to be closed as duplicates.
|
||||
- **It isn't an already-known class** that remains unaddressed. Those are listed under [Security](README.md#security) in the README; reports covering them are likely to be closed as duplicates.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
- **Critical:** report privately via the [Security](https://github.com/filebrowser/filebrowser/security) page.
|
||||
- **Non-critical:** open a public issue so the community can help; we'll label it as a security issue.
|
||||
Until 2026-09-01, report privately via the [Security](https://github.com/filebrowser/filebrowser/security) page. After that date this repository is read-only and reports can no longer be submitted.
|
||||
|
||||
Please include, where possible:
|
||||
|
||||
@@ -30,4 +27,4 @@ Please include, where possible:
|
||||
- Steps to reproduce
|
||||
- Recommended remediation, if any
|
||||
|
||||
We're a volunteer effort, so responses can take a while, and we may reach out for clarification.
|
||||
No fix will ship for any report: the last planned release has already shipped and no further changes will be merged. Reports may still be published as advisories so that people running File Browser can assess their exposure.
|
||||
+5
-31
@@ -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
-1
@@ -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{
|
||||
|
||||
@@ -192,6 +192,11 @@ user created with the credentials from options "username" and "password".`,
|
||||
}
|
||||
setupLog(server.Log)
|
||||
|
||||
log.Println("NOTICE: File Browser is being wound down.")
|
||||
log.Println("NOTICE: The project is archived on 2026-09-01, after which there will be no")
|
||||
log.Println("NOTICE: further releases and no security fixes. Known unfixed issues are at")
|
||||
log.Println("NOTICE: https://github.com/filebrowser/filebrowser/security/advisories")
|
||||
|
||||
root, err := filepath.Abs(server.Root)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<p align="center">
|
||||
<img src="../branding/banner.png" width="550"/>
|
||||
</p>
|
||||
|
||||
> [!WARNING]
|
||||
>
|
||||
> **File Browser is archived on 2026-09-01.** There will be no further releases and no security fixes. Existing releases and Docker images stay online. For the known unaddressed security issues and hardening guidance, read the [README](../README.md#security).
|
||||
|
||||
File Browser provides a file managing interface within a specified directory and it can be used to upload, delete, preview and edit your files. It is a **create-your-own-cloud**-kind of software where you can just install it on your server, direct it to a path and access your files through a nice web interface.
|
||||
|
||||

|
||||
|
||||
## Contents
|
||||
|
||||
- [Installation](installation.md)
|
||||
- [Customization](customization.md)
|
||||
- [Authentication](authentication.md)
|
||||
- [Command Execution](command-execution.md)
|
||||
- [Deployment](deployment.md)
|
||||
- [Troubleshooting](troubleshooting.md)
|
||||
- [Command Line Usage](cli/filebrowser.md)
|
||||
|
||||
Project-level documents live in the repository root: [README](../README.md), [Building File Browser](../CONTRIBUTING.md), [Security Policy](../SECURITY.md), [Code of Conduct](../CODE-OF-CONDUCT.md), [Changelog](../CHANGELOG.md) and [License](../LICENSE).
|
||||
|
||||
## Features
|
||||
|
||||
- **Easy Login System**
|
||||
|
||||

|
||||
|
||||
- **Sleek Interface**
|
||||
|
||||

|
||||
|
||||
- **User Management**
|
||||
|
||||

|
||||
|
||||
- **File Editing**
|
||||
|
||||

|
||||
|
||||
- **Custom Commands**
|
||||
|
||||

|
||||
|
||||
- **Customization**
|
||||
|
||||

|
||||
@@ -1,6 +1,6 @@
|
||||
# Authentication
|
||||
|
||||
There are three possible authentication methods. Each one of them has its own capabilities and specification. If you are interested in contributing with one more authentication method, please [check the guidelines](contributing.md).
|
||||
There are three possible authentication methods. Each one of them has its own capabilities and specification. Adding another authentication method is described in [Building File Browser](../CONTRIBUTING.md#authentication-provider).
|
||||
|
||||
## JSON Auth (default)
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Generated
+21
-21
@@ -28,7 +28,7 @@ importers:
|
||||
version: 1.11.20
|
||||
dompurify:
|
||||
specifier: ^3.2.6
|
||||
version: 3.4.4
|
||||
version: 3.4.12
|
||||
epubjs:
|
||||
specifier: ^0.3.93
|
||||
version: 0.3.93
|
||||
@@ -131,7 +131,7 @@ importers:
|
||||
version: 0.9.1(typescript@5.9.3)(vue@3.5.34(typescript@5.9.3))
|
||||
autoprefixer:
|
||||
specifier: ^10.4.21
|
||||
version: 10.5.0(postcss@8.5.14)
|
||||
version: 10.5.0(postcss@8.5.18)
|
||||
eslint:
|
||||
specifier: ^10.0.0
|
||||
version: 10.4.0
|
||||
@@ -146,7 +146,7 @@ importers:
|
||||
version: 10.9.1(@typescript-eslint/parser@8.56.0(eslint@10.4.0)(typescript@5.9.3))(eslint@10.4.0)(vue-eslint-parser@10.4.0(eslint@10.4.0))
|
||||
postcss:
|
||||
specifier: ^8.5.6
|
||||
version: 8.5.14
|
||||
version: 8.5.18
|
||||
prettier:
|
||||
specifier: ^3.6.2
|
||||
version: 3.8.3
|
||||
@@ -1990,8 +1990,8 @@ packages:
|
||||
dom-walk@0.1.2:
|
||||
resolution: {integrity: sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==}
|
||||
|
||||
dompurify@3.4.4:
|
||||
resolution: {integrity: sha512-r8K7KGKEcztXfA/nfabSYB2hg9tDphORJTdf8xprN/luSLGmNhOBN8dm1/SYjqLLet6YUFEXOcrdTuwryp/Bew==}
|
||||
dompurify@3.4.12:
|
||||
resolution: {integrity: sha512-zQvGet8Z2sWbQhCmfFz/T5QWH2oBmjnqK3qvOjaqaNLrLEF912WamU+ohnTp0TCep/MFVHpdJuCZEdFOdTnEFg==}
|
||||
|
||||
electron-to-chromium@1.5.340:
|
||||
resolution: {integrity: sha512-908qahOGocRMinT2nM3ajCEM99H4iPdv84eagPP3FfZy/1ZGeOy2CZYzjhms81ckOPCXPlW7LkY4XpxD8r1DrA==}
|
||||
@@ -2538,8 +2538,8 @@ packages:
|
||||
engines: {node: '>=8', npm: '>=5'}
|
||||
hasBin: true
|
||||
|
||||
nanoid@3.3.12:
|
||||
resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==}
|
||||
nanoid@3.3.16:
|
||||
resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==}
|
||||
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
||||
hasBin: true
|
||||
|
||||
@@ -2639,8 +2639,8 @@ packages:
|
||||
postcss-value-parser@4.2.0:
|
||||
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
|
||||
|
||||
postcss@8.5.14:
|
||||
resolution: {integrity: sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==}
|
||||
postcss@8.5.18:
|
||||
resolution: {integrity: sha512-xdB1oSLHbz1vRWgCDalrCqEFTWzFlhqFC5tIHLMOSUIjhm3XXQ1qrFy8S/ESr1JYRRXqM3c1QFiMZUJdUTqyMQ==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
|
||||
prelude-ls@1.2.1:
|
||||
@@ -2824,8 +2824,8 @@ packages:
|
||||
systemjs@6.15.1:
|
||||
resolution: {integrity: sha512-Nk8c4lXvMB98MtbmjX7JwJRgJOL8fluecYCfCeYBznwmpOs8Bf15hLM6z4z71EDAhQVrQrI+wt1aLWSXZq+hXA==}
|
||||
|
||||
tabbable@6.4.0:
|
||||
resolution: {integrity: sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg==}
|
||||
tabbable@6.5.0:
|
||||
resolution: {integrity: sha512-wieBHXygIm7OyQOu5hQlkk62/WyCFYGlWg7L6/ZCUZwx0o398Zkn4pVmMyfYhfMG8kGrj/Krt8eIk6UKC6VzwA==}
|
||||
|
||||
tar-mini@0.2.0:
|
||||
resolution: {integrity: sha512-+qfUHz700DWnRutdUsxRRVZ38G1Qr27OetwaMYTdg8hcPxf46U0S1Zf76dQMWRBmusOt2ZCK5kbIaiLkoGO7WQ==}
|
||||
@@ -4644,7 +4644,7 @@ snapshots:
|
||||
'@vue/shared': 3.5.34
|
||||
estree-walker: 2.0.2
|
||||
magic-string: 0.30.21
|
||||
postcss: 8.5.14
|
||||
postcss: 8.5.18
|
||||
source-map-js: 1.2.1
|
||||
|
||||
'@vue/compiler-ssr@3.5.34':
|
||||
@@ -4808,13 +4808,13 @@ snapshots:
|
||||
'@babel/parser': 7.29.3
|
||||
ast-kit: 2.2.0
|
||||
|
||||
autoprefixer@10.5.0(postcss@8.5.14):
|
||||
autoprefixer@10.5.0(postcss@8.5.18):
|
||||
dependencies:
|
||||
browserslist: 4.28.2
|
||||
caniuse-lite: 1.0.30001788
|
||||
fraction.js: 5.3.4
|
||||
picocolors: 1.1.1
|
||||
postcss: 8.5.14
|
||||
postcss: 8.5.18
|
||||
postcss-value-parser: 4.2.0
|
||||
|
||||
babel-plugin-polyfill-corejs2@0.4.17(@babel/core@7.29.0):
|
||||
@@ -4946,7 +4946,7 @@ snapshots:
|
||||
|
||||
dom-walk@0.1.2: {}
|
||||
|
||||
dompurify@3.4.4:
|
||||
dompurify@3.4.12:
|
||||
optionalDependencies:
|
||||
'@types/trusted-types': 2.0.7
|
||||
|
||||
@@ -5231,7 +5231,7 @@ snapshots:
|
||||
|
||||
focus-trap@8.0.0:
|
||||
dependencies:
|
||||
tabbable: 6.4.0
|
||||
tabbable: 6.5.0
|
||||
optional: true
|
||||
|
||||
fraction.js@5.3.4: {}
|
||||
@@ -5517,7 +5517,7 @@ snapshots:
|
||||
'@babel/runtime': 7.28.6
|
||||
global: 4.4.0
|
||||
|
||||
nanoid@3.3.12: {}
|
||||
nanoid@3.3.16: {}
|
||||
|
||||
natural-compare@1.4.0: {}
|
||||
|
||||
@@ -5604,9 +5604,9 @@ snapshots:
|
||||
|
||||
postcss-value-parser@4.2.0: {}
|
||||
|
||||
postcss@8.5.14:
|
||||
postcss@8.5.18:
|
||||
dependencies:
|
||||
nanoid: 3.3.12
|
||||
nanoid: 3.3.16
|
||||
picocolors: 1.1.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
@@ -5802,7 +5802,7 @@ snapshots:
|
||||
|
||||
systemjs@6.15.1: {}
|
||||
|
||||
tabbable@6.4.0:
|
||||
tabbable@6.5.0:
|
||||
optional: true
|
||||
|
||||
tar-mini@0.2.0: {}
|
||||
@@ -5963,7 +5963,7 @@ snapshots:
|
||||
dependencies:
|
||||
lightningcss: 1.32.0
|
||||
picomatch: 4.0.4
|
||||
postcss: 8.5.14
|
||||
postcss: 8.5.18
|
||||
rolldown: 1.0.1
|
||||
tinyglobby: 0.2.16
|
||||
optionalDependencies:
|
||||
|
||||
@@ -55,12 +55,16 @@
|
||||
short_name: window.FileBrowser.Name || "File Browser",
|
||||
icons: [
|
||||
{
|
||||
src: window.__prependStaticUrl("/img/icons/android-chrome-192x192.png"),
|
||||
src:
|
||||
window.location.origin +
|
||||
window.__prependStaticUrl("/img/icons/android-chrome-192x192.png"),
|
||||
sizes: "192x192",
|
||||
type: "image/png",
|
||||
},
|
||||
{
|
||||
src: window.__prependStaticUrl("/img/icons/android-chrome-512x512.png"),
|
||||
src:
|
||||
window.location.origin +
|
||||
window.__prependStaticUrl("/img/icons/android-chrome-512x512.png"),
|
||||
sizes: "512x512",
|
||||
type: "image/png",
|
||||
},
|
||||
|
||||
@@ -38,6 +38,7 @@ import { useRoute } from "vue-router";
|
||||
import { useLayoutStore } from "@/stores/layout";
|
||||
|
||||
import * as upload from "@/utils/upload";
|
||||
import buttons from "@/utils/buttons";
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
@@ -66,9 +67,13 @@ const uploadInput = async (event: Event) => {
|
||||
|
||||
const path = route.path.endsWith("/") ? route.path : route.path + "/";
|
||||
|
||||
// Checking the destination hits the server, so show it is working rather
|
||||
// than leaving the action looking inert until the upload starts.
|
||||
buttons.loading("upload");
|
||||
const conflict = await upload.checkConflict(uploadFiles, path);
|
||||
|
||||
if (conflict.length > 0) {
|
||||
buttons.done("upload");
|
||||
layoutStore.showHover({
|
||||
prompt: "resolve-conflict",
|
||||
props: {
|
||||
|
||||
@@ -56,6 +56,8 @@ nav {
|
||||
position: fixed;
|
||||
top: 4em;
|
||||
left: 0;
|
||||
height: calc(100vh - 4em);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
html[dir="rtl"] nav {
|
||||
|
||||
@@ -113,8 +113,9 @@
|
||||
top: 0;
|
||||
z-index: 99999;
|
||||
background: var(--surfaceSecondary);
|
||||
height: 100%;
|
||||
height: 100vh;
|
||||
width: 16em;
|
||||
overflow-y: auto;
|
||||
box-shadow: 0 0 5px var(--borderPrimary);
|
||||
transition: 0.1s ease left;
|
||||
left: -17em;
|
||||
|
||||
@@ -264,6 +264,9 @@
|
||||
"shareManagement": "Freigabeverwaltung",
|
||||
"shareDeleted": "Freigabe gelöscht!",
|
||||
"singleClick": "Einfacher Klick zum Öffnen von Dateien und Verzeichnissen",
|
||||
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
|
||||
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
|
||||
"sunsetTitle": "File Browser is being archived",
|
||||
"themes": {
|
||||
"default": "Systemstandard",
|
||||
"dark": "Dunkel",
|
||||
|
||||
@@ -264,6 +264,9 @@
|
||||
"shareManagement": "Share Management",
|
||||
"shareDeleted": "Share deleted!",
|
||||
"singleClick": "Use single clicks to open files and directories",
|
||||
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
|
||||
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
|
||||
"sunsetTitle": "File Browser is being archived",
|
||||
"themes": {
|
||||
"default": "System default",
|
||||
"dark": "Dark",
|
||||
|
||||
@@ -264,6 +264,9 @@
|
||||
"shareManagement": "Gestion des partages",
|
||||
"shareDeleted": "Partage supprimé !",
|
||||
"singleClick": "Utiliser un simple clic pour ouvrir les fichiers et les dossiers",
|
||||
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
|
||||
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
|
||||
"sunsetTitle": "File Browser is being archived",
|
||||
"themes": {
|
||||
"default": "Par défaut du système",
|
||||
"dark": "Sombre",
|
||||
|
||||
@@ -264,6 +264,9 @@
|
||||
"shareManagement": "Upravljanje Dijeljenjem",
|
||||
"shareDeleted": "Podjela izbrisana!",
|
||||
"singleClick": "Koristi jednostruke klikove za otvaranje datoteka i mapa",
|
||||
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
|
||||
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
|
||||
"sunsetTitle": "File Browser is being archived",
|
||||
"themes": {
|
||||
"default": "Zadano - Sustav",
|
||||
"dark": "Tamno",
|
||||
|
||||
@@ -264,6 +264,9 @@
|
||||
"shareManagement": "공유 내역 관리",
|
||||
"shareDeleted": "공유 삭제됨!",
|
||||
"singleClick": "단일 클릭으로 파일 및 디렉터리 열기",
|
||||
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
|
||||
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
|
||||
"sunsetTitle": "File Browser is being archived",
|
||||
"themes": {
|
||||
"default": "시스템 기본값",
|
||||
"dark": "어두운 테마",
|
||||
|
||||
@@ -264,6 +264,9 @@
|
||||
"shareManagement": "Beheer van gedeelde mappen en bestanden",
|
||||
"shareDeleted": "Delen opheffen!",
|
||||
"singleClick": "Bestanden en mappen met een enkele klik openen",
|
||||
"sunsetBody": "Dit project wordt afgebouwd. Het wordt gearchiveerd op 01-09-2026, waarna er geen releases, bugfixes of beveiligingsoplossingen meer zullen worden uitgegeven. Bestaande releases en Docker-afbeeldingen blijven online. Stel deze instantie niet rechtstreeks bloot aan internet zonder authenticatie ervoor.",
|
||||
"sunsetLink": "Lees de projectstatus, bekende niet-gefixeerde beveiligingsproblemen en verhardingsrichtlijnen",
|
||||
"sunsetTitle": "File Browser wordt gearchiveerd",
|
||||
"themes": {
|
||||
"default": "Systeem standaard",
|
||||
"dark": "Donker",
|
||||
|
||||
@@ -264,6 +264,9 @@
|
||||
"shareManagement": "Zarządzanie udostępnianiem",
|
||||
"shareDeleted": "Udostępnienie usunięte!",
|
||||
"singleClick": "Używaj pojedynczych kliknięć, aby otwierać pliki i foldery",
|
||||
"sunsetBody": "Ten projekt jest w trakcie zamykania. Zostanie zarchiwizowany 1 września 2026 r., po czym nie będzie żadnych kolejnych wydań, poprawek błędów ani poprawek zabezpieczeń. Istniejące wydania i obrazy Dockera pozostaną online. Nie udostępniaj tej instancji bezpośrednio w internecie bez uwierzytelnienia.",
|
||||
"sunsetLink": "Przeczytaj stan projektu, znane nierozwiązane problemy bezpieczeństwa i wskazówki dotyczące wzmacniania zabezpieczeń",
|
||||
"sunsetTitle": "File Browser jest archiwizowany",
|
||||
"themes": {
|
||||
"default": "Domyślny systemowy",
|
||||
"dark": "Ciemny",
|
||||
|
||||
@@ -264,6 +264,9 @@
|
||||
"shareManagement": "Gestão de Partilhas",
|
||||
"shareDeleted": "Partilha eliminada!",
|
||||
"singleClick": "Utilizar cliques únicos para abrir ficheiros e pastas",
|
||||
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
|
||||
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
|
||||
"sunsetTitle": "File Browser is being archived",
|
||||
"themes": {
|
||||
"default": "Predefinição do sistema",
|
||||
"dark": "Escuro",
|
||||
|
||||
@@ -264,6 +264,9 @@
|
||||
"shareManagement": "分享管理",
|
||||
"shareDeleted": "分享已删除!",
|
||||
"singleClick": "单击打开文件/文件夹",
|
||||
"sunsetBody": "This project is being wound down. It is archived on 2026-09-01, after which there will be no further releases, bug fixes, or security fixes. Existing releases and Docker images stay online. Do not expose this instance directly to the internet without authentication in front of it.",
|
||||
"sunsetLink": "Read the project status, known unfixed security issues, and hardening guidance",
|
||||
"sunsetTitle": "File Browser is being archived",
|
||||
"themes": {
|
||||
"default": "系统默认",
|
||||
"dark": "深色",
|
||||
|
||||
@@ -103,15 +103,21 @@ export const useUploadStore = defineStore("upload", () => {
|
||||
}
|
||||
|
||||
if (isActiveUploadsOnLimit() && hasPendingUploads()) {
|
||||
if (!hasActiveUploads()) {
|
||||
// Update the state in a fixed time interval
|
||||
if (progressInterval === null) {
|
||||
// Update the state in a fixed time interval. Guard on the handle, not
|
||||
// on the active count: this runs again every time the queue drains to
|
||||
// zero with work still pending, and reassigning would leak the timer.
|
||||
progressInterval = window.setInterval(syncState, 1000);
|
||||
}
|
||||
|
||||
const upload = nextUpload();
|
||||
let succeeded = true;
|
||||
|
||||
if (upload.type === "dir") {
|
||||
await api.post(upload.path).catch($showError);
|
||||
await api.post(upload.path).catch((err) => {
|
||||
succeeded = false;
|
||||
$showError(err);
|
||||
});
|
||||
} else {
|
||||
const onUpload = (event: ProgressEvent) => {
|
||||
upload.rawProgress.sentBytes = event.loaded;
|
||||
@@ -119,10 +125,13 @@ export const useUploadStore = defineStore("upload", () => {
|
||||
|
||||
await api
|
||||
.post(upload.path, upload.file!, upload.overwrite, onUpload)
|
||||
.catch((err) => err.message !== "Upload aborted" && $showError(err));
|
||||
.catch((err) => {
|
||||
succeeded = false;
|
||||
if (err.message !== "Upload aborted") $showError(err);
|
||||
});
|
||||
}
|
||||
|
||||
finishUpload(upload);
|
||||
finishUpload(upload, succeeded);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -135,9 +144,18 @@ export const useUploadStore = defineStore("upload", () => {
|
||||
return upload;
|
||||
};
|
||||
|
||||
const finishUpload = (upload: Upload) => {
|
||||
sentBytes.value += upload.totalBytes - upload.sentBytes;
|
||||
upload.sentBytes = upload.totalBytes;
|
||||
const finishUpload = (upload: Upload, succeeded: boolean) => {
|
||||
if (succeeded) {
|
||||
sentBytes.value += upload.totalBytes - upload.sentBytes;
|
||||
upload.sentBytes = upload.totalBytes;
|
||||
} else {
|
||||
// Credit only what actually reached the server and drop the rest from the
|
||||
// total. Counting a failed upload as fully sent makes the bar report 100%
|
||||
// while nothing was written, which reads as success.
|
||||
sentBytes.value += upload.rawProgress.sentBytes - upload.sentBytes;
|
||||
totalBytes.value -= upload.totalBytes - upload.rawProgress.sentBytes;
|
||||
upload.sentBytes = upload.rawProgress.sentBytes;
|
||||
}
|
||||
upload.file = null;
|
||||
|
||||
activeUploads.value.delete(upload);
|
||||
|
||||
@@ -20,6 +20,24 @@ vi.mock("@/stores/layout", () => ({ useLayoutStore: vi.fn() }));
|
||||
vi.mock("@/stores/upload", () => ({ useUploadStore: vi.fn() }));
|
||||
vi.mock("@/utils/url", () => ({ default: {} }));
|
||||
|
||||
type ServerEntry = {
|
||||
path: string;
|
||||
name: string;
|
||||
size: number;
|
||||
modified: string;
|
||||
isDir: boolean;
|
||||
};
|
||||
|
||||
// The destination's direct listing, used for copy/move and for flat uploads.
|
||||
function mockListing(entries: ServerEntry[]) {
|
||||
vi.mocked(api.fetch).mockResolvedValue({ items: entries } as Resource);
|
||||
}
|
||||
|
||||
// The recursive walk of the destination, used only for nested (folder) uploads.
|
||||
function mockRecursiveListing(entries: ServerEntry[]) {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue(entries);
|
||||
}
|
||||
|
||||
// A move/copy/drag item carries name (raw) and to (URL-encoded) but no
|
||||
// fullPath - mirroring what Move.vue / Copy.vue / ListingItem.vue build.
|
||||
function moveItem(name: string, dest: string, size = 12) {
|
||||
@@ -40,7 +58,7 @@ describe("checkConflict", () => {
|
||||
});
|
||||
|
||||
it("detects a conflict for a plain filename", async () => {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue([
|
||||
mockListing([
|
||||
{
|
||||
path: "/target/file.txt",
|
||||
name: "file.txt",
|
||||
@@ -59,6 +77,43 @@ describe("checkConflict", () => {
|
||||
expect(conflicts[0].name).toBe("/target/file.txt");
|
||||
});
|
||||
|
||||
// Regression for #6006: pressing Upload awaited a full server-side recursive
|
||||
// walk of the destination before a single byte was sent, so the UI sat there
|
||||
// doing nothing on a large destination. A flat upload can only collide with a
|
||||
// direct child, which the plain listing already covers.
|
||||
it("does not walk the destination tree for a flat upload", async () => {
|
||||
mockListing([]);
|
||||
|
||||
await checkConflict(
|
||||
[{ name: "file.txt", size: 12, isDir: false }],
|
||||
"/files/target/"
|
||||
);
|
||||
|
||||
expect(api.fetch).toHaveBeenCalledWith("/files/target/");
|
||||
expect(api.fetchAll).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
// ...but a folder upload lands entries below the destination, so it still
|
||||
// needs the recursive listing to see them.
|
||||
it("walks the destination tree for a nested upload", async () => {
|
||||
mockRecursiveListing([]);
|
||||
|
||||
await checkConflict(
|
||||
[
|
||||
{
|
||||
name: "file.txt",
|
||||
size: 12,
|
||||
isDir: false,
|
||||
fullPath: "folder/file.txt",
|
||||
},
|
||||
],
|
||||
"/files/target/"
|
||||
);
|
||||
|
||||
expect(api.fetchAll).toHaveBeenCalledWith("/files/target/");
|
||||
expect(api.fetch).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
// Regression for #5957: names with encodable characters (spaces, "#",
|
||||
// non-ASCII) were keyed by the URL-encoded `to` value and never matched the
|
||||
// server's raw path, so the conflict modal was skipped and the backend
|
||||
@@ -66,7 +121,7 @@ describe("checkConflict", () => {
|
||||
it.each(["my file.txt", "résumé.pdf", "a#b.txt"])(
|
||||
"detects a conflict for %s (encodable characters)",
|
||||
async (name) => {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue([
|
||||
mockListing([
|
||||
{
|
||||
path: `/target/${name}`,
|
||||
name,
|
||||
@@ -87,7 +142,7 @@ describe("checkConflict", () => {
|
||||
);
|
||||
|
||||
it("reports no conflict when the destination has no matching name", async () => {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue([
|
||||
mockListing([
|
||||
{
|
||||
path: "/target/other.txt",
|
||||
name: "other.txt",
|
||||
@@ -106,7 +161,7 @@ describe("checkConflict", () => {
|
||||
});
|
||||
|
||||
it("detects nested conflicts for folder uploads via fullPath", async () => {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue([
|
||||
mockRecursiveListing([
|
||||
{
|
||||
path: "/target/folder",
|
||||
name: "folder",
|
||||
@@ -143,7 +198,7 @@ describe("checkConflict", () => {
|
||||
// fullPath) and no directory entries. Conflict detection must still find a
|
||||
// nested file even though its parent folder is not in the upload list.
|
||||
it("detects nested conflicts when no directory entries are present", async () => {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue([
|
||||
mockRecursiveListing([
|
||||
{
|
||||
path: "/target/folder/deep/file.txt",
|
||||
name: "file.txt",
|
||||
@@ -171,24 +226,22 @@ describe("checkConflict", () => {
|
||||
// Copy/move only needs the target directory's direct children. A recursive
|
||||
// walk can make the UI look frozen on large destinations (regression #6005).
|
||||
it("checks only the direct destination listing for copy/move", async () => {
|
||||
vi.mocked(api.fetch).mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
path: "/target/file.txt",
|
||||
name: "file.txt",
|
||||
size: 10,
|
||||
modified: "2026-06-04T00:00:00Z",
|
||||
isDir: false,
|
||||
},
|
||||
{
|
||||
path: "/target/folder",
|
||||
name: "folder",
|
||||
size: 0,
|
||||
modified: "2026-06-04T00:00:00Z",
|
||||
isDir: true,
|
||||
},
|
||||
],
|
||||
} as Resource);
|
||||
mockListing([
|
||||
{
|
||||
path: "/target/file.txt",
|
||||
name: "file.txt",
|
||||
size: 10,
|
||||
modified: "2026-06-04T00:00:00Z",
|
||||
isDir: false,
|
||||
},
|
||||
{
|
||||
path: "/target/folder",
|
||||
name: "folder",
|
||||
size: 0,
|
||||
modified: "2026-06-04T00:00:00Z",
|
||||
isDir: true,
|
||||
},
|
||||
]);
|
||||
|
||||
const items = [
|
||||
moveItem("file.txt", "/files/target/"),
|
||||
@@ -209,7 +262,7 @@ describe("checkConflict", () => {
|
||||
// Uploads merge into an existing folder, so the directory itself must not be
|
||||
// reported - only the files inside it can conflict.
|
||||
it("ignores a directory conflict for uploads (default)", async () => {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue([
|
||||
mockListing([
|
||||
{
|
||||
path: "/target/folder",
|
||||
name: "folder",
|
||||
@@ -228,8 +281,8 @@ describe("checkConflict", () => {
|
||||
expect(conflicts).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("returns no conflicts when the recursive listing fails", async () => {
|
||||
vi.mocked(api.fetchAll).mockRejectedValue(new Error("404"));
|
||||
it("returns no conflicts when the destination listing fails", async () => {
|
||||
vi.mocked(api.fetch).mockRejectedValue(new Error("404"));
|
||||
|
||||
const conflicts = await checkConflict(
|
||||
[moveItem("file.txt", "/files/target/")],
|
||||
@@ -240,11 +293,11 @@ describe("checkConflict", () => {
|
||||
});
|
||||
|
||||
// Regression for #5980: a FileBrowser server running on Windows returns
|
||||
// backslash-separated paths from the recursive listing. Without normalizing
|
||||
// them, the prefix strip and key lookup never match, so the conflict modal is
|
||||
// skipped and the backend returns a bare 409.
|
||||
// backslash-separated paths, Without normalizing them, the prefix strip and
|
||||
// key lookup never match, so the conflict modal is skipped and the backend
|
||||
// returns a bare 409.
|
||||
it("detects a conflict for backslash-separated server paths (Windows)", async () => {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue([
|
||||
mockListing([
|
||||
{
|
||||
path: "\\target\\file.txt",
|
||||
name: "file.txt",
|
||||
@@ -263,7 +316,7 @@ describe("checkConflict", () => {
|
||||
});
|
||||
|
||||
it("detects nested conflicts for backslash-separated server paths (Windows)", async () => {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue([
|
||||
mockRecursiveListing([
|
||||
{
|
||||
path: "\\target\\folder\\nested file.txt",
|
||||
name: "nested file.txt",
|
||||
@@ -293,7 +346,7 @@ describe("checkConflict", () => {
|
||||
])(
|
||||
"detects conflicts below an encoded destination path with %s",
|
||||
async (_label, serverPath) => {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue([
|
||||
mockListing([
|
||||
{
|
||||
path: serverPath,
|
||||
name: "file.txt",
|
||||
@@ -314,7 +367,7 @@ describe("checkConflict", () => {
|
||||
);
|
||||
|
||||
it("detects nested folder-upload conflicts below an encoded destination path", async () => {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue([
|
||||
mockRecursiveListing([
|
||||
{
|
||||
path: "\\target\\My SubDir\\folder\\nested file.txt",
|
||||
name: "nested file.txt",
|
||||
@@ -341,7 +394,7 @@ describe("checkConflict", () => {
|
||||
});
|
||||
|
||||
it("leaves malformed destination path segments unchanged", async () => {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue([
|
||||
mockListing([
|
||||
{
|
||||
path: "/target/bad%ZZ/file.txt",
|
||||
name: "file.txt",
|
||||
@@ -360,7 +413,7 @@ describe("checkConflict", () => {
|
||||
});
|
||||
|
||||
it("does not match files outside the decoded destination path", async () => {
|
||||
vi.mocked(api.fetchAll).mockResolvedValue([
|
||||
mockRecursiveListing([
|
||||
{
|
||||
path: "/target/My SubDir/other.txt",
|
||||
name: "other.txt",
|
||||
@@ -369,7 +422,7 @@ describe("checkConflict", () => {
|
||||
isDir: false,
|
||||
},
|
||||
{
|
||||
path: "/target/My Other SubDir/file.txt",
|
||||
path: "/target/My Other SubDir/folder/file.txt",
|
||||
name: "file.txt",
|
||||
size: 10,
|
||||
modified: "2026-06-04T00:00:00Z",
|
||||
@@ -378,7 +431,14 @@ describe("checkConflict", () => {
|
||||
]);
|
||||
|
||||
const conflicts = await checkConflict(
|
||||
[moveItem("file.txt", "/files/target/My%20SubDir/")],
|
||||
[
|
||||
{
|
||||
name: "file.txt",
|
||||
size: 12,
|
||||
isDir: false,
|
||||
fullPath: "folder/file.txt",
|
||||
},
|
||||
],
|
||||
"/files/target/My%20SubDir/"
|
||||
);
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@ type ServerConflictEntry = {
|
||||
|
||||
async function fetchConflictEntries(
|
||||
basePath: string,
|
||||
includeDirectories: boolean
|
||||
recursive: boolean
|
||||
): Promise<ServerConflictEntry[]> {
|
||||
if (!includeDirectories) {
|
||||
if (recursive) {
|
||||
return await api.fetchAll(basePath);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,14 @@ async function fetchConflictEntries(
|
||||
return destination.items ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether any entry lands below the destination rather than directly in it.
|
||||
* Only then does conflict detection need the whole destination tree.
|
||||
*/
|
||||
function hasNestedEntries(files: UploadList): boolean {
|
||||
return files.some((file) => conflictKey(file).includes("/"));
|
||||
}
|
||||
|
||||
function conflictPath(entry: ServerConflictEntry): string {
|
||||
return entry.path.replace(/\\/g, "/");
|
||||
}
|
||||
@@ -84,11 +92,14 @@ function buildConflictMap(
|
||||
* server, so the caller can prompt the user to overwrite/rename/skip.
|
||||
*
|
||||
* Directory handling differs by action, hence `includeDirectories`:
|
||||
* - Upload (false): the destination tree is fetched recursively so nested
|
||||
* file uploads can be checked; existing folders are silently merged.
|
||||
* - Copy/move (true): only the destination directory itself is fetched. These
|
||||
* operations move flat top-level selections, so a same-named direct child is
|
||||
* the only preflight conflict the backend will reject.
|
||||
* - Upload (false): existing folders are silently merged, so only files count.
|
||||
* - Copy/move (true): these move flat top-level selections, so a same-named
|
||||
* direct child is the only preflight conflict the backend will reject.
|
||||
*
|
||||
* The destination tree is only walked recursively when an entry actually lands
|
||||
* below the destination (a folder upload). Walking it for a flat upload made
|
||||
* pressing Upload wait on a full server-side walk of the whole subtree before
|
||||
* a single byte was sent, which reads as a frozen UI on a large destination.
|
||||
*
|
||||
* @param files - flat upload list to check
|
||||
* @param basePath - server destination path (e.g. "/files/uploads/")
|
||||
@@ -101,9 +112,11 @@ export async function checkConflict(
|
||||
): Promise<ConflictingResource[]> {
|
||||
if (files.length === 0) return [];
|
||||
|
||||
const recursive = !includeDirectories && hasNestedEntries(files);
|
||||
|
||||
let serverEntries: ServerConflictEntry[];
|
||||
try {
|
||||
serverEntries = await fetchConflictEntries(basePath, includeDirectories);
|
||||
serverEntries = await fetchConflictEntries(basePath, recursive);
|
||||
} catch {
|
||||
// The destination doesn't exist yet, so nothing can conflict.
|
||||
return [];
|
||||
|
||||
@@ -34,6 +34,24 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card" v-if="user?.perm.admin">
|
||||
<div class="card-title">
|
||||
<h2>{{ t("settings.sunsetTitle") }}</h2>
|
||||
</div>
|
||||
|
||||
<div class="card-content">
|
||||
<p>{{ t("settings.sunsetBody") }}</p>
|
||||
<p>
|
||||
<a
|
||||
href="https://github.com/filebrowser/filebrowser#security"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>{{ t("settings.sunsetLink") }}</a
|
||||
>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="loading">
|
||||
<h2 class="message delayed">
|
||||
<div class="spinner">
|
||||
|
||||
@@ -348,6 +348,7 @@ import { useLayoutStore } from "@/stores/layout";
|
||||
import { users, files as api } from "@/api";
|
||||
import { enableExec } from "@/utils/constants";
|
||||
import * as upload from "@/utils/upload";
|
||||
import buttons from "@/utils/buttons";
|
||||
import css from "@/utils/css";
|
||||
import { throttle } from "lodash-es";
|
||||
import { Base64 } from "js-base64";
|
||||
@@ -821,11 +822,15 @@ const drop = async (event: DragEvent) => {
|
||||
}
|
||||
}
|
||||
|
||||
// Checking the destination hits the server, so show it is working rather
|
||||
// than leaving the action looking inert until the upload starts.
|
||||
buttons.loading("upload");
|
||||
const conflict = await upload.checkConflict(files, path);
|
||||
|
||||
const preselect = removePrefix(path) + (files[0].fullPath || files[0].name);
|
||||
|
||||
if (conflict.length > 0) {
|
||||
buttons.done("upload");
|
||||
layoutStore.showHover({
|
||||
prompt: "resolve-conflict",
|
||||
props: {
|
||||
@@ -879,9 +884,14 @@ const uploadInput = async (event: Event) => {
|
||||
}
|
||||
|
||||
const path = route.path.endsWith("/") ? route.path : route.path + "/";
|
||||
|
||||
// Checking the destination hits the server, so show it is working rather
|
||||
// than leaving the action looking inert until the upload starts.
|
||||
buttons.loading("upload");
|
||||
const conflict = await upload.checkConflict(uploadFiles, path);
|
||||
|
||||
if (conflict.length > 0) {
|
||||
buttons.done("upload");
|
||||
layoutStore.showHover({
|
||||
prompt: "resolve-conflict",
|
||||
props: {
|
||||
|
||||
@@ -51,6 +51,10 @@ vi.mock("@/utils/upload", () => ({
|
||||
handleFiles: harness.handleFiles,
|
||||
}));
|
||||
vi.mock("@/utils/css", () => ({ default: vi.fn() }));
|
||||
// Reaches document.querySelector, which the node test environment lacks.
|
||||
vi.mock("@/utils/buttons", () => ({
|
||||
default: { loading: vi.fn(), done: vi.fn(), success: vi.fn() },
|
||||
}));
|
||||
vi.mock("@/components/header/HeaderBar.vue", () => ({ default: {} }));
|
||||
vi.mock("@/components/header/Action.vue", () => ({ default: {} }));
|
||||
vi.mock("@/components/Search.vue", () => ({ default: {} }));
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<a
|
||||
class="link"
|
||||
target="_blank"
|
||||
href="https://filebrowser.org/customization.html#custom-branding"
|
||||
href="https://github.com/filebrowser/filebrowser/blob/master/docs/customization.md#custom-branding"
|
||||
>{{ t("settings.documentation") }}</a
|
||||
>
|
||||
</i18n-t>
|
||||
@@ -209,7 +209,7 @@
|
||||
<a
|
||||
class="link"
|
||||
target="_blank"
|
||||
href="https://filebrowser.org/command-execution.html#hook-runner"
|
||||
href="https://github.com/filebrowser/filebrowser/blob/master/docs/command-execution.md#hook-runner"
|
||||
>{{ t("settings.documentation") }}</a
|
||||
>
|
||||
</i18n-t>
|
||||
@@ -262,6 +262,7 @@ const error = ref<StatusError | null>(null);
|
||||
const originalSettings = ref<ISettings | null>(null);
|
||||
const settings = ref<ISettings | null>(null);
|
||||
const debounceTimeout = ref<number | null>(null);
|
||||
const pendingChunkSize = ref<string | null>(null);
|
||||
|
||||
const commandObject = ref<{
|
||||
[key: string]: string[] | string;
|
||||
@@ -289,13 +290,30 @@ const formattedChunkSize = computed({
|
||||
clearTimeout(debounceTimeout.value);
|
||||
}
|
||||
|
||||
pendingChunkSize.value = value;
|
||||
|
||||
// Set a new timeout to apply the format after a short delay
|
||||
debounceTimeout.value = window.setTimeout(() => {
|
||||
if (settings.value) settings.value.tus.chunkSize = parseBytes(value);
|
||||
}, 1500);
|
||||
debounceTimeout.value = window.setTimeout(applyChunkSize, 1500);
|
||||
},
|
||||
});
|
||||
|
||||
// applyChunkSize commits what the user typed. Saving must flush it first:
|
||||
// otherwise submitting within the debounce window persists the previous value,
|
||||
// and the setting appears to refuse the change.
|
||||
const applyChunkSize = () => {
|
||||
if (debounceTimeout.value) {
|
||||
clearTimeout(debounceTimeout.value);
|
||||
debounceTimeout.value = null;
|
||||
}
|
||||
|
||||
if (pendingChunkSize.value === null) return;
|
||||
|
||||
if (settings.value) {
|
||||
settings.value.tus.chunkSize = parseBytes(pendingChunkSize.value);
|
||||
}
|
||||
pendingChunkSize.value = null;
|
||||
};
|
||||
|
||||
// Define funcs
|
||||
const capitalize = (name: string, where: string | RegExp = "_") => {
|
||||
if (where === "caps") where = /(?=[A-Z])/;
|
||||
@@ -311,6 +329,7 @@ const capitalize = (name: string, where: string | RegExp = "_") => {
|
||||
|
||||
const save = async () => {
|
||||
if (settings.value === null) return false;
|
||||
applyChunkSize();
|
||||
const newSettings: ISettings = {
|
||||
...settings.value,
|
||||
shell:
|
||||
@@ -362,8 +381,12 @@ const parseBytes = (input: string) => {
|
||||
const matches = input.match(regex);
|
||||
if (matches) {
|
||||
const size = parseFloat(matches[1].concat(matches[2] || ""));
|
||||
let unit: keyof SettingsUnit =
|
||||
matches[3].toUpperCase() as keyof SettingsUnit;
|
||||
// The unit is optional: a bare number is already a count of bytes. Reading
|
||||
// it unguarded throws, and the throw happens inside the debounce callback,
|
||||
// so the setting is silently never updated.
|
||||
let unit: keyof SettingsUnit = (
|
||||
matches[3] ?? "B"
|
||||
).toUpperCase() as keyof SettingsUnit;
|
||||
if (!unit.endsWith("B")) {
|
||||
unit += "B";
|
||||
}
|
||||
|
||||
+34
-3
@@ -66,7 +66,7 @@ func (e extractor) ExtractToken(r *http.Request) (string, error) {
|
||||
return "", request.ErrNoTokenInRequest
|
||||
}
|
||||
|
||||
func renewableErr(err error, d *data) bool {
|
||||
func renewableErr(err error, r *http.Request, d *data, tk *authToken) bool {
|
||||
if d.settings.AuthMethod != fbAuth.MethodProxyAuth || err == nil {
|
||||
return false
|
||||
}
|
||||
@@ -79,7 +79,38 @@ func renewableErr(err error, d *data) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
// The expiration is only waived because the trusted proxy, not the token,
|
||||
// decides when the session ends. Require the proxy to still assert the same
|
||||
// identity on this request, otherwise a token that leaked before it expired
|
||||
// would authenticate on its own forever.
|
||||
return proxyAsserts(r, d, tk.User.ID)
|
||||
}
|
||||
|
||||
// proxyAsserts reports whether the proxy-auth header on r identifies the user
|
||||
// the token was issued for. The username is resolved through the user store, so
|
||||
// that it is matched exactly as a regular proxy login would match it.
|
||||
func proxyAsserts(r *http.Request, d *data, id uint) bool {
|
||||
auther, err := d.store.Auth.Get(fbAuth.MethodProxyAuth)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
proxy, ok := auther.(*fbAuth.ProxyAuth)
|
||||
if !ok || proxy.Header == "" {
|
||||
return false
|
||||
}
|
||||
|
||||
username := r.Header.Get(proxy.Header)
|
||||
if username == "" {
|
||||
return false
|
||||
}
|
||||
|
||||
user, err := d.store.Users.Get(d.server.Root, d.server.FollowExternalSymlinks, username)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return user.ID == id
|
||||
}
|
||||
|
||||
func withUser(fn handleFunc) handleFunc {
|
||||
@@ -91,7 +122,7 @@ func withUser(fn handleFunc) handleFunc {
|
||||
var tk authToken
|
||||
p := jwt.NewParser(jwt.WithValidMethods([]string{jwt.SigningMethodHS256.Alg()}), jwt.WithExpirationRequired())
|
||||
token, err := request.ParseFromRequest(r, &extractor{}, keyFunc, request.WithClaims(&tk), request.WithParser(p))
|
||||
if (err != nil || !token.Valid) && !renewableErr(err, d) {
|
||||
if (err != nil || !token.Valid) && !renewableErr(err, r, d, &tk) {
|
||||
return http.StatusUnauthorized, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -6,11 +6,15 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/asdine/storm/v3"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
|
||||
fbAuth "github.com/filebrowser/filebrowser/v2/auth"
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/filebrowser/filebrowser/v2/storage/bolt"
|
||||
"github.com/filebrowser/filebrowser/v2/users"
|
||||
)
|
||||
|
||||
// Regression for the username-normalization home-directory collision
|
||||
@@ -69,3 +73,79 @@ func TestSignupRejectsCollidingNormalizedScope(t *testing.T) {
|
||||
t.Fatalf("scope owner = %q, want teamone-x", owner.Username)
|
||||
}
|
||||
}
|
||||
|
||||
// Regression for GHSA-v3jv-rmh2-635j: under proxy auth with a non-default
|
||||
// logout page the JWT expiration is waived, because the proxy owns the session
|
||||
// lifetime. That exception used to apply to every route on the strength of the
|
||||
// token alone, so a token stolen before it expired kept working — and could be
|
||||
// renewed — indefinitely. The proxy must still assert the same identity.
|
||||
func TestExpiredTokenNeedsProxyAssertion(t *testing.T) {
|
||||
const proxyHeader = "X-Fb-User"
|
||||
|
||||
key := []byte("test-signing-key")
|
||||
perm := users.Permissions{Download: true}
|
||||
st := scopedUserStorage(t, t.TempDir(), perm, key)
|
||||
|
||||
if err := st.Settings.Save(&settings.Settings{
|
||||
Key: key,
|
||||
AuthMethod: fbAuth.MethodProxyAuth,
|
||||
LogoutPage: "/logged-out",
|
||||
}); err != nil {
|
||||
t.Fatalf("failed to save settings: %v", err)
|
||||
}
|
||||
if err := st.Auth.Save(&fbAuth.ProxyAuth{Header: proxyHeader}); err != nil {
|
||||
t.Fatalf("failed to save auther: %v", err)
|
||||
}
|
||||
|
||||
expired := &authToken{
|
||||
User: userInfo{ID: 1, Username: "u", Perm: perm},
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
IssuedAt: jwt.NewNumericDate(time.Now().Add(-2 * time.Hour)),
|
||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(-time.Hour)),
|
||||
},
|
||||
}
|
||||
expiredToken, err := jwt.NewWithClaims(jwt.SigningMethodHS256, expired).SignedString(key)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to sign token: %v", err)
|
||||
}
|
||||
|
||||
protected := withUser(func(w http.ResponseWriter, _ *http.Request, _ *data) (int, error) {
|
||||
_, writeErr := w.Write([]byte("protected"))
|
||||
return 0, writeErr
|
||||
})
|
||||
|
||||
get := func(token, proxyUser string) *httptest.ResponseRecorder {
|
||||
req, _ := http.NewRequest(http.MethodGet, "/", http.NoBody)
|
||||
req.Header.Set("X-Auth", token)
|
||||
if proxyUser != "" {
|
||||
req.Header.Set(proxyHeader, proxyUser)
|
||||
}
|
||||
rec := httptest.NewRecorder()
|
||||
handle(protected, "", st, &settings.Server{}).ServeHTTP(rec, req)
|
||||
return rec
|
||||
}
|
||||
|
||||
t.Run("expired token alone is rejected", func(t *testing.T) {
|
||||
if rec := get(expiredToken, ""); rec.Code != http.StatusUnauthorized {
|
||||
t.Errorf("VULNERABLE: expired token without the proxy header = %d, body=%q; want 401", rec.Code, rec.Body.String())
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("expired token for another identity is rejected", func(t *testing.T) {
|
||||
if rec := get(expiredToken, "someone-else"); rec.Code != http.StatusUnauthorized {
|
||||
t.Errorf("VULNERABLE: expired token with a foreign proxy identity = %d; want 401", rec.Code)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("expired token the proxy still asserts is accepted", func(t *testing.T) {
|
||||
if rec := get(expiredToken, "u"); rec.Code != http.StatusOK {
|
||||
t.Errorf("expired token asserted by the proxy = %d, body=%q; want 200", rec.Code, rec.Body.String())
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("valid token needs no assertion", func(t *testing.T) {
|
||||
if rec := get(signToken(t, perm, key), ""); rec.Code != http.StatusOK {
|
||||
t.Errorf("valid token = %d, body=%q; want 200", rec.Code, rec.Body.String())
|
||||
}
|
||||
})
|
||||
}
|
||||
+30
-16
@@ -35,25 +35,19 @@ type data struct {
|
||||
|
||||
// Check implements rules.Checker.
|
||||
func (d *data) Check(path string) bool {
|
||||
// Rules are written as "/"-separated virtual paths, but callers hand us
|
||||
// paths built by the OS as well as ones taken from the request: afero.Walk
|
||||
// and filepath.Join use "\" on Windows, where the filesystem also treats it
|
||||
// as a separator. Canonicalize first so the authorization decision does not
|
||||
// depend on which separator the caller happened to use.
|
||||
path = slashClean(path)
|
||||
|
||||
// When the filesystem has been rebased (e.g. a public share rooted at a
|
||||
// subdirectory), the incoming path is relative to that root. Resolve it
|
||||
// back to the user's original scope before matching rules, otherwise rules
|
||||
// targeting paths below the share root would be silently bypassed.
|
||||
if d.checkerPrefix != "" {
|
||||
path = gopath.Join(d.checkerPrefix, path)
|
||||
}
|
||||
|
||||
if d.user.HideDotfiles && rules.MatchHidden(path) {
|
||||
if d.user.HideDotfiles && rules.MatchHidden(d.rulePath(path)) {
|
||||
return false
|
||||
}
|
||||
|
||||
return d.CheckRules(path)
|
||||
}
|
||||
|
||||
// CheckRules reports whether the global and user rules allow path. Unlike
|
||||
// Check, it ignores HideDotfiles: hiding dotfiles is a display preference, so
|
||||
// it must not stop a user from operating on a tree that contains one.
|
||||
func (d *data) CheckRules(path string) bool {
|
||||
path = d.rulePath(path)
|
||||
|
||||
allow := true
|
||||
for _, rule := range d.settings.Rules {
|
||||
if rule.Matches(path, d.server.CaseInsensitiveFs) {
|
||||
@@ -70,6 +64,26 @@ func (d *data) Check(path string) bool {
|
||||
return allow
|
||||
}
|
||||
|
||||
// rulePath canonicalizes path into the form the rules are written in.
|
||||
func (d *data) rulePath(path string) string {
|
||||
// Rules are written as "/"-separated virtual paths, but callers hand us
|
||||
// paths built by the OS as well as ones taken from the request: afero.Walk
|
||||
// and filepath.Join use "\" on Windows, where the filesystem also treats it
|
||||
// as a separator. Canonicalize first so the authorization decision does not
|
||||
// depend on which separator the caller happened to use.
|
||||
path = slashClean(path)
|
||||
|
||||
// When the filesystem has been rebased (e.g. a public share rooted at a
|
||||
// subdirectory), the incoming path is relative to that root. Resolve it
|
||||
// back to the user's original scope before matching rules, otherwise rules
|
||||
// targeting paths below the share root would be silently bypassed.
|
||||
if d.checkerPrefix != "" {
|
||||
path = gopath.Join(d.checkerPrefix, path)
|
||||
}
|
||||
|
||||
return path
|
||||
}
|
||||
|
||||
func handle(fn handleFunc, prefix string, store *storage.Storage, server *settings.Server) http.Handler {
|
||||
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
for k, v := range globalHeaders {
|
||||
|
||||
@@ -103,6 +103,10 @@ func resourceDeleteHandler(fileCache FileCache) handleFunc {
|
||||
return errToStatus(err), err
|
||||
}
|
||||
|
||||
if err = checkDescendants(d, r.URL.Path, ""); err != nil {
|
||||
return errToStatus(err), err
|
||||
}
|
||||
|
||||
err = d.store.Share.DeleteWithPathPrefix(file.Path, d.user.ID)
|
||||
if err != nil {
|
||||
log.Printf("WARNING: Error(s) occurred while deleting associated shares with file: %s", err)
|
||||
@@ -259,6 +263,10 @@ func resourcePatchHandler(fileCache FileCache) handleFunc {
|
||||
}
|
||||
}
|
||||
|
||||
if err = checkDescendants(d, src, dst); err != nil {
|
||||
return errToStatus(err), err
|
||||
}
|
||||
|
||||
err = d.RunHook(func() error {
|
||||
return patchAction(r.Context(), action, src, dst, d, fileCache)
|
||||
}, action, src, dst, d.user)
|
||||
@@ -267,6 +275,42 @@ func resourcePatchHandler(fileCache FileCache) handleFunc {
|
||||
})
|
||||
}
|
||||
|
||||
// checkDescendants reports an error if the rules deny any path inside the src
|
||||
// tree or, when dst is not empty, the location that tree would land on. The
|
||||
// handlers only authorize the root of the operation, but copy, rename and
|
||||
// delete then recurse through the whole subtree, so a rule denying a descendant
|
||||
// of an allowed directory would be bypassed by operating on the parent instead.
|
||||
func checkDescendants(d *data, src, dst string) error {
|
||||
if len(d.settings.Rules) == 0 && len(d.user.Rules) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return afero.Walk(d.user.Fs, src, func(fPath string, _ os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !d.CheckRules(fPath) {
|
||||
return fberrors.ErrPermissionDenied
|
||||
}
|
||||
|
||||
if dst == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
rel, err := filepath.Rel(src, fPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !d.CheckRules(filepath.Join(dst, rel)) {
|
||||
return fberrors.ErrPermissionDenied
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func checkParent(src, dst string) error {
|
||||
rel, err := filepath.Rel(src, dst)
|
||||
if err != nil {
|
||||
@@ -412,6 +456,13 @@ var resourceGetRecursiveHandler = withUser(func(w http.ResponseWriter, r *http.R
|
||||
entries := make([]RecursiveEntry, 0)
|
||||
|
||||
err = afero.Walk(d.user.Fs, rootPath, func(fPath string, info os.FileInfo, err error) error {
|
||||
// Walking a large tree is expensive, and every entry is stat'ed through
|
||||
// the scoped filesystem. Stop as soon as nobody is waiting for the
|
||||
// answer instead of finishing the walk for a client that has gone.
|
||||
if ctxErr := r.Context().Err(); ctxErr != nil {
|
||||
return ctxErr
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil // skip entries we cannot read
|
||||
}
|
||||
@@ -442,6 +493,12 @@ var resourceGetRecursiveHandler = withUser(func(w http.ResponseWriter, r *http.R
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
// Once the request is done there is nobody left to answer, whatever the
|
||||
// walk reported. Asking for a status here only produces a second header
|
||||
// write on a connection that is already gone.
|
||||
if r.Context().Err() != nil {
|
||||
return 0, err
|
||||
}
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package fbhttp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/filebrowser/filebrowser/v2/users"
|
||||
)
|
||||
|
||||
func recursiveTestHandler(t *testing.T, userScope string) (http.Handler, string) {
|
||||
t.Helper()
|
||||
|
||||
key := []byte("test-signing-key")
|
||||
perm := users.Permissions{Create: true, Modify: true, Download: true}
|
||||
st := scopedUserStorage(t, userScope, perm, key)
|
||||
|
||||
return handle(resourceGetRecursiveHandler, "/api/resources/recursive", st, &settings.Server{}), signToken(t, perm, key)
|
||||
}
|
||||
|
||||
func TestResourceRecursiveListsTree(t *testing.T) {
|
||||
userScope := t.TempDir()
|
||||
if err := os.MkdirAll(filepath.Join(userScope, "target", "nested"), 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(userScope, "target", "nested", "file.txt"), []byte("hi"), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
handler, token := recursiveTestHandler(t, userScope)
|
||||
|
||||
req, _ := http.NewRequest(http.MethodGet, "/api/resources/recursive/target", http.NoBody)
|
||||
req.Header.Set("X-Auth", token)
|
||||
rec := httptest.NewRecorder()
|
||||
handler.ServeHTTP(rec, req)
|
||||
|
||||
if rec.Code != http.StatusOK {
|
||||
t.Fatalf("status = %d body = %q", rec.Code, rec.Body.String())
|
||||
}
|
||||
|
||||
var entries []RecursiveEntry
|
||||
if err := json.Unmarshal(rec.Body.Bytes(), &entries); err != nil {
|
||||
t.Fatalf("decode response: %v", err)
|
||||
}
|
||||
if len(entries) != 2 {
|
||||
t.Fatalf("got %d entries, want 2: %+v", len(entries), entries)
|
||||
}
|
||||
}
|
||||
|
||||
// Walking the tree stats every entry through the scoped filesystem, which is
|
||||
// expensive on a large destination. When the client has already hung up there
|
||||
// is nothing to answer, so the walk must stop instead of running to completion
|
||||
// and then reporting a write failure as a 500.
|
||||
func TestResourceRecursiveStopsWhenClientDisconnects(t *testing.T) {
|
||||
userScope := t.TempDir()
|
||||
if err := os.MkdirAll(filepath.Join(userScope, "target"), 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(userScope, "target", "file.txt"), []byte("hi"), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
handler, token := recursiveTestHandler(t, userScope)
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel()
|
||||
|
||||
req, _ := http.NewRequestWithContext(ctx, http.MethodGet, "/api/resources/recursive/target", http.NoBody)
|
||||
req.Header.Set("X-Auth", token)
|
||||
rec := httptest.NewRecorder()
|
||||
handler.ServeHTTP(rec, req)
|
||||
|
||||
if body := rec.Body.String(); body != "" {
|
||||
t.Fatalf("wrote a response for a disconnected client: %q", body)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package fbhttp
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/filebrowser/filebrowser/v2/diskcache"
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/filebrowser/filebrowser/v2/storage"
|
||||
"github.com/filebrowser/filebrowser/v2/users"
|
||||
)
|
||||
|
||||
// Regression for GHSA-77x8-73f4-5485: copy, rename and delete authorize only
|
||||
// the root of the operation and then recurse through the whole subtree, so a
|
||||
// rule denying /src/secret used to be bypassed by copying, moving or deleting
|
||||
// the allowed parent /src.
|
||||
func TestRecursiveOperationsEnforceDescendantRules(t *testing.T) {
|
||||
key := []byte("test-signing-key")
|
||||
perm := users.Permissions{Create: true, Modify: true, Rename: true, Delete: true, Download: true}
|
||||
|
||||
// scope builds a user scope holding an allowed parent with a denied child,
|
||||
// plus an entirely allowed tree to prove legitimate operations still run.
|
||||
scope := func(t *testing.T) (userScope string, st *storage.Storage) {
|
||||
t.Helper()
|
||||
userScope = t.TempDir()
|
||||
for _, dir := range []string{filepath.Join("src", "secret"), "clean"} {
|
||||
if err := os.MkdirAll(filepath.Join(userScope, dir), 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
files := map[string]string{
|
||||
filepath.Join("src", "public.txt"): "public",
|
||||
filepath.Join("src", "secret", "marker.txt"): "SECRET",
|
||||
filepath.Join("clean", "file.txt"): "clean",
|
||||
}
|
||||
for name, content := range files {
|
||||
if err := os.WriteFile(filepath.Join(userScope, name), []byte(content), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
return userScope, denyRuleStorage(t, userScope, "/src/secret", perm, key)
|
||||
}
|
||||
|
||||
do := func(t *testing.T, st *storage.Storage, handler handleFunc, method, target string) *httptest.ResponseRecorder {
|
||||
t.Helper()
|
||||
req, _ := http.NewRequest(method, target, http.NoBody)
|
||||
req.Header.Set("X-Auth", signToken(t, perm, key))
|
||||
rec := httptest.NewRecorder()
|
||||
handle(handler, "", st, &settings.Server{}).ServeHTTP(rec, req)
|
||||
return rec
|
||||
}
|
||||
|
||||
exists := func(t *testing.T, path string) bool {
|
||||
t.Helper()
|
||||
_, err := os.Stat(path)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
t.Run("denied descendant is not directly readable", func(t *testing.T) {
|
||||
_, st := scope(t)
|
||||
if rec := do(t, st, rawHandler, http.MethodGet, "/src/secret/marker.txt"); rec.Code != http.StatusForbidden {
|
||||
t.Fatalf("GET /src/secret/marker.txt = %d; want 403", rec.Code)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("copying the parent does not expose it", func(t *testing.T) {
|
||||
userScope, st := scope(t)
|
||||
rec := do(t, st, resourcePatchHandler(diskcache.NewNoOp()), http.MethodPatch, "/src?action=copy&destination=/dst")
|
||||
|
||||
if leaked := filepath.Join(userScope, "dst", "secret", "marker.txt"); exists(t, leaked) {
|
||||
t.Fatalf("VULNERABLE: denied descendant copied to %s (status %d)", leaked, rec.Code)
|
||||
}
|
||||
if rec.Code != http.StatusForbidden {
|
||||
t.Errorf("PATCH /src?action=copy = %d; want 403", rec.Code)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("renaming the parent does not expose it", func(t *testing.T) {
|
||||
userScope, st := scope(t)
|
||||
rec := do(t, st, resourcePatchHandler(diskcache.NewNoOp()), http.MethodPatch, "/src?action=rename&destination=/moved")
|
||||
|
||||
if leaked := filepath.Join(userScope, "moved", "secret", "marker.txt"); exists(t, leaked) {
|
||||
t.Fatalf("VULNERABLE: denied descendant moved to %s (status %d)", leaked, rec.Code)
|
||||
}
|
||||
if !exists(t, filepath.Join(userScope, "src", "secret", "marker.txt")) {
|
||||
t.Error("denied descendant no longer at its original path")
|
||||
}
|
||||
if rec.Code != http.StatusForbidden {
|
||||
t.Errorf("PATCH /src?action=rename = %d; want 403", rec.Code)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("deleting the parent does not delete it", func(t *testing.T) {
|
||||
userScope, st := scope(t)
|
||||
rec := do(t, st, resourceDeleteHandler(diskcache.NewNoOp()), http.MethodDelete, "/src")
|
||||
|
||||
if !exists(t, filepath.Join(userScope, "src", "secret", "marker.txt")) {
|
||||
t.Fatalf("VULNERABLE: denied descendant deleted through its parent (status %d)", rec.Code)
|
||||
}
|
||||
if rec.Code != http.StatusForbidden {
|
||||
t.Errorf("DELETE /src = %d; want 403", rec.Code)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("an entirely allowed tree still copies", func(t *testing.T) {
|
||||
userScope, st := scope(t)
|
||||
rec := do(t, st, resourcePatchHandler(diskcache.NewNoOp()), http.MethodPatch, "/clean?action=copy&destination=/clean-copy")
|
||||
|
||||
if rec.Code != http.StatusOK {
|
||||
t.Fatalf("PATCH /clean?action=copy = %d, body=%q; want 200", rec.Code, rec.Body.String())
|
||||
}
|
||||
if !exists(t, filepath.Join(userScope, "clean-copy", "file.txt")) {
|
||||
t.Error("allowed tree was not copied")
|
||||
}
|
||||
})
|
||||
}
|
||||
+129
-97
@@ -15,6 +15,24 @@ import (
|
||||
"github.com/spf13/afero"
|
||||
)
|
||||
|
||||
// maxPatchDrainBytes bounds how much of a rejected PATCH body is discarded to
|
||||
// keep the connection reusable. It comfortably covers a default-sized chunk;
|
||||
// beyond that the body is not worth reading just to throw away.
|
||||
const maxPatchDrainBytes = 32 << 20 // 32MB
|
||||
|
||||
// drainRequestBody discards what the client already put on the wire for a
|
||||
// request the handler answered without reading. net/http only drains 256KiB on
|
||||
// its own before giving up and closing the connection, and a connection closed
|
||||
// while the client is still streaming a chunk reaches the browser as a transport
|
||||
// error instead of the status we replied with. The client then cannot tell a
|
||||
// conflict from a network fault, retries blindly, and the upload stalls.
|
||||
func drainRequestBody(r *http.Request) {
|
||||
if r.Body == nil {
|
||||
return
|
||||
}
|
||||
_, _ = io.Copy(io.Discard, io.LimitReader(r.Body, maxPatchDrainBytes))
|
||||
}
|
||||
|
||||
// keepUploadActive periodically touches the cache entry to prevent eviction during transfer
|
||||
func keepUploadActive(cache UploadCache, filePath string) func() {
|
||||
stop := make(chan bool)
|
||||
@@ -160,107 +178,121 @@ func tusHeadHandler(cache UploadCache) handleFunc {
|
||||
|
||||
func tusPatchHandler(cache UploadCache) handleFunc {
|
||||
return withUser(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {
|
||||
if !d.user.Perm.Create || !d.Check(r.URL.Path) {
|
||||
return http.StatusForbidden, nil
|
||||
status, err := tusPatchUpload(w, r, d, cache)
|
||||
// A rejected chunk is still a chunk the client is streaming: read what is
|
||||
// left of it so the answer reaches the client on a connection that stays
|
||||
// usable, instead of being lost to a reset.
|
||||
if status >= 400 {
|
||||
drainRequestBody(r)
|
||||
}
|
||||
if r.Header.Get("Content-Type") != "application/offset+octet-stream" {
|
||||
return http.StatusUnsupportedMediaType, nil
|
||||
}
|
||||
|
||||
uploadOffset, err := getUploadOffset(r)
|
||||
if err != nil {
|
||||
return http.StatusBadRequest, fmt.Errorf("invalid upload offset")
|
||||
}
|
||||
|
||||
file, err := files.NewFileInfo(&files.FileOptions{
|
||||
Fs: d.user.Fs,
|
||||
Path: r.URL.Path,
|
||||
Modify: d.user.Perm.Modify,
|
||||
Expand: false,
|
||||
ReadHeader: d.server.TypeDetectionByHeader,
|
||||
Checker: d,
|
||||
})
|
||||
|
||||
switch {
|
||||
case errors.Is(err, afero.ErrFileNotFound):
|
||||
return http.StatusNotFound, nil
|
||||
case err != nil:
|
||||
return errToStatus(err), err
|
||||
}
|
||||
|
||||
uploadLength, err := cache.GetLength(file.RealPath())
|
||||
if err != nil {
|
||||
return http.StatusNotFound, err
|
||||
}
|
||||
|
||||
if uploadOffset > uploadLength {
|
||||
return http.StatusBadRequest, fmt.Errorf("upload offset %d exceeds declared length %d", uploadOffset, uploadLength)
|
||||
}
|
||||
|
||||
// Prevent the upload from being evicted during the transfer
|
||||
stop := keepUploadActive(cache, file.RealPath())
|
||||
defer stop()
|
||||
|
||||
switch {
|
||||
case file.IsDir:
|
||||
return http.StatusBadRequest, fmt.Errorf("cannot upload to a directory %s", file.RealPath())
|
||||
case file.Size != uploadOffset:
|
||||
return http.StatusConflict, fmt.Errorf(
|
||||
"%s file size doesn't match the provided offset: %d",
|
||||
file.RealPath(),
|
||||
uploadOffset,
|
||||
)
|
||||
}
|
||||
|
||||
openFile, err := d.user.Fs.OpenFile(r.URL.Path, os.O_WRONLY|os.O_APPEND, d.settings.FileMode)
|
||||
if err != nil {
|
||||
return http.StatusInternalServerError, fmt.Errorf("could not open file: %w", err)
|
||||
}
|
||||
defer openFile.Close()
|
||||
|
||||
_, err = openFile.Seek(uploadOffset, 0)
|
||||
if err != nil {
|
||||
return http.StatusInternalServerError, fmt.Errorf("could not seek file: %w", err)
|
||||
}
|
||||
|
||||
defer r.Body.Close()
|
||||
// Enforce the declared Upload-Length: never write more than the bytes
|
||||
// still expected for this upload. Reading one byte past the remainder
|
||||
// lets an over-length body be detected and rejected. Without this bound a
|
||||
// PATCH could stream arbitrary data to disk regardless of the length the
|
||||
// client declared when the upload was created.
|
||||
remaining := uploadLength - uploadOffset
|
||||
bytesWritten, err := io.Copy(openFile, io.LimitReader(r.Body, remaining+1))
|
||||
if err != nil {
|
||||
return http.StatusInternalServerError, fmt.Errorf("could not write to file: %w", err)
|
||||
}
|
||||
if bytesWritten > remaining {
|
||||
// The client sent more than it declared; roll this chunk back so the
|
||||
// file stays consistent with the tracked offset, and reject it.
|
||||
if truncErr := openFile.Truncate(uploadOffset); truncErr != nil {
|
||||
return http.StatusInternalServerError, fmt.Errorf("could not truncate file: %w", truncErr)
|
||||
}
|
||||
return http.StatusRequestEntityTooLarge, fmt.Errorf("upload exceeds declared length of %d bytes", uploadLength)
|
||||
}
|
||||
|
||||
// Sync the file to ensure all data is written to storage
|
||||
// to prevent file corruption.
|
||||
if err := openFile.Sync(); err != nil {
|
||||
return http.StatusInternalServerError, fmt.Errorf("could not sync file: %w", err)
|
||||
}
|
||||
|
||||
newOffset := uploadOffset + bytesWritten
|
||||
w.Header().Set("Upload-Offset", strconv.FormatInt(newOffset, 10))
|
||||
|
||||
if newOffset >= uploadLength {
|
||||
cache.Complete(file.RealPath())
|
||||
_ = d.RunHook(func() error { return nil }, "upload", r.URL.Path, "", d.user)
|
||||
}
|
||||
|
||||
return http.StatusNoContent, nil
|
||||
return status, err
|
||||
})
|
||||
}
|
||||
|
||||
func tusPatchUpload(w http.ResponseWriter, r *http.Request, d *data, cache UploadCache) (int, error) {
|
||||
if !d.user.Perm.Create || !d.Check(r.URL.Path) {
|
||||
return http.StatusForbidden, nil
|
||||
}
|
||||
if r.Header.Get("Content-Type") != "application/offset+octet-stream" {
|
||||
return http.StatusUnsupportedMediaType, nil
|
||||
}
|
||||
|
||||
uploadOffset, err := getUploadOffset(r)
|
||||
if err != nil {
|
||||
return http.StatusBadRequest, fmt.Errorf("invalid upload offset")
|
||||
}
|
||||
|
||||
file, err := files.NewFileInfo(&files.FileOptions{
|
||||
Fs: d.user.Fs,
|
||||
Path: r.URL.Path,
|
||||
Modify: d.user.Perm.Modify,
|
||||
Expand: false,
|
||||
ReadHeader: d.server.TypeDetectionByHeader,
|
||||
Checker: d,
|
||||
})
|
||||
|
||||
switch {
|
||||
case errors.Is(err, afero.ErrFileNotFound):
|
||||
return http.StatusNotFound, nil
|
||||
case err != nil:
|
||||
return errToStatus(err), err
|
||||
}
|
||||
|
||||
uploadLength, err := cache.GetLength(file.RealPath())
|
||||
if err != nil {
|
||||
return http.StatusNotFound, err
|
||||
}
|
||||
|
||||
if uploadOffset > uploadLength {
|
||||
return http.StatusBadRequest, fmt.Errorf("upload offset %d exceeds declared length %d", uploadOffset, uploadLength)
|
||||
}
|
||||
|
||||
// Prevent the upload from being evicted during the transfer
|
||||
stop := keepUploadActive(cache, file.RealPath())
|
||||
defer stop()
|
||||
|
||||
switch {
|
||||
case file.IsDir:
|
||||
return http.StatusBadRequest, fmt.Errorf("cannot upload to a directory %s", file.RealPath())
|
||||
case file.Size != uploadOffset:
|
||||
return http.StatusConflict, fmt.Errorf(
|
||||
"%s file size doesn't match the provided offset: %d",
|
||||
file.RealPath(),
|
||||
uploadOffset,
|
||||
)
|
||||
}
|
||||
|
||||
openFile, err := d.user.Fs.OpenFile(r.URL.Path, os.O_WRONLY|os.O_APPEND, d.settings.FileMode)
|
||||
if err != nil {
|
||||
return http.StatusInternalServerError, fmt.Errorf("could not open file: %w", err)
|
||||
}
|
||||
defer openFile.Close()
|
||||
|
||||
_, err = openFile.Seek(uploadOffset, 0)
|
||||
if err != nil {
|
||||
return http.StatusInternalServerError, fmt.Errorf("could not seek file: %w", err)
|
||||
}
|
||||
|
||||
// The server closes the request body once the handler returns; closing it
|
||||
// here would run before the caller gets to drain a rejected chunk, so every
|
||||
// status raised below this point would still cost the connection.
|
||||
//
|
||||
// Enforce the declared Upload-Length: never write more than the bytes
|
||||
// still expected for this upload. Reading one byte past the remainder
|
||||
// lets an over-length body be detected and rejected. Without this bound a
|
||||
// PATCH could stream arbitrary data to disk regardless of the length the
|
||||
// client declared when the upload was created.
|
||||
remaining := uploadLength - uploadOffset
|
||||
bytesWritten, err := io.Copy(openFile, io.LimitReader(r.Body, remaining+1))
|
||||
if err != nil {
|
||||
return http.StatusInternalServerError, fmt.Errorf("could not write to file: %w", err)
|
||||
}
|
||||
if bytesWritten > remaining {
|
||||
// The client sent more than it declared; roll this chunk back so the
|
||||
// file stays consistent with the tracked offset, and reject it.
|
||||
if truncErr := openFile.Truncate(uploadOffset); truncErr != nil {
|
||||
return http.StatusInternalServerError, fmt.Errorf("could not truncate file: %w", truncErr)
|
||||
}
|
||||
return http.StatusRequestEntityTooLarge, fmt.Errorf("upload exceeds declared length of %d bytes", uploadLength)
|
||||
}
|
||||
|
||||
// Sync the file to ensure all data is written to storage
|
||||
// to prevent file corruption.
|
||||
if err := openFile.Sync(); err != nil {
|
||||
return http.StatusInternalServerError, fmt.Errorf("could not sync file: %w", err)
|
||||
}
|
||||
|
||||
newOffset := uploadOffset + bytesWritten
|
||||
w.Header().Set("Upload-Offset", strconv.FormatInt(newOffset, 10))
|
||||
|
||||
if newOffset >= uploadLength {
|
||||
cache.Complete(file.RealPath())
|
||||
_ = d.RunHook(func() error { return nil }, "upload", r.URL.Path, "", d.user)
|
||||
}
|
||||
|
||||
return http.StatusNoContent, nil
|
||||
}
|
||||
|
||||
func tusDeleteHandler(cache UploadCache) handleFunc {
|
||||
return withUser(func(_ http.ResponseWriter, r *http.Request, d *data) (int, error) {
|
||||
if r.URL.Path == "/" || !d.user.Perm.Delete {
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
package fbhttp
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/http/httptrace"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/filebrowser/filebrowser/v2/storage"
|
||||
"github.com/filebrowser/filebrowser/v2/users"
|
||||
)
|
||||
|
||||
// newTusTestServer mounts the TUS handlers behind a real HTTP server, under the
|
||||
// same "/api/tus" prefix used in production, so tests exercise connection
|
||||
// handling and header round-tripping instead of a bare ResponseRecorder.
|
||||
func newTusTestServer(t *testing.T, st *storage.Storage, cache UploadCache) *httptest.Server {
|
||||
t.Helper()
|
||||
|
||||
server := &settings.Server{}
|
||||
post := handle(tusPostHandler(cache), "/api/tus", st, server)
|
||||
head := handle(tusHeadHandler(cache), "/api/tus", st, server)
|
||||
patch := handle(tusPatchHandler(cache), "/api/tus", st, server)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/api/tus/", func(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.Method {
|
||||
case http.MethodPost:
|
||||
post.ServeHTTP(w, r)
|
||||
case http.MethodHead:
|
||||
head.ServeHTTP(w, r)
|
||||
case http.MethodPatch:
|
||||
patch.ServeHTTP(w, r)
|
||||
default:
|
||||
w.WriteHeader(http.StatusMethodNotAllowed)
|
||||
}
|
||||
})
|
||||
|
||||
srv := httptest.NewServer(mux)
|
||||
t.Cleanup(srv.Close)
|
||||
return srv
|
||||
}
|
||||
|
||||
// tusTestFixture wires a scoped user, an upload cache and a live server.
|
||||
type tusTestFixture struct {
|
||||
srv *httptest.Server
|
||||
client *http.Client
|
||||
token string
|
||||
scope string
|
||||
}
|
||||
|
||||
func newTusTestFixture(t *testing.T) *tusTestFixture {
|
||||
t.Helper()
|
||||
|
||||
root := t.TempDir()
|
||||
userScope := filepath.Join(root, "user")
|
||||
if err := os.MkdirAll(userScope, 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
key := []byte("test-signing-key")
|
||||
perm := users.Permissions{Create: true, Modify: true}
|
||||
st := scopedUserStorage(t, userScope, perm, key)
|
||||
|
||||
cache := newMemoryUploadCache()
|
||||
t.Cleanup(cache.Close)
|
||||
|
||||
srv := newTusTestServer(t, st, cache)
|
||||
return &tusTestFixture{
|
||||
srv: srv,
|
||||
client: srv.Client(),
|
||||
token: signToken(t, perm, key),
|
||||
scope: userScope,
|
||||
}
|
||||
}
|
||||
|
||||
// create sends the TUS creation request and returns the absolute upload URL.
|
||||
func (f *tusTestFixture) create(t *testing.T, name string, length int) string {
|
||||
t.Helper()
|
||||
|
||||
req, err := http.NewRequest(http.MethodPost, f.srv.URL+"/api/tus/"+name+"?override=false", http.NoBody)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
req.Header.Set("X-Auth", f.token)
|
||||
req.Header.Set("Upload-Length", strconv.Itoa(length))
|
||||
|
||||
res, err := f.client.Do(req)
|
||||
if err != nil {
|
||||
t.Fatalf("POST create: %v", err)
|
||||
}
|
||||
defer res.Body.Close()
|
||||
body, _ := io.ReadAll(res.Body)
|
||||
|
||||
if res.StatusCode != http.StatusCreated {
|
||||
t.Fatalf("POST create: status %d body %q", res.StatusCode, body)
|
||||
}
|
||||
location := res.Header.Get("Location")
|
||||
if location == "" {
|
||||
t.Fatal("POST create: missing Location header")
|
||||
}
|
||||
return f.srv.URL + location
|
||||
}
|
||||
|
||||
// patch sends one chunk and reports the response plus whether the underlying
|
||||
// connection was reused from the pool.
|
||||
func (f *tusTestFixture) patch(t *testing.T, url string, offset int, chunk []byte) (*http.Response, bool) {
|
||||
t.Helper()
|
||||
|
||||
req, err := http.NewRequest(http.MethodPatch, url, bytes.NewReader(chunk))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
req.Header.Set("X-Auth", f.token)
|
||||
req.Header.Set("Content-Type", "application/offset+octet-stream")
|
||||
req.Header.Set("Upload-Offset", strconv.Itoa(offset))
|
||||
|
||||
var reused bool
|
||||
trace := &httptrace.ClientTrace{
|
||||
GotConn: func(info httptrace.GotConnInfo) { reused = info.Reused },
|
||||
}
|
||||
req = req.WithContext(httptrace.WithClientTrace(req.Context(), trace))
|
||||
|
||||
res, err := f.client.Do(req)
|
||||
if err != nil {
|
||||
t.Fatalf("PATCH at offset %d: %v", offset, err)
|
||||
}
|
||||
return res, reused
|
||||
}
|
||||
|
||||
func testPayload(size int) []byte {
|
||||
payload := make([]byte, size)
|
||||
for i := range payload {
|
||||
payload[i] = byte(i % 251)
|
||||
}
|
||||
return payload
|
||||
}
|
||||
|
||||
// A file larger than the chunk size must upload across several PATCH requests
|
||||
// over a single reused connection, exactly as the web UI drives it. Each chunk
|
||||
// has to be acknowledged with 204 and the new Upload-Offset, and the resulting
|
||||
// file must be byte-identical to the source.
|
||||
func TestTusMultiChunkUpload(t *testing.T) {
|
||||
const chunkSize = 64 * 1024
|
||||
const fileSize = chunkSize*3 + 1234
|
||||
|
||||
f := newTusTestFixture(t)
|
||||
payload := testPayload(fileSize)
|
||||
uploadURL := f.create(t, "movie.bin", fileSize)
|
||||
|
||||
for offset := 0; offset < fileSize; {
|
||||
end := min(offset+chunkSize, fileSize)
|
||||
|
||||
res, _ := f.patch(t, uploadURL, offset, payload[offset:end])
|
||||
body, _ := io.ReadAll(res.Body)
|
||||
res.Body.Close()
|
||||
|
||||
if res.StatusCode != http.StatusNoContent {
|
||||
t.Fatalf("PATCH at offset %d: status %d body %q", offset, res.StatusCode, body)
|
||||
}
|
||||
if got, want := res.Header.Get("Upload-Offset"), strconv.Itoa(end); got != want {
|
||||
t.Fatalf("PATCH at offset %d: Upload-Offset = %q, want %q", offset, got, want)
|
||||
}
|
||||
|
||||
offset = end
|
||||
}
|
||||
|
||||
got, err := os.ReadFile(filepath.Join(f.scope, "movie.bin"))
|
||||
if err != nil {
|
||||
t.Fatalf("read uploaded file: %v", err)
|
||||
}
|
||||
if !bytes.Equal(got, payload) {
|
||||
t.Fatalf("uploaded file differs from source (got %d bytes, want %d)", len(got), len(payload))
|
||||
}
|
||||
}
|
||||
|
||||
// Between chunks a client may re-synchronise with a HEAD request. It must
|
||||
// report the bytes already on disk plus the declared total, so the client can
|
||||
// resume from the right offset.
|
||||
func TestTusHeadReportsOffsetBetweenChunks(t *testing.T) {
|
||||
const chunkSize = 32 * 1024
|
||||
const fileSize = chunkSize * 2
|
||||
|
||||
f := newTusTestFixture(t)
|
||||
payload := testPayload(fileSize)
|
||||
uploadURL := f.create(t, "resume.bin", fileSize)
|
||||
|
||||
res, _ := f.patch(t, uploadURL, 0, payload[:chunkSize])
|
||||
res.Body.Close()
|
||||
if res.StatusCode != http.StatusNoContent {
|
||||
t.Fatalf("first PATCH: status %d", res.StatusCode)
|
||||
}
|
||||
|
||||
req, err := http.NewRequest(http.MethodHead, uploadURL, http.NoBody)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
req.Header.Set("X-Auth", f.token)
|
||||
|
||||
headRes, err := f.client.Do(req)
|
||||
if err != nil {
|
||||
t.Fatalf("HEAD: %v", err)
|
||||
}
|
||||
defer headRes.Body.Close()
|
||||
|
||||
if headRes.StatusCode != http.StatusOK {
|
||||
t.Fatalf("HEAD: status %d", headRes.StatusCode)
|
||||
}
|
||||
if got, want := headRes.Header.Get("Upload-Offset"), strconv.Itoa(chunkSize); got != want {
|
||||
t.Fatalf("HEAD Upload-Offset = %q, want %q", got, want)
|
||||
}
|
||||
if got, want := headRes.Header.Get("Upload-Length"), strconv.Itoa(fileSize); got != want {
|
||||
t.Fatalf("HEAD Upload-Length = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
// A PATCH that the handler rejects before reading the body must still leave the
|
||||
// connection usable. Go abandons draining an unread request body after 256 KiB
|
||||
// and then closes the socket, which turns a plain 409 into an opaque transport
|
||||
// error for the client and stalls the upload. Rejecting a chunk-sized body must
|
||||
// not cost the connection.
|
||||
func TestTusPatchRejectionKeepsConnectionUsable(t *testing.T) {
|
||||
const chunkSize = 1024 * 1024
|
||||
const fileSize = chunkSize * 2
|
||||
|
||||
f := newTusTestFixture(t)
|
||||
payload := testPayload(fileSize)
|
||||
uploadURL := f.create(t, "conflict.bin", fileSize)
|
||||
|
||||
// Land the first chunk so the file size no longer matches offset 0.
|
||||
res, _ := f.patch(t, uploadURL, 0, payload[:chunkSize])
|
||||
res.Body.Close()
|
||||
if res.StatusCode != http.StatusNoContent {
|
||||
t.Fatalf("first PATCH: status %d", res.StatusCode)
|
||||
}
|
||||
|
||||
// Replaying offset 0 with a full chunk must be answered with a real 409.
|
||||
res, _ = f.patch(t, uploadURL, 0, payload[:chunkSize])
|
||||
body, _ := io.ReadAll(res.Body)
|
||||
res.Body.Close()
|
||||
if res.StatusCode != http.StatusConflict {
|
||||
t.Fatalf("stale-offset PATCH: status %d body %q, want 409", res.StatusCode, body)
|
||||
}
|
||||
|
||||
// And the connection must survive it, so the client's next attempt is not
|
||||
// reported as a network failure.
|
||||
res, reused := f.patch(t, uploadURL, chunkSize, payload[chunkSize:])
|
||||
body, _ = io.ReadAll(res.Body)
|
||||
res.Body.Close()
|
||||
if res.StatusCode != http.StatusNoContent {
|
||||
t.Fatalf("PATCH after rejection: status %d body %q", res.StatusCode, body)
|
||||
}
|
||||
if !reused {
|
||||
t.Fatal("connection was dropped by the rejected PATCH instead of being reused")
|
||||
}
|
||||
|
||||
got, err := os.ReadFile(filepath.Join(f.scope, "conflict.bin"))
|
||||
if err != nil {
|
||||
t.Fatalf("read uploaded file: %v", err)
|
||||
}
|
||||
if !bytes.Equal(got, payload) {
|
||||
t.Fatalf("uploaded file differs from source (got %d bytes, want %d)", len(got), len(payload))
|
||||
}
|
||||
}
|
||||
|
||||
// Same requirement for a rejection raised once the write is already underway:
|
||||
// an over-length body is refused after part of it has been read, and the rest
|
||||
// still has to be drained for the answer to survive.
|
||||
func TestTusOverLengthPatchKeepsConnectionUsable(t *testing.T) {
|
||||
const declared = 1024
|
||||
|
||||
f := newTusTestFixture(t)
|
||||
payload := testPayload(4 << 20)
|
||||
uploadURL := f.create(t, "toolong.bin", declared)
|
||||
|
||||
res, _ := f.patch(t, uploadURL, 0, payload)
|
||||
body, _ := io.ReadAll(res.Body)
|
||||
res.Body.Close()
|
||||
if res.StatusCode != http.StatusRequestEntityTooLarge {
|
||||
t.Fatalf("over-length PATCH: status %d body %q, want 413", res.StatusCode, body)
|
||||
}
|
||||
|
||||
res, reused := f.patch(t, uploadURL, 0, payload[:declared])
|
||||
body, _ = io.ReadAll(res.Body)
|
||||
res.Body.Close()
|
||||
if res.StatusCode != http.StatusNoContent {
|
||||
t.Fatalf("PATCH after rejection: status %d body %q", res.StatusCode, body)
|
||||
}
|
||||
if !reused {
|
||||
t.Fatal("connection was dropped by the over-length PATCH instead of being reused")
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -65,7 +65,10 @@ func renderJSON(w http.ResponseWriter, _ *http.Request, data interface{}) (int,
|
||||
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
if _, err := w.Write(marsh); err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
// The status line is already on the wire, so there is no error status
|
||||
// left to send: a failed write here means the client hung up. Report it
|
||||
// for the log without asking the caller to write a second header.
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return 0, nil
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended",
|
||||
"group:allNonMajor",
|
||||
"group:allDigest",
|
||||
":disableDependencyDashboard",
|
||||
":disableMajorUpdates",
|
||||
":semanticCommitTypeAll(chore)"
|
||||
],
|
||||
"postUpdateOptions": [
|
||||
"gomodUpdateImportPaths",
|
||||
"gomodTidy"
|
||||
],
|
||||
"schedule": "* * * * 0,6"
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
docs/LICENSE
|
||||
docs/code-of-conduct.md
|
||||
docs/contributing.md
|
||||
docs/security.md
|
||||
docs/changelog.md
|
||||
public
|
||||
@@ -1,4 +0,0 @@
|
||||
FROM squidfunk/mkdocs-material
|
||||
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
@@ -1,59 +0,0 @@
|
||||
<style>
|
||||
.md-content .md-typeset h1 {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/filebrowser/filebrowser/master/branding/banner.png" width="550"/>
|
||||
</p>
|
||||
|
||||
> [!WARNING]
|
||||
>
|
||||
> This project is on **maintenance-only** mode. For more information, read the information on [GitHub](https://github.com/filebrowser/filebrowser#project-status).
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||
## Features
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- **Easy Login System**
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
- **Sleek Interface**
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
- **User Management**
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
- **File Editing**
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
- **Custom Commands**
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
- **Customization**
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
-140
@@ -1,140 +0,0 @@
|
||||
site_name: File Browser
|
||||
site_description: 'A web-based file browser and manager for your files'
|
||||
site_author: 'File Browser Contributors'
|
||||
site_url: 'https://filebrowser.org'
|
||||
|
||||
repo_name: 'filebrowser/filebrowser'
|
||||
repo_url: 'https://github.com/filebrowser/filebrowser'
|
||||
|
||||
copyright: 'Copyright © 2025 File Browser Contributors'
|
||||
|
||||
theme:
|
||||
name: material
|
||||
language: en
|
||||
logo: static/logo.png
|
||||
favicon: static/favicon.png
|
||||
palette:
|
||||
- scheme: default
|
||||
primary: blue
|
||||
accent: light blue
|
||||
toggle:
|
||||
icon: material/lightbulb
|
||||
name: Switch to dark mode
|
||||
- scheme: slate
|
||||
primary: blue
|
||||
accent: light blue
|
||||
toggle:
|
||||
icon: material/lightbulb-outline
|
||||
name: Switch to light mode
|
||||
|
||||
font:
|
||||
text: Roboto
|
||||
code: Roboto Mono
|
||||
|
||||
features:
|
||||
- navigation.tabs
|
||||
- navigation.tabs.sticky
|
||||
- navigation.indexes
|
||||
- navigation.top
|
||||
- navigation.instant
|
||||
- search.suggest
|
||||
- search.highlight
|
||||
- search.share
|
||||
- content.code.copy
|
||||
- toc.follow
|
||||
|
||||
icon:
|
||||
repo: fontawesome/brands/github
|
||||
edit: material/pencil
|
||||
view: material/eye
|
||||
|
||||
plugins:
|
||||
- search:
|
||||
separator: '[\\s\\-\\/]+'
|
||||
- offline
|
||||
- minify:
|
||||
minify_html: true
|
||||
|
||||
markdown_extensions:
|
||||
- smarty
|
||||
- sane_lists
|
||||
- abbr
|
||||
- admonition
|
||||
- attr_list
|
||||
- def_list
|
||||
- footnotes
|
||||
- meta
|
||||
- md_in_html
|
||||
- toc:
|
||||
permalink: true
|
||||
- pymdownx.caret
|
||||
- pymdownx.highlight:
|
||||
anchor_linenums: true
|
||||
use_pygments: true
|
||||
- pymdownx.inlinehilite
|
||||
- pymdownx.keys
|
||||
- pymdownx.mark
|
||||
- pymdownx.smartsymbols
|
||||
- pymdownx.superfences
|
||||
- pymdownx.tabbed:
|
||||
alternate_style: true
|
||||
- pymdownx.tasklist:
|
||||
custom_checkbox: true
|
||||
- pymdownx.tilde
|
||||
- callouts
|
||||
- github-callouts
|
||||
|
||||
extra:
|
||||
generator: false
|
||||
social:
|
||||
- icon: fontawesome/brands/github
|
||||
link: https://github.com/filebrowser/filebrowser
|
||||
- icon: fontawesome/brands/docker
|
||||
link: https://hub.docker.com/r/filebrowser/filebrowser
|
||||
|
||||
nav:
|
||||
- Home: index.md
|
||||
- Documentation:
|
||||
- Installation: installation.md
|
||||
- Configuration:
|
||||
- customization.md
|
||||
- authentication.md
|
||||
- command-execution.md
|
||||
- Troubleshooting: troubleshooting.md
|
||||
- Deployment: deployment.md
|
||||
- Command Line Usage:
|
||||
- cli/filebrowser.md
|
||||
- cli/filebrowser-cmds.md
|
||||
- cli/filebrowser-cmds-add.md
|
||||
- cli/filebrowser-cmds-ls.md
|
||||
- cli/filebrowser-cmds-rm.md
|
||||
- cli/filebrowser-completion.md
|
||||
- cli/filebrowser-completion-bash.md
|
||||
- cli/filebrowser-completion-fish.md
|
||||
- cli/filebrowser-completion-powershell.md
|
||||
- cli/filebrowser-completion-zsh.md
|
||||
- cli/filebrowser-config.md
|
||||
- cli/filebrowser-config-cat.md
|
||||
- cli/filebrowser-config-export.md
|
||||
- cli/filebrowser-config-import.md
|
||||
- cli/filebrowser-config-init.md
|
||||
- cli/filebrowser-config-set.md
|
||||
- cli/filebrowser-hash.md
|
||||
- cli/filebrowser-rules.md
|
||||
- cli/filebrowser-rules-add.md
|
||||
- cli/filebrowser-rules-ls.md
|
||||
- cli/filebrowser-rules-rm.md
|
||||
- cli/filebrowser-users.md
|
||||
- cli/filebrowser-users-add.md
|
||||
- cli/filebrowser-users-export.md
|
||||
- cli/filebrowser-users-find.md
|
||||
- cli/filebrowser-users-import.md
|
||||
- cli/filebrowser-users-ls.md
|
||||
- cli/filebrowser-users-rm.md
|
||||
- cli/filebrowser-users-update.md
|
||||
- cli/filebrowser-version.md
|
||||
- Contributing:
|
||||
- Contributing: contributing.md
|
||||
- Code of Conduct: code-of-conduct.md
|
||||
- Security Policy: security.md
|
||||
- Changelog: changelog.md
|
||||
@@ -1,4 +0,0 @@
|
||||
mkdocs-material
|
||||
mkdocs-minify-plugin
|
||||
mkdocs-redirects
|
||||
markdown-callouts
|
||||
Reference in new issue
Block a user