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
@@ -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 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
|
||||
|
||||
# ===== 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 action=drop comment="guest so usa hotspot"
|
||||
|
||||
# ===== 6. WALLED GARDEN (fontes do portal antes do login) =====
|
||||
/ip hotspot walled-garden remove [find dst-host="fonts.googleapis.com"]
|
||||
/ip hotspot walled-garden add dst-host=fonts.googleapis.com action=accept comment="fontes portal"
|
||||
/ip hotspot walled-garden remove [find dst-host="fonts.gstatic.com"]
|
||||
/ip hotspot walled-garden add dst-host=fonts.gstatic.com action=accept comment="fontes portal"
|
||||
# ===== 6. WALLED GARDEN (portal antes do login) =====
|
||||
# Portal publico (Cloudflare) - necessario para o convidado abrir o portal
|
||||
# antes de autenticar. As faixas cobrem os IPs anycast usados pelo dominio.
|
||||
/ip hotspot walled-garden ip
|
||||
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) =====
|
||||
/ip hotspot user remove [find where comment~"pix"]
|
||||
|
||||
Reference in new issue
Block a user