Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| services:filebrowser [2025/09/23 12:50] – [FileBrowser] willy | services:filebrowser [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== FileBrowser ===== | ||
| - | |||
| - | __Note:__ i have started using [[services: | ||
| - | |||
| - | There are a few software out there, but i like [[https:// | ||
| - | |||
| - | ==== Installation ==== | ||
| - | |||
| - | Create a standard user to host the FileBrowser installation. You will most probably //never// run it as this user, but always as different users, to allow it manage files owned by those users. | ||
| - | |||
| - | <code bash> | ||
| - | useradd -d / | ||
| - | </ | ||
| - | |||
| - | The default install approach is based on a auto executable web link ([[https:// | ||
| - | <code bash> | ||
| - | su - filebrowser | ||
| - | mkdir bin | ||
| - | cd bin | ||
| - | tar xvf ../ | ||
| - | </ | ||
| - | |||
| - | That's it! | ||
| - | |||
| - | In addition you might want to create the following **.bashrc**: | ||
| - | <file - .bashrc> | ||
| - | #!/bin/bash | ||
| - | |||
| - | 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 will have to run with it's own port, and set a reasonable location URL. This setup will also make use of FileBrowser user intergation with Proxy Authentication, | ||
| - | |||
| - | ==== Running ==== | ||
| - | |||
| - | I assume you want to run it as user **myuser**. | ||
| - | |||
| - | 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 and have it start automatically at boot. | ||
| - | |||
| - | 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 **/ | ||
| - | <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 the symlink, start it and add to autostart: | ||
| - | <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. | ||