working version 12-05-2026
This commit is contained in:
@@ -32,4 +32,9 @@ public class VpsController {
|
|||||||
public NetworkTrafficResponse getNetworkTraffic() {
|
public NetworkTrafficResponse getNetworkTraffic() {
|
||||||
return wireGuardService.getNetworkTraffic();
|
return wireGuardService.getNetworkTraffic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/udp2raw-traffic")
|
||||||
|
public NetworkTrafficResponse getUdp2rawTraffic() {
|
||||||
|
return wireGuardService.getUdp2rawTraffic();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -192,4 +192,29 @@ public class WireGuardService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NetworkTrafficResponse getUdp2rawTraffic() {
|
||||||
|
SshCommandResult result = sshService.executeOnConfiguredVps(
|
||||||
|
"sudo /usr/local/sbin/lr-vps-udp2raw-traffic 444 1"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (result.exitCode() != 0) {
|
||||||
|
throw new SshCommandException(
|
||||||
|
"Failed to query UDP2RAW traffic: "
|
||||||
|
+ result.stderr()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
return objectMapper.readValue(
|
||||||
|
result.stdout(),
|
||||||
|
NetworkTrafficResponse.class
|
||||||
|
);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new IllegalStateException(
|
||||||
|
"Invalid UDP2RAW traffic JSON returned by script",
|
||||||
|
e
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ spring:
|
|||||||
name: vpn-orchestrator
|
name: vpn-orchestrator
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 8080
|
port: ${SERVER_PORT:8080}
|
||||||
|
|
||||||
management:
|
management:
|
||||||
endpoints:
|
endpoints:
|
||||||
@@ -13,16 +13,16 @@ management:
|
|||||||
|
|
||||||
app:
|
app:
|
||||||
security:
|
security:
|
||||||
api-key: dev-api-key
|
api-key: ${LR_API_KEY}
|
||||||
|
|
||||||
vps:
|
vps:
|
||||||
ssh:
|
ssh:
|
||||||
host: 146.59.230.190
|
host: ${LR_VPS_HOST}
|
||||||
port: 22
|
port: ${LR_VPS_PORT:22}
|
||||||
username: lr-vpn
|
username: ${LR_VPS_USERNAME}
|
||||||
password: hidrotek2026
|
password: ${LR_VPS_PASSWORD}
|
||||||
connect-timeout-ms: 10000
|
connect-timeout-ms: ${LR_VPS_CONNECT_TIMEOUT_MS:10000}
|
||||||
command-timeout-ms: 15000
|
command-timeout-ms: ${LR_VPS_COMMAND_TIMEOUT_MS:15000}
|
||||||
|
|
||||||
lr:
|
lr:
|
||||||
login:
|
login:
|
||||||
|
|||||||
Reference in New Issue
Block a user