User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
sailing:filebrowser [2024/01/18 10:35] willysailing:filebrowser [2024/01/18 10:44] (current) – removed willy
Line 1: Line 1:
-====== FileBrowser ====== 
- 
-[[https://filebrowser.org/|File Browser]] is a nice web-based file manager for your server. 
- 
-I do not like the default installation method because it will install system-wide. I will show you how to install in a more customized way. 
- 
-first you need to create a new user: 
-<code bash> 
- > useradd -d /data/daemons/filebrowser -m filebrowser -g users 
-</code> 
- 
-the //filebrowser// user will have **users** as it's main group so that any files managed by it can be accessed and managed by users as well. 
- 
-You need to set the //umask// for the user to **0002** so that any new files created by it will be writable by the users. 
- 
-Then, as //filebrowser// user, get the software package and decompress it. The default install approach is based on a auto executable web link ([[https://raw.githubusercontent.com/filebrowser/get/master/get.sh|here]]) which i do not recommend to use directly. Instead go to [[https://github.com/filebrowser/filebrowser/releases/|here]] and download the proper package for your architecture. Then: 
-<code bash> 
- > su - filebrowser 
- > echo "umask 0002" >> ~/.bashrc 
- > tar xvf linux-amd64-filebrowser.tar.gz 
- > ./filebrowser config set --auth.method noauth 
-</code> 
- 
-since it will be hidden behind the reverse proxy, you can disable FileBrowser internal authentication. 
- 
-You need to setup filebrowser to access your common archive, so create the folder **/data/archive/common** and own it to filebrowser:users: 
-<code bash> 
- > mkdir /data/archive 
- > mkdir /data/archive/common 
- > chown -R filebrowser:users /data/archive/common 
-</code> 
- 
-Now, a startup script: 
-<file bash filebrowser.sh> 
-#!/bin/bash 
-cd /data/daemons/filebrowser && 
-./filebrowser -r /depoisito/archive/common -p 3002 -b /archive/common/ 2>&1 > filebrowser.log 
-</file> 
- 
-And the usual autostart stuff: 
-<file bash 40-filebrowser.start> 
-#!/bin/bash 
-start-stop-daemon -b -m -p /var/run/filebrowser.pid -n filebrowser -u filebrowser /data/daemons/filebrowser/filebrowser.sh 
-</file> 
- 
-Make both files executable. 
- 
-Now, reverse proxy is simple, but this into **/etc/nginx/folders/filebrowser.conf**: 
-<file txt filebrowser.conf> 
- 
-  location /archive/common/ { 
-        client_max_body_size 512M; 
- 
-        proxy_pass http://127.0.0.1:3002; 
-        proxy_http_version 1.1; 
- 
-        proxy_set_header Connection $http_connection; 
-        proxy_set_header Connection 'upgrade'; 
-        proxy_cache_bypass $http_upgrade; 
-        proxy_set_header Host $host; 
-        proxy_set_header X-Real-IP $remote_addr; 
-        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
-        proxy_set_header X-Forwarded-Proto $scheme; 
-    } 
-</file> 
- 
-and put this file include inside the usual **/etc/nginx*/folders/main.conf**, and restart nginx. 
- 
- 
- 
-<file bash filebrowser.sh> 
-#!/bin/bash 
- 
-SHARES="common:3002:filebrowser" 
- 
-BASE_PATH=/deposito/daemons/filebrowser/data 
- 
-for i in $SHARES 
-do 
-        SHARE=$(echo $i | cut -d: -f1) 
-        PORT=$(echo $i | cut -d: -f2) 
-        OWNER=$(echo $i | cut -d: -f3) 
- 
-        echo Starting FileBrowser for $OWNER on share $SHARE 
-        su - $OWNER -c "/deposito/daemons/filebrowser/bin/filebrowser config set --auth.method=noauth -d $BASE_PATH/db/filebrowser_$SHARE.db >/dev/null" 
-        su - $OWNER -c "/deposito/daemons/filebrowser/bin/filebrowser -r /deposito/$SHARE -p $PORT -b /archive/$SHARE -d $BASE_PATH/db/filebrowser_$SHARE.db -l $BASE_PATH/logs/filebrowser_$ 
-SHARE.log 2> $BASE_PATH/logs/filebrowser_${SHARE}_run.log"& 
- 
-        echo Starting WebDAV backend for $OWNER on share $SHARE 
-done 
-</file> 
- 
  

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information