Skip to content

Commit b0abb1b

Browse files
mudlerclaude
andcommitted
docs: restructure into a Diataxis tree with a generated CLI reference
The site was ~3,500 words for a project with ~90 CLI flags, and several of those words were wrong: --peerguardian is not a flag, the egress and `edgevpn start` features were undocumented entirely, and the architecture page described a ledger that had been replaced. Restructures docs/content into tutorials / how-to / reference / explanation, with a Hugo alias on every moved page so existing inbound links keep working. Adds internal/docsgen, which walks the real cli.App via cmd.NewApp and emits the CLI and environment-variable reference. A CI job regenerates and diffs it, so a flag cannot be added without the docs following. That covers 94 flags and 85 environment variables that were previously undocumented, and makes the --peerguardian class of defect structurally impossible. Publishes docs/design/authenticated-ledger.md, which had never shipped, and adds guides for HTTP egress, ledger ownership, relays, Docker and the ledger bucket namespace, plus a security model page stating plainly that EdgeVPN's model is perimeter-only. Relocates the README's unique content to the site and trims it. The README's Go library example did not compile; it does now. Also removes the unused docsy git submodule, adds the missing CONTRIBUTING.md the docs linked to, reconciles baseURL with what production actually serves, and fixes a 404 page that redirected visitors off-site. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 6ad8bca commit b0abb1b

72 files changed

Lines changed: 7503 additions & 495 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
22
version: 2
33
updates:
4-
- package-ecosystem: "gitsubmodule"
5-
directory: "/"
6-
schedule:
7-
interval: "weekly"
84
- package-ecosystem: "gomod"
95
directory: "/"
106
schedule:

.github/workflows/docs-gen.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Docs reference drift
2+
3+
on:
4+
# Narrowed to master: an unfiltered `push` also fires on every topic branch
5+
# and every tag, duplicating the run each pull request already performs.
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
10+
jobs:
11+
docs-gen:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v7
16+
- name: Set up Go
17+
uses: actions/setup-go@v6
18+
with:
19+
go-version: 1.26
20+
- name: Regenerate the reference
21+
run: make docs-gen
22+
- name: Fail if the generated reference is stale
23+
# The output is staged before diffing because `git diff --exit-code`
24+
# ignores untracked paths: a brand-new command makes the generator emit
25+
# a new cli/<name>.md, and an unstaged diff would pass while that page
26+
# went uncommitted. Diffing the index catches additions alongside
27+
# modifications and deletions.
28+
run: |
29+
git add -A docs/content/en/docs/reference/
30+
if ! git diff --cached --exit-code docs/content/en/docs/reference/; then
31+
echo "::error::The generated CLI reference is out of date. Run 'make docs-gen' and commit the result."
32+
exit 1
33+
fi

.github/workflows/pages.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Github Pages
22
on:
33
push:
44
branches: [ master ]
5+
# Pull requests build the docs so breakage is caught before merge. They must
6+
# never deploy: the Deploy step below is guarded on a push to master.
7+
pull_request:
8+
paths:
9+
- 'docs/**'
510

611
jobs:
712
build:

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Contributing to EdgeVPN
2+
3+
Thanks for wanting to help. This page is the short version; the full
4+
documentation lives at <https://mudler.github.io/edgevpn/docs/>.
5+
6+
## Build
7+
8+
EdgeVPN is a single Go binary. You need Go 1.26 (the version in `go.mod`) and
9+
nothing else:
10+
11+
```bash
12+
make build # go build -o edgevpn ./
13+
```
14+
15+
Building the **documentation site** additionally needs Hugo and Node/npm —
16+
`docs/scripts/build.sh` downloads the pinned Hugo (see `docs/Makefile`) and
17+
installs `postcss-cli` and `autoprefixer` for you:
18+
19+
```bash
20+
cd docs && make build # one-off build into docs/public
21+
cd docs && make serve # live preview on http://localhost:1313
22+
```
23+
24+
## Test
25+
26+
```bash
27+
make test # go test ./...
28+
```
29+
30+
The end-to-end suites that CI runs (VPN connectivity, services, file transfer)
31+
are the scripts under `.github/`; see `.github/workflows/test.yml` for how they
32+
are invoked.
33+
34+
## Adding or changing a CLI flag
35+
36+
The CLI and environment-variable reference under
37+
`docs/content/en/docs/reference/` is **generated** from the real `cli.App` — do
38+
not hand-edit those pages. After touching any flag or command, run:
39+
40+
```bash
41+
make docs-gen
42+
```
43+
44+
and commit the result. The `Docs reference drift` workflow regenerates the
45+
reference on every push and pull request and fails if the committed output
46+
differs, so a forgotten `make docs-gen` will turn CI red.
47+
48+
## Issues and pull requests
49+
50+
- Open issues and feature requests at
51+
<https://github.com/mudler/edgevpn/issues>.
52+
- Questions and general discussion belong in
53+
[GitHub Discussions](https://github.com/mudler/edgevpn/discussions) or the
54+
[Matrix room](https://matrix.to/#/#edgevpn:matrix.org).
55+
- Pull requests go against `master`. Please make sure `make test` and
56+
`make docs-gen` are clean before asking for review, and mark work in progress
57+
with a draft PR or a `WIP` prefix.
58+
59+
Docs-only changes have their own walkthrough (including the *Edit this page*
60+
shortcut) at
61+
<https://mudler.github.io/edgevpn/docs/contribution-guidelines/>.
62+
63+
## License
64+
65+
EdgeVPN is Apache 2.0 licensed. By contributing you agree that your
66+
contributions are licensed under the same terms.

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.PHONY: build test docs-gen
2+
3+
build:
4+
go build -o edgevpn ./
5+
6+
test:
7+
go test ./...
8+
9+
# docs-gen regenerates the CLI and environment-variable reference from the real
10+
# cli.App. The output is committed; CI re-runs this and fails on a diff, so the
11+
# docs cannot drift from the binary.
12+
docs-gen:
13+
go run ./internal/docsgen

README.md

Lines changed: 15 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ It can:
3232
- **Create a VPN** : Secure VPN between p2p peers
3333
- Automatically assign IPs to nodes
3434
- Embedded tiny DNS server to resolve internal/external IPs
35-
- Create trusted zones to prevent network access if token is leaked
35+
- Create trusted zones to restrict which peers may join (experimental: it does not currently stop a token holder from entering the zone — see the [security model](https://mudler.github.io/edgevpn/docs/explanation/security-model/))
3636
- For example, the [Kairos](https://github.com/kairos-io/kairos) CNCF project uses it as a layer for creating decentralized clusters with Kubernetes
3737

3838
- **Act as a reverse Proxy** : Share a tcp service like you would do with `ngrok`. EdgeVPN let expose TCP services to the p2p network nodes without establishing a VPN connection: creates reverse proxy and tunnels traffic into the p2p network.
@@ -75,6 +75,14 @@ Check out [Kairos](https://github.com/kairos-io/kairos) for seeing EdgeVPN in ac
7575

7676
Download the precompiled static release in the [releases page](https://github.com/mudler/edgevpn/releases). You can either install it in your system or just run it.
7777

78+
Or install the latest release with the one-liner:
79+
80+
```bash
81+
curl -sfL https://raw.githubusercontent.com/mudler/edgevpn/master/install.sh | sh
82+
```
83+
84+
Every installation route — install script, release archives, Homebrew, the container image and building from source — is covered in [Install EdgeVPN](https://mudler.github.io/edgevpn/docs/tutorials/install/).
85+
7886
# :computer: Usage
7987

8088
EdgeVPN works by generating tokens (or a configuration file) that can be shared between different machines, hosts or peers to access to a decentralized secured network between them.
@@ -129,90 +137,20 @@ $ EDGEVPNTOKEN=.. edgevpn --address 10.1.0.13/24
129137

130138
# :question: Is it for me?
131139

132-
EdgeVPN makes VPN decentralization a first strong requirement.
133-
134-
Its main use is for edge and low-end devices and especially for development.
135-
136-
The decentralized approach has few cons:
137-
138-
- The underlying network is chatty. It uses a Gossip protocol for synchronizing the routing table and p2p. Every blockchain message is broadcasted to all peers, while the traffic is to the host only.
139-
- Might be not suited for low latency workload.
140-
141-
Keep that in mind before using it for your prod networks!
142-
143-
But it has a strong pro: it just works everywhere libp2p works!
140+
The decentralized approach is chatty and might not suit low-latency workloads, and this software has not been security audited. Read [when not to use EdgeVPN](https://mudler.github.io/edgevpn/docs/explanation/when-not-to-use-edgevpn/) before you rely on it.
144141

145142
# :question: Why?
146143

147144
First of all it's my first experiment with libp2p. Second, I always wanted a more "open" `ngrok` alternative, but I always prefer to have "less infra" as possible to maintain. That's why building something like this on top of `libp2p` makes sense.
148145

149146
# :warning: Warning!
150147

151-
I'm not a security expert, and this software didn't went through a full security audit, so don't use and rely on it for sensible traffic and not even for production environment! I did this mostly for fun while I was experimenting with libp2p.
152-
153-
## Example use case: network-decentralized [k3s](https://github.com/k3s-io/k3s) test cluster
154-
155-
Let's see a practical example, you are developing something for kubernetes and you want to try a multi-node setup, but you have machines available that are only behind NAT (pity!) and you would really like to leverage HW.
156-
157-
If you are not really interested in network performance (again, that's for development purposes only!) then you could use `edgevpn` + [k3s](https://github.com/k3s-io/k3s) in this way:
158-
159-
1) Generate edgevpn config: `edgevpn -g > vpn.yaml`
160-
2) Start the vpn:
161-
162-
on node A: `sudo IFACE=edgevpn0 ADDRESS=10.1.0.3/24 EDGEVPNCONFIG=vpn.yml edgevpn`
163-
164-
on node B: `sudo IFACE=edgevpn0 ADDRESS=10.1.0.4/24 EDGEVPNCONFIG=vpm.yml edgevpn`
165-
3) Start k3s:
166-
167-
on node A: `k3s server --flannel-iface=edgevpn0`
168-
169-
on node B: `K3S_URL=https://10.1.0.3:6443 K3S_TOKEN=xx k3s agent --flannel-iface=edgevpn0 --node-ip 10.1.0.4`
170-
171-
We have used flannel here, but other CNI should work as well.
172-
173-
174-
# :notebook: As a library
175-
176-
EdgeVPN can be used as a library. It is very portable and offers a functional interface.
177-
178-
To join a node in a network from a token, without starting the vpn:
179-
180-
```golang
148+
This software has not been through a full security audit — don't rely on it for sensitive traffic or production environments. The full caveats are in [when not to use EdgeVPN](https://mudler.github.io/edgevpn/docs/explanation/when-not-to-use-edgevpn/).
181149

182-
import (
183-
node "github.com/mudler/edgevpn/pkg/node"
184-
)
150+
# :books: Examples
185151

186-
e := node.New(
187-
node.Logger(l),
188-
node.LogLevel(log.LevelInfo),
189-
node.MaxMessageSize(2 << 20),
190-
node.FromBase64( mDNSEnabled, DHTEnabled, token ),
191-
// ....
192-
)
193-
194-
e.Start(ctx)
195-
196-
```
197-
198-
or to start a VPN:
199-
200-
```golang
201-
202-
import (
203-
vpn "github.com/mudler/edgevpn/pkg/vpn"
204-
node "github.com/mudler/edgevpn/pkg/node"
205-
)
206-
207-
opts, err := vpn.Register(vpnOpts...)
208-
if err != nil {
209-
return err
210-
}
211-
212-
e := edgevpn.New(append(o, opts...)...)
213-
214-
e.Start(ctx)
215-
```
152+
- [A network-decentralized k3s test cluster](https://mudler.github.io/edgevpn/docs/tutorials/decentralized-k3s-cluster/) — a multi-node Kubernetes development cluster across machines behind NAT.
153+
- [Use EdgeVPN as a library](https://mudler.github.io/edgevpn/docs/how-to/use-as-a-library/) — embed a node in your own Go program.
216154

217155
# 🧑‍💻 Projects using EdgeVPN
218156

@@ -239,23 +177,7 @@ and any other way if not mentioned here.
239177

240178
# :notebook: Troubleshooting
241179

242-
If during bootstrap you see messages like:
243-
244-
```
245-
edgevpn[3679]: * [/ip4/104.131.131.82/tcp/4001] failed to negotiate stream multiplexer: context deadline exceeded
246-
```
247-
248-
or
249-
250-
```
251-
edgevpn[9971]: 2021/12/16 20:56:34 failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.
252-
```
253-
254-
or generally experiencing poor network performance, it is recommended to increase the maximum buffer size by running:
255-
256-
```
257-
sysctl -w net.core.rmem_max=2500000
258-
```
180+
Bootstrap failures, receive-buffer warnings and poor network performance are covered in [Troubleshooting](https://mudler.github.io/edgevpn/docs/troubleshooting/).
259181

260182
# :notebook: TODO
261183

docs/config.toml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
baseURL = "https://mudler.github.io/edgevpn/docs/"
1+
# Must match the -b value passed by scripts/build.sh, which is what production
2+
# is actually built with. The site root is https://mudler.github.io/edgevpn/;
3+
# /docs/ is a content section inside it, not the base.
4+
baseURL = "https://mudler.github.io/edgevpn/"
25
title = "EdgeVPN"
36

47
enableRobotsTXT = true
@@ -42,10 +45,9 @@ resampleFilter = "CatmullRom"
4245
quality = 75
4346
anchor = "smart"
4447

45-
[services]
46-
[services.googleAnalytics]
47-
# Comment out the next line to disable GA tracking. Also disables the feature described in [params.ui.feedback].
48-
id = "UA-00000000-0"
48+
# No analytics property is configured. The Docsy template ships a placeholder
49+
# "UA-00000000-0" here; leaving it in place sent page views and the
50+
# [params.ui.feedback] events to a property that does not exist.
4951

5052
# Language configuration
5153

@@ -118,8 +120,9 @@ offlineSearch = true
118120
[params.ui]
119121
# Enable to show the side bar menu in its compact state.
120122
sidebar_menu_compact = false
121-
# Set to true to disable breadcrumb navigation.
122-
breadcrumb_disable = true
123+
# Set to true to disable breadcrumb navigation. The docs tree is three levels
124+
# deep (docs / section / page), so breadcrumbs earn their keep.
125+
breadcrumb_disable = false
123126
# Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled)
124127
sidebar_search_disable = false
125128
# Set to false if you don't want to display a logo (/assets/icons/logo.svg) in the top nav bar
@@ -131,8 +134,11 @@ footer_about_disable = false
131134
# This feature depends on [services.googleAnalytics] and will be disabled if "services.googleAnalytics.id" is not set.
132135
# If you want this feature, but occasionally need to remove the "Feedback" section from a single page,
133136
# add "hide_feedback: true" to the page's front matter.
137+
# Disabled along with the analytics property above: the responses are delivered
138+
# as Google Analytics events, so with no property configured the widget would
139+
# only collect clicks and drop them. Re-enable once a GA4 property exists.
134140
[params.ui.feedback]
135-
enable = true
141+
enable = false
136142
# The responses that the user sees after clicking "yes" (the page was helpful) or "no" (the page was not helpful).
137143
yes = 'Glad to hear it! Please <a href="https://github.com/mudler/edgevpn/issues/new">tell us how we can improve</a>.'
138144
no = 'Sorry to hear that. Please <a href="https://github.com/mudler/edgevpn/issues/new">tell us how we can improve</a>.'

docs/content/en/_index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ <h1 class="text-center">
7171
</h1>
7272

7373
<center>
74-
<a class="btn btn-md btn-primary mr-3 mb-4" href="{{< relref "/docs">}}/getting-started/api/">
74+
<a class="btn btn-md btn-primary mr-3 mb-4" href="{{< relref "/docs/reference/api" >}}">
7575
WebUI
7676
<i class="fa fa-globe ml-2"></i></a>
77-
<a class="btn btn-md btn-primary mr-3 mb-4" href="{{< relref "/docs">}}/getting-started/gui/">GUI
77+
<a class="btn btn-md btn-primary mr-3 mb-4" href="{{< relref "/docs/tools/desktop-gui" >}}">GUI
7878
<i class="fa fa-desktop ml-2"></i></a><br>
7979
Keep an eye on your network with the Web UI. <br>
8080
Connect easily from your workstation with the frontend GUI app.

docs/content/en/community/_index.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)