1
0
mirror of https://github.com/falk-werner/webfuse synced 2025-06-13 12:54:15 +00:00

updates documentation

This commit is contained in:
Falk Werner 2019-04-13 22:18:52 +02:00
parent 9345f947cc
commit 1b15f30f2f
5 changed files with 28 additions and 17 deletions

View File

@ -38,11 +38,10 @@ webfuse solves this problem by using the [WebSocket](https://en.wikipedia.org/wi
With webfuse it is possible to implement remote filesystems based on websockets. With webfuse it is possible to implement remote filesystems based on websockets.
A reference implementation of such a daemon is provided within the examples. The picture above describes the workflow: A reference implementation of such a daemon is provided within the examples. The picture above describes the workflow:
- The websocket filesystem daemon (*webfuse daemon*) mounts a filesystem on startup. - The websocket filesystem daemon (*webfuse daemon*) waits for incoming connections.
It starts the websocket server and waits for incoming connections.
- A remote filesystem provider connects to webfuse daemon via websocket protocol. - A remote filesystem provider connects to webfuse daemon via websocket protocol and adds one or more filesystems.
The example includes such a provider implemented in HTML and JavaScript. *Note: the examples include such a provider implemented in HTML and JavaScript.*
- Whenever the user makes filesystem requests, such as *ls*, the request is redirected via webfuse daemon to the connected filesystem provider - Whenever the user makes filesystem requests, such as *ls*, the request is redirected via webfuse daemon to the connected filesystem provider
@ -275,10 +274,21 @@ Read from an open file.
### Requests (Provider -> Adapter) ### Requests (Provider -> Adapter)
#### add_filesystem
Adds a filesystem.
fs provider: {"method": "add_filesytem", "params": [<name>], "id": <id>}
webfuse daemon: {"result": {"id": <name>}, "id": <id>}
| Item | Data type | Description |
| ----------- | ----------| ------------------------------- |
| name | string | name and id of filesystem |
#### authtenticate #### authtenticate
Authenticate the provider. Authenticate the provider.
If authentication is enabled, a provider must be authenticated by the adapter before the adapter will send any messages. If authentication is enabled, a provider must be authenticated by the adapter before filesystems can be added.
fs provider: {"method": "authenticate", "params": [<type>, <credentials>], "id": <id>} fs provider: {"method": "authenticate", "params": [<type>, <credentials>], "id": <id>}
webfuse daemon: {"result": {}, "id": <id>} webfuse daemon: {"result": {}, "id": <id>}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -1,12 +1,10 @@
@startuml @startuml
participant "Filesystem Provider\n(e.g. Webbrowser)" as provider participant "Filesystem Provider\n(e.g. Webbrowser)" as provider
participant "webfuse\ndaemon" as daemon participant "webfuse\ndaemon" as daemon
actor "user" as user
group directory listing fails without authentication group add filesystem fails without authentication
user -> daemon : ls provider -> daemon : add_filesystem
daemon -> daemon : is_authenticated daemon -->x provider : error: access denied
daemon -->x user : error: no entry
end end
@ -17,12 +15,10 @@ daemon -> daemon: check(credentials)
daemon --> provider: result daemon --> provider: result
end end
group directory listing succeeds after authentication group add filesystem succeeds after authentication
user -> daemon : ls provider -> daemon: add_filesystem
daemon -> daemon : is_authenticated daemon -> daemon : fuse_mount
daemon -> provider : readdir daemon -> provider: okay
provider --> daemon : readdir_resp
daemon --> user : [., ..]
end end
@enduml @enduml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -4,7 +4,6 @@ participant "webfuse\ndaemon" as daemon
actor "user" as user actor "user" as user
group startup group startup
daemon -> daemon : fuse_mount
daemon -> daemon : start ws daemon -> daemon : start ws
end end
... ...
@ -16,9 +15,15 @@ provider -> daemon : connect
daemon -> daemon: check credentials daemon -> daemon: check credentials
daemon --> provider: okay daemon --> provider: okay
end end
provider -> daemon: add_filesystem
daemon -> daemon : fuse_mount
daemon -> provider: okay
end end
... ...
group directory listing group directory listing
user -> daemon : ls user -> daemon : ls
daemon -> provider : readdir daemon -> provider : readdir