Coder Social home page Coder Social logo

pivpn-telegram-manager's Introduction

PiVPN Telegram Manager

With this telegram bot you can manage clients for WireGuard/OpenVPN installed with PiVPN.

Features

  • Create new clients.
  • Removing existing clients.
  • Getting the client configuration file (for WireGuard and OpenVPN).
  • Obtaining a client QR code (for the WireGuard mobile application).
  • Getting a list of clients.

Installation

1. Publish application

Clone project, open it and run command:

$ dotnet publish -c release -r linux-x64 --self-contained

2. Preparation and setup

Upload the publish folder to the server using WinSCP or whatever method you like, and then fill the config.json file inside the publish folder following this example:

Key Default Example Description
TelegramBotToken "" "1234567890:NNWQxDDCqFB5Hf9AdaRTiA12-c5qWbqCCLN" Telegram bot authentication token.
TelegramBotAdmins [ ] [ "user1", "user2" ] Names of users who can use the bot. Attention: It is strongly recommended to specify users, if left empty, then any user can manage the bot!
PiVPNConfigsPath "" "/home/ubuntu/configs/" The path where the client configuration files are located. Must contain "configs" for WireGuard and "ovpns" for OpenVPN.

3. Run pivpn-telegram-manager

Get superuser rights and go to the folder with the bot, then run the commands:

$ chmod 777 ./pivpn-telegram-manager
$ ./pivpn-telegram-manager

Or to run as a service, first install systemd on your server, then create a .service file:

$ nano /etc/systemd/system/pivpn-telegram-manager.service

The contents of the pivpn-telegram-manager.service file:

[Unit]
Description=PiVPN Telegram Manager

[Service]
WorkingDirectory=/path/to/app/
ExecStart=/usr/bin/dotnet /path/to/app/pivpn-telegram-manager.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=log.pivpntgmanager
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production
TimeoutStopSec=30

[Install]
WantedBy=multi-user.target

Where /path/to/app/ is the path to the publish folder.

Then reload Unit files and start service:

$ systemctl daemon-reload
$ systemctl start pivpn-telegram-manager

pivpn-telegram-manager's People

Contributors

auwaho avatar

Stargazers

 avatar

Watchers

 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.