Skip to content

Commit 2d72219

Browse files
committed
Update document
1 parent ce56d35 commit 2d72219

File tree

9 files changed

+369
-274
lines changed

9 files changed

+369
-274
lines changed

DEV.md

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
11
# Development
22

3-
- [scripts](./scripts) folder contains some linux script to build/run `vpnserver`/`vpnc`/`vpnddns` and shared artifact to `vagrant`
3+
- [scripts](./scripts) folder contains some linux script to build/run `vpnserver`/`vpnc`/`vpnddns` and shared artifact
4+
to `vagrant`
45
- [docker](./docker) folder contains a list of `vpnserver`/`vpnc`/`vpnddns` `dockerfile` and `docker-compose`
56

7+
## Vagrant
8+
9+
It is used for test VPN client CLI in the specific environment/`OS`.
10+
11+
Use [./scripts/vagrant.sh](./scripts/vagrant.sh) to `up`/`halt`/`destroy`/`status`/`port`/`ssh` one or
12+
multiple `vagrant` boxes. The `vagrant` box parameter is one of folder name in [./vagrant](vagrant)
13+
14+
For example:
15+
16+
```bash
17+
# Up multiple boxes
18+
./scripts/vagrant.sh up ubuntu20 fedora32 debian10
19+
# ssh to one box
20+
./scripts/vagrant.sh ssh ubuntu20
21+
```
22+
623
## SoftEther VPN server
724

825
### Docker
926

27+
[Dockerfile](./docker/dockerfile)
28+
1029
#### Build
1130

1231
2 edition repositories:
@@ -55,23 +74,42 @@ curl -k -X POST -H 'Content-Type: application/json' \
5574
https://localhost:8443/api/
5675
```
5776

58-
## VPN client CLI
77+
## VPN CLI
78+
79+
### Setup python environment
80+
81+
```bash
82+
## Install pipenv
83+
# By pip/or pip3
84+
pip3 install pipenv
85+
# Debian Buster+:
86+
sudo apt install pipenv
87+
# Fedora/Redhat/centos
88+
sudo dnf install pipenv
89+
90+
# In root project dir
91+
pipenv install
92+
# Join pipenv in virtualenv
93+
pipenv shell
94+
```
95+
96+
### VPN client
5997

60-
### Vagrant
98+
#### Vagrant
6199

62100
```bash
63101
# Build VPN Client CLI then copy to vagrant/shared
64102
./scripts/build.vpnc_2_vagrant.sh
65103
# go to any box in vagrant folder then up. Binary file will be synced to /vagrant/playio-vpnc
66104
# with ubuntu20
67-
cd vagrant/ubuntu20 && vagrant up && vagrant ssh
105+
./scripts/vagrant.sh up ubuntu20 && ./scripts/vagrant.sh ssh ubuntu20
68106
# now, it is inside vagrant guest machine, and binary already symlink to /usr/local/bin/playio-vpnc
69107
playio-vpnc version
70108
```
71109

72-
### Docker
110+
#### Docker
73111

74-
#### Setup multiple arch
112+
##### Setup multiple arch
75113

76114
- Use `docker` [buildx](https://github.com/docker/buildx/#installing)
77115
- Use `docker` [registry](https://github.com/zero88/gh-registry) to distribute image in local registry
@@ -85,7 +123,7 @@ docker buildx ls
85123
docker run -v docker-registry-data:/var/lib/registry -p 5000:5000 --privileged --network host -d --restart always
86124
```
87125

88-
#### Build
126+
##### Build
89127

90128
[vpnclient.Dockerfile](cli/python/docker/vpnc.Dockerfile)
91129

@@ -97,10 +135,27 @@ docker run -v docker-registry-data:/var/lib/registry -p 5000:5000 --privileged -
97135
./scripts/docker.vpntool.sh c true
98136
```
99137

100-
## VPN DDNS
138+
### VPNC Deployer
139+
140+
[vpnc-deployer.Dockerfile](cli/ansible/docker/vpnc-deployer.Dockerfile)
141+
142+
```bash
143+
./scripts/docker.vpntool.sh ddns
144+
```
145+
146+
Please read [VPNC Deployer](./cli/ansible/README.md) to see how it works based on `ansible` and `docker`
147+
148+
149+
### VPN DDNS
101150

102151
[vpnddns.Dockerfile](cli/python/docker/vpnddns.Dockerfile)
103152

104153
```bash
105154
./scripts/docker.vpntool.sh ddns
106155
```
156+
157+
Please read [VPN DDNS k8s](./cli/k8s/ddns/README.md) to see sample `k8s` deployment
158+
159+
### Implementation
160+
161+
Please consume [vpnc-dev](./cli/python/DEV.md)

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ netifaces = "*"
1414
google-cloud-dns = "*"
1515

1616
[requires]
17-
python_version = "3.8"
17+
python_version = "3"

Pipfile.lock

Lines changed: 120 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,27 @@
3030
- [x] `openresolv`
3131
- [x] `connman`
3232

33+
### How to use
34+
35+
Please read [VPNC README](./cli/python/src/client/README.md)
36+
3337
## VPNC Deployer
3438

3539
![Docker Image Version (latest semver)](https://img.shields.io/docker/v/playio/vpnc-deployer?sort=semver)
3640
![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/playio/vpnc-deployer?sort=semver)
3741

42+
The `CLI` tool based on `ansible` and `docker` to mass deploy VPN client on one or many devices/computers.
43+
3844
## VPN DDNS
3945

4046
![Docker Image Version (latest semver)](https://img.shields.io/docker/v/playio/vpnddns?sort=semver)
4147
![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/playio/vpnddns?sort=semver)
48+
49+
The `CLI` application syncs every 2 minutes VPN client IP addresses to private Google Cloud DNS:
50+
51+
- DNS zone name for each customer: `device.<customer-code>`
52+
- Device DNS name: `<device-hostname>.device.<customer-code>`
53+
54+
## How to contribute
55+
56+
Please read [DEV.md](DEV.md) to setup your environment.

cli/python/DEV.md

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,12 @@
11
# Development
22

3-
## Install pipenv
4-
5-
```bash
6-
# By pip/or pip3
7-
pip3 install pipenv
8-
9-
# Debian Buster+:
10-
sudo apt install pipenv
11-
12-
# Fedora/Redhat/centos
13-
sudo dnf install pipenv
14-
```
15-
16-
## Install dependencies
17-
18-
```bash
19-
pipenv install
20-
# Join pipenv in virtualenv
21-
pipenv shell
22-
```
23-
243
## Develop VPN client tool
254

265
### Run in dev
276

287
```bash
8+
# Navigate to python source
9+
cd cli/python
2910
# After pipenv shell
3011
python -m src.client.cmd_client -h
3112
# OR
Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,6 @@
11
# PlayiO VPN overview
22

3-
## Index script
4-
5-
- Install `pipenv`
6-
7-
```sh
8-
pip install pipenv
9-
```
10-
11-
- Invoke `index.py` will show available commands
12-
13-
```sh
14-
python index.py --help
15-
Usage: index.py [OPTIONS] COMMAND [ARGS]...
16-
17-
Options:
18-
--help Show this message and exit.
19-
20-
Commands:
21-
hub HUB tool to add/modify SoftEther VPN users and groups.
22-
secret Secret utils
23-
server Server tool
24-
```
25-
26-
More detail in `README` in each sub folders.
27-
28-
### External connection
3+
## External connection
294

305
Note
316

@@ -42,15 +17,15 @@ This is collection of script to bootstrap, manage, setup softether-vpn server.
4217
- Use `TLS 1.2`
4318
- [Cipher suite](https://en.wikipedia.org/wiki/Cipher_suite): `ECDHE-RSA-AES256-GCM-SHA384`
4419

45-
### Internal communication
20+
## Internal communication
4621

4722
- VPN connection type: [Remote Access VPN](https://www.softether.org/4-docs/1-manual/1._SoftEther_VPN_Overview/1.4_VPN_Processing_Principle_and_Communication_Method#1.4.7_Remote_Access_VPN)
4823
- Separate customers to `Virtual Hubs`.
4924
- `Virtual Hubs` are isolated to each other.
5025

51-
### Virtual Hub setup
26+
## Virtual Hub setup
5227

53-
#### IP network
28+
### IP network
5429

5530
Enable `secureNAT`
5631

@@ -68,7 +43,7 @@ Enable `secureNAT`
6843

6944
\*And all necessary routes to `internal resource subnets` defined for each customer.
7045

71-
#### User authentication
46+
### User authentication
7247

7348
- Define groups and users for each customer
7449
- Authentication method
@@ -78,33 +53,10 @@ Enable `secureNAT`
7853
- Each device has each `ssh` public/private key
7954
- (Optional) Interactive user: `basic password`
8055

81-
#### Virtual hub security policy
56+
### Virtual Hub security policy
8257

8358
Status: `WIP`
8459

8560
- [ ] Define hub admin security policy
8661
- [ ] Define security policy and apply to group
8762
- [ ] Define hub extended options
88-
89-
### Cloud sync
90-
91-
Cronjob on Cloud `Production GKE` run every 2 minutes to sync client IP addresses to private Google Cloud DNS:
92-
93-
- DNS zone name for each customer: `<customer-code>.device`
94-
- Device DNS name: `<device-hostname>.<customer-code>.device`
95-
96-
## VPN Client overview
97-
98-
**More details** in [Client](./src/client/README.md)
99-
100-
An automated setup and configuration for `IoT` devices using client scripts.
101-
102-
Standard configuration:
103-
104-
- Installation path: `/app/vpnclient`
105-
- Virtual network interface: `vpn_playio`
106-
- SoftEther VPN client account name: `playio`
107-
- Linux services auto start on system boot up: `playio-vpn`
108-
- VPN username: (follow naming convention)
109-
- Authentication: `client certificate` (signed certificate and corresponding private key)
110-
- Server certificate verification(`WIP`)

0 commit comments

Comments
 (0)