Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
selfhost:fileserver [2024/01/16 10:25] – willy | selfhost:fileserver [2025/03/19 15:09] (current) – willy | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== File Server ====== | + | ====== |
+ | I will not discuss how to share your files on the home network using __legacy__ tools like [[https:// | ||
- | Access | + | I will focus on how to provide access via __web browser__ and via __WebDAV__, which is a web-based sharing protocol a bit like NFS or SAMBA, but aimed ad broader //in**ter**net// access, |
- | Access must be both from web page (HTTP/ | + | The idea is to create share areas where your users will be able to store files. It is possible to extend this idea also to user-specific areas where each user can put private stuff not visible by other users, but this require a little bit extra complexity |
- | [[sailing: | + | You will be using your SSO authentication, |
- | [[sailing:NGINX]] is used as WebDAV server. | + | In the past i used a more complex solution leveraging more tools. That obsolete solution has been moved, for reference, |
- | ===== Background | + | ===== Overall Architecture and Shares |
- | From users point of view, the common area will be managed by user **filebrowser** | + | This solution leverages |
- | Of course, each user will need to be part of the **users** group as well. | + | AList itself also support SSO integration, opening the way to provide also a public sharing approach, if needed since the SSO should not be enabled at reverse-proxy level. |
- | You will need a common " | + | You can also define as many shared folders as you like, and even connect |
- | This folder will need to contain: | + | |
- | * **common** subfolder, where the common area files will be stored (created in the [[sailing: | + | |
- | * **temp/ | + | |
- | * **temp/ | + | |
- | * **temp/ | + | |
- | * **logs** subfolder, to store NGINX log files | + | |
- | * **conf** subfolder, where you will store custom NGINX config files for the private areas (and common area too) | + | |
- | Create | + | I will assume that your shares are under **/ |
+ | |||
+ | Each share folder will have the following structure: | ||
+ | * / | ||
+ | * / | ||
+ | * / | ||
+ | |||
+ | Your AList installation will provide WebDAV and browser access from one single port hwich need to be reverse-proxied. | ||
+ | |||
+ | I choose to assign a dedicated subdomain, **drive.mydomain.com**, | ||
+ | * **https:// | ||
+ | * **https:// | ||
+ | * **https:// | ||
+ | * **https:// | ||
+ | * **https:// | ||
+ | * **https:// | ||
+ | |||
+ | I think that /webdav is easier to remember than /dav, but AList by default shared WebDAV under /dav, NGINX will be used to map the /webdav path to /dav. | ||
+ | |||
+ | You can add any more folders | ||
+ | |||
+ | |||
+ | === Permissions and Users === | ||
+ | |||
+ | (Note: you should run AList as the user **fileserver** and group **users**) | ||
+ | |||
+ | I assume you have already created the user **fileserver** when installing AList. | ||
+ | |||
+ | You need to set the //umask// for the fileserver user to **0002** so that any new files created by it will be writable by the users: | ||
<code bash> | <code bash> | ||
- | > | + | mkdir /data/shares |
- | > mkdir /data/archive/ | + | mkdir /data/shares/common |
- | > mkdir / | + | chown fileserver:users /data/shares |
- | > mkdir / | + | |
- | > mkdir / | + | |
- | > mkdir / | + | |
- | > mkdir / | + | |
- | > | + | |
</ | </ | ||
- | ===== NGINX WebDAV approach ===== | ||
- | No need to use third party WebDAV server since NGINX has a pretty solid implementation of it already. Follow the [[sailing: | + | ===== Fileserver access via Browser ===== |
- | Now, there is a nasty catch here which stems from using NGINX as WebDAV server... You need to run NGINX as // | + | Nothing extra needs to be done except install AList, and adding |
- | For consistency, | ||
- | <file txt / | ||
+ | ===== Fileserver access via WebDAV ===== | ||
- | </ | + | __NOTE:__ using HTTP will cause a 301 redirect to HTTPS, and WebDAV clients will fail. So use HTTPS URL in webdav clients and not HTTP. |
+ | The only chnage you need to make is to add the following location to the NGINX configuration file you created during AList setup: | ||
+ | < | ||
+ | location /webdav/ { | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | which will remap /webdav to /dav | ||