adamwalach / openvpn-web-ui

Web interface (with golang backend) for monitoring and administration of OpenVPN server
MIT License
674 stars 276 forks source link

How to compile and run this project? #39

Closed seaung closed 2 years ago

seaung commented 2 years ago

Hello, how to compile this project correctly and run it on CentOS 7

bnhf commented 2 years ago

This project primarily uses golang (aka Go), along with the Beego framework and the Bee tool. It's intended for use in a Docker container. Though an excellent piece of work, the project has not really been updated since it was developed, nor have there been any PRs merged. Some development basics are listed at the bottom of the README here and in my repo.

I've done a significant amount of work updating what started out as a fork, and has now been moved to its own repo. My version of the project keeps the web ui in container form, but manages a PiVPN installation on the host. My motivation in making this change originally was to support an OpenVPN TAP server, which to my knowledge, cannot be done in a container. PiVPN can be installed on Raspbian, Debian and Ubuntu.

If you decide to fork this original project, or fork my repo, you may want to take a look at some of what I've done. In addition to merging in several of the pending PRs in this project, everything has been brought up to date in regard to OpenVPN, Go, Beego, Bee and the many dependencies. Additional data fields and functionality have been added, along with a change to a darker theme: https://github.com/bnhf/pivpn-tap-web-ui

seaung commented 2 years ago

Thank you very much. I try to compile this project locally(https://github.com/bnhf/openvpn-tap-external-web-ui)。I have managed to run the OpenVPN WebUI with the help of installation guides。 I have installed OpenVPN。 An error occurred while the program was running!

2022/04/26 23:08:17.245 [E] [default.go:31]  dial tcp 118.5.49.6:2080: connect: connection timed out 
2022/04/26 23:08:17.245 [D] [utils.go:49]  null 
2022/04/26 23:10:26.955 [E] [default.go:39]  dial tcp 189.163.17.5:2080: connect: connection timed out 
2022/04/26 23:10:26.955 [D] [utils.go:49]  null 
2022/04/26 23:10:27.037 [E] [default.go:47]  dial tcp: lookup openvpn: no such host 
2022/04/26 23:10:27.037 [D] [utils.go:49]  -1 
2022/04/26 23:10:27.116 [E] [default.go:55]  dial tcp: lookup openvpn: no such host 
2022/04/26 23:10:27.116 [D] [utils.go:49]  null 
2022/04/26 23:10:27.120 [E] [funcmap.go:43]  Unknown type: <nil> 
2022/04/26 23:10:27.120 [E] [funcmap.go:43]  Unknown type: <nil> 
2022/04/26 23:10:27.120 [N] [funcmap.go:54]  Percent 1965649920 16572096512 
2022/04/26 23:10:27.120 [N] [funcmap.go:54]  Percent 1965649920 16572096512 
2022/04/26 23:10:27.120 [N] [funcmap.go:54]  Percent 0 17179865088 
2022/04/26 23:10:27.120 [N] [funcmap.go:54]  Percent 0 17179865088
bnhf commented 2 years ago

This original project is setup to use OpenVPN in a Docker container (TUN only). My fork of the project was developed for, and has only been tested with PiVPN -- installed on the host. Which are you trying to use? Also, I moved my fork to its own repo, and continued development there. It can be found at the link I referenced in my original response.

Having said that, it appears you're not connecting with OpenVPN's in-built management interface on port 2080. Did you add the "management" parameter to your server.conf file?

seaung commented 2 years ago

I want to compile and run this project locally (https://github.com/bnhf/openvpn-tap-external-web-ui) I don't know how to connect the built-in management interface of OpenVPN on port 2080 I use the default configuration

bnhf commented 2 years ago

When you say locally do you mean without using Docker for the WebUI or for OpenVPN? It's no doubt possible, but not the intention of either the original project, my fork, or the new repo based on my fork. I know there was at least one person, that did this, so if you look through previous issues you may be able to get some guidance from that user.

This project relies on communicating with an OpenVPN server that's been configured to expose its management port on 2080 (the default we use), or whatever other port you may choose. There really is no default configuration for OpenVPN server though, each instance needs to be configured for your specific use with certificates generated to protect and encrypt the connection to a remote client.

This WebUI can create the server.conf file for you, but you still need to understand how OpenVPN server works, and what parameters are right for you.

seaung commented 2 years ago

thank you