Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f777bafbc | ||
|
|
be4a1ac807 | ||
|
|
55f2474660 | ||
|
|
c02bf755f2 | ||
|
|
c209f1effc | ||
|
|
7fd7ae6733 | ||
|
|
705762d57c | ||
|
|
86dc0e8d95 | ||
|
|
68a6801690 | ||
|
|
6873f04bfb | ||
|
|
6d8faa7d03 | ||
|
|
7371c29111 | ||
|
|
852140c3a7 | ||
|
|
6e36b6c4b7 | ||
|
|
bc9709e500 | ||
|
|
5cb1b463ea | ||
|
|
1afa755d4f | ||
|
|
c05293a948 | ||
|
|
ab7b77de39 | ||
|
|
54761e4ef2 | ||
|
|
042392f611 | ||
|
|
6aca927851 | ||
|
|
d8bdf5f390 | ||
|
|
2366035c72 | ||
|
|
9110c8a9d5 | ||
|
|
d3d164910b | ||
|
|
fa1832dfa7 | ||
|
|
b87f8cb961 | ||
|
|
a69fdf2e09 | ||
|
|
7a1d18dfc6 | ||
|
|
dd29258828 | ||
|
|
b569f68300 | ||
|
|
7fc7465f71 | ||
|
|
5dda0dc5f3 | ||
|
|
618fccd7bb | ||
|
|
a0de540dbd | ||
|
|
bd9bf33bc9 | ||
|
|
2e3b56f250 | ||
|
|
87bc33e675 | ||
|
|
833d908884 | ||
|
|
1cd18d7ead | ||
|
|
e8a388f840 | ||
|
|
0dfe44649c | ||
|
|
05ee853eef | ||
|
|
afeb478ee1 | ||
|
|
df2869993a | ||
|
|
d49ab67904 | ||
|
|
cfff84306a | ||
|
|
72faf6dd3c | ||
|
|
a789f29cee | ||
|
|
74b13db3fa | ||
|
|
773b30102c | ||
|
|
0b925cbca9 | ||
|
|
9dd7c7d099 | ||
|
|
b24e43b06c | ||
|
|
91e68edb8c | ||
|
|
ac11538f08 | ||
|
|
f6fb8f6bf5 | ||
|
|
e6d70cf24c | ||
|
|
41e2b1bbba | ||
|
|
41b01a7404 | ||
|
|
0dd8905886 | ||
|
|
032271bafa | ||
|
|
50125a5d21 | ||
|
|
bc3d75a94a | ||
|
|
fb6aeba9ea | ||
|
|
67e893eee7 | ||
|
|
4a4b0f8c84 | ||
|
|
660d84661d | ||
|
|
392253c563 | ||
|
|
328f629181 | ||
|
|
4c3cb4bc9b | ||
|
|
3213b605be | ||
|
|
610e0b09e9 | ||
|
|
7453c78c98 | ||
|
|
cd5749dff8 | ||
|
|
4daddec6f2 | ||
|
|
9bd79c3aae | ||
|
|
6c69b5cd89 | ||
|
|
4b8a8d72ce | ||
|
|
8ddd3d1db9 | ||
|
|
9fffee387f | ||
|
|
5a12cad548 | ||
|
|
6232686e22 | ||
|
|
b21b1245ae | ||
|
|
7361d91ea2 | ||
|
|
c05c668148 | ||
|
|
b7dc392838 | ||
|
|
ac46cf0671 | ||
|
|
f0785391bf | ||
|
|
9b78324d77 | ||
|
|
fe7efb2e6a | ||
|
|
2651260a1c | ||
|
|
4470288ba1 | ||
|
|
58d22578e8 | ||
|
|
dfc2e887e1 | ||
|
|
aac2516637 | ||
|
|
c05ead7e8e | ||
|
|
d76b7d1610 | ||
|
|
f30fca636c | ||
|
|
ec13054671 | ||
|
|
883a36f02f | ||
|
|
8503ba61ff | ||
|
|
1fb05d65de | ||
|
|
2472fbcd30 | ||
|
|
43a404ca69 | ||
|
|
d9cf2f0100 | ||
|
|
6209f8fddd | ||
|
|
bd1520fe09 | ||
|
|
8cfa6a175f | ||
|
|
a1063925e1 | ||
|
|
64511ce45e | ||
|
|
be23ab3a15 | ||
|
|
ffb486e05f | ||
|
|
403d2bbd33 | ||
|
|
dfe6e5b333 | ||
|
|
d9816b1531 | ||
|
|
7c2c0a11b3 | ||
|
|
3406d3d7f9 | ||
|
|
67ed670d92 | ||
|
|
a1a514dcbb | ||
|
|
5f7311d324 | ||
|
|
998bd95bfa | ||
|
|
c1abe8f561 | ||
|
|
0bb2768754 | ||
|
|
7b7ff8ae8f | ||
|
|
1086903c14 | ||
|
|
3471ec2c4b | ||
|
|
69c76d11cc | ||
|
|
6b04cbf5e9 | ||
|
|
503fd6b01f | ||
|
|
35db07d015 | ||
|
|
19514367ad | ||
|
|
cdd666fc95 | ||
|
|
103acd15fe | ||
|
|
f5e0c4e2e1 | ||
|
|
ca019ae7d9 | ||
|
|
4488f5b131 | ||
|
|
166583db63 | ||
|
|
85b7d2762d | ||
|
|
4edabb9ccc | ||
|
|
103683069e | ||
|
|
5328e80d2e | ||
|
|
847d08bdd1 | ||
|
|
0231b7ebdf | ||
|
|
e07c59df0b | ||
|
|
0d3eb9bea9 | ||
|
|
34ae34e764 | ||
|
|
ca0108f070 | ||
|
|
a1e442ef9e | ||
|
|
6ad8160aa3 | ||
|
|
22b848f26e | ||
|
|
a418dd6bb3 | ||
|
|
d978d1ecca | ||
|
|
9cc18a81e3 | ||
|
|
e38c28273a | ||
|
|
da2dff0933 | ||
|
|
261bca67bc | ||
|
|
ca5e249e3c | ||
|
|
f4e148523e | ||
|
|
1f22fe65ec | ||
|
|
e2bdf6f747 | ||
|
|
d236f1c563 | ||
|
|
4edf425a9f | ||
|
|
a1a7ac4f04 | ||
|
|
74917c8037 | ||
|
|
7bd27f5e82 | ||
|
|
9f4288b1b4 | ||
|
|
41b801d30c | ||
|
|
da6b7ac26b | ||
|
|
7f8b920aa4 | ||
|
|
dd53644acb | ||
|
|
9b80a9aa6c | ||
|
|
0321415a15 | ||
|
|
23e84c9974 | ||
|
|
0fadf28b18 | ||
|
|
871f337892 | ||
|
|
29c73eaca6 | ||
|
|
f13c7c8cff | ||
|
|
1e03feadb5 | ||
|
|
8adf127c7d | ||
|
|
7dbf7a3528 | ||
|
|
65a837de49 | ||
|
|
876cdb3426 | ||
|
|
2f805de527 | ||
|
|
7a16129bfc | ||
|
|
0f39bd055e | ||
|
|
860c19ddf5 | ||
|
|
a8fc1657b7 | ||
|
|
c406bda0c7 | ||
|
|
d9f9460c1e | ||
|
|
126227bb27 | ||
|
|
b6a4fb1f27 | ||
|
|
2368e468b9 | ||
|
|
8d8cd26d7f | ||
|
|
8f81b77cf2 | ||
|
|
0616f6811f | ||
|
|
432f3e60ff | ||
|
|
ae72f93667 | ||
|
|
4812536555 | ||
|
|
6d44b3ae1d | ||
|
|
811cf2dfe5 | ||
|
|
b5f970731b | ||
|
|
fc80f4f44c | ||
|
|
6aea227617 | ||
|
|
09a26166b4 | ||
|
|
a63573b67e | ||
|
|
4bd7d69c82 | ||
|
|
c21af0791a | ||
|
|
858eb42651 | ||
|
|
21709428b1 | ||
|
|
846fb3333a | ||
|
|
6f772f2b10 | ||
|
|
3c5d36673f | ||
|
|
27afbb8813 | ||
|
|
79875bac7f | ||
|
|
be8ba18937 | ||
|
|
ef2e9992dc | ||
|
|
0542fc0ba4 | ||
|
|
f04af0cac6 | ||
|
|
f5f8b60b33 | ||
|
|
6dcef07f40 | ||
|
|
6700a981a5 | ||
|
|
490e5bbf99 | ||
|
|
df63cb595c | ||
|
|
3cb21c727d | ||
|
|
c01b6a840c | ||
|
|
cbcf708d94 | ||
|
|
4d9e6b8218 | ||
|
|
8ee55761a1 | ||
|
|
8598db2acc | ||
|
|
a7dc7bf88a | ||
|
|
9f56826fb2 | ||
|
|
d7b00ce5f6 | ||
|
|
177c7cfcce | ||
|
|
4af3f85e64 | ||
|
|
c950a57df8 | ||
|
|
7ed1425115 | ||
|
|
148b3c5942 | ||
|
|
a40f80672d | ||
|
|
8dc618a24b | ||
|
|
31194fb57a | ||
|
|
aa809096eb | ||
|
|
e3d00d591b | ||
|
|
7b16e2de90 | ||
|
|
2470b9eb69 | ||
|
|
9940bdd663 | ||
|
|
200d501547 | ||
|
|
3169a14a4d | ||
|
|
7e78ad97ad | ||
|
|
0467326d5c | ||
|
|
63a76ef18c | ||
|
|
3cad9a2b0e | ||
|
|
804b14b698 | ||
|
|
95e6ed75a7 | ||
|
|
b09960e538 | ||
|
|
5e8f5be245 | ||
|
|
e5bc0d3cce | ||
|
|
f67bccf8c5 | ||
|
|
88b97def9e | ||
|
|
1f7904dad2 | ||
|
|
5feaf66575 | ||
|
|
c94870fcfe | ||
|
|
6a76dfeba9 | ||
|
|
e193d43278 | ||
|
|
489af403a1 | ||
|
|
ff2f00498c | ||
|
|
2957b4605b | ||
|
|
099dfb0ae8 | ||
|
|
a4289011ef | ||
|
|
942d59848a | ||
|
|
854e5371b6 | ||
|
|
b9df030e6e | ||
|
|
2b82612e3f | ||
|
|
08d7a1504c | ||
|
|
b8da36e630 | ||
|
|
a8fe32f4aa | ||
|
|
8fee2561af | ||
|
|
d441b28f43 | ||
|
|
87cfead033 | ||
|
|
3a08949c7f | ||
|
|
b594d4d4e2 | ||
|
|
1053aace8c | ||
|
|
004488c15b | ||
|
|
3032a1fade | ||
|
|
87f1d00fd7 | ||
|
|
f0f2f1ff06 | ||
|
|
08c8ede587 | ||
|
|
1154b49974 | ||
|
|
785b7abb7b | ||
|
|
550a73b6ba | ||
|
|
e7ea1ad27d | ||
|
|
24781badd4 | ||
|
|
4094fb359b | ||
|
|
cfa6c5864e | ||
|
|
59ca0c340a | ||
|
|
037e29a708 | ||
|
|
fda8a99292 | ||
|
|
208535a8cc | ||
|
|
464b581953 | ||
|
|
20312ff18e | ||
|
|
219582c0b0 | ||
|
|
4fd18a382c | ||
|
|
94ec786d34 | ||
|
|
25e9b85259 | ||
|
|
ffa893e9ac | ||
|
|
b8151a038a | ||
|
|
943e5340d0 | ||
|
|
88aa56f53b | ||
|
|
a12a612970 | ||
|
|
a2d80c62c1 | ||
|
|
1faa21844f | ||
|
|
7a93b2a062 | ||
|
|
032d6c7520 | ||
|
|
9595f3939c | ||
|
|
60b1ee8bb9 | ||
|
|
79d1aa9229 | ||
|
|
20bfd131c6 | ||
|
|
f89975603e | ||
|
|
2d3b64ecf6 | ||
|
|
579756dbb5 | ||
|
|
c11c986b73 | ||
|
|
3fdca6dfd9 | ||
|
|
cf966578d8 | ||
|
|
6d4c867672 | ||
|
|
169e97e6f9 | ||
|
|
7fa3432f25 | ||
|
|
e9ce7fa5aa |
No files matched your search
@@ -0,0 +1,12 @@
|
||||
*.go text eol=lf
|
||||
*.sh text eol=lf
|
||||
*.ps1 text eol=lf
|
||||
*.service text eol=lf
|
||||
|
||||
# Keep frontend checkout consistent with Prettier on Windows.
|
||||
*.vue text eol=lf
|
||||
*.ts text eol=lf
|
||||
*.js text eol=lf
|
||||
*.cjs text eol=lf
|
||||
*.css text eol=lf
|
||||
*.json text eol=lf
|
||||
@@ -1 +0,0 @@
|
||||
* @filebrowser/maintainers
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
Before submitting your PR, please indicate which issues are either fixed or closed by this PR. See [GitHub Help: Closing issues using keywords](https://help.github.com/articles/closing-issues-via-commit-messages/).
|
||||
|
||||
- [ ] I am aware the project is currently in maintenance-only mode. See [README](https://github.com/filebrowser/community/blob/master/README.md)
|
||||
- [ ] I am aware this project is being **archived on 2026-09-01** and that no further changes will be merged, including bug fixes. See [README](https://github.com/filebrowser/filebrowser/blob/master/README.md)
|
||||
- [ ] I am aware that translations MUST be made through [Transifex](https://app.transifex.com/file-browser/file-browser/) and that this PR is NOT a translation update
|
||||
- [ ] I am making a PR against the `master` branch.
|
||||
- [ ] I am sure File Browser can be successfully built. See [builds](https://github.com/filebrowser/community/blob/master/builds.md) and [development](https://github.com/filebrowser/community/blob/master/development.md).
|
||||
- [ ] I am sure File Browser can be successfully built. See [CONTRIBUTING.md](https://github.com/filebrowser/filebrowser/blob/master/CONTRIBUTING.md).
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: pnpm/action-setup@v4
|
||||
- uses: pnpm/action-setup@v6
|
||||
with:
|
||||
package_json_file: "frontend/package.json"
|
||||
- uses: actions/setup-node@v6
|
||||
@@ -27,6 +27,24 @@ jobs:
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm run lint
|
||||
|
||||
test-frontend:
|
||||
name: Test Frontend
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: pnpm/action-setup@v6
|
||||
with:
|
||||
package_json_file: "frontend/package.json"
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "24.x"
|
||||
cache: "pnpm"
|
||||
cache-dependency-path: "frontend/pnpm-lock.yaml"
|
||||
- working-directory: frontend
|
||||
run: |
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm run test
|
||||
|
||||
lint-backend:
|
||||
name: Lint Backend
|
||||
runs-on: ubuntu-latest
|
||||
@@ -34,7 +52,7 @@ jobs:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.25.x"
|
||||
go-version: "1.26.x"
|
||||
- uses: golangci/golangci-lint-action@v9
|
||||
with:
|
||||
version: "latest"
|
||||
@@ -46,7 +64,7 @@ jobs:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.25.x"
|
||||
go-version: "1.26.x"
|
||||
- run: go test --race ./...
|
||||
|
||||
build:
|
||||
@@ -58,8 +76,8 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25'
|
||||
- uses: pnpm/action-setup@v4
|
||||
go-version: '1.26'
|
||||
- uses: pnpm/action-setup@v6
|
||||
with:
|
||||
package_json_file: "frontend/package.json"
|
||||
- uses: actions/setup-node@v6
|
||||
@@ -68,7 +86,7 @@ jobs:
|
||||
cache: "pnpm"
|
||||
cache-dependency-path: "frontend/pnpm-lock.yaml"
|
||||
- name: Install Task
|
||||
uses: go-task/setup-task@v1
|
||||
uses: go-task/setup-task@v2
|
||||
- run: task build
|
||||
|
||||
release:
|
||||
@@ -82,8 +100,8 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25'
|
||||
- uses: pnpm/action-setup@v4
|
||||
go-version: '1.26'
|
||||
- uses: pnpm/action-setup@v6
|
||||
with:
|
||||
package_json_file: "frontend/package.json"
|
||||
- uses: actions/setup-node@v6
|
||||
@@ -92,19 +110,19 @@ jobs:
|
||||
cache: "pnpm"
|
||||
cache-dependency-path: "frontend/pnpm-lock.yaml"
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v4
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
- name: Install Task
|
||||
uses: go-task/setup-task@v1
|
||||
uses: go-task/setup-task@v2
|
||||
- run: task build:frontend
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
uses: goreleaser/goreleaser-action@v7
|
||||
with:
|
||||
version: latest
|
||||
args: release --clean
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
name: Docs
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'www'
|
||||
- '*.md'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Docs
|
||||
if: github.event_name == 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Install Task
|
||||
uses: go-task/setup-task@v1
|
||||
- name: Build site
|
||||
run: task docs
|
||||
|
||||
build-and-release:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
name: Build and Release Docs
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Install Task
|
||||
uses: go-task/setup-task@v1
|
||||
- name: Build site
|
||||
run: task docs
|
||||
- name: Upload static files as artifact
|
||||
uses: actions/upload-pages-artifact@v4
|
||||
with:
|
||||
path: www/public
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: actions/deploy-pages@v4
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: marocchino/sticky-pull-request-comment@v2
|
||||
- uses: marocchino/sticky-pull-request-comment@v3
|
||||
# When the previous steps fails, the workflow would stop. By adding this
|
||||
# condition you can continue the execution with the populated error message.
|
||||
if: always() && (steps.lint_pr_title.outputs.error_message != null)
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
|
||||
# Delete a previous comment when the issue has been resolved
|
||||
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
uses: marocchino/sticky-pull-request-comment@v3
|
||||
with:
|
||||
header: pr-title-lint-error
|
||||
delete: true
|
||||
@@ -37,3 +37,11 @@ build/
|
||||
|
||||
default.nix
|
||||
Dockerfile.dev
|
||||
|
||||
# SSO secrets and local setup
|
||||
.filebrowser.json
|
||||
.filebrowser.*.json
|
||||
|
||||
# Downloaded optional editor bundles
|
||||
/addons/*
|
||||
!/addons/.gitkeep
|
||||
@@ -17,6 +17,7 @@ builds:
|
||||
- linux
|
||||
- windows
|
||||
- freebsd
|
||||
- openbsd
|
||||
goarch:
|
||||
- amd64
|
||||
- "386"
|
||||
@@ -30,6 +31,12 @@ builds:
|
||||
ignore:
|
||||
- goos: darwin
|
||||
goarch: "386"
|
||||
# Experimental, may not work properly
|
||||
- goos: openbsd
|
||||
goarch: riscv64
|
||||
# Broken as of Go 1.24, deprecated as of Go 1.26
|
||||
- goos: windows
|
||||
goarch: arm
|
||||
- goos: freebsd
|
||||
goarch: arm
|
||||
|
||||
|
||||
@@ -2,6 +2,436 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
||||
|
||||
## [2.63.23](https://github.com/filebrowser/filebrowser/compare/v2.63.22...v2.63.23) (2026-07-27)
|
||||
## [2.63.22](https://github.com/filebrowser/filebrowser/compare/v2.63.21...v2.63.22) (2026-07-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* enforce rules on recursive operations and expired proxy tokens ([#6053](https://github.com/filebrowser/filebrowser/issues/6053)) ([72faf6d](https://github.com/filebrowser/filebrowser/commit/72faf6dd3c85628e332d3e567124b86708ce2695))
|
||||
* make the sidebar scrollable when content overflows ([#6031](https://github.com/filebrowser/filebrowser/issues/6031)) ([a789f29](https://github.com/filebrowser/filebrowser/commit/a789f29ceec4734e7471592921d1ce67f1a10a7e))
|
||||
* unblock stalled and frozen uploads ([0b925cb](https://github.com/filebrowser/filebrowser/commit/0b925cbca940fe0b2726827cf66783da05c64f5e)), closes [#6006](https://github.com/filebrowser/filebrowser/issues/6006), references [#5987](https://github.com/filebrowser/filebrowser/issues/5987)
|
||||
* use absolute URLs for the PWA manifest icon sources ([#6032](https://github.com/filebrowser/filebrowser/issues/6032)) ([cfff843](https://github.com/filebrowser/filebrowser/commit/cfff84306af66deedfdc9248300919b3ddd9a7f0))
|
||||
## [2.63.21](https://github.com/filebrowser/filebrowser/compare/v2.63.20...v2.63.21) (2026-07-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **http:** canonicalize paths before checking access rules ([#6045](https://github.com/filebrowser/filebrowser/issues/6045)) ([e6d70cf](https://github.com/filebrowser/filebrowser/commit/e6d70cf24c0cd79a1787601dc99104ec7e7ca3ef))
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "chore(deps): update all non-major dependencies (#5946)" ([0dd8905](https://github.com/filebrowser/filebrowser/commit/0dd89058867f87a7bc04aa7517d21528a280e27c)), references [#5946](https://github.com/filebrowser/filebrowser/issues/5946)
|
||||
## [2.63.20](https://github.com/filebrowser/filebrowser/compare/v2.63.19...v2.63.20) (2026-07-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* use aria-selected ([67e893e](https://github.com/filebrowser/filebrowser/commit/67e893eee7ee411e166d3fcd759a87b6f0971277))
|
||||
* **users:** make the provisioned scope check atomic with the save ([fb6aeba](https://github.com/filebrowser/filebrowser/commit/fb6aeba9eae7b8eb401e0db325973781e1ffd08b))
|
||||
## [2.63.19](https://github.com/filebrowser/filebrowser/compare/v2.63.18...v2.63.19) (2026-07-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* accessibility and security improvements ([#6033](https://github.com/filebrowser/filebrowser/issues/6033)) ([b21b124](https://github.com/filebrowser/filebrowser/commit/b21b1245ae1b57f031b2f5d787f32a17532402c0))
|
||||
* **auth:** isolate auto-provisioned proxy and hook users to their own home ([8ddd3d1](https://github.com/filebrowser/filebrowser/commit/8ddd3d1db9b9f5727d0bf96ea0e7d9a25a8692b4))
|
||||
* **http:** delete abandoned TUS uploads through the scoped filesystem ([9bd79c3](https://github.com/filebrowser/filebrowser/commit/9bd79c3aaeb4a55b0e69cf8976c4a258db2f5e06))
|
||||
* **http:** enforce declared Upload-Length on TUS uploads ([4daddec](https://github.com/filebrowser/filebrowser/commit/4daddec6f200b03a721197d8c0b4b652c994894e))
|
||||
* **http:** enforce download permission on the checksum branch ([6c69b5c](https://github.com/filebrowser/filebrowser/commit/6c69b5cd895e15b29e563200a9a6dfc27b06525e))
|
||||
* **http:** run upload hooks for directories ([#6034](https://github.com/filebrowser/filebrowser/issues/6034)) ([9b78324](https://github.com/filebrowser/filebrowser/commit/9b78324d773c790951cc6a97840c4b55f66b5f3d))
|
||||
* process --FollowExternalSymlinks ([c05c668](https://github.com/filebrowser/filebrowser/commit/c05c66814891c3cccef394162e428444b53394e4))
|
||||
* return error instead of panicking on an unreadable directory during copy ([#6020](https://github.com/filebrowser/filebrowser/issues/6020)) ([ac46cf0](https://github.com/filebrowser/filebrowser/commit/ac46cf06719575477d5125e7472037c204b3702d))
|
||||
* **storage:** reject case-folded home directory collisions ([4b8a8d7](https://github.com/filebrowser/filebrowser/commit/4b8a8d72ce554dde378b5091da74aa930ea18327))
|
||||
* **upload:** handle encoded path conflicts safely ([#6040](https://github.com/filebrowser/filebrowser/issues/6040)) ([7361d91](https://github.com/filebrowser/filebrowser/commit/7361d91ea2e8cc200a0f40ac84adcd02aedc9ed2))
|
||||
## [2.63.18](https://github.com/filebrowser/filebrowser/compare/v2.63.17...v2.63.18) (2026-07-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* avoid recursive conflict checks for copy and move ([#6009](https://github.com/filebrowser/filebrowser/issues/6009)) ([dfc2e88](https://github.com/filebrowser/filebrowser/commit/dfc2e887e1a19d54984a0d7e39a2a63caf73ef19))
|
||||
* deduplicate PT language ([4470288](https://github.com/filebrowser/filebrowser/commit/4470288ba1828a14453a99348fd22c62aa0b9460))
|
||||
* **preview:** keep the EPUB table-of-contents button clear of the header ([#6010](https://github.com/filebrowser/filebrowser/issues/6010)) ([aac2516](https://github.com/filebrowser/filebrowser/commit/aac25166378422135e624e305c410c54a39374fb))
|
||||
|
||||
## [2.63.17](https://github.com/filebrowser/filebrowser/compare/v2.63.16...v2.63.17) (2026-06-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **auth:** reject signup when normalized home dir collides (GHSA-7rc3-g7h6-22m7) ([883a36f](https://github.com/filebrowser/filebrowser/commit/883a36f02fcb69566a8628cb47f18fdc73348387))
|
||||
* match admin share paths by owner scope ([#5992](https://github.com/filebrowser/filebrowser/issues/5992)) ([43a404c](https://github.com/filebrowser/filebrowser/commit/43a404ca69bf25553bfbbb2b446f0f53077c6302))
|
||||
* normalize recursive listing paths to forward slashes ([#6003](https://github.com/filebrowser/filebrowser/issues/6003)) ([2472fbc](https://github.com/filebrowser/filebrowser/commit/2472fbcd30502606feb11fbc8b8dc4f3803e6641))
|
||||
* preserve SRT subtitle line breaks ([#6002](https://github.com/filebrowser/filebrowser/issues/6002)) ([d9cf2f0](https://github.com/filebrowser/filebrowser/commit/d9cf2f0100d2c4892cad8e339eacca96df1aa5b6))
|
||||
* **raw:** neutralize backslashes in archive entry names (GHSA-83xp-526h-j3ww) ([8503ba6](https://github.com/filebrowser/filebrowser/commit/8503ba61ff51d48a7313896483d130eb6a5abfe0))
|
||||
* **share:** delete exact directory share on trailing-slash delete (GHSA-pp88-jhwj-5qh5) ([f30fca6](https://github.com/filebrowser/filebrowser/commit/f30fca636c1af9ef401e9a82ff60391cb3db97e1))
|
||||
* **share:** stop exposing password hash and bypass token in share API (GHSA-833g-cqhp-h72j) ([ec13054](https://github.com/filebrowser/filebrowser/commit/ec130546713c44cd24556907552ac554c7f809c9))
|
||||
|
||||
## [2.63.16](https://github.com/filebrowser/filebrowser/compare/v2.63.15...v2.63.16) (2026-06-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* dangling symlink, write, delete scope bugs ([64511ce](https://github.com/filebrowser/filebrowser/commit/64511ce45e3be379e965f7f4fb0929a068d5bb81))
|
||||
* restore symlink behavior as opt-in followExternalSymlinks ([a106392](https://github.com/filebrowser/filebrowser/commit/a1063925e15ef27f9d5dc26aae371bbf52af608c))
|
||||
|
||||
## [2.63.15](https://github.com/filebrowser/filebrowser/compare/v2.63.14...v2.63.15) (2026-06-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* restore ScopedFs RealPath ([#5986](https://github.com/filebrowser/filebrowser/issues/5986)) ([403d2bb](https://github.com/filebrowser/filebrowser/commit/403d2bbd3357aa57e78745b52dcdad3490901bb3))
|
||||
|
||||
## [2.63.14](https://github.com/filebrowser/filebrowser/compare/v2.63.13...v2.63.14) (2026-06-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* recursive check ([3406d3d](https://github.com/filebrowser/filebrowser/commit/3406d3d7f98dfc3c16e4ff7ff4a87e3bdfe221dd))
|
||||
|
||||
|
||||
### Refactorings
|
||||
|
||||
* ScopedFs to avoid escaping symlinks ([7c2c0a1](https://github.com/filebrowser/filebrowser/commit/7c2c0a11b31b2bb214d741005a0b02b1764208b3))
|
||||
|
||||
## [2.63.13](https://github.com/filebrowser/filebrowser/compare/v2.63.12...v2.63.13) (2026-06-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* copy/move allow overwrite ([a1a514d](https://github.com/filebrowser/filebrowser/commit/a1a514dcbb216d2080412c5354eea1e1fb033050))
|
||||
|
||||
|
||||
### Refactorings
|
||||
|
||||
* cleanup and simplify upload.ts ([5f7311d](https://github.com/filebrowser/filebrowser/commit/5f7311d32437e98d7c14c7b307a4f68109275535))
|
||||
|
||||
## [2.63.12](https://github.com/filebrowser/filebrowser/compare/v2.63.11...v2.63.12) (2026-06-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* await copy move conflict detection ([#5978](https://github.com/filebrowser/filebrowser/issues/5978)) ([c1abe8f](https://github.com/filebrowser/filebrowser/commit/c1abe8f561208bf36bde70879d1a15ef9de998fa))
|
||||
* keep mobile file sort controls visible ([#5977](https://github.com/filebrowser/filebrowser/issues/5977)) ([0bb2768](https://github.com/filebrowser/filebrowser/commit/0bb2768754d11b865d68e72dcd7cebb232a6308a))
|
||||
* skip inaccessible children when listing directories ([#5958](https://github.com/filebrowser/filebrowser/issues/5958)) ([7b7ff8a](https://github.com/filebrowser/filebrowser/commit/7b7ff8ae8f97393b2e6ae6e061c1f780077c32b6))
|
||||
|
||||
## [2.63.11](https://github.com/filebrowser/filebrowser/compare/v2.63.10...v2.63.11) (2026-06-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* incomplete fix for symlinked directories let scopes users and public-share recipients read and write files outside of scope ([3471ec2](https://github.com/filebrowser/filebrowser/commit/3471ec2c4b6473831c72ee889cb3c1a6849a1fb1))
|
||||
|
||||
## [2.63.10](https://github.com/filebrowser/filebrowser/compare/v2.63.9...v2.63.10) (2026-06-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow writes when user scope resolves to filesystem root ([6b04cbf](https://github.com/filebrowser/filebrowser/commit/6b04cbf5e9db1f5b9c0b1624843607ce2881cfc4))
|
||||
|
||||
## [2.63.9](https://github.com/filebrowser/filebrowser/compare/v2.63.8...v2.63.9) (2026-06-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* force octet-stream for attachment downloads ([#5942](https://github.com/filebrowser/filebrowser/issues/5942)) ([103acd1](https://github.com/filebrowser/filebrowser/commit/103acd15fe57554fe0246bfe70a49b6cb4ae0c51))
|
||||
* prevent symlink scope escape in copy/move/rename ([cdd666f](https://github.com/filebrowser/filebrowser/commit/cdd666fc95f569ad583c32391e45646fed676dfd))
|
||||
* set X-Content-Type-Options: nosniff on raw file responses ([35db07d](https://github.com/filebrowser/filebrowser/commit/35db07d0159c520a6b3c969ac52033593914fadd))
|
||||
* use constant-time comparison for share access token ([1951436](https://github.com/filebrowser/filebrowser/commit/19514367adf2d9fe5be2b7666e397979ea679b94))
|
||||
|
||||
## [2.63.8](https://github.com/filebrowser/filebrowser/compare/v2.63.7...v2.63.8) (2026-06-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* check if share is within scope when creating ([ca019ae](https://github.com/filebrowser/filebrowser/commit/ca019ae7d966a7c28de2b2341271cd13e3458ae6))
|
||||
|
||||
## [2.63.7](https://github.com/filebrowser/filebrowser/compare/v2.63.6...v2.63.7) (2026-06-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* disallow shares for non-existent paths ([166583d](https://github.com/filebrowser/filebrowser/commit/166583db632e088e9f0adce30aec43bb9d9019f4))
|
||||
|
||||
## [2.63.6](https://github.com/filebrowser/filebrowser/compare/v2.63.5...v2.63.6) (2026-06-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* address three security disclosures (archive traversal, login DoS, symlink escape) ([847d08b](https://github.com/filebrowser/filebrowser/commit/847d08bdd135e5c3659f2e6dea2f0cd36617af9b))
|
||||
* cross-user unauthorized share-link deletion ([0231b7e](https://github.com/filebrowser/filebrowser/commit/0231b7ebdfbe77a6c54027d30c4856c3fd81ee4d))
|
||||
* incorrect access control in public directory shares via rule path rebasing ([e07c59d](https://github.com/filebrowser/filebrowser/commit/e07c59df0b850f5924d5b1683e8609661ddcf534))
|
||||
* parse csv files with uneven columns in their rows ([#5965](https://github.com/filebrowser/filebrowser/issues/5965)) ([5328e80](https://github.com/filebrowser/filebrowser/commit/5328e80d2e88d1c279a1250a7dfee4fc96f703ec))
|
||||
* remove undocumented hook auth with shell replacement ([34ae34e](https://github.com/filebrowser/filebrowser/commit/34ae34e764d72540c039f1f5ea2ec4c974168c1f))
|
||||
|
||||
## [2.63.5](https://github.com/filebrowser/filebrowser/compare/v2.63.4...v2.63.5) (2026-05-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **router:** handle undefined catchAll param on root redirect ([#5955](https://github.com/filebrowser/filebrowser/issues/5955)) ([6ad8160](https://github.com/filebrowser/filebrowser/commit/6ad8160aa3309314c1b471c5090b67c824464396))
|
||||
|
||||
## [2.63.4](https://github.com/filebrowser/filebrowser/compare/v2.63.3...v2.63.4) (2026-05-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* show item shares from all users to admins ([#5941](https://github.com/filebrowser/filebrowser/issues/5941)) ([9cc18a8](https://github.com/filebrowser/filebrowser/commit/9cc18a81e3e1b8bf96795bfbe3d83ced294ecfd7))
|
||||
|
||||
## [2.63.3](https://github.com/filebrowser/filebrowser/compare/v2.63.2...v2.63.3) (2026-05-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* correct environment variable in compose.yaml ([#5910](https://github.com/filebrowser/filebrowser/issues/5910)) ([41b801d](https://github.com/filebrowser/filebrowser/commit/41b801d30c736c8ca863e2be6aece7d99e92129e))
|
||||
* Fix conflict modal and add a resume transfert option ([#5884](https://github.com/filebrowser/filebrowser/issues/5884)) ([f4e1485](https://github.com/filebrowser/filebrowser/commit/f4e148523e0dc9242081831b53544396f995c611))
|
||||
|
||||
## [2.63.2](https://github.com/filebrowser/filebrowser/compare/v2.63.1...v2.63.2) (2026-04-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **preview:** let arrow keys seek video instead of switching files ([#5895](https://github.com/filebrowser/filebrowser/issues/5895)) ([0fadf28](https://github.com/filebrowser/filebrowser/commit/0fadf28b18e506ddca0027e83ebe567ac57932bf))
|
||||
|
||||
## [2.63.1](https://github.com/filebrowser/filebrowser/compare/v2.63.0...v2.63.1) (2026-04-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* check download permission in resource handler ([#5891](https://github.com/filebrowser/filebrowser/issues/5891)) ([1e03fea](https://github.com/filebrowser/filebrowser/commit/1e03feadb550e4414b5589a6a8df57f538efba15))
|
||||
* check share owner permissions on public share access ([#5888](https://github.com/filebrowser/filebrowser/issues/5888)) ([7dbf7a3](https://github.com/filebrowser/filebrowser/commit/7dbf7a3528234b2a9ee9c4115e8ecf58d258ca51))
|
||||
* enforce directory boundary in rule path matching ([#5889](https://github.com/filebrowser/filebrowser/issues/5889)) ([8adf127](https://github.com/filebrowser/filebrowser/commit/8adf127c7d33585333b8030869f6f318e6517179))
|
||||
* restrict default permissions for proxy-auth auto-provisioned users ([#5890](https://github.com/filebrowser/filebrowser/issues/5890)) ([f13c7c8](https://github.com/filebrowser/filebrowser/commit/f13c7c8cffd6d58ff29c4a6763ced1385f69961e))
|
||||
|
||||
## [2.63.0](https://github.com/filebrowser/filebrowser/compare/v2.62.2...v2.63.0) (2026-04-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* enable copy operation on drag‑and‑drop with ctrl key ([#5882](https://github.com/filebrowser/filebrowser/issues/5882)) ([876cdb3](https://github.com/filebrowser/filebrowser/commit/876cdb34265b090c2a74a69509f4106f2c5e8726))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* check download permission when sharing permission is enabled ([#5875](https://github.com/filebrowser/filebrowser/issues/5875)) ([0f39bd0](https://github.com/filebrowser/filebrowser/commit/0f39bd055efdadc15abd2f8146cf5da3793f8318))
|
||||
* **tus:** reject negative upload-length to prevent inconsistent cache entry ([#5876](https://github.com/filebrowser/filebrowser/issues/5876)) ([7a16129](https://github.com/filebrowser/filebrowser/commit/7a16129bfc07dbdc2fa52b99d2985c1bc0ea12e2))
|
||||
|
||||
## [2.62.2](https://github.com/filebrowser/filebrowser/compare/v2.62.1...v2.62.2) (2026-03-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* disable scripted content in epub ([126227b](https://github.com/filebrowser/filebrowser/commit/126227bb2754eee15cd7c722916c3bb8821084a2))
|
||||
* double slash in TUS upload path when readEntries returns multiple batches ([#5848](https://github.com/filebrowser/filebrowser/issues/5848)) ([432f3e6](https://github.com/filebrowser/filebrowser/commit/432f3e60ffdf92af6f8f56119a1bac8084f52a60))
|
||||
* include filename in Content-Disposition header for inline downloads ([#5860](https://github.com/filebrowser/filebrowser/issues/5860)) ([8f81b77](https://github.com/filebrowser/filebrowser/commit/8f81b77cf2a3da0a445f3700fbf4a0091ea46c07))
|
||||
* json escaping ([c406bda](https://github.com/filebrowser/filebrowser/commit/c406bda0c73ac8b187e23a97c05521edc77efa84))
|
||||
* self-registered users don't get execute perms ([b6a4fb1](https://github.com/filebrowser/filebrowser/commit/b6a4fb1f27f4d894b384c0f3acacda276d1338a5))
|
||||
* shares listing ([a8fc165](https://github.com/filebrowser/filebrowser/commit/a8fc1657b796c5da7190466beff13e680721b6d3))
|
||||
* touch Redis upload cache key on GetLength to prevent TTL expiry ([#5850](https://github.com/filebrowser/filebrowser/issues/5850)) ([4812536](https://github.com/filebrowser/filebrowser/commit/48125365551ce2b27790aaafd7594cf5ce52f1ba))
|
||||
* use html/template ([d9f9460](https://github.com/filebrowser/filebrowser/commit/d9f9460c1e51d10a25065e10358c12d5ced66ad9))
|
||||
|
||||
## [2.62.1](https://github.com/filebrowser/filebrowser/compare/v2.62.0...v2.62.1) (2026-03-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* base url/reverse proxy redirect ([fc80f4f](https://github.com/filebrowser/filebrowser/commit/fc80f4f44c856ddc19df3024c245990fffd55630))
|
||||
|
||||
## [2.62.0](https://github.com/filebrowser/filebrowser/compare/v2.61.2...v2.62.0) (2026-03-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Updates for project File Browser ([#5807](https://github.com/filebrowser/filebrowser/issues/5807)) ([858eb42](https://github.com/filebrowser/filebrowser/commit/858eb426515ec55172e9cca47bdf1e25a0d0d81d))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow deleting the user's own account ([#5820](https://github.com/filebrowser/filebrowser/issues/5820)) ([f04af0c](https://github.com/filebrowser/filebrowser/commit/f04af0cac6c808b8e7c9a9651380c252c4de9132))
|
||||
* around languages ([c21af07](https://github.com/filebrowser/filebrowser/commit/c21af0791a5df458c2ddb81ce9ae44b772b6d82d))
|
||||
* clean path in patch handler ([4bd7d69](https://github.com/filebrowser/filebrowser/commit/4bd7d69c82163b201a987e99c0c50d7ecc6ee5f1))
|
||||
* make perm.share depend on share.download ([09a2616](https://github.com/filebrowser/filebrowser/commit/09a26166b4f79446e7174c017380f6db45444e32))
|
||||
* properly surface config parse errors ([#5822](https://github.com/filebrowser/filebrowser/issues/5822)) ([ef2e999](https://github.com/filebrowser/filebrowser/commit/ef2e9992dc3098f6c4722c2a98966cd8abf8bab5))
|
||||
* signup handler shouldn't create admins ([a63573b](https://github.com/filebrowser/filebrowser/commit/a63573b67eb302167b4c4f218361a2d0c138deab))
|
||||
* **tus:** preserve percent-encoded upload paths in Location header ([#5817](https://github.com/filebrowser/filebrowser/issues/5817)) ([0542fc0](https://github.com/filebrowser/filebrowser/commit/0542fc0ba43740c967414eebd156bac86ad80376))
|
||||
* **upload:** avoid skipping whole folder upload on conflict modal ([#5814](https://github.com/filebrowser/filebrowser/issues/5814)) ([f5f8b60](https://github.com/filebrowser/filebrowser/commit/f5f8b60b331a07729a1fed1ed065cb6fc20930ea))
|
||||
* **upload:** don't mark every folder-upload file as conflicting ([#5813](https://github.com/filebrowser/filebrowser/issues/5813)) ([6dcef07](https://github.com/filebrowser/filebrowser/commit/6dcef07f40d550acee63dd01e0a3bcf78532f690))
|
||||
|
||||
## [2.61.2](https://github.com/filebrowser/filebrowser/compare/v2.61.1...v2.61.2) (2026-03-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* added dateFormat to getUserDefaults so this is respected in the … ([#5804](https://github.com/filebrowser/filebrowser/issues/5804)) ([8598db2](https://github.com/filebrowser/filebrowser/commit/8598db2accccf5b87353e5e718b2ad1c946e5c44))
|
||||
* avoid sending the same name in the file/folder rename modal ([#5806](https://github.com/filebrowser/filebrowser/issues/5806)) ([d7b00ce](https://github.com/filebrowser/filebrowser/commit/d7b00ce5f672b7ce0b26ce31abdfc74f8b00b939))
|
||||
* **csv-viewer:** add support for missing text encodings in dropdown list ([#5795](https://github.com/filebrowser/filebrowser/issues/5795)) ([4af3f85](https://github.com/filebrowser/filebrowser/commit/4af3f85e64e795e8ae1d87d4caee8185028294ac))
|
||||
* **frontend:** do not delete original assets ([4d9e6b8](https://github.com/filebrowser/filebrowser/commit/4d9e6b821852203cef67233791a922013bd5b64d))
|
||||
* **frontend:** input password type ([8ee5576](https://github.com/filebrowser/filebrowser/commit/8ee55761a1aa9bc091d8466c44f03c2043a8ca79))
|
||||
* validate current password with a modal ([#5805](https://github.com/filebrowser/filebrowser/issues/5805)) ([177c7cf](https://github.com/filebrowser/filebrowser/commit/177c7cfcce36779e2c5ebaa4b59a055dd1e17648))
|
||||
|
||||
## [2.61.1](https://github.com/filebrowser/filebrowser/compare/v2.61.0...v2.61.1) (2026-03-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* check for correct permission in TUS Delete ([7ed1425](https://github.com/filebrowser/filebrowser/commit/7ed1425115be602c2b23236c410098ea2d74b42f))
|
||||
|
||||
## [2.61.0](https://github.com/filebrowser/filebrowser/compare/v2.60.0...v2.61.0) (2026-02-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* improved conflict resolution when uploading/copying/moving files ([#5765](https://github.com/filebrowser/filebrowser/issues/5765)) ([aa80909](https://github.com/filebrowser/filebrowser/commit/aa809096eb35fdfbdeb6784b1ebfe2ca1e42f52b))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* correctly clean path ([31194fb](https://github.com/filebrowser/filebrowser/commit/31194fb57a5b92e7155219d7ec7273028fcb2e83))
|
||||
|
||||
## [2.60.0](https://github.com/filebrowser/filebrowser/compare/v2.59.0...v2.60.0) (2026-02-21)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Updates for project File Browser ([#5764](https://github.com/filebrowser/filebrowser/issues/5764)) ([9940bdd](https://github.com/filebrowser/filebrowser/commit/9940bdd663ff5141110778524b8a22c957036e78))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* always show separators and encoding list in the CSV viewer ([#5774](https://github.com/filebrowser/filebrowser/issues/5774)) ([3169a14](https://github.com/filebrowser/filebrowser/commit/3169a14a4d63a0a11a5288f4f3a674c0a0edb972))
|
||||
* modal lifecycle issues, multiple modals, new directory creation and discard changes behavior ([#5773](https://github.com/filebrowser/filebrowser/issues/5773)) ([200d501](https://github.com/filebrowser/filebrowser/commit/200d5015472c79d5caa683ea291ebf500356a39f))
|
||||
|
||||
## [2.59.0](https://github.com/filebrowser/filebrowser/compare/v2.58.0...v2.59.0) (2026-02-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add 'Open direct' button to images ([#5678](https://github.com/filebrowser/filebrowser/issues/5678)) ([804b14b](https://github.com/filebrowser/filebrowser/commit/804b14b698aa218fa5c2aaba687e72c5f7617f0f))
|
||||
* Updates for project File Browser ([#5760](https://github.com/filebrowser/filebrowser/issues/5760)) ([63a76ef](https://github.com/filebrowser/filebrowser/commit/63a76ef18c51121e08634810a894c1e22a870428))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* render equations in markdown preview ([#5745](https://github.com/filebrowser/filebrowser/issues/5745)) ([0467326](https://github.com/filebrowser/filebrowser/commit/0467326d5c082c42c0ede88ee2d3472f5fb65600))
|
||||
|
||||
## [2.58.0](https://github.com/filebrowser/filebrowser/compare/v2.57.1...v2.58.0) (2026-02-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* nederlands ([88b97de](https://github.com/filebrowser/filebrowser/commit/88b97def9ee72fe6e8094209aebb71830b7305be))
|
||||
* support for multiple encodings in CSV files ([#5756](https://github.com/filebrowser/filebrowser/issues/5756)) ([f67bccf](https://github.com/filebrowser/filebrowser/commit/f67bccf8c5470cb280fe854d92aa2666c270bcf5))
|
||||
* Updates for project File Browser ([#5749](https://github.com/filebrowser/filebrowser/issues/5749)) ([c94870f](https://github.com/filebrowser/filebrowser/commit/c94870fcfe1b4acb2db9ab897b9f7d35e3b75770))
|
||||
* Updates for project File Browser ([#5759](https://github.com/filebrowser/filebrowser/issues/5759)) ([5e8f5be](https://github.com/filebrowser/filebrowser/commit/5e8f5be245fd0126545ef5ca61c2d428ac128ad5))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **frontend:** pnpm lock ([b09960e](https://github.com/filebrowser/filebrowser/commit/b09960e538387ff29371c80be1584720f65181e7))
|
||||
* ignore version.go ([1f7904d](https://github.com/filebrowser/filebrowser/commit/1f7904dad21a87f04e1543ee10b60ce79e5eebe9))
|
||||
* respect Accept-Encoding for pre-compressed JS ([#5750](https://github.com/filebrowser/filebrowser/issues/5750)) ([6a76dfe](https://github.com/filebrowser/filebrowser/commit/6a76dfeba9254a938e320928c67d110f73f83715))
|
||||
* wrap response text in Error before reject ([#5753](https://github.com/filebrowser/filebrowser/issues/5753)) ([e5bc0d3](https://github.com/filebrowser/filebrowser/commit/e5bc0d3cce18fa7b069688b176b99efbb67382d2))
|
||||
|
||||
## [2.57.1](https://github.com/filebrowser/filebrowser/compare/v2.57.0...v2.57.1) (2026-02-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* normalize fields capitalization ([ff2f004](https://github.com/filebrowser/filebrowser/commit/ff2f00498cff151e2fb1f5f0b16963bf33c3d6d4))
|
||||
* remove skip clean ([489af40](https://github.com/filebrowser/filebrowser/commit/489af403a19057f6b6b4b1dc0e48cbb26a202ef9))
|
||||
|
||||
## [2.57.0](https://github.com/filebrowser/filebrowser/compare/v2.56.0...v2.57.0) (2026-02-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add Redis upload cache for multi-replica deployments ([#5724](https://github.com/filebrowser/filebrowser/issues/5724)) ([08d7a15](https://github.com/filebrowser/filebrowser/commit/08d7a1504c42c115fdd82d3845694fe87147f1db))
|
||||
* Updates for project File Browser ([#5725](https://github.com/filebrowser/filebrowser/issues/5725)) ([8fee256](https://github.com/filebrowser/filebrowser/commit/8fee2561afbf968ed577bc4139562a42b2278243))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* adjust yaml config decodification to yaml.v3 ([#5722](https://github.com/filebrowser/filebrowser/issues/5722)) ([b594d4d](https://github.com/filebrowser/filebrowser/commit/b594d4d4e28a1b35e69d81d2c35948fe0d629888))
|
||||
* avoid 409 conflict when renaming files differing only by case ([#5729](https://github.com/filebrowser/filebrowser/issues/5729)) ([d441b28](https://github.com/filebrowser/filebrowser/commit/d441b28f432c3448a29ac828400321f1f4ed32d9))
|
||||
|
||||
## [2.56.0](https://github.com/filebrowser/filebrowser/compare/v2.55.0...v2.56.0) (2026-01-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Updates for project File Browser ([#5698](https://github.com/filebrowser/filebrowser/issues/5698)) ([f0f2f1f](https://github.com/filebrowser/filebrowser/commit/f0f2f1ff069aae566d8bf25ec275da59f29a96bc))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* adjust columns of the table from the "users ls" command ([#5716](https://github.com/filebrowser/filebrowser/issues/5716)) ([3032a1f](https://github.com/filebrowser/filebrowser/commit/3032a1fade43737c51c49b5ccda34f336394c2ed))
|
||||
* avoid clearing selection when clicking elements outside the empty area ([#5715](https://github.com/filebrowser/filebrowser/issues/5715)) ([004488c](https://github.com/filebrowser/filebrowser/commit/004488c15b3c30784e1ea564b3ca9feec7bcad08))
|
||||
|
||||
## [2.55.0](https://github.com/filebrowser/filebrowser/compare/v2.54.0...v2.55.0) (2026-01-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* added cut, copy, paste and show command palette functions in header ([#5648](https://github.com/filebrowser/filebrowser/issues/5648)) ([785b7ab](https://github.com/filebrowser/filebrowser/commit/785b7abb7ba7a86cc0deae1052c319ff714c222c))
|
||||
* update translations ([#5677](https://github.com/filebrowser/filebrowser/issues/5677)) ([e7ea1ad](https://github.com/filebrowser/filebrowser/commit/e7ea1ad27d3d17e249489d3338be40bfea15e2a1))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* prevent context menu clicks from clearing file selection ([#5681](https://github.com/filebrowser/filebrowser/issues/5681)) ([59ca0c3](https://github.com/filebrowser/filebrowser/commit/59ca0c340afc7774747c70ede9a5a5a3c9349d6b))
|
||||
* request current password when deleting users ([#5667](https://github.com/filebrowser/filebrowser/issues/5667)) ([cfa6c58](https://github.com/filebrowser/filebrowser/commit/cfa6c5864e5e7673aa9f3180e4964e0db92cc4da))
|
||||
* retain file selection when closing the editor ([#5693](https://github.com/filebrowser/filebrowser/issues/5693)) ([4094fb3](https://github.com/filebrowser/filebrowser/commit/4094fb359babac70e88d0ed4bfe3bd100744aad6))
|
||||
|
||||
## [2.54.0](https://github.com/filebrowser/filebrowser/compare/v2.53.1...v2.54.0) (2026-01-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add "redirect after copy/move" user setting ([#5662](https://github.com/filebrowser/filebrowser/issues/5662)) ([fda8a99](https://github.com/filebrowser/filebrowser/commit/fda8a992929b1466e75fb2813f2c4e293c12d244))
|
||||
* force file sync while uploading file ([#5668](https://github.com/filebrowser/filebrowser/issues/5668)) ([4fd18a3](https://github.com/filebrowser/filebrowser/commit/4fd18a382c31bbe7059d6733ffa371e70051865b))
|
||||
* update translations ([#5659](https://github.com/filebrowser/filebrowser/issues/5659)) ([464b581](https://github.com/filebrowser/filebrowser/commit/464b581953139c17e3276b774e381e4052827125))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* clear selection by clicking on empty area ([#5663](https://github.com/filebrowser/filebrowser/issues/5663)) ([208535a](https://github.com/filebrowser/filebrowser/commit/208535a8cc23254de0013dfab9008486707ee6c2))
|
||||
* hide "change password form" in noauth setting ([#5652](https://github.com/filebrowser/filebrowser/issues/5652)) ([219582c](https://github.com/filebrowser/filebrowser/commit/219582c0b03fd90979b1d1398dba7919d086a23f))
|
||||
|
||||
## [2.53.1](https://github.com/filebrowser/filebrowser/compare/v2.53.0...v2.53.1) (2026-01-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* download path encoding file paths ([#5655](https://github.com/filebrowser/filebrowser/issues/5655)) ([ffa893e](https://github.com/filebrowser/filebrowser/commit/ffa893e9ac387a49dba5917a41df7c3b7ce120fc))
|
||||
* request a password to change sensitive user data ([#5629](https://github.com/filebrowser/filebrowser/issues/5629)) ([b8151a0](https://github.com/filebrowser/filebrowser/commit/b8151a038a1ea55afae8073b439b74e364cac12f))
|
||||
|
||||
## [2.53.0](https://github.com/filebrowser/filebrowser/compare/v2.52.0...v2.53.0) (2025-12-29)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add "disable image resolution calculation" flag ([#5638](https://github.com/filebrowser/filebrowser/issues/5638)) ([a2d80c6](https://github.com/filebrowser/filebrowser/commit/a2d80c62c1c17962e566f68fb7cac6960ed3e4cb))
|
||||
* support streaming response for search results ([#5630](https://github.com/filebrowser/filebrowser/issues/5630)) ([20bfd13](https://github.com/filebrowser/filebrowser/commit/20bfd131c6a4fca48a645b52171c2d1cc3ce92b7))
|
||||
* update translations ([a12a612](https://github.com/filebrowser/filebrowser/commit/a12a612970d6cc3dfbca1b35ef3a60a887a4effb))
|
||||
* update translations ([#5626](https://github.com/filebrowser/filebrowser/issues/5626)) ([f899756](https://github.com/filebrowser/filebrowser/commit/f89975603e29b9f1fc05aec58afb42bbd56ed696))
|
||||
* update translations ([#5631](https://github.com/filebrowser/filebrowser/issues/5631)) ([032d6c7](https://github.com/filebrowser/filebrowser/commit/032d6c7520a64686c9d9b1218562256f629b4703))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* conversion of backslashes in file paths for archive creation ([#5637](https://github.com/filebrowser/filebrowser/issues/5637)) ([9595f39](https://github.com/filebrowser/filebrowser/commit/9595f3939c1c129ed875a47adcc4fbcfad9a0e65))
|
||||
* Don't crash on invalid config import ([#5640](https://github.com/filebrowser/filebrowser/issues/5640)) ([79d1aa9](https://github.com/filebrowser/filebrowser/commit/79d1aa9229b076ee8e3b71d6cf061fc90738f4da))
|
||||
* fix nil deref in config set command ([#5641](https://github.com/filebrowser/filebrowser/issues/5641)) ([60b1ee8](https://github.com/filebrowser/filebrowser/commit/60b1ee8bb9e18b21d7f2c04cb1cc90046cecd3e1))
|
||||
|
||||
## [2.52.0](https://github.com/filebrowser/filebrowser/compare/v2.51.2...v2.52.0) (2025-12-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* sync translations with Transifex ([7fa3432](https://github.com/filebrowser/filebrowser/commit/7fa3432f25610bbb55a718bc709b9a7bf41d92f0))
|
||||
* update translations ([#5615](https://github.com/filebrowser/filebrowser/issues/5615)) ([3fdca6d](https://github.com/filebrowser/filebrowser/commit/3fdca6dfd9a18c3f4895b4ef3cbd216824dbb57a))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* display the directory name in the shared folder view ([#5617](https://github.com/filebrowser/filebrowser/issues/5617)) ([6d4c867](https://github.com/filebrowser/filebrowser/commit/6d4c86767239dad4f09f30f48678f2f3a716eb12))
|
||||
* hide the context menu when changing the route ([#5613](https://github.com/filebrowser/filebrowser/issues/5613)) ([cf96657](https://github.com/filebrowser/filebrowser/commit/cf966578d8c6beab111b74f495bac6bdec173f41))
|
||||
|
||||
## [2.51.2](https://github.com/filebrowser/filebrowser/compare/v2.51.1...v2.51.2) (2025-12-07)
|
||||
|
||||
|
||||
|
||||
@@ -1,128 +1,13 @@
|
||||
# Contributing
|
||||
# Сборка и разработка
|
||||
|
||||
If you're interested in contributing to this project, this is the best place to start. Before contributing to this project, please take a bit of time to read our [Code of Conduct](code-of-conduct.md). Also, note that this project is open-source and licensed under [Apache License 2.0](LICENSE).
|
||||
Go 1.26+, Node.js 24+, pnpm 10.33.4. Разработка ведётся в dev, исходная версия сохранена в master-copy.
|
||||
|
||||
## Project Structure
|
||||
Сборка интерфейса: `cd frontend && pnpm install --frozen-lockfile && pnpm run build`.
|
||||
Затем из корня: `go build -o filebrowser .` и `./filebrowser init`.
|
||||
|
||||
The backend side of the application is written in [Go](https://golang.org/), while the frontend (located on a subdirectory of the same name) is written in [Vue.js](https://vuejs.org/). Due to the tight coupling required by some features, basic knowledge of both Go and Vue.js is recommended.
|
||||
Проверки: `go test ./...`, `go vet ./...`, `pnpm run typecheck`, `pnpm run test`, `pnpm run lint` в frontend.
|
||||
Аудит: `govulncheck ./...`, `pnpm audit`; для Linux на другой ОС установите GOOS=linux и GOARCH=amd64 при запуске govulncheck.
|
||||
|
||||
* Learn Go: [https://github.com/golang/go/wiki/Learn](https://github.com/golang/go/wiki/Learn)
|
||||
* Learn Vue.js: [https://vuejs.org/guide/introduction.html](https://vuejs.org/guide/introduction.html)
|
||||
|
||||
We encourage you to use git to manage your fork. To clone the main repository, just run:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/filebrowser/filebrowser
|
||||
```
|
||||
|
||||
We use [Taskfile](https://taskfile.dev/) to manage the different processes (building, releasing, etc) automatically.
|
||||
|
||||
## Build
|
||||
|
||||
You can fully build the project in order to produce a binary by running:
|
||||
|
||||
```bash
|
||||
task build
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
For development, there are a few things to have in mind.
|
||||
|
||||
### Frontend
|
||||
|
||||
We use [Node.js](https://nodejs.org/en/) on the frontend to manage the build process. Prepare the frontend environment:
|
||||
|
||||
```bash
|
||||
# From the root of the repo, go to frontend/
|
||||
cd frontend
|
||||
|
||||
# Install the dependencies
|
||||
pnpm install
|
||||
```
|
||||
|
||||
If you just want to develop the backend, you can create a static build of the frontend:
|
||||
|
||||
```bash
|
||||
pnpm run build
|
||||
```
|
||||
|
||||
If you want to develop the frontend, start a development server which watches for changes:
|
||||
|
||||
```bash
|
||||
pnpm run dev
|
||||
```
|
||||
|
||||
Please note that you need to access File Browser's interface through the development server of the frontend.
|
||||
|
||||
### Backend
|
||||
|
||||
First prepare the backend environment by downloading all required dependencies:
|
||||
|
||||
```bash
|
||||
go mod download
|
||||
```
|
||||
|
||||
You can now build or run File Browser as any other Go project:
|
||||
|
||||
```bash
|
||||
# Build
|
||||
go build
|
||||
|
||||
# Run
|
||||
go run .
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
We rely on Docker to abstract all the dependencies required for building the documentation.
|
||||
|
||||
To build the documentation to `www/public`:
|
||||
|
||||
```bash
|
||||
task docs
|
||||
```
|
||||
|
||||
To start a local server on port `8000` to view the built documentation:
|
||||
|
||||
```bash
|
||||
task docs:serve
|
||||
```
|
||||
|
||||
## Release
|
||||
|
||||
To make a release, just run:
|
||||
|
||||
```bash
|
||||
task release
|
||||
```
|
||||
|
||||
## Translations
|
||||
|
||||
Translations are managed on Transifex, which is an online website where everyone can contribute and translate strings for our project. It automatically syncs with the main language file \(in English\) and,, for you to contribute, you just need to:
|
||||
|
||||
1. Go to our Transifex web page: [app.transifex.com/file-browser/file-browser](https://app.transifex.com/file-browser/file-browser/)
|
||||
2. Click on **Join the project** and pick your language. We'll accept you as soon as possible. If you're language is not on the list, please request it via the interface.
|
||||
|
||||
Translations are automatically pushed to GitHub via an integration.
|
||||
|
||||
## Authentication Provider
|
||||
|
||||
To build a new authentication provider, you need to implement the [Auther interface](https://github.com/filebrowser/filebrowser/blob/master/auth/auth.go), whose method will be called on the login page after the user has submitted their login data.
|
||||
|
||||
```go
|
||||
// Auther is the authentication interface.
|
||||
type Auther interface {
|
||||
// Auth is called to authenticate a request.
|
||||
Auth(r *http.Request, s *users.Storage, root string) (*users.User, error)
|
||||
}
|
||||
```
|
||||
|
||||
After implementing the interface you should:
|
||||
|
||||
1. Add it to [`auth` directory](https://github.com/filebrowser/filebrowser/blob/master/auth).
|
||||
2. Add it to the [configuration parser](https://github.com/filebrowser/filebrowser/blob/master/cmd/config.go) for the CLI.
|
||||
3. Add it to the [`authBackend.Get`](https://github.com/filebrowser/filebrowser/blob/master/storage/bolt/auth.go).
|
||||
|
||||
If you need to add more flags, please update the function `addConfigFlags`.
|
||||
Для интерфейса в режиме разработки выполните `pnpm run dev`; запросы API проксируются на 127.0.0.1:8080. Полный OIDC-вход проверяйте через собранный интерфейс: публичный URL и Origin должны совпадать с конфигурацией SSO.
|
||||
|
||||
Готовый Debian-архив: `sh scripts/build-release.sh` либо `./scripts/build-release.ps1`. Инструкция — [docs/deployment.md](docs/deployment.md).
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:3.22
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:3.23
|
||||
|
||||
RUN apk update && \
|
||||
apk --no-cache add ca-certificates mailcap jq libcap
|
||||
|
||||
@@ -1,30 +1,48 @@
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/filebrowser/filebrowser/master/branding/banner.png" width="550"/>
|
||||
</p>
|
||||
# File Browser
|
||||
|
||||
[](https://github.com/filebrowser/filebrowser/actions/workflows/ci.yaml)
|
||||
[](https://goreportcard.com/report/github.com/filebrowser/filebrowser/v2)
|
||||
[](https://github.com/filebrowser/filebrowser/releases/latest)
|
||||
**Ваши файлы, ссылки и браузерные инструменты — на своём сервере.**
|
||||
|
||||
File Browser provides a file managing interface within a specified directory and it can be used to upload, delete, preview and edit your files. It is a **create-your-own-cloud**-kind of software where you can just install it on your server, direct it to a path and access your files through a nice web interface.
|
||||
[Скачать](https://git.anidev.ru/SantaSpeen/filebrowser/releases) · [Установка](docs/deployment.md) · [Разработка](#сборка)
|
||||
|
||||
## Documentation
|
||||

|
||||
|
||||
Documentation on how to install, configure, and contribute to this project is hosted at [filebrowser.org](https://filebrowser.org).
|
||||
[Мобильный интерфейс](docs/images/workspace-mobile.png)
|
||||
|
||||
## Project Status
|
||||
- **Общая сессия SSO.** Текущий аккаунт и роли проверяются на сервере; переключение синхронизируется между приложениями.
|
||||
- **Удобное пространство.** Дерево папок, закладки, поиск, меню действий, светлая и тёмная темы, мобильная вёрстка.
|
||||
- **Мои ссылки.** Короткие адреса `/s/имя`, несколько ссылок на файл, необязательные пароль и срок действия.
|
||||
- **Предпросмотр.** Изображения, PDF, DICOM 2D, текст, Markdown, CSV, книги, аудио и видео. ZIP показывает дерево без распаковки.
|
||||
- **Craft-аддоны.** Установка и обновление из панели управления; совместимые редакторы открывают и сохраняют файлы на сервере.
|
||||
- **Один бинарник.** Debian amd64 и Windows amd64; отдельная СУБД и Node.js для запуска не нужны.
|
||||
|
||||
This project is a finished product which fulfills its goal: be a single binary web File Browser which can be run by anyone anywhere. That means that File Browser is currently on **maintenance-only** mode. Therefore, please note the following:
|
||||
## Запуск
|
||||
|
||||
- It can take a while until someone gets back to you. Please be patient.
|
||||
- [Issues](https://github.com/filebrowser/filebrowser/issues) are meant to track bugs. Unrelated issues will be converted into [discussions](https://github.com/filebrowser/filebrowser/discussions).
|
||||
- No new features will be implemented by maintainers. Pull requests for new features will be reviewed on a case by case basis.
|
||||
- The priority is triaging issues, addressing security issues and reviewing pull requests meant to solve bugs.
|
||||
```sh
|
||||
chmod +x filebrowser
|
||||
./filebrowser init
|
||||
./filebrowser
|
||||
```
|
||||
|
||||
## Contributing
|
||||
На Windows: `filebrowser.exe init`, затем `filebrowser.exe`. Мастер настраивает хранилище и SSO без `.env`. Подробности, systemd и nginx — в [инструкции](docs/deployment.md).
|
||||
|
||||
Contributions are always welcome. To start contributing to this project, read our [guidelines](CONTRIBUTING.md) first.
|
||||
Без SSO и пароля: `./filebrowser --no-sso` — все посетители получают административный доступ. [Как работает вход](docs/authentication.md).
|
||||
|
||||
## License
|
||||
## Сборка
|
||||
|
||||
[Apache License 2.0](LICENSE) © File Browser Contributors
|
||||
Go 1.26+, Node.js 24+, pnpm 10.33.4.
|
||||
|
||||
```sh
|
||||
cd frontend
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm run build
|
||||
pnpm test
|
||||
cd ..
|
||||
go test ./...
|
||||
go build -o filebrowser .
|
||||
```
|
||||
|
||||
Релиз для Debian: `sh scripts/build-release.sh` или `./scripts/build-release.ps1`. Архивы и контрольные суммы находятся в `build/`.
|
||||
|
||||
`dev` — разработка · `master` — страница проекта · `master-copy` — исходная версия upstream.
|
||||
|
||||
Независимый форк [File Browser](https://github.com/filebrowser/filebrowser). [Apache-2.0](LICENSE). [Безопасность и ограничения](docs/SECURITY-REVIEW.md).
|
||||
@@ -1,26 +1,9 @@
|
||||
# Security Policy
|
||||
# Безопасность
|
||||
|
||||
## Supported Versions
|
||||
Этот репозиторий — независимый форк File Browser. Политика архивированного upstream к нему не относится.
|
||||
|
||||
Use this section to tell people about which versions of your project are
|
||||
currently being supported with security updates.
|
||||
Ограничения и выполненные проверки: [обзор безопасности](docs/SECURITY-REVIEW.md).
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 2.x | :white_check_mark: |
|
||||
| < 2.0 | :x: |
|
||||
При обнаружении уязвимости сообщите владельцу этого форка приватно. Укажите версию или коммит, шаги воспроизведения и влияние. Не публикуйте токены, пароли и реальные медицинские файлы.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Vulnerabilities with critical impact should be reported on the [Security](https://github.com/filebrowser/filebrowser/security) page of this repository, which is a private way of communicating vulnerabilities to maintainers. This project is in maintenance-only mode and it can take a while until someone gets back to you.
|
||||
|
||||
If it is not a critical vulnerability, please open an issue and we will categorize it as a security issue. By giving visibility, we can get more help from the community at fixing such issues.
|
||||
|
||||
When reporting an issue, where possible, please provide at least:
|
||||
|
||||
* The commit version the issue was identified at
|
||||
* A proof of concept (plaintext; no binaries)
|
||||
* Steps to reproduce
|
||||
* Your recommended remediation(s), if any.
|
||||
|
||||
The File Browser team is a volunteer-only effort, and may reach back out for clarification.
|
||||
Для размещения в интернете используйте HTTPS и своевременно обновляйте сервер и аддоны. Наличие проверок не гарантирует отсутствия уязвимостей.
|
||||
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
@@ -14,3 +15,12 @@ type Auther interface {
|
||||
// LoginPage indicates if this auther needs a login page.
|
||||
LoginPage() bool
|
||||
}
|
||||
|
||||
const MethodSSO settings.AuthMethod = "sso"
|
||||
|
||||
type SSOAuth struct{}
|
||||
|
||||
func (SSOAuth) Auth(*http.Request, users.Store, *settings.Settings, *settings.Server) (*users.User, error) {
|
||||
return nil, errors.New("use OpenID Connect")
|
||||
}
|
||||
func (SSOAuth) LoginPage() bool { return true }
|
||||
@@ -1,298 +0,0 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
fberrors "github.com/filebrowser/filebrowser/v2/errors"
|
||||
"github.com/filebrowser/filebrowser/v2/files"
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/filebrowser/filebrowser/v2/users"
|
||||
)
|
||||
|
||||
// MethodHookAuth is used to identify hook auth.
|
||||
const MethodHookAuth settings.AuthMethod = "hook"
|
||||
|
||||
type hookCred struct {
|
||||
Password string `json:"password"`
|
||||
Username string `json:"username"`
|
||||
}
|
||||
|
||||
// HookAuth is a hook implementation of an Auther.
|
||||
type HookAuth struct {
|
||||
Users users.Store `json:"-"`
|
||||
Settings *settings.Settings `json:"-"`
|
||||
Server *settings.Server `json:"-"`
|
||||
Cred hookCred `json:"-"`
|
||||
Fields hookFields `json:"-"`
|
||||
Command string `json:"command"`
|
||||
}
|
||||
|
||||
// Auth authenticates the user via a json in content body.
|
||||
func (a *HookAuth) Auth(r *http.Request, usr users.Store, stg *settings.Settings, srv *settings.Server) (*users.User, error) {
|
||||
var cred hookCred
|
||||
|
||||
if r.Body == nil {
|
||||
return nil, os.ErrPermission
|
||||
}
|
||||
|
||||
err := json.NewDecoder(r.Body).Decode(&cred)
|
||||
if err != nil {
|
||||
return nil, os.ErrPermission
|
||||
}
|
||||
|
||||
a.Users = usr
|
||||
a.Settings = stg
|
||||
a.Server = srv
|
||||
a.Cred = cred
|
||||
|
||||
action, err := a.RunCommand()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch action {
|
||||
case "auth":
|
||||
u, err := a.SaveUser()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return u, nil
|
||||
case "block":
|
||||
return nil, os.ErrPermission
|
||||
case "pass":
|
||||
u, err := a.Users.Get(a.Server.Root, a.Cred.Username)
|
||||
if err != nil || !users.CheckPwd(a.Cred.Password, u.Password) {
|
||||
return nil, os.ErrPermission
|
||||
}
|
||||
return u, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("invalid hook action: %s", action)
|
||||
}
|
||||
}
|
||||
|
||||
// LoginPage tells that hook auth requires a login page.
|
||||
func (a *HookAuth) LoginPage() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// RunCommand starts the hook command and returns the action
|
||||
func (a *HookAuth) RunCommand() (string, error) {
|
||||
command := strings.Split(a.Command, " ")
|
||||
envMapping := func(key string) string {
|
||||
switch key {
|
||||
case "USERNAME":
|
||||
return a.Cred.Username
|
||||
case "PASSWORD":
|
||||
return a.Cred.Password
|
||||
default:
|
||||
return os.Getenv(key)
|
||||
}
|
||||
}
|
||||
for i, arg := range command {
|
||||
if i == 0 {
|
||||
continue
|
||||
}
|
||||
command[i] = os.Expand(arg, envMapping)
|
||||
}
|
||||
|
||||
cmd := exec.Command(command[0], command[1:]...)
|
||||
cmd.Env = append(os.Environ(), fmt.Sprintf("USERNAME=%s", a.Cred.Username))
|
||||
cmd.Env = append(cmd.Env, fmt.Sprintf("PASSWORD=%s", a.Cred.Password))
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
a.GetValues(string(out))
|
||||
|
||||
return a.Fields.Values["hook.action"], nil
|
||||
}
|
||||
|
||||
// GetValues creates a map with values from the key-value format string
|
||||
func (a *HookAuth) GetValues(s string) {
|
||||
m := map[string]string{}
|
||||
|
||||
// make line breaks consistent on Windows platform
|
||||
s = strings.ReplaceAll(s, "\r\n", "\n")
|
||||
|
||||
// iterate input lines
|
||||
for val := range strings.Lines(s) {
|
||||
v := strings.SplitN(val, "=", 2)
|
||||
|
||||
// skips non key and value format
|
||||
if len(v) != 2 {
|
||||
continue
|
||||
}
|
||||
|
||||
fieldKey := strings.TrimSpace(v[0])
|
||||
fieldValue := strings.TrimSpace(v[1])
|
||||
|
||||
if a.Fields.IsValid(fieldKey) {
|
||||
m[fieldKey] = fieldValue
|
||||
}
|
||||
}
|
||||
|
||||
a.Fields.Values = m
|
||||
}
|
||||
|
||||
// SaveUser updates the existing user or creates a new one when not found
|
||||
func (a *HookAuth) SaveUser() (*users.User, error) {
|
||||
u, err := a.Users.Get(a.Server.Root, a.Cred.Username)
|
||||
if err != nil && !errors.Is(err, fberrors.ErrNotExist) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if u == nil {
|
||||
pass, err := users.ValidateAndHashPwd(a.Cred.Password, a.Settings.MinimumPasswordLength)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// create user with the provided credentials
|
||||
d := &users.User{
|
||||
Username: a.Cred.Username,
|
||||
Password: pass,
|
||||
Scope: a.Settings.Defaults.Scope,
|
||||
Locale: a.Settings.Defaults.Locale,
|
||||
ViewMode: a.Settings.Defaults.ViewMode,
|
||||
SingleClick: a.Settings.Defaults.SingleClick,
|
||||
Sorting: a.Settings.Defaults.Sorting,
|
||||
Perm: a.Settings.Defaults.Perm,
|
||||
Commands: a.Settings.Defaults.Commands,
|
||||
HideDotfiles: a.Settings.Defaults.HideDotfiles,
|
||||
}
|
||||
u = a.GetUser(d)
|
||||
|
||||
userHome, err := a.Settings.MakeUserDir(u.Username, u.Scope, a.Server.Root)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("user: failed to mkdir user home dir: [%s]", userHome)
|
||||
}
|
||||
u.Scope = userHome
|
||||
log.Printf("user: %s, home dir: [%s].", u.Username, userHome)
|
||||
|
||||
err = a.Users.Save(u)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else if p := !users.CheckPwd(a.Cred.Password, u.Password); len(a.Fields.Values) > 1 || p {
|
||||
u = a.GetUser(u)
|
||||
|
||||
// update the password when it doesn't match the current
|
||||
if p {
|
||||
pass, err := users.ValidateAndHashPwd(a.Cred.Password, a.Settings.MinimumPasswordLength)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
u.Password = pass
|
||||
}
|
||||
|
||||
// update user with provided fields
|
||||
err := a.Users.Update(u)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return u, nil
|
||||
}
|
||||
|
||||
// GetUser returns a User filled with hook values or provided defaults
|
||||
func (a *HookAuth) GetUser(d *users.User) *users.User {
|
||||
// adds all permissions when user is admin
|
||||
isAdmin := a.Fields.GetBoolean("user.perm.admin", d.Perm.Admin)
|
||||
perms := users.Permissions{
|
||||
Admin: isAdmin,
|
||||
Execute: isAdmin || a.Fields.GetBoolean("user.perm.execute", d.Perm.Execute),
|
||||
Create: isAdmin || a.Fields.GetBoolean("user.perm.create", d.Perm.Create),
|
||||
Rename: isAdmin || a.Fields.GetBoolean("user.perm.rename", d.Perm.Rename),
|
||||
Modify: isAdmin || a.Fields.GetBoolean("user.perm.modify", d.Perm.Modify),
|
||||
Delete: isAdmin || a.Fields.GetBoolean("user.perm.delete", d.Perm.Delete),
|
||||
Share: isAdmin || a.Fields.GetBoolean("user.perm.share", d.Perm.Share),
|
||||
Download: isAdmin || a.Fields.GetBoolean("user.perm.download", d.Perm.Download),
|
||||
}
|
||||
user := users.User{
|
||||
ID: d.ID,
|
||||
Username: d.Username,
|
||||
Password: d.Password,
|
||||
Scope: a.Fields.GetString("user.scope", d.Scope),
|
||||
Locale: a.Fields.GetString("user.locale", d.Locale),
|
||||
ViewMode: users.ViewMode(a.Fields.GetString("user.viewMode", string(d.ViewMode))),
|
||||
SingleClick: a.Fields.GetBoolean("user.singleClick", d.SingleClick),
|
||||
Sorting: files.Sorting{
|
||||
Asc: a.Fields.GetBoolean("user.sorting.asc", d.Sorting.Asc),
|
||||
By: a.Fields.GetString("user.sorting.by", d.Sorting.By),
|
||||
},
|
||||
Commands: a.Fields.GetArray("user.commands", d.Commands),
|
||||
HideDotfiles: a.Fields.GetBoolean("user.hideDotfiles", d.HideDotfiles),
|
||||
Perm: perms,
|
||||
LockPassword: true,
|
||||
}
|
||||
|
||||
return &user
|
||||
}
|
||||
|
||||
// hookFields is used to access fields from the hook
|
||||
type hookFields struct {
|
||||
Values map[string]string
|
||||
}
|
||||
|
||||
// validHookFields contains names of the fields that can be used
|
||||
var validHookFields = []string{
|
||||
"hook.action",
|
||||
"user.scope",
|
||||
"user.locale",
|
||||
"user.viewMode",
|
||||
"user.singleClick",
|
||||
"user.sorting.by",
|
||||
"user.sorting.asc",
|
||||
"user.commands",
|
||||
"user.hideDotfiles",
|
||||
"user.perm.admin",
|
||||
"user.perm.execute",
|
||||
"user.perm.create",
|
||||
"user.perm.rename",
|
||||
"user.perm.modify",
|
||||
"user.perm.delete",
|
||||
"user.perm.share",
|
||||
"user.perm.download",
|
||||
}
|
||||
|
||||
// IsValid checks if the provided field is on the valid fields list
|
||||
func (hf *hookFields) IsValid(field string) bool {
|
||||
return slices.Contains(validHookFields, field)
|
||||
}
|
||||
|
||||
// GetString returns the string value or provided default
|
||||
func (hf *hookFields) GetString(k, dv string) string {
|
||||
val, ok := hf.Values[k]
|
||||
if ok {
|
||||
return val
|
||||
}
|
||||
return dv
|
||||
}
|
||||
|
||||
// GetBoolean returns the bool value or provided default
|
||||
func (hf *hookFields) GetBoolean(k string, dv bool) bool {
|
||||
val, ok := hf.Values[k]
|
||||
if ok {
|
||||
return val == "true"
|
||||
}
|
||||
return dv
|
||||
}
|
||||
|
||||
// GetArray returns the array value or provided default
|
||||
func (hf *hookFields) GetArray(k string, dv []string) []string {
|
||||
val, ok := hf.Values[k]
|
||||
if ok && strings.TrimSpace(val) != "" {
|
||||
return strings.Split(val, " ")
|
||||
}
|
||||
return dv
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/filebrowser/filebrowser/v2/users"
|
||||
)
|
||||
|
||||
// MethodJSONAuth is used to identify json auth.
|
||||
const MethodJSONAuth settings.AuthMethod = "json"
|
||||
|
||||
type jsonCred struct {
|
||||
Password string `json:"password"`
|
||||
Username string `json:"username"`
|
||||
ReCaptcha string `json:"recaptcha"`
|
||||
}
|
||||
|
||||
// JSONAuth is a json implementation of an Auther.
|
||||
type JSONAuth struct {
|
||||
ReCaptcha *ReCaptcha `json:"recaptcha" yaml:"recaptcha"`
|
||||
}
|
||||
|
||||
// Auth authenticates the user via a json in content body.
|
||||
func (a JSONAuth) Auth(r *http.Request, usr users.Store, _ *settings.Settings, srv *settings.Server) (*users.User, error) {
|
||||
var cred jsonCred
|
||||
|
||||
if r.Body == nil {
|
||||
return nil, os.ErrPermission
|
||||
}
|
||||
|
||||
err := json.NewDecoder(r.Body).Decode(&cred)
|
||||
if err != nil {
|
||||
return nil, os.ErrPermission
|
||||
}
|
||||
|
||||
// If ReCaptcha is enabled, check the code.
|
||||
if a.ReCaptcha != nil && a.ReCaptcha.Secret != "" {
|
||||
ok, err := a.ReCaptcha.Ok(cred.ReCaptcha)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !ok {
|
||||
return nil, os.ErrPermission
|
||||
}
|
||||
}
|
||||
|
||||
u, err := usr.Get(srv.Root, cred.Username)
|
||||
if err != nil || !users.CheckPwd(cred.Password, u.Password) {
|
||||
return nil, os.ErrPermission
|
||||
}
|
||||
|
||||
return u, nil
|
||||
}
|
||||
|
||||
// LoginPage tells that json auth doesn't require a login page.
|
||||
func (a JSONAuth) LoginPage() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
const reCaptchaAPI = "/recaptcha/api/siteverify"
|
||||
|
||||
// ReCaptcha identifies a recaptcha connection.
|
||||
type ReCaptcha struct {
|
||||
Host string `json:"host"`
|
||||
Key string `json:"key"`
|
||||
Secret string `json:"secret"`
|
||||
}
|
||||
|
||||
// Ok checks if a reCaptcha responde is correct.
|
||||
func (r *ReCaptcha) Ok(response string) (bool, error) {
|
||||
body := url.Values{}
|
||||
body.Set("secret", r.Secret)
|
||||
body.Add("response", response)
|
||||
|
||||
client := &http.Client{}
|
||||
|
||||
resp, err := client.Post(
|
||||
r.Host+reCaptchaAPI,
|
||||
"application/x-www-form-urlencoded",
|
||||
strings.NewReader(body.Encode()),
|
||||
)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
var data struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
err = json.NewDecoder(resp.Body).Decode(&data)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return data.Success, nil
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/filebrowser/filebrowser/v2/users"
|
||||
)
|
||||
|
||||
// MethodNoAuth is used to identify no auth.
|
||||
const MethodNoAuth settings.AuthMethod = "noauth"
|
||||
|
||||
// NoAuth is no auth implementation of auther.
|
||||
type NoAuth struct{}
|
||||
|
||||
// Auth uses authenticates user 1.
|
||||
func (a NoAuth) Auth(_ *http.Request, usr users.Store, _ *settings.Settings, srv *settings.Server) (*users.User, error) {
|
||||
return usr.Get(srv.Root, uint(1))
|
||||
}
|
||||
|
||||
// LoginPage tells that no auth doesn't require a login page.
|
||||
func (a NoAuth) LoginPage() bool {
|
||||
return false
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
fberrors "github.com/filebrowser/filebrowser/v2/errors"
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/filebrowser/filebrowser/v2/users"
|
||||
)
|
||||
|
||||
// MethodProxyAuth is used to identify no auth.
|
||||
const MethodProxyAuth settings.AuthMethod = "proxy"
|
||||
|
||||
// ProxyAuth is a proxy implementation of an auther.
|
||||
type ProxyAuth struct {
|
||||
Header string `json:"header"`
|
||||
}
|
||||
|
||||
// Auth authenticates the user via an HTTP header.
|
||||
func (a ProxyAuth) Auth(r *http.Request, usr users.Store, setting *settings.Settings, srv *settings.Server) (*users.User, error) {
|
||||
username := r.Header.Get(a.Header)
|
||||
user, err := usr.Get(srv.Root, username)
|
||||
if errors.Is(err, fberrors.ErrNotExist) {
|
||||
return a.createUser(usr, setting, srv, username)
|
||||
}
|
||||
return user, err
|
||||
}
|
||||
|
||||
func (a ProxyAuth) createUser(usr users.Store, setting *settings.Settings, srv *settings.Server, username string) (*users.User, error) {
|
||||
const randomPasswordLength = settings.DefaultMinimumPasswordLength + 10
|
||||
pwd, err := users.RandomPwd(randomPasswordLength)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var hashedRandomPassword string
|
||||
hashedRandomPassword, err = users.ValidateAndHashPwd(pwd, setting.MinimumPasswordLength)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
user := &users.User{
|
||||
Username: username,
|
||||
Password: hashedRandomPassword,
|
||||
LockPassword: true,
|
||||
}
|
||||
setting.Defaults.Apply(user)
|
||||
|
||||
var userHome string
|
||||
userHome, err = setting.MakeUserDir(user.Username, user.Scope, srv.Root)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
user.Scope = userHome
|
||||
|
||||
err = usr.Save(user)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return user, nil
|
||||
}
|
||||
|
||||
// LoginPage tells that proxy auth doesn't require a login page.
|
||||
func (a ProxyAuth) LoginPage() bool {
|
||||
return false
|
||||
}
|
||||
@@ -1,6 +1,3 @@
|
||||
package cmd
|
||||
|
||||
// Execute executes the commands.
|
||||
func Execute() error {
|
||||
return rootCmd.Execute()
|
||||
}
|
||||
func Execute() error { return rootCmd.Execute() }
|
||||
@@ -5,6 +5,10 @@ import (
|
||||
|
||||
"github.com/samber/lo"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"github.com/filebrowser/filebrowser/v2/auth"
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
)
|
||||
|
||||
// TestEnvCollisions ensures that there are no collisions in the produced environment
|
||||
@@ -33,3 +37,25 @@ func testEnvCollisions(t *testing.T, cmd *cobra.Command) {
|
||||
t.Errorf("Found duplicate environment variable keys for command %q: %v", cmd.Name(), duplicates)
|
||||
}
|
||||
}
|
||||
|
||||
// TestGetSettingsFollowExternalSymlinks ensures that the followExternalSymlinks
|
||||
// flag is persisted to the server config when set via "config set".
|
||||
func TestGetSettingsFollowExternalSymlinks(t *testing.T) {
|
||||
flags := pflag.NewFlagSet("test", pflag.ContinueOnError)
|
||||
addConfigFlags(flags)
|
||||
|
||||
if err := flags.Parse([]string{"--followExternalSymlinks"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
set := &settings.Settings{AuthMethod: auth.MethodSSO}
|
||||
ser := &settings.Server{}
|
||||
|
||||
if _, err := getSettings(flags, set, ser, &auth.SSOAuth{}, false); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if !ser.FollowExternalSymlinks {
|
||||
t.Error("expected FollowExternalSymlinks to be persisted as true")
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"github.com/filebrowser/filebrowser/v2/auth"
|
||||
fberrors "github.com/filebrowser/filebrowser/v2/errors"
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
)
|
||||
|
||||
@@ -35,26 +34,15 @@ func addConfigFlags(flags *pflag.FlagSet) {
|
||||
flags.Bool("hideLoginButton", false, "hide login button from public pages")
|
||||
flags.Bool("createUserDir", false, "generate user's home directory automatically")
|
||||
flags.Uint("minimumPasswordLength", settings.DefaultMinimumPasswordLength, "minimum password length for new users")
|
||||
flags.String("shell", "", "shell command to which other commands should be appended")
|
||||
|
||||
// NB: these are string so they can be presented as octal in the help text
|
||||
// as that's the conventional representation for modes in Unix.
|
||||
flags.String("fileMode", fmt.Sprintf("%O", settings.DefaultFileMode), "mode bits that new files are created with")
|
||||
flags.String("dirMode", fmt.Sprintf("%O", settings.DefaultDirMode), "mode bits that new directories are created with")
|
||||
|
||||
flags.String("auth.method", string(auth.MethodJSONAuth), "authentication type")
|
||||
flags.String("auth.header", "", "HTTP header for auth.method=proxy")
|
||||
flags.String("auth.command", "", "command for auth.method=hook")
|
||||
flags.String("auth.logoutPage", "", "url of custom logout page")
|
||||
|
||||
flags.String("recaptcha.host", "https://www.google.com", "use another host for ReCAPTCHA. recaptcha.net might be useful in China")
|
||||
flags.String("recaptcha.key", "", "ReCaptcha site key")
|
||||
flags.String("recaptcha.secret", "", "ReCaptcha secret")
|
||||
|
||||
flags.String("branding.name", "", "replace 'File Browser' by this name")
|
||||
flags.String("branding.theme", "", "set the theme")
|
||||
flags.String("branding.color", "", "set the theme color")
|
||||
flags.String("branding.files", "", "path to directory with images and custom styles")
|
||||
flags.Bool("branding.disableExternal", false, "disable external links such as GitHub links")
|
||||
flags.Bool("branding.disableUsedPercentage", false, "disable used disk percentage graph")
|
||||
|
||||
@@ -93,107 +81,8 @@ func getAuthMethod(flags *pflag.FlagSet, defaults ...interface{}) (settings.Auth
|
||||
return method, defaultAuther, nil
|
||||
}
|
||||
|
||||
func getProxyAuth(flags *pflag.FlagSet, defaultAuther map[string]interface{}) (auth.Auther, error) {
|
||||
header, err := flags.GetString("auth.header")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if header == "" {
|
||||
header = defaultAuther["header"].(string)
|
||||
}
|
||||
|
||||
if header == "" {
|
||||
return nil, errors.New("you must set the flag 'auth.header' for method 'proxy'")
|
||||
}
|
||||
|
||||
return &auth.ProxyAuth{Header: header}, nil
|
||||
}
|
||||
|
||||
func getNoAuth() auth.Auther {
|
||||
return &auth.NoAuth{}
|
||||
}
|
||||
|
||||
func getJSONAuth(flags *pflag.FlagSet, defaultAuther map[string]interface{}) (auth.Auther, error) {
|
||||
jsonAuth := &auth.JSONAuth{}
|
||||
host, err := flags.GetString("recaptcha.host")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
key, err := flags.GetString("recaptcha.key")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
secret, err := flags.GetString("recaptcha.secret")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if key == "" {
|
||||
if kmap, ok := defaultAuther["recaptcha"].(map[string]interface{}); ok {
|
||||
key = kmap["key"].(string)
|
||||
}
|
||||
}
|
||||
|
||||
if secret == "" {
|
||||
if smap, ok := defaultAuther["recaptcha"].(map[string]interface{}); ok {
|
||||
secret = smap["secret"].(string)
|
||||
}
|
||||
}
|
||||
|
||||
if key != "" && secret != "" {
|
||||
jsonAuth.ReCaptcha = &auth.ReCaptcha{
|
||||
Host: host,
|
||||
Key: key,
|
||||
Secret: secret,
|
||||
}
|
||||
}
|
||||
return jsonAuth, nil
|
||||
}
|
||||
|
||||
func getHookAuth(flags *pflag.FlagSet, defaultAuther map[string]interface{}) (auth.Auther, error) {
|
||||
command, err := flags.GetString("auth.command")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if command == "" {
|
||||
command = defaultAuther["command"].(string)
|
||||
}
|
||||
|
||||
if command == "" {
|
||||
return nil, errors.New("you must set the flag 'auth.command' for method 'hook'")
|
||||
}
|
||||
|
||||
return &auth.HookAuth{Command: command}, nil
|
||||
}
|
||||
|
||||
func getAuthentication(flags *pflag.FlagSet, defaults ...interface{}) (settings.AuthMethod, auth.Auther, error) {
|
||||
method, defaultAuther, err := getAuthMethod(flags, defaults...)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
var auther auth.Auther
|
||||
switch method {
|
||||
case auth.MethodProxyAuth:
|
||||
auther, err = getProxyAuth(flags, defaultAuther)
|
||||
case auth.MethodNoAuth:
|
||||
auther = getNoAuth()
|
||||
case auth.MethodJSONAuth:
|
||||
auther, err = getJSONAuth(flags, defaultAuther)
|
||||
case auth.MethodHookAuth:
|
||||
auther, err = getHookAuth(flags, defaultAuther)
|
||||
default:
|
||||
return "", nil, fberrors.ErrInvalidAuthMethod
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
return method, auther, nil
|
||||
func getAuthentication(_ *pflag.FlagSet, _ ...interface{}) (settings.AuthMethod, auth.Auther, error) {
|
||||
return auth.MethodSSO, &auth.SSOAuth{}, nil
|
||||
}
|
||||
|
||||
func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Auther) error {
|
||||
@@ -209,7 +98,6 @@ func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Aut
|
||||
|
||||
fmt.Fprintln(w, "\nBranding:")
|
||||
fmt.Fprintf(w, "\tName:\t%s\n", set.Branding.Name)
|
||||
fmt.Fprintf(w, "\tFiles override:\t%s\n", set.Branding.Files)
|
||||
fmt.Fprintf(w, "\tDisable external links:\t%t\n", set.Branding.DisableExternal)
|
||||
fmt.Fprintf(w, "\tDisable used disk percentage graph:\t%t\n", set.Branding.DisableUsedPercentage)
|
||||
fmt.Fprintf(w, "\tColor:\t%s\n", set.Branding.Color)
|
||||
@@ -229,6 +117,7 @@ func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Aut
|
||||
fmt.Fprintf(w, "\tThumbnails Enabled:\t%t\n", ser.EnableThumbnails)
|
||||
fmt.Fprintf(w, "\tResize Preview:\t%t\n", ser.ResizePreview)
|
||||
fmt.Fprintf(w, "\tType Detection by Header:\t%t\n", ser.TypeDetectionByHeader)
|
||||
fmt.Fprintf(w, "\tFollow External Symlinks:\t%t\n", ser.FollowExternalSymlinks)
|
||||
|
||||
fmt.Fprintln(w, "\nTUS:")
|
||||
fmt.Fprintf(w, "\tChunk size:\t%d\n", set.Tus.ChunkSize)
|
||||
@@ -236,10 +125,12 @@ func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Aut
|
||||
|
||||
fmt.Fprintln(w, "\nDefaults:")
|
||||
fmt.Fprintf(w, "\tScope:\t%s\n", set.Defaults.Scope)
|
||||
fmt.Fprintf(w, "\tDateFormat:\t%t\n", set.Defaults.DateFormat)
|
||||
fmt.Fprintf(w, "\tHideDotfiles:\t%t\n", set.Defaults.HideDotfiles)
|
||||
fmt.Fprintf(w, "\tLocale:\t%s\n", set.Defaults.Locale)
|
||||
fmt.Fprintf(w, "\tView mode:\t%s\n", set.Defaults.ViewMode)
|
||||
fmt.Fprintf(w, "\tSingle Click:\t%t\n", set.Defaults.SingleClick)
|
||||
fmt.Fprintf(w, "\tRedirect after Copy/Move:\t%t\n", set.Defaults.RedirectAfterCopyMove)
|
||||
fmt.Fprintf(w, "\tFile Creation Mode:\t%O\n", set.FileMode)
|
||||
fmt.Fprintf(w, "\tDirectory Creation Mode:\t%O\n", set.DirMode)
|
||||
fmt.Fprintf(w, "\tCommands:\t%s\n", strings.Join(set.Defaults.Commands, " "))
|
||||
@@ -308,6 +199,11 @@ func getSettings(flags *pflag.FlagSet, set *settings.Settings, ser *settings.Ser
|
||||
case "disableTypeDetectionByHeader":
|
||||
ser.TypeDetectionByHeader, err = flags.GetBool(flag.Name)
|
||||
ser.TypeDetectionByHeader = !ser.TypeDetectionByHeader
|
||||
case "disableImageResolutionCalc":
|
||||
ser.ImageResolutionCal, err = flags.GetBool(flag.Name)
|
||||
ser.ImageResolutionCal = !ser.ImageResolutionCal
|
||||
case "followExternalSymlinks":
|
||||
ser.FollowExternalSymlinks, err = flags.GetBool(flag.Name)
|
||||
|
||||
// Settings flags from [addConfigFlags]
|
||||
case "signup":
|
||||
@@ -338,8 +234,6 @@ func getSettings(flags *pflag.FlagSet, set *settings.Settings, ser *settings.Ser
|
||||
set.Branding.Theme, err = flags.GetString(flag.Name)
|
||||
case "branding.color":
|
||||
set.Branding.Color, err = flags.GetString(flag.Name)
|
||||
case "branding.files":
|
||||
set.Branding.Files, err = flags.GetString(flag.Name)
|
||||
case "branding.disableExternal":
|
||||
set.Branding.DisableExternal, err = flags.GetBool(flag.Name)
|
||||
case "branding.disableUsedPercentage":
|
||||
|
||||
@@ -3,7 +3,6 @@ package cmd
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -53,6 +52,10 @@ The path must be for a json or yaml file.`,
|
||||
return err
|
||||
}
|
||||
|
||||
if file.Settings == nil || file.Server == nil {
|
||||
return errors.New("invalid configuration file: 'settings' or 'server' fields are missing. Please ensure you are importing a file generated by the 'config export' command")
|
||||
}
|
||||
|
||||
file.Settings.Key = key
|
||||
err = st.Settings.Save(file.Settings)
|
||||
if err != nil {
|
||||
@@ -64,42 +67,12 @@ The path must be for a json or yaml file.`,
|
||||
return err
|
||||
}
|
||||
|
||||
var rawAuther interface{}
|
||||
if filepath.Ext(args[0]) != ".json" {
|
||||
rawAuther = cleanUpInterfaceMap(file.Auther.(map[interface{}]interface{}))
|
||||
} else {
|
||||
rawAuther = file.Auther
|
||||
file.Settings.AuthMethod = auth.MethodSSO
|
||||
auther := &auth.SSOAuth{}
|
||||
if err = st.Settings.Save(file.Settings); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var auther auth.Auther
|
||||
var autherErr error
|
||||
switch file.Settings.AuthMethod {
|
||||
case auth.MethodJSONAuth:
|
||||
var a interface{}
|
||||
a, autherErr = getAuther(auth.JSONAuth{}, rawAuther)
|
||||
auther = a.(*auth.JSONAuth)
|
||||
case auth.MethodNoAuth:
|
||||
var a interface{}
|
||||
a, autherErr = getAuther(auth.NoAuth{}, rawAuther)
|
||||
auther = a.(*auth.NoAuth)
|
||||
case auth.MethodProxyAuth:
|
||||
var a interface{}
|
||||
a, autherErr = getAuther(auth.ProxyAuth{}, rawAuther)
|
||||
auther = a.(*auth.ProxyAuth)
|
||||
case auth.MethodHookAuth:
|
||||
var a interface{}
|
||||
a, autherErr = getAuther(&auth.HookAuth{}, rawAuther)
|
||||
auther = a.(*auth.HookAuth)
|
||||
default:
|
||||
return errors.New("invalid auth method")
|
||||
}
|
||||
|
||||
if autherErr != nil {
|
||||
return autherErr
|
||||
}
|
||||
|
||||
err = st.Auth.Save(auther)
|
||||
if err != nil {
|
||||
if err = st.Auth.Save(auther); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
fbhttp "github.com/filebrowser/filebrowser/v2/http"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"golang.org/x/term"
|
||||
)
|
||||
|
||||
type initialConfig struct {
|
||||
CacheDir string `json:"cacheDir"`
|
||||
ImageProcessors int `json:"imageProcessors"`
|
||||
Address string `json:"address"`
|
||||
Port string `json:"port"`
|
||||
Root string `json:"root"`
|
||||
Database string `json:"database"`
|
||||
BaseURL string `json:"baseURL"`
|
||||
DisableExec bool `json:"disableExec"`
|
||||
SSO fbhttp.SSOConfig `json:"sso"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(initCmd)
|
||||
initCmd.Flags().String("output", ".filebrowser.json", "configuration file to create; existing files are never overwritten")
|
||||
}
|
||||
|
||||
var initCmd = &cobra.Command{
|
||||
Use: "init", Short: "Initial setup: SSO, file directory and database", Args: cobra.NoArgs,
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
out, _ := cmd.Flags().GetString("output")
|
||||
out, err := filepath.Abs(out)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err = os.Stat(out); err == nil {
|
||||
return errors.New("configuration already exists; edit it or select another --output")
|
||||
} else if !os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
reader := bufio.NewReader(cmd.InOrStdin())
|
||||
ask := func(label, fallback string) (string, error) {
|
||||
fmt.Fprintf(cmd.OutOrStdout(), "%s [%s]: ", label, fallback)
|
||||
line, err := reader.ReadString('\n')
|
||||
if err != nil && !(errors.Is(err, io.EOF) && line != "") {
|
||||
return "", err
|
||||
}
|
||||
line = strings.TrimSpace(line)
|
||||
if line == "" {
|
||||
line = fallback
|
||||
}
|
||||
return line, nil
|
||||
}
|
||||
var c initialConfig
|
||||
fmt.Fprintln(cmd.OutOrStdout(), "File Browser — initial setup\nSSO roles Master Admin and FS Admin grant administrator access.")
|
||||
if c.SSO.Issuer, err = ask("SSO issuer URL", "https://sso.anidev.ru"); err != nil {
|
||||
return err
|
||||
}
|
||||
if c.SSO.ClientID, err = ask("SSO Client ID", ""); err != nil {
|
||||
return err
|
||||
}
|
||||
if term.IsTerminal(int(os.Stdin.Fd())) && cmd.InOrStdin() == os.Stdin {
|
||||
fmt.Fprint(cmd.OutOrStdout(), "SSO Client secret (hidden): ")
|
||||
var secret []byte
|
||||
secret, err = term.ReadPassword(int(os.Stdin.Fd()))
|
||||
c.SSO.ClientSecret = strings.TrimSpace(string(secret))
|
||||
fmt.Fprintln(cmd.OutOrStdout())
|
||||
} else {
|
||||
c.SSO.ClientSecret, err = ask("SSO Client secret", "")
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if c.SSO.PublicURL, err = ask("Public File Browser URL", "https://files.anidev.ru"); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = validateSetupURL(c.SSO.Issuer); err != nil {
|
||||
return fmt.Errorf("issuer: %w", err)
|
||||
}
|
||||
if err = validateSetupURL(c.SSO.PublicURL); err != nil {
|
||||
return fmt.Errorf("public URL: %w", err)
|
||||
}
|
||||
if c.SSO.ClientID == "" || c.SSO.ClientSecret == "" {
|
||||
return errors.New("Client ID and secret are required")
|
||||
}
|
||||
if c.Root, err = ask("File directory", "./files"); err != nil {
|
||||
return err
|
||||
}
|
||||
if c.Database, err = ask("Database path", "./filebrowser.db"); err != nil {
|
||||
return err
|
||||
}
|
||||
if c.Address, err = ask("Listen address", "127.0.0.1"); err != nil {
|
||||
return err
|
||||
}
|
||||
if c.Port, err = ask("Listen port", "8080"); err != nil {
|
||||
return err
|
||||
}
|
||||
port, e := strconv.Atoi(c.Port)
|
||||
if e != nil || port < 1 || port > 65535 {
|
||||
return errors.New("invalid port")
|
||||
}
|
||||
c.Root, err = filepath.Abs(c.Root)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Database, err = filepath.Abs(c.Database)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.CacheDir = filepath.Join(filepath.Dir(c.Database), "cache")
|
||||
c.ImageProcessors = min(2, runtime.NumCPU())
|
||||
public, _ := url.Parse(c.SSO.PublicURL)
|
||||
c.BaseURL = strings.TrimRight(public.Path, "/")
|
||||
c.SSO.RedirectURI = strings.TrimRight(c.SSO.PublicURL, "/") + "/auth/callback"
|
||||
c.DisableExec = true
|
||||
if err = os.MkdirAll(c.Root, 0750); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = os.MkdirAll(filepath.Dir(c.Database), 0700); err != nil {
|
||||
return err
|
||||
}
|
||||
b, err := json.MarshalIndent(c, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
f, err := os.OpenFile(out, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = f.Write(append(b, '\n'))
|
||||
closeErr := f.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if closeErr != nil {
|
||||
return closeErr
|
||||
}
|
||||
bootstrapCmd := &cobra.Command{Use: "bootstrap"}
|
||||
bootstrapCmd.Flags().String("config", out, "")
|
||||
bootstrapCmd.Flags().String("database", c.Database, "")
|
||||
addServerFlags(bootstrapCmd.Flags())
|
||||
bootstrap := withViperAndStore(func(_ *cobra.Command, _ []string, v *viper.Viper, st *store) error {
|
||||
if !st.databaseExisted {
|
||||
return quickSetup(v, st.Storage)
|
||||
}
|
||||
return nil
|
||||
}, storeOptions{allowsNoDatabase: true})
|
||||
if err = bootstrap(bootstrapCmd, nil); err != nil {
|
||||
return fmt.Errorf("configuration saved; database setup failed: %w", err)
|
||||
}
|
||||
fmt.Fprintf(cmd.OutOrStdout(), "\nSaved %s (0600).\nRegister this callback in SSO:\n%s/auth/callback\nStart: filebrowser --config %q\n", out, strings.TrimRight(c.SSO.PublicURL, "/"), out)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
func validateSetupURL(raw string) error {
|
||||
u, err := url.Parse(raw)
|
||||
if err != nil || u.Host == "" || u.User != nil || u.RawQuery != "" || u.Fragment != "" || (u.Scheme != "https" && !(u.Scheme == "http" && (u.Hostname() == "localhost" || u.Hostname() == "127.0.0.1"))) {
|
||||
return errors.New("use an HTTPS URL; HTTP is allowed only on loopback")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestInitWizard(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
configPath := filepath.Join(dir, "settings.json")
|
||||
input := strings.Join([]string{"https://sso.example.test", "client-id", "client-secret", "https://files.example.test", filepath.Join(dir, "files"), filepath.Join(dir, "files.db"), "127.0.0.1", "8080", ""}, "\n")
|
||||
var output bytes.Buffer
|
||||
initCmd.SetIn(strings.NewReader(input))
|
||||
initCmd.SetOut(&output)
|
||||
defer func() { initCmd.SetIn(nil); initCmd.SetOut(nil) }()
|
||||
if err := initCmd.Flags().Set("output", configPath); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := initCmd.RunE(initCmd, nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var c initialConfig
|
||||
b, err := os.ReadFile(configPath)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err = json.Unmarshal(b, &c); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if c.SSO.ClientSecret != "client-secret" || !c.DisableExec || c.Root != filepath.Join(dir, "files") {
|
||||
t.Fatal("configuration lost")
|
||||
}
|
||||
if strings.Contains(output.String(), "client-secret") {
|
||||
t.Fatal("secret leaked to output")
|
||||
}
|
||||
if _, err = os.Stat(c.Database); err != nil {
|
||||
t.Fatal("database not initialized", err)
|
||||
}
|
||||
if !strings.Contains(output.String(), "https://files.example.test/auth/callback") {
|
||||
t.Fatal("callback missing")
|
||||
}
|
||||
initCmd.SetIn(strings.NewReader(input))
|
||||
if err = initCmd.RunE(initCmd, nil); err == nil {
|
||||
t.Fatal("existing configuration overwritten")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestOnlyExplicitNoSSOFlagSkipsInitialSSOSetup(t *testing.T) {
|
||||
for _, enabled := range []bool{false, true} {
|
||||
dir := t.TempDir()
|
||||
config := filepath.Join(dir, "config.json")
|
||||
// A JSON setting must not enable this process-only bypass.
|
||||
if err := os.WriteFile(config, []byte(`{"no-sso":true}`), 0600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
command := &cobra.Command{Use: "filebrowser"}
|
||||
command.Flags().String("config", config, "")
|
||||
command.Flags().String("database", filepath.Join(dir, "test.db"), "")
|
||||
command.Flags().Bool("no-sso", false, "")
|
||||
if enabled {
|
||||
command.Flags().Set("no-sso", "true")
|
||||
}
|
||||
called := false
|
||||
err := withViperAndStore(func(_ *cobra.Command, _ []string, _ *viper.Viper, _ *store) error { called = true; return nil }, storeOptions{allowsNoDatabase: true})(command, nil)
|
||||
if enabled && (err != nil || !called) {
|
||||
t.Fatalf("explicit flag blocked: %v", err)
|
||||
}
|
||||
if !enabled && (err == nil || called) {
|
||||
t.Fatal("configuration silently enabled no-sso")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
@@ -46,6 +47,7 @@ var (
|
||||
"disable-type-detection-by-header": "disableTypeDetectionByHeader",
|
||||
"img-processors": "imageProcessors",
|
||||
"cache-dir": "cacheDir",
|
||||
"redis-cache-url": "redisCacheUrl",
|
||||
"token-expiration-time": "tokenExpirationTime",
|
||||
"baseurl": "baseURL",
|
||||
}
|
||||
@@ -83,11 +85,10 @@ func init() {
|
||||
|
||||
// Runtime flags for the root command
|
||||
flags := rootCmd.Flags()
|
||||
flags.Bool("noauth", false, "use the noauth auther when using quick setup")
|
||||
flags.String("username", "admin", "username for the first user when using quick setup")
|
||||
flags.String("password", "", "hashed password for the first user when using quick setup")
|
||||
flags.Bool("no-sso", false, "start without SSO or passwords; everyone with network access is an administrator")
|
||||
flags.Uint32("socketPerm", 0666, "unix socket file permissions")
|
||||
flags.String("cacheDir", "", "file cache directory (disabled if empty)")
|
||||
flags.String("redisCacheUrl", "", "redis cache URL (for multi-instance deployments), e.g. redis://user:pass@host:port")
|
||||
flags.Int("imageProcessors", 4, "image processors count")
|
||||
addServerFlags(flags)
|
||||
}
|
||||
@@ -108,6 +109,8 @@ func addServerFlags(flags *pflag.FlagSet) {
|
||||
flags.Bool("disablePreviewResize", false, "disable resize of image previews")
|
||||
flags.Bool("disableExec", true, "disables Command Runner feature")
|
||||
flags.Bool("disableTypeDetectionByHeader", false, "disables type detection by reading file headers")
|
||||
flags.Bool("disableImageResolutionCalc", false, "disables image resolution calculation by reading image files")
|
||||
flags.Bool("followExternalSymlinks", false, "follow symlinks whose target is outside the user scope (unsafe)")
|
||||
}
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
@@ -117,36 +120,8 @@ var rootCmd = &cobra.Command{
|
||||
manage your users and all the configurations without accessing the
|
||||
web interface.
|
||||
|
||||
If you've never run File Browser, you'll need to have a database for
|
||||
it. Don't worry: you don't need to setup a separate database server.
|
||||
We're using Bolt DB which is a single file database and all managed
|
||||
by ourselves.
|
||||
|
||||
For this command, all flags are available as environmental variables,
|
||||
except for "--config", which specifies the configuration file to use.
|
||||
The environment variables are prefixed by "FB_" followed by the flag name in
|
||||
UPPER_SNAKE_CASE. For example, the flag "--disablePreviewResize" is available
|
||||
as FB_DISABLE_PREVIEW_RESIZE.
|
||||
|
||||
If "--config" is not specified, File Browser will look for a configuration
|
||||
file named .filebrowser.{json, toml, yaml, yml} in the following directories:
|
||||
|
||||
- ./
|
||||
- $HOME/
|
||||
- /etc/filebrowser/
|
||||
|
||||
The precedence of the configuration values are as follows:
|
||||
|
||||
- Flags
|
||||
- Environment variables
|
||||
- Configuration file
|
||||
- Database values
|
||||
- Defaults
|
||||
|
||||
Also, if the database path doesn't exist, File Browser will enter into
|
||||
the quick setup mode and a new database will be bootstrapped and a new
|
||||
user created with the credentials from options "username" and "password".`,
|
||||
RunE: withViperAndStore(func(_ *cobra.Command, _ []string, v *viper.Viper, st *store) error {
|
||||
Run filebrowser init for initial setup. It creates the configuration file, prepares the database and prints the SSO callback URL. Local password accounts and command execution are not supported. Use --no-sso to start without SSO or passwords, granting administrator access to all visitors. Runtime options can still be overridden using flags or FB_ environment variables.`,
|
||||
RunE: withViperAndStore(func(cmd *cobra.Command, _ []string, v *viper.Viper, st *store) error {
|
||||
if !st.databaseExisted {
|
||||
err := quickSetup(v, st.Storage)
|
||||
if err != nil {
|
||||
@@ -170,12 +145,20 @@ user created with the credentials from options "username" and "password".`,
|
||||
fileCache = diskcache.New(afero.NewOsFs(), cacheDir)
|
||||
}
|
||||
|
||||
redisCacheURL := v.GetString("redisCacheUrl")
|
||||
uploadCache, err := fbhttp.NewUploadCache(redisCacheURL)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to initialize upload cache: %w", err)
|
||||
}
|
||||
|
||||
server, err := getServerSettings(v, st.Storage)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
setupLog(server.Log)
|
||||
|
||||
log.Println("File Browser")
|
||||
|
||||
root, err := filepath.Abs(server.Root)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -221,7 +204,24 @@ user created with the credentials from options "username" and "password".`,
|
||||
panic(err)
|
||||
}
|
||||
|
||||
handler, err := fbhttp.NewHandler(imageService, fileCache, st.Storage, server, assetsFs)
|
||||
// Execution hooks and external symlinks are never enabled in this fork.
|
||||
server.EnableExec = false
|
||||
server.FollowExternalSymlinks = false
|
||||
var authentication interface {
|
||||
Wrap(http.Handler) http.Handler
|
||||
}
|
||||
noSSO, _ := cmd.Flags().GetBool("no-sso")
|
||||
if noSSO {
|
||||
authentication, err = fbhttp.NewNoSSO(st.Storage, server)
|
||||
log.Println("--no-sso: authentication disabled; all visitors have administrator access")
|
||||
} else {
|
||||
authentication, err = fbhttp.NewSSO(context.Background(), st.Storage, server, fbhttp.SSOConfig{Issuer: v.GetString("sso.issuer"), ClientID: v.GetString("sso.clientID"), ClientSecret: v.GetString("sso.clientSecret"), PublicURL: v.GetString("sso.publicURL"), RedirectURI: v.GetString("sso.redirectURI")})
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
handler, err := fbhttp.NewHandler(imageService, fileCache, uploadCache, st.Storage, server, assetsFs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -230,8 +230,10 @@ user created with the credentials from options "username" and "password".`,
|
||||
|
||||
log.Println("Listening on", listener.Addr().String())
|
||||
srv := &http.Server{
|
||||
Handler: handler,
|
||||
ReadHeaderTimeout: 60 * time.Second,
|
||||
Handler: authentication.Wrap(handler),
|
||||
ReadHeaderTimeout: 10 * time.Second,
|
||||
IdleTimeout: 90 * time.Second,
|
||||
MaxHeaderBytes: 1 << 20,
|
||||
}
|
||||
|
||||
go func() {
|
||||
@@ -331,10 +333,18 @@ func getServerSettings(v *viper.Viper, st *storage.Storage) (*settings.Server, e
|
||||
server.TypeDetectionByHeader = !v.GetBool("disableTypeDetectionByHeader")
|
||||
}
|
||||
|
||||
if v.IsSet("disableImageResolutionCalc") {
|
||||
server.ImageResolutionCal = !v.GetBool("disableImageResolutionCalc")
|
||||
}
|
||||
|
||||
if v.IsSet("disableExec") {
|
||||
server.EnableExec = !v.GetBool("disableExec")
|
||||
}
|
||||
|
||||
if v.IsSet("followExternalSymlinks") {
|
||||
server.FollowExternalSymlinks = v.GetBool("followExternalSymlinks")
|
||||
}
|
||||
|
||||
if isAddrSet && isSocketSet {
|
||||
return nil, errors.New("--socket flag cannot be used with --address, --port, --key nor --cert")
|
||||
}
|
||||
@@ -351,6 +361,25 @@ func getServerSettings(v *viper.Viper, st *storage.Storage) (*settings.Server, e
|
||||
log.Println("WARNING: read https://github.com/filebrowser/filebrowser/issues/5199")
|
||||
}
|
||||
|
||||
if server.FollowExternalSymlinks {
|
||||
log.Println("WARNING: Following external symlinks enabled!")
|
||||
log.Println("WARNING: Symlinks pointing outside a user's scope will be followed,")
|
||||
log.Println("WARNING: which can expose files outside that scope. Only enable this if")
|
||||
log.Println("WARNING: you fully understand and trust the contents of every user scope.")
|
||||
}
|
||||
|
||||
if set, err := st.Settings.Get(); err == nil && set.Signup {
|
||||
scope := strings.TrimSpace(set.Defaults.Scope)
|
||||
scopeIsRoot := scope == "" || scope == "." || scope == "/"
|
||||
|
||||
if !set.CreateUserDir && scopeIsRoot {
|
||||
log.Println("WARNING: Signup is enabled without createUserDir and the default scope is")
|
||||
log.Println("WARNING: the server root, so every self-registered user can read, modify and")
|
||||
log.Println("WARNING: delete all files File Browser serves, including other users' files.")
|
||||
log.Println("WARNING: Enable createUserDir, or set a default scope other than the root.")
|
||||
}
|
||||
}
|
||||
|
||||
return server, nil
|
||||
}
|
||||
|
||||
@@ -383,13 +412,14 @@ func quickSetup(v *viper.Viper, s *storage.Storage) error {
|
||||
MinimumPasswordLength: settings.DefaultMinimumPasswordLength,
|
||||
UserHomeBasePath: settings.DefaultUsersHomeBasePath,
|
||||
Defaults: settings.UserDefaults{
|
||||
Scope: ".",
|
||||
Locale: "en",
|
||||
SingleClick: false,
|
||||
AceEditorTheme: v.GetString("defaults.aceEditorTheme"),
|
||||
Scope: ".",
|
||||
Locale: "en",
|
||||
SingleClick: false,
|
||||
RedirectAfterCopyMove: true,
|
||||
AceEditorTheme: v.GetString("defaults.aceEditorTheme"),
|
||||
Perm: users.Permissions{
|
||||
Admin: false,
|
||||
Execute: true,
|
||||
Execute: false,
|
||||
Create: true,
|
||||
Rename: true,
|
||||
Modify: true,
|
||||
@@ -409,36 +439,31 @@ func quickSetup(v *viper.Viper, s *storage.Storage) error {
|
||||
Rules: nil,
|
||||
}
|
||||
|
||||
var err error
|
||||
if v.GetBool("noauth") {
|
||||
set.AuthMethod = auth.MethodNoAuth
|
||||
err = s.Auth.Save(&auth.NoAuth{})
|
||||
} else {
|
||||
set.AuthMethod = auth.MethodJSONAuth
|
||||
err = s.Auth.Save(&auth.JSONAuth{})
|
||||
}
|
||||
set.AuthMethod = auth.MethodSSO
|
||||
err := s.Auth.Save(&auth.SSOAuth{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = s.Settings.Save(set)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ser := &settings.Server{
|
||||
BaseURL: v.GetString("baseURL"),
|
||||
Port: v.GetString("port"),
|
||||
Log: v.GetString("log"),
|
||||
TLSKey: v.GetString("key"),
|
||||
TLSCert: v.GetString("cert"),
|
||||
Address: v.GetString("address"),
|
||||
Root: v.GetString("root"),
|
||||
TokenExpirationTime: v.GetString("tokenExpirationTime"),
|
||||
EnableThumbnails: !v.GetBool("disableThumbnails"),
|
||||
ResizePreview: !v.GetBool("disablePreviewResize"),
|
||||
EnableExec: !v.GetBool("disableExec"),
|
||||
TypeDetectionByHeader: !v.GetBool("disableTypeDetectionByHeader"),
|
||||
BaseURL: v.GetString("baseURL"),
|
||||
Port: v.GetString("port"),
|
||||
Log: v.GetString("log"),
|
||||
TLSKey: v.GetString("key"),
|
||||
TLSCert: v.GetString("cert"),
|
||||
Address: v.GetString("address"),
|
||||
Root: v.GetString("root"),
|
||||
TokenExpirationTime: v.GetString("tokenExpirationTime"),
|
||||
EnableThumbnails: !v.GetBool("disableThumbnails"),
|
||||
ResizePreview: !v.GetBool("disablePreviewResize"),
|
||||
EnableExec: !v.GetBool("disableExec"),
|
||||
TypeDetectionByHeader: !v.GetBool("disableTypeDetectionByHeader"),
|
||||
ImageResolutionCal: !v.GetBool("disableImageResolutionCalc"),
|
||||
FollowExternalSymlinks: v.GetBool("followExternalSymlinks"),
|
||||
}
|
||||
|
||||
err = s.Settings.SaveServer(ser)
|
||||
@@ -446,37 +471,5 @@ func quickSetup(v *viper.Viper, s *storage.Storage) error {
|
||||
return err
|
||||
}
|
||||
|
||||
username := v.GetString("username")
|
||||
password := v.GetString("password")
|
||||
|
||||
if password == "" {
|
||||
var pwd string
|
||||
pwd, err = users.RandomPwd(set.MinimumPasswordLength)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Printf("User '%s' initialized with randomly generated password: %s\n", username, pwd)
|
||||
password, err = users.ValidateAndHashPwd(pwd, set.MinimumPasswordLength)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
log.Printf("User '%s' initialize wth user-provided password\n", username)
|
||||
}
|
||||
|
||||
if username == "" || password == "" {
|
||||
log.Fatal("username and password cannot be empty during quick setup")
|
||||
}
|
||||
|
||||
user := &users.User{
|
||||
Username: username,
|
||||
Password: password,
|
||||
LockPassword: false,
|
||||
}
|
||||
|
||||
set.Defaults.Apply(user)
|
||||
user.Perm.Admin = true
|
||||
|
||||
return s.Users.Save(user)
|
||||
return nil
|
||||
}
|
||||
@@ -36,7 +36,7 @@ func runRules(st *storage.Storage, cmd *cobra.Command, usersFn func(*users.User)
|
||||
}
|
||||
if id != nil {
|
||||
var user *users.User
|
||||
user, err = st.Users.Get("", id)
|
||||
user, err = st.Users.Get("", false, id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(usersCmd)
|
||||
// Local password account management is removed; users are provisioned by SSO.
|
||||
}
|
||||
|
||||
var usersCmd = &cobra.Command{
|
||||
@@ -27,16 +27,17 @@ var usersCmd = &cobra.Command{
|
||||
|
||||
func printUsers(usrs []*users.User) {
|
||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||
fmt.Fprintln(w, "ID\tUsername\tScope\tLocale\tV. Mode\tS.Click\tAdmin\tExecute\tCreate\tRename\tModify\tDelete\tShare\tDownload\tPwd Lock")
|
||||
fmt.Fprintln(w, "ID\tUsername\tScope\tLocale\tV. Mode\tS.Click\tRed. After C/M\tAdmin\tExecute\tCreate\tRename\tModify\tDelete\tShare\tDownload\tPwd Lock")
|
||||
|
||||
for _, u := range usrs {
|
||||
fmt.Fprintf(w, "%d\t%s\t%s\t%s\t%s\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t\n",
|
||||
fmt.Fprintf(w, "%d\t%s\t%s\t%s\t%s\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t\n",
|
||||
u.ID,
|
||||
u.Username,
|
||||
u.Scope,
|
||||
u.Locale,
|
||||
u.ViewMode,
|
||||
u.SingleClick,
|
||||
u.RedirectAfterCopyMove,
|
||||
u.Perm.Admin,
|
||||
u.Perm.Execute,
|
||||
u.Perm.Create,
|
||||
@@ -77,8 +78,9 @@ func addUserFlags(flags *pflag.FlagSet) {
|
||||
flags.String("locale", "en", "locale for users")
|
||||
flags.String("viewMode", string(users.ListViewMode), "view mode for users")
|
||||
flags.Bool("singleClick", false, "use single clicks only")
|
||||
flags.Bool("redirectAfterCopyMove", false, "redirect to destination after copy/move")
|
||||
flags.Bool("dateFormat", false, "use date format (true for absolute time, false for relative)")
|
||||
flags.Bool("hideDotfiles", false, "hide dotfiles")
|
||||
flags.Bool("hideDotfiles", false, "hide dotfiles in file listings")
|
||||
flags.String("aceEditorTheme", "", "ace editor's syntax highlighting theme for users")
|
||||
}
|
||||
|
||||
@@ -110,6 +112,8 @@ func getUserDefaults(flags *pflag.FlagSet, defaults *settings.UserDefaults, all
|
||||
defaults.ViewMode, err = getAndParseViewMode(flags)
|
||||
case "singleClick":
|
||||
defaults.SingleClick, err = flags.GetBool(flag.Name)
|
||||
case "redirectAfterCopyMove":
|
||||
defaults.RedirectAfterCopyMove, err = flags.GetBool(flag.Name)
|
||||
case "aceEditorTheme":
|
||||
defaults.AceEditorTheme, err = flags.GetString(flag.Name)
|
||||
case "perm.admin":
|
||||
@@ -134,6 +138,8 @@ func getUserDefaults(flags *pflag.FlagSet, defaults *settings.UserDefaults, all
|
||||
defaults.Sorting.By, err = flags.GetString(flag.Name)
|
||||
case "sorting.asc":
|
||||
defaults.Sorting.Asc, err = flags.GetBool(flag.Name)
|
||||
case "dateFormat":
|
||||
defaults.DateFormat, err = flags.GetBool(flag.Name)
|
||||
case "hideDotfiles":
|
||||
defaults.HideDotfiles, err = flags.GetBool(flag.Name)
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ var usersExportCmd = &cobra.Command{
|
||||
path to the file where you want to write the users.`,
|
||||
Args: jsonYamlArg,
|
||||
RunE: withStore(func(_ *cobra.Command, args []string, st *store) error {
|
||||
list, err := st.Users.Gets("")
|
||||
list, err := st.Users.Gets("", false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -36,14 +36,14 @@ var findUsers = withStore(func(_ *cobra.Command, args []string, st *store) error
|
||||
if len(args) == 1 {
|
||||
username, id := parseUsernameOrID(args[0])
|
||||
if username != "" {
|
||||
user, err = st.Users.Get("", username)
|
||||
user, err = st.Users.Get("", false, username)
|
||||
} else {
|
||||
user, err = st.Users.Get("", id)
|
||||
user, err = st.Users.Get("", false, id)
|
||||
}
|
||||
|
||||
list = []*users.User{user}
|
||||
} else {
|
||||
list, err = st.Users.Gets("")
|
||||
list, err = st.Users.Gets("", false)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -40,7 +40,7 @@ list or set it to 0.`,
|
||||
}
|
||||
|
||||
for _, user := range list {
|
||||
err = user.Clean("")
|
||||
err = user.Clean("", false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -52,7 +52,7 @@ list or set it to 0.`,
|
||||
}
|
||||
|
||||
if replace {
|
||||
oldUsers, userImportErr := st.Users.Gets("")
|
||||
oldUsers, userImportErr := st.Users.Gets("", false)
|
||||
if userImportErr != nil {
|
||||
return userImportErr
|
||||
}
|
||||
@@ -76,7 +76,7 @@ list or set it to 0.`,
|
||||
}
|
||||
|
||||
for _, user := range list {
|
||||
onDB, err := st.Users.Get("", user.ID)
|
||||
onDB, err := st.Users.Get("", false, user.ID)
|
||||
|
||||
// User exists in DB.
|
||||
if err == nil {
|
||||
@@ -88,7 +88,7 @@ list or set it to 0.`,
|
||||
// with the new username. If there is, print an error and cancel the
|
||||
// operation
|
||||
if user.Username != onDB.Username {
|
||||
if conflictuous, err := st.Users.Get("", user.Username); err == nil {
|
||||
if conflictuous, err := st.Users.Get("", false, user.Username); err == nil {
|
||||
return usernameConflictError(user.Username, conflictuous.ID, user.ID)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,22 +43,23 @@ options you want to change.`,
|
||||
user *users.User
|
||||
)
|
||||
if id != 0 {
|
||||
user, err = st.Users.Get("", id)
|
||||
user, err = st.Users.Get("", false, id)
|
||||
} else {
|
||||
user, err = st.Users.Get("", username)
|
||||
user, err = st.Users.Get("", false, username)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defaults := settings.UserDefaults{
|
||||
Scope: user.Scope,
|
||||
Locale: user.Locale,
|
||||
ViewMode: user.ViewMode,
|
||||
SingleClick: user.SingleClick,
|
||||
Perm: user.Perm,
|
||||
Sorting: user.Sorting,
|
||||
Commands: user.Commands,
|
||||
Scope: user.Scope,
|
||||
Locale: user.Locale,
|
||||
ViewMode: user.ViewMode,
|
||||
SingleClick: user.SingleClick,
|
||||
RedirectAfterCopyMove: user.RedirectAfterCopyMove,
|
||||
Perm: user.Perm,
|
||||
Sorting: user.Sorting,
|
||||
Commands: user.Commands,
|
||||
}
|
||||
|
||||
err = getUserDefaults(flags, &defaults, false)
|
||||
@@ -70,6 +71,7 @@ options you want to change.`,
|
||||
user.Locale = defaults.Locale
|
||||
user.ViewMode = defaults.ViewMode
|
||||
user.SingleClick = defaults.SingleClick
|
||||
user.RedirectAfterCopyMove = defaults.RedirectAfterCopyMove
|
||||
user.Perm = defaults.Perm
|
||||
user.Commands = defaults.Commands
|
||||
user.Sorting = defaults.Sorting
|
||||
|
||||
@@ -3,7 +3,6 @@ package cmd
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"log"
|
||||
"os"
|
||||
@@ -119,7 +118,8 @@ func initViper(cmd *cobra.Command) (*viper.Viper, error) {
|
||||
|
||||
// Read in configuration
|
||||
if err := v.ReadInConfig(); err != nil {
|
||||
if errors.Is(err, viper.ConfigParseError{}) {
|
||||
|
||||
if errors.As(err, &viper.ConfigParseError{}) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -153,6 +153,10 @@ func withViperAndStore(fn func(cmd *cobra.Command, args []string, v *viper.Viper
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
noSSO, _ := cmd.Flags().GetBool("no-sso")
|
||||
if cmd.Parent() == nil && cmd.Use == "filebrowser" && !noSSO && (v.GetString("sso.issuer") == "" || v.GetString("sso.clientID") == "" || v.GetString("sso.clientSecret") == "" || v.GetString("sso.publicURL") == "") {
|
||||
return errors.New("initial setup required: run filebrowser init")
|
||||
}
|
||||
|
||||
path, err := filepath.Abs(v.GetString("database"))
|
||||
if err != nil {
|
||||
@@ -249,33 +253,6 @@ func jsonYamlArg(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
func cleanUpInterfaceMap(in map[interface{}]interface{}) map[string]interface{} {
|
||||
result := make(map[string]interface{})
|
||||
for k, v := range in {
|
||||
result[fmt.Sprintf("%v", k)] = cleanUpMapValue(v)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func cleanUpInterfaceArray(in []interface{}) []interface{} {
|
||||
result := make([]interface{}, len(in))
|
||||
for i, v := range in {
|
||||
result[i] = cleanUpMapValue(v)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func cleanUpMapValue(v interface{}) interface{} {
|
||||
switch v := v.(type) {
|
||||
case []interface{}:
|
||||
return cleanUpInterfaceArray(v)
|
||||
case map[interface{}]interface{}:
|
||||
return cleanUpInterfaceMap(v)
|
||||
default:
|
||||
return v
|
||||
}
|
||||
}
|
||||
|
||||
// convertCmdStrToCmdArray checks if cmd string is blank (whitespace included)
|
||||
// then returns empty string array, else returns the split word array of cmd.
|
||||
// This is to ensure the result will never be []string{""}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
services:
|
||||
filebrowser:
|
||||
container_name: filebrowser
|
||||
image: filebrowser/filebrowser:latest
|
||||
networks:
|
||||
- filebrowser
|
||||
ports:
|
||||
- 8000:80
|
||||
volumes:
|
||||
- filebrowser:/flux/vault
|
||||
environment:
|
||||
- FB_REDIS_CACHE_URL=redis://default:filebrowser@redis:6379 # Use rediss:// for ssl
|
||||
|
||||
redis:
|
||||
container_name: redis
|
||||
image: redis:latest
|
||||
networks:
|
||||
- filebrowser
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
cat > /tmp/users.acl <<EOF
|
||||
user default on >filebrowser ~* +@all
|
||||
EOF
|
||||
redis-server --aclfile /tmp/users.acl
|
||||
|
||||
networks:
|
||||
filebrowser:
|
||||
|
||||
volumes:
|
||||
filebrowser:
|
||||
@@ -0,0 +1,24 @@
|
||||
[Unit]
|
||||
Description=File Browser SSO workspace
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=filebrowser
|
||||
Group=filebrowser
|
||||
WorkingDirectory=/var/lib/filebrowser
|
||||
ExecStart=/opt/filebrowser/filebrowser --config /var/lib/filebrowser/.filebrowser.json
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
UMask=0027
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
ProtectSystem=strict
|
||||
ProtectHome=true
|
||||
ReadWritePaths=/var/lib/filebrowser /srv/filebrowser
|
||||
RestrictSUIDSGID=true
|
||||
LockPersonality=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,41 @@
|
||||
# Проверка 3.1.0
|
||||
|
||||
Edge/Chromium, Windows amd64; 1440×1000 и 390×844. Изолированное временное хранилище, настоящие HTTP-обработчики сервера, синтетические файлы. Реальные пользовательские данные и SSO не использовались.
|
||||
|
||||
## Интерфейс и файловые операции
|
||||
|
||||
- Предпросмотр PNG, JPEG, GIF, BMP, TIFF, WebP, SVG, PDF, DICOM 2D, TXT, Markdown, CSV, JSON, XML, HTML, JavaScript, ZIP, EPUB, WAV; WebM проверен отдельно.
|
||||
- Настройки, панель управления, пользователи, публичная ссылка и парольная форма, длинные имена, серверный диалог открытия. Проверены снимки экранов и горизонтальное переполнение.
|
||||
- Создание папки, загрузка, копирование, перемещение, изменение, скачивание и удаление через реальный сервер.
|
||||
- Загрузка 3 МиБ по частям, новая статистика и отмена; сравнение полученного файла с исходными байтами.
|
||||
- Несколько ссылок на один файл, независимые пароль и срок действия.
|
||||
|
||||
## Craft
|
||||
|
||||
| Инструмент | Результат |
|
||||
| --- | --- |
|
||||
| WordCraft | Изменённый текст найден внутри DOCX; сохранение и повторное открытие |
|
||||
| GridCraft | Значение ячейки найдено внутри XLSX; сохранение и повторное открытие |
|
||||
| DeckCraft | Сохранение и повторное открытие собственного `.deckcraft` |
|
||||
| PdfCraft | Пометка сохранена в PDF; повторное открытие |
|
||||
| PhotoCraft | Рисование, сохранение отдельного PSD и повторное открытие; исходный PNG сохранён |
|
||||
| VectorCraft | SVG открыт, проект сохранён в `.vectorcraft` и открыт повторно |
|
||||
| DesignCraft | Валидный проект сохранён и повторно открыт |
|
||||
| CADCraft | DXF сохранён и повторно открыт |
|
||||
| SoundCraft | Отключён: официальная веб-сборка работает только с демосессией |
|
||||
| FigCraft | Отключён: надёжная загрузка/выгрузка серверного проекта не подтверждена |
|
||||
| LightCraft | Отключён: изображение открывается, надёжный экспорт на сервер не подтверждён |
|
||||
|
||||
Открытие второго документа из WordCraft через серверный диалог проверено отдельно: изменения записаны во второй файл, первый остался неизменным.
|
||||
|
||||
Для проверенных сохранений сопоставлены отправленные данные и файл на диске. Это проверка представительных форматов, а не гарантия совместимости каждого импортируемого формата или сложного документа. Мобильная вёрстка сторонних Craft-инструментов определяется самими инструментами.
|
||||
|
||||
DICOM 3D временно выключен; сохранённые предпочтения не удалены. Проверки 2D и декодирования остаются.
|
||||
|
||||
## Повторение
|
||||
|
||||
Обычные проверки: `pnpm --dir frontend test`, `pnpm --dir frontend lint`, `pnpm --dir frontend build`, `go test ./...`, `go vet ./...`.
|
||||
|
||||
Для браузерных сценариев предусмотрен `TestWorkspaceBrowserQA`: задайте `FILEBROWSER_QA=1`, `FILEBROWSER_QA_SCRIPT` (абсолютный путь к `frontend/scripts/check-workspace.cjs` или `check-previews.cjs`), `FILEBROWSER_QA_FIXTURES`, `FILEBROWSER_QA_ADDONS`, `FILEBROWSER_QA_OUTPUT`, `PLAYWRIGHT_MODULE` и `BROWSER_EXECUTABLE`. Затем `go test ./http -run TestWorkspaceBrowserQA -v -count=1`. Сценарии требуют тестовые файлы с именами, перечисленными в их исходниках; авторизация подставляется только внутри тестового бинарника.
|
||||
|
||||
Linux-бинарник собран для amd64/v1 без CGO; запуск на Debian в этой среде не проверялся.
|
||||
@@ -0,0 +1,12 @@
|
||||
# Проверка 3.2.0
|
||||
|
||||
- OIDC: PKCE S256, HTTP Basic, nonce/at_hash/RS256-проверка, повтор callback, изолированные cookies транзакций и host-only Secure/HttpOnly handle.
|
||||
- Внутренний resolve: запрос на каждую операцию без положительного кеша, строгие client_id/sub/expiry, текущие роли, отказ при ошибке провайдера/невалидном ответе без удаления cookie.
|
||||
- Два настоящих HTTP-сервера File Browser с тестовыми БД/файлами и общий имитатор SSO: Alice → Bob в двух открытых приложениях без OAuth-обмена, независимое устройство остаётся Alice, отказ Bob, сбой/восстановление SSO, общий logout и недостающий фактор.
|
||||
- Поздний ответ Alice задержан до перехода на Bob; данные Alice не возвращаются в интерфейс. Старая форма отвергается с 409. Тестируется также недоступный iframe-брокер — работает запасной опрос backend.
|
||||
- TUS: другой аккаунт или новая версия сессии не продолжает старую загрузку; очередь и запросы отменяются при смене аккаунта.
|
||||
- Без SSO: административный доступ без cookie/пароля, неизменный локальный профиль, CSRF-защита сохраняется. В этот режим нельзя перейти из-за отказа SSO.
|
||||
|
||||
Среда: Windows amd64, Edge/Chromium, изолированные данные и синтетический провайдер. Реальные аккаунты SSO не переключались. Проверка с установленным SSO требует внутреннего клиента и зарегистрированных redirect/origin.
|
||||
|
||||
Повторение: обычные `go test ./...`, `go vet ./...`, `pnpm --dir frontend test`, `pnpm --dir frontend lint`, `pnpm --dir frontend build`. Для браузера: `FILEBROWSER_INTERNAL_QA=1`, `FILEBROWSER_INTERNAL_QA_SCRIPT` — абсолютный путь к `frontend/scripts/check-internal-session.cjs`; также задайте `PLAYWRIGHT_MODULE`, `BROWSER_EXECUTABLE`, `FILEBROWSER_QA_OUTPUT`. Запуск: `go test ./http -run TestInternalSessionBrowser -v -count=1`.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Документация File Browser SSO
|
||||
|
||||
- [Установка на Debian, первоначальная настройка, SSO и systemd](deployment.md)
|
||||
- [Авторизация и сессии](authentication.md)
|
||||
- [Проверки безопасности и ограничения](SECURITY-REVIEW.md)
|
||||
- [Настройка внешнего вида](customization.md)
|
||||
- [CLI](cli/filebrowser.md)
|
||||
|
||||
Актуальная точка входа — `filebrowser init`. Руководства исходного архивированного File Browser по локальным паролям, proxy-auth, hook-auth и выполнению команд к этому форку не применяются.
|
||||
@@ -0,0 +1,34 @@
|
||||
# Проверки безопасности и ограничения
|
||||
|
||||
Проверено 21 октября 2026 года. Это результат проверок конкретного состояния исходников, а не гарантия отсутствия всех возможных уязвимостей.
|
||||
|
||||
## Сделано
|
||||
|
||||
- Удалены JSON/password, no-auth, proxy и hook способы входа, регистрация, выпуск и продление JWT File Browser. Локальные пароли в существующей базе при миграции заменяются заблокированным значением.
|
||||
- OIDC Authorization Code с PKCE S256, state, nonce, RS256, issuer/audience/expiry и at_hash. Идентичность привязана к issuer и sub; совпадение имени с локальным пользователем не повышает права.
|
||||
- Административная роль берётся только из подтверждённого SSO-входа: Master Admin / FS Admin. Флаг admin в локальном профиле не даёт административный доступ.
|
||||
- С версии 3.2.0: host-only Secure/HttpOnly cookie с внутренним handle; свежий resolve для каждого защищённого запроса, общий logout и защита изменений ожидаемым session_state. Самостоятельных локальных SSO-сессий нет.
|
||||
- Проверка Origin и специального заголовка для меняющих состояние запросов, запрет cross-site запросов. CSP с nonce для HTML bootstrap, запрет скриптов при выдаче пользовательских файлов, nosniff.
|
||||
- Выполнение команд и файловые хуки принудительно выключены; /api/command не зарегистрирован. Внешние симлинки запрещены. Старый вспомогательный CLI-код локальных аккаунтов не подключён к корневой команде; часть legacy-кода оставлена отключённой.
|
||||
- Короткие ссылки: валидация имени, атомарная вставка в BoltDB, отказ 409 при занятом имени; случайные ключи увеличены с 48 до 128 бит.
|
||||
- Исправлено удаление соседних просроченных ссылок: прежний цикл менял срез во время range и мог пропускать записи или выходить за границы.
|
||||
- Исправлен откат слишком большого TUS-чанка на Windows: используется запись с явным смещением, позволяющая Truncate; проверены последовательные чанки и повторное использование HTTP-соединения.
|
||||
- Ошибка чтения настроек больше не завершает процесс сервера через log.Fatalf.
|
||||
- Обновлены frontend-зависимости и x/net, x/crypto, x/image. Удалена цепочка линтера с неисправленной advisory braces; вместо неё используется flat config typescript-eslint. Режимы и темы Ace включены в бинарник, загрузка с CDN больше не нужна.
|
||||
|
||||
## Результаты
|
||||
|
||||
- go test ./... — успешно на Windows, включая OIDC, роли, logout, отказе/смене аккаунта, CSRF, callback replay, короткие ссылки и конкурентную вставку.
|
||||
- go vet ./... — успешно.
|
||||
- Frontend: TypeScript, production build, 29 тестов и ESLint без ошибок — успешно. У старых неизменённых файлов при полном lint остаются предупреждения Prettier из-за CRLF-выгрузки Windows.
|
||||
- pnpm audit — 0 известных уязвимостей в установленном дереве.
|
||||
- govulncheck для linux/amd64 — 0 уязвимостей в вызываемом коде и импортируемых пакетах. Одна advisory остаётся на уровне требуемого модуля: GO-2026-5932 (неиспользуемый пакет golang.org/x/crypto/openpgp). Приложение openpgp не импортирует и не вызывает; исправленной версии для этого устаревшего пакета нет.
|
||||
- В браузере: тестовый локальный OIDC-провайдер, список файлов, создание именованной ссылки и маршрут /s/{key}. Настоящие Client ID/secret не использовались и в репозиторий не добавлялись.
|
||||
|
||||
## Ограничения эксплуатации
|
||||
|
||||
Новый контракт и проверки общей сессии описаны в [авторизации](authentication.md). При недоступности SSO доступ закрыт без резервной локальной авторизации. Режим без входа включается только явным `--no-sso` и предоставляет всем посетителям административный доступ.
|
||||
|
||||
Debian-бинарник собирается из Windows для linux/amd64 с отключённым CGO и GOAMD64=v1. Нативный запуск и тесты на Debian в этой среде не выполнялись. POSIX-тест с именами, содержащими обратные слеши, не применим к файловой системе Windows и пропускается там.
|
||||
|
||||
Конфигурация содержит Client secret и должна принадлежать только пользователю службы (0600). Рекомендуемый systemd-файл отделяет исполняемые файлы от изменяемых данных. Обновляйте зависимости и повторяйте аудит перед публикацией новых версий.
|
||||
@@ -0,0 +1,45 @@
|
||||
# Craft-аддоны
|
||||
|
||||
В «Панель управления → Аддоны» доступны 11 инструментов: скачать/обновить, включить/отключить, увидеть версию, этап загрузки и ошибку. Настройки доступны администратору; для редактирования нужны права скачивания и изменения файла. Создание и «Сохранить как» дополнительно требуют права создания.
|
||||
|
||||
| Инструмент | Открытие | Сохранение |
|
||||
| --- | --- | --- |
|
||||
| WordCraft / GridCraft / PdfCraft | DOCX / XLSX / PDF | Исходный формат, PDF |
|
||||
| DeckCraft | PPTX, DeckCraft | Штатное сохранение DeckCraft; экспорт PPTX/PDF |
|
||||
| PhotoCraft | PCraft, PSD/PSB, PNG/JPEG/WebP/GIF/BMP/TIFF | Эти же форматы |
|
||||
| VectorCraft | VectorCraft/DrawCraft, SVG | Нативный формат, SVG/PDF/PNG/JPEG |
|
||||
| LightCraft | DNG/CR2/CR3/NEF/NRW/ARW/PEF/ORF/RW2/RAF, JPEG/PNG/TIFF | Экспорт JPEG/PNG/TIFF отдельным файлом |
|
||||
| DesignCraft | DesignCraft, IDML | Нативный формат, IDML/PDF/PNG/JPEG |
|
||||
| FigCraft | FigCraft | Нативный формат, SVG/PDF/PNG/JPEG |
|
||||
| SoundCraft | SCraftZ, WAV/FLAC/MP3/Ogg/AIFF/M4A, MIDI | SCraftZ со встроенными аудио, поддерживаемые аудио/MIDI-экспорты |
|
||||
| CADCraft | DXF/DWG | DXF/PDF/SVG/PNG; DWG не перезаписывается |
|
||||
|
||||
Для нескольких подходящих редакторов доступны отдельные команды «Открыть в…». Двойной клик использует встроенный быстрый просмотр; PDF открывается в доступном PdfCraft. Для форматов без быстрого просмотра выбирается первый подходящий установленный включённый инструмент. У LightCraft каждая вкладка использует отдельный каталог в памяти (`store=memory`); настройки обработки и каталог не синхронизируются с сервером. RAW-оригиналы не перезаписываются, экспорт требует права создания.
|
||||
|
||||
FilmCraft и EffectCraft изучены, но не включены: для сохранения и повторного открытия их проектов на другом устройстве нужна привязка ссылок на исходные видео, аудио и прочие медиа к файловому серверу. Простой перенос одного проекта этого не обеспечивает.
|
||||
|
||||
Веб-сборки хранятся в `addons` относительно рабочего каталога процесса. Для штатного Debian systemd unit это `/var/lib/filebrowser/addons`. Папка не входит в бинарник и архивы релиза: на другом сервере инструменты скачиваются кнопкой или переносится вся готовая папка `addons` с сохранением структуры. Отдельных служб редакторов нет.
|
||||
|
||||
Структура: `addons/<id>/active.json` — активная версия; `addons/<id>/versions/<tag>-<sha>/` — неизменяемые веб-файлы и оригинальные лицензии. Установка берёт только стабильный официальный GitHub Release из фиксированного каталога репозиториев `storytold`, заданного в `internal/addons/catalog.go`. Проверяются размер и SHA-256 из метаданных GitHub, затем ZIP распаковывается в отдельную временную папку. Ограничения: архив 128 МиБ, распакованные файлы суммарно 512 МиБ, отдельный файл 128 МиБ, 4096 записей, 16 уровней. Запрещены ссылки, пути наружу и совпадающие без учёта регистра имена. После успешной проверки указатель версии заменяется атомарно. Неудачное обновление оставляет прежнюю версию. Повторная проверка уже установленного релиза не скачивает архив заново.
|
||||
|
||||
Для HTML, JS и WASM создаются gzip-копии; корректные MIME, CSP для WASM и same-origin iframe задаются только страницам аддонов. Основная CSP File Browser не ослабляется. Старые версии остаются на диске: открытые редакторы продолжают загружать свои файлы. Удалять старые версии и оставшиеся после аварийной остановки `.install-*` можно вручную при остановленном сервере. Каталог `addons` закрыт от чтения/изменения через обычный файловый API, включая псевдонимы через ссылки и операции над родительскими папками.
|
||||
|
||||
В ПКМ и панели предпросмотра появляется «Открыть в WordCraft/GridCraft/DeckCraft/PdfCraft». В «Создать» — DOCX/XLSX/PPTX/PDF, если соответствующий аддон установлен и включён; сервер генерирует корректные пустые документы. Двойной клик сначала использует встроенный быстрый просмотр; PDF открывается в установленном включённом PdfCraft. Для файлов без быстрого просмотра открывается подходящий редактор в отдельной вкладке без панелей File Browser. Команда «Открыть в…» и создание документов также открывают отдельную вкладку. Для остальных файлов сохраняется обычное открытие.
|
||||
|
||||
CADCraft/GridCraft/PdfCraft используют официальный `?host=parent`/`postMessage`. Для остальных редакторов сервер добавляет собственный адаптер в отдаваемую HTML-страницу: открытие через штатную обработку перетаскивания, сохранение разрешённых форматов через перехват браузерного сохранения. Успех асинхронного сохранения подтверждается после ответа сервера. Остальные экспорты остаются обычными скачиваниями браузера. Исходные файлы установленных сборок не изменяются; HTML с адаптером не кешируется. Для обоих способов проверяются origin и конкретное окно iframe. Данные передаются без токенов SSO. Файлы загружаются и сохраняются через собственный API File Browser, с проверкой области доступа, правил и текущих разрешений. Размер документа ограничен 64 МиБ; Архивные документы и проекты дополнительно ограничены 4096 записями и суммарно 256 МиБ заявленного распакованного содержимого. Одновременно обрабатываются не более двух запросов документов.
|
||||
|
||||
Сохранение сначала пишет временный файл и выполняет Sync; затем проверяет SHA-256 ETag и заменяет оригинал. Если документ изменился, возвращается 412; «Сохранить как» не перезаписывает занятое имя (409). Проверка и замена синхронизированы с файловыми операциями данного процесса File Browser. Изменения сторонними процессами не блокируются. Успех показывается только после ответа сервера, а при ошибке доступны повтор, другое имя и скачивание копии. При истечении сессии можно войти в соседней вкладке и повторить запись без автоматического ухода из редактора. Активность пользователя в iframe поддерживает текущую сессию, но простаивающая вкладка её не продлевает.
|
||||
|
||||
Инструменты исполняются в браузере: нужны современный браузер и WebGL2/WebGPU. Совместного редактирования в реальном времени нет. Для редакторов с адаптером состояние изменений определяется консервативно по действиям пользователя: предупреждение перед закрытием возможно и после действий, которые не меняют документ. Графический запуск проверяет пользователь; автоматические проверки не запускают GPU-интерфейс.
|
||||
|
||||
Проверка официальных сборок вручную: установить `FB_TEST_OFFICIAL_ADDONS=1`, при необходимости `FB_TEST_ADDONS_DIR` в абсолютный путь целевого `addons`, затем выполнить `go test ./internal/addons -run TestOfficialBundles -v -count=1`. Обычно тест пропускается и не использует сеть.
|
||||
|
||||
## Совместимость DeckCraft v0.9.0
|
||||
|
||||
Официальная WASM-сборка вызывает `std::process::id()` в `recovery::instance_id`, что паникует на wasm32. `http/deckcraft_compat.js` перед `__wbindgen_start` инициализирует этот `OnceLock<u64>` случайным идентификатором браузера с теми же ограничениями: меньше 2^53, младшие 24 бита нулевые. Последующий счётчик документов остаётся штатным.
|
||||
|
||||
Обход добавляется только для `v0.9.0-38076027b9c1` и независимо сверяет полный SHA-256 WASM (`e0849d8de375fe7726a621f7e98112b76a7b0d0bc361d701bcae66b639c8e354`), размер памяти и исходное нулевое состояние. Другие сборки не затрагиваются. Файлы аддона на диске и SRI остаются исходными. При обновлении DeckCraft это исправление необходимо перепроверять; адрес внутренней структуры нельзя переносить на другую WASM-сборку.
|
||||
|
||||
Редактор запускается с `blank`, чтобы не открывать демонстрационную презентацию перед документом пользователя. Штатное браузерное Save сохраняет `.deckcraft` (архив с `presentation.json` и встроенными медиа); этот формат теперь открывается и сохраняется через FS с теми же лимитами, правами и ETag. Для PPTX используется экспорт редактора. Первая запись в новом формате запрашивает имя отдельной копии.
|
||||
|
||||
Проверено программным тестом в фоновом Edge/WebGL2: запуск, импорт тестового PPTX, Ctrl+S и получение `smoke.deckcraft`. Снимки экрана и визуальная оценка не выполнялись. `http/testdata/deckcraft-blank.deckcraft` — результат этого теста без пользовательских данных.
|
||||
@@ -0,0 +1,29 @@
|
||||
# Авторизация
|
||||
|
||||
## Общая сессия SSO
|
||||
|
||||
File Browser использует внутренний контракт общей браузерной сессии. В SSO приложение должно иметь тип **«Внутреннее»**, PKCE S256 и точный callback. Настройка — через `filebrowser init`; секрет хранится только в конфигурации сервера.
|
||||
|
||||
Первичный вход: discovery → Authorization Code + PKCE S256 с `internal_sync=1`. Проверяются одноразовый state, nonce, RS256/JWKS, issuer, audience, exp и at_hash. Параллельные попытки входа имеют отдельные cookies. Для восстановления привязки доступен `prompt=none`; при необходимости фактора продолжается обычный поток без принудительного запроса пароля.
|
||||
|
||||
SSO выдаёт `session_handle`. Он хранится в собственной cookie `__Host-internal_session`: Secure, HttpOnly, SameSite=Lax, Path=/, без Domain. Срок не превышает выданный SSO и 30 суток. Cookie не заменяет родительскую сессию SSO и не продлевает её. Access/ID tokens и watch не сохраняются; handle не передаётся в JavaScript, URL или localStorage.
|
||||
|
||||
**Каждый защищённый запрос** обращается к `/internal/session/resolve` с Basic client ID/secret. Используются только текущие `sub` и роли из resolve; положительный результат между запросами не кешируется. Локальная база хранит настройки и файловые права, а не самостоятельный вход. Связка issuer + sub сохраняет прежние ID, настройки и ссылки. Роли `Master Admin` и `FS Admin` дают административный доступ.
|
||||
|
||||
`GET /auth/session` возвращает текущий статус и разрешённый профиль без credentials. Копия SDK `internal-session.js` синхронизирует открытые вкладки: смена аккаунта отменяет запросы/загрузки, очищает данные и монтирует интерфейс нового аккаунта. Старые формы отвергаются по `X-FB-Session-State` с `409 session_changed`. TUS-загрузка привязана к аккаунту и версии сессии; продолжить её от другого аккаунта нельзя. Долгие чтения/записи перепроверяются не реже чем при следующем чтении/записи после двух секунд, сохранение Craft — также перед атомарной заменой файла.
|
||||
|
||||
При отказе в доступе данные скрываются; при недостающем факторе предлагается пройти TOTP/Passkey. Подключение фактора выполняется в настройках аккаунта. Ошибка SSO/TLS/ответа закрывает защищённые действия с 503, сохраняя cookie для восстановления. Автоматического перехода на старую локальную сессию нет.
|
||||
|
||||
Выход — защищённый POST, общий для текущей браузерной сессии SSO. Другие устройства не выходят. Если аккаунт успел смениться, logout получает 409 и не повторяется для нового пользователя. «Сменить аккаунт» сначала выполняет этот выход, затем открывает обычный поток входа.
|
||||
|
||||
При обновлении старые восьмичасовые сессии File Browser больше не принимаются. Требуется новая PKCE-привязка; существующий вход SSO обычно позволяет сделать её без повторного пароля. Для всех приложений используйте одинаковый issuer; общие Domain-cookies не нужны.
|
||||
|
||||
## Без входа
|
||||
|
||||
```sh
|
||||
./filebrowser --no-sso
|
||||
```
|
||||
|
||||
Этот явный флаг запускает приложение без SSO и пароля. Все посетители получают права администратора в настроенном файловом корне. Конфигурация SSO и доступность провайдера не проверяются. Настройки локального профиля сохраняются между запусками. Без флага обязательна проверка через SSO; ошибка провайдера режим без входа не включает.
|
||||
|
||||
Пароли публичных ссылок остаются независимыми и работают в обоих режимах.
|
||||
@@ -19,15 +19,10 @@ filebrowser config init [flags]
|
||||
```
|
||||
--aceEditorTheme string ace editor's syntax highlighting theme for users
|
||||
-a, --address string address to listen on (default "127.0.0.1")
|
||||
--auth.command string command for auth.method=hook
|
||||
--auth.header string HTTP header for auth.method=proxy
|
||||
--auth.logoutPage string url of custom logout page
|
||||
--auth.method string authentication type (default "json")
|
||||
-b, --baseURL string base url
|
||||
--branding.color string set the theme color
|
||||
--branding.disableExternal disable external links such as GitHub links
|
||||
--branding.disableUsedPercentage disable used disk percentage graph
|
||||
--branding.files string path to directory with images and custom styles
|
||||
--branding.name string replace 'File Browser' by this name
|
||||
--branding.theme string set the theme
|
||||
-t, --cert string tls certificate
|
||||
@@ -36,12 +31,14 @@ filebrowser config init [flags]
|
||||
--dateFormat use date format (true for absolute time, false for relative)
|
||||
--dirMode string mode bits that new directories are created with (default "0o750")
|
||||
--disableExec disables Command Runner feature (default true)
|
||||
--disableImageResolutionCalc disables image resolution calculation by reading image files
|
||||
--disablePreviewResize disable resize of image previews
|
||||
--disableThumbnails disable image thumbnails
|
||||
--disableTypeDetectionByHeader disables type detection by reading file headers
|
||||
--fileMode string mode bits that new files are created with (default "0o640")
|
||||
--followExternalSymlinks follow symlinks whose target is outside the user scope (unsafe)
|
||||
-h, --help help for init
|
||||
--hideDotfiles hide dotfiles
|
||||
--hideDotfiles hide dotfiles in file listings
|
||||
--hideLoginButton hide login button from public pages
|
||||
-k, --key string tls key
|
||||
--locale string locale for users (default "en")
|
||||
@@ -57,12 +54,9 @@ filebrowser config init [flags]
|
||||
--perm.rename rename perm for users (default true)
|
||||
--perm.share share perm for users (default true)
|
||||
-p, --port string port to listen on (default "8080")
|
||||
--recaptcha.host string use another host for ReCAPTCHA. recaptcha.net might be useful in China (default "https://www.google.com")
|
||||
--recaptcha.key string ReCaptcha site key
|
||||
--recaptcha.secret string ReCaptcha secret
|
||||
--redirectAfterCopyMove redirect to destination after copy/move
|
||||
-r, --root string root to prepend to relative paths (default ".")
|
||||
--scope string scope for users (default ".")
|
||||
--shell string shell command to which other commands should be appended
|
||||
-s, --signup allow users to signup
|
||||
--singleClick use single clicks only
|
||||
--socket string socket to listen to (cannot be used with address, port, cert nor key flags)
|
||||
@@ -16,15 +16,10 @@ filebrowser config set [flags]
|
||||
```
|
||||
--aceEditorTheme string ace editor's syntax highlighting theme for users
|
||||
-a, --address string address to listen on (default "127.0.0.1")
|
||||
--auth.command string command for auth.method=hook
|
||||
--auth.header string HTTP header for auth.method=proxy
|
||||
--auth.logoutPage string url of custom logout page
|
||||
--auth.method string authentication type (default "json")
|
||||
-b, --baseURL string base url
|
||||
--branding.color string set the theme color
|
||||
--branding.disableExternal disable external links such as GitHub links
|
||||
--branding.disableUsedPercentage disable used disk percentage graph
|
||||
--branding.files string path to directory with images and custom styles
|
||||
--branding.name string replace 'File Browser' by this name
|
||||
--branding.theme string set the theme
|
||||
-t, --cert string tls certificate
|
||||
@@ -33,12 +28,14 @@ filebrowser config set [flags]
|
||||
--dateFormat use date format (true for absolute time, false for relative)
|
||||
--dirMode string mode bits that new directories are created with (default "0o750")
|
||||
--disableExec disables Command Runner feature (default true)
|
||||
--disableImageResolutionCalc disables image resolution calculation by reading image files
|
||||
--disablePreviewResize disable resize of image previews
|
||||
--disableThumbnails disable image thumbnails
|
||||
--disableTypeDetectionByHeader disables type detection by reading file headers
|
||||
--fileMode string mode bits that new files are created with (default "0o640")
|
||||
--followExternalSymlinks follow symlinks whose target is outside the user scope (unsafe)
|
||||
-h, --help help for set
|
||||
--hideDotfiles hide dotfiles
|
||||
--hideDotfiles hide dotfiles in file listings
|
||||
--hideLoginButton hide login button from public pages
|
||||
-k, --key string tls key
|
||||
--locale string locale for users (default "en")
|
||||
@@ -54,12 +51,9 @@ filebrowser config set [flags]
|
||||
--perm.rename rename perm for users (default true)
|
||||
--perm.share share perm for users (default true)
|
||||
-p, --port string port to listen on (default "8080")
|
||||
--recaptcha.host string use another host for ReCAPTCHA. recaptcha.net might be useful in China (default "https://www.google.com")
|
||||
--recaptcha.key string ReCaptcha site key
|
||||
--recaptcha.secret string ReCaptcha secret
|
||||
--redirectAfterCopyMove redirect to destination after copy/move
|
||||
-r, --root string root to prepend to relative paths (default ".")
|
||||
--scope string scope for users (default ".")
|
||||
--shell string shell command to which other commands should be appended
|
||||
-s, --signup allow users to signup
|
||||
--singleClick use single clicks only
|
||||
--socket string socket to listen to (cannot be used with address, port, cert nor key flags)
|
||||
@@ -0,0 +1,25 @@
|
||||
# filebrowser init
|
||||
|
||||
Initial setup: SSO, file directory and database
|
||||
|
||||
```
|
||||
filebrowser init [flags]
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
```
|
||||
-h, --help help for init
|
||||
--output string configuration file to create; existing files are never overwritten (default ".filebrowser.json")
|
||||
```
|
||||
|
||||
## Options inherited from parent commands
|
||||
|
||||
```
|
||||
-c, --config string config file path
|
||||
-d, --database string database path (default "./filebrowser.db")
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
* [filebrowser](filebrowser.md) - A stylish web-based file browser
|
||||
@@ -17,7 +17,7 @@ filebrowser users add <username> <password> [flags]
|
||||
--commands strings a list of the commands a user can execute
|
||||
--dateFormat use date format (true for absolute time, false for relative)
|
||||
-h, --help help for add
|
||||
--hideDotfiles hide dotfiles
|
||||
--hideDotfiles hide dotfiles in file listings
|
||||
--locale string locale for users (default "en")
|
||||
--lockPassword lock password
|
||||
--perm.admin admin perm for users
|
||||
@@ -28,6 +28,7 @@ filebrowser users add <username> <password> [flags]
|
||||
--perm.modify modify perm for users (default true)
|
||||
--perm.rename rename perm for users (default true)
|
||||
--perm.share share perm for users (default true)
|
||||
--redirectAfterCopyMove redirect to destination after copy/move
|
||||
--scope string scope for users (default ".")
|
||||
--singleClick use single clicks only
|
||||
--sorting.asc sorting by ascending order
|
||||
@@ -18,7 +18,7 @@ filebrowser users update <id|username> [flags]
|
||||
--commands strings a list of the commands a user can execute
|
||||
--dateFormat use date format (true for absolute time, false for relative)
|
||||
-h, --help help for update
|
||||
--hideDotfiles hide dotfiles
|
||||
--hideDotfiles hide dotfiles in file listings
|
||||
--locale string locale for users (default "en")
|
||||
--lockPassword lock password
|
||||
-p, --password string new password
|
||||
@@ -30,6 +30,7 @@ filebrowser users update <id|username> [flags]
|
||||
--perm.modify modify perm for users (default true)
|
||||
--perm.rename rename perm for users (default true)
|
||||
--perm.share share perm for users (default true)
|
||||
--redirectAfterCopyMove redirect to destination after copy/move
|
||||
--scope string scope for users (default ".")
|
||||
--singleClick use single clicks only
|
||||
--sorting.asc sorting by ascending order
|
||||
@@ -8,35 +8,7 @@ File Browser CLI lets you create the database to use with File Browser,
|
||||
manage your users and all the configurations without accessing the
|
||||
web interface.
|
||||
|
||||
If you've never run File Browser, you'll need to have a database for
|
||||
it. Don't worry: you don't need to setup a separate database server.
|
||||
We're using Bolt DB which is a single file database and all managed
|
||||
by ourselves.
|
||||
|
||||
For this command, all flags are available as environmental variables,
|
||||
except for "--config", which specifies the configuration file to use.
|
||||
The environment variables are prefixed by "FB_" followed by the flag name in
|
||||
UPPER_SNAKE_CASE. For example, the flag "--disablePreviewResize" is available
|
||||
as FB_DISABLE_PREVIEW_RESIZE.
|
||||
|
||||
If "--config" is not specified, File Browser will look for a configuration
|
||||
file named .filebrowser.{json, toml, yaml, yml} in the following directories:
|
||||
|
||||
- ./
|
||||
- $HOME/
|
||||
- /etc/filebrowser/
|
||||
|
||||
The precedence of the configuration values are as follows:
|
||||
|
||||
- Flags
|
||||
- Environment variables
|
||||
- Configuration file
|
||||
- Database values
|
||||
- Defaults
|
||||
|
||||
Also, if the database path doesn't exist, File Browser will enter into
|
||||
the quick setup mode and a new database will be bootstrapped and a new
|
||||
user created with the credentials from options "username" and "password".
|
||||
Run filebrowser init for initial setup. It creates the configuration file, prepares the database and prints the SSO callback URL. Local password accounts and command execution are not supported. Runtime options can still be overridden using flags or FB_ environment variables.
|
||||
|
||||
```
|
||||
filebrowser [flags]
|
||||
@@ -52,21 +24,21 @@ filebrowser [flags]
|
||||
-c, --config string config file path
|
||||
-d, --database string database path (default "./filebrowser.db")
|
||||
--disableExec disables Command Runner feature (default true)
|
||||
--disableImageResolutionCalc disables image resolution calculation by reading image files
|
||||
--disablePreviewResize disable resize of image previews
|
||||
--disableThumbnails disable image thumbnails
|
||||
--disableTypeDetectionByHeader disables type detection by reading file headers
|
||||
--followExternalSymlinks follow symlinks whose target is outside the user scope (unsafe)
|
||||
-h, --help help for filebrowser
|
||||
--imageProcessors int image processors count (default 4)
|
||||
-k, --key string tls key
|
||||
-l, --log string log output (default "stdout")
|
||||
--noauth use the noauth auther when using quick setup
|
||||
--password string hashed password for the first user when using quick setup
|
||||
-p, --port string port to listen on (default "8080")
|
||||
--redisCacheUrl string redis cache URL (for multi-instance deployments), e.g. redis://user:pass@host:port
|
||||
-r, --root string root to prepend to relative paths (default ".")
|
||||
--socket string socket to listen to (cannot be used with address, port, cert nor key flags)
|
||||
--socketPerm uint32 unix socket file permissions (default 438)
|
||||
--tokenExpirationTime string user session timeout (default "2h")
|
||||
--username string username for the first user when using quick setup (default "admin")
|
||||
```
|
||||
|
||||
## See Also
|
||||
@@ -75,7 +47,7 @@ filebrowser [flags]
|
||||
* [filebrowser completion](filebrowser-completion.md) - Generate the autocompletion script for the specified shell
|
||||
* [filebrowser config](filebrowser-config.md) - Configuration management utility
|
||||
* [filebrowser hash](filebrowser-hash.md) - Hashes a password
|
||||
* [filebrowser init](filebrowser-init.md) - Initial setup: SSO, file directory and database
|
||||
* [filebrowser rules](filebrowser-rules.md) - Rules management utility
|
||||
* [filebrowser users](filebrowser-users.md) - Users management utility
|
||||
* [filebrowser version](filebrowser-version.md) - Print the version number
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# Выполнение команд
|
||||
|
||||
В этом форке выполнение команд, shell API и файловые хуки отключены без возможности включения через пользовательские настройки. Веб-маршрут `/api/command` отсутствует.
|
||||
|
||||
Если нужна автоматическая обработка файлов, запускайте её отдельной службой ОС с самостоятельными разрешениями.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Customization
|
||||
|
||||
The interface assets are embedded in the executable. The administrator can configure the instance name, default theme, external links and storage usage indicator in **Settings → Global Settings**.
|
||||
|
||||
The same options are available through the CLI:
|
||||
|
||||
```sh
|
||||
filebrowser config set --branding.name "My Files" --branding.theme dark
|
||||
```
|
||||
|
||||
To change the built-in icons or styles, edit the frontend sources and rebuild the executable. Runtime branding directories and custom stylesheet overrides are no longer supported.
|
||||
@@ -0,0 +1,113 @@
|
||||
# File Browser SSO — Debian amd64
|
||||
|
||||
Сборка для `linux/amd64`, базовый набор инструкций `GOAMD64=v1`, `CGO_ENABLED=0`.
|
||||
Node.js и Go на сервере не нужны: интерфейс встроен в исполняемый файл.
|
||||
|
||||
## Первоначальная настройка
|
||||
|
||||
Распакуйте архив в `/opt/filebrowser`. Пример отдельного системного пользователя:
|
||||
|
||||
```sh
|
||||
sudo useradd --system --home /opt/filebrowser --shell /usr/sbin/nologin filebrowser
|
||||
sudo install -d -m 0750 -o filebrowser -g filebrowser /var/lib/filebrowser /srv/filebrowser
|
||||
sudo chmod 0755 /opt/filebrowser/filebrowser
|
||||
cd /var/lib/filebrowser
|
||||
sudo -u filebrowser /opt/filebrowser/filebrowser init
|
||||
```
|
||||
|
||||
Мастер запросит issuer SSO, Client ID, Client secret (без эха в терминале),
|
||||
публичный URL File Browser, папку файлов, путь базы, адрес и порт прослушивания.
|
||||
Для приведённого systemd-файла используйте `/srv/filebrowser` как папку файлов,
|
||||
`/var/lib/filebrowser/filebrowser.db` как базу и `127.0.0.1:8080` как адрес сервера.
|
||||
Публичный URL — внешний HTTPS-адрес, например `https://files.anidev.ru`.
|
||||
|
||||
Конфигурация сохраняется в `.filebrowser.json` с правами `0600`. Настройка через
|
||||
`.env` не нужна. Мастер не перезаписывает существующую конфигурацию; для другого
|
||||
файла используйте `./filebrowser init --output /полный/путь/settings.json`.
|
||||
Запуск с нестандартной конфигурацией: `./filebrowser --config /полный/путь/settings.json`.
|
||||
|
||||
В вашем SSO зарегистрируйте приложение с PKCE S256 и callback, напечатанным мастером:
|
||||
|
||||
```text
|
||||
https://files.anidev.ru/auth/callback
|
||||
```
|
||||
|
||||
Если приложение размещено в подпапке, например `https://example.com/files`,
|
||||
мастер сохранит `baseURL=/files`, а callback будет `/files/auth/callback`.
|
||||
|
||||
Нужны scopes `openid profile email`. Claim `roles` — массив строк;
|
||||
точные имена `Master Admin` и `FS Admin` дают права администратора.
|
||||
Остальные пользователи получают локальные файловые разрешения по умолчанию.
|
||||
Создавать пароли и пользователей File Browser не нужно: профиль создаётся при
|
||||
первом входе. Идентичность привязана к issuer и `sub`, а не к логину или почте.
|
||||
|
||||
## Сессии
|
||||
|
||||
В SSO выберите тип приложения **«Внутреннее»**. Используется общая браузерная сессия: каждый защищённый запрос проверяется через `/internal/session/resolve`, роли и текущий аккаунт обновляются без нового OAuth-обмена. Смена аккаунта и общий выход распространяются на открытые приложения; другие устройства независимы.
|
||||
|
||||
Конфигурация содержит точный `sso.redirectURI` (мастер заполняет его автоматически). Прежние конфигурации без этого поля используют callback, полученный из `sso.publicURL`. Все приложения установки должны использовать одинаковый issuer. Настройка cookie Domain не требуется; для SSO используйте HTTPS.
|
||||
|
||||
Для запуска без SSO и пароля: `./filebrowser --no-sso`. В этом режиме все посетители получают административный доступ к настроенному корню.
|
||||
|
||||
Подробности и миграция старых сессий: [авторизация](authentication.md).
|
||||
|
||||
## Запуск через systemd
|
||||
|
||||
```sh
|
||||
sudo install -m 0644 filebrowser.service /etc/systemd/system/filebrowser.service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now filebrowser
|
||||
sudo journalctl -u filebrowser -f
|
||||
```
|
||||
|
||||
Перед приложением нужен reverse proxy с HTTPS. Пример nginx:
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name files.anidev.ru;
|
||||
# Укажите свои ssl_certificate и ssl_certificate_key.
|
||||
client_max_body_size 0;
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_request_buffering off;
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Исполняемые команды и хуки всегда выключены, внешние симлинки запрещены.
|
||||
Файлы, которые разрешено отдавать пользователям, держите в отдельном каталоге.
|
||||
При изменении пути файлов поправьте `ReadWritePaths` и `ProtectHome` в systemd-файле.
|
||||
|
||||
Публичные ссылки создаются как `/s/{key}`. Можно задать имя длиной 2–64 символа
|
||||
из латинских букв, цифр, `_` и `-`. Имена чувствительны к регистру. Занятое имя
|
||||
возвращает 409 и никогда не перезаписывает существующую ссылку. Без имени генерируется
|
||||
случайный ключ из 128 бит. Старые `/share/{key}` остаются доступными.
|
||||
|
||||
Понятные имена легче угадать; для приватных материалов используйте пароль ссылки и срок действия.
|
||||
|
||||
## Обновление и резервное копирование
|
||||
|
||||
Остановите службу, сохраните `.filebrowser.json`, базу и пользовательские файлы,
|
||||
замените бинарник и запустите службу. Перед миграцией старой установки особенно
|
||||
важно сохранить базу: при запуске удаляются пригодные для входа локальные пароли.
|
||||
Старые локальные пользователи автоматически не связываются с SSO по имени — это
|
||||
предотвращает захват аккаунта совпадающим логином. Их файловые области при необходимости
|
||||
назначьте новым SSO-профилям через настройки администратора.
|
||||
|
||||
## Сборка из исходников
|
||||
|
||||
Нужны Go 1.26+, Node.js 24+ и pnpm 10.33.4. Сборка использует системные шрифты,
|
||||
переводы и тяжёлые экраны загружаются по требованию. Для старых ПК используйте
|
||||
поддерживаемый браузер с JavaScript Proxy (Vue 3); Internet Explorer не поддерживается.
|
||||
|
||||
```sh
|
||||
sh scripts/build-release.sh
|
||||
```
|
||||
|
||||
На Windows: `./scripts/build-release.ps1`. Архив и SHA256 появятся в `build/`.
|
||||
@@ -0,0 +1,31 @@
|
||||
# DICOM 2D/3D в браузере
|
||||
|
||||
Для текущего интерфейса FS предпочтителен **Cornerstone3D**: библиотека для собственного просмотрщика на Vue, с отдельными Stack/Volume/Volume3D viewport, инструментами измерений, MPR и объёмным рендерингом. Загрузчик `@cornerstonejs/dicom-image-loader` умеет получать DICOM P10 через HTTP; отдельный PACS для такого варианта не обязателен. Лицензия MIT.
|
||||
|
||||
Источники: [область применения и загрузчики](https://www.cornerstonejs.org/docs/getting-started/scope/), [построение объёма](https://www.cornerstonejs.org/docs/tutorials/basic-volume/), [лицензия](https://github.com/cornerstonejs/cornerstone3D/blob/main/LICENSE).
|
||||
|
||||
**OHIF** — готовый просмотрщик с собственным интерфейсом и расширениями. Его можно раздавать как статические файлы и встраивать через iframe. Потребуется настроить источник данных. Помимо DICOMweb есть JSON-манифест с метаданными исследования/серий и URL отдельных DICOM-файлов. Лицензия MIT.
|
||||
|
||||
Источники: [развёртывание](https://docs.ohif.org/deployment/), [источник DICOM JSON](https://docs.ohif.org/configuration/datasources/dicom-json/), [лицензия](https://github.com/OHIF/Viewers/blob/master/LICENSE).
|
||||
|
||||
Для FS потребуется индексировать файлы выбранной папки по StudyInstanceUID и SeriesInstanceUID, учитывать ориентацию, положение и расстояние между срезами. Объём строится из согласованной серии срезов или подходящего многокадрового DICOM; из одиночной обычной 2D-проекции полноценный объём не получается. Доступ к файлам и метаданным должен наследовать текущие права пользователя либо публичной ссылки.
|
||||
|
||||
## Реализация в FS
|
||||
|
||||
В предпросмотр встроен лёгкий 2D-режим на Daikon и отдельный, лениво загружаемый объёмный просмотр на Cornerstone3D. Внешний PACS и отдельный сервер просмотрщика не нужны. Декодирование выполняется в существующем Web Worker; поддерживаются те же пиксельные форматы и кодеки, что и в 2D. Cornerstone получает готовые значения с применёнными rescale slope/intercept.
|
||||
|
||||
Если открыто имя вида `prefix_123.dcm` и все файлы родительской папки принадлежат этой нумерованной серии, появляется кнопка **Открыть как 3D**. Подпапки не учитываются. Имена определяют только предложение: после нажатия проверяются Study/Series/FrameOfReference UID, уникальность SOPInstanceUID, размеры, ориентация, PixelSpacing и ImagePositionPatient. Порядок определяется координатами пациента, а не именами. Дубликаты позиций, неравномерный шаг, несовпадающие серии и наклонённые относительно сетки срезы отклоняются. Обычные одиночные снимки и многокадровые файлы остаются в 2D; сборка объёма сейчас поддерживает серии однокадровых монохромных файлов с обычными верхнеуровневыми тегами геометрии.
|
||||
|
||||
Объёмный режим включает вращение и масштабирование 3D, аксиальную/сагиттальную/корональную реконструкцию, прокрутку срезов, перемещение, яркость/контрастность и непрозрачность. Нужен WebGL2. На неподходящем устройстве сохраняется 2D.
|
||||
|
||||
В настройках профиля есть раздел **DICOM — 3D-просмотр**: качество (автоматическое, исходное, половинное, четверть), лимит памяти вокселей 128–1536 МиБ и начальная непрозрачность. Настройки хранятся в аккаунте. По умолчанию автоматический режим подбирает разрешение под 1536 МиБ: большие срезы уменьшаются билинейной интерполяцией с сохранением поля обзора, координат пациента и физического масштаба; все срезы сохраняются. В просмотрщике показывается уменьшенное разрешение. Исходные DICOM-файлы не изменяются. При выборе исходного или фиксированного качества превышение персонального лимита по-прежнему останавливает просмотр.
|
||||
|
||||
Ограничения: до 2048 файлов, 64 МиБ на исходный файл, 1,5 ГиБ суммарной загрузки и 1,5 ГиБ Float32-вокселей. Это лимит массива объёма, а не всей памяти браузера: сборка и GPU требуют дополнительной памяти. Файлы читаются последовательно только после нажатия кнопки, загрузку можно отменить. При закрытии удаляются движок, GPU-ресурсы и принадлежащие просмотру записи кеша.
|
||||
|
||||
При запуске 3D в консоль браузера выводятся сообщения `[DICOM 3D]`: число файлов, общий и максимальный исходный размер, а после декодирования первого среза — размеры сетки и оценка Float32-объёма. При превышении лимита выводятся конкретная причина, фактическое значение и порог. Размеры указаны в байтах и ГиБ; пути, токены и медицинские теги не логируются.
|
||||
|
||||
Для приватных файлов используются обычные авторизованные API; для публичных — только API текущей ссылки с её токеном. Публичная ссылка на отдельный файл не запрашивает содержимое его родительской папки.
|
||||
|
||||
В сборщике `xmlbuilder2` направлен на официальный браузерный bundle: серверный entry зависимости VTK требует Node EventEmitter и не запускается в браузере. CSP страницы не ослабляется, сторонние CDN не используются.
|
||||
|
||||
Встроенные ресурсы включают служебные чанки Vite с начальным `__`; сервер отдаёт исходный JS, если gzip-копия не создана из-за малого размера. Go-тесты проверяют полноту встраивания и оба варианта отдачи. Дополнительная функциональная проверка: `DICOM_BROWSER_TEST=1 go test ./http -run TestProductionDICOMPreviewBrowser -v`. Нужны собранный frontend, Node 24, Playwright (путь можно задать в `PLAYWRIGHT_MODULE`) и браузер (`BROWSER_EXECUTABLE`). Проверка использует синтетические DICOM, настоящий встроенный сервер и CSP, без скриншотов и пользовательских данных.
|
||||
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 99 KiB |
@@ -6,29 +6,29 @@ File Browser is a single binary and can be used as standalone executable. Howeve
|
||||
|
||||
The quickest and easiest way to install File Browser is to use a package manager, or our download script, which automatically fetches the latest version of File Browser for your platform. Alternatively, you can manually download the binary from the [releases page](https://github.com/filebrowser/filebrowser/releases).
|
||||
|
||||
=== "Brew"
|
||||
### Brew
|
||||
|
||||
```sh
|
||||
brew tap filebrowser/tap
|
||||
brew install filebrowser
|
||||
filebrowser -r /path/to/your/files
|
||||
```
|
||||
```sh
|
||||
brew tap filebrowser/tap
|
||||
brew install filebrowser
|
||||
filebrowser -r /path/to/your/files
|
||||
```
|
||||
|
||||
=== "Unix"
|
||||
### Unix
|
||||
|
||||
```sh
|
||||
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
|
||||
filebrowser -r /path/to/your/files
|
||||
```
|
||||
```sh
|
||||
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
|
||||
filebrowser -r /path/to/your/files
|
||||
```
|
||||
|
||||
=== "Windows"
|
||||
### Windows
|
||||
|
||||
```sh
|
||||
iwr -useb https://raw.githubusercontent.com/filebrowser/get/master/get.ps1 | iex
|
||||
filebrowser -r /path/to/your/files
|
||||
```
|
||||
```sh
|
||||
iwr -useb https://raw.githubusercontent.com/filebrowser/get/master/get.ps1 | iex
|
||||
filebrowser -r /path/to/your/files
|
||||
```
|
||||
|
||||
File Browser is now up and running. Read some [first boot](#first-boot) for more information.
|
||||
File Browser is now up and running. Read the ["First Boot"](#first-boot) section for more information.
|
||||
|
||||
## Docker
|
||||
|
||||
@@ -47,7 +47,7 @@ docker run \
|
||||
|
||||
Where `filebrowser_data`, `filebrowser_database` and `filebrowser_config` are Docker [volumes](https://docs.docker.com/engine/storage/volumes/), where the data, database and configuration will be stored, respectively. The default configuration and database will be automatically initialized.
|
||||
|
||||
The default user that runs File Browser inside the container has PID 1000 and GID 1000. If, for one reason or another, you want to run the Docker container with a different user, please consult Docker's [user documentation](https://docs.docker.com/engine/containers/run/#user).
|
||||
The default user that runs File Browser inside the container has UID 1000 and GID 1000. If, for one reason or another, you want to run the Docker container with a different user, please consult Docker's [user documentation](https://docs.docker.com/engine/containers/run/#user).
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
@@ -0,0 +1,22 @@
|
||||
# Навигация и миниатюры
|
||||
|
||||
Переходы выполняются внутри SPA: текущая папка остаётся на экране, пока сервер готовит следующую. Список и адрес обновляются вместе; шапка, поиск и дерево каталогов сохраняют свои компоненты. Для долгих запросов показывается тонкая полоса загрузки с задержкой 160 мс. Быстрый повторный переход отменяет предыдущий; запоздавшие ответы и ответы прежнего аккаунта не применяются. Крупные модули просмотра загружаются по необходимости до переключения страницы.
|
||||
|
||||
При смене аккаунта открывается его домашняя папка, в том числе после промежуточного выхода или OAuth-перехода. Обычный повторный вход в тот же аккаунт сохраняет прямую ссылку.
|
||||
|
||||
Боковая панель содержит закладки и раскрывающееся дерево каталогов. Текущий путь раскрывается автоматически; для остальных папок запрашивается только непосредственное содержимое при раскрытии. Обновления текущего каталога берутся из уже загруженного списка файлов. Скрытые каталоги учитывают настройку профиля. Права и область доступа проверяются существующим API.
|
||||
|
||||
Кнопка закладки закрепляет текущую папку. Закладки хранятся в браузере отдельно для каждого аккаунта и базового URL приложения. Крестик удаляет только закладку. Нижняя строка аккаунта открывает профиль, управление ссылками, административные разделы и выход в соответствии с правами пользователя. Меню поддерживает клавиатуру и закрывается по Escape или нажатию снаружи.
|
||||
|
||||
«Настройки профиля → Показ превью» сохраняется в базе пользователя и действует после повторного входа. По умолчанию показ включён, если миниатюры разрешены сервером. При отключении запросов миниатюр нет. Изображения загружаются по мере приближения к видимой области как в таблице, так и в плитках; ошибки миниатюр заменяются иконкой типа файла. DICOM отображается отдельной иконкой `.dcm`, без попытки генерации серверной миниатюры.
|
||||
|
||||
Настройки интерфейса находятся в разделе «Интерфейс»: внешний вид, работа с файлами, язык и даты. Кнопка «Управление» напротив профиля ведёт через `/auth/account` на `/settings` настроенного провайдера входа. Аватар берётся из проверенного `picture` при входе, преобразуется в небольшую PNG-миниатюру и хранится только в локальной сессии. Загружаются только изображения из `/avatars/` того же провайдера, без перенаправлений и передачи cookies или токенов. Если аватара нет, отображается первая буква имени.
|
||||
|
||||
Раздел ссылок называется «Мои ссылки» (My Shares). Уведомления отображаются справа под верхней панелью, учитывают тему и уменьшаются по ширине на мобильных устройствах. Ошибки остаются видимыми до закрытия; успешные действия закрываются автоматически.
|
||||
Меню действий открывается правой кнопкой на файле или на пустой области, а также кнопкой «Действия» в шапке. ПКМ на пустом месте снимает выделение и показывает действия с текущей папкой. Меню ограничено размерами экрана, прокручивается, поддерживает стрелки и Escape. Верхняя панель освобождена для поиска, доступного и на мобильных устройствах.
|
||||
|
||||
Скачивание начинается сразу. Для папок и нескольких файлов формат задаётся в «Глобальные настройки → Скачивание → Формат архива», по умолчанию ZIP. Настройка действует и на публичные ссылки; отдельный файл передаётся без упаковки. Старые URL с явным параметром algo продолжают работать.
|
||||
|
||||
Навигация настроек находится в меню аккаунта: «Аккаунт» ведёт на управление аккаунтом, «Настройки» — личные предпочтения, «Мои ссылки» — созданные ссылки, «Административные настройки» — серверные параметры (только для администратора). Вкладок больше нет. Плитка «Управление пользователями» открывает таблицу и редактирование доступа в одном модальном окне; старые адреса управления пользователями перенаправляются туда.
|
||||
|
||||
Подменю «Создать» содержит папку и шаблоны текстовых форматов. Расширение добавляется автоматически без дублирования; JSON, HTML и XML получают корректное начальное содержимое. Реестр frontend/src/utils/file-templates.ts предназначен для расширения типов при подключении редакторов. Office-документы пока не создаются, чтобы не выдавать пустой файл за корректный DOCX/XLSX.
|
||||
@@ -0,0 +1,21 @@
|
||||
# Предпросмотр файлов
|
||||
|
||||
PDF отображается локальным PDF.js в canvas, без плагинов браузера и внешних CDN. Страницы рисуются по одной; доступны переключение страницы и масштаб. CSP `object-src 'none'` сохраняется. Шрифты и таблицы символов входят в сборку.
|
||||
|
||||
В панели PDF есть кнопка открытия в новой вкладке: там документ отображает сам браузер. Общая кнопка «Открыть файл» удалена.
|
||||
|
||||
Обычные и публичные страницы поддерживают изображения, аудио и видео в форматах браузера, TIFF, текст, Markdown, CSV и EPUB. Текстовые форматы ограничены 5 МиБ, TIFF — 64 МиБ и 16 миллионами пикселей. HTML показывается текстом; Markdown очищается от активного содержимого. Если формат не поддерживается, остаются иконка и скачивание.
|
||||
|
||||
ZIP показывает только дерево имён из центрального каталога, без чтения содержимого записей, распаковки или открытия вложенных архивов. Используются частичные HTTP-запросы; ответ без поддержки Range отклоняется. Лимиты: 4 МиБ центрального каталога, 10 000 записей, 20 000 узлов с учётом папок, 32 уровня вложенности, 1024 байта на имя. Одновременно отображаются до 1000 строк. Проверяются границы записей и ответа сервера; пути с переходом к родителю отклоняются. ZIP64 и составные архивы не поддерживаются. Заявленный распакованный размер не используется для выделения памяти; ZIP-бомбы не распаковываются. Время загрузки ограничено 30 секундами.
|
||||
|
||||
Параметры DICOM подписаны «Контраст (ширина окна)» и «Яркость (уровень окна)». Это медицинское окно отображения интенсивности: его ширина задаёт диапазон, а уровень — центр диапазона; исходные пиксели не изменяются.
|
||||
|
||||
Файлы `.dcm` и `.dicom` открываются локальным DICOM-декодером в отдельном Worker. Поддерживаются 8/16-битные монохромные изображения (MONOCHROME1/2), 8-битный RGB и сжатые данные, поддерживаемые декодером Daikon. Доступны выбор кадра, ширина/уровень окна и сброс настроек. Неподдерживаемый формат сообщает об ошибке; файл остаётся доступен для скачивания.
|
||||
|
||||
Изображение DICOM целиком вписывается в доступную область под панелью инструментов с сохранением пропорций. Большие изображения уменьшаются, небольшие не увеличиваются.
|
||||
|
||||
Окно сведений показывает свойства файла и таблицу DICOM-тегов с поиском по коду, имени и значению: данные пациента, исследования, серии, оборудования и параметры изображения, если они присутствуют в файле. Чтение метаданных не требует распаковки пикселей и работает независимо от поддержки формата изображения. Бинарные данные и последовательности не выводятся; таблица ограничена 512 тегами, 64 значениями на тег и 2048 символами на значение. Метаданные обрабатываются локально, без внешних сервисов.
|
||||
|
||||
Для ограничения памяти DICOM-предпросмотр принимает файлы до 64 МиБ, изображения до 16 миллионов пикселей на кадр и до 128 МиБ распакованных пикселей. Первичное декодирование ограничено 30 секундами. Просмотр доступен в файловом менеджере и по публичным ссылкам с теми же проверками доступа, что и скачивание.
|
||||
|
||||
Текстовые теги декодируются из исходных байтов. Автоматический режим распознаёт корректный UTF-8 и учитывает объявленную кодировку; при неверной маркировке UTF-8 использует Windows-1256. Для неоднозначных файлов кодировку можно выбрать вручную, в том числе Windows-1251 и Windows-1256, без повторной загрузки файла. Тег Specific Character Set сохраняет исходное значение из файла, а поле «Используется» показывает фактическую кодировку отображения.
|
||||
@@ -6,22 +6,24 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
ErrEmptyKey = errors.New("empty key")
|
||||
ErrExist = errors.New("the resource already exists")
|
||||
ErrNotExist = errors.New("the resource does not exist")
|
||||
ErrEmptyPassword = errors.New("password is empty")
|
||||
ErrEasyPassword = errors.New("password is too easy")
|
||||
ErrEmptyUsername = errors.New("username is empty")
|
||||
ErrEmptyRequest = errors.New("empty request")
|
||||
ErrScopeIsRelative = errors.New("scope is a relative path")
|
||||
ErrInvalidDataType = errors.New("invalid data type")
|
||||
ErrIsDirectory = errors.New("file is directory")
|
||||
ErrInvalidOption = errors.New("invalid option")
|
||||
ErrInvalidAuthMethod = errors.New("invalid auth method")
|
||||
ErrPermissionDenied = errors.New("permission denied")
|
||||
ErrInvalidRequestParams = errors.New("invalid request params")
|
||||
ErrSourceIsParent = errors.New("source is parent")
|
||||
ErrRootUserDeletion = errors.New("user with id 1 can't be deleted")
|
||||
ErrEmptyKey = errors.New("empty key")
|
||||
ErrExist = errors.New("the resource already exists")
|
||||
ErrNotExist = errors.New("the resource does not exist")
|
||||
ErrEmptyPassword = errors.New("password is empty")
|
||||
ErrEasyPassword = errors.New("password is too easy")
|
||||
ErrEmptyUsername = errors.New("username is empty")
|
||||
ErrEmptyRequest = errors.New("empty request")
|
||||
ErrScopeIsRelative = errors.New("scope is a relative path")
|
||||
ErrInvalidDataType = errors.New("invalid data type")
|
||||
ErrIsDirectory = errors.New("file is directory")
|
||||
ErrInvalidOption = errors.New("invalid option")
|
||||
ErrInvalidAuthMethod = errors.New("invalid auth method")
|
||||
ErrPermissionDenied = errors.New("permission denied")
|
||||
ErrInvalidRequestParams = errors.New("invalid request params")
|
||||
ErrSourceIsParent = errors.New("source is parent")
|
||||
ErrRootUserDeletion = errors.New("the sole admin can't be deleted")
|
||||
ErrCurrentPasswordIncorrect = errors.New("the current password is incorrect")
|
||||
ErrShareRequiresDownload = errors.New("permission to share requires permission to download")
|
||||
)
|
||||
|
||||
type ErrShortPassword struct {
|
||||
|
||||