RFC: Using external storage with FreedomBox applications

Summary

Allow FreedomBox applications primarily intended for downloading and sharing files to use a shared storage location on external disks to store their data.

Note: Some technical details about implementation are omitted to avoid bias in implementation plans and to make the plan accessible to all readers. Implementation details will be discussed in the issue tracker after receiving comments on this.

Problems

  1. FreedomBox currently uses only one disk to store application data.Though there is support for adding additional disks, the system is not equipped to use it as additional storage.
  2. Files downloaded by one application are not accessible to others. Currently, the only way to get around this limitation is using the Sharing app.

Solution

When a user adds a new disk to their FreedomBox, an option will be presented in the Storage module to use the disk for application data storage (similar to how one would use expandable storage in Android devices). A directory called FreedomBox will be created on the external disk with a special set of permissions. The directory and its children will be owned by a user group called freedombox-share of which all the file sharing applications are members. Our current candidates for this are:

  • Deluge
  • Transmission
  • MLDonkey
  • Syncthing
  • Sharing

There can be any number of directories under the FreedomBox directory. Like Syncthing folders, BitTorrent download folders, Sharing folders etc. with arbitrary overlap. All the above apps will be able to read and write to folders under the FreedomBox directory.

Example Use Cases

  1. View photos and videos from your phone on the TV.
    Explanation: The Camera folder from the user’s phone is synced to their FreedomBox using Syncthing. The Sharing app makes it available to the TV over uPnP.
  2. Download a video using Transmission to FreedomBox and watch it on TV.
    Explanation: A directory like FreedomBox/Videos is set as the downloads folder in Transmission and is also shared using the Sharing app which makes it available to the TV using the uPnP protocol.
  3. Share a large file from one of the Syncthing folders using Transmission.
  4. Play multimedia files (downloaded by whatever application) in the browser using the Sharing app.
  5. Some future applications for music streaming, photo sharing etc. can make use of media in folders synced from smartphones and other computers.

I haven’t used MLDonkey yet but I imagine the use cases will be similar to Transmission.

Directory Browser

Once an external disk is configured for FreedomBox storage, a user should be able to use it with applications. A directory browser will help users choose the directory to download to or share from.

The UI will be similar to what is presented in Gnome when a user clicks on a file selector in a web page (the Browse button). This UI component will be made available in all of the above mentioned apps.

First, a user chooses the disk they want to use (only among the configured disks). The Directory Browser will detect and jump to the FreedomBox directory on the disk. The user can pick one of the existing directories or create a new one.
(Advanced) The user can also choose any other arbitrary location if they are sure about the path and its permissions.

Spike

I checked that it is possible to create a directory and set ACL rules on it such that a group of users will be able to use it as a common storage. I tested this configuration by using a common directory for Transmission and Syncthing.

2 Likes

Sounds good.

If we can avoid ACLs and implement this with regular unix file/directory ownership and permissions, then it will make things simpler.

No idea on the tecnical side, but this is definitely a gamechanger. The filebrowser makes things much easier for people who come from a desktop or mobileOS background. And the propper integration of external storage basically makes it replase a NAS, as i understand it.