1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00
falk-werner_webfuse/README.md

85 lines
5.3 KiB
Markdown
Raw Normal View History

2019-03-26 22:04:53 +00:00
[![Build Status](https://travis-ci.org/falk-werner/webfuse.svg?branch=master)](https://travis-ci.org/falk-werner/webfuse)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d6c20d37bb3a456a9c0ee224001081b2)](https://www.codacy.com/app/falk.werner/webfuse?utm_source=github.com&utm_medium=referral&utm_content=falk-werner/webfuse&utm_campaign=Badge_Grade)
[![codecov](https://codecov.io/gh/falk-werner/webfuse/branch/master/graph/badge.svg)](https://codecov.io/gh/falk-werner/webfuse)
2019-02-12 19:38:45 +00:00
2019-03-26 22:04:53 +00:00
# webfuse
2019-01-27 11:32:02 +00:00
2019-03-26 22:04:53 +00:00
webfuse combines libwebsockets and libfuse. It allows ot attach a remote filesystem via websockets.
2019-01-27 11:32:02 +00:00
2019-02-13 18:43:29 +00:00
## Contents
2019-02-12 20:43:50 +00:00
- [Motivation](#Motivation)
2020-02-09 19:42:57 +00:00
- [Fellow Repositories](#Fellow-Repositories)
2020-06-26 16:53:43 +00:00
- [Known Implementations](#Known-Implementations)
- [Concept](#Concept)
- [Similar Projects](#Similar-Projects)
2020-02-18 20:48:52 +00:00
- [Further Documentation](#Further-Documentation)
2019-01-27 11:32:02 +00:00
## Motivation
Many embedded devices, such as smart home or [IoT](https://en.wikipedia.org/wiki/Internet_of_things) 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](https://redmine.lighttpd.net/boards/2/topics/3451)
2. copied to locally, e.g. /tmp
3. uncompressed, also to /tmp
Techniques like [SquashFS](https://en.wikipedia.org/wiki/SquashFS) help to avoid the third step, since the upgrade file can be mounted directly. [RAUC](https://rauc.io/) 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](https://en.wikipedia.org/wiki/Network_File_System) or [WebDAV](https://wiki.archlinux.org/index.php/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.
2019-03-26 22:04:53 +00:00
webfuse solves this problem by using the [WebSocket](https://en.wikipedia.org/wiki/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.
2020-02-09 19:42:57 +00:00
## Fellow Repositories
- **[webfuse-example](https://github.com/falk-werner/webfuse-example)**: Example of webfuse
- **[webfused](https://github.com/falk-werner/webfused)**: Reference implementation of webfuse daemon
2020-06-26 16:40:21 +00:00
- **[webfuse-provider](https://github.com/falk-werner/webfuse-provider)**: webfuse provider library (C/C++)
- **[webfuse-js](https://github.com/falk-werner/webfuse-js)**: webfuse provider library (JavaScript))
2020-02-09 19:42:57 +00:00
2020-06-26 16:53:43 +00:00
## Known Implementations
| Implementation | Language | Adatper/Server | Adapter/Client | Provider/Server | Provider/Client |
| ------------------------------------------------------------------- | ---------- | ------------- | -------------- | --------------- | --------------- |
2020-06-26 17:04:13 +00:00
| [webfuse](https://github.com/falk-werner/webfuse) | C/C++ | ✔ | ✔ | - | - |
| [webfuse-provider](https://github.com/falk-werner/webfuse-provider) | C/C++ | - | - | - | ✔ |
2020-06-26 17:05:43 +00:00
| [webfuse-js](https://github.com/falk-werner/webfuse-js) | JavaScript | - | - | - | ✔ |
2020-06-26 16:53:43 +00:00
## Concept
![concept](doc/concept.png)
2019-02-10 19:05:36 +00:00
2019-03-26 22:04:53 +00:00
With webfuse it is possible to implement remote filesystems based on websockets.
2019-02-10 19:05:36 +00:00
A reference implementation of such a daemon is provided within the examples. The picture above describes the workflow:
feat(webfuse): add multiclient support (#23) * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * adds missing toolchain headers to project * renames container macros * adds gdbserver * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * adds missing toolchain headers to project * renames container macros * adds gdbserver * removes language settings, which contains alternating values * adds wrapper script to launch gdbserver * fix docker command in wrapper script * fixes run in dind setup * replaces docker's init through dump-init * moves filesystem to session * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * renames container macros * adds gdbserver * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * renames container macros * adds gdbserver * adds wrapper script to launch gdbserver * fix docker command in wrapper script * fixes run in dind setup * replaces docker's init through dump-init * moves filesystem to session * adds container_of * added dlist * allows multiple clients to connect * removes directory when session is closed * adds dependecy to uuid-dev * allow clients to register filesystems * updates documentation * moves mountpoint handling into filesystem: mountpoints are removed during session cleanup * adds filesystem name/id to request parameters * fixes security issue: add_filesystem did not check name * removes default link, if it is broken * recreates symlink "default", if filesystem is gone * updates documentation * fixes memory leak * makes authentication work .. again * updates provider to support changed protocol * removes execute right of hello.txt * fixes style issues * fixes javascript style issues * fixes flase positive from Flawfinder * fixes some javascript style issues * removes use of PATH_MAX * removes use of GNU extensions in container_of implementation * ignores findings of flawfinder * replaces dlist by slist * removes duplicate implementation of slist (message_queue)
2019-04-17 20:51:16 +00:00
- The websocket filesystem daemon (*webfuse daemon*) waits for incoming connections.
2019-02-14 23:00:44 +00:00
feat(webfuse): add multiclient support (#23) * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * adds missing toolchain headers to project * renames container macros * adds gdbserver * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * adds missing toolchain headers to project * renames container macros * adds gdbserver * removes language settings, which contains alternating values * adds wrapper script to launch gdbserver * fix docker command in wrapper script * fixes run in dind setup * replaces docker's init through dump-init * moves filesystem to session * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * renames container macros * adds gdbserver * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * renames container macros * adds gdbserver * adds wrapper script to launch gdbserver * fix docker command in wrapper script * fixes run in dind setup * replaces docker's init through dump-init * moves filesystem to session * adds container_of * added dlist * allows multiple clients to connect * removes directory when session is closed * adds dependecy to uuid-dev * allow clients to register filesystems * updates documentation * moves mountpoint handling into filesystem: mountpoints are removed during session cleanup * adds filesystem name/id to request parameters * fixes security issue: add_filesystem did not check name * removes default link, if it is broken * recreates symlink "default", if filesystem is gone * updates documentation * fixes memory leak * makes authentication work .. again * updates provider to support changed protocol * removes execute right of hello.txt * fixes style issues * fixes javascript style issues * fixes flase positive from Flawfinder * fixes some javascript style issues * removes use of PATH_MAX * removes use of GNU extensions in container_of implementation * ignores findings of flawfinder * replaces dlist by slist * removes duplicate implementation of slist (message_queue)
2019-04-17 20:51:16 +00:00
- A remote filesystem provider connects to webfuse daemon via websocket protocol and adds one or more filesystems.
*Note: the examples include such a provider implemented in HTML and JavaScript.*
2019-02-14 23:00:44 +00:00
2019-03-26 22:04:53 +00:00
- Whenever the user makes filesystem requests, such as *ls*, the request is redirected via webfuse daemon to the connected filesystem provider
2019-02-10 19:05:36 +00:00
2020-02-18 20:48:52 +00:00
### Adapters and Providers
2019-02-10 19:05:36 +00:00
2020-02-18 20:48:52 +00:00
In webfuse, an adapter is a component that adapts the libfuse API to a websocket interface.
Currently, libwebfuse provides both, server based and client based adapters.
feat(webfuse): add multiclient support (#23) * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * adds missing toolchain headers to project * renames container macros * adds gdbserver * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * adds missing toolchain headers to project * renames container macros * adds gdbserver * removes language settings, which contains alternating values * adds wrapper script to launch gdbserver * fix docker command in wrapper script * fixes run in dind setup * replaces docker's init through dump-init * moves filesystem to session * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * renames container macros * adds gdbserver * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * renames container macros * adds gdbserver * adds wrapper script to launch gdbserver * fix docker command in wrapper script * fixes run in dind setup * replaces docker's init through dump-init * moves filesystem to session * adds container_of * added dlist * allows multiple clients to connect * removes directory when session is closed * adds dependecy to uuid-dev * allow clients to register filesystems * updates documentation * moves mountpoint handling into filesystem: mountpoints are removed during session cleanup * adds filesystem name/id to request parameters * fixes security issue: add_filesystem did not check name * removes default link, if it is broken * recreates symlink "default", if filesystem is gone * updates documentation * fixes memory leak * makes authentication work .. again * updates provider to support changed protocol * removes execute right of hello.txt * fixes style issues * fixes javascript style issues * fixes flase positive from Flawfinder * fixes some javascript style issues * removes use of PATH_MAX * removes use of GNU extensions in container_of implementation * ignores findings of flawfinder * replaces dlist by slist * removes duplicate implementation of slist (message_queue)
2019-04-17 20:51:16 +00:00
2020-02-18 20:48:52 +00:00
In webfuse, a provider is a component that provides a filesystem via websocket interface.
Take a look at [known implementations](#Known-Implementations) to find provider libraries.
feat(webfuse): add multiclient support (#23) * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * adds missing toolchain headers to project * renames container macros * adds gdbserver * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * adds missing toolchain headers to project * renames container macros * adds gdbserver * removes language settings, which contains alternating values * adds wrapper script to launch gdbserver * fix docker command in wrapper script * fixes run in dind setup * replaces docker's init through dump-init * moves filesystem to session * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * renames container macros * adds gdbserver * fixes verbosity option when set through command line * adds support for build type and allows to run gdb in container * renames container macros * adds gdbserver * adds wrapper script to launch gdbserver * fix docker command in wrapper script * fixes run in dind setup * replaces docker's init through dump-init * moves filesystem to session * adds container_of * added dlist * allows multiple clients to connect * removes directory when session is closed * adds dependecy to uuid-dev * allow clients to register filesystems * updates documentation * moves mountpoint handling into filesystem: mountpoints are removed during session cleanup * adds filesystem name/id to request parameters * fixes security issue: add_filesystem did not check name * removes default link, if it is broken * recreates symlink "default", if filesystem is gone * updates documentation * fixes memory leak * makes authentication work .. again * updates provider to support changed protocol * removes execute right of hello.txt * fixes style issues * fixes javascript style issues * fixes flase positive from Flawfinder * fixes some javascript style issues * removes use of PATH_MAX * removes use of GNU extensions in container_of implementation * ignores findings of flawfinder * replaces dlist by slist * removes duplicate implementation of slist (message_queue)
2019-04-17 20:51:16 +00:00
## Similar Projects
### Davfs2
[davfs2](http://savannah.nongnu.org/projects/davfs2) is a Linux file system driver that allows to mount a [WebDAV](https://wiki.archlinux.org/index.php/WebDAV) resource. WebDAV is an extension to HTTP/1.1 that allows remote collaborative authoring of Web resources.
2019-03-26 22:04:53 +00:00
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.
2020-02-18 20:48:52 +00:00
## Further Documentation
2020-02-18 20:48:52 +00:00
- [Build instructions](doc/build.md)
- [Webfuse Protocol](doc/protocol.md)
- [API](doc/api.md)