feat(hotspot): login page redireciona para o portal INCTG e login por voucher no portal
build-image / build-push (push) Successful in 8m51s
build-image / build-push (push) Successful in 8m51s
This commit is contained in:
1 parent
a8c513dc2c
commit
8fab1e2ab6
3 files changed
+87
-11
No files matched your search
@@ -484,6 +484,21 @@
|
|||||||
<div class="skel"></div><div class="skel"></div><div class="skel"></div>
|
<div class="skel"></div><div class="skel"></div><div class="skel"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="card" style="margin-top:14px">
|
||||||
|
<button class="btn btn-ghost" id="showLogin" type="button">Já tenho usuário e senha</button>
|
||||||
|
<div id="loginBox" class="hidden" style="margin-top:14px">
|
||||||
|
<label class="field">
|
||||||
|
<span>Usuário</span>
|
||||||
|
<input id="hsUser" type="text" autocomplete="username" autocapitalize="off" placeholder="Ex.: GAB12CD">
|
||||||
|
</label>
|
||||||
|
<label class="field">
|
||||||
|
<span>Senha</span>
|
||||||
|
<input id="hsPass" type="password" autocomplete="current-password" placeholder="Sua senha">
|
||||||
|
</label>
|
||||||
|
<button class="btn btn-primary" id="hsConnect" type="button">Conectar ao Wi-Fi</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- ===== DADOS DO PAGADOR ===== -->
|
<!-- ===== DADOS DO PAGADOR ===== -->
|
||||||
@@ -562,13 +577,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol class="steps">
|
<ol class="steps">
|
||||||
<li>Volte às configurações de Wi-Fi do celular</li>
|
<li>Toque no botão <strong>Conectar agora</strong> abaixo</li>
|
||||||
<li>Conecte em <strong>Convidados-Pix</strong> (se ainda não estiver)</li>
|
<li>Se pedir, conecte em <strong>Convidados-Pix</strong></li>
|
||||||
<li>Abra qualquer site para exibir o login</li>
|
<li>Pronto: seu acesso já estará liberado</li>
|
||||||
<li>Digite o usuário e a senha acima</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<button class="btn btn-success" id="copyVoucher" type="button" style="margin-top:14px">Copiar usuário e senha</button>
|
<button class="btn btn-success" id="hsAutoLogin" type="button" style="margin-top:14px">Conectar agora</button>
|
||||||
|
<button class="btn btn-ghost" id="copyVoucher" type="button" style="margin-top:10px">Copiar usuário e senha</button>
|
||||||
<a class="back" href="#" id="backBtn2">← Voltar aos planos</a>
|
<a class="back" href="#" id="backBtn2">← Voltar aos planos</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -755,6 +770,28 @@
|
|||||||
$('payerNext').addEventListener('click', () => checkout(selectedPlanId));
|
$('payerNext').addEventListener('click', () => checkout(selectedPlanId));
|
||||||
$('payerCpf').addEventListener('input', (e) => { e.target.value = maskCpf(e.target.value); });
|
$('payerCpf').addEventListener('input', (e) => { e.target.value = maskCpf(e.target.value); });
|
||||||
|
|
||||||
|
// ===== Login no hotspot (voucher) =====
|
||||||
|
const HS_LOGIN = 'http://10.10.10.1/login';
|
||||||
|
|
||||||
|
function hsUrl(user, pass) {
|
||||||
|
return HS_LOGIN + '?username=' + encodeURIComponent(user) + '&password=' + encodeURIComponent(pass);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('showLogin').addEventListener('click', () => {
|
||||||
|
$('loginBox').classList.toggle('hidden');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('hsConnect').addEventListener('click', () => {
|
||||||
|
const u = $('hsUser').value.trim();
|
||||||
|
const p = $('hsPass').value;
|
||||||
|
if (!u || !p) { toast('Informe usuário e senha'); return; }
|
||||||
|
window.location.href = hsUrl(u, p);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('hsAutoLogin').addEventListener('click', () => {
|
||||||
|
window.location.href = hsUrl($('vUser').textContent, $('vPass').textContent);
|
||||||
|
});
|
||||||
|
|
||||||
loadPlans();
|
loadPlans();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="pt-BR">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>INCTG Wi-Fi</title>
|
||||||
|
<meta http-equiv="refresh" content="0;url=https://hotspot.jf.eng.br/?mac=$(mac)">
|
||||||
|
<style>
|
||||||
|
body{margin:0;background:#101820;color:#F4F6F8;font-family:Inter,system-ui,-apple-system,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh}
|
||||||
|
.b{text-align:center;padding:24px}
|
||||||
|
.l{width:72px;height:72px;border-radius:50%;background:rgba(36,107,253,.15);display:flex;align-items:center;justify-content:center;margin:0 auto 18px}
|
||||||
|
.s{width:28px;height:28px;border:3px solid #246BFD;border-top-color:transparent;border-radius:50%;animation:r 1s linear infinite}
|
||||||
|
@keyframes r{to{transform:rotate(360deg)}}
|
||||||
|
strong{font-size:17px;letter-spacing:-.01em}
|
||||||
|
p{color:#7C8A9A;font-size:14px;margin:8px 0 0}
|
||||||
|
a{color:#246BFD;text-decoration:none;font-weight:600}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="b">
|
||||||
|
<div class="l"><div class="s"></div></div>
|
||||||
|
<strong>Abrindo o portal INCTG...</strong>
|
||||||
|
<p>Se nao abrir, <a href="https://hotspot.jf.eng.br/?mac=$(mac)">toque aqui</a></p>
|
||||||
|
</div>
|
||||||
|
<script>window.location.replace('https://hotspot.jf.eng.br/?mac=$(mac)');</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
/ip pool add name=guest-pool ranges=($guestIP . "10-")($guestIP . "50")
|
/ip pool add name=guest-pool ranges=($guestIP . "10-")($guestIP . "50")
|
||||||
/ip pool set [find name=guest-pool] ranges=("10.10.10.10-10.10.10.50")
|
/ip pool set [find name=guest-pool] ranges=("10.10.10.10-10.10.10.50")
|
||||||
|
|
||||||
/ip hotspot profile add name=hs-guest hotspot-interface=bridge-guest html-directory=hotspot login-by=http-chap dns-name="" comment="perfil hotspot convidados"
|
/ip hotspot profile add name=hs-guest hotspot-interface=bridge-guest html-directory=hotspot login-by=cookie,http-chap,http-pap dns-name="" comment="perfil hotspot convidados"
|
||||||
/ip hotspot add name=guest-hotspot interface=bridge-guest address-pool=guest-pool profile=hs-guest lease-time=1h disabled=no
|
/ip hotspot add name=guest-hotspot interface=bridge-guest address-pool=guest-pool profile=hs-guest lease-time=1h disabled=no
|
||||||
|
|
||||||
# ===== 3. PERFIS DE PLANO (nomes devem bater com o backend) =====
|
# ===== 3. PERFIS DE PLANO (nomes devem bater com o backend) =====
|
||||||
@@ -56,11 +56,23 @@ add chain=forward src-address=$guestSubnet dst-address=172.16.0.0/12 action=drop
|
|||||||
add chain=input src-address=$guestSubnet dst-address=$guestIP action=drop comment="guest nao gerencia o MikroTik"
|
add chain=input src-address=$guestSubnet dst-address=$guestIP action=drop comment="guest nao gerencia o MikroTik"
|
||||||
add chain=input src-address=$guestSubnet action=drop comment="guest so usa hotspot"
|
add chain=input src-address=$guestSubnet action=drop comment="guest so usa hotspot"
|
||||||
|
|
||||||
# ===== 6. WALLED GARDEN (fontes do portal antes do login) =====
|
# ===== 6. WALLED GARDEN (portal antes do login) =====
|
||||||
/ip hotspot walled-garden remove [find dst-host="fonts.googleapis.com"]
|
# Portal publico (Cloudflare) - necessario para o convidado abrir o portal
|
||||||
/ip hotspot walled-garden add dst-host=fonts.googleapis.com action=accept comment="fontes portal"
|
# antes de autenticar. As faixas cobrem os IPs anycast usados pelo dominio.
|
||||||
/ip hotspot walled-garden remove [find dst-host="fonts.gstatic.com"]
|
/ip hotspot walled-garden ip
|
||||||
/ip hotspot walled-garden add dst-host=fonts.gstatic.com action=accept comment="fontes portal"
|
add dst-address=104.16.0.0/13 dst-port=443 protocol=tcp action=accept comment="pix-portal-cloudflare"
|
||||||
|
add dst-address=172.64.0.0/13 dst-port=443 protocol=tcp action=accept comment="pix-portal-cloudflare"
|
||||||
|
|
||||||
|
# Portal local (fallback, caso use o backend direto na LAN)
|
||||||
|
/ip hotspot walled-garden ip
|
||||||
|
add dst-address=192.168.3.100 dst-port=3000 protocol=tcp action=accept comment="pix: portal pagamento"
|
||||||
|
|
||||||
|
# ===== 6.1 PAGINA DE LOGIN CUSTOMIZADA =====
|
||||||
|
# Substituir hotspot/login.html e hotspot/alogin.html pelo arquivo
|
||||||
|
# mikrotik/hotspot-login.html (redireciona para o portal INCTG).
|
||||||
|
# Via FTP:
|
||||||
|
# curl -T hotspot-login.html ftp://USER:[email protected]/hotspot/login.html
|
||||||
|
# curl -T hotspot-login.html ftp://USER:[email protected]/hotspot/alogin.html
|
||||||
|
|
||||||
# ===== 7. LIMPA HOTSPOT ANTIGO (se houver) =====
|
# ===== 7. LIMPA HOTSPOT ANTIGO (se houver) =====
|
||||||
/ip hotspot user remove [find where comment~"pix"]
|
/ip hotspot user remove [find where comment~"pix"]
|
||||||
|
|||||||
Reference in new issue
Block a user