소스 검색

doc(readme): update readme instructions

Mustafa Arici 8 년 전
부모
커밋
83f8e1e07f
1개의 변경된 파일63개의 추가작업 그리고 32개의 파일을 삭제
  1. 63 32
      README.md

+ 63 - 32
README.md

@@ -5,66 +5,97 @@
 [![codecov](https://codecov.io/gh/cad/ovpm/branch/master/graph/badge.svg)](https://codecov.io/gh/cad/ovpm)
 [![GoDoc](https://godoc.org/github.com/cad/ovpm?status.svg)](https://godoc.org/github.com/cad/ovpm)
 
-OVPM allows you to manage an OpenVPN server from command line easily. With OVPM you can create and run an OpenVPN server, add/remove vpn users, generate client .ovpn files for your users etc. 
+*OVPM* allows you to administrate an **OpenVPN** server on linux easily via command line. 
 
-## Usage
+With OVPM you can create and run an OpenVPN server, add/remove VPN users, generate client .ovpn files for your users etc. 
 
-Install OVPM:
+## Installation
+Install OVPM from RPM (CentOS/Fedora):
 
 ```bash
-$ go get -u github.com/cad/ovpm/...
+### Add YUM Repo
+$ curl -s https://packagecloud.io/install/repositories/cad/ovpm/script.rpm.sh | sudo bash
+
+### Install OVPM
+$ sudo yum install ovpm
 ```
 
-And verify the installation by running ovpmd:
+Or install OVPM from source:
 
-```bash
-$ ovpmd --version
+Only dependency for ovpm is **OpenVPN>=2.3**.
 
-ovpmd version 0.1.0
+```bash
+$ go get -u github.com/cad/ovpm/...
 ```
 
-And also make sure openvpn is also installed on the host:
+## Start the Server
+You need to start the start OVPM server, which is called **ovpmd**, before doing anything.
 
-```bash
-$ openvpn --version
+### CentOS/Fedora (RPM Package)
 
-OpenVPN 2.4.3 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO]
-...
+Just use systemd to manage ovpmd.
 
+```bash
+$ systemctl start ovpmd
+$ systemctl enable ovpmd  # enable ovpmd to start on boot
 ```
 
-Now you can actually run the ovpmd server:
+### If You've Installed From Source (go get)
+
+Run in another terminal.
 
 ```bash
-# Since ovpmd launches and supervises openvpn binary it needs root privileges.
 $ sudo ovpmd
 
 INFO[0000] OVPM is running :9090 ...                    
+ERRO[0000] can not launch OpenVPN because system is not initialized 
 ```
 
-In another terminal you can use ovpm via the command line tool, ovpm:
+It complains about an error due to server not being initialized, it's completely fine getting this when you first start **ovpmd**.
+
+
+## Usage
+
+### Init Server
+If you just installed the ovpm from scratch you have started the **ovpm server** (ovpmd) then now you need to initialize the server.
+
+You can do so by invoking;
+
+```bash
+$ ovpm vpn init -s <your-vpn-server's-fqdn-or-ip-addr>
+
+This operation will cause invalidation of existing user certificates.
+After this opeartion, new client config files (.ovpn) should be generated for each existing user.
+
+Are you sure ? (y/N)
+y
+INFO[0003] ovpm server initialized 
+```
+
+Now you have your server initialized, up and running.
+
+### Create a VPN user
+If you have initialized your ovpm server now you can add users.
+
+Add a VPN user;
 
 ```bash
-$ ovpm 
+$ ovpm user create -u john -p 1234            
 
-NAME:
-   ovpm - OpenVPN Manager
+INFO[0000] user created: john  
+```
 
-USAGE:
-   main [global options] command [command options] [arguments...]
+Please note that user password is taken but it will be used in the future releases. Such as for the Web UI and etc..
 
-VERSION:
-   0.1.0
 
-COMMANDS:
-     user     User Operations
-     vpn      VPN Operations
-     help, h  Shows a list of commands or help for one command
+### Export the OpenVPN Client Config
+After creating a user, you can export the client config for them.
 
-GLOBAL OPTIONS:
-   --verbose            verbose output
-   --daemon-port value  port number for OVPM daemon to call
-   --help, -h           show help
-   --version, -v        print the version
+```bash
+$ ovpm user genconfig -u john
 
+INFO[0000] exported to john.ovpn
 ```
+
+This .ovpn file contains all necesarray bits and pieces for the client to connect to your newly created VPN server.
+You can copy the OpenVPN client config file (e.g. john.ovpn) to the any OpenVPN client and use it to connect to your VPN server.