Skip to content

Commit 48500e1

Browse files
authored
V0.1.1 documentation (#6)
1 parent 863d3ce commit 48500e1

File tree

8 files changed

+241
-96
lines changed

8 files changed

+241
-96
lines changed

.vitepress/config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ function sidebarGuide() {
6060
}, {
6161
text: 'Quick Start',
6262
link: '/guide/quick-start',
63-
},
63+
}, {
64+
text: 'Self Deployment',
65+
link: '/guide/self-deploy'
66+
},
6467
/*{
6568
text: 'Admin Web Tutorial',
6669
link: '/guide/admin_web_tutorial'

guide/quick-start.md

Lines changed: 8 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,13 @@
11
# Getting Started
22

3-
## Installation
3+
ForNet now provide a sever service for users to easy try. It's in beta status. you can deploy it yourself with this [guide](./self-deploy).
4+
:: tip
5+
P2P is under development, you should deploy relay server on Linux OS.
6+
::
7+
## client installation
48

5-
### Prerequisites
6-
ForNet is a client-server model program, you need to deploy server firstly,
7-
and ForNet now needs relay node to let devices connect each other. You need have a linux server to deploy the relay instance.
8-
We are in hard work to build SaaS backend server and implement p2p connection feature. You would only need to install client then.
9-
10-
If you like to build ForNet from the source code, please refer [Develop Guide](./develop) for more information.
11-
12-
### Client
139
you can download client binary app at Github <a :href="`${$sourceUrl}/releases`">release page</a>, it now supports macOS、Linux and Windows 11. **Client needs root/administrator permission to run**, unix is to create tun, Windows is to install driver.
1410

15-
### Server
16-
The manager server is written by Scala 3, you can deploy the jar or docker image. It uses Postgres to store data. and uses [rmqtt](https://github.com/rmqtt/rmqtt) to interact with client.
17-
18-
There is <a :href="`${$sourceUrl}/tree/main/command/docker-compose/simple/docker-compose.yml`">docker-compose.yml</a> for quick start, you can ship it with:
19-
```shell
20-
# must be in the directory
21-
# it needs config files of backend and rmqtt
22-
cd /command/docker-compose/simple
23-
docker-compose up
24-
```
25-
If you would like to deploy with docker step by step, you can follow this:
26-
#### Postgres
27-
```shell
28-
# If platform is Mac/Windows, change --network=host to -p 5432:5432
29-
docker run -d --name postgres --network=host \
30-
-e POSTGRES_PASSWORD=tnet_db_password \
31-
-e POSTGRES_DB=tnet_db \
32-
-e POSTGRES_USER=postgres \
33-
-v ${local_machine/pg/path}:/var/lib/postgresql/data \
34-
postgres:15
35-
```
36-
37-
#### Deploy RMQTT Docker
38-
Here is an example of rmqtt <a :href="$sourceUrl + '/tree/main/command/docker/mqtt'">config</a>, you can run it after changed backend server url in `config/plugin/rmqtt-auth-http.toml`.
39-
40-
More details about RMQTT can be found [here](https://github.com/rmqtt/rmqtt).
41-
```shell
42-
cd /command/docker/mqtt
43-
# RMQTT will use port:
44-
# 1883(mqtt) 6060(http api) 5363(grpc)
45-
docker run -d --name mqtt --network=host \
46-
-v $(pwd)/log:/var/log/rmqtt \
47-
-v $(pwd)/config/rmqtt.toml:/app/rmqtt/rmqtt.toml \
48-
-v $(pwd)/config/plugin:/app/rmqtt/plugin \
49-
rmqtt/rmqtt:latest
50-
```
51-
52-
#### Deploy Server Docker
53-
There is two config file: `application.conf` and `logback.xml`, you can get the example <a :href="$sourceUrl + 'tree/main/command/docker/backend/config'">here</a>.
54-
More details about config can be found [here](config.md).
55-
56-
```shell
57-
# run server with database init, 8080 is for http api, 9000 is for grpc.
58-
docker run -it -d \
59-
-p 8080:8080 -p 9000:9000 \
60-
-v ${local_machine/applcation.conf+logback.xml/path}:/config \
61-
--name=fornet-backend \
62-
fornetcode/fornet-backend:latest
63-
64-
```
65-
66-
## Up and Running
67-
68-
### Create Network
69-
After the backend server up, visit the backend website: http://127.0.0.1:8080, If you use simple auth, just type the config value of `auth.simple.token` to login in.
70-
Then you could create network, and get invite code to let client node join in.
7111

7212
### Client Join Network
7313
There's `fornet` and `fornet-cli`, `fornet` is the background service, `fornet-cli` is used to interact with `fornet`.
@@ -77,7 +17,7 @@ sudo fornet &
7717
# you could get the invite cod from the admin web.
7818
sudo fornet-cli join ${invite code}
7919
```
80-
You can also use docker in Linux(thisdoes not support macOS, indows).
20+
You can also use docker in Linux(this does not support macOS, indows).
8121
```shell
8222
# export config to host, otherwise private.key will miss if image delete
8323
docker run -it --name=fornet \
@@ -131,5 +71,6 @@ systemctl start fornet
13171
```shell
13272
sudo fornet-cli launch enable
13373
```
74+
13475
## What's More
135-
If you are interested with this project, you can go [roadmap](../plan) to get more information.
76+
If you would like to deploy it self, please refer this [doc](./self-deploy) and get roadmap [here](../plan).

guide/quick-test.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Quick Test
2+
This is for quick test.
3+
## linux
4+
### Backend
5+
```shell
6+
# cd $fornet_project_path
7+
docker start mqtt nginx postgres
8+
# docker rmi ghcr.io/fornetcode/fornet-backend:latest
9+
10+
docker run --rm -v $PWD/backend/src/main/resources:/config --network=host ghcr.io/fornetcode/fornet-backend:latest
11+
```
12+
13+
### Client
14+
```shell
15+
wget https://github.com/ForNetCode/fornet/releases/download/v0.1.0/fornet-linux-x86_64.tar.gz
16+
17+
#docker run
18+
```
19+
20+
## Windows
21+
### Client
22+
```pwsh
23+
wget https://github.com/ForNetCode/fornet/releases/download/v0.1.0/fornet-win11-x86_64.zip
24+
25+
```
26+
27+
##

guide/real_self_deploy.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
## 本地
3+
```bash
4+
cd $fornet_git_project_path/command/docker
5+
6+
scp -r backend/config/* $RemoteHost:~/data/config/backend/
7+
scp -r mqtt/config/ $RemoteHost:~/data/config/backend/
8+
9+
10+
```
11+
12+
```shell
13+
# change config
14+
# firewall: 443, 4883(mqtts tcp)
15+
# http ssl certificater
16+
cd ~
17+
mkdir -p data/pg
18+
cd data/pg
19+
20+
docker run -d --name postgres --network=host \
21+
-e POSTGRES_PASSWORD=timzaak \
22+
-e POSTGRES_DB=tnet \
23+
-e POSTGRES_USER=postgres \
24+
-v $(pwd):/var/lib/postgresql/data \
25+
postgres:15
26+
27+
cd ~/data/config/backend
28+
docker run -it -d \
29+
--network=host \
30+
-v $(pwd):/config \
31+
--name=fornet-backend \
32+
fornetcode/fornet-backend:latest
33+
34+
#cd ~/data && mkdir -p config/backend && cd config/backend
35+
# copy config here
36+
37+
38+
````
39+

guide/self-deploy.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Self Deployment
2+
3+
### Prerequisites
4+
ForNet is a client-server model program, you need to deploy server firstly,
5+
and ForNet now needs relay node to let devices connect each other. You need have a linux server to deploy the relay instance.
6+
We are in hard work to build SaaS backend server and implement p2p connection feature. You would only need to install client then.
7+
8+
If you like to build ForNet from the source code, please refer [Develop Guide](./develop) for more information.
9+
10+
### Client
11+
you can download client binary app at Github <a :href="`${$sourceUrl}/releases`">release page</a>, it now supports macOS、Linux and Windows 11. **Client needs root/administrator permission to run**, unix is to create tun, Windows is to install driver.
12+
13+
14+
### Server
15+
The manager server is written by Scala 3, you can deploy the jar or docker image. It uses Postgres to store data. and uses [rmqtt](https://github.com/rmqtt/rmqtt) to interact with client.
16+
17+
There is <a :href="`${$sourceUrl}/tree/main/command/docker-compose/simple/docker-compose.yml`">docker-compose.yml</a> for quick start, you can ship it with:
18+
```shell
19+
# must be in the directory
20+
# it needs config files of backend and rmqtt
21+
cd /command/docker-compose/simple
22+
docker-compose up
23+
```
24+
If you would like to deploy with docker step by step, you can follow this:
25+
#### Postgres
26+
```shell
27+
# If platform is Mac/Windows, change --network=host to -p 5432:5432
28+
docker run -d --name postgres --network=host \
29+
-e POSTGRES_PASSWORD=tnet_db_password \
30+
-e POSTGRES_DB=tnet_db \
31+
-e POSTGRES_USER=postgres \
32+
-v $(pwd):/var/lib/postgresql/data \
33+
postgres:15
34+
```
35+
36+
#### Deploy RMQTT Docker
37+
Here is an example of rmqtt <a :href="$sourceUrl + '/tree/main/command/docker/mqtt'">config</a>, you can run it after changed backend server url in `config/plugin/rmqtt-auth-http.toml`.
38+
39+
More details about RMQTT can be found [here](https://github.com/rmqtt/rmqtt).
40+
```shell
41+
cd /command/docker/mqtt
42+
# RMQTT will use port:
43+
# 1883(mqtt) 6060(http api) 5363(grpc)
44+
docker run -d --name mqtt --network=host \
45+
-v $(pwd)/log:/var/log/rmqtt \
46+
-v $(pwd)/config/rmqtt.toml:/app/rmqtt/rmqtt.toml \
47+
-v $(pwd)/config/plugin:/app/rmqtt/plugin \
48+
rmqtt/rmqtt:latest
49+
```
50+
51+
#### Deploy Server Docker
52+
There is two config file: `application.conf` and `logback.xml`, you can get the example <a :href="$sourceUrl + '/tree/main/command/docker/backend/config'">here</a>.
53+
More details about config can be found [here](config.md).
54+
55+
```shell
56+
# run server with database init, 8080 is for http api, 9000 is for grpc.
57+
docker run -it -d \
58+
-p 8080:8080 -p 9000:9000 \
59+
-v ${local_machine/applcation.conf+logback.xml/path}:/config \
60+
--name=fornet-backend \
61+
fornetcode/fornet-backend:latest
62+
63+
```
64+
65+
## Up and Running
66+
67+
### Create Network
68+
After the backend server up, visit the backend website: http://127.0.0.1:8080, If you use simple auth, just type the config value of `auth.simple.token` to login in.
69+
Then you could create network, and get invite code to let client node join in.
70+
71+
### Client Join Network
72+
There's `fornet` and `fornet-cli`, `fornet` is the background service, `fornet-cli` is used to interact with `fornet`.
73+
```shell
74+
# run fornet in background
75+
sudo fornet &
76+
# you could get the invite cod from the admin web.
77+
sudo fornet-cli join ${invite code}
78+
```
79+
You can also use docker in Linux(thisdoes not support macOS, indows).
80+
```shell
81+
# export config to host, otherwise private.key will miss if image delete
82+
docker run -it --name=fornet \
83+
--cap-add=NET_ADMIN \
84+
--network=host \
85+
--device=/dev/net/tun \
86+
-v ${config_path}:/config \
87+
fornet:latest
88+
# join network
89+
docker exec -it fornet fornet-cli join ${invite code}
90+
```
91+
92+
### Auto Launch
93+
#### Linux
94+
ForNet now don't support automatically start after host reboot in Linux, you can get it with Systemd.
95+
```
96+
cp fornet /usr/local/bin/
97+
```
98+
create the Systemd configuration file at `/etc/systemd/system/fornet.service`
99+
```
100+
[Unit]
101+
Description=ForNet client daemon
102+
After=network.target
103+
104+
[Service]
105+
Type=simple
106+
User=root
107+
Restart=always
108+
ExecStart=/usr/local/bin/fornet
109+
110+
[Install]
111+
WantedBy=multi-user.target
112+
113+
```
114+
115+
After that you're supposed to reload systemd:
116+
```
117+
systemctl daemon-reload
118+
```
119+
120+
Launch fornet on system startup with:
121+
```
122+
systemctl enable fornet
123+
```
124+
Launch fornet immediately with:
125+
```
126+
systemctl start fornet
127+
```
128+
129+
#### macOS
130+
```shell
131+
sudo fornet-cli launch enable
132+
```
133+
## What's More
134+
If you are interested with this project, you can go [roadmap](../plan) to get more information.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"directories": {
55
"doc": "./"
66
},

plan.md

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
# Roadmap
22

3+
If you have any idea, feel free to open <a :href="$sourceUrl + '/issues/new'">issue</a>.
4+
## Firstly To Do
5+
* WebRTC punch hole(p2p) and relay (0.2 Version)
36

4-
## Doing Feature
5-
- [ ] Android App
7+
## Secondly To Do
8+
* Desktop App
9+
* error info report to server
10+
* Windows auto launch
11+
* DNS(DNS Resolver)
12+
* usage statistic(server)
13+
* client connect each other without server
614

7-
## Plan Feature(No Order)
8-
- [ ] Windows auto launch
9-
- [ ] admin web turn to white theme
10-
- [ ] admin web tutoril(blocked by white theme)
11-
- [ ] Win10 support
12-
- [ ] punch hole(p2p)
13-
- [ ] error info report to server
14-
- [ ] iOS App
15-
- [ ] DNS(DNS Resolver)
16-
- [ ] WireGuard Relay support
17-
- [ ] mDNS support for Lan
18-
- [ ] usage statistic(server)
19-
- [ ] Ingress、Outgress
20-
- [ ] Ingress LoadBalance
21-
- [ ] k8s deploy
22-
- [ ] OpenBSD/FreeBSD support
23-
- [ ] Windows arm64 support
24-
- [ ] Windows Tun Driver performance improve(all in driver, only provide api to userspace)
25-
- [ ] run without manager sc-manager, read config from local file
15+
## Easy To Do
16+
* user online status show at admin web
17+
* admin web change to white theme
18+
* admin web tutorial (0.1.x Version)
2619

27-
## Blocked Feature
28-
- [x] MacOS desktop(release when user really need it)
29-
- [x] Windows desktop(release when user really need it)
30-
- [ ] Linux desktop
20+
## Blocked, Waiting For User Feedback
21+
* Android App
22+
* Win10 support
23+
* iOS App
24+
* OpenBSD/FreeBSD support
25+
* Windows arm64 support
3126

32-
## Thinking Feature
33-
replace wireguard to webrtc, then P2P is more easy to be done.
27+
28+
## Just remark
29+
* Windows Tun Driver performance improve(all in driver, only provide api to userspace)

version_change.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
## Changelog
2+
### V0.1.1
3+
This is a fixed bug version, we have tested it in production environment of SAAS, and every thing is ok.
4+
- [x] fix: multifarious bugs
5+
- [x] feat: aarch64 client support with Github Actions, make the distribution zip file more clean
6+
- [x] feat: add SAAS production config and scripts
27

38
### V0.1.0
49
**This is not compatible with V0.0.4.**

0 commit comments

Comments
 (0)