From ab50e998cb8ae245fb8ff40edc9d17879addc795 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Fri, 13 Dec 2024 13:46:12 +0100 Subject: Docs: Pre-build mermaid files without plugin --- docs/md/building-client.md | 77 ++-------------------------------------------- docs/md/fsm.mmd | 67 ++++++++++++++++++++++++++++++++++++++++ docs/md/fsm.mmd.svg | 1 + docs/md/overview.mmd | 4 +++ docs/md/overview.mmd.svg | 1 + docs/mkdocs.yml | 2 -- 6 files changed, 75 insertions(+), 77 deletions(-) create mode 100644 docs/md/fsm.mmd create mode 100644 docs/md/fsm.mmd.svg create mode 100644 docs/md/overview.mmd create mode 100644 docs/md/overview.mmd.svg (limited to 'docs') diff --git a/docs/md/building-client.md b/docs/md/building-client.md index 5c01872..77c4eaf 100644 --- a/docs/md/building-client.md +++ b/docs/md/building-client.md @@ -20,12 +20,7 @@ And finally the most important goal: ## Architecture In the previous section, we have already hinted a bit on the exact architecture. This section will expand upon it by giving a figure of the basic structure -```mermaid -graph TD; -A[Go]-- Compiles to -->B[C shared library .so/.dll]; -C[Language wrapper]-- Loads -->B -Client -- Uses --> C; -``` +![overview of shared library structure](./overview.mmd.svg) As can be seen by this architecture, there is an intermediate layer between the client and the *shared* library. This wrapper eases the way of loading this library and then defining a more language specific API for it. In the eduvpn-common repo, we currently only support a Python wrapper. Clients themselves can define their own wrapper @@ -55,75 +50,7 @@ The eduvpn-common library uses a finite state machine internally to keep track o ### FSM example The following is an example of the FSM when the client has obtained a Wireguard/OpenVPN configuration from an eduVPN server -```mermaid -graph TD - -style Deregistered fill:cyan -Deregistered(Deregistered) -->|Register| Main - -style Main fill:white -Main(Main) -->|Deregister| Deregistered - -style Main fill:white -Main(Main) -->|Add a server| AddingServer - -style Main fill:white -Main(Main) -->|Get a VPN config| GettingConfig - -style Main fill:white -Main(Main) -->|Already connected| Connected - -style AddingServer fill:white -AddingServer(AddingServer) -->|Authorize| OAuthStarted - -style OAuthStarted fill:white -OAuthStarted(OAuthStarted) -->|Authorized| Main - -style GettingConfig fill:white -GettingConfig(GettingConfig) -->|Invalid location| AskLocation - -style GettingConfig fill:white -GettingConfig(GettingConfig) -->|Invalid or no profile| AskProfile - -style GettingConfig fill:white -GettingConfig(GettingConfig) -->|Successfully got a configuration| GotConfig - -style GettingConfig fill:white -GettingConfig(GettingConfig) -->|Authorize| OAuthStarted - -style AskLocation fill:white -AskLocation(AskLocation) -->|Location chosen| GettingConfig - -style AskProfile fill:white -AskProfile(AskProfile) -->|Profile chosen| GettingConfig - -style GotConfig fill:white -GotConfig(GotConfig) -->|Get a VPN config again| GettingConfig - -style GotConfig fill:white -GotConfig(GotConfig) -->|VPN is connecting| Connecting - -style Connecting fill:white -Connecting(Connecting) -->|VPN is connected| Connected - -style Connecting fill:white -Connecting(Connecting) -->|Cancel connecting| Disconnecting - -style Connected fill:white -Connected(Connected) -->|VPN is disconnecting| Disconnecting - -style Disconnecting fill:white -Disconnecting(Disconnecting) -->|VPN is disconnected| Disconnected - -style Disconnecting fill:white -Disconnecting(Disconnecting) -->|Cancel disconnecting| Connected - -style Disconnected fill:white -Disconnected(Disconnected) -->|Connect again| GettingConfig - -style Disconnected fill:white -Disconnected(Disconnected) -->|Renew| OAuthStarted -``` +![finite state machine (FSM) of eduvpn-common](./fsm.mmd.svg) The current state is highlighted in the cyan color. diff --git a/docs/md/fsm.mmd b/docs/md/fsm.mmd new file mode 100644 index 0000000..6f4ea24 --- /dev/null +++ b/docs/md/fsm.mmd @@ -0,0 +1,67 @@ +graph TD + +style Deregistered fill:cyan +Deregistered(Deregistered) -->|Register| Main + +style Main fill:white +Main(Main) -->|Deregister| Deregistered + +style Main fill:white +Main(Main) -->|Add a server| AddingServer + +style Main fill:white +Main(Main) -->|Get a VPN config| GettingConfig + +style Main fill:white +Main(Main) -->|Already connected| Connected + +style AddingServer fill:white +AddingServer(AddingServer) -->|Authorize| OAuthStarted + +style OAuthStarted fill:white +OAuthStarted(OAuthStarted) -->|Authorized| Main + +style GettingConfig fill:white +GettingConfig(GettingConfig) -->|Invalid location| AskLocation + +style GettingConfig fill:white +GettingConfig(GettingConfig) -->|Invalid or no profile| AskProfile + +style GettingConfig fill:white +GettingConfig(GettingConfig) -->|Successfully got a configuration| GotConfig + +style GettingConfig fill:white +GettingConfig(GettingConfig) -->|Authorize| OAuthStarted + +style AskLocation fill:white +AskLocation(AskLocation) -->|Location chosen| GettingConfig + +style AskProfile fill:white +AskProfile(AskProfile) -->|Profile chosen| GettingConfig + +style GotConfig fill:white +GotConfig(GotConfig) -->|Get a VPN config again| GettingConfig + +style GotConfig fill:white +GotConfig(GotConfig) -->|VPN is connecting| Connecting + +style Connecting fill:white +Connecting(Connecting) -->|VPN is connected| Connected + +style Connecting fill:white +Connecting(Connecting) -->|Cancel connecting| Disconnecting + +style Connected fill:white +Connected(Connected) -->|VPN is disconnecting| Disconnecting + +style Disconnecting fill:white +Disconnecting(Disconnecting) -->|VPN is disconnected| Disconnected + +style Disconnecting fill:white +Disconnecting(Disconnecting) -->|Cancel disconnecting| Connected + +style Disconnected fill:white +Disconnected(Disconnected) -->|Connect again| GettingConfig + +style Disconnected fill:white +Disconnected(Disconnected) -->|Renew| OAuthStarted diff --git a/docs/md/fsm.mmd.svg b/docs/md/fsm.mmd.svg new file mode 100644 index 0000000..7276cc7 --- /dev/null +++ b/docs/md/fsm.mmd.svg @@ -0,0 +1 @@ +
Register
Deregister
Add a server
Get a VPN config
Already connected
Authorize
Authorized
Invalid location
Invalid or no profile
Successfully got a configuration
Authorize
Location chosen
Profile chosen
Get a VPN config again
VPN is connecting
VPN is connected
Cancel connecting
VPN is disconnecting
VPN is disconnected
Cancel disconnecting
Connect again
Renew
Deregistered
Main
AddingServer
GettingConfig
Connected
OAuthStarted
AskLocation
AskProfile
GotConfig
Connecting
Disconnecting
Disconnected
\ No newline at end of file diff --git a/docs/md/overview.mmd b/docs/md/overview.mmd new file mode 100644 index 0000000..c19e4cb --- /dev/null +++ b/docs/md/overview.mmd @@ -0,0 +1,4 @@ +graph TD; +A[Go]-- Compiles to -->B[C shared library .so/.dll]; +C[Language wrapper]-- Loads -->B +Client -- Uses --> C; diff --git a/docs/md/overview.mmd.svg b/docs/md/overview.mmd.svg new file mode 100644 index 0000000..c3ee832 --- /dev/null +++ b/docs/md/overview.mmd.svg @@ -0,0 +1 @@ +
Compiles to
Loads
Uses
Go
C shared library .so/.dll
Language wrapper
Client
\ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index b48518d..15fbcfb 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -13,8 +13,6 @@ nav: - 'Building a client': building-client.md - 'API Docs': apidocs.md use_directory_urls: False -plugins: - - mermaid2 markdown_extensions: - markdown_include.include: - smarty -- cgit v1.2.3