From 6c7a1c7a9245cf457a86fd15bdc14bc93b55d508 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 26 Apr 2022 16:49:15 +0200 Subject: Docs: Use an SVG for the FSM --- docs/src/gettingstarted/debugging/fsm.md | 6 ++++-- docs/src/gettingstarted/debugging/fsm_example.png | Bin 62025 -> 0 bytes docs/src/gettingstarted/debugging/fsm_example.svg | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) delete mode 100644 docs/src/gettingstarted/debugging/fsm_example.png create mode 100644 docs/src/gettingstarted/debugging/fsm_example.svg (limited to 'docs/src/gettingstarted/debugging') diff --git a/docs/src/gettingstarted/debugging/fsm.md b/docs/src/gettingstarted/debugging/fsm.md index 65ff031..08022cb 100644 --- a/docs/src/gettingstarted/debugging/fsm.md +++ b/docs/src/gettingstarted/debugging/fsm.md @@ -1,16 +1,18 @@ # Finite State Machine -The eduvpn-common library uses a Finite State Machine internally to keep track of which state the client is in and to communicate data callbacks(e.g. to communicate the Authorization URL in the OAuth process to the client). +The eduvpn-common library uses a Finite State Machine internally to keep track of which state the client is in and to communicate data callbacks (e.g. to communicate the Authorization URL in the OAuth process to the client). ## Viewing the FSM To view the FSM in an image, set the debug variable to `True`. This outputs the graph with a `.graph` extension in the client-specified config directory (See [API](../../api/index.html)). The format of this graph is from [Mermaid](https://mermaid-js.github.io/mermaid/#/). If you have the [Mermaid command line client](https://github.com/mermaid-js/mermaid-cli) installed, the Go library will automatically provide a PNG file in the same directory of the `.graph` file. We recommend to use an image viewer that has auto-reload capabilities, such as [feh](https://feh.finalrewind.org/)[^1] for Linux. +If you do not want to install additional tools to view the graph, you can submit the contents of the `.graph` file to the [Mermaid Live Editor](https://mermaid.live/) to see the image. + ## FSM Example The following is an example of the FSM when the client has obtained a Wireguard/OpenVPN configuration from an eduVPN server -![](./fsm_example.png) +![](./fsm_example.svg) The current state is highlighted in the cyan color. diff --git a/docs/src/gettingstarted/debugging/fsm_example.png b/docs/src/gettingstarted/debugging/fsm_example.png deleted file mode 100644 index 7b68d8e..0000000 Binary files a/docs/src/gettingstarted/debugging/fsm_example.png and /dev/null differ diff --git a/docs/src/gettingstarted/debugging/fsm_example.svg b/docs/src/gettingstarted/debugging/fsm_example.svg new file mode 100644 index 0000000..9b19280 --- /dev/null +++ b/docs/src/gettingstarted/debugging/fsm_example.svg @@ -0,0 +1 @@ +
Client registers
User chooses a server
Found tokens in config
No tokens found in config
User authorizes with browser
Cancel OAuth
Re-authorize with OAuth
Client requests a config
Multiple profiles found
Success, only one profile
OS reports connected
User chooses profile and success
OS reports disconnected
Deregistered
No_Server
Chosen_Server
Authorized
OAuth_Started
Request_Config
Ask_Profile
Has_Config
Connected
\ No newline at end of file -- cgit v1.2.3