Compare commits

..

5 Commits

Author SHA1 Message Date
Henrique Dias
e36a9b40a0 chore(release): 2.36.1 2025-07-03 16:14:05 +02:00
Henrique Dias
a756e02142 docs: fix typo 2025-07-03 16:11:37 +02:00
Henrique Dias
b6394745a3 docs: docker caveat with bind mounts 2025-07-03 16:00:54 +02:00
Stavros Tsioulis
e99e0b3028 fix: remove associated shares when deleting file/folder 2025-07-03 06:42:55 +02:00
Henrique Dias
47b3e218ad docs: remove note about fixed issue 2025-07-02 08:54:27 +02:00
6 changed files with 62 additions and 47 deletions

View File

@@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [2.36.1](https://github.com/filebrowser/filebrowser/compare/v2.36.0...v2.36.1) (2025-07-03)
### Bug Fixes
* remove associated shares when deleting file/folder ([e99e0b3](https://github.com/filebrowser/filebrowser/commit/e99e0b3028e1c8a50e1744bb07ecc8e809bdb8e6))
## [2.36.0](https://github.com/filebrowser/filebrowser/compare/v2.35.0...v2.36.0) (2025-07-02)

View File

@@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"io"
"log"
"net/http"
"net/url"
"os"
@@ -73,6 +74,11 @@ func resourceDeleteHandler(fileCache FileCache) handleFunc {
return errToStatus(err), err
}
err = d.store.Share.DeleteWithPathPrefix(file.Path)
if err != nil {
log.Printf("WARNING: Error(s) occurred while deleting associated shares with file: %s", err)
}
// delete thumbnails
err = delThumbs(r.Context(), fileCache, file)
if err != nil {

View File

@@ -15,6 +15,7 @@ type StorageBackend interface {
Gets(path string, id uint) ([]*Link, error)
Save(s *Link) error
Delete(hash string) error
DeleteWithPathPrefix(path string) error
}
// Storage is a storage.
@@ -118,3 +119,7 @@ func (s *Storage) Save(l *Link) error {
func (s *Storage) Delete(hash string) error {
return s.back.Delete(hash)
}
func (s *Storage) DeleteWithPathPrefix(path string) error {
return s.back.DeleteWithPathPrefix(path)
}

View File

@@ -75,3 +75,16 @@ func (s shareBackend) Delete(hash string) error {
}
return err
}
func (s shareBackend) DeleteWithPathPrefix(pathPrefix string) error {
var links []share.Link
if err := s.db.Prefix("Path", pathPrefix, &links); err != nil {
return err
}
var err error
for _, link := range links {
err = errors.Join(err, s.db.DeleteStruct(&share.Link{Hash: link.Hash}))
}
return err
}

View File

@@ -72,11 +72,6 @@ filebrowser config set --recaptcha.host https://recaptcha.net
Where `https://recaptcha.net` is any provider you want.
> [!CAUTION]
>
> Note that you **always** need to set the `--auth.method` flag when changing authentication configurations and that it will completely overwrite your current settings. [This is a known issue.](https://github.com/filebrowser/filebrowser/issues/715)
### Proxy Header
If you have a reverse proxy you want to use to login your users, you do it via our `proxy` authentication method. To configure this method, your proxy must send an HTTP header containing the username of the logged in user:

View File

@@ -32,37 +32,43 @@ File Browser is now up and running. Read some [first boot](#first-boot) for more
## Docker
File Browser is available as two different Docker images, which can be found on [Docker Hub](https://hub.docker.com/r/filebrowser/filebrowser).
File Browser is available as two different Docker images, which can be found on [Docker Hub](https://hub.docker.com/r/filebrowser/filebrowser): a [bare Alpine image](#bare-alpine-image) and an [S6 Overlay image](#s6-overlay-image).
=== "Alpine"
### Bare Alpine Image
The
```sh
docker run \
-v filebrowser_data:/srv \
-v filebrowser_database:/database \
-v filebrowser_config:/config \
-p 8080:80 \
filebrowser/filebrowser
```
```sh
docker run \
-v /path/to/srv:/srv \
-v /path/to/database:/database \
-v /path/to/config:/config \
-p 8080:80 \
filebrowser/filebrowser
```
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 has PID 1000 and GID 1000. Please make sure that this user has access to the different mounted volumes. To change the user running inside the Docker image, you need to use the [`--user` flag](https://docs.docker.com/engine/containers/run/#user).
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).
=== "s6 overlay"
> [!NOTE]
>
> When using [bind mounts](https://docs.docker.com/engine/storage/bind-mounts/), that is, when you mount a path on the host in the container, you must manually ensure that they have the correct **permissions**. Docker does not do this automatically for you. The host directories must be readable and writable by the user running inside the container. You can use the [`chown`](https://linux.die.net/man/1/chown) command to change the owner of those paths.
The `s6` image is based on LinuxServer and leverages the [s6-overlay](https://github.com/just-containers/s6-overlay) system for a standard, highly customizable image. It should be used as follows:
File Browser is now up and running. Read the ["First Boot"](#first-boot) section for more information.
```shell
docker run \
-v /path/to/srv:/srv \
-v /path/to/database:/database \
-v /path/to/config:/config \
-e PUID=$(id -u) \
-e PGID=$(id -g) \
-p 8080:80 \
filebrowser/filebrowser:s6
```
### S6 Overlay Image
The `s6` image is based on LinuxServer and leverages the [s6-overlay](https://github.com/just-containers/s6-overlay) system for a standard, highly customizable image. It should be used as follows:
```shell
docker run \
-v /path/to/srv:/srv \
-v /path/to/database:/database \
-v /path/to/config:/config \
-e PUID=$(id -u) \
-e PGID=$(id -g) \
-p 8080:80 \
filebrowser/filebrowser:s6
```
Where:
@@ -72,24 +78,7 @@ Where:
Both `settings.json` and `filebrowser.db` will automatically be initialized if they don't exist.
File Browser is now up and running. Read some [first boot](#first-boot) for more information.
> [!NOTE]
>
> The Alpine Docker image has breaking changes from v2.33.0, in order to address multiple issues that have continuously affected multiple users. The changes are as follows:
>
> - **User**: File Browser no longer runs as `root`, but as user with PID 1000 and GID 1000. You can still change this by using Docker's [`--user` flag](https://www.docker.com/blog/understanding-the-docker-user-instruction/).
> - **Volumes**: the volumes with the database and configuration are now aligned with the s6-overlay images. Instead of mounting the files themselves, which leads to frequent issues, you now mount the surrounding directory.
>
> Assuming you have a `database.db`, a `.filebrowser.json` and the data in `/data`, do the following:
>
> 1. Change the path of `database` in `.filebrowser.json` to `/database/filebrowser.db`
> 2. Rename `database.db` to `filebrowser.db`
> 3. Rename `.filebrowser.json` to `settings.json`
> 4. Put them in the same directory locally, let's say `/app/filebrowser/`
> 5. Change the permissions of both directories: `sudo chown -R 1000:1000 /app/filebrowser /data`
> 6. Mount with the flags `-v /app/filebrowser:/database -v /app/filebrowser:/config` - you can also choose to put them in separate directories, but it is not needed.
File Browser is now up and running. Read the ["First Boot"](#first-boot) section for more information.
## First Boot