Code Monkey home page Code Monkey logo

openvpn-web-ui's Introduction

OpenVPN-web-ui

Summary

OpenVPN server web administration interface.

Goal: create quick to deploy and easy to use solution that makes work with small OpenVPN environments a breeze.

If you have docker and docker-compose installed, you can jump directly to installation.

Status page

Please note this project is in alpha stage. It still needs some work to make it secure and feature complete.

Motivation

Features

  • status page that shows server statistics and list of connected clients
  • easy creation of client certificates
  • ability to download client certificates as a zip package with client configuration inside
  • log preview
  • modification of OpenVPN configuration file through web interface

Screenshots

Screenshots

Usage

After startup web service is visible on port 8080. To login use the following default credentials:

  • username: admin
  • password: b3secure (this will be soon replaced with random password)

Please change password to your own immediately!

Prod

Requirements:

  • docker and docker-compose
  • on firewall open ports: 1194/udp and 8080/tcp

Execute commands

curl -O https://raw.githubusercontent.com/adamwalach/openvpn-web-ui/master/docs/docker-compose.yml
docker-compose up -d

It starts two docker containers. One with OpenVPN server and second with OpenVPNAdmin web application. Through a docker volume it creates following directory structure:

.
├── docker-compose.yml
└── openvpn-data
    ├── conf
    │   ├── dh2048.pem
    │   ├── ipp.txt
    │   ├── keys
    │   │   ├── 01.pem
    │   │   ├── ca.crt
    │   │   ├── ca.key
    │   │   ├── index.txt
    │   │   ├── index.txt.attr
    │   │   ├── index.txt.old
    │   │   ├── serial
    │   │   ├── serial.old
    │   │   ├── server.crt
    │   │   ├── server.csr
    │   │   ├── server.key
    │   │   └── vars
    │   ├── openvpn.log
    │   └── server.conf
    └── db
        └── data.db

Dev

Requirements:

  • golang environments
  • beego

Execute commands:

go get github.com/adamwalach/openvpn-web-ui
cd $GOPATH/src/github.com/adamwalach/openvpn-web-ui
bee run -gendoc=true

Todo

  • add unit tests
  • add option to modify certificate properties
  • generate random admin password at initialization phase
  • add versioning
  • add automatic ssl/tls (check how ponzu did it)

License

This project uses MIT license

Remarks

Vendoring

https://github.com/kardianos/govendor is used for vendoring.

To update dependencies from GOPATH:

govendor update +v

Template

AdminLTE - dashboard & control panel theme. Built on top of Bootstrap 3.

Preview: https://almsaeedstudio.com/themes/AdminLTE/index2.html

openvpn-web-ui's People

Contributors

adamwalach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openvpn-web-ui's Issues

Updated version of this project available: OpenVPN Admin Plus!

Though this project still functions for the most part, there have been a number of important changes in OpenVPN and EasyRSA since it was last updated in 2017. In early 2022, I started the process of bringing it up-to-date -- mostly for my own use. :-)

Late last year I did significant additional work, and am happy to say it's in great shape! All of the known issues with this outstanding original version of the project have been addressed. It's designed to work with OpenVPN 2.5.x and higher (many, many important advancements since 2.4.x), along with EasyRSA3. Certificate revocation and removal have been added. SSL is now supported, and bugs in the status page data have been fixed.

The tried-and-true AdminLTE theme has been tweaked for a dark look. Go and all of the dependencies have been brought current as well. It now supports armv7 and arm64, in addition to amd64.

Though it will work with OpenVPN in a container (TUN only), support is not limited to that. It's primarily intended to work with the PiVPN script for a host-based OpenVPN installation on Debian, Ubuntu or the Raspberry Pi OS. This allows for either TUN or TAP connections!

Here are a few screenshots:

screenshot-nuc10-pc2 localdomain_8080-2023 01 10-15_31_48

screenshot-nuc10-pc2 localdomain_8080-2023 01 10-15_11_54

screenshot-nuc10-pc2 localdomain-2023 01 10-14_51_43

screenshot-nuc10-pc2 localdomain-2023 01 10-14_45_55

The new repository can be found here:
https://github.com/bnhf/openvpn-admin-plus

And, a write-up can be found here:
https://technologydragonslayer.com/2023/01/11/openvpn-admin-plus-an-admin-web-user-interface-for-openvpn-servers/

Available as a multi-arch Docker container here:
https://hub.docker.com/repository/docker/bnhf/openvpn-admin-plus/general

.ovpn client file

To connect to a VPN from OpenVPN client I need an .ovpn client file.
I don't find it anywhere if your installation using Docker.
How do I connect to the VPN once it's running ?

Remove existing users

Hello,

Thanks a lot for your project.

Is there functionality to remove created users (not only create) via this tool?

Regards,
Alex Kurichenko

"Connected Since" is show error

"Connected Since" is the duration, but it is not formatted. It is only displayed as a number. It is not displayed in the duration format

send certs via email

Consider adding the possibility of sending user certificates via email
Regards

Status fields mapping - simple fix

Hi Adam,

Would you be able please kindly to fix the little problem with mapping fields?
[https://imgur.com/a/c9GBERj]

The KB received shows 0, the KB Sent shows value, in fact received in KBytes, Connected Since shows Sent but in B not KB, and Username shows connected since but in timestamp, not date.

Belief is that it is down to parse.go section (below is what I thought would fix it - but something is wrong with this - not sure why field[4] gets 0, hence moved on to next field.

		case c == "CLIENT_LIST":
			bytesR, _ := strconv.ParseUint(fields[5], 10, 64)
			bytesS, _ := strconv.ParseUint(fields[6], 10, 64)
//			ConnectedSinceD := time.Unix(fields[7])
			item := &OVClient{
				CommonName:      fields[1],
				RealAddress:     fields[2],
				VirtualAddress:  fields[3],
				BytesReceived:   bytesR,
				BytesSent:       bytesS,
				ConnectedSince:  fields[7],
				ConnectedSinceT: fields[8],
//				Username:        fields[9],

bytesR, _ := strconv.ParseUint(fields[4], 10, 64)

Hope this is a 1 minute issue for you to fix.

Thank you in advance.

Generate proper .ovpn

Would you be able to rebuild this so that the generated client certificates are embedded in the conf file, and you should probably rename it .ovpn
Or is this project abandoned?

Delete an existing users

1,The Clients certificates generated through web-gui are not stored in the database, are they!!!
2,How do I delete an existing user!!!

ubuntu 18 installl

hi

i have allready install this https://github.com/angristan/openvpn-install and work very nice no problems all perfeckt
only i want to monitor and get a webinterface for see statistic etc.. and try this webui
bud as i try all waht in readme i cant get running
its thare any step by step instalation for beginner for ubuntu webui

kind regarts

Docker network issues

I am not expert and really new with a docker but...
Docker has own network adapter... doesn't that mean that you can run openvpn with docker only like proxy server? - no access to rest of the network.

password

I install it in an docker and can see webgui but i can not see password (username: admin password: b3secure) not work.

WireGuard support

Hi, would you ever consider adding WireGuard option for this tool please?

Thankyou for your effort in making it 👍

Masquerade is required inside openvpn container

Setting the default route option (redirect-gateway def1) in client-side to redirect all traffic over the VPN it stays connected but nothing passes through even simple ping request.

And it fixed by adding masquerade rule inside openvpn container

docker exec -it openvpn /bin/bash
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 172.16.0.0/12 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -j MASQUERADE

Purpose of build/pack.sh

Can anyone enlighten me on what the build/pack.sh script does? I'm including it below:

#!/bin/bash

set -e

time docker run \
    -v "$PWD/../":/go/src/github.com/bnhf/openvpn-tap-external-web-ui \
    --rm \
    -w /usr/src/myapp \
    tyzbit/beego:1.9.4 \
    sh -c "cd /go/src/github.com/bnhf/openvpn-tap-external-web-ui/ && bee version && bee pack -exr='^vendor|^data.db|^build|^README.md|^docs'"
cd github.com

Thanks!

Extra features

Hi,

I really like the gui!
I think the following features would improve it greatly:

  • set DNS server(s) (push "dhcp-option DNS x.x.x.x)
  • set the vpn ip range (at the moment this is hard-coded to 10.8.0.0 255.255.255.0 in the openvpn-server-config.tpl file)
  • remove clients/certificates; at the moment clients/certificates can be added but not removed.

Unfortunately I'm not much of a developer otherwise I would love to help this project along!

Kind regards,
Taco Scheltema

Server Bridging

Hi, nice work,
do u plan an Option to use TAP instead TUN for a Server Bridged Layer 2 VPN ?

No Internet

Vpn is connected but internet is not working can you please tell me what is the issue

Server is always 10.8.0.0 255.255.255.0

Even though I config the server as 10.99.0.0 255.255.0.0, the generated server.conf always says the server is 10.8.0.0 255.255.255.0.

image

server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 10.8.0.0 255.255.255.0"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"

The reason is hardcoding in openvpn-server-config.tpl:

server 10.8.0.0 255.255.255.0

Handler crashed with error reflect: call of reflect.Value.Int on string Value

How can I solve this error?
Environment
Platform: Raspberry Pi 3 B +
OS: linux
Architecture: arm
The source was compiled on the Raspberry Pi.

Action: Update the configuration of the default profile
Initially I had to comment on that configuration in the code because it gave me the same error.
Log

[ORM]2019/09/27 15:15:01  -[Queries/default] - [  OK / db.QueryRow /     0.2ms] - [SELECT `id`, `profile`, `port`, `proto`, `ca`, `cert`, `key`, `cipher`, `keysize`, `auth`, `dh`, `server`, `ifconfig_pool_persist`, `keepalive`, `max_clients`, `management` FROM `o_v_config` WHERE `profile` = ? ] - `default`
2019/09/27 15:15:01 [D] [utils.go:49] {
,
	"Profile": "default",
	"Port": 0,
	"Proto": "",
	"Ca": "",
	"Cert": "",
	"Key": "",
	"Cipher": "",
	"Keysize": 0,
	"Auth": "",
	"Dh": "",
	"Server": "",
	"IfconfigPoolPersist": "",
	"Keepalive": "",
	"MaxClients": 0,
	"Management": ""
} 
2019/09/27 15:15:01 [C] [panic.go:679] the request url is  /ov/config
2019/09/27 15:15:01 [C] [panic.go:679] Handler crashed with error reflect: call of reflect.Value.Int on string Value
2019/09/27 15:15:01 [C] [panic.go:679] /usr/local/go/src/runtime/panic.go:679
2019/09/27 15:15:01 [C] [panic.go:679] /usr/local/go/src/reflect/value.go:986
2019/09/27 15:15:01 [C] [panic.go:679] /go/src/github.com/adamwalach/openvpn-web-ui/vendor/github.com/astaxie/beego/orm/db.go:214
2019/09/27 15:15:01 [C] [panic.go:679] /go/src/github.com/adamwalach/openvpn-web-ui/vendor/github.com/astaxie/beego/orm/db.go:92
2019/09/27 15:15:01 [C] [panic.go:679] /go/src/github.com/adamwalach/openvpn-web-ui/vendor/github.com/astaxie/beego/orm/db.go:617
2019/09/27 15:15:01 [C] [panic.go:679] /go/src/github.com/adamwalach/openvpn-web-ui/vendor/github.com/astaxie/beego/orm/orm.go:239
2019/09/27 15:15:01 [C] [panic.go:679] /go/src/github.com/adamwalach/openvpn-web-ui/controllers/ovconfig.go:61
2019/09/27 15:15:01 [C] [panic.go:679] /go/src/github.com/adamwalach/openvpn-web-ui/vendor/github.com/astaxie/beego/router.go:787
2019/09/27 15:15:01 [C] [panic.go:679] /usr/local/go/src/net/http/server.go:2802
2019/09/27 15:15:01 [C] [panic.go:679] /usr/local/go/src/net/http/server.go:1890
2019/09/27 15:15:01 [C] [panic.go:679] /usr/local/go/src/runtime/asm_arm.s:868

Run on ARM/Raspberry

Hi, I've tried running this on a Raspberry but the docker instances keep restarting.

running docker logs openvpn
shows the following error:
standard_init_linux.go:195: exec user process caused "exec format error''

so I guess these dockers do not run on ARM. It would be great to be able to do so though. do you have any plans to add support for ARM? or maybe provide instructions on how to build it myself?

Kind regards,
Taco Scheltema

How to remove old certs?

Hello,
when will removing old certs be enabled? Or is there any way now to do this without the web panel?

Running the OpenVPN web UI as service.

Hi Adam,
I've created a functional OpenVPN web UI Dashboard thanks to you but is there a startup script to run the app as a service so that we can run the app in the background.

Thanks.

exec: "gcc": executable file not found in $PATH

while executing the command "go get github.com/adamwalach/openvpn-web-ui", i am getting error like "exec: "gcc": executable file not found in $PATH"

Kindly help me in fixing this issue.

Client routes

how can I add the client-config-dir?
If i set it in the server.conf and all routes (e.g route 172.18.0.0 255.255.255.0), the server does it but
the webinterface tell me i should fix my configuration with "Mapping error MB "
How can if fix this in the webinterface?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.