- Has a base directory (like /var/www/
- to be injected by enviroment
- Below this directory exists subdirectories PER user
- Like /var/www/nico
The ucloud-file-scan service scans the base path every x minutes (we might be able to trigger this by cron job) and creates etcd entries.
Users can list their files by ucloud-cli. Files are created off band with sftp.
How it interacts with the other systems¶
- Found files are created in etcd below /v1/files/$UUID
- Each file gets a random UUID
- Json contains at least:
- some checksum (sha512sum maybe)
- date created
- size (in bytes)
How to extend ucloud-api and ucloud-cli¶
Support the following command(s)
- ucloud-cli files-list
Upload and delete is NOT supported by the CLI, but will be using sftp.
Note: we COULD wrap sftp for the user into
- ucloud-cli files-upload file [file...]
which in turn calls
- sftp ... files.datacenterlight.ch
(this is earliest for v2)
Improving scanning speed¶
In theory we can also use inotify and events for rescanning. However if we miss an event, we miss the file/image upload. Thus we need to regularly scan, but we can ALSO have an event based system as well.
(this is earliest for v3)