161 lines
4.0 KiB
PHP
161 lines
4.0 KiB
PHP
<?php
|
|
require_once "protecao.php";
|
|
|
|
/* =========================
|
|
CONTROLO DA VPN
|
|
========================= */
|
|
|
|
$outputVPN = null;
|
|
|
|
if (isset($_GET['vpn'])) {
|
|
$allowed = ['md','al','nl','de','ch','status'];
|
|
$cmd = $_GET['vpn'];
|
|
|
|
if (in_array($cmd, $allowed)) {
|
|
// IP do LXC NordVPN (104)
|
|
$vpnHost = "192.168.10.104";
|
|
$vpnUser = "root";
|
|
|
|
$sshCmd = "/usr/bin/ssh -i /var/www/.ssh/nordvpn "
|
|
. "-o BatchMode=yes -o StrictHostKeyChecking=no "
|
|
. "{$vpnUser}@{$vpnHost} "
|
|
. escapeshellarg($cmd)
|
|
. " 2>&1";
|
|
|
|
$outputVPN = shell_exec($sshCmd);
|
|
} else {
|
|
$outputVPN = "❌ Comando VPN inválido.";
|
|
}
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="pt">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Menu Principal</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
<style>
|
|
body {
|
|
background-color: #0f0f0f;
|
|
color: #e0e0e0;
|
|
font-family: 'Segoe UI', sans-serif;
|
|
}
|
|
|
|
h2, h4 {
|
|
color: #00ffc8;
|
|
text-shadow: 0 0 6px #00ffc8;
|
|
}
|
|
|
|
.btn {
|
|
border-width: 2px;
|
|
font-weight: 600;
|
|
padding: 8px 14px;
|
|
font-size: 0.9rem;
|
|
transition: all 0.15s ease-in-out;
|
|
}
|
|
|
|
.btn:hover {
|
|
box-shadow: 0 0 8px currentColor;
|
|
}
|
|
|
|
pre {
|
|
background: #000;
|
|
color: #00ff99;
|
|
padding: 12px;
|
|
border-radius: 6px;
|
|
font-size: 0.85rem;
|
|
text-align: left;
|
|
}
|
|
|
|
.container {
|
|
max-width: 720px;
|
|
}
|
|
|
|
footer {
|
|
margin-top: 50px;
|
|
font-size: 0.85rem;
|
|
color: #777;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body class="p-4">
|
|
<div class="container text-center">
|
|
|
|
<h2 class="mb-4">
|
|
Bem-vindo, <?= htmlspecialchars($_SESSION['username']) ?> 😎
|
|
</h2>
|
|
|
|
<!-- MENU PRINCIPAL -->
|
|
<div class="row g-2 mb-5">
|
|
<div class="col-12">
|
|
<a href="../console.php" class="btn btn-outline-light w-100">📊 Estado dos Dispositivos</a>
|
|
</div>
|
|
<div class="col-12">
|
|
<a href="../comandos.php" class="btn btn-outline-light w-100">🛠️ Enviar Comando</a>
|
|
</div>
|
|
<div class="col-12">
|
|
<a href="../historico.php" class="btn btn-outline-light w-100">📜 Ver Histórico</a>
|
|
</div>
|
|
<div class="col-12">
|
|
<a href="config.php" class="btn btn-outline-info w-100">⚙️ Configurações</a>
|
|
</div>
|
|
<div class="col-12">
|
|
<a href="https://web.xupas.mywire.org/matrix_admin.php" target="_blank"
|
|
class="btn btn-outline-success w-100">
|
|
💬 Matrix Admin (Web)
|
|
</a>
|
|
</div>
|
|
<div class="col-12">
|
|
<a href="https://admmatrix.xupas.mywire.org" target="_blank"
|
|
class="btn btn-outline-warning w-100">
|
|
🧠 Synapse Admin (Servidor)
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- CONTROLO DA VPN -->
|
|
<hr class="my-4">
|
|
<h4 class="mb-3">🌍 Controlo da VPN</h4>
|
|
|
|
<div class="row g-2 mb-4">
|
|
<div class="col-12 col-md-6">
|
|
<a href="?vpn=md" class="btn btn-outline-success w-100">🇲🇩 Moldova (YouTube)</a>
|
|
</div>
|
|
<div class="col-12 col-md-6">
|
|
<a href="?vpn=al" class="btn btn-outline-success w-100">🇦🇱 Albania (Ad-free)</a>
|
|
</div>
|
|
<div class="col-12 col-md-6">
|
|
<a href="?vpn=nl" class="btn btn-outline-info w-100">🇳🇱 Netherlands (Torrent)</a>
|
|
</div>
|
|
<div class="col-12 col-md-6">
|
|
<a href="?vpn=de" class="btn btn-outline-info w-100">🇩🇪 Germany (Speed)</a>
|
|
</div>
|
|
<div class="col-12">
|
|
<a href="?vpn=status" class="btn btn-outline-light w-100">📡 Ver Estado VPN</a>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if ($outputVPN): ?>
|
|
<div class="mb-4">
|
|
<pre><?= htmlspecialchars($outputVPN) ?></pre>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<!-- LOGOUT -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<a href="logout.php" class="btn btn-outline-danger w-100">🚪 Terminar Sessão</a>
|
|
</div>
|
|
</div>
|
|
|
|
<footer class="text-center mt-5">
|
|
<p>© <?= date('Y') ?> Xupas Systems | Todos os direitos reservados</p>
|
|
</footer>
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|
|
|