Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
sailing:filebrowser [2024/01/18 10:35] – willy | sailing:filebrowser [2024/01/18 10:44] (current) – removed willy | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== FileBrowser ====== | ||
- | |||
- | [[https:// | ||
- | |||
- | 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 / | ||
- | </ | ||
- | |||
- | the // | ||
- | |||
- | 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 // | ||
- | <code bash> | ||
- | > su - filebrowser | ||
- | > echo "umask 0002" >> ~/.bashrc | ||
- | > tar xvf linux-amd64-filebrowser.tar.gz | ||
- | > ./ | ||
- | </ | ||
- | |||
- | 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 **/ | ||
- | <code bash> | ||
- | > mkdir / | ||
- | > mkdir / | ||
- | > chown -R filebrowser: | ||
- | </ | ||
- | |||
- | Now, a startup script: | ||
- | <file bash filebrowser.sh> | ||
- | #!/bin/bash | ||
- | cd / | ||
- | ./ | ||
- | </ | ||
- | |||
- | And the usual autostart stuff: | ||
- | <file bash 40-filebrowser.start> | ||
- | #!/bin/bash | ||
- | start-stop-daemon -b -m -p / | ||
- | </ | ||
- | |||
- | Make both files executable. | ||
- | |||
- | Now, reverse proxy is simple, but this into **/ | ||
- | <file txt 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; | ||
- | } | ||
- | </ | ||
- | |||
- | and put this file include inside the usual **/ | ||
- | |||
- | |||
- | |||
- | <file bash filebrowser.sh> | ||
- | #!/bin/bash | ||
- | |||
- | SHARES=" | ||
- | |||
- | BASE_PATH=/ | ||
- | |||
- | 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 "/ | ||
- | su - $OWNER -c "/ | ||
- | SHARE.log 2> $BASE_PATH/ | ||
- | |||
- | echo Starting WebDAV backend for $OWNER on share $SHARE | ||
- | done | ||
- | </ | ||
- | |||