Update README
Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
		
							parent
							
								
									82d6ac96e4
								
							
						
					
					
						commit
						77c41ce3f3
					
				
							
								
								
									
										49
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										49
									
								
								README.md
									
									
									
									
									
								
							| @ -1,15 +1,44 @@ | ||||
| # hvpn-node3 | ||||
| 
 | ||||
| ## Build | ||||
| ```bash | ||||
| cd cmd/hvpn-node && go build . | ||||
| ``` | ||||
| NAME: | ||||
|    ./hvpn-node - HVPN node API server | ||||
| 
 | ||||
| USAGE: | ||||
|    ./hvpn-node [global options] [arguments...] | ||||
| ## Run  | ||||
| With root (no recommended!) | ||||
| ```bash | ||||
| sudo ./hvpn-node | ||||
| ``` | ||||
| Without root; using libcap | ||||
| ```bash | ||||
| set_cap.sh && ./hvpn-node | ||||
| ``` | ||||
| The program creates a keys for the wireguad interface if non are given. | ||||
| The device name is `hvpn0`. | ||||
| 
 | ||||
| AUTHOR: | ||||
|    Hesham T. Banafa <hishaminv@gmail.com> | ||||
| ## Add a peer  | ||||
| ```bash | ||||
| curl -X POST \ | ||||
|     -d '{"public_key": "TxPfKra6/BQ2tkVXHM/PjeJgzX7j0I07acOn+2re/yI="}' \ | ||||
|     localhost:8080/peer | ||||
| ``` | ||||
| Response body | ||||
| ```json | ||||
| { | ||||
|   "mtu": 1380, | ||||
|   "public_key": "TxPfKra6/BQ2tkVXHM/PjeJgzX7j0I07acOn+2re/yI=", | ||||
|   "public_key_url_safe": "TxPfKra6%2FBQ2tkVXHM%2FPjeJgzX7j0I07acOn%2B2re%2FyI%3D", | ||||
|   "endpoint": "", | ||||
|   "allowed_ips": "10.42.0.1", | ||||
|   "presistent_keepalive": 25000000000, | ||||
|   "TX": 0, | ||||
|   "RX": 0 | ||||
| } | ||||
| ``` | ||||
| 
 | ||||
| ## CLI options | ||||
| ``` | ||||
| GLOBAL OPTIONS: | ||||
|    --log-level value            (default: "INFO") [$LOG_LEVEL] | ||||
|    --private-key value          Path to file with private key | ||||
| @ -20,4 +49,12 @@ GLOBAL OPTIONS: | ||||
|    --host value                 IP address to listen on for HTTP API requests (default: "0.0.0.0") | ||||
|    --http-port value            TCP Port for HTTP API (default: 8080) | ||||
|    --help, -h                   show help | ||||
| 
 | ||||
| TLS: | ||||
| 
 | ||||
|    --cert value                      Server x509 certificate file | ||||
|    --cert-private-key value          Server x509 certificate private key file | ||||
|    --client-certs value, --ca value  Clients x509 file with single or many certificates | ||||
|    --enable-tls, --tls               (default: false) | ||||
| 
 | ||||
| ``` | ||||
|  | ||||
| @ -208,7 +208,7 @@ func createCliApp() *cli.App { | ||||
|     mTLSClientCerts := cli.PathFlag{ | ||||
|         Name: "client-certs", | ||||
|         Aliases: []string{"ca"}, | ||||
|         Usage: "A path to PEM file with client certificates; Enables TLS", | ||||
|         Usage: "Clients x509 file with single or many certificates", | ||||
|         Category: "\rTLS:", | ||||
|     } | ||||
|     app.Flags = append(app.Flags, &mTLSClientCerts) | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user