Commit Graph

22 Commits

Author SHA1 Message Date
Stanislas
6b09270347 feat: add certificate renewal functionality (#1328)
## Summary

- Add certificate renewal for both client and server certificates
- Allow custom validity period during renewal (prompts user, defaults to
3650 days)
- Show expiry info inline in menus (e.g., "Renew the server certificate
(expires in 3542 days)")
- Regenerate `.ovpn` files after client renewal
- Restart OpenVPN service after server renewal
- Extract reusable helper functions to reduce code duplication
- Add robust input validation and error handling

## New menu option

```
What do you want to do?
   1) Add a new user
   2) Revoke existing user
   3) Renew certificate        ← NEW
   4) Remove OpenVPN
   5) Exit
```

## Renewal submenu

```
What do you want to renew?
   1) Renew a client certificate
   2) Renew the server certificate (expires in 3542 days)
   3) Back to main menu
```

Client list shows expiry for each:
```
Select the existing client certificate you want to renew
     1) alice (expires in 3542 days)
     2) bob (expires in 30 days)
     3) charlie (EXPIRED 5 days ago)
```

## Helper functions added

Extracted common code into reusable functions:
- `getHomeDir()` - home directory detection
- `regenerateCRL()` - CRL regeneration after cert changes
- `generateClientConfig()` - .ovpn file generation  
- `selectClient()` - client listing with optional expiry display
- `getDaysUntilExpiry()` - certificate expiry calculation
- `formatExpiry()` - human-readable expiry formatting

## Test plan

- [x] Client certificate renewal tested in Docker CI
- [x] Server certificate renewal tested in Docker CI
- [x] Certificate validity verified after renewal (~3650 days)
- [x] VPN connectivity tested with renewed certificate

Closes #974 #1002 #1228 #1060
2025-12-09 21:49:19 +01:00
Stanislas
93284de7df Fix typo in FAQ
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-04 23:04:11 +01:00
Stanislas Lange
39dd034717 Fix textlint terminology: websites -> sites 2025-12-04 23:04:11 +01:00
Stanislas Lange
bfcd624592 docs: fix sysctl config path in FAQ (20 -> 99)
The script uses /etc/sysctl.d/99-openvpn.conf but the FAQ
incorrectly referenced /etc/sysctl.d/20-openvpn.conf
2025-12-04 23:04:11 +01:00
s7r
38d3bf9afa Update FAQ with IPv6 prefix policies for ULA addresses (#1083)
* Update FAQ with IPv6 prefix policies for ULA addresses

Most operating systems will prefer IPv4 rather than IPv6 ULA, which defeats the purpose of redirect-gateway ipv6. It's nothing the script can do to automate this.
2023-01-18 23:05:09 +01:00
Stanislas
ea236de3e3 Create user from text file
Fix #732
2020-12-08 21:39:51 +01:00
Stanislas
5acd9a0446 Update FAQ.md 2020-12-08 21:26:39 +01:00
Stanislas
b2e96b0762 Update FAQ.md 2020-12-08 21:24:38 +01:00
Stanislas
bd047c08d7 ci: use super-linter (#683) 2020-10-21 13:59:49 +02:00
Gal Bracha
7ddd525edf Update FAQ.md
Added instructions on the `/etc/openvpn/client-template.txt` as requested
2020-10-12 10:28:22 +03:00
Gal Bracha
9623867026 FAQ - Added how to set up part of the routing
# Implements
Updated `FAQ.md` - Added how to set only some of the traffic to go through the VPN and the rest using the normal connection
2020-09-08 11:47:31 +03:00
robiiinos
2a73a41f71 Add new dns leak tests to FAQ 2020-06-27 14:49:12 +02:00
Techroy23
e952d58995 docs(faq): add batch client generation script (#645) 2020-04-28 14:23:18 +02:00
randomshell
c785b230e9 docs(faq): add info for remote LAN access (#630) 2020-04-27 19:02:35 +02:00
Stanislas Lange
c2d7729c20 style(faq): format markdown 2020-04-27 15:32:05 +02:00
randomshell
a3e6652d6d docs(faq): update DNS not working question (#632) 2020-04-27 14:20:04 +02:00
randomshell
0481e10bce Add FAQ for client-to-client (#631) 2020-04-27 10:39:33 +02:00
randomshell
72c99f3e8f Add FAQ for router clients (#629) 2020-04-24 18:00:59 +02:00
Stanislas Lange
0188c442a2 FAQ: Remove obsolete entry
Fix #634
2020-04-23 18:49:26 +02:00
randomshell
fcc4cc4afd Add FAQ entry for sysctl and iptables changes (#626) 2020-04-22 11:39:42 +02:00
randomshell
777bedaa38 Add FAQ for DNS Leaks blocking (#627) 2020-04-22 11:38:31 +02:00
Stanislas
d31efe9e7b Move FAQ from wiki to git to allow contributions (#611)
Signed-off-by: Stanislas Lange <angristan@pm.me>
2020-04-04 11:54:17 +02:00