Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
services:filebrowser [2024/03/22 08:48] – willy | services:filebrowser [2025/01/21 11:50] (current) – [Running] willy | ||
---|---|---|---|
Line 5: | Line 5: | ||
==== Installation ==== | ==== 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. | + | Create a standard user to host the FileBrowser installation. You will most probably |
<code bash> | <code bash> | ||
Line 20: | Line 20: | ||
That's it! | 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 ==== | ==== Reverse Proxy ==== | ||
Line 43: | Line 60: | ||
</ | </ | ||
- | 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, | + | 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 ==== | ==== Running ==== | ||
Line 57: | Line 74: | ||
</ | </ | ||
- | The start script | + | As the starting |
- | < | + | <file filebrowser> |
- | #!/bin/bash | + | #!/sbin/openrc-run |
- | FILEBROWSER="/data/daemons/ | + | # Copyright 2024 Willy Garidol |
- | APP_PATH="/ | + | # Distributed under the terms of the GNU General Public License v3 |
- | DATA_PATH="/data/MyFiles" | + | |
- | BASE_URL="/files/myuser" | + | depend() { |
- | PORT=3005 | + | need localmount net |
- | "${FILEBROWSER}" | + | } |
- | "${FILEBROWSER}" | + | |
+ | FB_LOG_PATH="/var/log/ | ||
+ | FB_SLOT="${SVCNAME# | ||
+ | FB_USER=${USER: | ||
+ | FB_GROUP=${GROUP: | ||
+ | |||
+ | description=${DESCRIPTION: | ||
+ | pidfile="/run/${RC_SVCNAME}.pid" | ||
+ | command_background=true | ||
+ | command="/data/daemons/ | ||
+ | command_args="-r \"${FOLDER}\" -p ${PORT} | ||
+ | command_user="${FB_USER}: | ||
+ | |||
+ | start_pre() { | ||
+ | if [ "${FB_SLOT}" | ||
+ | then | ||
+ | test -e "${FB_LOG_PATH}" || mkdir "${FB_LOG_PATH}" | ||
+ | test -e "${FB_LOG_PATH}/${FB_SLOT}" | ||
+ | mkdir "${FB_LOG_PATH}/${FB_SLOT}" | ||
+ | } && chown -R ${FB_USER} | ||
+ | else | ||
+ | ebegin " | ||
+ | eend 255 | ||
+ | fi | ||
+ | } | ||
</ | </ | ||
- | And the startup script should be **/etc/local.d/40-filebrowser.start**: | + | make it executable! |
- | < | + | |
+ | Now, create a file **/etc/conf.d/ | ||
+ | <file filebrowser.myshare> | ||
+ | BASE_URL="/ | ||
+ | DATABASE="/ | ||
+ | DESCRIPTION=" | ||
+ | FOLDER="/ | ||
+ | GROUP=" | ||
+ | PORT=3005 | ||
+ | USER=" | ||
</ | </ | ||
- | make both executable of course. | + | |
+ | 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. | ||