Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
selfhost:fileserver [2024/02/22 08:43] – removed willy | selfhost:fileserver [2025/03/19 15:09] (current) – willy | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== H) File Server ====== | ||
+ | |||
+ | I will not discuss how to share your files on the home network using __legacy__ tools like [[https:// | ||
+ | |||
+ | 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 // | ||
+ | |||
+ | 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 and might be addressed in the future. | ||
+ | |||
+ | You will be using your SSO authentication, | ||
+ | |||
+ | In the past i used a more complex solution leveraging more tools. That obsolete solution has been moved, for reference, [[selfhost: | ||
+ | |||
+ | ===== Overall Architecture and Shares ===== | ||
+ | |||
+ | This solution leverages the use of one tool called AList (installation & configuration instructions [[services: | ||
+ | |||
+ | AList itself also support SSO integration, | ||
+ | |||
+ | You can also define as many shared folders as you like, and even connect to remote services from the same UI. | ||
+ | |||
+ | 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 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 | ||
+ | |||