GithubHelp home page GithubHelp logo

tmorgansl / openvpn-notifier Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 41 KB

Sends notifications to pushover when a client connects or disconnects from an openvpn server

License: MIT License

Rust 100.00%
pushover rust-application openvpn-server cargo

openvpn-notifier's Introduction

Openvpn Notifier

Build Status License

Sends notifications to pushover when a client connects or disconnects from an openvpn server. The application is written in rust, purely as a learning exercise to get used to writing rust code.

Disclaimer

It is strongly encouraged to only run this against openvpn servers which have only a few clients. Only one request to the pushover API will ever be made at one time, however if a lot of clients connect or disconnect at the same time it could result in a lot of messages being sent one after another. My use case was a raspberry pi openvpn server on my home network with a handful of regular clients. Always be friendly to the pushover API.

Prerequisites

You will need:-

  • A running openvpn server with access to its management port
  • A pushover account
  • A user key and application token from pushover

To compile from source you will require Rust stable and cargo

Installing

The easiest way to install the application is to pull the latest binary from the release page

Complile from Source

Cargo can be used to install the application from source

git clone [email protected]:tmorgansl/openvpn-notifier.git
cd openvpn_notifier
cargo build --release

This will create the target binary in target/release.

The installation has been tested on stable linux toolchain, v1.31.1.

Running

The binary file requires your application token and user key passed as command line arguments

./openvpn-notifier --token=<TOKEN> --user_key=<USER_KEY>

Once the application is running, it will poll the openvpn management address (default localhost:5555) every 5 seconds for changes in the number of clients.

Additional options can be found by using the help flag

./openvpn-notifier -h

FAQ

Q. When some clients disconnect I get the notification hours later, what's going on?

A. When the openvpn server is in UDP mode, not all clients will send the disconnect notification by default. Instead, the client's session will be cleaned up after a long timeout period. To resolve this issue, add the following line to the client's .ovpn file

explicit-exit-notify 2

For more details, consult the openvpn manual.

License

This project is licensed under the MIT License - see the LICENSE file for details

openvpn-notifier's People

Contributors

tmorgansl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  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.