Skip to content

Commit 1830b04

Browse files
committed
refactor(menu): reorganise menu layout for first-time user workflow
Renumber all options to reflect logical setup order: First-Time Setup (1-6), Instance Management (i/l), Server Configuration (7-9/s), Firewall (10-11), Client Certificates (12-17/r), VPN Profiles (18-19), Monitoring & Diagnostics (20-22), exit via x. Remove p) letter option — configure performance is a numbered step (9) not a cross-cutting operation. Update README, integration tests, and sexpect_helper quit_script to send x instead of old option 20.
1 parent 4958e45 commit 1830b04

4 files changed

Lines changed: 138 additions & 144 deletions

File tree

README.md

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Tired of managing keys, ovpn files and all different parts piecemeal? Use this s
3030

3131
- **OpenWRT 25 Support** - Automatic detection of `apk` (OpenWRT 25+) or `opkg` (older versions) for all package operations
3232
- **Install Required Packages Menu** - New menu option 19 installs `at`, `openvpn-openssl`, and `openvpn-easy-rsa` in one step
33-
- **LuCI File Manager** - Option 13 now also installs `luci-app-filemanager` for easy .ovpn file downloads via the web interface
33+
- **LuCI File Manager** - Option 6 now also installs `luci-app-filemanager` for easy .ovpn file downloads via the web interface
3434
- **Exit moved to option 20**
3535

3636
## What's New in v2.5.0
@@ -172,10 +172,10 @@ This guide assumes you're starting from scratch with nothing installed. Follow t
172172

173173
### Step 1: Install Required Packages
174174

175-
**Menu Option: 19**
175+
**Menu Option: 1**
176176

177177
```
178-
19) Install required packages (at, openvpn, openvpn-easy-rsa)
178+
1) Install required packages (at, openvpn, openvpn-easy-rsa)
179179
Continue with installation? (yes/no): yes
180180
```
181181

@@ -197,10 +197,10 @@ The script detects the package manager at startup and uses the correct package n
197197

198198
### Step 2: Install LuCI Web Interface (Optional but Recommended)
199199

200-
**Menu Option: 13**
200+
**Menu Option: 6**
201201

202202
```
203-
13) Install LuCI OpenVPN and File Manager web interface
203+
6) Install LuCI OpenVPN and File Manager web interface
204204
Continue with installation? (yes/no): yes
205205
```
206206

@@ -218,10 +218,10 @@ This installs `luci-app-openvpn` and `luci-app-filemanager` which provide:
218218

219219
### Step 3: Initialize EasyRSA
220220

221-
**Menu Option: 12**
221+
**Menu Option: 3**
222222

223223
```
224-
12) Initialize EasyRSA for OpenVPN
224+
3) Initialize EasyRSA / PKI
225225
```
226226

227227
This will:
@@ -242,16 +242,16 @@ The script defaults to **EC (Elliptic Curve)** with the `prime256v1` curve (NIST
242242
| Client compatibility | OpenVPN 2.4+ (2017+) | All OpenVPN versions |
243243
| Security | Strong — equivalent to RSA 3072+ | Strong at 2048-bit |
244244

245-
To use RSA instead, edit the `OVPN_CRYPTO_ALGO` variable at the top of the script before running Step 3, or use Menu Option `k) Configure cryptography settings`. Once the PKI is initialized the algorithm cannot be changed without re-initializing (which revokes all existing certificates).
245+
To use RSA instead, edit the `OVPN_CRYPTO_ALGO` variable at the top of the script before running Step 3, or use Menu Option `2) Configure cryptography settings`. Once the PKI is initialized the algorithm cannot be changed without re-initializing (which revokes all existing certificates).
246246

247247
**Important:** This step takes several minutes for RSA (DH generation). EC completes significantly faster.
248248

249249
### Step 4: Auto-Detect Server Settings
250250

251-
**Menu Option: 0**
251+
**Menu Option: 4**
252252

253253
```
254-
0) Auto-Detect server settings
254+
4) Auto-detect server settings
255255
```
256256

257257
This automatically detects:
@@ -262,7 +262,7 @@ This automatically detects:
262262

263263
Review the detected settings. The script will use these for configuration generation.
264264

265-
**Note:** IPv6 support is disabled by default. If you want to enable IPv6 for your VPN, use Menu Option 3 after reviewing the auto-detected IPv6 settings (Step 5 below).
265+
**Note:** IPv6 support is disabled by default. If you want to enable IPv6 for your VPN, use Menu Option 8 after reviewing the auto-detected IPv6 settings (Step 5 below).
266266

267267
**DDNS Support:**
268268

@@ -272,18 +272,18 @@ The auto-detect feature will automatically detect your DDNS hostname if configur
272272
1. Follow the official OpenWrt DDNS guide: https://openwrt.org/docs/guide-user/services/ddns/client
273273
2. Configure your DDNS service provider in LuCI or UCI
274274
3. Verify DDNS is working: `nslookup your-hostname.dyndns.org`
275-
4. Run this script's auto-detect (Option 0) - it will automatically use your DDNS hostname
275+
4. Run this script's auto-detect (Option 4) - it will automatically use your DDNS hostname
276276

277277
If DDNS is not configured, the script will fall back to using your current WAN IP address.
278278

279279
### Step 5: Configure IPv6 (Optional - Advanced Users)
280280

281281
**Note:** IPv6 is disabled by default to avoid configuration conflicts. Only enable if you understand IPv6 networking and have verified your router has proper IPv6 prefix delegation from your ISP.
282282

283-
**Menu Option: 3**
283+
**Menu Option: 8**
284284

285285
```
286-
3) Toggle IPv6 support (Currently: no)
286+
8) Toggle IPv6 support (Currently: no)
287287
Enable IPv6 support? (yes/no): yes
288288
289289
Select IPv6 mode:
@@ -302,10 +302,10 @@ Enter max clients limit (default 253): 100
302302

303303
### Step 5.5: Configure Performance Settings (Optional)
304304

305-
**Menu Option: p**
305+
**Menu Option: 9**
306306

307307
```
308-
p) Configure performance (bandwidth limiting)
308+
9) Configure performance (bandwidth limiting)
309309
310310
Current Performance Settings:
311311
@@ -371,10 +371,10 @@ Enter bandwidth limit in bytes per second:
371371

372372
### Step 6: Generate Server Configuration
373373

374-
**Menu Option: 1**
374+
**Menu Option: 5**
375375

376376
```
377-
1) Generate/Update server.conf
377+
5) Generate/Update server.conf
378378
Continue and overwrite? (yes/no): yes
379379
View the generated configuration? (y/n): y
380380
```
@@ -392,10 +392,10 @@ This creates `/etc/openvpn/server.conf` with:
392392

393393
### Step 7: Configure Firewall
394394

395-
**Menu Option: 15**
395+
**Menu Option: 11**
396396

397397
```
398-
15) Configure VPN firewall access
398+
11) Configure VPN firewall access
399399
Continue with firewall configuration? (yes/no): yes
400400
Restart firewall to apply changes? (y/n): y
401401
```
@@ -431,7 +431,7 @@ Restart firewall to apply changes? (y/n): y
431431
**Verify Firewall:**
432432

433433
```
434-
14) Check firewall configuration
434+
10) Check firewall configuration
435435
```
436436

437437
**Confirms:**
@@ -456,10 +456,10 @@ Or manually:
456456

457457
### Step 9: Create Your First Client Certificate
458458

459-
**Menu Option: 4**
459+
**Menu Option: 12**
460460

461461
```
462-
4) Create new client certificate
462+
12) Create new client certificate
463463
Enter client name: username.laptop
464464
Generate .ovpn config file? (y/n): y
465465
```
@@ -499,7 +499,7 @@ scp root@192.168.1.1:/root/ovpn_config_out/bill.laptop.ovpn ~/Downloads/
499499

500500
**Or via LuCI Web Interface:**
501501

502-
Install the file manager via menu option 13, then navigate to System → File Browser
502+
Install the file manager via menu option 6, then navigate to System → File Browser
503503

504504
### Step 11: Connect Your Client
505505

@@ -557,13 +557,13 @@ One the client device (the laptop or mobile device) open a browser while the VPN
557557
- Shows instance status, config file path, and running state
558558

559559
## LuCI Integration
560-
- Install `luci-app-openvpn` and `luci-app-filemanager` with one command (menu option 13)
560+
- Install `luci-app-openvpn` and `luci-app-filemanager` with one command (menu option 6)
561561
- Automatic package installation using `apk` (OpenWRT 25+) or `opkg` (older versions)
562562
- Changes made in LuCI web interface appear in this script and vice versa
563563

564564
### Viewing VPN Tunnel in LuCI
565565

566-
After running **Menu Option 15** (Configure VPN firewall access), the VPN tunnel interface will appear in LuCI:
566+
After running **Menu Option 11** (Configure VPN firewall access), the VPN tunnel interface will appear in LuCI:
567567

568568
**Location:** LuCI → Network → Interfaces
569569

@@ -588,10 +588,10 @@ After running **Menu Option 15** (Configure VPN firewall access), the VPN tunnel
588588
**Important:** The `vpn` interface is managed by OpenVPN. Don't edit it directly in LuCI - use this script (Menu Options) or edit `/etc/openvpn/server.conf` instead.
589589

590590
**Troubleshooting:** If VPN interface doesn't appear in LuCI:
591-
1. Run Menu Option 15 to create UCI network interface
591+
1. Run Menu Option 11 to create UCI network interface
592592
2. Restart network service: `/etc/init.d/network restart`
593593
3. Refresh LuCI page
594-
4. Check Menu Option 14 for verification
594+
4. Check Menu Option 10 for verification
595595

596596

597597
## OpenVPN Monitoring
@@ -619,10 +619,10 @@ After running **Menu Option 15** (Configure VPN firewall access), the VPN tunnel
619619

620620
### Monitor VPN Status
621621

622-
**Menu Option: 16**
622+
**Menu Option: 20**
623623

624624
```
625-
16) Monitor VPN address usage (IPv4 & IPv6)
625+
20) Monitor VPN usage
626626
Select instance to monitor: 1
627627
```
628628

@@ -635,8 +635,8 @@ Shows:
635635
### Create Additional Clients
636636

637637
```
638-
**Menu Option: 4** (Create certificate)
639-
**Menu Option: 11** (Generate single .ovpn file)
638+
**Menu Option: 12** (Create certificate)
639+
**Menu Option: 19** (Generate single .ovpn file)
640640
```
641641

642642
### Manage Multiple Server Instances
@@ -655,10 +655,10 @@ Enter new instance name: office_vpn
655655

656656
### Revoke a Client Certificate
657657

658-
**Menu Option: 6**
658+
**Menu Option: 14**
659659

660660
```
661-
6) Revoke client certificate
661+
14) Revoke client certificate
662662
Enter client name to revoke: laptop
663663
Are you sure? (yes/no, 30s timeout): yes
664664
Revoking certificate for laptop...
@@ -699,20 +699,20 @@ The script also warns at startup if the CRL is expired or within 30 days of expi
699699

700700
### Check Certificate Expiration
701701

702-
**Menu Option: 7**
702+
**Menu Option: 15**
703703

704704
```
705-
7) Check certificate expiration
705+
15) Check certificate expiration
706706
```
707707

708708
Shows expiration status for all certificates.
709709

710710
### Check/Fix File Permissions
711711

712-
**Menu Option: 18**
712+
**Menu Option: 22**
713713

714714
```
715-
18) Check/Fix file permissions
715+
22) Check/Fix file permissions
716716
Fix all permission issues now? (yes/no): yes
717717
```
718718

@@ -818,10 +818,10 @@ The `at` utility (for scheduling) is automatically installed if not present:
818818

819819
Safe restart with connection checking is automatically used in:
820820
- Server Control menu (Menu Option 's', Action 3)
821-
- After generating server configuration (Menu Option 1)
822-
- After restoring configuration from backup (Menu Option 2)
823-
- After creating new client certificates (Menu Option 4)
824-
- After revoking client certificates (Menu Option 6)
821+
- After generating server configuration (Menu Option 5)
822+
- After restoring configuration from backup (Menu Option 7)
823+
- After creating new client certificates (Menu Option 12)
824+
- After revoking client certificates (Menu Option 14)
825825

826826
<details>
827827
<summary><strong>Troubleshooting</strong> (click to expand)</summary>
@@ -832,8 +832,8 @@ Safe restart with connection checking is automatically used in:
832832

833833
**Use the built-in diagnostic tool first:**
834834
```bash
835-
# Run from script Menu Option 17
836-
17) Diagnose IPv6 routing issues
835+
# Run from script Menu Option 21
836+
21) Diagnose IPv6 routing issues
837837
```
838838

839839
This will automatically check all common issues below.
@@ -977,8 +977,8 @@ curl -4 https://ifconfig.co
977977

978978
**Use the built-in permission checker first:**
979979
```bash
980-
# Run from script Menu Option 18
981-
18) Check/Fix file permissions
980+
# Run from script Menu Option 22
981+
22) Check/Fix file permissions
982982
```
983983

984984
This will automatically check and optionally fix all permission issues.
@@ -1446,7 +1446,7 @@ ip -6 addr show tun0
14461446
```
14471447

14481448
**3. Monitor IPv6 usage:**
1449-
- Run **Option 16** in the script
1449+
- Run **Option 20** in the script
14501450
- Select the server instance
14511451
- View IPv6 addresses and connected clients
14521452

@@ -1540,11 +1540,11 @@ Then restart: `/etc/init.d/openvpn restart server`
15401540
Monitor and limit IPv6 address usage:
15411541

15421542
**Check current usage:**
1543-
- Run **Option 16** (Monitor VPN address usage)
1543+
- Run **Option 20** (Monitor VPN usage)
15441544
- Shows: active IPv6 addresses, connected clients, remaining capacity
15451545

15461546
**Adjust pool size:**
1547-
- Run **Option 3** (Toggle IPv6 support)
1547+
- Run **Option 8** (Toggle IPv6 support)
15481548
- Select **Option 3** (Change max clients limit)
15491549
- Enter new limit (e.g., 50, 100, 253)
15501550

@@ -1679,7 +1679,7 @@ cat /tmp/hosts/odhcpd
16791679
logread | grep odhcpd
16801680
```
16811681

1682-
**Use the script's monitoring (Option 16):**
1682+
**Use the script's monitoring (Option 20):**
16831683
- Shows connected clients
16841684
- Displays IPv6 addresses in use
16851685
- Works with both static and DHCPv6 modes

0 commit comments

Comments
 (0)