Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
services:filebrowser [2024/03/22 07:59] – created willy | services:filebrowser [2025/01/21 11:50] (current) – [Running] willy | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Fileserver access via Browser | + | ===== FileBrowser |
There are a few software out there, but i like [[https:// | There are a few software out there, but i like [[https:// | ||
- | // | + | ==== Installation ==== |
- | - bin: where the FileBrowser binary will be located | + | |
- | - data/db: where the FileBrowser databases files will be stored | + | |
- | - data/logs: where the various log files will be created | + | |
- | You need to set the //umask// for the user to **0002** so that any new files created | + | Create a standard user to host the FileBrowser installation. You will most probably |
- | Then, as // | ||
<code bash> | <code bash> | ||
- | su - fileserver | + | useradd -d / |
- | echo "umask 0002" >> ~/.bashrc | + | </code> |
- | source ~/.bashrc | + | |
- | mkdir bin data data/logs data/db | + | The default install approach is based on a auto executable web link ([[https://raw.githubusercontent.com/filebrowser/ |
+ | <code bash> | ||
+ | su - filebrowser | ||
+ | mkdir bin | ||
cd bin | cd bin | ||
tar xvf ../ | tar xvf ../ | ||
</ | </ | ||
- | Now, you will need to start a copy of FileBrowser | + | That's it! |
+ | |||
+ | In addition | ||
+ | <file - .bashrc> | ||
+ | # | ||
+ | |||
+ | export UMASK=0002 | ||
+ | export PATH=$PATH: | ||
+ | </ | ||
+ | |||
+ | ==== Authentication ==== | ||
+ | |||
+ | <code bash> | ||
+ | filebrowser config set --auth.method=noauth | ||
+ | filebrowser config set --auth.method=proxy --auth.header=X-My-Header | ||
+ | </ | ||
+ | |||
+ | TBD | ||
+ | |||
+ | ==== Reverse Proxy ==== | ||
+ | |||
+ | Running FileBrowser behind NGINX is easy, this is an example: | ||
+ | <file - filebrowser.conf> | ||
+ | location / | ||
+ | client_max_body_size 512M; | ||
+ | |||
+ | proxy_pass http:// | ||
+ | proxy_http_version 1.1; | ||
+ | |||
+ | proxy_set_header Connection $http_connection; | ||
+ | proxy_set_header Connection ' | ||
+ | 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; | ||
+ | # | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | |||
+ | Remember to set the correct port as each instance of FileBrowser | ||
+ | |||
+ | ==== Running ==== | ||
+ | |||
+ | I assume | ||
+ | |||
+ | As a general startup rule, the first time you need to run it once to create the needed configuration files and database, then you want to start it with a script | ||
+ | |||
+ | For initial configuration: | ||
+ | <code bash> | ||
+ | su - myuser | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | As the starting script, since i use OpenRC, i have written the following init script wihch needs to be dropped to **/etc/init.d/ | ||
+ | <file filebrowser> | ||
+ | # | ||
+ | # Copyright 2024 Willy Garidol | ||
+ | # Distributed under the terms of the GNU General Public License v3 | ||
+ | |||
+ | depend() { | ||
+ | need localmount net | ||
+ | } | ||
+ | |||
+ | FB_LOG_PATH="/ | ||
+ | FB_SLOT=" | ||
+ | FB_USER=${USER: | ||
+ | FB_GROUP=${GROUP: | ||
+ | |||
+ | description=${DESCRIPTION: | ||
+ | pidfile="/ | ||
+ | command_background=true | ||
+ | command="/ | ||
+ | command_args=" | ||
+ | command_user=" | ||
+ | |||
+ | start_pre() { | ||
+ | if [ " | ||
+ | then | ||
+ | test -e " | ||
+ | test -e " | ||
+ | mkdir " | ||
+ | } && chown -R ${FB_USER} " | ||
+ | else | ||
+ | ebegin " | ||
+ | eend 255 | ||
+ | fi | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | make it executable! | ||
+ | |||
+ | Now, create a file **/ | ||
+ | <file filebrowser.myshare> | ||
+ | BASE_URL="/ | ||
+ | DATABASE="/ | ||
+ | DESCRIPTION=" | ||
+ | FOLDER="/ | ||
+ | GROUP=" | ||
+ | PORT=3005 | ||
+ | USER=" | ||
+ | </ | ||
+ | |||
+ | And create | ||
+ | <code bash> | ||
+ | ln -s / | ||
+ | rc-update add filebrowser.myshare default | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | To add more shares, just create new links to the // | ||
+ | |||
+ | |||
+ | ==== Updates ==== | ||
+ | |||
+ | Download a new binary release (see link above), replace binary and restart service. |