Skip to content
Snippets Groups Projects
Verified Commit 391aa25f authored by David Beniamine's avatar David Beniamine
Browse files

Build our own to fix umask limitations

parent 3f210b4a
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,8 @@ COMPOSE_FILE=docker-compose.yml:dev.yml ...@@ -3,7 +3,8 @@ COMPOSE_FILE=docker-compose.yml:dev.yml
# For prod # For prod
#COMPOSE_FILE=docker-compose.yml:traefik.yml #COMPOSE_FILE=docker-compose.yml:traefik.yml
NAME=filebrowser NAME=filebrowser
VERSION=v2 # Must be full version number
VERSION=v2.32.0
# Hostname for prod `FQDN` ex HOSTS=`files.example.org` # Hostname for prod `FQDN` ex HOSTS=`files.example.org`
HOSTS= HOSTS=
DEV_PORT=8080 DEV_PORT=8080
......
...@@ -9,6 +9,8 @@ docker-compose up -d ...@@ -9,6 +9,8 @@ docker-compose up -d
The initial credentials are admin / admin please change them as soon as your are logged in. 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 ## Customisation
### Run a command upon file creation ### 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 ...@@ -25,11 +27,10 @@ It will be called each time a new file/directory is created with the file path a
### Set default permissions ### 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 UMASK=007
VERSION=v2.27.9
``` ```
If you which that all new directories have permissions `770` and files `660` If you which that all new directories have permissions `770` and files `660`
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 ARG VERSION=v2
FROM filebrowser/filebrowser:${VERSION} FROM filebrowser/filebrowser:${VERSION}
COPY --from=builder /go/filebrowser/filebrowser /filebrowser
RUN ls -lstrh /
COPY entrypoint.sh / COPY entrypoint.sh /
RUN apk add inotify-tools shadow RUN apk add inotify-tools shadow
ENTRYPOINT '/entrypoint.sh' ENTRYPOINT '/entrypoint.sh'
......
...@@ -15,4 +15,3 @@ if [ ! -z "$UMASK" ]; then ...@@ -15,4 +15,3 @@ if [ ! -z "$UMASK" ]; then
fi fi
callback_daemon & callback_daemon &
exec /filebrowser exec /filebrowser
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment