Giter VIP home page Giter VIP logo

docker-openvpn-monitor's Introduction

ruimarinho/openvpn-monitor

build status ruimarinho/openvpn-monitor ruimarinho/openvpn-monitor

The trusted multi-platform web-based OpenVPN Monitor docker image.

  • amd64 (x86_64)
  • arm64 (aarch64, armv8)
  • arm32v7 (armv7)
  • arm32v6 (armv6)
  • i386

What is OpenVPN Monitor?

OpenVPN Monitor is a web-based utility that displays the status of OpenVPN servers. It includes information such as the usernames/hostnames connected, remote and VPN IP addresses, approximate locations (using GeoIP), traffic consumption and more.

Usage

First, make sure OpenVPN is configured to open the management interface that the OpenVPN Monitor connects to. Edit the openvpn.conf file and add the following directive (choose port 5555 or any other of your preference):

management 127.0.0.1 5555

Note: if you're running OpenVPN in a container as well, allow for external connections with:

management 0.0.0.0 5555

All settings of OpenVPN Monitor can be dynamically configured via environment variables (thanks to confd) without having to create a new image or bind-mounting the configuration file.

The environment variable are organized into two groups:

  • OPENVPNMONITOR_DEFAULT_<PROPERTY>: populates the global [OpenVPN-Monitor] section.
  • OPENVPNMONITOR_SITES_<INDEX>_<PROPERTY>: populates each site section. Note: if property contains underscores, like datetime_format and show_disconnect, you must pass those properties without the underscore. See example below.

By default, GeoIP is automatically available (no additional download step is required). For this reason, the location of the geoip_data file is hardcoded in the configuration file. The datetime_format defaults to %d/%m/%Y %H:%M:%S if none is provided. Everything else must be set and there is no whitelist of property names. This ensures compatibility of this image with future versions of OpenVPN monitor without too much maintenance.

So a minimal and accessible, yet non-functional, version of OpenVPN Monitor can be reduced to:

docker run -p 80:80 --rm ruimarinho/openvpn-monitor

Let's add some configuration, including changing the page name, adding a logo, some geolocation features and two sites - one that connects to a running TCP OpenVPN server and another one to an UDP server.

Using the scheme above, the configuration is as simple as setting the appropriate environment variables:

docker run --name openvpn-monitor \
  -e OPENVPNMONITOR_DEFAULT_DATETIMEFORMAT="%%d/%%m/%%Y" \
  -e OPENVPNMONITOR_DEFAULT_LATITUDE=-37 \
  -e OPENVPNMONITOR_DEFAULT_LOGO=logo.jpg \
  -e OPENVPNMONITOR_DEFAULT_LONGITUDE=144 \
  -e OPENVPNMONITOR_DEFAULT_MAPS=True \
  -e OPENVPNMONITOR_DEFAULT_MAPSHEIGHT=500 \
  -e OPENVPNMONITOR_DEFAULT_SITE=Test \
  -e OPENVPNMONITOR_SITES_0_ALIAS=UDP \
  -e OPENVPNMONITOR_SITES_0_HOST=openvpn-udp \
  -e OPENVPNMONITOR_SITES_0_NAME=UDP \
  -e OPENVPNMONITOR_SITES_0_PORT=5555 \
  -e OPENVPNMONITOR_SITES_0_SHOWDISCONNECT=True \
  -e OPENVPNMONITOR_SITES_1_ALIAS=TCP \
  -e OPENVPNMONITOR_SITES_1_HOST=openvpn-udp \
  -e OPENVPNMONITOR_SITES_1_NAME=TCP \
  -e OPENVPNMONITOR_SITES_1_PORT=5555 \
  -p 80:80 ruimarinho/openvpn-monitor

Now OpenVPN Monitor should be accessible via http://127.0.0.1:80.

Note that for the logo.jpg to be readable, you need to bind-mount it or pass an URL instead. Also, the datetime format needs to be escaped as shown above (suing two %).

Supported Docker versions

This image is officially supported on Docker version 1.12, with support for older versions provided on a best-effort basis.

License

MIT

docker-openvpn-monitor's People

Contributors

ruimarinho avatar andras-tim avatar m0rtalis avatar

Watchers

James Cloos avatar

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.