fix(luci-app-masterlink): Use HTTPS instead of HTTP for mesh join API

- Change API endpoint from http://IP:7331 to https://IP (port 443)
- Add -k flag for curl to handle self-signed certificates
- Add --no-check-certificate for wget for self-signed certs
- Update usage examples to show HTTPS URLs
- Fix menu path to /admin/secubox/master-link

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-03-26 15:03:02 +01:00
parent c4a2601c11
commit 349b20a750
2 changed files with 9 additions and 7 deletions

View File

@ -64,7 +64,7 @@ Usage:
Examples:
sbx-mesh-join 192.168.1.1 abc123def456
sbx-mesh-join 'http://192.168.1.1:7331/master-link/?token=abc123'
sbx-mesh-join 'https://192.168.1.1/master-link/?token=abc123'
sbx-mesh-join 'https://master.local/master-link/?token=abc123'
The tool will:
@ -137,18 +137,20 @@ main() {
log_step "Connecting to master at ${master_ip}..."
# Send join request
# Send join request (HTTPS with self-signed cert support)
local response=""
local api_url="https://${master_ip}/api/v1/p2p/master-link/join"
if command -v curl >/dev/null; then
response=$(curl -sf --connect-timeout 30 -X POST \
response=$(curl -sf -k --connect-timeout 30 -X POST \
-H "Content-Type: application/json" \
-d "$payload" \
"http://${master_ip}:7331/api/v1/p2p/master-link/join" 2>/dev/null)
"$api_url" 2>/dev/null)
else
response=$(wget -qO- --timeout=30 \
response=$(wget -qO- --no-check-certificate --timeout=30 \
--header="Content-Type: application/json" \
--post-data="$payload" \
"http://${master_ip}:7331/api/v1/p2p/master-link/join" 2>/dev/null)
"$api_url" 2>/dev/null)
fi
if [ -z "$response" ]; then

View File

@ -1,5 +1,5 @@
{
"admin/services/masterlink": {
"admin/secubox/master-link": {
"title": "Master-Link",
"order": 90,
"action": {