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:13] – 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** subfolder, required by WebDAV | + | |
- | * **conf** subfolder, where you will store custom NGINX config files for the private areas (and common area too) | + | |
- | ===== NGINX WebDAV approach ===== | + | I will assume that your shares are under **/ |
- | No need to use third party WebDAV server since NGINX has a pretty solid implementation of it already. Follow | + | 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 as separate shares as you like. Due to how WebDAV works, it is mandatory to separate the browser accessible URLs from the WebDAV ones, like i did above. | ||
+ | |||
+ | |||
+ | === 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> | ||
+ | mkdir / | ||
+ | mkdir / | ||
+ | chown fileserver: | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Fileserver access via Browser ===== | ||
+ | |||
+ | Nothing extra needs to be done except install AList, and adding the new shares inside it's WEB configuration. | ||
+ | |||
+ | |||
+ | ===== 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 | ||