platform: modularize api/gui, add docs-tests-web foundation, and refresh root config

This commit is contained in:
beckline
2026-03-26 22:40:54 +03:00
parent 0e2d7f61ea
commit 6a56d734c2
562 changed files with 70151 additions and 16423 deletions

View File

@@ -0,0 +1,92 @@
package app
import (
"net/http"
apiroutes "selective-vpn-api/app/apiroutes"
)
func registerAPIRoutes(mux *http.ServeMux) {
apiroutes.Register(mux, apiroutes.Handlers{
Healthz: handleHealthz,
EventsStream: handleEventsStream,
GetStatus: handleGetStatus,
VPNLoginState: handleVPNLoginState,
SystemdState: handleSystemdState,
RoutesServiceStart: makeRoutesServiceActionHandler("start"),
RoutesServiceStop: makeRoutesServiceActionHandler("stop"),
RoutesServiceRestart: makeRoutesServiceActionHandler("restart"),
RoutesService: handleRoutesService,
RoutesUpdate: handleRoutesUpdate,
RoutesTimer: handleRoutesTimer,
RoutesTimerToggle: handleRoutesTimerToggle,
RoutesRollback: handleRoutesClear,
RoutesClear: handleRoutesClear,
RoutesCacheRestore: handleRoutesCacheRestore,
RoutesPrecheckDebug: handleRoutesPrecheckDebug,
RoutesFixPolicyRoute: handleFixPolicyRoute,
RoutesFixPolicyAlias: handleFixPolicyRoute,
TrafficMode: handleTrafficMode,
TrafficModeTest: handleTrafficModeTest,
TrafficAdvancedReset: handleTrafficAdvancedReset,
TrafficInterfaces: handleTrafficInterfaces,
TrafficCandidates: handleTrafficCandidates,
TrafficAppMarks: handleTrafficAppMarks,
TrafficAppMarksItems: handleTrafficAppMarksItems,
TrafficAppProfiles: handleTrafficAppProfiles,
TrafficAudit: handleTrafficAudit,
TransportClients: handleTransportClients,
TransportClientByID: handleTransportClientByID,
TransportInterfaces: handleTransportInterfaces,
TransportRuntimeObservability: handleTransportRuntimeObservability,
TransportPolicies: handleTransportPolicies,
TransportPoliciesValidate: handleTransportPoliciesValidate,
TransportPoliciesApply: handleTransportPoliciesApply,
TransportPoliciesRollback: handleTransportPoliciesRollback,
TransportConflicts: handleTransportConflicts,
TransportOwnership: handleTransportOwnership,
TransportOwnerLocks: handleTransportOwnerLocks,
TransportOwnerLocksClear: handleTransportOwnerLocksClear,
TransportCapabilities: handleTransportCapabilities,
TransportHealthRefresh: handleTransportHealthRefresh,
TransportNetnsToggle: handleTransportNetnsToggle,
TransportSingBoxProfiles: handleTransportSingBoxProfiles,
TransportSingBoxProfileByID: handleTransportSingBoxProfileByID,
TransportSingBoxFeatures: handleTransportSingBoxFeatures,
EgressIdentityGet: handleEgressIdentityGet,
EgressIdentityRefresh: handleEgressIdentityRefresh,
TraceTailPlain: handleTraceTailPlain,
TraceJSON: handleTraceJSON,
TraceAppend: handleTraceAppend,
DNSUpstreams: handleDNSUpstreams,
DNSUpstreamPool: handleDNSUpstreamPool,
DNSStatus: handleDNSStatus,
DNSModeSet: handleDNSModeSet,
DNSBenchmark: handleDNSBenchmark,
DNSSmartdnsService: handleDNSSmartdnsService,
SmartdnsService: handleSmartdnsService,
SmartdnsRuntime: handleSmartdnsRuntime,
SmartdnsPrewarm: handleSmartdnsPrewarm,
SmartdnsWildcards: handleSmartdnsWildcards,
DomainsTable: handleDomainsTable,
DomainsFile: handleDomainsFile,
VPNAutoloopStatus: handleVPNAutoloopStatus,
VPNStatus: handleVPNStatus,
VPNAutoconnect: handleVPNAutoconnect,
VPNListLocations: handleVPNListLocations,
VPNSetLocation: handleVPNSetLocation,
VPNLoginSessionStart: handleVPNLoginSessionStart,
VPNLoginSessionState: handleVPNLoginSessionState,
VPNLoginSessionAction: handleVPNLoginSessionAction,
VPNLoginSessionStop: handleVPNLoginSessionStop,
VPNLogout: handleVPNLogout,
})
}