diff --git a/.env.sample b/.env.sample index 5ba3054cd1ad6d07814b44db4cc6f6744517d238..557c9216f142e43cdc63236d4ca17a8d5c60e03a 100644 --- a/.env.sample +++ b/.env.sample @@ -3,7 +3,8 @@ COMPOSE_FILE=docker-compose.yml:dev.yml # For prod #COMPOSE_FILE=docker-compose.yml:traefik.yml NAME=filebrowser -VERSION=v2 +# Must be full version number +VERSION=v2.32.0 # Hostname for prod `FQDN` ex HOSTS=`files.example.org` HOSTS= DEV_PORT=8080 diff --git a/Readme.md b/Readme.md index 5a51f5bd2db08d4122374ffbfdef7cef42050a84..73ca616a592d0544f254b8b72c3e11a2c0dec190 100644 --- a/Readme.md +++ b/Readme.md @@ -9,6 +9,8 @@ docker-compose up -d The initial credentials are admin / admin please change them as soon as your are logged in. +We build our own version of filebrowser to fix issue [3399](https://github.com/filebrowser/filebrowser/issues/3399#issuecomment-2326120447). + ## Customisation ### Run a command upon file creation @@ -25,11 +27,10 @@ It will be called each time a new file/directory is created with the file path a ### Set default permissions -It is possible to set a [umask](https://www.liquidweb.com/blog/what-is-umask-and-how-to-use-it-effectively/) on all files created but this is only compatible with filebrowser versions up to 2.27, so you must set in your `.env` +It is possible to set a [umask](https://www.liquidweb.com/blog/what-is-umask-and-how-to-use-it-effectively/) on all files created. ``` UMASK=007 -VERSION=v2.27.9 ``` If you which that all new directories have permissions `770` and files `660` diff --git a/docker/Dockerfile b/docker/Dockerfile index 8cd389092d9c98366ad72b74f20e40c3dc0110e4..98e7b1ea147535a806057d1a85c6f317e3168a82 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,19 @@ +ARG VERSION=v2 +FROM node:22 as frontbuilder +RUN git clone https://github.com/filebrowser/filebrowser; cd filebrowser; git switch -d ${VERSION} +RUN cd filebrowser/frontend; npm install; npm install -g pnpm; npm run build +RUN ls -lstrh /filebrowser + +FROM golang:1.23 AS builder +COPY --from=frontbuilder /filebrowser /go/filebrowser +# See https://github.com/filebrowser/filebrowser/issues/3399#issuecomment-2573494806 +RUN cd filebrowser; sed -i 's/755/777/' files/file.go; sed -i 's/644/666/' files/file.go; go mod download; CGO_ENABLED=0 go build -ldflags="-s -w" +RUN ls -lstrh /go/filebrowser + ARG VERSION=v2 FROM filebrowser/filebrowser:${VERSION} +COPY --from=builder /go/filebrowser/filebrowser /filebrowser +RUN ls -lstrh / COPY entrypoint.sh / RUN apk add inotify-tools shadow ENTRYPOINT '/entrypoint.sh' diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 30eeae31844156fa7785d08271cd315c7e100616..ff4cd590d9fea075e8cdef1a66598cdd3935ffc5 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -15,4 +15,3 @@ if [ ! -z "$UMASK" ]; then fi callback_daemon & exec /filebrowser -