Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
239 commits
Select commit Hold shift + click to select a range
2752f1d
Update install.sh
arvage Apr 27, 2020
07f9a6c
Update README.md
arvage Apr 27, 2020
f95f670
Update README.md
arvage Apr 27, 2020
f74fbca
Update server.conf
arvage Apr 27, 2020
ada07c9
Update install.sh
arvage Apr 27, 2020
d22b09f
Update install.sh
arvage Apr 27, 2020
ef3f6bc
Update install.sh
arvage Apr 27, 2020
69b0985
Update install.sh
arvage Apr 27, 2020
c207baa
Update install.sh
arvage Apr 27, 2020
115a352
Update install.sh
arvage Apr 27, 2020
ddff862
Update README.md
arvage Apr 27, 2020
c35d9a6
Update README.md
arvage Apr 27, 2020
fac2d7d
Delete icon.png
arvage Apr 27, 2020
c1b119b
Add files via upload
arvage Apr 27, 2020
868bf13
Update install.sh
arvage Apr 27, 2020
10e244a
Update README.md
arvage Apr 27, 2020
6954c98
Update install.sh
arvage Apr 28, 2020
b85b6c6
Update install.sh
arvage Apr 28, 2020
c4552dd
Update index.php
arvage Apr 28, 2020
074b868
Update configuration.php
arvage Apr 28, 2020
d6514ab
Update index.php
arvage Apr 28, 2020
d821641
Update index.php
arvage Apr 28, 2020
c3bad15
Update install.sh
arvage May 1, 2020
47e526a
Update install.sh
arvage May 1, 2020
6e5ba47
Create .htaccess
arvage May 1, 2020
8056284
Update install.sh
arvage May 1, 2020
27dfb33
Update install.sh
arvage May 1, 2020
00a8f9f
Update install.sh
arvage May 1, 2020
145f047
Fixed client conf download
arvage May 1, 2020
d3ee3a7
Update README.md
arvage May 1, 2020
00e29a7
Visual touchups
arvage May 1, 2020
702d47c
Merge branch 'master' of https://github.com/arvage/OpenVPN-Admin
arvage May 1, 2020
b025f20
visual touchups
arvage May 1, 2020
5e88c7b
added git as prerequisite
arvage May 1, 2020
acf5dcc
fixed configuration file name on save
arvage May 1, 2020
d386543
Update install.sh
arvage May 1, 2020
e15d057
Update install.sh
arvage May 1, 2020
0cbe2be
Update install.sh
arvage May 1, 2020
3620a03
fixed error when no sql user provided
arvage May 1, 2020
fb0c554
Update README.md
arvage May 1, 2020
5d719ea
Update install.sh
arvage May 1, 2020
4fc47e4
Update README.md
arvage May 1, 2020
4d7dca5
Update install.sh
arvage May 1, 2020
b3b6968
added instruction button
arvage May 1, 2020
2ed02ff
manual
arvage May 1, 2020
4d38c24
download instructions
arvage May 1, 2020
2e91230
download instructions
arvage May 1, 2020
67ee746
get instructions
arvage May 1, 2020
8841a5e
instruction ger
arvage May 2, 2020
c76c04b
Fully automated install
arvage May 2, 2020
23e0763
removed unnecessary package install
arvage May 2, 2020
831198e
fix easy-rsa
arvage May 2, 2020
f6064e8
Update README.md
arvage May 2, 2020
2db974b
online install created
arvage May 2, 2020
975c65d
online install
arvage May 2, 2020
66de7fb
automated install
arvage May 2, 2020
04608ce
Updating client-conf folder web security
arvage May 3, 2020
7a121d0
Providing auto-generated information when finished
arvage May 3, 2020
3e730fe
fixed hostname
arvage May 3, 2020
65b36ec
fixed error on auto install
arvage May 3, 2020
005350f
fixed final messages
arvage May 3, 2020
d431307
rearranged the script
arvage May 3, 2020
6f06ac0
Update README.md
arvage May 3, 2020
e36329e
added auto admin install
arvage May 3, 2020
9560e01
Update README.md
arvage May 3, 2020
3744d9e
fixed an error
arvage May 3, 2020
74bc507
fixed mariadb error
arvage May 3, 2020
6e374f7
fixed prerequisite checkups
arvage May 3, 2020
0e87d08
error fix
arvage May 3, 2020
6f41b85
script touchups
arvage May 3, 2020
4f43760
add user auto start date to date
arvage May 4, 2020
7a69e86
static timezone added
arvage May 4, 2020
526fd0e
static timezone added
arvage May 4, 2020
92c64af
fixed sql user or pass error
arvage May 4, 2020
c5e17da
added download conf to admin page
arvage May 4, 2020
b2302d9
added configurations table
arvage May 4, 2020
3423248
update
arvage May 4, 2020
e340dad
update
arvage May 4, 2020
10110ef
Update README.md
arvage May 4, 2020
dcbf6d2
Update README.md
arvage May 4, 2020
6c0a59c
Update README.md
arvage May 4, 2020
c51fdbd
added config download button to admin page
arvage May 4, 2020
ccd09cc
updated unistall
arvage May 4, 2020
dc93d3c
update
arvage May 4, 2020
d33ba61
auto first time admin install
arvage May 4, 2020
5eb6b86
updated public ip and hotname
arvage May 4, 2020
b75916f
update install
arvage May 4, 2020
e0b36ea
updated install
arvage May 5, 2020
80c75a9
updated install script
arvage May 5, 2020
946a6e9
updated install script
arvage May 5, 2020
a1bf476
Update install.sh
arvage May 5, 2020
7a53df2
updated install script
arvage May 5, 2020
9a8b442
timeout for hostname input for automated install
arvage May 5, 2020
6c330d2
updated install script
arvage May 5, 2020
f03b705
update
arvage May 5, 2020
3860451
update
arvage May 5, 2020
a32f9fc
update
arvage May 5, 2020
3911af0
added mysql timezone to install script
arvage May 5, 2020
94e51f4
fixed MySQL timezone.
arvage May 5, 2020
463776c
fix
arvage May 5, 2020
bab6166
fix
arvage May 5, 2020
8891733
update
arvage May 5, 2020
9fb12ed
fix
arvage May 5, 2020
7b1d023
fix
arvage May 5, 2020
9e2af72
fix
arvage May 5, 2020
9f42e08
added npm update line
arvage May 5, 2020
fdf0368
update
arvage May 5, 2020
a0fcbe0
added ip_forward for ubuntu
arvage May 6, 2020
c6ae7be
welcome ubuntu full install
arvage May 6, 2020
474cff9
grammar typo fixed. fixed KB and MB
arvage May 6, 2020
07e34b3
removed 2 columns from logs table
arvage May 6, 2020
0d282d1
removed decimals from bytes send and received
arvage May 6, 2020
0b814e6
added coloring to logs based on MB KB
arvage May 6, 2020
17a04be
coloring logs
arvage May 6, 2020
11f09e7
logs coloring
arvage May 6, 2020
4ebbede
logs coloring
arvage May 6, 2020
5941e18
logs coloring
arvage May 7, 2020
ea68f67
log table text align
arvage May 7, 2020
0104ea3
update
arvage May 7, 2020
3147dc7
added download filename selection to install script
arvage May 7, 2020
8d42a4e
added config file manual setup in install script
arvage May 7, 2020
00a1b07
fixed error
arvage May 7, 2020
276200d
download filename selection on install script
arvage May 7, 2020
d72952e
fixed error on changing file name
arvage May 7, 2020
7b870aa
updated install script user outputs
arvage May 7, 2020
067966f
updated user outputs
arvage May 7, 2020
ec5440c
fixed file save name
arvage May 7, 2020
e81debe
updated user comments
arvage May 7, 2020
5527166
fixed download file extension
arvage May 7, 2020
6825b7e
quick fix
arvage May 7, 2020
599de1b
force iptables save rules on Ubuntu
arvage Jul 15, 2020
0003e30
Added MAC instructions
arvage Oct 21, 2020
2911675
MAC instructions
arvage Oct 21, 2020
d44698c
Update index.php
arvage Oct 21, 2020
6d6a0b9
Update configuration.php
arvage Oct 21, 2020
986827d
Update configuration.php
arvage Oct 21, 2020
7756f73
Fixed filename
arvage Apr 12, 2021
db6d63b
Delete Download and install the OpenVPN GUI.pdf
arvage Apr 12, 2021
81170ee
Added Debian Support
arvage Jul 17, 2021
0ad1185
Update install.sh
arvage Jul 17, 2021
8071548
Update install.sh
arvage Jul 21, 2021
0a03546
Update install.sh
arvage Jul 21, 2021
b48f4e5
minor touch
arvage Aug 30, 2021
a2bebbd
Added filename tab and configurations
arvage Sep 2, 2021
ee7e4a3
now saving ovpn file based on filename in configs
arvage Sep 2, 2021
2885994
Create filename
arvage Sep 2, 2021
4bbbe09
Update grids.php
arvage Sep 2, 2021
0e0b86c
Update install.sh
arvage Sep 2, 2021
7722f71
touchups :)
arvage Sep 2, 2021
38fa71d
Update online-install.sh
arvage Sep 2, 2021
a0a025b
fixed a missing quotation
arvage Sep 15, 2021
5bad8e4
Fixed IP forward issue after reboots
arvage Oct 8, 2021
d279b0c
Update install.sh
arvage Oct 14, 2021
4a8d153
fixed .ovpn file save
arvage Oct 14, 2021
5bb52b3
Update online-install.sh
arvage Oct 14, 2021
fa77b96
Update online-install.sh
arvage Oct 14, 2021
28ac14b
Update online-install.sh
arvage Oct 14, 2021
9ace200
Update online-install.sh
arvage Oct 14, 2021
b6f8403
Update README.md
arvage Oct 14, 2021
06dfa13
Update online-install.sh
arvage Oct 14, 2021
ca21625
Update online-install.sh
arvage Oct 14, 2021
219d718
Update filename
arvage Oct 14, 2021
603713f
fixed MySQL root password reset
arvage Oct 14, 2021
bad7a71
Update online-install.sh
arvage Oct 14, 2021
e96d433
Update install.sh
arvage Oct 14, 2021
6ed245a
Update install.sh
arvage Oct 14, 2021
22ff51a
Update README.md
arvage Oct 14, 2021
cdba39a
Update README.md
arvage Oct 14, 2021
342a1b5
Update install.sh
arvage Oct 14, 2021
241b82f
Update install.sh
arvage Oct 14, 2021
6c56b8b
Update install.sh
arvage Oct 14, 2021
7779a3d
Update README.md
arvage Oct 14, 2021
59e714b
Update install.sh
arvage Oct 14, 2021
4b5f133
Update install.sh
arvage Oct 14, 2021
4660d63
Update install.sh
arvage Oct 14, 2021
fdbe29f
Update install.sh
arvage Oct 15, 2021
869c109
Update install.sh
arvage Oct 15, 2021
9aab409
Update online-install.sh
arvage Oct 15, 2021
42e3162
Update install.sh
arvage Oct 15, 2021
45aee9a
Update install.sh
arvage Oct 15, 2021
1c716ef
Update online-install.sh
arvage Oct 15, 2021
b19d788
Update install.sh
arvage Oct 15, 2021
5ea1682
Update install.sh
arvage Oct 15, 2021
d6606ab
Update README.md
arvage Nov 24, 2021
c0a2212
Update README.md
arvage Nov 24, 2021
7a130e1
getting ready for ubuntu 22
Aug 24, 2022
2dfacd0
getting ready for ubuntu 22
Aug 24, 2022
78cfed6
adding php7.4 to ubuntu 22
Aug 24, 2022
dcb0327
SSL CERT expiration is 100 years now
Aug 24, 2022
c1a4eca
fixed a tiny error
Aug 24, 2022
db686a0
fixed an error
Aug 24, 2022
6b034d1
tiny fix
Aug 24, 2022
5d9fad7
debugging
Aug 24, 2022
c31d5a4
tiny fix
Aug 24, 2022
76dbee3
tiny fix again!
Aug 24, 2022
614c996
fix!
Aug 24, 2022
2c827c2
fix2.0
Aug 24, 2022
57d7d49
unattended install
Aug 24, 2022
f3be3ac
unattended install fix
Aug 24, 2022
796e03b
last fix!
Aug 24, 2022
470ce78
last fix?
Aug 24, 2022
10e25a7
corrected typo
Aug 24, 2022
794db2b
corrected typo
Aug 24, 2022
4c474f7
fixed SQL query
Aug 24, 2022
4cbe55f
added some art :)
Aug 24, 2022
06347be
Amiga!?
Aug 24, 2022
0036a49
new OpenSSL compatibility
arvage Nov 15, 2022
8b582f6
Update install.sh
arvage Nov 18, 2022
8d7f356
updated version
arvage Mar 22, 2023
b683575
FD0 removal!
arvage Mar 27, 2023
810ad4e
Added RDP on Mac
arvage Mar 27, 2023
748476f
removed FD0
arvage Mar 27, 2023
01729ab
feat: add dark sidebar (A), dashboard stats panel (B), and improved u…
claude Feb 20, 2026
d84c08d
feat: add Debian 11/12 support to install, uninstall, and online-inst…
claude Feb 20, 2026
189412f
fix: use ID field from /etc/os-release for reliable OS detection
claude Feb 20, 2026
1b193b7
fix: point clone URLs to fork (ringmor) instead of upstream (arvage)
claude Feb 21, 2026
dea45fb
feat: URL-based admin pages, unified login, and admin user management
Feb 22, 2026
7bba70b
Update README.md
sandmanstorm Mar 4, 2026
b733b51
Merge pull request #1 from sandmanstorm/claude/explain-codebase-mlvb1…
arvage Mar 4, 2026
8652b41
Update repository links in installation instructions
arvage Mar 4, 2026
16dba7d
Fixed online install script
arvage Mar 5, 2026
aabf736
fixed require error
arvage Mar 6, 2026
e9ff143
Update tested Ubuntu version in README
arvage Mar 6, 2026
621c010
Upgrade to Bootstrap 5, add role-based access, certificates, SMTP, li…
arvage Jun 3, 2026
d0ddbdf
Fix install.sh compatibility with Ubuntu 22/24, Debian 11/12, Raspber…
arvage Jun 4, 2026
daeab33
Fix online-install.sh for modern Ubuntu/Debian/Raspberry Pi OS
arvage Jun 4, 2026
2bf3f9c
Fix uninstall.sh: colors, socket auth, NIC detection, complete cleanup
arvage Jun 4, 2026
13e0051
Fix update.sh: colors, backup, stat, sudoers, log dir, server.conf pa…
arvage Jun 4, 2026
080558a
Update README and CHANGELOG for v1.0.0
arvage Jun 4, 2026
933ed22
Fix PHP 7.2 compatibility: replace match(), str_contains(), arrow fun…
arvage Jun 4, 2026
25cc38c
Fix online-install.sh: add sudo to needrestart sed command
arvage Jun 4, 2026
1c67535
Fix needrestart suppression: use env var instead of sed on config file
arvage Jun 4, 2026
9b31ec3
Fix Apache PHP module mismatch in install.sh and update.sh
arvage Jun 4, 2026
e6f8849
Add author credit to sidebar footer and login page
arvage Jun 4, 2026
3db633e
Fix SQL migration: remove ADD COLUMN IF NOT EXISTS, add per-statement…
arvage Jun 4, 2026
4f8f59b
Fix isInstalled(): check for admin users, not just the admin table
arvage Jun 4, 2026
964493f
Fix duplicate redirect-gateway warning in client configs
arvage Jun 4, 2026
ae92ca0
Fix LZO decompression header error causing connection drops
arvage Jun 4, 2026
abac3a4
Fix LZO header mismatch: align compression to lz4-v2 everywhere
arvage Jun 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# OpenVPN-Admin Version History

## 1.0.0
- Upgrade UI from Bootstrap 3 to Bootstrap 5 with Bootstrap Icons (CDN-based; removes Bower/npm dependency entirely)
- Replace x-editable inline editing with Bootstrap 5 modal-based row editing
- Add live connection dashboard (polls OpenVPN status log every 10 seconds)
- Add per-user certificate management: generate, revoke, download `.ovpn`, email config
- Add role-based admin access: `super-admin` (full control) and `read-only`
- Add SMTP configuration page with send-test functionality
- Add email notification toggles: on-connect, on-disconnect, account-expiry
- Add `include/mailer.php`: lightweight zero-dependency PHP SMTP client
- Add `include/notify.php`: CLI script called by OpenVPN connect/disconnect hooks
- Add `sql/schema-10.sql`: admin role column, `smtp_settings` table, fix missing admin columns
- Fix `install.sh`: remove PHP 7.4 forcing; use system PHP; fix OpenVPN 2.5+ genkey syntax;
fix `iptables-save`; fix IP forwarding persistence via `sysctl.d`; fix hardcoded `eth0`;
detect MySQL vs MariaDB; add sudoers entry for EasyRSA; add 64-bit Raspberry Pi OS detection;
remove Bower/nodejs/npm; fix `apt-get upgrade` removal; add `systemctl enable`
- Fix `online-install.sh`: remove non-ASCII chars from ASCII art; fix RPi 64-bit detection;
guard `needrestart` edit; remove `apt-get upgrade`; handle existing clone directory; add `set -e`
- Fix `uninstall.sh`: add colors; fix MySQL socket auth; fix hardcoded `eth0`; fix `iptables-save`;
fix sysctl cleanup; stop/disable OpenVPN service before file removal; clean up all new artifacts
(sudoers, log dir, iptables persistence file, Apache conf); fix PHP timezone revert
- Fix `update.sh`: add colors; add pre-update backup; fix `stat` for user/group detection;
add sudoers and log dir creation for existing installs; patch `server.conf` for OpenVPN 2.5+;
add Apache reload; add OpenVPN restart when server.conf changes
- Connect and disconnect scripts now call `notify.php` for email alerts

## 0.3.2
- Fix with MySQL NO_ZERO_DATE mode

Expand Down
216 changes: 149 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,178 @@
# OpenVPN Admin

## Summary
Administrate its OpenVPN with a web interface (logs visualisations, users managing...) and a SQL database.
A web-based administration panel for OpenVPN servers — manage users, certificates, logs, and settings through a modern browser interface.

![Previsualisation configuration](https://lutim.cpy.re/fUq2rxqz)
![Previsualisation administration](https://lutim.cpy.re/wwYMkHcM)
---

## Features

## Prerequisite
| Feature | Description |
|---|---|
| **Live Dashboard** | Real-time table of connected clients with IP, bandwidth, and session duration |
| **User Management** | Add, edit, enable/disable, and delete VPN users with expiry dates |
| **Certificate Management** | Generate and revoke per-user certificates via EasyRSA; download individual `.ovpn` files |
| **Connection Logs** | Aggregated session history with data transferred per user |
| **Role-based Admin Access** | `super-admin` (full control) and `read-only` roles for web panel admins |
| **Email Notifications** | SMTP configuration with optional alerts on user connect, disconnect, or account expiry |
| **Client Configs** | Edit and version-history GNU/Linux, Windows, and macOS `.ovpn` templates in-browser |
| **Modern UI** | Bootstrap 5 interface with dark sidebar, stats cards, and responsive layout |

* GNU/Linux with Bash and root access
* Fresh install of OpenVPN
* Web server (NGinx, Apache...)
* MySQL
* PHP >= 5.5 with modules:
* zip
* pdo_mysql
* bower
* unzip
* wget
* sed
* curl
---

### Debian 8 Jessie
## Supported Platforms

````
# apt-get install openvpn apache2 php5-mysql mysql-server php5 nodejs unzip git wget sed npm curl
# npm install -g bower
# ln -s /usr/bin/nodejs /usr/bin/node
````
| OS | Versions |
|---|---|
| Ubuntu Server | 22.04 LTS, 24.04 LTS |
| Debian | 11 (Bullseye), 12 (Bookworm) |
| Raspberry Pi OS | 32-bit and 64-bit (Bullseye / Bookworm) |

### Debian 9 Stretch
> The installer auto-detects your OS, PHP version, and database engine (MySQL or MariaDB). No manual configuration required.

In order to install `npm`, [stretch-backports need to be added to your sources.list](https://backports.debian.org/Instructions/#index2h2).
---

````
# apt-get install -t stretch-backports npm nodejs
# apt-get install openvpn apache2 php-mysql mysql-server php-zip php unzip git wget sed curl
# npm install -g bower
````
## Installation

### CentOS 7
### Automatic (one-liner)

````
# yum install epel-release
# yum install openvpn httpd php-mysql mariadb-server php nodejs unzip git wget sed npm
# npm install -g bower
# systemctl enable mariadb
# systemctl start mariadb
````
```bash
wget -O - https://raw.githubusercontent.com/arvage/OpenVPN-Admin/master/online-install.sh | bash
```

### Other distribution... (PR welcome)
### Manual

## Tests
```bash
sudo apt update && sudo apt install -y git
git clone https://github.com/arvage/OpenVPN-Admin ~/openvpn-admin
cd ~/openvpn-admin
sudo ./install.sh /var/www www-data www-data
```

Only tested on Debian Jessie. Feel free to open issues.
### First-time setup

## Installation
Once the installer finishes, open a browser and go to:

```
http://<your-server-ip>/index.php?installation
```

Create your first admin account there. The page will redirect to the admin panel when done.

---

## Admin Panel

After logging in at `http://<your-server-ip>/`, the sidebar gives access to:

* Setup OpenVPN and the web application:
### Dashboard
Live table of currently connected VPN clients — username, real IP address, bytes received/sent, and connection time. Refreshes every 10 seconds automatically.

$ cd ~/my_coding_workspace
$ git clone https://github.com/Chocobozzz/OpenVPN-Admin openvpn-admin
$ cd openvpn-admin
# ./install.sh /var/www www-data www-data
### Users
Full user management: add users, reset passwords, set start/end dates, enable or disable accounts. Rows with expired end dates are highlighted automatically.

* Setup the web server (Apache, NGinx...) to serve the web application.
* Create the admin of the web application by visiting `http://your-installation/index.php?installation`
### Certificates
Per-user certificate management backed by EasyRSA:
- **Generate** a certificate for a user (runs `easyrsa build-client-full`)
- **Revoke** a certificate (runs `easyrsa revoke` + `gen-crl`)
- **Download** a ready-to-use `.ovpn` file with the user's certificate embedded inline
- **Email** the `.ovpn` file directly to the user (requires SMTP to be configured)

## Usage
> The installer automatically grants `www-data` passwordless sudo access to `easyrsa` via `/etc/sudoers.d/openvpn-admin`.

* Start OpenVPN on the server (for example `systemctl start openvpn@server`)
* Connect to the web application as an admin
* Create an user
* User get the configurations files via the web application (and put them in */etc/openvpn*)
* Users on GNU/Linux systems, run `chmod +x /etc/openvpn/update-resolv.sh` as root
* User run OpenVPN (for example `systemctl start openvpn@client`)
### Logs
Aggregated connection history per user: total sessions, data transferred, and last seen timestamp. Server-side paginated for large datasets.

### Admins
Manage web panel admin accounts. Each admin has a **role**:
- `super-admin` — full read/write access to all pages
- `read-only` — can view all pages but cannot make changes

### Configs
Edit the raw OpenVPN client configuration templates for GNU/Linux, Windows, and macOS directly in the browser. Changes are saved with a version history so you can review or restore previous configs.

### Settings → SMTP
Configure outgoing email:
- SMTP host, port, username, password
- Security: STARTTLS, SSL/TLS, or none
- Send a test email to verify settings

### Settings → Notifications
Toggle email alerts sent to the user's registered address:
- **On Connect** — email when the user connects to VPN
- **On Disconnect** — email when the user disconnects
- **Account Expiry** — email 7 days before the account's end date

> Connect/disconnect notifications require the OpenVPN server scripts to be in place. The installer sets this up automatically via `/etc/openvpn/scripts/connect.sh` and `disconnect.sh`.

---

## Update

$ git pull origin master
# ./update.sh /var/www
```bash
cd ~/openvpn-admin
git pull origin master
sudo ./update.sh /var/www
```

`update.sh` will:
- Back up the current installation to `/root/openvpn-admin-backup-<timestamp>.tar.gz`
- Copy updated web application files
- Apply any pending database migrations automatically
- Patch `server.conf` for OpenVPN 2.5+ compatibility if needed
- Add missing infrastructure (sudoers entry, log directory) for existing installs
- Reload Apache and restart OpenVPN if config changed

---

## Uninstall

Removes all installed components: OpenVPN keys and configuration, the web application, the MySQL/MariaDB database and user, iptables NAT rules, the Apache virtual host, and sysctl forwarding settings.

```bash
sudo ./uninstall.sh /var/www
```

The script will show a full list of what will be deleted and require you to type `yes` to confirm. Installed packages (`openvpn`, `apache2`, `mysql`/`mariadb`, `php`) are **not** removed.

---

## How It Works

```
Browser ──► Apache ──► PHP (index.php / grids.php)
├── MySQL/MariaDB (users, admins, logs, SMTP config)
├── /etc/openvpn/ (server.conf, certs, client configs)
└── /var/log/openvpn/openvpn-status.log (live dashboard)

OpenVPN server ──► connect.sh / disconnect.sh
└── notify.php (sends email alerts via SMTP)
```

Users authenticate to OpenVPN with username + password (no client certificate required by default). The `login.sh` script validates credentials against the database. The certificate management feature generates optional per-user certs for environments that require them.

---

## Libraries Used

All frontend libraries are loaded from CDN — no build tools or package managers required.

| Library | Version | Purpose |
|---|---|---|
| [Bootstrap](https://getbootstrap.com/) | 5.3 | UI framework |
| [Bootstrap Icons](https://icons.getbootstrap.com/) | 1.11 | Icon set |
| [Bootstrap Table](https://bootstrap-table.wenzhixin.net.cn/) | 1.22 | Data grids with pagination and filtering |
| [jQuery](https://jquery.com/) | 3.7 | DOM and AJAX |

## Desinstall
It will remove all installed components (OpenVPN keys and configurations, the web application, iptables rules...).
---

# ./desinstall.sh /var/www
## Reporting Issues

## Use of
Please open an issue at [github.com/arvage/OpenVPN-Admin/issues](https://github.com/arvage/OpenVPN-Admin/issues) and include:

* [Bootstrap](https://github.com/twbs/bootstrap)
* [Bootstrap Table](http://bootstrap-table.wenzhixin.net.cn/)
* [Bootstrap Datepicker](https://github.com/eternicode/bootstrap-datepicker)
* [JQuery](https://jquery.com/)
* [X-editable](https://github.com/vitalets/x-editable)
- OS and version
- PHP version (`php -v`)
- MySQL/MariaDB version (`mysql --version`)
- The error message or unexpected behaviour
- Relevant Apache/PHP logs (`/var/log/apache2/error.log`)
Binary file modified css/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading