secubox-openwrt/package/secubox/luci-app-exposure/htdocs/luci-static/resources/exposure/api.js
CyberMind-FR 1056026168 feat(luci): Add LuCI interface for Service Exposure Manager
Complete LuCI app with:
- Overview dashboard with stats (services, Tor, SSL counts)
- Port conflict detection and warnings
- Services list with quick actions
- Tor hidden services management (add/list/remove)
- HAProxy SSL backends management (add/list/remove)

Views: overview.js, services.js, tor.js, ssl.js
RPCD: luci.exposure backend
Menu: admin/secubox/network/exposure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 15:49:29 +01:00

82 lines
1.6 KiB
JavaScript

'use strict';
'require rpc';
var callScan = rpc.declare({
object: 'luci.exposure',
method: 'scan',
expect: { services: [] }
});
var callConflicts = rpc.declare({
object: 'luci.exposure',
method: 'conflicts',
expect: { conflicts: [] }
});
var callStatus = rpc.declare({
object: 'luci.exposure',
method: 'status'
});
var callTorList = rpc.declare({
object: 'luci.exposure',
method: 'tor_list',
expect: { services: [] }
});
var callSslList = rpc.declare({
object: 'luci.exposure',
method: 'ssl_list',
expect: { backends: [] }
});
var callGetConfig = rpc.declare({
object: 'luci.exposure',
method: 'get_config',
expect: { known_services: [] }
});
var callFixPort = rpc.declare({
object: 'luci.exposure',
method: 'fix_port',
params: ['service', 'port']
});
var callTorAdd = rpc.declare({
object: 'luci.exposure',
method: 'tor_add',
params: ['service', 'local_port', 'onion_port']
});
var callTorRemove = rpc.declare({
object: 'luci.exposure',
method: 'tor_remove',
params: ['service']
});
var callSslAdd = rpc.declare({
object: 'luci.exposure',
method: 'ssl_add',
params: ['service', 'domain', 'local_port']
});
var callSslRemove = rpc.declare({
object: 'luci.exposure',
method: 'ssl_remove',
params: ['service']
});
return {
scan: callScan,
conflicts: callConflicts,
status: callStatus,
torList: callTorList,
sslList: callSslList,
getConfig: callGetConfig,
fixPort: callFixPort,
torAdd: callTorAdd,
torRemove: callTorRemove,
sslAdd: callSslAdd,
sslRemove: callSslRemove
};