1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-12 12:52:03 +00:00
Go to file
Falk Werner bd49d69b09 do not lint cast to fuse_fill_dir_flags
The allowed value of 0 is not part of the enum definition.

Signed-off-by: Falk Werner <falk.werner@gmx.net>
2024-10-11 16:40:19 +02:00
.devcontainer build and develop using docker 2024-10-11 16:40:19 +02:00
.github Update build.yml 2024-04-23 16:42:12 +02:00
doc build and develop using docker 2024-10-11 16:40:19 +02:00
example add javascript example 2023-02-05 11:37:19 +01:00
script refine directory structure 2023-01-27 17:55:58 +01:00
src do not lint cast to fuse_fill_dir_flags 2024-10-11 16:40:19 +02:00
test-src fix check of existense of closefrom function 2024-01-08 18:30:39 +01:00
.gitignore build and develop using docker 2024-10-11 16:40:19 +02:00
CMakeLists.txt make clang-tidy happy (old versions of clang tidy don't understand some NOLINT comments) 2024-01-08 18:30:39 +01:00
COPYING.LESSER initial commit 2022-11-12 11:34:51 +01:00
docker-bake.hcl build and develop using docker 2024-10-11 16:40:19 +02:00
Dockerfile build and develop using docker 2024-10-11 16:40:19 +02:00
README.md remove section about webfuse legacy 2023-11-07 22:10:32 +01:00
SECURITY.md Add security policy 2023-06-17 00:13:50 +02:00

build

webfuse

webfuse combines libwebsockets and libfuse. It allows to attach a remote filesystem via websockets.

Motivation

Many embedded devices, such as smart home or IoT devices are very limited regarding to their (non-volatile) memory resources. Such devices are typically comprised of an embedded linux and a small web server, providing an interface for maintenance purposes.

Some use cases, such as firmware update, require to transfer (larger) files to the device. The firmware file is often stored multiple times on the device:

  1. cached by the web server, e.g. lighttpd
  2. copied to locally, e.g. /tmp
  3. uncompressed, also to /tmp

Techniques like SquashFS help to avoid the third step, since the upgrade file can be mounted directly. RAUC shows the use of SquashFS within an update facility.
However at least one (unecessary) copy of the upload file is needed on the device.

To avoid Steps 1 and 2, it would be great to keep the update file entirely in web server, just like NFS or WebDAV. Unfortunately, NFS is not based on any protocol, natively usable by a web application. WebDAV is based on HTTP, but it needs a server providing the update file.

webfuse solves this problem by using the WebSocket protocol. The emdedded device runs a service, known as webfuse adapter, awaiting incoming connections, e.g. from a web browser. The browser acts as a file system provider, providing the update file to the device.

Concept

concept

With webfuse it is possible to implement remote filesystems based on websockets. Therefore, webfuse defined two roles participating in a webfuse connection:

  • webfuse service
  • webfuse provider

Webfuse Service

A webfuse service is both,

  • a websocket service providing the webfuse protocol
  • a fuse filesystem attached to a local mountpoint

The webfuse service awaits incoming connections from a webfuse provider. Once connected, it communicates all the filesystem requests originated by the libfuse to the connected webfuse provider using the websocket-based webfuse protocol.

By doing so, webfuse allows to inject a filesystem to a remote device.

Webfuse Provider

A webfuse provider provides a filesystem to a remote device using the websocket-based webfuse protocol. Therefore, a webfuse provider implements a websocket client.

Similar Projects

Davfs2

davfs2 is a Linux file system driver that allows to mount a WebDAV resource. WebDAV is an extension to HTTP/1.1 that allows remote collaborative authoring of Web resources.

Unlike webfuse, davfs2 mounts a remote filesystem locally, that is provided by a WebDAV server. In contrast, webfuse starts a server awaiting client connections to attach the remote file system.

Further Documentation