silexlabs / unifile

Unified access to cloud storage services through a simple web API.
https://silexlabs.github.io/unifile/
MIT License
144 stars 32 forks source link

Question: best way to create "vhost"-like hosting #147

Open lexoyo opened 6 years ago

lexoyo commented 6 years ago

The question is: should I use the new extension system for what I am thinking about

I want to create a service, where my user authenticate and have an ID. They should be able to access a folder on my FTP or amazon storage - list, upload, download files with cloud explorer. Then I will provide them with a subdomain, e.g. {id}.mydomain.com and I want to serve their files on this subdomain.

For the subdomain part I it is easy but for the "shared" FTP I would like to use the one provided by unifile, so maybe the extension system could add the ID to all paths? E.g. "/userfolder1/file.jpg" would be "/my/ftp/root/{ID}/userfolder1/file.jpg"

JbIPS commented 6 years ago

Yes, I'm thinking of adding the path into the plugin lifecycle so it could be modified automatically.

From your example, you would setup a plugin to convert any path to your absolute one with ID