diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5f00b8f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +.git +.gitignore +__pycache__ +*.py[cod] +*.db +*.sqlite +*.sqlite3 +README.md +docker-compose.yml +up.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a70d4c --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +__pycache__/ +*.py[cod] +*.db +*.sqlite +*.sqlite3 +.DS_Store diff --git a/Dockerfile b/Dockerfile index 5b50d09..8dfbcec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,15 +6,15 @@ ENV DEBIAN_FRONTEND=noninteractive \ # Apache2 + NetworkManager embarqué + outils Wi-Fi + Python RUN apt-get update \ && apt full-upgrade -y && apt-get install -y --no-install-recommends \ - apache2 nano python3 tzdata \ + ca-certificates apache2 nano python3 python3-cryptography tzdata \ network-manager wpasupplicant dbus \ iw iproute2 rfkill wireless-regdb \ dnsmasq-base iptables nftables procps kmod tcpdump \ wireguard-tools openvpn ebtables curl conntrack \ - && a2enmod proxy proxy_http headers \ + && a2enmod proxy proxy_http headers setenvif remoteip rewrite \ + && a2disconf other-vhosts-access-log 2>/dev/null || true \ && ln -sf /dev/stdout /var/log/apache2/access.log \ && ln -sf /dev/stderr /var/log/apache2/error.log \ - && ln -sf /dev/stdout /var/log/apache2/other_vhosts_access.log \ && rm -rf /var/lib/apt/lists/* # Vos fichiers @@ -24,9 +24,14 @@ COPY ap.py /app/ap.py ARG HTML_FILE=index.html COPY ${HTML_FILE} /app/index.html COPY ${HTML_FILE} /var/www/html/index.html -COPY favicon.png /var/www/html/favicon.png +COPY setup.html /app/setup.html +COPY setup.html /var/www/html/setup.html +COPY images/ /app/images/ +COPY images/ /var/www/html/images/ +COPY lang/ /app/lang/ +COPY lang/ /var/www/html/lang/ # L'API n'est plus joignable que via Apache : le HTML appelle /api sur le même port (1001) -RUN sed -i 's#const API_URL=[^;]*;#const API_URL="";#' /app/index.html /var/www/html/index.html +RUN sed -i 's#const API_URL=[^;]*;#const API_URL="";#' /app/index.html /var/www/html/index.html /app/setup.html /var/www/html/setup.html 2>/dev/null || true COPY apache-ap.conf /etc/apache2/sites-available/000-default.conf COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh && rm -f /var/www/html/index.html.orig \ diff --git a/ap.py b/ap.py index 237511c..62d2022 100644 --- a/ap.py +++ b/ap.py @@ -1,9 +1,13 @@ #!/usr/bin/env python3 -import base64, hashlib, hmac, json, os, re, secrets, socket, sqlite3, subprocess, threading, time, urllib.parse, urllib.request, urllib.error, socketserver, shutil, datetime, atexit, signal, struct, smtplib, ssl, ipaddress, queue, http.client +import base64, hashlib, hmac, json, os, re, secrets, socket, sqlite3, subprocess, threading, time, urllib.parse, urllib.request, urllib.error, socketserver, shutil, datetime, atexit, signal, struct, smtplib, ssl, ipaddress, queue, http.client, io, zipfile, tempfile from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer +for p in ['/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin']: + if p not in os.environ.get('PATH', '').split(':'): + os.environ['PATH'] = p + ':' + os.environ.get('PATH', '') + INTERFACE = os.environ.get('AP_INTERFACE', 'wls16b1') SOCKET_PATH = os.environ.get('AP_SOCKET', '/run/ap-api.sock') BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -41,7 +45,9 @@ AP_BAND = os.environ.get('AP_BAND', 'bg') if os.environ.get('AP_BAND', 'bg') in try: AP_CHANNEL = int(os.environ.get('AP_CHANNEL', '6')) except ValueError: AP_CHANNEL = 6 -APP_VERSION = 'V1.9' +APP_VERSION = 'V5.5' +SERVER_BOOT_TIME = time.time() +app_startup_done = False SESSION_TTL = 30 * 86400 # 30 jours (1 mois) sessions = {} last_macs = set() @@ -80,77 +86,197 @@ def lease_entries(): except (OSError, UnicodeError): continue return entries +_device_name_cache = {} # mac -> (name, timestamp) +_journal_dhcp_cache = {'time': 0, 'entries': {}} + +def get_journal_dhcp_entries(): + now = time.time() + if now - _journal_dhcp_cache['time'] < 15: + return _journal_dhcp_cache['entries'] + entries = {} + try: + journal = command('journalctl', '-u', 'NetworkManager', '--no-pager', '-n', '200', timeout=1) + pattern = r'DHCPACK\([^)]*\)\s+(\S+)\s+([0-9a-f:]{17})\s+(\S+)' + for line in reversed(journal.splitlines()): + m = re.search(pattern, line, re.I) + if m: + j_mac = m.group(2).upper() + j_host = m.group(3).strip() + if j_host and j_host != '*' and j_mac not in entries: + entries[j_mac] = j_host + except Exception: + pass + _journal_dhcp_cache['time'] = now + _journal_dhcp_cache['entries'] = entries + return entries + def device_name(ip, mac): mac = (mac or '').upper() + now = time.time() + if mac and mac in _device_name_cache: + c_name, c_time = _device_name_cache[mac] + if now - c_time < 30: + return c_name + + # 1. Base de données client_names (nom personnalisé ou précédemment appris) + if mac: + try: + c = db(); row = c.execute('SELECT name FROM client_names WHERE mac=?', (mac,)).fetchone(); c.close() + if row and row[0] and not row[0].startswith('Client ') and row[0] != 'Nom non communiqué': + _device_name_cache[mac] = (row[0], now) + return row[0] + except sqlite3.Error: pass + + # 2. Baux DHCP dnsmasq try: is_bridge = is_bridge_mode() except Exception: is_bridge = False if not is_bridge: for l_mac, l_ip, l_host in reversed(lease_entries()): if l_mac == mac or (ip and l_ip == ip): - if l_host and l_host != '*': return l_host.strip() - try: - journal = command('journalctl','-u','NetworkManager','--no-pager','-n','500') - pattern = r'DHCPACK\([^)]*\)\s+(\S+)\s+([0-9a-f:]{17})\s+(\S+)' - for line in reversed(journal.splitlines()): - match = re.search(pattern, line, re.I) - if match and (match.group(1) == ip or match.group(2).upper() == mac): - hostname = match.group(3).strip() - if hostname and hostname != '*': return hostname - except Exception: pass + if l_host and l_host != '*': + name = l_host.strip() + _device_name_cache[mac] = (name, now) + return name + # 3. Journal DHCP NetworkManager (avec cache et timeout 1s) + dhcp_entries = get_journal_dhcp_entries() + if mac in dhcp_entries: + name = dhcp_entries[mac] + _device_name_cache[mac] = (name, now) + return name + + # 4. Table des voisins ARP (ip neigh) if ip and ip not in ('Non attribuée', '—') and not (is_bridge and ip.startswith('10.42.')): - try: - name = socket.gethostbyaddr(ip)[0] - if name and name != ip: return name.split('.')[0] - except (socket.herror, socket.gaierror, OSError): pass - host_line = command('ip','neigh','show',ip) + host_line = command('ip', 'neigh', 'show', ip, timeout=1) match = re.search(r'\(([^)]+)\)', host_line) - if match and match.group(1) != ip: return match.group(1) - try: - c = db(); row = c.execute('SELECT name FROM client_names WHERE mac=?', (mac,)).fetchone(); c.close() - if row and row[0]: return row[0] - except sqlite3.Error: pass - return 'Client ' + mac.replace(':', '')[-4:] if mac else 'Nom non communiqué' + if match and match.group(1) != ip: + name = match.group(1) + _device_name_cache[mac] = (name, now) + return name + + # 5. Nom en base même si générique + if mac: + try: + c = db(); row = c.execute('SELECT name FROM client_names WHERE mac=?', (mac,)).fetchone(); c.close() + if row and row[0]: + _device_name_cache[mac] = (row[0], now) + return row[0] + except sqlite3.Error: pass + + fallback = 'Client ' + mac.replace(':', '')[-4:] if mac else 'Nom non communiqué' + if mac: + _device_name_cache[mac] = (fallback, now) + return fallback # __AUTHENTICATION_IMPLEMENTATION__ -def db(): - folder = os.path.dirname(DB_FILE) - if folder: os.makedirs(folder, exist_ok=True) - c = sqlite3.connect(DB_FILE) - c.execute('CREATE TABLE IF NOT EXISTS auth_users (username TEXT PRIMARY KEY, password_hash TEXT NOT NULL)') - columns = {row[1] for row in c.execute('PRAGMA table_info(auth_users)').fetchall()} - if 'totp_secret' not in columns: - c.execute('ALTER TABLE auth_users ADD COLUMN totp_secret TEXT DEFAULT NULL') - c.commit() - recovery_table(c) - c.execute('CREATE TABLE IF NOT EXISTS connection_logs(id INTEGER PRIMARY KEY,event_time TEXT,event TEXT,name TEXT,ip TEXT,mac TEXT)') - c.execute('CREATE TABLE IF NOT EXISTS blocked_clients(mac TEXT PRIMARY KEY,blocked_at TEXT)') - c.execute('CREATE TABLE IF NOT EXISTS client_names(mac TEXT PRIMARY KEY,name TEXT NOT NULL,last_ip TEXT,last_seen TEXT)') - c.execute('CREATE TABLE IF NOT EXISTS client_traffic(mac TEXT PRIMARY KEY, rx_bytes INTEGER DEFAULT 0, tx_bytes INTEGER DEFAULT 0, last_updated TEXT)') - c.execute('CREATE TABLE IF NOT EXISTS client_traffic_daily(mac TEXT, traffic_date TEXT, rx_bytes INTEGER DEFAULT 0, tx_bytes INTEGER DEFAULT 0, PRIMARY KEY(mac, traffic_date))') - c.execute('CREATE INDEX IF NOT EXISTS idx_client_traffic_daily_date ON client_traffic_daily(traffic_date)') - try: - cnt_daily = c.execute("SELECT COUNT(*) FROM client_traffic_daily").fetchone()[0] - if cnt_daily == 0: - today_str = time.strftime('%Y-%m-%d') - c.execute(''' - INSERT OR IGNORE INTO client_traffic_daily(mac, traffic_date, rx_bytes, tx_bytes) - SELECT mac, COALESCE(SUBSTR(last_updated, 1, 10), ?), rx_bytes, tx_bytes - FROM client_traffic - WHERE rx_bytes > 0 OR tx_bytes > 0 - ''', (today_str,)) - c.commit() - except Exception: pass - c.execute('CREATE TABLE IF NOT EXISTS preferences(key TEXT PRIMARY KEY, value TEXT NOT NULL)') - c.execute('CREATE TABLE IF NOT EXISTS geoip_cache (ip TEXT PRIMARY KEY, code TEXT, country TEXT, flag TEXT, created_at REAL)') - c.execute('CREATE TABLE IF NOT EXISTS vpn_profiles (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, type TEXT NOT NULL, config_content TEXT NOT NULL, auth_user TEXT DEFAULT "", auth_pass TEXT DEFAULT "", table_id INTEGER DEFAULT 101, iface TEXT DEFAULT "", auto_connect INTEGER DEFAULT 0, status TEXT DEFAULT "disconnected", last_error TEXT DEFAULT "", created_at TEXT DEFAULT "", updated_at TEXT DEFAULT "")') - c.execute('CREATE TABLE IF NOT EXISTS client_vpn_routes (mac TEXT PRIMARY KEY, profile_id INTEGER DEFAULT 0, kill_switch INTEGER DEFAULT 0, updated_at TEXT DEFAULT "")') - c.execute('CREATE TABLE IF NOT EXISTS auth_sessions(token TEXT PRIMARY KEY, username TEXT, expires REAL, ip TEXT DEFAULT "", ua TEXT DEFAULT "", device_name TEXT DEFAULT "", os_name TEXT DEFAULT "", created_at TEXT DEFAULT "", last_seen TEXT DEFAULT "")') - session_cols = {row[1] for row in c.execute('PRAGMA table_info(auth_sessions)').fetchall()} - for col in ('ip', 'ua', 'device_name', 'os_name', 'browser_name', 'created_at', 'last_seen'): - if col not in session_cols: - try: c.execute(f'ALTER TABLE auth_sessions ADD COLUMN {col} TEXT DEFAULT ""') +_db_initialized = False +_db_init_lock = threading.Lock() + +def init_db(): + global _db_initialized + with _db_init_lock: + if _db_initialized: + return + folder = os.path.dirname(DB_FILE) + if folder: os.makedirs(folder, exist_ok=True) + c = sqlite3.connect(DB_FILE, timeout=30.0) + try: + c.execute('PRAGMA journal_mode = WAL') + c.execute('PRAGMA synchronous = NORMAL') + c.execute('PRAGMA busy_timeout = 30000') + c.execute('CREATE TABLE IF NOT EXISTS auth_users (username TEXT PRIMARY KEY, password_hash TEXT NOT NULL)') + columns = {row[1] for row in c.execute('PRAGMA table_info(auth_users)').fetchall()} + if 'totp_secret' not in columns: + c.execute('ALTER TABLE auth_users ADD COLUMN totp_secret TEXT DEFAULT NULL') + c.commit() + recovery_table(c) + c.execute('CREATE TABLE IF NOT EXISTS connection_logs(id INTEGER PRIMARY KEY,event_time TEXT,event TEXT,name TEXT,ip TEXT,mac TEXT)') + c.execute('CREATE TABLE IF NOT EXISTS blocked_clients(mac TEXT PRIMARY KEY,blocked_at TEXT)') + c.execute('CREATE TABLE IF NOT EXISTS client_names(mac TEXT PRIMARY KEY,name TEXT NOT NULL,last_ip TEXT,last_seen TEXT,device_type TEXT DEFAULT "")') + cn_cols = {row[1] for row in c.execute('PRAGMA table_info(client_names)').fetchall()} + if 'device_type' not in cn_cols: + try: + c.execute('ALTER TABLE client_names ADD COLUMN device_type TEXT DEFAULT ""') + c.commit() + except Exception: pass + c.execute('CREATE TABLE IF NOT EXISTS client_traffic(mac TEXT PRIMARY KEY, rx_bytes INTEGER DEFAULT 0, tx_bytes INTEGER DEFAULT 0, last_updated TEXT)') + c.execute('CREATE TABLE IF NOT EXISTS client_traffic_daily(mac TEXT, traffic_date TEXT, rx_bytes INTEGER DEFAULT 0, tx_bytes INTEGER DEFAULT 0, PRIMARY KEY(mac, traffic_date))') + c.execute('CREATE INDEX IF NOT EXISTS idx_client_traffic_daily_date ON client_traffic_daily(traffic_date)') + try: + cnt_daily = c.execute("SELECT COUNT(*) FROM client_traffic_daily").fetchone()[0] + if cnt_daily == 0: + today_str = time.strftime('%Y-%m-%d') + c.execute(''' + INSERT OR IGNORE INTO client_traffic_daily(mac, traffic_date, rx_bytes, tx_bytes) + SELECT mac, COALESCE(SUBSTR(last_updated, 1, 10), ?), rx_bytes, tx_bytes + FROM client_traffic + WHERE rx_bytes > 0 OR tx_bytes > 0 + ''', (today_str,)) + c.commit() except Exception: pass - c.commit(); return c + c.execute('CREATE TABLE IF NOT EXISTS preferences(key TEXT PRIMARY KEY, value TEXT NOT NULL)') + c.execute('CREATE TABLE IF NOT EXISTS geoip_cache (ip TEXT PRIMARY KEY, code TEXT, country TEXT, flag TEXT, created_at REAL)') + c.execute('CREATE TABLE IF NOT EXISTS vpn_profiles (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, type TEXT NOT NULL, config_content TEXT NOT NULL, auth_user TEXT DEFAULT "", auth_pass TEXT DEFAULT "", table_id INTEGER DEFAULT 101, iface TEXT DEFAULT "", auto_connect INTEGER DEFAULT 0, status TEXT DEFAULT "disconnected", last_error TEXT DEFAULT "", created_at TEXT DEFAULT "", updated_at TEXT DEFAULT "")') + c.execute('CREATE TABLE IF NOT EXISTS client_vpn_routes (mac TEXT PRIMARY KEY, profile_id INTEGER DEFAULT 0, kill_switch INTEGER DEFAULT 0, updated_at TEXT DEFAULT "")') + c.execute('CREATE TABLE IF NOT EXISTS auth_sessions(token TEXT PRIMARY KEY, username TEXT, expires REAL, ip TEXT DEFAULT "", ua TEXT DEFAULT "", device_name TEXT DEFAULT "", os_name TEXT DEFAULT "", created_at TEXT DEFAULT "", last_seen TEXT DEFAULT "")') + session_cols = {row[1] for row in c.execute('PRAGMA table_info(auth_sessions)').fetchall()} + for col in ('ip', 'ua', 'device_name', 'os_name', 'browser_name', 'created_at', 'last_seen'): + if col not in session_cols: + try: c.execute(f'ALTER TABLE auth_sessions ADD COLUMN {col} TEXT DEFAULT ""') + except Exception: pass + c.execute('CREATE TABLE IF NOT EXISTS auth_passkeys(id TEXT PRIMARY KEY, username TEXT NOT NULL, public_key TEXT NOT NULL, name TEXT NOT NULL, device_type TEXT DEFAULT "security_key", sign_count INTEGER DEFAULT 0, created_at TEXT DEFAULT "", last_used_at TEXT DEFAULT "")') + c.execute(''' + CREATE TABLE IF NOT EXISTS client_limits ( + mac TEXT PRIMARY KEY, + quota_enabled INTEGER DEFAULT 0, + quota_bytes INTEGER DEFAULT 0, + quota_period TEXT DEFAULT 'total', + bandwidth_enabled INTEGER DEFAULT 0, + rate_down_kbps INTEGER DEFAULT 0, + rate_up_kbps INTEGER DEFAULT 0, + quota_action TEXT DEFAULT 'block', + updated_at TEXT DEFAULT '' + ) + ''') + init_device_types_table(c) + c.commit() + _db_initialized = True + finally: + c.close() + +def db(): + if not _db_initialized: + init_db() + c = sqlite3.connect(DB_FILE, timeout=30.0) + c.execute('PRAGMA busy_timeout = 30000') + return c + +def init_device_types_table(c): + c.execute(''' + CREATE TABLE IF NOT EXISTS custom_device_types( + id TEXT PRIMARY KEY, + label TEXT NOT NULL, + icon TEXT NOT NULL, + desc TEXT DEFAULT "", + sort_order INTEGER DEFAULT 0 + ) + ''') + try: + count = c.execute('SELECT COUNT(*) FROM custom_device_types').fetchone()[0] + if count == 0: + defaults = [ + ('phone', 'Smartphone', '📱', 'iPhone, Android, Galaxy...', 1), + ('tablet', 'Tablette', 'tablet_svg', 'iPad, Galaxy Tab, Kindle...', 2), + ('laptop', 'PC Portable', '💻', 'MacBook, ThinkPad, Laptop...', 3), + ('desktop', 'Ordinateur fixe', '🖥️', 'PC Bureau, Mac Pro, Tour...', 4), + ('tv', 'Smart TV / Box', '📺', 'Apple TV, Chromecast, Box...', 5), + ('console', 'Console de jeux', '🎮', 'PlayStation, Switch, Xbox...', 6), + ('iot', 'Objet connecté', '📟', 'IoT, Caméra, Domotique, RPi...', 7), + ('generic', 'Standard / Autre', '💻', 'Appareil générique / inconnu', 8) + ] + c.executemany('INSERT INTO custom_device_types(id, label, icon, desc, sort_order) VALUES(?,?,?,?,?)', defaults) + c.commit() + except Exception as e: + print(f"[ap-error] Erreur init_device_types_table: {e}", flush=True) def password_hash(value, salt=None): @@ -181,12 +307,26 @@ def totp_ok(secret, code): def auth_state(): c = db(); row = c.execute('SELECT username,totp_secret FROM auth_users LIMIT 1').fetchone() + has_pk = bool(c.execute('SELECT 1 FROM auth_passkeys LIMIT 1').fetchone()) rows = dict(c.execute("SELECT key,value FROM preferences").fetchall()); c.close() + conn = connection_name() if callable(globals().get('connection_name')) else '' + eth_list = detect_ethernet_interfaces() if callable(globals().get('detect_ethernet_interfaces')) else [] + admin_ok = bool(row) + wifi_ok = bool(conn) return { - 'configured': bool(row), + 'configured': admin_ok, + 'admin_configured': admin_ok, + 'wifi_configured': wifi_ok, + 'setup_completed': admin_ok and wifi_ok, 'two_factor': bool(row and row[1]), + 'has_passkeys': has_pk, + 'ethernet_interfaces': eth_list, 'app_name': rows.get('app_name', 'Administration de l’AP Wi‑Fi'), - 'app_short_name': rows.get('app_short_name', 'AP Manageur') + 'app_short_name': rows.get('app_short_name', 'AP Manageur'), + 'language': rows.get('language', 'fr'), + 'is_starting': not app_startup_done, + 'boot_time': SERVER_BOOT_TIME, + 'username': row[0] if row else 'admin' } RECOVERY_COUNT = 8 @@ -224,6 +364,145 @@ def second_factor_ok(secret, code): return totp_ok(secret, code) or recovery_use(code) +# ============================================================================== +# WEBAUTHN / PASSKEYS HELPER FUNCTIONS +# ============================================================================== +passkey_pending_challenges = {} + +P256_P = 0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF +P256_A = P256_P - 3 +P256_B = 0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B +P256_GX = 0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296 +P256_GY = 0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5 +P256_N = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551 + +def _ec_inv(k, m): return pow(k, m - 2, m) +def _ec_point_add(p1, p2): + if p1 is None: return p2 + if p2 is None: return p1 + x1, y1 = p1; x2, y2 = p2 + if x1 == x2: + if (y1 + y2) % P256_P == 0: return None + l = (3 * x1 * x1 + P256_A) * _ec_inv(2 * y1, P256_P) % P256_P + else: + l = (y2 - y1) * _ec_inv(x2 - x1, P256_P) % P256_P + x3 = (l * l - x1 - x2) % P256_P + y3 = (l * (x1 - x3) - y1) % P256_P + return x3, y3 + +def _ec_point_mul(k, p): + res = None; cur = p + while k > 0: + if k & 1: res = _ec_point_add(res, cur) + cur = _ec_point_add(cur, cur) + k >>= 1 + return res + +def b64url_decode(s): + if isinstance(s, bytes): s = s.decode('ascii') + s = str(s).replace('-', '+').replace('_', '/') + while len(s) % 4: s += '=' + return base64.b64decode(s) + +def b64url_encode(b): + if isinstance(b, str): b = b.encode('utf-8') + return base64.b64encode(b).decode('ascii').replace('+', '-').replace('/', '_').rstrip('=') + +def decode_cbor(data, offset=0): + if offset >= len(data): raise ValueError('Fin de données CBOR inattendue') + b = data[offset]; major = b >> 5; info = b & 0x1f; offset += 1 + if info < 24: val = info + elif info == 24: val = data[offset]; offset += 1 + elif info == 25: val = int.from_bytes(data[offset:offset+2], 'big'); offset += 2 + elif info == 26: val = int.from_bytes(data[offset:offset+4], 'big'); offset += 4 + elif info == 27: val = int.from_bytes(data[offset:offset+8], 'big'); offset += 8 + else: raise ValueError(f'Info CBOR non supportée : {info}') + if major == 0: return val, offset + elif major == 1: return -1 - val, offset + elif major == 2: return data[offset:offset+val], offset+val + elif major == 3: return data[offset:offset+val].decode('utf-8', errors='replace'), offset+val + elif major == 4: + arr = [] + for _ in range(val): item, offset = decode_cbor(data, offset); arr.append(item) + return arr, offset + elif major == 5: + m = {} + for _ in range(val): + k, offset = decode_cbor(data, offset); v, offset = decode_cbor(data, offset); m[k] = v + return m, offset + elif major == 7: + if info == 20: return False, offset + if info == 21: return True, offset + if info == 22: return None, offset + return val, offset + else: raise ValueError(f'Type majeur CBOR non supporté : {major}') + +def parse_der_signature(sig_bytes): + if not sig_bytes or sig_bytes[0] != 0x30: + raise ValueError('Signature DER invalide') + idx = 2 + if sig_bytes[1] & 0x80: + idx += (sig_bytes[1] & 0x7f) + if sig_bytes[idx] != 0x02: + raise ValueError('Entier r invalide dans la signature DER') + r_len = sig_bytes[idx+1] + r = int.from_bytes(sig_bytes[idx+2 : idx+2+r_len], 'big') + idx = idx + 2 + r_len + if sig_bytes[idx] != 0x02: + raise ValueError('Entier s invalide dans la signature DER') + s_len = sig_bytes[idx+1] + s = int.from_bytes(sig_bytes[idx+2 : idx+2+s_len], 'big') + return r, s + +def verify_es256_signature(pub_x_bytes, pub_y_bytes, sig_bytes, signed_data): + try: + from cryptography.hazmat.primitives.asymmetric import ec + from cryptography.hazmat.primitives import hashes + pub_num = ec.EllipticCurvePublicNumbers( + int.from_bytes(pub_x_bytes, 'big'), + int.from_bytes(pub_y_bytes, 'big'), + ec.SECP256R1() + ) + pub_num.public_key().verify(sig_bytes, signed_data, ec.ECDSA(hashes.SHA256())) + return True + except Exception: + pass + try: + r, s = parse_der_signature(sig_bytes) + if not (1 <= r < P256_N and 1 <= s < P256_N): + return False + z = int.from_bytes(hashlib.sha256(signed_data).digest(), 'big') + w = _ec_inv(s, P256_N) + u1 = (z * w) % P256_N + u2 = (r * w) % P256_N + pub_pt = (int.from_bytes(pub_x_bytes, 'big'), int.from_bytes(pub_y_bytes, 'big')) + pt = _ec_point_add(_ec_point_mul(u1, (P256_GX, P256_GY)), _ec_point_mul(u2, pub_pt)) + return pt is not None and (pt[0] % P256_N) == (r % P256_N) + except Exception: + return False + +def verify_rs256_signature(n_bytes, e_bytes, sig_bytes, signed_data): + try: + from cryptography.hazmat.primitives.asymmetric import rsa, padding + from cryptography.hazmat.primitives import hashes + pub_num = rsa.RSAPublicNumbers(int.from_bytes(e_bytes, 'big'), int.from_bytes(n_bytes, 'big')) + pub_num.public_key().verify(sig_bytes, signed_data, padding.PKCS1v15(), hashes.SHA256()) + return True + except Exception: + pass + try: + sig_int = int.from_bytes(sig_bytes, 'big') + e_int = int.from_bytes(e_bytes, 'big') + n_int = int.from_bytes(n_bytes, 'big') + m = pow(sig_int, e_int, n_int) + em = m.to_bytes((n_int.bit_length() + 7) // 8, 'big') + sha = hashlib.sha256(signed_data).digest() + oid = bytes.fromhex('3031300d060960864801650304020105000420') + return em.endswith(oid + sha) + except Exception: + return False + + def create_user(username, password, secret=None): if not re.fullmatch(r'[A-Za-z0-9_.-]{3,32}', username or ''): raise ValueError('Nom utilisateur invalide') if not 8 <= len(password) <= 128: raise ValueError('Le mot de passe doit contenir entre 8 et 128 caractères') @@ -425,8 +704,12 @@ def update_session_activity(token, ip, ua, custom_name=''): c.commit(); c.close() except Exception: pass -def list_sessions(current_token=''): +def list_sessions(current_token='', lang='fr'): now = time.time() + is_en = str(lang or '').lower().startswith('en') + unknown_machine = 'Unknown machine' if is_en else 'Machine inconnue' + unknown_os = 'Unknown' if is_en else 'Inconnu' + default_browser = 'Web Browser' if is_en else 'Navigateur Web' try: c = db() c.execute('DELETE FROM auth_sessions WHERE expires < ?', (now,)) @@ -457,9 +740,9 @@ def list_sessions(current_token=''): 'is_current': is_current, 'username': uname or 'admin', 'ip': ip or '127.0.0.1', - 'device_name': dev_name or 'Machine inconnue', - 'os_name': os_name or 'Inconnu', - 'browser_name': browser_name or 'Navigateur', + 'device_name': dev_name or unknown_machine, + 'os_name': os_name or unknown_os, + 'browser_name': browser_name or default_browser, 'created_at': created_at or '—', 'last_seen': last_seen or created_at or '—' }) @@ -496,14 +779,93 @@ def username(h): s = get_session(token) return s.get('username', '') if s else '' -def command(*args): - try: return subprocess.check_output(args, text=True, stderr=subprocess.DEVNULL).strip() - except (subprocess.CalledProcessError, FileNotFoundError): return '' +def command(*args, timeout=5): + try: return subprocess.check_output(args, text=True, stderr=subprocess.DEVNULL, timeout=timeout).strip() + except (subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError): return '' def read_json(h): return json.loads(h.rfile.read(int(h.headers.get('Content-Length', '0'))) or b'{}') -def request_ip(h): return h.headers.get('X-Real-IP', '').strip() or h.client_address[0] +def clean_ip_str(ip_str): + if not ip_str: return '' + s = ip_str.strip() + if s.startswith('[') and ']' in s: + s = s[1:s.index(']')] + elif ':' in s and s.count(':') == 1: + s = s.split(':')[0] + return s.strip() + +def is_ip_trusted_proxy(ip_str, trusted_list_str, trust_all_private=True): + ip_clean = clean_ip_str(ip_str) + if not ip_clean: return False + try: + ip = ipaddress.ip_address(ip_clean) + except ValueError: + return False + if trust_all_private and (ip.is_private or ip.is_loopback or ip.is_link_local): + return True + for item in (trusted_list_str or '').split(','): + item = item.strip() + if not item: continue + if item == '*': return True + try: + if '/' in item: + if ip in ipaddress.ip_network(item, strict=False): return True + else: + item_clean = clean_ip_str(item) + if ip == ipaddress.ip_address(item_clean): return True + except ValueError: + pass + return False + +def get_reverse_proxy_config(): + try: + c = db() + rows = dict(c.execute("SELECT key, value FROM preferences WHERE key LIKE 'reverse_proxy_%'").fetchall()) + c.close() + except Exception: + rows = {} + return { + 'enabled': rows.get('reverse_proxy_enabled', '1') == '1', + 'header': rows.get('reverse_proxy_header', 'auto').lower(), + 'trusted_proxies': rows.get('reverse_proxy_trusted_proxies', '127.0.0.1, ::1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16'), + 'trust_all_private': rows.get('reverse_proxy_trust_all_private', '1') == '1' + } + +def request_ip(h): + socket_ip = h.client_address[0] if hasattr(h, 'client_address') and h.client_address else '127.0.0.1' + raw_direct = clean_ip_str(h.headers.get('X-Client-Raw-IP', '').strip()) or socket_ip + cfg = get_reverse_proxy_config() + if not cfg['enabled']: + return raw_direct + if not is_ip_trusted_proxy(raw_direct, cfg['trusted_proxies'], cfg['trust_all_private']): + return raw_direct + hdr_pref = cfg['header'] + def get_list(hdr): + val = h.headers.get(hdr, '').strip() + if not val: return [] + return [p.strip() for p in val.split(',') if p.strip()] + if hdr_pref == 'cf-connecting-ip': + candidates = get_list('CF-Connecting-IP') + elif hdr_pref == 'true-client-ip': + candidates = get_list('True-Client-IP') + elif hdr_pref == 'x-real-ip': + candidates = get_list('X-Real-IP') + elif hdr_pref == 'x-forwarded-for': + candidates = get_list('X-Forwarded-For') + else: + candidates = (get_list('CF-Connecting-IP') or + get_list('True-Client-IP') or + get_list('X-Forwarded-For') or + get_list('X-Real-IP')) + for cand in candidates: + cand_clean = clean_ip_str(cand) + try: + val_ip = ipaddress.ip_address(cand_clean) + return str(val_ip) + except ValueError: + continue + return raw_direct def log(event, name='Nom non communiqué', ip='Non attribuée', mac='—'): ts = time.strftime('%Y-%m-%d %H:%M:%S') @@ -542,6 +904,11 @@ MONTHS_SHORT_FR = ['', 'Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Aoû DAYS_FR = ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche'] DAYS_SHORT_FR = ['Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam', 'Dim'] +MONTHS_EN = ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] +MONTHS_SHORT_EN = ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] +DAYS_EN = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] +DAYS_SHORT_EN = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] + station_traffic = {} traffic_lock = threading.Lock() @@ -666,8 +1033,10 @@ def compute_stats_internal(active_items=None): for h in range(24): key = f"{today_str} {h:02d}:00" label = f"{h:02d}h" + label_en = f"{h:02d}:00" full_label = f"Aujourd’hui de {h:02d}h00 à {h:02d}h59" - item = {'period': key, 'hour': h, 'label': label, 'full_label': full_label, 'unique_clients': 0, 'total_connections': 0, 'devices': []} + full_label_en = f"Today from {h:02d}:00 to {h:02d}:59" + item = {'period': key, 'hour': h, 'label': label, 'label_en': label_en, 'full_label': full_label, 'full_label_en': full_label_en, 'unique_clients': 0, 'total_connections': 0, 'devices': []} hours.append(item) hours_map[h] = item @@ -678,8 +1047,10 @@ def compute_stats_internal(active_items=None): d = now - datetime.timedelta(days=i) key = d.strftime('%Y-%m-%d') label = f"{DAYS_SHORT_FR[d.weekday()]} {d.day:02d}/{d.month:02d}" + label_en = f"{DAYS_SHORT_EN[d.weekday()]} {d.month:02d}/{d.day:02d}" full_label = f"{DAYS_FR[d.weekday()]} {d.day:02d} {MONTHS_FR[d.month].lower()} {d.year}" - item = {'period': key, 'label': label, 'full_label': full_label, 'unique_clients': 0, 'total_connections': 0, 'devices': []} + full_label_en = f"{DAYS_EN[d.weekday()]}, {MONTHS_EN[d.month]} {d.day:02d}, {d.year}" + item = {'period': key, 'label': label, 'label_en': label_en, 'full_label': full_label, 'full_label_en': full_label_en, 'unique_clients': 0, 'total_connections': 0, 'devices': []} days.append(item) days_map[key] = item @@ -692,8 +1063,10 @@ def compute_stats_internal(active_items=None): key = mon.strftime('%Y-W%W') week_num = mon.isocalendar()[1] label = f"Sem {week_num}" + label_en = f"Wk {week_num}" full_label = f"Semaine {week_num} (du {mon.day:02d}/{mon.month:02d} au {sun.day:02d}/{sun.month:02d}/{sun.year})" - item = {'period': key, 'start': mon.strftime('%Y-%m-%d'), 'end': sun.strftime('%Y-%m-%d'), 'label': label, 'full_label': full_label, 'unique_clients': 0, 'total_connections': 0, 'devices': []} + full_label_en = f"Week {week_num} (from {mon.month:02d}/{mon.day:02d} to {sun.month:02d}/{sun.day:02d}/{sun.year})" + item = {'period': key, 'start': mon.strftime('%Y-%m-%d'), 'end': sun.strftime('%Y-%m-%d'), 'label': label, 'label_en': label_en, 'full_label': full_label, 'full_label_en': full_label_en, 'unique_clients': 0, 'total_connections': 0, 'devices': []} weeks.append(item) weeks_map[key] = item @@ -708,8 +1081,10 @@ def compute_stats_internal(active_items=None): y -= 1 key = f"{y:04d}-{m:02d}" label = f"{MONTHS_SHORT_FR[m]} {y}" + label_en = f"{MONTHS_SHORT_EN[m]} {y}" full_label = f"{MONTHS_FR[m]} {y}" - item = {'period': key, 'label': label, 'full_label': full_label, 'unique_clients': 0, 'total_connections': 0, 'devices': []} + full_label_en = f"{MONTHS_EN[m]} {y}" + item = {'period': key, 'label': label, 'label_en': label_en, 'full_label': full_label, 'full_label_en': full_label_en, 'unique_clients': 0, 'total_connections': 0, 'devices': []} months.append(item) months_map[key] = item @@ -728,7 +1103,7 @@ def compute_stats_internal(active_items=None): years_map = {} for y in range(min_year, now.year + 1): key = str(y) - item = {'period': key, 'label': key, 'full_label': f"Année {key}", 'unique_clients': 0, 'total_connections': 0, 'devices': []} + item = {'period': key, 'label': key, 'label_en': key, 'full_label': f"Année {key}", 'full_label_en': f"Year {key}", 'unique_clients': 0, 'total_connections': 0, 'devices': []} years.append(item) years_map[key] = item @@ -756,19 +1131,49 @@ def compute_stats_internal(active_items=None): rows = c.execute(''' SELECT l.event_time, + l.event, l.mac, COALESCE(NULLIF(n.name, ''), NULLIF(l.name, ''), 'Client ' || REPLACE(SUBSTR(l.mac, -5), ':', '')) AS display_name FROM connection_logs l LEFT JOIN client_names n ON n.mac = l.mac - WHERE l.event = 'connexion' AND l.mac LIKE '%:%' + WHERE l.event IN ('connexion', 'déconnexion') AND l.mac LIKE '%:%' ORDER BY l.id ASC ''').fetchall() + + # Également récupérer l'historique du trafic journalier stocké en base + try: + traffic_rows = c.execute(''' + SELECT + t.mac, + t.traffic_date, + COALESCE(NULLIF(n.name, ''), 'Client ' || REPLACE(SUBSTR(t.mac, -5), ':', '')) AS display_name, + (COALESCE(t.rx_bytes, 0) + COALESCE(t.tx_bytes, 0)) AS total_bytes + FROM client_traffic_daily t + LEFT JOIN client_names n ON n.mac = t.mac + WHERE (t.rx_bytes > 0 OR t.tx_bytes > 0) + ''').fetchall() + except Exception: + traffic_rows = [] + + # Également récupérer les derniers accès connus dans client_names + try: + cn_rows = c.execute(''' + SELECT mac, name, last_seen FROM client_names + WHERE last_seen IS NOT NULL AND last_seen != '' AND last_seen != '—' + ''').fetchall() + except Exception: + cn_rows = [] + c.close() except Exception as e: rows = [] + traffic_rows = [] + cn_rows = [] print(f"[ap-error] Erreur récupération statistiques: {e}", flush=True) - for et, mac, name in rows: + # 1. Événements de journaux de connexion + today_sessions = {} # mac -> [(dt, event, name)] + for et, ev, mac, name in rows: try: dt = datetime.datetime.strptime(et[:19], '%Y-%m-%d %H:%M:%S') except Exception: @@ -780,57 +1185,133 @@ def compute_stats_internal(active_items=None): m_key = dt.strftime('%Y-%m') y_key = dt.strftime('%Y') + if ev == 'connexion': + if et.startswith(today_str): + today_macs.add(mac) + today_total += 1 + h = dt.hour + if h in hours_map: + hours_map[h]['total_connections'] += 1 + hour_macs[h].add(mac) + hour_devs[h][mac] = name + if et >= cur_week_start: + week_macs_cur.add(mac) + week_total += 1 + if et.startswith(cur_month): + month_macs_cur.add(mac) + month_total += 1 + if et.startswith(cur_year): + year_macs_cur.add(mac) + year_total += 1 + + if d_key in days_map: + days_map[d_key]['total_connections'] += 1 + day_macs[d_key].add(mac) + day_devs[d_key][mac] = name + if w_key in weeks_map: + weeks_map[w_key]['total_connections'] += 1 + week_macs[w_key].add(mac) + week_devs[w_key][mac] = name + if m_key in months_map: + months_map[m_key]['total_connections'] += 1 + month_macs[m_key].add(mac) + month_devs[m_key][mac] = name + if y_key in years_map: + years_map[y_key]['total_connections'] += 1 + year_macs[y_key].add(mac) + year_devs[y_key][mac] = name + if et.startswith(today_str): + today_sessions.setdefault(mac, []).append((dt, ev, name)) + + # Reconstitution des tranches horaires pour aujourd'hui selon la durée de présence + for mac, ev_list in today_sessions.items(): + last_conn_dt = None + dev_name = None + for dt, ev, name in ev_list: + dev_name = name or dev_name + if ev == 'connexion': + if last_conn_dt is not None: + for h in range(last_conn_dt.hour, dt.hour + 1): + if h in hours_map: + hour_macs[h].add(mac) + hour_devs[h][mac] = dev_name + last_conn_dt = dt + elif ev == 'déconnexion': + if last_conn_dt is not None: + for h in range(last_conn_dt.hour, dt.hour + 1): + if h in hours_map: + hour_macs[h].add(mac) + hour_devs[h][mac] = dev_name + last_conn_dt = None + else: + for h in range(0, dt.hour + 1): + if h in hours_map: + hour_macs[h].add(mac) + hour_devs[h][mac] = dev_name + if last_conn_dt is not None: + for h in range(last_conn_dt.hour, min(23, now.hour) + 1): + if h in hours_map: + hour_macs[h].add(mac) + hour_devs[h][mac] = dev_name + + # 2. Intégration du trafic journalier (client_traffic_daily) enregistré en base SQLite + for mac, t_date, name, tot_b in traffic_rows: + try: + dt = datetime.datetime.strptime(t_date[:10], '%Y-%m-%d') + except Exception: + continue + d_key = t_date[:10] + dt_monday = dt.date() - datetime.timedelta(days=dt.weekday()) + w_key = dt_monday.strftime('%Y-W%W') + m_key = dt.strftime('%Y-%m') + y_key = dt.strftime('%Y') + + if d_key == today_str: today_macs.add(mac) - today_total += 1 - h = dt.hour - if h in hours_map: - hours_map[h]['total_connections'] += 1 - hour_macs[h].add(mac) - hour_devs[h][mac] = name - if et >= cur_week_start: + if d_key >= cur_week_start[:10]: week_macs_cur.add(mac) - week_total += 1 - if et.startswith(cur_month): + if d_key.startswith(cur_month): month_macs_cur.add(mac) - month_total += 1 - if et.startswith(cur_year): + if d_key.startswith(cur_year): year_macs_cur.add(mac) - year_total += 1 if d_key in days_map: - days_map[d_key]['total_connections'] += 1 day_macs[d_key].add(mac) day_devs[d_key][mac] = name if w_key in weeks_map: - weeks_map[w_key]['total_connections'] += 1 week_macs[w_key].add(mac) week_devs[w_key][mac] = name if m_key in months_map: - months_map[m_key]['total_connections'] += 1 month_macs[m_key].add(mac) month_devs[m_key][mac] = name if y_key in years_map: - years_map[y_key]['total_connections'] += 1 year_macs[y_key].add(mac) year_devs[y_key][mac] = name - for h, item in hours_map.items(): - item['unique_clients'] = len(hour_macs[h]) - item['devices'] = sorted(list(hour_devs[h].values())) - - for k, item in days_map.items(): - item['unique_clients'] = len(day_macs[k]) - item['devices'] = sorted(list(day_devs[k].values())) - for k, item in weeks_map.items(): - item['unique_clients'] = len(week_macs[k]) - item['devices'] = sorted(list(week_devs[k].values())) - for k, item in months_map.items(): - item['unique_clients'] = len(month_macs[k]) - item['devices'] = sorted(list(month_devs[k].values())) - for k, item in years_map.items(): - item['unique_clients'] = len(year_macs[k]) - item['devices'] = sorted(list(year_devs[k].values())) + # 3. Intégration des derniers accès enregistrés en base SQLite (client_names.last_seen) + for mac, name, last_seen in cn_rows: + ls = str(last_seen).strip() + if len(ls) >= 10: + ls_date = ls[:10] + if ls_date == today_str: + today_macs.add(mac) + try: + ls_h = int(ls[11:13]) + if ls_h in hours_map: + hour_macs[ls_h].add(mac) + hour_devs[ls_h][mac] = name + except Exception: + pass + if ls_date >= cur_week_start[:10]: + week_macs_cur.add(mac) + if ls_date.startswith(cur_month): + month_macs_cur.add(mac) + if ls_date.startswith(cur_year): + year_macs_cur.add(mac) + if ls_date in days_map: + day_macs[ls_date].add(mac) + day_devs[ls_date][mac] = name if active_items is None: try: active_items = clients() @@ -838,17 +1319,56 @@ def compute_stats_internal(active_items=None): active_count = len(active_items) cur_h = now.hour - if cur_h in hours_map and active_items: + if active_items: for x in active_items: m = x.get('mac') - n = x.get('name') + n = x.get('name') or m if m: - hour_macs[cur_h].add(m) - hour_devs[cur_h][m] = n - hours_map[cur_h]['unique_clients'] = len(hour_macs[cur_h]) - if hours_map[cur_h]['total_connections'] < hours_map[cur_h]['unique_clients']: - hours_map[cur_h]['total_connections'] = hours_map[cur_h]['unique_clients'] - hours_map[cur_h]['devices'] = sorted(list(hour_devs[cur_h].values())) + today_macs.add(m) + week_macs_cur.add(m) + month_macs_cur.add(m) + year_macs_cur.add(m) + if cur_h in hours_map: + hour_macs[cur_h].add(m) + hour_devs[cur_h][m] = n + if today_str in days_map: + day_macs[today_str].add(m) + day_devs[today_str][m] = n + + for h, item in hours_map.items(): + item['unique_clients'] = len(hour_macs[h]) + if item['total_connections'] < item['unique_clients']: + item['total_connections'] = item['unique_clients'] + item['devices'] = sorted(list(hour_devs[h].values())) + + for k, item in days_map.items(): + item['unique_clients'] = len(day_macs[k]) + if item['total_connections'] < item['unique_clients']: + item['total_connections'] = item['unique_clients'] + item['devices'] = sorted(list(day_devs[k].values())) + + for k, item in weeks_map.items(): + item['unique_clients'] = len(week_macs[k]) + if item['total_connections'] < item['unique_clients']: + item['total_connections'] = item['unique_clients'] + item['devices'] = sorted(list(week_devs[k].values())) + + for k, item in months_map.items(): + item['unique_clients'] = len(month_macs[k]) + if item['total_connections'] < item['unique_clients']: + item['total_connections'] = item['unique_clients'] + item['devices'] = sorted(list(month_devs[k].values())) + + for k, item in years_map.items(): + item['unique_clients'] = len(year_macs[k]) + if item['total_connections'] < item['unique_clients']: + item['total_connections'] = item['unique_clients'] + item['devices'] = sorted(list(year_devs[k].values())) + + today_total = max(today_total, len(today_macs)) + week_total = max(week_total, len(week_macs_cur)) + month_total = max(month_total, len(month_macs_cur)) + year_total = max(year_total, len(year_macs_cur)) top_clients_by_range = { 'day': get_top_clients(active_items, 'day'), @@ -931,6 +1451,18 @@ def set_pref(key, value): except Exception: pass def current_mode(): + try: + # Pendant l'assistant de configuration initial (setup non terminé), forcer le mode de l'environnement (ap par défaut) + if callable(globals().get('auth_state')): + st = auth_state() + if not st.get('setup_completed'): + return os.environ.get('AP_MODE', 'ap').lower() + except Exception: pass + + # Si l'environnement impose expressément le mode AP + if os.environ.get('AP_MODE', '').lower() == 'ap': + return 'ap' + name = connection_name() if name: slave_type = (command('nmcli','-t','-g','connection.slave-type','connection','show',name) or command('nmcli','-t','-g','connection.port-type','connection','show',name)).lower() @@ -1044,6 +1576,10 @@ DEFAULT_NOTIFICATION_TEMPLATES = { "title": "⚠️ Tunnel VPN déconnecté", "message": "Le profil VPN « {name} » ({type}) a été déconnecté (interface {iface})." }, + "quota_exceeded": { + "title": "⚠️ Quota de données dépassé", + "message": "L'appareil « {name} » ({ip}) a dépassé son quota de {quota} (consommé : {consumption}). L'accès Internet a été coupé." + }, "stats_report": { "title": "📊 Rapport statistiques & métriques Wi‑Fi", "message": "📊 Rapport Wi‑Fi ({date}) :\n• {clients_count} appareil(s) connecté(s) (↓ {traffic_down} • ↑ {traffic_up})\n• Aujourd'hui : {today_unique} visiteur(s) unique(s) ({today_total} sessions)\n• Cette semaine : {week_unique} unique(s) | Ce mois : {month_unique} unique(s)\n• VPN : {active_vpns} tunnel(s) actif(s) ({vpn_routed_clients} appareil(s) routé(s))\n• Passerelle WAN : {gateway_status} ({gateway_ip})\n• Top clients (Consommation de données) :\n{top_clients}" @@ -1119,6 +1655,7 @@ DEFAULT_NOTIFICATIONS_CONFIG = { "vpn_client_disconnected": True, # Déconnexion / Retrait d'un client du VPN "vpn_profile_connected": True, # Connexion d'un profil VPN (tunnel actif) "vpn_profile_disconnected": True, # Déconnexion d'un profil VPN (tunnel coupé) + "quota_exceeded": True, # Quota de données dépassé par un équipement Wi-Fi "stats_report": False # Rapport planifié des statistiques et métriques (Tâche Cron) }, "stats_report_schedule": { @@ -2042,14 +2579,32 @@ def dispatch_notification(event_type, title, message, details=None, priority=5, safe_vars['name'] = safe_vars['profile'] if 'interface' in safe_vars and 'iface' not in safe_vars: safe_vars['iface'] = safe_vars['interface'] + if 'consumption' in safe_vars and 'consommation' not in safe_vars: + safe_vars['consommation'] = safe_vars['consumption'] + if 'consommation' in safe_vars and 'consumption' not in safe_vars: + safe_vars['consumption'] = safe_vars['consommation'] + if 'usage' in safe_vars and 'consommation' not in safe_vars: + safe_vars['consommation'] = safe_vars['usage'] + if 'usage' in safe_vars and 'consumption' not in safe_vars: + safe_vars['consumption'] = safe_vars['usage'] + if 'quota' in safe_vars and 'limite' not in safe_vars: + safe_vars['limite'] = safe_vars['quota'] + if 'limite' in safe_vars and 'quota' not in safe_vars: + safe_vars['quota'] = safe_vars['limite'] def render_tmpl(text): if not text: return "" return re.sub(r'\{([a-zA-Z0-9_]+)\}', lambda m: safe_vars.get(m.group(1).lower(), '{' + m.group(1) + '}'), text) + pref_lang = 'fr' + try: pref_lang = get_pref('language', 'fr') + except Exception: pass final_title = title final_message = message + if pref_lang and pref_lang.startswith('en'): + final_title = translate_api_text(final_title, pref_lang) + final_message = translate_api_text(final_message, pref_lang) templates = cfg.get('templates', {}) tmpl = templates.get(event_type) if isinstance(templates, dict) else None @@ -2190,7 +2745,12 @@ def clean_stale_router_leases(): except Exception: pass def find_bin(name): - return shutil.which(name) or shutil.which(f'/sbin/{name}') or shutil.which(f'/usr/sbin/{name}') or shutil.which(f'/usr/bin/{name}') or name + if not name: return None + for candidate in [name, f'/usr/sbin/{name}', f'/sbin/{name}', f'/usr/local/sbin/{name}', f'/usr/bin/{name}', f'/bin/{name}']: + p = shutil.which(candidate) + if p and os.path.isfile(p) and os.access(p, os.X_OK): + return p + return shutil.which(name) or name def run_cmd(*args): if not args: return None @@ -2208,25 +2768,27 @@ def setup_bridge_dns_redirection(bridge_name='br0', iface=None): if not dns_servers or not iface: return + # Si l'interface Wi-Fi n'est pas active ou pas encore en mode AP, ne rien faire pour préserver l'hôte + if not is_iface_up(iface): + return + st = command('iw', 'dev', iface, 'info') or '' + if 'type AP' not in st: + return + try: - run_cmd('modprobe', 'br_netfilter') - run_cmd('sysctl', '-w', 'net.bridge.bridge-nf-call-iptables=1') - run_cmd('sysctl', '-w', 'net.bridge.bridge-nf-call-ip6tables=0') - run_cmd('sysctl', '-w', 'net.bridge.bridge-nf-call-arptables=0') + # Redirection DNS propre ciblée UNIQUEMENT sur l'interface Wi-Fi via ebtables broute + # Cela détourne uniquement le port 53 des clients Wi-Fi vers la couche IP locale + for proto in ('udp', 'tcp'): + run_cmd('ebtables', '-t', 'broute', '-D', 'BROUTING', '-i', iface, '-p', 'IPv4', '--ip-proto', proto, '--ip-dport', '53', '-j', 'redirect', '--redirect-target', 'DROP') + run_cmd('ebtables', '-t', 'broute', '-A', 'BROUTING', '-i', iface, '-p', 'IPv4', '--ip-proto', proto, '--ip-dport', '53', '-j', 'redirect', '--redirect-target', 'DROP') - # 1. Autoriser le trafic bridgé dans la table filter FORWARD - run_cmd('iptables', '-I', 'FORWARD', '-m', 'physdev', '--physdev-is-bridged', '-j', 'ACCEPT') - if bridge_name: - run_cmd('iptables', '-I', 'FORWARD', '-i', bridge_name, '-o', bridge_name, '-j', 'ACCEPT') - - # 2. Chaîne personnalisée de redirection PREROUTING (DNAT) + # Chaîne personnalisée de redirection PREROUTING (DNAT) pour l'interface Wi-Fi uniquement run_cmd('iptables', '-t', 'nat', '-N', 'AP_BRIDGE_DNS') run_cmd('iptables', '-t', 'nat', '-F', 'AP_BRIDGE_DNS') - # Raccorder les requêtes DNS provenant du Wi-Fi vers AP_BRIDGE_DNS for proto in ('udp', 'tcp'): - run_cmd('iptables', '-t', 'nat', '-D', 'PREROUTING', '-m', 'physdev', '--physdev-in', iface, '-p', proto, '--dport', '53', '-j', 'AP_BRIDGE_DNS') - run_cmd('iptables', '-t', 'nat', '-I', 'PREROUTING', '1', '-m', 'physdev', '--physdev-in', iface, '-p', proto, '--dport', '53', '-j', 'AP_BRIDGE_DNS') + run_cmd('iptables', '-t', 'nat', '-D', 'PREROUTING', '-i', iface, '-p', proto, '--dport', '53', '-j', 'AP_BRIDGE_DNS') + run_cmd('iptables', '-t', 'nat', '-I', 'PREROUTING', '1', '-i', iface, '-p', proto, '--dport', '53', '-j', 'AP_BRIDGE_DNS') # Rediriger vers AP_DNS (avec répartition équitable si plusieurs serveurs) n = len(dns_servers) @@ -2239,18 +2801,6 @@ def setup_bridge_dns_redirection(bridge_name='br0', iface=None): cmd += ['-j', 'DNAT', '--to-destination', f"{s}:53"] run_cmd(*cmd) - # 3. Chaîne POSTROUTING (MASQUERADE) pour garantir le retour des paquets si AP_DNS est sur le LAN (ex: Pi-hole) - run_cmd('iptables', '-t', 'nat', '-N', 'AP_BRIDGE_DNS_POST') - run_cmd('iptables', '-t', 'nat', '-F', 'AP_BRIDGE_DNS_POST') - - for proto in ('udp', 'tcp'): - run_cmd('iptables', '-t', 'nat', '-D', 'POSTROUTING', '-p', proto, '--dport', '53', '-j', 'AP_BRIDGE_DNS_POST') - run_cmd('iptables', '-t', 'nat', '-I', 'POSTROUTING', '1', '-p', proto, '--dport', '53', '-j', 'AP_BRIDGE_DNS_POST') - - for s in dns_servers: - for proto in ('udp', 'tcp'): - run_cmd('iptables', '-t', 'nat', '-A', 'AP_BRIDGE_DNS_POST', '-p', proto, '-d', s, '--dport', '53', '-j', 'MASQUERADE') - print(f"[ap-bridge] Redirection DNS active en mode Pont pour les clients Wi-Fi ({iface}) vers {', '.join(dns_servers)}", flush=True) except Exception as e: print(f"[ap-bridge] Erreur configuration redirection DNS : {e}", flush=True) @@ -2263,9 +2813,11 @@ def teardown_bridge_dns_redirection(bridge_name='br0', iface=None): run_cmd('iptables', '-t', 'nat', '-F', 'AP_BRIDGE_DNS_POST') for proto in ('udp', 'tcp'): if iface: + run_cmd('iptables', '-t', 'nat', '-D', 'PREROUTING', '-i', iface, '-p', proto, '--dport', '53', '-j', 'AP_BRIDGE_DNS') run_cmd('iptables', '-t', 'nat', '-D', 'PREROUTING', '-m', 'physdev', '--physdev-in', iface, '-p', proto, '--dport', '53', '-j', 'AP_BRIDGE_DNS') + run_cmd('iptables', '-t', 'nat', '-D', 'POSTROUTING', '-m', 'physdev', '--physdev-in', iface, '-p', proto, '--dport', '53', '-j', 'AP_BRIDGE_DNS_POST') + run_cmd('ebtables', '-t', 'broute', '-D', 'BROUTING', '-i', iface, '-p', 'IPv4', '--ip-proto', proto, '--ip-dport', '53', '-j', 'redirect', '--redirect-target', 'DROP') run_cmd('iptables', '-t', 'nat', '-D', 'POSTROUTING', '-p', proto, '--dport', '53', '-j', 'AP_BRIDGE_DNS_POST') - run_cmd('sysctl', '-w', 'net.bridge.bridge-nf-call-iptables=0') except Exception: pass @@ -2285,33 +2837,18 @@ def setup_bridge(bridge_name='br0', bridge_eth=None): try: eth_master = os.path.basename(os.readlink(f'/sys/class/net/{bridge_eth}/master')) except OSError: pass - # S'assurer que NetworkManager possède le profil du pont master - nm_conns = command('nmcli', '-t', '-g', 'NAME', 'connection', 'show').splitlines() - if bridge_name not in nm_conns and f"ap-bridge-{bridge_name}" not in nm_conns: - subprocess.run([ - 'nmcli', 'connection', 'add', - 'type', 'bridge', - 'con-name', bridge_name, - 'ifname', bridge_name, - 'bridge.stp', 'no', - 'ipv4.method', 'disabled', - 'ipv6.method', 'disabled' - ], capture_output=True) - try: open(CREATED_BRIDGE_FILE, 'w').write(f"{bridge_name}:{bridge_eth or ''}") - except OSError: pass + bridge_already_existed = os.path.exists(bridge_path) - # Démarrer le pont dans NetworkManager pour qu'il soit prêt à accueillir le slave Wi-Fi - subprocess.run(['nmcli', 'connection', 'up', bridge_name], capture_output=True) - - # Si le pont n'existe pas encore au niveau noyau, le créer - if not os.path.exists(bridge_path): + # Si le pont n'existe pas encore au niveau noyau, le créer directement via iproute2 (sans profil NetworkManager) + if not bridge_already_existed: print(f"[ap-bridge] Création sécurisée du pont noyau {bridge_name}...", flush=True) subprocess.run(['ip', 'link', 'add', 'name', bridge_name, 'type', 'bridge'], capture_output=True) try: open(CREATED_BRIDGE_FILE, 'w').write(f"{bridge_name}:{bridge_eth or ''}") except OSError: pass - # Asservir l'Ethernet physique s'il n'est pas déjà dans le pont - if bridge_eth and os.path.exists(f'/sys/class/net/{bridge_eth}') and eth_master != bridge_name: + # Asservir l'Ethernet physique s'il n'est pas déjà dans le pont et que le pont n'existait pas déjà avec IP + has_bridge_ip = bool(get_iface_ip_info(bridge_name)[0]) + if bridge_eth and os.path.exists(f'/sys/class/net/{bridge_eth}') and eth_master != bridge_name and not has_bridge_ip and not bridge_already_existed: ip_cidr, gw, mac = get_iface_ip_info(bridge_eth) if mac: subprocess.run(['ip', 'link', 'set', 'dev', bridge_name, 'address', mac], capture_output=True) @@ -2329,14 +2866,9 @@ def setup_bridge(bridge_name='br0', bridge_eth=None): try: subprocess.run(['sysctl', '-w', 'net.ipv4.ip_forward=1'], capture_output=True) - subprocess.run(['sysctl', '-w', 'net.ipv4.conf.all.arp_accept=1'], capture_output=True) - subprocess.run(['sysctl', '-w', f'net.ipv4.conf.{bridge_name}.arp_accept=1'], capture_output=True) - for nf in ('bridge-nf-call-iptables', 'bridge-nf-call-ip6tables', 'bridge-nf-call-arptables'): - subprocess.run(['sysctl', '-w', f'net.bridge.{nf}=0'], capture_output=True) except Exception: pass clean_stale_router_leases() subprocess.run(['iptables', '-I', 'FORWARD', '-i', bridge_name, '-o', bridge_name, '-j', 'ACCEPT'], capture_output=True) - subprocess.run(['iptables', '-I', 'FORWARD', '-m', 'physdev', '--physdev-is-bridged', '-j', 'ACCEPT'], capture_output=True) setup_bridge_dns_redirection(bridge_name, INTERFACE) def teardown_bridge(bridge_name='br0', bridge_eth=None): @@ -2360,36 +2892,55 @@ def teardown_bridge(bridge_name='br0', bridge_eth=None): subprocess.run(['nmcli', 'connection', 'down', c], capture_output=True) subprocess.run(['nmcli', 'connection', 'delete', c], capture_output=True) - if not was_created_by_us: - # Pont préexistant sur l'hôte : ne pas le détruire - return + # Détecter si une interface Ethernet physique de l'hôte est asservie à ce pont + slaved_eth = None + eth_candidates = [saved_eth, bridge_eth] + detect_ethernet_interfaces() + for cand in eth_candidates: + if cand and os.path.exists(f'/sys/class/net/{cand}/master'): + try: + master = os.path.basename(os.readlink(f'/sys/class/net/{cand}/master')) + if master == bridge_name: + slaved_eth = cand + break + except OSError: pass - # Supprimer aussi le profil NetworkManager du pont créé par nous - if bridge_name in conns: - subprocess.run(['nmcli', 'connection', 'down', bridge_name], capture_output=True) - subprocess.run(['nmcli', 'connection', 'delete', bridge_name], capture_output=True) + # Ne restaurer et ne détruire le pont QUE si nous l'avons créé nous-mêmes (préserver impérativement la configuration hôte) + if was_created_by_us and os.path.exists(bridge_path): + if slaved_eth: + ip_cidr, gw, _ = get_iface_ip_info(bridge_name) + subprocess.run(['ip', 'link', 'set', 'dev', slaved_eth, 'nomaster'], capture_output=True) + if ip_cidr: + subprocess.run(['ip', 'addr', 'flush', 'dev', bridge_name], capture_output=True) + subprocess.run(['ip', 'addr', 'add', ip_cidr, 'dev', slaved_eth], capture_output=True) + if gw: + subprocess.run(['ip', 'route', 'replace', 'default', 'via', gw, 'dev', slaved_eth], capture_output=True) + print(f"[ap-bridge] IP {ip_cidr} et passerelle {gw} restaurées sur {slaved_eth}.", flush=True) - eth = saved_eth or bridge_eth - if eth and os.path.exists(f'/sys/class/net/{eth}') and os.path.exists(bridge_path): - ip_cidr, gw, _ = get_iface_ip_info(bridge_name) - subprocess.run(['ip', 'link', 'set', 'dev', eth, 'nomaster'], capture_output=True) - if ip_cidr: - subprocess.run(['ip', 'addr', 'flush', 'dev', bridge_name], capture_output=True) - subprocess.run(['ip', 'addr', 'add', ip_cidr, 'dev', eth], capture_output=True) - if gw: - subprocess.run(['ip', 'route', 'replace', 'default', 'via', gw, 'dev', eth], capture_output=True) - print(f"[ap-bridge] IP {ip_cidr} restaurée sur {eth}.", flush=True) - - if os.path.exists(bridge_path): subprocess.run(['ip', 'link', 'set', 'dev', bridge_name, 'down'], capture_output=True) subprocess.run(['ip', 'link', 'delete', 'name', bridge_name, 'type', 'bridge'], capture_output=True) - print(f"[ap-bridge] Pont {bridge_name} nettoyé.", flush=True) + print(f"[ap-bridge] Pont créé {bridge_name} nettoyé et supprimé.", flush=True) try: if os.path.exists(CREATED_BRIDGE_FILE): os.remove(CREATED_BRIDGE_FILE) except OSError: pass -def status(): +_status_cache = {'time': 0, 'data': None} +_status_cache_lock = threading.Lock() + +def invalidate_status_cache(): + with _status_cache_lock: + _status_cache['time'] = 0 + _status_cache['data'] = None + +def status(force_refresh=False): + now = time.time() + with _status_cache_lock: + if not force_refresh and _status_cache['data'] is not None and (now - _status_cache['time'] < 2.0): + cached = dict(_status_cache['data']) + if cached.get('active'): + cached['uptime_seconds'] = ap_uptime() + return cached + name = connection_name(); ssid = command('nmcli','-t','-g','802-11-wireless.ssid','connection','show',name) if name else '' password = command('nmcli','--show-secrets','-t','-g','802-11-wireless-security.psk','connection','show',name) if name else '' key = command('nmcli','-t','-g','802-11-wireless-security.key-mgmt','connection','show',name).lower() if name else '' @@ -2406,7 +2957,11 @@ def status(): mode = current_mode() b_name = master or get_pref('bridge_name', os.environ.get('AP_BRIDGE_NAME', 'br0')) b_eth = get_pref('bridge_eth', os.environ.get('AP_BRIDGE_ETH', '')) - return {'ssid':ssid or 'SSID inconnu','password':password,'security':sec,'autoconnect':auto,'mode':mode,'bridge_name':b_name,'bridge_eth':b_eth,'ethernet_interfaces':detect_ethernet_interfaces(),'interface':INTERFACE,'connection':name,'active':active,'configured':bool(name),'uptime_seconds':ap_uptime() if active else 0,'max_clients':get_max_clients(),'dns':get_dns_servers()} + res = {'ssid':ssid or 'SSID inconnu','password':password,'security':sec,'autoconnect':auto,'mode':mode,'bridge_name':b_name,'bridge_eth':b_eth,'ethernet_interfaces':detect_ethernet_interfaces(),'interface':INTERFACE,'connection':name,'active':active,'configured':bool(name),'uptime_seconds':ap_uptime() if active else 0,'max_clients':get_max_clients(),'dns':get_dns_servers(),'is_starting':not app_startup_done,'boot_time':SERVER_BOOT_TIME} + with _status_cache_lock: + _status_cache['time'] = now + _status_cache['data'] = res + return res def blocked_set(): c = db(); rows = c.execute('SELECT mac FROM blocked_clients').fetchall(); c.close(); return {r[0] for r in rows} @@ -2467,12 +3022,18 @@ def clients(): vpn_routes = {} vpn_profiles = {} + custom_types = {} try: c_vpn = db() for row in c_vpn.execute('SELECT mac, profile_id, kill_switch FROM client_vpn_routes').fetchall(): vpn_routes[row[0].upper()] = {'profile_id': row[1], 'kill_switch': row[2]} for row in c_vpn.execute('SELECT id, name, type, status, iface FROM vpn_profiles').fetchall(): vpn_profiles[row[0]] = {'name': row[1], 'type': row[2], 'status': row[3], 'iface': row[4]} + cn_cols = {r[1] for r in c_vpn.execute('PRAGMA table_info(client_names)').fetchall()} + if 'device_type' in cn_cols: + for row in c_vpn.execute('SELECT mac, COALESCE(device_type, "") FROM client_names').fetchall(): + if row[0] and row[1]: + custom_types[row[0].upper()] = row[1] c_vpn.close() except Exception: pass @@ -2605,6 +3166,7 @@ def clients(): 'name': name, 'ip': ip, 'mac': mac, + 'device_type': custom_types.get(mac) or guess_device_type(name, mac), 'signal_dbm': int(sm.group(1)) if sm else None, 'blocked': blocked, 'connected': not blocked, @@ -2622,7 +3184,8 @@ def clients(): 'lan_isolated': v_is_up, 'vpn_public_ip': v_pub_ip, 'vpn_public_ip_geo': v_pub_geo, - 'kill_switch': vroute['kill_switch'] if vroute else 0 + 'kill_switch': vroute['kill_switch'] if vroute else 0, + 'limits': get_client_limits_dict(mac) }) return output @@ -2656,6 +3219,563 @@ def blocked_list(): c = db(); rows = c.execute('SELECT b.mac,b.blocked_at,n.name FROM blocked_clients b LEFT JOIN client_names n ON n.mac=b.mac ORDER BY b.blocked_at DESC').fetchall(); c.close() return [{'mac':r[0],'blocked_at':r[1],'name':r[2] or 'Client ' + r[0].replace(':', '')[-4:]} for r in rows] +quota_alerted_macs = set() +last_sync_limits_time = 0 +limits_lock = threading.RLock() + +def get_client_traffic_usage(mac, period='total'): + mac = (mac or '').upper() + c = db() + try: + if period == 'daily': + today_str = time.strftime('%Y-%m-%d') + row = c.execute("SELECT rx_bytes + tx_bytes FROM client_traffic_daily WHERE mac=? AND traffic_date=?", (mac, today_str)).fetchone() + return int(row[0]) if row and row[0] is not None else 0 + elif period == 'monthly': + month_prefix = time.strftime('%Y-%m-') + '%' + row = c.execute("SELECT SUM(rx_bytes + tx_bytes) FROM client_traffic_daily WHERE mac=? AND traffic_date LIKE ?", (mac, month_prefix)).fetchone() + return int(row[0]) if row and row[0] is not None else 0 + else: + row = c.execute("SELECT rx_bytes + tx_bytes FROM client_traffic WHERE mac=?", (mac,)).fetchone() + return int(row[0]) if row and row[0] is not None else 0 + except Exception: + return 0 + finally: + c.close() + +def get_client_limits_dict(target_mac=None): + c = db() + try: + has_table = bool(c.execute("SELECT 1 FROM sqlite_master WHERE type='table' AND name='client_limits'").fetchone()) + if not has_table: return None if target_mac else {} + query = "SELECT mac, quota_enabled, quota_bytes, quota_period, bandwidth_enabled, rate_down_kbps, rate_up_kbps, quota_action, updated_at FROM client_limits" + params = () + if target_mac: + query += " WHERE mac=?" + params = (target_mac.upper(),) + rows = c.execute(query, params).fetchall() + res = {} + for r in rows: + m = (r[0] or '').upper() + q_en = bool(r[1]) + q_bytes = int(r[2] or 0) + q_period = r[3] or 'total' + bw_en = bool(r[4]) + r_down = int(r[5] or 0) + r_up = int(r[6] or 0) + usage = get_client_traffic_usage(m, q_period) + exceeded = q_en and q_bytes > 0 and usage >= q_bytes + pct = min(100.0, round((usage / q_bytes) * 100.0, 1)) if (q_bytes > 0) else 0.0 + remaining = max(0, q_bytes - usage) if q_bytes > 0 else 0 + res[m] = { + 'mac': m, + 'quota_enabled': q_en, + 'quota_bytes': q_bytes, + 'quota_bytes_str': format_bytes(q_bytes) if q_bytes > 0 else 'Illimité', + 'quota_period': q_period, + 'quota_period_label': 'Total cumulé' if q_period == 'total' else ('Par mois' if q_period == 'monthly' else 'Par jour'), + 'bandwidth_enabled': bw_en, + 'rate_down_kbps': r_down, + 'rate_up_kbps': r_up, + 'rate_down_str': f"{r_down // 1000} Mbps" if r_down >= 1000 else (f"{r_down} Kbps" if r_down > 0 else 'Illimité'), + 'rate_up_str': f"{r_up // 1000} Mbps" if r_up >= 1000 else (f"{r_up} Kbps" if r_up > 0 else 'Illimité'), + 'usage_bytes': usage, + 'usage_bytes_str': format_bytes(usage), + 'usage_percent': pct, + 'remaining_bytes': remaining, + 'remaining_bytes_str': format_bytes(remaining), + 'quota_exceeded': exceeded, + 'quota_action': r[7] or 'block', + 'updated_at': r[8] or '' + } + return res.get(target_mac.upper()) if target_mac else res + except Exception as e: + print(f"[ap-limits] Erreur get_client_limits_dict: {e}", flush=True) + return None if target_mac else {} + finally: + c.close() + +def save_client_limits(mac, data): + mac = (mac or '').strip().upper() + if not re.fullmatch(r'[0-9A-F]{2}(:[0-9A-F]{2}){5}', mac): + raise ValueError('Adresse MAC invalide') + + quota_enabled = 1 if data.get('quota_enabled') else 0 + try: quota_bytes = max(0, int(data.get('quota_bytes', 0))) + except (ValueError, TypeError): quota_bytes = 0 + quota_period = str(data.get('quota_period', 'total')).strip().lower() + if quota_period not in ('total', 'daily', 'monthly'): quota_period = 'total' + + bandwidth_enabled = 1 if data.get('bandwidth_enabled') else 0 + try: rate_down_kbps = max(0, int(data.get('rate_down_kbps', 0))) + except (ValueError, TypeError): rate_down_kbps = 0 + try: rate_up_kbps = max(0, int(data.get('rate_up_kbps', 0))) + except (ValueError, TypeError): rate_up_kbps = 0 + quota_action = str(data.get('quota_action', 'block')).strip().lower() + + reset_usage = bool(data.get('reset_usage', False)) + now_str = time.strftime('%Y-%m-%d %H:%M:%S') + + c = db() + try: + if reset_usage: + c.execute("UPDATE client_traffic SET rx_bytes=0, tx_bytes=0 WHERE mac=?", (mac,)) + today_str = time.strftime('%Y-%m-%d') + c.execute("UPDATE client_traffic_daily SET rx_bytes=0, tx_bytes=0 WHERE mac=? AND traffic_date=?", (mac, today_str)) + if mac in quota_alerted_macs: + quota_alerted_macs.discard(mac) + + c.execute(''' + INSERT INTO client_limits (mac, quota_enabled, quota_bytes, quota_period, bandwidth_enabled, rate_down_kbps, rate_up_kbps, quota_action, updated_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) + ON CONFLICT(mac) DO UPDATE SET + quota_enabled=excluded.quota_enabled, + quota_bytes=excluded.quota_bytes, + quota_period=excluded.quota_period, + bandwidth_enabled=excluded.bandwidth_enabled, + rate_down_kbps=excluded.rate_down_kbps, + rate_up_kbps=excluded.rate_up_kbps, + quota_action=excluded.quota_action, + updated_at=excluded.updated_at + ''', (mac, quota_enabled, quota_bytes, quota_period, bandwidth_enabled, rate_down_kbps, rate_up_kbps, quota_action, now_str)) + c.commit() + finally: + c.close() + + threading.Thread(target=sync_client_bandwidth_and_quotas, kwargs={'force': True}, daemon=True).start() + return get_client_limits_dict(mac) + +last_applied_limits_state = None + +def sync_client_bandwidth_and_quotas(force=False): + global last_sync_limits_time, last_applied_limits_state + now_ts = time.time() + if not force and now_ts - last_sync_limits_time < 3: + return + last_sync_limits_time = now_ts + + with limits_lock: + try: + c = db() + has_table = bool(c.execute("SELECT 1 FROM sqlite_master WHERE type='table' AND name='client_limits'").fetchone()) + if not has_table: + c.close() + return + + rows = c.execute("SELECT mac, quota_enabled, quota_bytes, quota_period, bandwidth_enabled, rate_down_kbps, rate_up_kbps, quota_action FROM client_limits").fetchall() + c.close() + + limits = {} + for r in rows: + limits[r[0].upper()] = { + 'quota_enabled': bool(r[1]), + 'quota_bytes': int(r[2] or 0), + 'quota_period': r[3] or 'total', + 'bandwidth_enabled': bool(r[4]), + 'rate_down_kbps': int(r[5] or 0), + 'rate_up_kbps': int(r[6] or 0), + 'quota_action': r[7] or 'block' + } + + # 1. Vérifier les quotas dépassés et appareils bloqués + quota_blocked_macs = set() + mac_to_ip = get_all_mac_to_ips() + + for mac, lim in limits.items(): + if lim['quota_enabled'] and lim['quota_bytes'] > 0: + usage = get_client_traffic_usage(mac, lim['quota_period']) + if usage >= lim['quota_bytes']: + quota_blocked_macs.add(mac) + if mac not in quota_alerted_macs: + quota_alerted_macs.add(mac) + name, ip = known_device(mac) + q_str = format_bytes(lim['quota_bytes']) + u_str = format_bytes(usage) + msg = f"L'appareil « {name} » ({ip or mac}) a dépassé son quota de {q_str} (consommé : {u_str}). L'accès Internet a été coupé." + log('quota_depasse', name, ip, mac) + dispatch_notification( + 'quota_exceeded', + "⚠️ Quota de données dépassé", + msg, + details={ + "Nom": name, + "IP": ip or "—", + "MAC": mac, + "Quota": q_str, + "Consommation": u_str, + "Action": "Accès Internet coupé" + }, + priority=5, + level="warning", + vars_dict={ + "name": name, + "nom": name, + "ip": ip or "—", + "mac": mac, + "quota": q_str, + "consumption": u_str, + "consommation": u_str, + "usage": u_str, + "action": "L'accès Internet a été coupé" + } + ) + else: + if mac in quota_alerted_macs: + quota_alerted_macs.discard(mac) + + try: + manually_blocked = blocked_set() + except Exception: + manually_blocked = set() + + all_blocked_macs = set(quota_blocked_macs) | set(manually_blocked) + + active_rate_limits = { + mac: lim for mac, lim in limits.items() + if lim['bandwidth_enabled'] and (lim['rate_down_kbps'] > 0 or lim['rate_up_kbps'] > 0) + } + + # Optimisation majeure : si l'état des blocages et débits n'a pas changé, éviter de relancer les sous-processus système + current_state = ( + frozenset(all_blocked_macs), + frozenset((m, lim['rate_down_kbps'], lim['rate_up_kbps']) for m, lim in active_rate_limits.items()), + tuple(sorted((m, mac_to_ip.get(m, '')) for m in all_blocked_macs | set(active_rate_limits.keys()))) + ) + if not force and last_applied_limits_state == current_state: + return + last_applied_limits_state = current_state + + # 2. Couche 2 Pont Ethernet (L2 Bridge) : nftables family bridge (Priorité -350, avant le broute VPN -300) + nft_bin = find_bin('nft') + if nft_bin: + try: + if all_blocked_macs: + nft_cmds = [ + "add table bridge ap_quota_block", + "flush table bridge ap_quota_block", + "add chain bridge ap_quota_block prerouting { type filter hook prerouting priority -350; policy accept; }", + "add chain bridge ap_quota_block forward { type filter hook forward priority -350; policy accept; }", + # Exemptions fondamentales : ARP et DHCP (IPv4 + IPv6) + "add rule bridge ap_quota_block prerouting ether type arp accept", + "add rule bridge ap_quota_block forward ether type arp accept", + "add rule bridge ap_quota_block prerouting ether type ip udp sport 67-68 udp dport 67-68 accept", + "add rule bridge ap_quota_block forward ether type ip udp sport 67-68 udp dport 67-68 accept", + "add rule bridge ap_quota_block prerouting ether type ip6 udp sport 546-547 udp dport 546-547 accept", + "add rule bridge ap_quota_block forward ether type ip6 udp sport 546-547 udp dport 546-547 accept", + "add rule bridge ap_quota_block prerouting ether type ip6 icmpv6 type { 133, 134, 135, 136 } accept", + "add rule bridge ap_quota_block forward ether type ip6 icmpv6 type { 133, 134, 135, 136 } accept", + ] + for b_mac in all_blocked_macs: + cm = b_mac.strip().lower() + if cm: + nft_cmds.append(f"add rule bridge ap_quota_block prerouting ether saddr {cm} drop") + nft_cmds.append(f"add rule bridge ap_quota_block prerouting ether daddr {cm} drop") + nft_cmds.append(f"add rule bridge ap_quota_block forward ether saddr {cm} drop") + nft_cmds.append(f"add rule bridge ap_quota_block forward ether daddr {cm} drop") + subprocess.run([nft_bin, '-f', '-'], input="\n".join(nft_cmds), text=True, capture_output=True, timeout=5) + else: + subprocess.run([nft_bin, 'delete', 'table', 'bridge', 'ap_quota_block'], capture_output=True, timeout=3) + except Exception as e: + print(f"[ap-limits] Erreur nftables bridge : {e}", flush=True) + + # 3. Couche 2 Pont Ethernet (L2 Bridge) : ebtables (avec --concurrent) + ebtables_bin = find_bin('ebtables') + if ebtables_bin: + try: + subprocess.run([ebtables_bin, '--concurrent', '-t', 'filter', '-N', 'AP_QUOTA_BLOCK'], capture_output=True, timeout=5) + subprocess.run([ebtables_bin, '--concurrent', '-t', 'filter', '-F', 'AP_QUOTA_BLOCK'], capture_output=True, timeout=5) + subprocess.run([ebtables_bin, '--concurrent', '-t', 'filter', '-D', 'FORWARD', '-j', 'AP_QUOTA_BLOCK'], capture_output=True, timeout=5) + subprocess.run([ebtables_bin, '--concurrent', '-t', 'filter', '-D', 'INPUT', '-j', 'AP_QUOTA_BLOCK'], capture_output=True, timeout=5) + if all_blocked_macs: + subprocess.run([ebtables_bin, '--concurrent', '-t', 'filter', '-I', 'FORWARD', '1', '-j', 'AP_QUOTA_BLOCK'], capture_output=True, timeout=5) + subprocess.run([ebtables_bin, '--concurrent', '-t', 'filter', '-I', 'INPUT', '1', '-j', 'AP_QUOTA_BLOCK'], capture_output=True, timeout=5) + subprocess.run([ebtables_bin, '--concurrent', '-t', 'filter', '-A', 'AP_QUOTA_BLOCK', '-p', 'ARP', '-j', 'ACCEPT'], capture_output=True, timeout=5) + subprocess.run([ebtables_bin, '--concurrent', '-t', 'filter', '-A', 'AP_QUOTA_BLOCK', '-p', 'IPv4', '--ip-proto', 'udp', '--ip-dport', '67:68', '-j', 'ACCEPT'], capture_output=True, timeout=5) + subprocess.run([ebtables_bin, '--concurrent', '-t', 'filter', '-A', 'AP_QUOTA_BLOCK', '-p', 'IPv4', '--ip-proto', 'udp', '--ip-sport', '67:68', '-j', 'ACCEPT'], capture_output=True, timeout=5) + for b_mac in all_blocked_macs: + cm = b_mac.strip().lower() + if cm: + subprocess.run([ebtables_bin, '--concurrent', '-t', 'filter', '-A', 'AP_QUOTA_BLOCK', '-s', cm, '-j', 'DROP'], capture_output=True, timeout=5) + subprocess.run([ebtables_bin, '--concurrent', '-t', 'filter', '-A', 'AP_QUOTA_BLOCK', '-d', cm, '-j', 'DROP'], capture_output=True, timeout=5) + except Exception as e: + print(f"[ap-limits] Erreur ebtables : {e}", flush=True) + + # 4. Couche 3 (IPv4 & IPv6) : iptables et ip6tables (filter & mangle avec verrou -w 5 et test -C) + iptables_bin = find_bin('iptables') + ip6tables_bin = find_bin('ip6tables') + for bin_cmd, is_v6 in [(iptables_bin, False), (ip6tables_bin, True)]: + if not bin_cmd: continue + try: + for tbl, chain in [('filter', 'FORWARD'), ('filter', 'INPUT'), ('mangle', 'PREROUTING')]: + # Créer et vider la chaîne + subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-N', 'AP_QUOTA_BLOCK'], capture_output=True, timeout=5) + subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-F', 'AP_QUOTA_BLOCK'], capture_output=True, timeout=5) + + # Vérifier si la règle de saut existe + check_r = subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-C', chain, '-j', 'AP_QUOTA_BLOCK'], capture_output=True, timeout=5) + has_jump = (check_r.returncode == 0) + + if all_blocked_macs: + if not has_jump: + subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-I', chain, '1', '-j', 'AP_QUOTA_BLOCK'], capture_output=True, timeout=5) + else: + if has_jump: + subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-D', chain, '-j', 'AP_QUOTA_BLOCK'], capture_output=True, timeout=5) + + if all_blocked_macs: + if not is_v6: + for tbl in ['filter', 'mangle']: + subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-A', 'AP_QUOTA_BLOCK', '-p', 'udp', '--dport', '67:68', '-j', 'RETURN'], capture_output=True, timeout=5) + subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-A', 'AP_QUOTA_BLOCK', '-p', 'udp', '--sport', '67:68', '-j', 'RETURN'], capture_output=True, timeout=5) + else: + for tbl in ['filter', 'mangle']: + subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-A', 'AP_QUOTA_BLOCK', '-p', 'udp', '--dport', '546:547', '-j', 'RETURN'], capture_output=True, timeout=5) + subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-A', 'AP_QUOTA_BLOCK', '-p', 'udp', '--sport', '546:547', '-j', 'RETURN'], capture_output=True, timeout=5) + subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-A', 'AP_QUOTA_BLOCK', '-p', 'ipv6-icmp', '-j', 'RETURN'], capture_output=True, timeout=5) + + for b_mac in all_blocked_macs: + cm = b_mac.strip().lower() + if cm: + for tbl in ['filter', 'mangle']: + subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-A', 'AP_QUOTA_BLOCK', '-m', 'mac', '--mac-source', cm, '-j', 'DROP'], capture_output=True, timeout=5) + if not is_v6: + ip = mac_to_ip.get(b_mac) + if ip and ip not in ('Non attribuée', '—'): + for tbl in ['filter', 'mangle']: + subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-A', 'AP_QUOTA_BLOCK', '-s', ip, '-j', 'DROP'], capture_output=True, timeout=5) + subprocess.run([bin_cmd, '-w', '5', '-t', tbl, '-A', 'AP_QUOTA_BLOCK', '-d', ip, '-j', 'DROP'], capture_output=True, timeout=5) + except Exception as e: + print(f"[ap-limits] Erreur iptables/ip6tables ({bin_cmd}) : {e}", flush=True) + + # 5. Maintenir le filtrage isolé pour ne pas impacter la résolution de l'hôte + if all_blocked_macs: + try: + subprocess.run(['sysctl', '-w', 'net.bridge.bridge-nf-call-iptables=0'], capture_output=True, timeout=3) + subprocess.run(['sysctl', '-w', 'net.bridge.bridge-nf-call-ip6tables=0'], capture_output=True, timeout=3) + except Exception: pass + + # 6. Limitation de bande passante & Drop direct avec Traffic Control (tc) + tc_bin = find_bin('tc') + target_iface = INTERFACE + if tc_bin and target_iface: + try: + subprocess.run([tc_bin, 'qdisc', 'del', 'dev', target_iface, 'root'], capture_output=True, timeout=3) + subprocess.run([tc_bin, 'qdisc', 'del', 'dev', target_iface, 'ingress'], capture_output=True, timeout=3) + except Exception: pass + + if active_rate_limits or all_blocked_macs: + subprocess.run([tc_bin, 'qdisc', 'add', 'dev', target_iface, 'root', 'handle', '1:', 'htb', 'default', '999'], capture_output=True, timeout=3) + subprocess.run([tc_bin, 'class', 'add', 'dev', target_iface, 'parent', '1:', 'classid', '1:999', 'htb', 'rate', '1000mbit', 'ceil', '1000mbit'], capture_output=True, timeout=3) + subprocess.run([tc_bin, 'qdisc', 'add', 'dev', target_iface, 'handle', 'ffff:', 'ingress'], capture_output=True, timeout=3) + + # Pour chaque client bloqué : drop immédiat en TC (ingress et egress) + for b_mac in all_blocked_macs: + b_ip = mac_to_ip.get(b_mac) + if b_ip and b_ip not in ('Non attribuée', '—'): + subprocess.run([ + tc_bin, 'filter', 'add', 'dev', target_iface, 'parent', 'ffff:', 'protocol', 'ip', 'prio', '1', + 'u32', 'match', 'ip', 'src', b_ip, 'action', 'drop' + ], capture_output=True, timeout=3) + subprocess.run([ + tc_bin, 'filter', 'add', 'dev', target_iface, 'parent', '1:', 'protocol', 'ip', 'prio', '1', + 'u32', 'match', 'ip', 'dst', b_ip, 'action', 'drop' + ], capture_output=True, timeout=3) + + cls_idx = 10 + for mac, lim in active_rate_limits.items(): + if mac in all_blocked_macs: + continue + ip = mac_to_ip.get(mac) + if not ip or ip in ('Non attribuée', '—'): + continue + + if lim['rate_down_kbps'] > 0: + rate_str = f"{lim['rate_down_kbps']}kbit" + class_id = f"1:{cls_idx}" + subprocess.run([tc_bin, 'class', 'add', 'dev', target_iface, 'parent', '1:', 'classid', class_id, 'htb', 'rate', rate_str, 'ceil', rate_str], capture_output=True, timeout=3) + subprocess.run([tc_bin, 'filter', 'add', 'dev', target_iface, 'protocol', 'ip', 'parent', '1:', 'prio', '2', 'u32', 'match', 'ip', 'dst', ip, 'flowid', class_id], capture_output=True, timeout=3) + cls_idx += 1 + + if lim['rate_up_kbps'] > 0: + rate_str = f"{lim['rate_up_kbps']}kbit" + burst_str = f"{max(32, lim['rate_up_kbps'] // 8)}k" + subprocess.run([ + tc_bin, 'filter', 'add', 'dev', target_iface, 'parent', 'ffff:', 'protocol', 'ip', 'prio', '2', + 'u32', 'match', 'ip', 'src', ip, + 'police', 'rate', rate_str, 'burst', burst_str, 'drop', 'flowid', ':1' + ], capture_output=True, timeout=3) + + # 7. Conntrack flush : coupe immédiatement les flux et téléchargements en cours + conntrack_bin = find_bin('conntrack') + if conntrack_bin and all_blocked_macs: + for b_mac in all_blocked_macs: + b_ip = mac_to_ip.get(b_mac) + if b_ip and b_ip not in ('Non attribuée', '—'): + subprocess.run([conntrack_bin, '-D', '-s', b_ip], capture_output=True, timeout=3) + subprocess.run([conntrack_bin, '-D', '-d', b_ip], capture_output=True, timeout=3) + except Exception as e: + print(f"[ap-limits] Erreur synchronisation quotas & débits : {e}", flush=True) + except Exception as e: + print(f"[ap-limits] Erreur synchronisation quotas & débits : {e}", flush=True) + except Exception as e: + print(f"[ap-limits] Erreur synchronisation quotas & débits : {e}", flush=True) + +def all_devices(lang='fr'): + """Récupère l'ensemble des équipements qui se sont déjà connectés au réseau depuis la base de données SQLite.""" + is_en = str(lang or '').lower().startswith('en') + c = db() + names_dict = {} + cn_cols = {row[1] for row in c.execute('PRAGMA table_info(client_names)').fetchall()} + has_dev_type = 'device_type' in cn_cols + query = 'SELECT mac, name, last_ip, last_seen, COALESCE(device_type, "") FROM client_names' if has_dev_type else 'SELECT mac, name, last_ip, last_seen, "" FROM client_names' + for r in c.execute(query).fetchall(): + m = (r[0] or '').upper() + if m: + names_dict[m] = { + 'name': r[1] or '', + 'last_ip': r[2] or '', + 'last_seen': r[3] or '', + 'device_type': r[4] or '' + } + + logs_dict = {} + try: + rows = c.execute(''' + SELECT mac, MIN(event_time), MAX(event_time), + (SELECT name FROM connection_logs WHERE mac = l.mac AND name != '' AND name != 'Nom non communiqué' ORDER BY id DESC LIMIT 1), + (SELECT ip FROM connection_logs WHERE mac = l.mac AND ip != '' AND ip != 'Non attribuée' ORDER BY id DESC LIMIT 1) + FROM connection_logs l + WHERE mac LIKE '%:%' + GROUP BY mac + ''').fetchall() + for r in rows: + m = (r[0] or '').upper() + if m: + logs_dict[m] = { + 'first_seen': r[1] or '', + 'last_seen': r[2] or '', + 'name': r[3] or '', + 'last_ip': r[4] or '' + } + except Exception: pass + + blocked_dict = {} + try: + for r in c.execute('SELECT mac, blocked_at FROM blocked_clients').fetchall(): + m = (r[0] or '').upper() + if m: blocked_dict[m] = r[1] or '' + except Exception: pass + + vpn_routes = {} + try: + p_dict = dict(c.execute('SELECT id, name FROM vpn_profiles').fetchall()) + for r in c.execute('SELECT mac, profile_id FROM client_vpn_routes WHERE profile_id > 0').fetchall(): + m = (r[0] or '').upper() + if m: vpn_routes[m] = {'profile_id': r[1], 'profile_name': p_dict.get(r[1], 'VPN')} + except Exception: pass + + traffic_dict = {} + try: + for r in c.execute('SELECT mac, rx_bytes, tx_bytes FROM client_traffic').fetchall(): + m = (r[0] or '').upper() + if m: + rx = r[1] or 0 + tx = r[2] or 0 + traffic_dict[m] = {'rx': rx, 'tx': tx, 'total': rx + tx} + except Exception: pass + + c.close() + limits_dict = get_client_limits_dict() or {} + + live_clients = {} + try: + for cl in clients(): + m = (cl.get('mac') or '').upper() + if m: live_clients[m] = cl + except Exception: pass + + all_macs = sorted(set(names_dict.keys()) | set(logs_dict.keys()) | set(blocked_dict.keys()) | set(live_clients.keys()) | set(limits_dict.keys())) + + devices = [] + for mac in all_macs: + live = live_clients.get(mac) + is_conn = live is not None + is_block = mac in blocked_dict + + nd = names_dict.get(mac, {}) + ld = logs_dict.get(mac, {}) + td = traffic_dict.get(mac, {'rx': 0, 'tx': 0, 'total': 0}) + vd = vpn_routes.get(mac) + + name = '' + if live and live.get('name') and live['name'] not in ('Nom non communiqué', 'Inconnu'): + name = live['name'] + if not name and nd.get('name') and nd['name'] not in ('Nom non communiqué', 'Inconnu'): + name = nd['name'] + if not name and ld.get('name'): + name = ld['name'] + if not name: + name = 'Client ' + mac.replace(':', '')[-4:] + + ip = '' + if live and live.get('ip') and live['ip'] not in ('Non attribuée', '—'): + ip = live['ip'] + if not ip and nd.get('last_ip') and nd['last_ip'] not in ('Non attribuée', '—'): + ip = nd['last_ip'] + if not ip and ld.get('last_ip') and ld['last_ip'] not in ('Non attribuée', '—'): + ip = ld['last_ip'] + if not ip: + ip = 'Non attribuée' + + first_seen = ld.get('first_seen') or nd.get('last_seen') or '—' + last_seen = nd.get('last_seen') or ld.get('last_seen') or '—' + online_label = 'Currently online' if is_en else 'Actuellement en ligne' + unknown_label = 'Unknown' if is_en else 'Inconnue' + last_seen_str = online_label if is_conn else (last_seen if last_seen != '—' else unknown_label) + + custom_type = nd.get('device_type') or (live.get('device_type') if live else '') + dev_type = custom_type if custom_type else guess_device_type(name, mac) + + devices.append({ + 'mac': mac, + 'name': name, + 'ip': ip, + 'connected': is_conn, + 'status': 'connected' if is_conn else 'offline', + 'blocked': is_block, + 'blocked_at': blocked_dict.get(mac, ''), + 'first_seen': first_seen, + 'last_seen': last_seen, + 'last_seen_display': last_seen_str, + 'device_type': dev_type, + 'signal_dbm': live.get('signal_dbm') if live else None, + 'download_speed_str': live.get('download_speed_str', '') if live else '', + 'upload_speed_str': live.get('upload_speed_str', '') if live else '', + 'traffic_total_str': format_bytes(td['total']) if td['total'] > 0 else '0 o', + 'traffic_total_bytes': td['total'], + 'vpn_profile_name': vd['profile_name'] if vd else '', + 'limits': limits_dict.get(mac, None) + }) + + def _dev_sort(d): + conn_rank = 0 if d['connected'] else 1 + ts = 0 + ls = d.get('last_seen') or '' + if re.match(r'^\d{4}-\d{2}-\d{2}', ls): + try: ts = time.mktime(time.strptime(ls, '%Y-%m-%d %H:%M:%S')) + except Exception: pass + return (conn_rank, -ts, d['name'].lower()) + + devices.sort(key=_dev_sort) + + return { + 'devices': devices, + 'total': len(devices), + 'connected_count': sum(1 for d in devices if d['connected']), + 'offline_count': sum(1 for d in devices if not d['connected']), + 'blocked_count': sum(1 for d in devices if d['blocked']) + } + def get_default_gateway(): try: res = command('ip', 'route', 'show', 'default') @@ -2746,7 +3866,7 @@ def compute_topology_internal(active_items=None, active_status=None): total_tx_rate = 0 for c in cl: - c['device_type'] = guess_device_type(c.get('name', ''), c.get('mac', '')) + c['device_type'] = c.get('device_type') or guess_device_type(c.get('name', ''), c.get('mac', '')) sig = c.get('signal_dbm') if sig is None: c['signal_rating'] = 'Inconnu' @@ -2813,6 +3933,7 @@ def compute_topology_internal(active_items=None, active_status=None): 'ip': ap_net.get('ip') or ('10.42.0.1' if st.get('mode') == 'nat' else 'IP Pont LAN'), 'cidr': ap_net.get('cidr') or '24', 'mode': 'NAT (Routeur Wi-Fi)' if st.get('mode') == 'nat' else 'Pont réseau (Bridge)', + 'mode_key': 'nat' if st.get('mode') == 'nat' else 'bridge', 'channel': wifi_radio.get('channel') or 6, 'frequency_mhz': wifi_radio.get('freq_mhz') or 2437, 'band': '5 GHz' if (wifi_radio.get('freq_mhz') or 0) > 4000 else '2.4 GHz', @@ -3346,6 +4467,7 @@ def configure_ap(data, initial=False, caller_ip=None): if r.returncode: raise RuntimeError(r.stderr.strip() or 'Impossible de démarrer le point d’accès') mark_ap_started() + invalidate_status_cache() log('création' if initial else 'enregistrement_modifie', f"Réseau Wi-Fi {ssid} ({'Mode Pont' if mode == 'bridge' else 'Mode AP'})", ip=caller_ip or 'Non attribuée', mac='AP') dispatch_notification('settings_changed', "⚙️ Modification réglages Wi-Fi / AP", f"Les réglages du point d'accès Wi-Fi ont été modifiés.", details={"SSID": ssid, "Mode": "Mode Pont" if mode == 'bridge' else "Mode AP", "Sécurité": sec.upper(), "Date": time.strftime('%d/%m/%Y %H:%M:%S')}, priority=5, level="warning") return name @@ -4024,11 +5146,11 @@ def capture_worker(iface): entry['last_client_ip'] = client_ip if client_name: entry['last_client_name'] = client_name - if len(capture_packets) > 2000: - del capture_packets[:200] - if len(capture_pcap_bytes) > 20 * 1024 * 1024: + if len(capture_packets) > 50000: + del capture_packets[:500] + if len(capture_pcap_bytes) > 50 * 1024 * 1024: header = capture_pcap_bytes[:24] - capture_pcap_bytes = header + capture_pcap_bytes[5 * 1024 * 1024:] + capture_pcap_bytes = header + capture_pcap_bytes[10 * 1024 * 1024:] except socket.timeout: continue except Exception: @@ -4046,7 +5168,9 @@ VPN_DIR_WG = '/etc/wireguard' VPN_DIR_OVPN = '/etc/openvpn' VPN_RUN_DIR = '/run/ap-vpn' VPN_SCRIPT_DIR = '/run/ap-vpn/scripts' -vpn_lock = threading.Lock() +vpn_lock = threading.RLock() +connecting_vpn_pids = set() +connecting_vpn_pids_lock = threading.RLock() def ensure_vpn_dirs(): for d in (VPN_DIR_WG, VPN_DIR_OVPN, VPN_RUN_DIR, VPN_SCRIPT_DIR): @@ -4069,11 +5193,16 @@ def is_iface_up(iface): if not iface: return False p = f'/sys/class/net/{iface}' if not os.path.exists(p): return False + try: + with open(f'{p}/flags', 'r') as f: + flags = int(f.read().strip(), 16) + return bool(flags & 1) # IFF_UP + except Exception: pass try: with open(f'{p}/operstate', 'r') as f: - state = f.read().strip().lower() - return state in ('up', 'unknown') - except OSError: return True + return f.read().strip().lower() == 'up' + except Exception: pass + return False def read_iface_traffic(iface): rx, tx = 0, 0 @@ -4119,7 +5248,7 @@ def read_iface_traffic(iface): def get_wireguard_handshake_info(iface): if not iface or not iface.startswith('wg_'): - return None + return None, None try: res = subprocess.run(['wg', 'show', iface, 'latest-handshakes'], capture_output=True, text=True, timeout=2) if res.returncode == 0 and res.stdout.strip(): @@ -4130,16 +5259,16 @@ def get_wireguard_handshake_info(iface): if ts > 0: diff = max(0, int(time.time()) - ts) if diff < 120: - return f"Handshake actif (il y a {diff}s)" + return f"Handshake actif (il y a {diff}s)", diff elif diff < 3600: - return f"Dernier handshake il y a {diff // 60} min" + return f"Dernier handshake il y a {diff // 60} min", diff else: - return f"Dernier handshake il y a {diff // 3600} h" + return f"Dernier handshake il y a {diff // 3600} h", diff else: - return "En attente du handshake (non reçu)" + return "En attente du handshake (non reçu)", -1 except Exception: pass - return None + return None, None vpn_public_ip_cache = {} @@ -4152,36 +5281,36 @@ def get_vpn_public_ip(iface, force_refresh=False): return cached.get('ip', '') detected_ip = '' - # 1. Requête via curl --interface - urls = [ - 'https://api.ipify.org', - 'https://icanhazip.com', - 'https://ifconfig.me/ip', - 'https://ipinfo.io/ip' - ] - for url in urls: - try: - res = subprocess.run(['curl', '-4', '-s', '--interface', iface, '--max-time', '3', url], - capture_output=True, text=True, timeout=4) - if res.returncode == 0: - ip_match = re.search(r'\b(?:\d{1,3}\.){3}\d{1,3}\b', res.stdout) - if ip_match: - detected_ip = ip_match.group(0).strip() - break - except Exception: - pass + # 1. Requête Cloudflare directe sans résolution DNS (ultra-rapide < 250ms) + try: + res = subprocess.run(['curl', '-4', '-s', '-k', '--interface', iface, '--max-time', '2', 'https://1.1.1.1/cdn-cgi/trace'], + capture_output=True, text=True, timeout=3) + if res.returncode == 0: + m = re.search(r'^ip=([0-9.]+)', res.stdout, re.M) + if m: + detected_ip = m.group(1).strip() + except Exception: + pass - # 2. Requête Cloudflare directe sans résolution DNS + # 2. Requête alternative via les fournisseurs IP publics usuels if not detected_ip: - try: - res = subprocess.run(['curl', '-4', '-s', '-k', '--interface', iface, '--max-time', '3', 'https://1.1.1.1/cdn-cgi/trace'], - capture_output=True, text=True, timeout=4) - if res.returncode == 0: - m = re.search(r'^ip=([0-9.]+)', res.stdout, re.M) - if m: - detected_ip = m.group(1).strip() - except Exception: - pass + urls = [ + 'https://api.ipify.org', + 'https://icanhazip.com', + 'https://ifconfig.me/ip', + 'https://ipinfo.io/ip' + ] + for url in urls: + try: + res = subprocess.run(['curl', '-4', '-s', '--interface', iface, '--max-time', '2', url], + capture_output=True, text=True, timeout=3) + if res.returncode == 0: + ip_match = re.search(r'\b(?:\d{1,3}\.){3}\d{1,3}\b', res.stdout) + if ip_match: + detected_ip = ip_match.group(0).strip() + break + except Exception: + pass # 3. Requête Python native avec socket SO_BINDTODEVICE if not detected_ip: @@ -4234,8 +5363,10 @@ def format_vpn_bytes(b): return f"{b / 1099511627776:.2f} To" def prepare_wireguard_config_text(raw_config, table_id): - content = raw_config.strip() + content = raw_config.replace('\r\n', '\n').replace('\r', '\n').strip() content = re.sub(r"^\s*DNS\s*=.*$", r"# \g<0> (DNS géré localement)", content, flags=re.MULTILINE|re.IGNORECASE) + # Neutraliser ListenPort pour attribuer un port dynamique par tunnel et éviter les conflits d'adresses + content = re.sub(r"^\s*ListenPort\s*=.*$", r"# \g<0> (Port dynamique)", content, flags=re.MULTILINE|re.IGNORECASE) if re.search(r"^\s*Table\s*=", content, re.MULTILINE|re.IGNORECASE): content = re.sub(r"^\s*Table\s*=.*$", f"Table = {table_id}", content, flags=re.MULTILINE|re.IGNORECASE) else: @@ -4243,7 +5374,7 @@ def prepare_wireguard_config_text(raw_config, table_id): return content def prepare_openvpn_config_text(raw_config, script_path, auth_path=None): - lines = raw_config.splitlines() + lines = raw_config.replace('\r\n', '\n').replace('\r', '\n').splitlines() filtered = [] for line in lines: s = line.strip() @@ -4275,13 +5406,24 @@ def list_vpn_profiles(): iface = r[7] or (f"wg_ap{pid}" if vtype == "wireguard" else f"tun_ap{pid}") raw_status = r[9] actual_up = is_iface_up(iface) - status = "connected" if (raw_status == "connected" and actual_up) else ("error" if raw_status == "error" else "disconnected") + is_connecting_now = False + with connecting_vpn_pids_lock: + is_connecting_now = pid in connecting_vpn_pids + + if actual_up: + status = "connected" + elif is_connecting_now: + status = "connecting" + elif raw_status == "error": + status = "error" + else: + status = "disconnected" rx, tx = read_iface_traffic(iface) if actual_up else (0, 0) cache_entry = vpn_public_ip_cache.get(iface, {}) pub_ip = cache_entry.get('ip', '') if actual_up else '' pub_geo = get_ip_geo(pub_ip) if pub_ip else None last_tested = cache_entry.get('last_tested', '') if actual_up else '' - handshake = get_wireguard_handshake_info(iface) if (actual_up and vtype == 'wireguard') else None + handshake, handshake_sec = get_wireguard_handshake_info(iface) if (actual_up and vtype == 'wireguard') else (None, None) result.append({ 'id': pid, 'name': r[1], @@ -4304,7 +5446,8 @@ def list_vpn_profiles(): 'public_ip': pub_ip, 'public_ip_geo': pub_geo, 'last_tested': last_tested, - 'handshake': handshake + 'handshake': handshake, + 'handshake_age_seconds': handshake_sec }) return result @@ -4361,16 +5504,20 @@ def delete_vpn_profile(pid): sync_vpn_client_rules() def connect_vpn_profile(pid, caller_ip=''): - ensure_vpn_dirs() - prof = get_vpn_profile(pid) - if not prof: return False, 'Profil VPN introuvable' - table_id = prof['table_id'] or (100 + pid) - vtype = prof['type'] - iface = prof['iface'] or (f"wg_ap{pid}" if vtype == "wireguard" else f"tun_ap{pid}") - c = db() - c.execute('UPDATE vpn_profiles SET status="connecting", last_error="" WHERE id=?', (pid,)) - c.commit(); c.close() + with connecting_vpn_pids_lock: + if pid in connecting_vpn_pids: + return False, 'Connexion déjà en cours pour ce profil' + connecting_vpn_pids.add(pid) try: + ensure_vpn_dirs() + prof = get_vpn_profile(pid) + if not prof: return False, 'Profil VPN introuvable' + table_id = prof['table_id'] or (100 + pid) + vtype = prof['type'] + iface = prof['iface'] or (f"wg_ap{pid}" if vtype == "wireguard" else f"tun_ap{pid}") + c = db() + c.execute('UPDATE vpn_profiles SET status="connecting", last_error="" WHERE id=?', (pid,)) + c.commit(); c.close() # Activer le forwarding IP et désactiver complètement rp_filter (0 = essentiel pour le brouting) subprocess.run(['sysctl', '-w', 'net.ipv4.ip_forward=1'], capture_output=True) subprocess.run(['sysctl', '-w', 'net.ipv4.conf.all.forwarding=1'], capture_output=True) @@ -4383,10 +5530,42 @@ def connect_vpn_profile(pid, caller_ip=''): f.write(prepared) try: os.chmod(conf_path, 0o600) except OSError: pass + + # 1. Vérifier que le module noyau WireGuard est présent + if not os.path.exists('/sys/module/wireguard'): + subprocess.run(['modprobe', 'wireguard'], capture_output=True) + + # 2. Nettoyage préventif de l'interface et de la table PBR subprocess.run(['wg-quick', 'down', iface], capture_output=True) - res = subprocess.run(['wg-quick', 'up', iface], capture_output=True, text=True) + subprocess.run(['ip', 'link', 'delete', 'dev', iface], capture_output=True) + subprocess.run(['ip', 'route', 'flush', 'table', str(table_id)], capture_output=True) + for _ in range(5): + r_del = subprocess.run(['ip', 'rule', 'del', 'table', str(table_id)], capture_output=True) + if r_del.returncode != 0: break + + # 3. Pré-résolution DNS de l'Endpoint WireGuard si c'est un nom de domaine + ep_m = re.search(r"^\s*Endpoint\s*=\s*([^:\s]+)\s*:\s*(\d+)", prof['config_content'], re.MULTILINE | re.IGNORECASE) + if ep_m: + ep_host, ep_port = ep_m.group(1).strip(), int(ep_m.group(2)) + if not re.match(r"^(\d{1,3}\.){3}\d{1,3}$", ep_host) and ':' not in ep_host: + dns_resolved = False + for _ in range(3): + try: + socket.getaddrinfo(ep_host, ep_port, socket.AF_INET) + dns_resolved = True + break + except Exception: + time.sleep(0.5) + if not dns_resolved: + print(f"[ap-vpn] Attente résolution DNS pour '{ep_host}'...", flush=True) + + # 4. Exécution protégée de wg-quick up + with vpn_lock: + res = subprocess.run(['wg-quick', 'up', iface], capture_output=True, text=True, timeout=10) + if res.returncode != 0: err_msg = res.stderr.strip() or res.stdout.strip() or 'Erreur wg-quick up' + print(f"[ap-vpn] Échec wg-quick up '{iface}' : {err_msg}", flush=True) c = db() c.execute('UPDATE vpn_profiles SET status="error", last_error=? WHERE id=?', (err_msg, pid)) c.commit(); c.close() @@ -4459,14 +5638,17 @@ def connect_vpn_profile(pid, caller_ip=''): subprocess.run(['iptables', '-t', 'mangle', '-I', 'FORWARD', '1', '-p', 'tcp', '--tcp-flags', 'SYN,RST', 'SYN', '-o', iface, '-j', 'TCPMSS', '--clamp-mss-to-pmtu'], capture_output=True) # Permettre à la machine locale de router du trafic via l'interface VPN (pour vérification IP publique, ping, etc.) - subprocess.run(['ip', 'rule', 'add', 'oif', iface, 'lookup', str(table_id), 'priority', '9900'], capture_output=True) + rule_prio = 9800 + pid * 2 + subprocess.run(['ip', 'rule', 'del', 'priority', str(rule_prio)], capture_output=True) + subprocess.run(['ip', 'rule', 'del', 'priority', str(rule_prio + 1)], capture_output=True) + subprocess.run(['ip', 'rule', 'add', 'oif', iface, 'lookup', str(table_id), 'priority', str(rule_prio)], capture_output=True) time.sleep(0.3) try: r_ip = subprocess.run(['ip', '-4', '-o', 'addr', 'show', 'dev', iface], capture_output=True, text=True) if r_ip.returncode == 0: m_ip = re.search(r'inet\s+(\d+\.\d+\.\d+\.\d+)', r_ip.stdout) if m_ip: - subprocess.run(['ip', 'rule', 'add', 'from', m_ip.group(1), 'lookup', str(table_id), 'priority', '9901'], capture_output=True) + subprocess.run(['ip', 'rule', 'add', 'from', m_ip.group(1), 'lookup', str(table_id), 'priority', str(rule_prio + 1)], capture_output=True) except Exception: pass c = db() @@ -4523,6 +5705,9 @@ def connect_vpn_profile(pid, caller_ip=''): c.execute('UPDATE vpn_profiles SET status="error", last_error=? WHERE id=?', (err_msg, pid)) c.commit(); c.close() return False, f"Erreur de connexion : {err_msg}" + finally: + with connecting_vpn_pids_lock: + connecting_vpn_pids.discard(pid) def disconnect_vpn_profile(pid, caller_ip=''): prof = get_vpn_profile(pid) @@ -4620,38 +5805,49 @@ def disconnect_vpn_profile(pid, caller_ip=''): return False, str(e) def list_vpn_clients(): - active = clients() + all_devs = all_devices().get('devices', []) c = db() routes = {row[0].upper(): {'profile_id': row[1], 'kill_switch': row[2]} for row in c.execute('SELECT mac, profile_id, kill_switch FROM client_vpn_routes').fetchall()} profiles = {row[0]: {'id': row[0], 'name': row[1], 'type': row[2], 'status': row[3], 'iface': row[4]} for row in c.execute('SELECT id, name, type, status, iface FROM vpn_profiles').fetchall()} - known_names = dict(c.execute('SELECT mac, name FROM client_names').fetchall()) c.close() seen_macs = set() result = [] - for cl in active: - mac = (cl.get('mac') or '').upper() + for d in all_devs: + mac = (d.get('mac') or '').upper() if not mac or mac in seen_macs: continue seen_macs.add(mac) route = routes.get(mac, {'profile_id': 0, 'kill_switch': 0}) pid = route['profile_id'] prof = profiles.get(pid) + is_conn = bool(d.get('connected')) + eff_status = 'direct' if pid > 0 and prof: is_connected = (prof['status'] == 'connected' and is_iface_up(prof['iface'])) if is_connected: - eff_status = 'routed' + eff_status = 'routed' if is_conn else 'offline' else: - eff_status = 'blocked' if route['kill_switch'] else 'direct_fallback' + if is_conn: + eff_status = 'blocked' if route['kill_switch'] else 'direct_fallback' + else: + eff_status = 'offline' elif pid > 0 and not prof: eff_status = 'direct' pid = 0 + elif not is_conn: + eff_status = 'offline' + + raw_ip = d.get('ip') or '' + ip_val = '' if raw_ip in ('Non attribuée', '—') else raw_ip + result.append({ 'mac': mac, - 'ip': cl.get('ip') or '', - 'name': cl.get('name') or known_names.get(mac, 'Inconnu'), - 'online': True, + 'ip': ip_val, + 'name': d.get('name') or ('Client ' + mac.replace(':', '')[-4:]), + 'online': is_conn, + 'device_type': d.get('device_type') or 'generic', 'profile_id': pid, 'profile_name': prof['name'] if (pid > 0 and prof) else 'Connexion directe (Sans VPN)', 'profile_type': prof['type'] if (pid > 0 and prof) else '', @@ -4660,6 +5856,7 @@ def list_vpn_clients(): 'routing_status': eff_status, 'lan_isolated': (eff_status == 'routed') }) + for mac, route in routes.items(): if mac in seen_macs: continue seen_macs.add(mac) @@ -4668,15 +5865,24 @@ def list_vpn_clients(): result.append({ 'mac': mac, 'ip': '', - 'name': known_names.get(mac, 'Appareil mémorisé'), + 'name': 'Client ' + mac.replace(':', '')[-4:], 'online': False, + 'device_type': 'generic', 'profile_id': pid, 'profile_name': prof['name'] if (pid > 0 and prof) else 'Connexion directe (Sans VPN)', 'profile_type': prof['type'] if (pid > 0 and prof) else '', 'profile_status': prof['status'] if (pid > 0 and prof) else '', 'kill_switch': route['kill_switch'], - 'routing_status': 'offline' + 'routing_status': 'offline', + 'lan_isolated': False }) + + def _vpn_client_sort(c): + conn_rank = 0 if c['online'] else 1 + routed_rank = 0 if c['profile_id'] > 0 else 1 + return (conn_rank, routed_rank, c['name'].lower()) + + result.sort(key=_vpn_client_sort) return result def assign_client_vpn(mac, profile_id, kill_switch): @@ -4773,20 +5979,31 @@ def get_local_lan_subnets(): return subnets, host_ips def get_all_mac_to_ips(): - """Détecte de manière exhaustive l'adresse IP associée à chaque adresse MAC.""" + """Détecte de manière exhaustive l'adresse IP associée à chaque adresse MAC sans appeler clients().""" mac_to_ip = {} - try: - for cl in clients(): - m = (cl.get('mac') or '').upper() - ip = cl.get('ip') or '' - if m and ip and ip not in ('Non attribuée', '—'): - mac_to_ip[m] = ip - except Exception: pass for m, ip in station_live_ips.items(): - if m.upper() not in mac_to_ip and ip: + if m and ip and ip not in ('Non attribuée', '—'): mac_to_ip[m.upper()] = ip + try: + r = subprocess.run(['ip', 'neigh', 'show'], capture_output=True, text=True, timeout=1) + if r.returncode == 0: + for line in r.stdout.splitlines(): + m = re.search(r'^(\S+).*?lladdr ([0-9a-f:]{17})', line, re.I) + if m and 'FAILED' not in line: + nip = m.group(1) + nmac = m.group(2).upper() + if nmac not in mac_to_ip and not nip.startswith('127.'): + mac_to_ip[nmac] = nip + except Exception: pass + + try: + for l_mac, l_ip, _ in lease_entries(): + if l_mac and l_ip and l_mac not in mac_to_ip: + mac_to_ip[l_mac.upper()] = l_ip + except Exception: pass + try: c = db() for row in c.execute('SELECT mac, last_ip FROM client_names').fetchall(): @@ -4802,46 +6019,58 @@ def get_all_mac_to_ips(): c.close() except Exception: pass - try: - r = subprocess.run(['ip', 'neigh', 'show'], capture_output=True, text=True) - if r.returncode == 0: - for line in r.stdout.splitlines(): - m = re.search(r'^(\S+).*?lladdr ([0-9a-f:]{17})', line, re.I) - if m: - nip = m.group(1) - nmac = m.group(2).upper() - if nmac not in mac_to_ip and not nip.startswith('127.'): - mac_to_ip[nmac] = nip - except Exception: pass return mac_to_ip def setup_nftables_broute(assigned_macs, local_subnets=None): """Active le brouting matériel via nftables (Linux 6.4+, Debian 13) pour détourner les trames du pont L2 vers la couche L3.""" + nft_bin = find_bin('nft') + if not assigned_macs: + # Aucun client assigné à un VPN : supprimer la table pour ne jamais interférer avec le pont hôte + if nft_bin: + subprocess.run([nft_bin, 'delete', 'table', 'bridge', 'ap_vpn_broute'], capture_output=True) + return + for mod in ['br_netfilter', 'nf_tables', 'nft_compat']: subprocess.run(['modprobe', mod], capture_output=True) - subprocess.run(['nft', 'add', 'table', 'bridge', 'ap_vpn_broute'], capture_output=True) - subprocess.run(['nft', 'flush', 'table', 'bridge', 'ap_vpn_broute'], capture_output=True) - subprocess.run(['nft', 'add', 'chain', 'bridge', 'ap_vpn_broute', 'prerouting', '{ type filter hook prerouting priority -300; policy accept; }'], capture_output=True) + if not nft_bin: + return + + subprocess.run([nft_bin, 'add', 'table', 'bridge', 'ap_vpn_broute'], capture_output=True) + subprocess.run([nft_bin, 'flush', 'table', 'bridge', 'ap_vpn_broute'], capture_output=True) + subprocess.run([nft_bin, 'add', 'chain', 'bridge', 'ap_vpn_broute', 'prerouting', '{ type filter hook prerouting priority -300; policy accept; }'], capture_output=True) # 1. Exemptions ABSOLUES du brouting : # DHCP (ports 67/68 UDP) et Broadcast (ff:ff:ff:ff:ff:ff et 255.255.255.255). # Ces paquets DOIVENT être bridgés en L2 pour que les clients reçoivent leur IP locale de la box ! - subprocess.run(['nft', 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', 'ether', 'daddr', 'ff:ff:ff:ff:ff:ff', 'accept'], capture_output=True) - subprocess.run(['nft', 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', 'ether', 'type', 'ip', 'udp', 'dport', '67-68', 'accept'], capture_output=True) - subprocess.run(['nft', 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', 'ether', 'type', 'ip', 'udp', 'sport', '67-68', 'accept'], capture_output=True) - subprocess.run(['nft', 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', 'ether', 'type', 'ip', 'ip', 'daddr', '255.255.255.255', 'accept'], capture_output=True) + subprocess.run([nft_bin, 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', 'ether', 'daddr', 'ff:ff:ff:ff:ff:ff', 'accept'], capture_output=True) + subprocess.run([nft_bin, 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', 'ether', 'type', 'ip', 'udp', 'dport', '67-68', 'accept'], capture_output=True) + subprocess.run([nft_bin, 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', 'ether', 'type', 'ip', 'udp', 'sport', '67-68', 'accept'], capture_output=True) + subprocess.run([nft_bin, 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', 'ether', 'type', 'ip', 'ip', 'daddr', '255.255.255.255', 'accept'], capture_output=True) - # Note : Pas d'exemption pour les sous-réseaux locaux (local_subnets). - # Tout le trafic IPv4 des clients VPN (hors DHCP/broadcast) est brouté vers L3 - # pour être strictement isolé du réseau local et routé uniquement dans le tunnel VPN. + # Obtenir la liste des MACs bloquées (quota dépassé ou blocage manuel) pour ne JAMAIS les router + blocked_macs = set() + try: + blocked_macs.update(blocked_set()) + lims = get_client_limits_dict() or {} + for m, l in lims.items(): + if l.get('quota_exceeded'): + blocked_macs.add(m.upper()) + except Exception: pass for mac in assigned_macs: clean_mac = mac.strip().lower() if not clean_mac: continue + + if mac.strip().upper() in blocked_macs: + # Client bloqué : DROP absolu, pas de broute VPN ! + subprocess.run([nft_bin, 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', + 'ether', 'saddr', clean_mac, 'drop'], capture_output=True) + continue + # meta broute set 1 : détourne la trame du pont Ethernet directement dans la pile IP locale (L3) # meta pkttype set host : force le noyau (ip_forward) à accepter le paquet au lieu de le jeter comme PACKET_OTHERHOST - cmd_v4 = ['nft', 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', + cmd_v4 = [nft_bin, 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', 'ether', 'saddr', clean_mac, 'ether', 'type', 'ip', 'meta', 'broute', 'set', '1', 'meta', 'pkttype', 'set', 'host', 'accept'] res = subprocess.run(cmd_v4, capture_output=True, text=True) @@ -4851,7 +6080,7 @@ def setup_nftables_broute(assigned_macs, local_subnets=None): print(f"[ap-vpn] [NFTABLES] Broute actif pour {clean_mac} (meta broute set 1, pkttype host)", flush=True) # Bloquer les fuites IPv6 pour forcer la bascule complète du smartphone en IPv4 via WireGuard - cmd_v6 = ['nft', 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', + cmd_v6 = [nft_bin, 'add', 'rule', 'bridge', 'ap_vpn_broute', 'prerouting', 'ether', 'saddr', clean_mac, 'ether', 'type', 'ip6', 'drop'] subprocess.run(cmd_v6, capture_output=True) @@ -4865,16 +6094,35 @@ def sync_vpn_client_rules(): for row in c.execute('SELECT mac, profile_id, kill_switch FROM client_vpn_routes').fetchall()} c.close() + assigned_macs = [mac for mac, rinfo in client_routes.items() if rinfo.get('profile_id', 0) > 0] + connected_profiles = [p for p in profiles.values() if p['status'] == 'connected' and is_iface_up(p.get('iface', ''))] + + # Si aucun appareil n'est routé et aucun VPN n'est actif, désactiver toutes les chaînes pour ne pas impacter l'hôte + if not assigned_macs and not connected_profiles: + while subprocess.run(['iptables', '-D', 'INPUT', '-j', 'AP_VPN_INPUT'], capture_output=True).returncode == 0: pass + subprocess.run(['iptables', '-F', 'AP_VPN_INPUT'], capture_output=True) + while subprocess.run(['iptables', '-D', 'FORWARD', '-j', 'AP_VPN_ISOLATION'], capture_output=True).returncode == 0: pass + subprocess.run(['iptables', '-F', 'AP_VPN_ISOLATION'], capture_output=True) + while subprocess.run(['iptables', '-t', 'nat', '-D', 'PREROUTING', '-j', 'AP_VPN_DNS'], capture_output=True).returncode == 0: pass + subprocess.run(['iptables', '-t', 'nat', '-F', 'AP_VPN_DNS'], capture_output=True) + while subprocess.run(['iptables', '-t', 'mangle', '-D', 'PREROUTING', '-j', 'AP_VPN_MANGLE'], capture_output=True).returncode == 0: pass + subprocess.run(['iptables', '-t', 'mangle', '-F', 'AP_VPN_MANGLE'], capture_output=True) + subprocess.run(['ebtables', '-t', 'broute', '-F', 'BROUTING'], capture_output=True) + nft_b = find_bin('nft') + if nft_b: subprocess.run([nft_b, 'delete', 'table', 'bridge', 'ap_vpn_broute'], capture_output=True) + return + # 1. Nettoyage des anciennes règles ip rule (plage 9900 - 29999) - r = subprocess.run(['ip', 'rule', 'show'], capture_output=True, text=True) + r = subprocess.run(['ip', 'rule', 'show'], capture_output=True, text=True, timeout=2) if r.returncode == 0: for line in r.stdout.splitlines(): m = re.match(r"^\s*(\d+):", line) if m: prio = int(m.group(1)) if 9900 <= prio <= 29999: - while subprocess.run(['ip', 'rule', 'del', 'priority', str(prio)], capture_output=True).returncode == 0: - pass + for _ in range(5): + if subprocess.run(['ip', 'rule', 'del', 'priority', str(prio)], capture_output=True, timeout=2).returncode != 0: + break # 2. Réinitialisation de la chaîne iptables mangle AP_VPN_MANGLE subprocess.run(['iptables', '-t', 'mangle', '-N', 'AP_VPN_MANGLE'], capture_output=True) @@ -4931,13 +6179,14 @@ def sync_vpn_client_rules(): # 7. Fallback legacy ebtables avec redirect vers host (sans exemption LAN) subprocess.run(['ebtables', '-t', 'broute', '-F', 'BROUTING'], capture_output=True) - subprocess.run(['ebtables', '-t', 'broute', '-A', 'BROUTING', '-d', 'Broadcast', '-j', 'ACCEPT'], capture_output=True) - subprocess.run(['ebtables', '-t', 'broute', '-A', 'BROUTING', '-p', 'IPv4', '--ip-proto', 'udp', '--ip-dport', '67:68', '-j', 'ACCEPT'], capture_output=True) - subprocess.run(['ebtables', '-t', 'broute', '-A', 'BROUTING', '-p', 'IPv4', '--ip-proto', 'udp', '--ip-sport', '67:68', '-j', 'ACCEPT'], capture_output=True) - subprocess.run(['ebtables', '-t', 'broute', '-A', 'BROUTING', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '-j', 'ACCEPT'], capture_output=True) - for mac in assigned_macs: - subprocess.run(['ebtables', '-t', 'broute', '-A', 'BROUTING', '-p', 'IPv4', '-s', mac, '-j', 'redirect', '--redirect-target', 'DROP'], capture_output=True) - subprocess.run(['ebtables', '-t', 'broute', '-A', 'BROUTING', '-p', 'IPv6', '-s', mac, '-j', 'DROP'], capture_output=True) + if assigned_macs: + subprocess.run(['ebtables', '-t', 'broute', '-A', 'BROUTING', '-d', 'Broadcast', '-j', 'ACCEPT'], capture_output=True) + subprocess.run(['ebtables', '-t', 'broute', '-A', 'BROUTING', '-p', 'IPv4', '--ip-proto', 'udp', '--ip-dport', '67:68', '-j', 'ACCEPT'], capture_output=True) + subprocess.run(['ebtables', '-t', 'broute', '-A', 'BROUTING', '-p', 'IPv4', '--ip-proto', 'udp', '--ip-sport', '67:68', '-j', 'ACCEPT'], capture_output=True) + subprocess.run(['ebtables', '-t', 'broute', '-A', 'BROUTING', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '-j', 'ACCEPT'], capture_output=True) + for mac in assigned_macs: + subprocess.run(['ebtables', '-t', 'broute', '-A', 'BROUTING', '-p', 'IPv4', '-s', mac, '-j', 'redirect', '--redirect-target', 'DROP'], capture_output=True) + subprocess.run(['ebtables', '-t', 'broute', '-A', 'BROUTING', '-p', 'IPv6', '-s', mac, '-j', 'DROP'], capture_output=True) prio_base = 10000 active_tables = set() @@ -5080,28 +6329,78 @@ def sync_vpn_client_rules(): subprocess.run(['sysctl', '-w', 'net.ipv4.conf.all.forwarding=1'], capture_output=True) if os.path.exists('/sys/class/net/br0'): subprocess.run(['sysctl', '-w', 'net.ipv4.conf.br0.forwarding=1'], capture_output=True) - if len(active_tables) == 0: - subprocess.run(['conntrack', '-F'], capture_output=True) - subprocess.run(['ip', 'route', 'flush', 'cache'], capture_output=True) print(f"[ap-vpn] Synchronisation des règles VPN terminée ({len(active_tables)} profil(s) actif(s), {len(assigned_macs)} client(s) routé(s) - Isolation LAN activée)", flush=True) except Exception as e: print(f"[ap-vpn] Erreur synchronisation règles : {e}", flush=True) def auto_connect_vpn_profiles(): - time.sleep(4) + global app_startup_done + time.sleep(1.5) + # 1. Attendre que la route par défaut hôte/Internet soit prête (max 20s) + for _ in range(40): + r_gw = subprocess.run(['ip', 'route', 'show', 'default'], capture_output=True, text=True) + if r_gw.returncode == 0 and r_gw.stdout.strip(): + break + time.sleep(0.5) + + # 2. Attendre que la résolution DNS soit fonctionnelle (max 15s) + for _ in range(30): + try: + socket.getaddrinfo('one.one.one.one', 53, socket.AF_INET) + break + except Exception: + time.sleep(0.5) + try: c = db() - rows = c.execute('SELECT id, name FROM vpn_profiles WHERE auto_connect = 1').fetchall() + rows = c.execute('SELECT id, name FROM vpn_profiles WHERE auto_connect = 1 ORDER BY id ASC').fetchall() c.close() - for row in rows: - print(f"[ap-vpn] Connexion automatique au démarrage du profil '{row[1]}' (ID: {row[0]})...", flush=True) - try: - connect_vpn_profile(row[0]) - except Exception as e: - print(f"[ap-vpn] Erreur démarrage auto profil {row[0]} : {e}", flush=True) + + total_auto = len(rows) + if total_auto == 0: + app_startup_done = True + return + + for pid, name in rows: + print(f"[ap-vpn] Connexion automatique au démarrage du profil '{name}' (ID: {pid})...", flush=True) + for attempt in range(1, 4): + try: + ok, msg = connect_vpn_profile(pid) + if ok: + prof = get_vpn_profile(pid) or {} + vtype = prof.get('type', 'wireguard') + ifc = prof.get('iface') or (f"wg_ap{pid}" if vtype == "wireguard" else f"tun_ap{pid}") + up = False + for _ in range(30): + if is_iface_up(ifc): + up = True + break + time.sleep(0.2) + if up: + print(f"[ap-vpn] Profil '{name}' (ID: {pid}, {ifc}) connecté et actif.", flush=True) + get_vpn_public_ip(ifc, force_refresh=True) + break + print(f"[ap-vpn] Tentative {attempt}/3 pour '{name}' : {msg}", flush=True) + except Exception as e: + print(f"[ap-vpn] Exception tentative {attempt}/3 pour '{name}' : {e}", flush=True) + time.sleep(1.2) + time.sleep(0.5) + + # Synchronisation globale complète de toutes les règles une fois tous les tunnels montés + sync_vpn_client_rules() + except Exception as e: print(f"[ap-vpn] Erreur auto_connect_vpn_profiles : {e}", flush=True) + finally: + app_startup_done = True + print(f"[ap-vpn] Initialisation du démarrage terminée (app_startup_done = True)", flush=True) + +def _mark_startup_done_safety(): + time.sleep(180) + global app_startup_done + app_startup_done = True +threading.Thread(target=_mark_startup_done_safety, daemon=True).start() def vpn_healthcheck_loop(): """Effectue un test périodique de connectivité et rafraîchissement d'IP publique toutes les 5 minutes (300 s) en arrière-plan.""" @@ -5125,24 +6424,991 @@ def vpn_healthcheck_loop(): time.sleep(300) +def get_iconify_ssl_contexts(): + contexts = [] + try: + contexts.append(ssl.create_default_context()) + except Exception: + pass + try: + contexts.append(ssl._create_unverified_context()) + except Exception: + pass + return contexts or [None] + +def search_iconify_icons(query, limit=36): + q = (query or '').strip() + if not q: + return [] + hosts = [ + 'https://api.iconify.design', + 'https://api.simplesvg.com', + 'https://api.unisvg.com' + ] + headers = { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36', + 'Accept': 'application/json' + } + for host in hosts: + for ctx in get_iconify_ssl_contexts(): + try: + url = f"{host}/search?query={urllib.parse.quote(q)}&limit={limit}" + req = urllib.request.Request(url, headers=headers) + kwargs = {'timeout': 5} + if ctx: + kwargs['context'] = ctx + with urllib.request.urlopen(req, **kwargs) as resp: + if resp.status == 200: + raw = json.loads(resp.read().decode('utf-8')) + icons = raw.get('icons', []) + if icons: + return icons + except Exception: + continue + return [] + +def fetch_iconify_svg(clean_name, color=None): + clean_name = re.sub(r'[^a-zA-Z0-9_\-:/]', '', (clean_name or '').strip()) + if not clean_name: + return '' + if ':' in clean_name: + prefix, name = clean_name.split(':', 1) + clean_path = f"{prefix}/{name}" + elif '/' in clean_name: + prefix, name = clean_name.split('/', 1) + clean_path = f"{prefix}/{name}" + else: + prefix = 'mdi' + name = clean_name + clean_path = f"mdi/{clean_name}" + + is_emoji_set = any(prefix.lower().startswith(em) for em in ('noto', 'twemoji', 'openmoji', 'emojione', 'joypixels', 'fluent-emoji', 'fxemoji', 'streamline-emojis', 'blobmoji')) + hosts = [ + 'https://api.iconify.design', + 'https://api.simplesvg.com', + 'https://api.unisvg.com' + ] + headers = { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36', + 'Accept': 'image/svg+xml,application/json,*/*' + } + + # 1. Essayer les endpoints SVG directs + for host in hosts: + for ctx in get_iconify_ssl_contexts(): + try: + url = f"{host}/{clean_path}.svg" + if color and not is_emoji_set and color != 'currentColor': + url += f"?color={urllib.parse.quote(color)}" + req = urllib.request.Request(url, headers=headers) + kwargs = {'timeout': 5} + if ctx: + kwargs['context'] = ctx + with urllib.request.urlopen(req, **kwargs) as resp: + if resp.status == 200: + content = resp.read().decode('utf-8', errors='ignore') + if '{body}' + except Exception: + continue + + # 3. Fallback SVG garanti + fallback_color = color or '#38bdf8' + short_label = (name.split('-')[0] if '-' in name else name)[:6].upper() + return f'{short_label}' + + +def export_backup_data(): + c = db() + try: + preferences = dict(c.execute("SELECT key, value FROM preferences").fetchall()) + vpn_profiles = [] + for r in c.execute("SELECT id, name, type, config_content, auth_user, auth_pass, table_id, iface, auto_connect, created_at, updated_at FROM vpn_profiles").fetchall(): + vpn_profiles.append({ + 'id': r[0], 'name': r[1], 'type': r[2], 'config_content': r[3], + 'auth_user': r[4], 'auth_pass': r[5], 'table_id': r[6], 'iface': r[7], + 'auto_connect': r[8], 'created_at': r[9], 'updated_at': r[10] + }) + client_vpn_routes = [] + for r in c.execute("SELECT r.mac, r.profile_id, r.kill_switch, r.updated_at, p.name FROM client_vpn_routes r LEFT JOIN vpn_profiles p ON p.id=r.profile_id").fetchall(): + client_vpn_routes.append({ + 'mac': r[0], 'profile_id': r[1], 'kill_switch': r[2], + 'updated_at': r[3], 'profile_name': r[4] or '' + }) + client_names = [] + for r in c.execute("SELECT mac, name, last_ip, last_seen, device_type FROM client_names").fetchall(): + client_names.append({ + 'mac': r[0], 'name': r[1], 'last_ip': r[2], 'last_seen': r[3], 'device_type': r[4] or '' + }) + custom_device_types = [] + has_cdt = bool(c.execute("SELECT 1 FROM sqlite_master WHERE type='table' AND name='custom_device_types'").fetchone()) + if has_cdt: + for r in c.execute("SELECT id, label, icon, desc, sort_order FROM custom_device_types ORDER BY sort_order ASC, id ASC").fetchall(): + custom_device_types.append({ + 'id': r[0], 'label': r[1], 'icon': r[2], 'desc': r[3], 'sort_order': r[4] + }) + blocked_clients = [] + for r in c.execute("SELECT mac, blocked_at FROM blocked_clients").fetchall(): + blocked_clients.append({ + 'mac': r[0], 'blocked_at': r[1] + }) + auth_users = [] + for r in c.execute("SELECT username, password_hash, totp_secret FROM auth_users").fetchall(): + auth_users.append({ + 'username': r[0], 'password_hash': r[1], 'totp_secret': r[2] + }) + auth_passkeys = [] + has_pk = bool(c.execute("SELECT 1 FROM sqlite_master WHERE type='table' AND name='auth_passkeys'").fetchone()) + if has_pk: + for r in c.execute("SELECT id, username, public_key, name, device_type, sign_count, created_at, last_used_at FROM auth_passkeys").fetchall(): + auth_passkeys.append({ + 'id': r[0], 'username': r[1], 'public_key': r[2], 'name': r[3], + 'device_type': r[4], 'sign_count': r[5], 'created_at': r[6], 'last_used_at': r[7] + }) + client_traffic = [] + for r in c.execute("SELECT mac, rx_bytes, tx_bytes, last_updated FROM client_traffic").fetchall(): + client_traffic.append({ + 'mac': r[0], 'rx_bytes': r[1], 'tx_bytes': r[2], 'last_updated': r[3] + }) + client_traffic_daily = [] + for r in c.execute("SELECT mac, traffic_date, rx_bytes, tx_bytes FROM client_traffic_daily").fetchall(): + client_traffic_daily.append({ + 'mac': r[0], 'traffic_date': r[1], 'rx_bytes': r[2], 'tx_bytes': r[3] + }) + connection_logs = [] + for r in c.execute("SELECT id, event_time, event, name, ip, mac FROM connection_logs ORDER BY id DESC LIMIT 150").fetchall(): + connection_logs.append({ + 'id': r[0], 'event_time': r[1], 'event': r[2], 'name': r[3], 'ip': r[4], 'mac': r[5] + }) + client_limits = [] + has_cl = bool(c.execute("SELECT 1 FROM sqlite_master WHERE type='table' AND name='client_limits'").fetchone()) + if has_cl: + for r in c.execute("SELECT mac, quota_enabled, quota_bytes, quota_period, bandwidth_enabled, rate_down_kbps, rate_up_kbps, quota_action, updated_at FROM client_limits").fetchall(): + client_limits.append({ + 'mac': r[0], 'quota_enabled': r[1], 'quota_bytes': r[2], 'quota_period': r[3], + 'bandwidth_enabled': r[4], 'rate_down_kbps': r[5], 'rate_up_kbps': r[6], + 'quota_action': r[7], 'updated_at': r[8] + }) + return { + 'ap_manageur_backup': { + 'version': '1.0', + 'app_version': APP_VERSION, + 'exported_at': datetime.datetime.now(datetime.timezone.utc).isoformat(), + 'export_timestamp': int(time.time()), + 'app_name': preferences.get('app_name', 'Administration de l’AP Wi‑Fi') + }, + 'preferences': preferences, + 'vpn_profiles': vpn_profiles, + 'client_vpn_routes': client_vpn_routes, + 'client_names': client_names, + 'custom_device_types': custom_device_types, + 'client_limits': client_limits, + 'blocked_clients': blocked_clients, + 'auth_users': auth_users, + 'auth_passkeys': auth_passkeys, + 'client_traffic': client_traffic, + 'client_traffic_daily': client_traffic_daily, + 'connection_logs': connection_logs + } + finally: + c.close() + + +def import_backup_data(payload, options=None): + if options is None: + options = {} + if isinstance(payload, dict) and 'backup' in payload and isinstance(payload['backup'], dict): + backup = payload['backup'] + options = {**options, **payload.get('options', {})} + elif isinstance(payload, dict): + backup = payload + else: + raise ValueError("Format de sauvegarde invalide (objet JSON attendu)") + + restore_prefs = options.get('restore_preferences', True) + restore_vpn = options.get('restore_vpn', True) + restore_devices = options.get('restore_devices', True) + restore_blocked = options.get('restore_blocked', True) + restore_categories = options.get('restore_categories', True) + restore_auth = options.get('restore_auth', False) + restore_traffic = options.get('restore_traffic', True) + + stats = { + 'preferences': 0, + 'vpn_profiles': 0, + 'client_vpn_routes': 0, + 'client_names': 0, + 'custom_device_types': 0, + 'blocked_clients': 0, + 'auth_users': 0, + 'auth_passkeys': 0 + } + + ensure_vpn_dirs() + c = db() + try: + # 1. Catégories d'appareils + if restore_categories and 'custom_device_types' in backup and isinstance(backup['custom_device_types'], list): + for dt in backup['custom_device_types']: + dt_id = str(dt.get('id', '')).strip() + label = str(dt.get('label', '')).strip() + icon = str(dt.get('icon', '💻')).strip() + desc = str(dt.get('desc', '')).strip() + try: order = int(dt.get('sort_order', 0)) + except (ValueError, TypeError): order = 0 + if dt_id and label: + c.execute(''' + INSERT INTO custom_device_types (id, label, icon, desc, sort_order) + VALUES (?, ?, ?, ?, ?) + ON CONFLICT(id) DO UPDATE SET + label=excluded.label, + icon=excluded.icon, + desc=excluded.desc, + sort_order=excluded.sort_order + ''', (dt_id, label, icon, desc, order)) + stats['custom_device_types'] += 1 + + # 2. Noms d'appareils & types + if restore_devices and 'client_names' in backup and isinstance(backup['client_names'], list): + for cn in backup['client_names']: + mac = str(cn.get('mac', '')).strip().upper() + name = str(cn.get('name', '')).strip() + last_ip = str(cn.get('last_ip', '')).strip() + last_seen = str(cn.get('last_seen', '')).strip() + device_type = str(cn.get('device_type', '')).strip() + if mac and name: + c.execute(''' + INSERT INTO client_names (mac, name, last_ip, last_seen, device_type) + VALUES (?, ?, ?, ?, ?) + ON CONFLICT(mac) DO UPDATE SET + name=excluded.name, + last_ip=CASE WHEN excluded.last_ip != '' THEN excluded.last_ip ELSE client_names.last_ip END, + last_seen=CASE WHEN excluded.last_seen != '' THEN excluded.last_seen ELSE client_names.last_seen END, + device_type=CASE WHEN excluded.device_type != '' THEN excluded.device_type ELSE client_names.device_type END + ''', (mac, name, last_ip, last_seen, device_type)) + stats['client_names'] += 1 + + if 'client_limits' in backup and isinstance(backup['client_limits'], list): + for cl in backup['client_limits']: + mac = str(cl.get('mac', '')).strip().upper() + if mac: + c.execute(''' + INSERT INTO client_limits (mac, quota_enabled, quota_bytes, quota_period, bandwidth_enabled, rate_down_kbps, rate_up_kbps, quota_action, updated_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) + ON CONFLICT(mac) DO UPDATE SET + quota_enabled=excluded.quota_enabled, + quota_bytes=excluded.quota_bytes, + quota_period=excluded.quota_period, + bandwidth_enabled=excluded.bandwidth_enabled, + rate_down_kbps=excluded.rate_down_kbps, + rate_up_kbps=excluded.rate_up_kbps, + quota_action=excluded.quota_action, + updated_at=excluded.updated_at + ''', ( + mac, 1 if cl.get('quota_enabled') else 0, int(cl.get('quota_bytes', 0) or 0), + str(cl.get('quota_period', 'total')), 1 if cl.get('bandwidth_enabled') else 0, + int(cl.get('rate_down_kbps', 0) or 0), int(cl.get('rate_up_kbps', 0) or 0), + str(cl.get('quota_action', 'block')), str(cl.get('updated_at', '')) + )) + try: sync_client_bandwidth_and_quotas(force=True) + except Exception: pass + + # 3. Appareils bloqués + if restore_blocked and 'blocked_clients' in backup and isinstance(backup['blocked_clients'], list): + for bl in backup['blocked_clients']: + mac = str(bl.get('mac', '')).strip().upper() + b_at = str(bl.get('blocked_at', '')).strip() or time.strftime('%Y-%m-%d %H:%M:%S') + if mac: + c.execute('INSERT OR IGNORE INTO blocked_clients (mac, blocked_at) VALUES (?, ?)', (mac, b_at)) + stats['blocked_clients'] += 1 + try: command('iw', 'dev', INTERFACE, 'station', 'del', mac) + except Exception: pass + + # 4. Préférences et réglages + if restore_prefs and 'preferences' in backup and isinstance(backup['preferences'], dict): + for k, v in backup['preferences'].items(): + c.execute("INSERT INTO preferences(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value=excluded.value", (str(k), str(v))) + stats['preferences'] += 1 + + # 5. Profils VPN et routage + if restore_vpn and 'vpn_profiles' in backup and isinstance(backup['vpn_profiles'], list): + profile_id_map = {} + for vp in backup['vpn_profiles']: + old_id = vp.get('id') + p_name = str(vp.get('name', 'Profil VPN')).strip() + p_type = str(vp.get('type', 'wireguard')).strip().lower() + if p_type not in ('wireguard', 'openvpn'): p_type = 'wireguard' + p_cfg = str(vp.get('config_content', '')).strip() + p_user = str(vp.get('auth_user', '')).strip() + p_pass = str(vp.get('auth_pass', '')).strip() + p_auto = 1 if vp.get('auto_connect') else 0 + now_ts = time.strftime('%Y-%m-%d %H:%M:%S') + + existing = c.execute('SELECT id FROM vpn_profiles WHERE name=?', (p_name,)).fetchone() + if existing: + cur_id = existing[0] + c.execute(''' + UPDATE vpn_profiles SET + type=?, config_content=?, auth_user=?, auth_pass=?, auto_connect=?, updated_at=? + WHERE id=? + ''', (p_type, p_cfg, p_user, p_pass, p_auto, now_ts, cur_id)) + profile_id_map[old_id] = cur_id + profile_id_map[p_name] = cur_id + stats['vpn_profiles'] += 1 + else: + table_id = get_next_vpn_table_id() + cur = c.execute(''' + INSERT INTO vpn_profiles (name, type, config_content, auth_user, auth_pass, table_id, iface, auto_connect, status, last_error, created_at, updated_at) + VALUES (?, ?, ?, ?, ?, ?, "", ?, "disconnected", "", ?, ?) + ''', (p_name, p_type, p_cfg, p_user, p_pass, table_id, p_auto, now_ts, now_ts)) + new_pid = cur.lastrowid + iface = f"wg_ap{new_pid}" if p_type == "wireguard" else f"tun_ap{new_pid}" + c.execute('UPDATE vpn_profiles SET iface=? WHERE id=?', (iface, new_pid)) + profile_id_map[old_id] = new_pid + profile_id_map[p_name] = new_pid + stats['vpn_profiles'] += 1 + + if 'client_vpn_routes' in backup and isinstance(backup['client_vpn_routes'], list): + for cr in backup['client_vpn_routes']: + mac = str(cr.get('mac', '')).strip().upper() + old_pid = cr.get('profile_id') + p_name = cr.get('profile_name') + kill_sw = 1 if cr.get('kill_switch') else 0 + target_pid = profile_id_map.get(old_pid) or profile_id_map.get(p_name) or 0 + if mac and target_pid: + now_ts = time.strftime('%Y-%m-%d %H:%M:%S') + c.execute(''' + INSERT INTO client_vpn_routes (mac, profile_id, kill_switch, updated_at) + VALUES (?, ?, ?, ?) + ON CONFLICT(mac) DO UPDATE SET + profile_id=excluded.profile_id, + kill_switch=excluded.kill_switch, + updated_at=excluded.updated_at + ''', (mac, target_pid, kill_sw, now_ts)) + stats['client_vpn_routes'] += 1 + try: sync_vpn_client_rules() + except Exception: pass + + # 6. Trafic (optionnel) + if restore_traffic and 'client_traffic' in backup and isinstance(backup['client_traffic'], list): + for ct in backup['client_traffic']: + mac = str(ct.get('mac', '')).strip().upper() + try: + rx = int(ct.get('rx_bytes', 0)) + tx = int(ct.get('tx_bytes', 0)) + except (ValueError, TypeError): rx, tx = 0, 0 + lu = str(ct.get('last_updated', '')).strip() + if mac: + c.execute(''' + INSERT INTO client_traffic (mac, rx_bytes, tx_bytes, last_updated) + VALUES (?, ?, ?, ?) + ON CONFLICT(mac) DO UPDATE SET + rx_bytes=MAX(client_traffic.rx_bytes, excluded.rx_bytes), + tx_bytes=MAX(client_traffic.tx_bytes, excluded.tx_bytes), + last_updated=excluded.last_updated + ''', (mac, rx, tx, lu)) + if 'client_traffic_daily' in backup and isinstance(backup['client_traffic_daily'], list): + for ctd in backup['client_traffic_daily']: + mac = str(ctd.get('mac', '')).strip().upper() + t_date = str(ctd.get('traffic_date', '')).strip() + try: + rx = int(ctd.get('rx_bytes', 0)) + tx = int(ctd.get('tx_bytes', 0)) + except (ValueError, TypeError): rx, tx = 0, 0 + if mac and t_date: + c.execute(''' + INSERT INTO client_traffic_daily (mac, traffic_date, rx_bytes, tx_bytes) + VALUES (?, ?, ?, ?) + ON CONFLICT(mac, traffic_date) DO UPDATE SET + rx_bytes=MAX(client_traffic_daily.rx_bytes, excluded.rx_bytes), + tx_bytes=MAX(client_traffic_daily.tx_bytes, excluded.tx_bytes) + ''', (mac, t_date, rx, tx)) + + # 7. Authentification (si demandée explicitement) + if restore_auth and 'auth_users' in backup and isinstance(backup['auth_users'], list): + for u in backup['auth_users']: + uname = str(u.get('username', '')).strip() + phash = str(u.get('password_hash', '')).strip() + totp = u.get('totp_secret') + if uname and phash: + c.execute(''' + INSERT INTO auth_users (username, password_hash, totp_secret) + VALUES (?, ?, ?) + ON CONFLICT(username) DO UPDATE SET + password_hash=excluded.password_hash, + totp_secret=excluded.totp_secret + ''', (uname, phash, totp)) + stats['auth_users'] += 1 + if 'auth_passkeys' in backup and isinstance(backup['auth_passkeys'], list): + for pk in backup['auth_passkeys']: + pk_id = str(pk.get('id', '')).strip() + pk_uname = str(pk.get('username', '')).strip() + pk_key = str(pk.get('public_key', '')).strip() + pk_name = str(pk.get('name', '')).strip() + pk_dev = str(pk.get('device_type', 'security_key')).strip() + try: pk_count = int(pk.get('sign_count', 0)) + except (ValueError, TypeError): pk_count = 0 + pk_c_at = str(pk.get('created_at', '')).strip() + pk_u_at = str(pk.get('last_used_at', '')).strip() + if pk_id and pk_uname and pk_key: + c.execute(''' + INSERT INTO auth_passkeys (id, username, public_key, name, device_type, sign_count, created_at, last_used_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + ON CONFLICT(id) DO UPDATE SET + name=excluded.name, + sign_count=excluded.sign_count, + last_used_at=excluded.last_used_at + ''', (pk_id, pk_uname, pk_key, pk_name, pk_dev, pk_count, pk_c_at, pk_u_at)) + stats['auth_passkeys'] += 1 + + c.commit() + finally: + c.close() + return stats + + +def extract_backup_from_sqlite(db_path): + conn = sqlite3.connect(db_path) + conn.row_factory = sqlite3.Row + c = conn.cursor() + try: + def table_exists(tname): + return bool(c.execute("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?", (tname,)).fetchone()) + + preferences = {} + if table_exists('preferences'): + preferences = dict(c.execute("SELECT key, value FROM preferences").fetchall()) + + vpn_profiles = [] + if table_exists('vpn_profiles'): + for r in c.execute("SELECT id, name, type, config_content, auth_user, auth_pass, table_id, iface, auto_connect, created_at, updated_at FROM vpn_profiles").fetchall(): + vpn_profiles.append({ + 'id': r['id'], 'name': r['name'], 'type': r['type'], 'config_content': r['config_content'], + 'auth_user': r['auth_user'], 'auth_pass': r['auth_pass'], 'table_id': r['table_id'], 'iface': r['iface'], + 'auto_connect': r['auto_connect'], 'created_at': r['created_at'], 'updated_at': r['updated_at'] + }) + + client_vpn_routes = [] + if table_exists('client_vpn_routes'): + q = "SELECT r.mac, r.profile_id, r.kill_switch, r.updated_at, p.name FROM client_vpn_routes r LEFT JOIN vpn_profiles p ON p.id=r.profile_id" if table_exists('vpn_profiles') else "SELECT mac, profile_id, kill_switch, updated_at, '' FROM client_vpn_routes" + for r in c.execute(q).fetchall(): + client_vpn_routes.append({ + 'mac': r[0], 'profile_id': r[1], 'kill_switch': r[2], + 'updated_at': r[3], 'profile_name': r[4] or '' + }) + + client_names = [] + if table_exists('client_names'): + for r in c.execute("SELECT mac, name, last_ip, last_seen, device_type FROM client_names").fetchall(): + client_names.append({ + 'mac': r['mac'], 'name': r['name'], 'last_ip': r['last_ip'], + 'last_seen': r['last_seen'], 'device_type': r['device_type'] or '' + }) + + custom_device_types = [] + if table_exists('custom_device_types'): + for r in c.execute("SELECT id, label, icon, desc, sort_order FROM custom_device_types ORDER BY sort_order ASC, id ASC").fetchall(): + custom_device_types.append({ + 'id': r['id'], 'label': r['label'], 'icon': r['icon'], 'desc': r['desc'], 'sort_order': r['sort_order'] + }) + + blocked_clients = [] + if table_exists('blocked_clients'): + for r in c.execute("SELECT mac, blocked_at FROM blocked_clients").fetchall(): + blocked_clients.append({'mac': r['mac'], 'blocked_at': r['blocked_at']}) + + auth_users = [] + if table_exists('auth_users'): + for r in c.execute("SELECT username, password_hash, totp_secret FROM auth_users").fetchall(): + auth_users.append({'username': r['username'], 'password_hash': r['password_hash'], 'totp_secret': r['totp_secret']}) + + auth_passkeys = [] + if table_exists('auth_passkeys'): + for r in c.execute("SELECT id, username, public_key, name, device_type, sign_count, created_at, last_used_at FROM auth_passkeys").fetchall(): + auth_passkeys.append({ + 'id': r['id'], 'username': r['username'], 'public_key': r['public_key'], 'name': r['name'], + 'device_type': r['device_type'], 'sign_count': r['sign_count'], 'created_at': r['created_at'], 'last_used_at': r['last_used_at'] + }) + + client_limits = [] + if table_exists('client_limits'): + for r in c.execute("SELECT mac, quota_enabled, quota_bytes, quota_period, bandwidth_enabled, rate_down_kbps, rate_up_kbps, quota_action, updated_at FROM client_limits").fetchall(): + client_limits.append({ + 'mac': r['mac'], 'quota_enabled': r['quota_enabled'], 'quota_bytes': r['quota_bytes'], + 'quota_period': r['quota_period'], 'bandwidth_enabled': r['bandwidth_enabled'], + 'rate_down_kbps': r['rate_down_kbps'], 'rate_up_kbps': r['rate_up_kbps'], + 'quota_action': r['quota_action'], 'updated_at': r['updated_at'] + }) + + return { + 'ap_manageur_backup': { + 'version': '1.0', + 'app_version': APP_VERSION, + 'exported_at': datetime.datetime.now(datetime.timezone.utc).isoformat(), + 'export_timestamp': int(time.time()), + 'app_name': preferences.get('app_name', 'Administration de l’AP Wi‑Fi (extrait SQLite)') + }, + 'preferences': preferences, + 'vpn_profiles': vpn_profiles, + 'client_vpn_routes': client_vpn_routes, + 'client_names': client_names, + 'custom_device_types': custom_device_types, + 'client_limits': client_limits, + 'blocked_clients': blocked_clients, + 'auth_users': auth_users, + 'auth_passkeys': auth_passkeys + } + finally: + conn.close() + + +def inspect_backup_bytes(raw_bytes, filename=''): + if not raw_bytes: + raise ValueError("Le fichier de sauvegarde est vide") + + # 1. Archive ZIP + if raw_bytes[:4] == b'PK\x03\x04' or filename.lower().endswith('.zip'): + try: + with zipfile.ZipFile(io.BytesIO(raw_bytes)) as zf: + namelist = zf.namelist() + json_files = [n for n in namelist if n.lower().endswith('.json')] + target = None + if 'configuration.json' in json_files: + target = 'configuration.json' + elif json_files: + target = json_files[0] + + if target: + content = zf.read(target).decode('utf-8') + return json.loads(content) + + # Si pas de JSON mais un fichier SQLite est présent dans le zip + sqlite_files = [n for n in namelist if n.lower().endswith(('.sqlite3', '.db'))] + if sqlite_files: + tmp = tempfile.NamedTemporaryFile(delete=False, suffix='.sqlite3') + try: + tmp.write(zf.read(sqlite_files[0])) + tmp.close() + return extract_backup_from_sqlite(tmp.name) + finally: + if os.path.exists(tmp.name): + try: os.unlink(tmp.name) + except OSError: pass + raise ValueError("L'archive ZIP ne contient ni fichier JSON de configuration ni base de données SQLite.") + except zipfile.BadZipFile: + raise ValueError("L'archive ZIP est corrompue ou invalide.") + + # 2. Base SQLite brute + if raw_bytes[:16] == b'SQLite format 3\x00' or filename.lower().endswith(('.sqlite3', '.db')): + tmp = tempfile.NamedTemporaryFile(delete=False, suffix='.sqlite3') + try: + tmp.write(raw_bytes) + tmp.close() + return extract_backup_from_sqlite(tmp.name) + finally: + if os.path.exists(tmp.name): + try: os.unlink(tmp.name) + except OSError: pass + + # 3. JSON standard + try: + text = raw_bytes.decode('utf-8') + return json.loads(text) + except Exception as e: + raise ValueError(f"Fichier de sauvegarde non reconnu (ni ZIP, ni SQLite, ni JSON) : {e}") + + +API_MSG_I18N = { + 'Authentification réussie': {'en-us': 'Authentication successful', 'en-gb': 'Authentication successful'}, + 'Authentification réussie avec': {'en-us': 'Authentication successful with', 'en-gb': 'Authentication successful with'}, + 'Erreur export SQLite': {'en-us': 'SQLite export error', 'en-gb': 'SQLite export error'}, + 'Erreur génération archive ZIP': {'en-us': 'ZIP archive generation error', 'en-gb': 'ZIP archive generation error'}, + 'Erreur génération sauvegarde': {'en-us': 'Backup generation error', 'en-gb': 'Backup generation error'}, + 'Erreur lors de la restauration': {'en-us': 'Error during restore', 'en-gb': 'Error during restore'}, + 'Impossible d’analyser le fichier': {'en-us': 'Unable to parse file', 'en-gb': 'Unable to parse file'}, + "Impossible d'analyser le fichier": {'en-us': 'Unable to parse file', 'en-gb': 'Unable to parse file'}, + 'Passkey enregistrée avec succès !': {'en-us': 'Passkey registered successfully!', 'en-gb': 'Passkey registered successfully!'}, + 'enregistrée avec succès !': {'en-us': 'registered successfully!', 'en-gb': 'registered successfully!'}, + 'Clé de sécurité renommée avec succès': {'en-us': 'Security key renamed successfully', 'en-gb': 'Security key renamed successfully'}, + 'Passkey supprimée avec succès': {'en-us': 'Passkey deleted successfully', 'en-gb': 'Passkey deleted successfully'}, + 'Double identification activée avec succès !': {'en-us': 'Two-factor authentication enabled successfully!', 'en-gb': 'Two-factor authentication enabled successfully!'}, + 'Nouveaux codes générés avec succès !': {'en-us': 'New recovery codes generated successfully!', 'en-gb': 'New recovery codes generated successfully!'}, + 'Double identification désactivée': {'en-us': 'Two-factor authentication disabled', 'en-gb': 'Two-factor authentication disabled'}, + 'Session déconnectée avec succès': {'en-us': 'Session disconnected successfully', 'en-gb': 'Session disconnected successfully'}, + 'Machine renommée avec succès': {'en-us': 'Machine renamed successfully', 'en-gb': 'Machine renamed successfully'}, + 'Activation refusée': {'en-us': 'Activation refused', 'en-gb': 'Activation refused'}, + 'Désactivation refusée': {'en-us': 'Deactivation refused', 'en-gb': 'Deactivation refused'}, + 'Code refusé': {'en-us': 'Invalid code', 'en-gb': 'Invalid code'}, + 'Nom de machine vide': {'en-us': 'Machine name cannot be empty', 'en-gb': 'Machine name cannot be empty'}, + 'Token de session manquant': {'en-us': 'Missing session token', 'en-gb': 'Missing session token'}, + 'Impossible de déconnecter la session': {'en-us': 'Unable to disconnect session', 'en-gb': 'Unable to disconnect session'}, + 'Impossible de renommer la machine': {'en-us': 'Unable to rename machine', 'en-gb': 'Unable to rename machine'}, + 'Passkey introuvable': {'en-us': 'Passkey not found', 'en-gb': 'Passkey not found'}, + 'Capture déjà en cours sur': {'en-us': 'Capture already running on', 'en-gb': 'Capture already running on'}, + 'Capture démarrée sur l': {'en-us': 'Capture started on', 'en-gb': 'Capture started on'}, + 'Échec de connexion WireGuard': {'en-us': 'WireGuard connection failed', 'en-gb': 'WireGuard connection failed'}, + 'Échec de connexion OpenVPN': {'en-us': 'OpenVPN connection failed', 'en-gb': 'OpenVPN connection failed'}, + 'Erreur de connexion': {'en-us': 'Connection error', 'en-gb': 'Connection error'}, + "Nom d'icône manquant": {'en-us': 'Missing icon name', 'en-gb': 'Missing icon name'}, + 'Nom d’icône manquant': {'en-us': 'Missing icon name', 'en-gb': 'Missing icon name'}, + 'Profil connecté': {'en-us': 'Profile connected', 'en-gb': 'Profile connected'}, + 'Profil déconnecté': {'en-us': 'Profile disconnected', 'en-gb': 'Profile disconnected'}, + + 'Authentification requise': {'en-us': 'Authentication required', 'en-gb': 'Authentication required'}, + 'Nom d’utilisateur ou mot de passe incorrect': {'en-us': 'Incorrect username or password', 'en-gb': 'Incorrect username or password'}, + 'Compte non configuré': {'en-us': 'Account not configured', 'en-gb': 'Account not configured'}, + 'Mot de passe actuel incorrect': {'en-us': 'Incorrect current password', 'en-gb': 'Incorrect current password'}, + 'Les nouveaux mots de passe ne correspondent pas': {'en-us': 'New passwords do not match', 'en-gb': 'New passwords do not match'}, + 'Le mot de passe doit contenir au moins 8 caractères': {'en-us': 'Password must be at least 8 characters long', 'en-gb': 'Password must be at least 8 characters long'}, + 'Le mot de passe doit contenir entre 8 et 128 caractères': {'en-us': 'Password must be between 8 and 128 characters long', 'en-gb': 'Password must be between 8 and 128 characters long'}, + 'Nom d’utilisateur invalide': {'en-us': 'Invalid username', 'en-gb': 'Invalid username'}, + 'Nom utilisateur invalide': {'en-us': 'Invalid username', 'en-gb': 'Invalid username'}, + 'Code 2FA incorrect': {'en-us': 'Incorrect 2FA code', 'en-gb': 'Incorrect 2FA code'}, + 'Code 2FA invalide': {'en-us': 'Invalid 2FA code', 'en-gb': 'Invalid 2FA code'}, + 'Code de secours déjà utilisé': {'en-us': 'Backup code already used', 'en-gb': 'Backup code already used'}, + 'Profil introuvable': {'en-us': 'Profile not found', 'en-gb': 'Profile not found'}, + 'Profil VPN introuvable': {'en-us': 'VPN profile not found', 'en-gb': 'VPN profile not found'}, + 'Profil VPN enregistré avec succès': {'en-us': 'VPN profile saved successfully', 'en-gb': 'VPN profile saved successfully'}, + 'Profil VPN supprimé avec succès': {'en-us': 'VPN profile deleted successfully', 'en-gb': 'VPN profile deleted successfully'}, + 'Contenu du fichier manquant': {'en-us': 'Missing file content', 'en-gb': 'Missing file content'}, + 'Format de fichier invalide': {'en-us': 'Invalid file format', 'en-gb': 'Invalid file format'}, + 'Nom de l’application invalide': {'en-us': 'Invalid application name', 'en-gb': 'Invalid application name'}, + 'Nom court invalide': {'en-us': 'Invalid short name', 'en-gb': 'Invalid short name'}, + 'Thème invalide': {'en-us': 'Invalid theme', 'en-gb': 'Invalid theme'}, + 'Adresse MAC invalide': {'en-us': 'Invalid MAC address', 'en-gb': 'Invalid MAC address'}, + 'Impossible de se connecter au VPN': {'en-us': 'Unable to connect to VPN', 'en-gb': 'Unable to connect to VPN'}, + 'Tunnel VPN déconnecté': {'en-us': 'VPN tunnel disconnected', 'en-gb': 'VPN tunnel disconnected'}, + 'Le tunnel VPN est actuellement déconnecté': {'en-us': 'VPN tunnel is currently disconnected', 'en-gb': 'VPN tunnel is currently disconnected'}, + 'IP publique introuvable via ce tunnel': {'en-us': 'Public IP not found through this tunnel', 'en-gb': 'Public IP not found through this tunnel'}, + 'Passkey introuvable': {'en-us': 'Passkey not found', 'en-gb': 'Passkey not found'}, + 'Passkey inconnue ou non enregistrée': {'en-us': 'Passkey unknown or not registered', 'en-gb': 'Passkey unknown or not registered'}, + 'Passkey supprimée avec succès': {'en-us': 'Passkey deleted successfully', 'en-gb': 'Passkey deleted successfully'}, + 'Clé de sécurité renommée avec succès': {'en-us': 'Security key renamed successfully', 'en-gb': 'Security key renamed successfully'}, + 'Le nom de la clé ne peut pas être vide': {'en-us': 'Key name cannot be empty', 'en-gb': 'Key name cannot be empty'}, + 'Aucune modification': {'en-us': 'No changes', 'en-gb': 'No changes'}, + 'Action non autorisée': {'en-us': 'Unauthorized action', 'en-gb': 'Unauthorized action'}, + 'Erreur interne du serveur': {'en-us': 'Internal server error', 'en-gb': 'Internal server error'}, + 'Erreur interne': {'en-us': 'Internal error', 'en-gb': 'Internal error'}, + 'Réglages enregistrés avec succès': {'en-us': 'Settings saved successfully', 'en-gb': 'Settings saved successfully'}, + 'Réglages enregistrés': {'en-us': 'Settings saved successfully', 'en-gb': 'Settings saved successfully'}, + 'Personnalisation enregistrée sur le serveur': {'en-us': 'Customization saved to server', 'en-gb': 'Customisation saved to server'}, + 'Compteur de données remis à zéro': {'en-us': 'Data counter reset to zero', 'en-gb': 'Data counter reset to zero'}, + 'Limitations enregistrées': {'en-us': 'Limitations saved successfully', 'en-gb': 'Limitations saved successfully'}, + 'Limitations enregistrées avec succès': {'en-us': 'Limitations saved successfully', 'en-gb': 'Limitations saved successfully'}, + 'Erreur enregistrement limitations': {'en-us': 'Error saving limitations', 'en-gb': 'Error saving limitations'}, + 'Sauvegarde restaurée avec succès': {'en-us': 'Backup restored successfully', 'en-gb': 'Backup restored successfully'}, + 'Format de sauvegarde invalide': {'en-us': 'Invalid backup format', 'en-gb': 'Invalid backup format'}, + 'Fichier base de données introuvable': {'en-us': 'Database file not found', 'en-gb': 'Database file not found'}, + 'Appareil renommé avec succès': {'en-us': 'Device renamed successfully', 'en-gb': 'Device renamed successfully'}, + 'Appareil supprimé de l’historique': {'en-us': 'Device deleted from history', 'en-gb': 'Device deleted from history'}, + 'Type d’appareil modifié avec succès': {'en-us': 'Device type updated successfully', 'en-gb': 'Device type updated successfully'}, + 'Type d’appareil non valide': {'en-us': 'Invalid device type', 'en-gb': 'Invalid device type'}, + 'Le nom de la catégorie est obligatoire': {'en-us': 'Category name is required', 'en-gb': 'Category name is required'}, + 'Catégorie d’appareil enregistrée avec succès': {'en-us': 'Device category saved successfully', 'en-gb': 'Device category saved successfully'}, + 'Catégorie supprimée avec succès': {'en-us': 'Category deleted successfully', 'en-gb': 'Category deleted successfully'}, + 'Catégories réinitialisées avec succès': {'en-us': 'Categories reset to default successfully', 'en-gb': 'Categories reset to default successfully'}, + 'Assignation VPN du client mise à jour avec succès': {'en-us': 'Client VPN assignment updated successfully', 'en-gb': 'Client VPN assignment updated successfully'}, + 'Journaux supprimés': {'en-us': 'Logs cleared', 'en-gb': 'Logs cleared'}, + 'Toutes les données et le point d’accès ont été réinitialisés et supprimés': {'en-us': 'All data and the access point have been reset and removed', 'en-gb': 'All data and the access point have been reset and removed'}, + 'Double identification activée': {'en-us': 'Two-factor authentication enabled', 'en-gb': 'Two-factor authentication enabled'}, + 'Double identification désactivée': {'en-us': 'Two-factor authentication disabled', 'en-gb': 'Two-factor authentication disabled'}, + 'La 2FA n’est pas activée': {'en-us': '2FA is not enabled', 'en-gb': '2FA is not enabled'}, + 'Identifiants modifiés': {'en-us': 'Credentials updated', 'en-gb': 'Credentials updated'}, + 'Compte créé': {'en-us': 'Account created', 'en-gb': 'Account created'}, + 'Un compte existe déjà': {'en-us': 'An account already exists', 'en-gb': 'An account already exists'}, + 'Session déconnectée avec succès': {'en-us': 'Session logged out successfully', 'en-gb': 'Session logged out successfully'}, + 'Réglages des notifications enregistrés avec succès': {'en-us': 'Notification settings saved successfully', 'en-gb': 'Notification settings saved successfully'}, + 'Réglages du proxy inversé enregistrés avec succès !': {'en-us': 'Reverse proxy settings saved successfully!', 'en-gb': 'Reverse proxy settings saved successfully!'}, + 'SSID ou mot de passe Wi-Fi invalide': {'en-us': 'Invalid Wi-Fi SSID or password', 'en-gb': 'Invalid Wi-Fi SSID or password'}, + 'Sécurité Wi-Fi invalide': {'en-us': 'Invalid Wi-Fi security setting', 'en-gb': 'Invalid Wi-Fi security setting'}, + 'Délai d’attente dépassé': {'en-us': 'Request timed out', 'en-gb': 'Request timed out'}, + "Délai d'attente dépassé": {'en-us': 'Request timed out', 'en-gb': 'Request timed out'} +} + +def translate_api_text(text, lang='fr'): + if not text or not isinstance(text, str) or not lang or lang == 'fr': + return text + lang = lang.lower().strip() + if text in API_MSG_I18N: + return API_MSG_I18N[text].get(lang, API_MSG_I18N[text].get('en-us', text)) + for k, v in API_MSG_I18N.items(): + if k in text: + trans = v.get(lang, v.get('en-us', k)) + text = text.replace(k, trans) + return text + + class Handler(BaseHTTPRequestHandler): + def get_req_lang(self): + req_lang = self.headers.get('X-Language', '').strip().lower() + if not req_lang: + acc = self.headers.get('Accept-Language', '').strip().lower() + if acc: + req_lang = acc.split(',')[0].split(';')[0].strip() + if not req_lang: + try: req_lang = get_pref('language', 'fr') + except Exception: req_lang = 'fr' + return req_lang or 'fr' + def send_json(self, data, status=200): - body=json.dumps(data,ensure_ascii=False).encode(); self.send_response(status); self.send_header('Content-Type','application/json; charset=utf-8'); self.send_header('Access-Control-Allow-Origin','*'); self.send_header('Access-Control-Allow-Headers','Content-Type, X-Session-Token'); self.send_header('Access-Control-Allow-Methods','GET, POST, OPTIONS'); self.send_header('Content-Length',str(len(body))); self.end_headers(); self.wfile.write(body) + req_lang = self.get_req_lang() + if req_lang.startswith('en') and isinstance(data, dict): + data = dict(data) + if 'error' in data and isinstance(data['error'], str): + data['error'] = translate_api_text(data['error'], req_lang) + if 'message' in data and isinstance(data['message'], str): + data['message'] = translate_api_text(data['message'], req_lang) + body=json.dumps(data,ensure_ascii=False).encode(); self.send_response(status); self.send_header('Content-Type','application/json; charset=utf-8'); self.send_header('Access-Control-Allow-Origin','*'); self.send_header('Access-Control-Allow-Headers','Content-Type, X-Session-Token, X-Language, Accept-Language'); self.send_header('Access-Control-Allow-Methods','GET, POST, OPTIONS'); self.send_header('Content-Length',str(len(body))); self.end_headers(); self.wfile.write(body) def do_OPTIONS(self): self.send_response(204); self.send_header('Access-Control-Allow-Origin','*'); self.send_header('Access-Control-Allow-Headers','Content-Type, X-Session-Token'); self.send_header('Access-Control-Allow-Methods','GET, POST, OPTIONS'); self.end_headers() def do_GET(self): if self.path in ('/','/index.html','/ap_dashboard.html'): try: body=open(os.path.join(os.path.dirname(__file__),'index.html'),'rb').read(); self.send_response(200); self.send_header('Content-Type','text/html; charset=utf-8'); self.send_header('Content-Length',str(len(body))); self.end_headers(); self.wfile.write(body) except OSError: self.send_error(404,'index.html introuvable') return + if self.path in ('/setup', '/setup.html', '/Setup.html', '/Setup.HTML'): + try: + body = open(os.path.join(os.path.dirname(__file__), 'setup.html'), 'rb').read() + self.send_response(200) + self.send_header('Content-Type', 'text/html; charset=utf-8') + self.send_header('Content-Length', str(len(body))) + self.end_headers() + self.wfile.write(body) + except OSError: + self.send_error(404, 'setup.html introuvable') + return + if self.path.startswith('/lang/'): + clean_name = os.path.basename(urllib.parse.urlparse(self.path).path) + lang_path = os.path.join(os.path.dirname(__file__), 'lang', clean_name) + if os.path.isfile(lang_path) and clean_name.endswith('.js'): + try: + body = open(lang_path, 'rb').read() + self.send_response(200) + self.send_header('Content-Type', 'application/javascript; charset=utf-8') + self.send_header('Content-Length', str(len(body))) + self.end_headers() + self.wfile.write(body) + return + except OSError: pass + self.send_error(404, 'Fichier de langue introuvable') + return + if self.path == '/favicon.png' or self.path.startswith('/images/'): + clean_name = 'favicon.png' if self.path == '/favicon.png' else os.path.basename(urllib.parse.urlparse(self.path).path) + img_path = os.path.join(os.path.dirname(__file__), 'images', clean_name) + ext = os.path.splitext(clean_name)[1].lower() + mime_map = {'.png': 'image/png', '.svg': 'image/svg+xml', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.webp': 'image/webp', '.ico': 'image/x-icon'} + if os.path.isfile(img_path) and ext in mime_map: + try: + body = open(img_path, 'rb').read() + self.send_response(200) + self.send_header('Content-Type', mime_map[ext]) + self.send_header('Content-Length', str(len(body))) + self.end_headers() + self.wfile.write(body) + return + except OSError: pass + if self.path.startswith('/images/'): + self.send_error(404, 'Image introuvable') + return if self.path == '/api/auth/status': self.send_json(auth_state()); return + if self.path == '/api/device-types': + c = db() + rows = c.execute('SELECT id, label, icon, desc, sort_order FROM custom_device_types ORDER BY sort_order ASC, id ASC').fetchall() + c.close() + items = [{'id': r[0], 'label': r[1], 'icon': r[2], 'desc': r[3], 'sort_order': r[4]} for r in rows] + self.send_json({'ok': True, 'device_types': items}); return + if self.path.startswith('/api/icons/search'): + parsed = urllib.parse.urlparse(self.path) + qs = urllib.parse.parse_qs(parsed.query) + q = (qs.get('q', [''])[0]).strip() + limit = min(int(qs.get('limit', ['36'])[0]), 64) + icons = search_iconify_icons(q, limit=limit) + self.send_json({'ok': True, 'icons': icons, 'total': len(icons)}) + return + if self.path.startswith('/api/icons/svg'): + parsed = urllib.parse.urlparse(self.path) + qs = urllib.parse.parse_qs(parsed.query) + name = (qs.get('name', [''])[0]).strip() + color = (qs.get('color', [''])[0]).strip() + as_json = (qs.get('format', [''])[0]).strip().lower() == 'json' or 'application/json' in self.headers.get('Accept', '') + if not name: + if as_json: self.send_json({'error': 'Nom d\'icône manquant'}, 400) + else: self.send_error(400, 'Nom d\'icône manquant') + return + svg_content = fetch_iconify_svg(name, color=color) + if as_json: + self.send_json({'ok': True, 'svg': svg_content, 'name': name}) + else: + svg_bytes = svg_content.encode('utf-8') + self.send_response(200) + self.send_header('Content-Type', 'image/svg+xml; charset=utf-8') + self.send_header('Cache-Control', 'public, max-age=86400') + self.send_header('Content-Length', str(len(svg_bytes))) + self.end_headers() + self.wfile.write(svg_bytes) + return + if self.path.startswith('/api/backup/export'): + if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + parsed = urllib.parse.urlparse(self.path) + qs = urllib.parse.parse_qs(parsed.query) + fmt = (qs.get('format', ['zip'])[0]).strip().lower() + now_str = time.strftime('%Y%m%d-%H%M%S') + if fmt == 'sqlite': + if os.path.exists(DB_FILE): + try: + with open(DB_FILE, 'rb') as f: + content = f.read() + self.send_response(200) + self.send_header('Content-Type', 'application/x-sqlite3') + self.send_header('Content-Disposition', f'attachment; filename="ap-manageur-database-{now_str}.sqlite3"') + self.send_header('Content-Length', str(len(content))) + self.end_headers() + self.wfile.write(content) + log('export_base_sqlite', username(self) or 'Administrateur', request_ip(self), 'SYSTEM') + return + except Exception as e: + self.send_json({'error': f'Erreur export SQLite: {e}'}, 500); return + else: + self.send_json({'error': 'Fichier base de données introuvable'}, 404); return + elif fmt == 'json': + try: + backup = export_backup_data() + json_bytes = json.dumps(backup, ensure_ascii=False, indent=2).encode('utf-8') + self.send_response(200) + self.send_header('Content-Type', 'application/json; charset=utf-8') + self.send_header('Content-Disposition', f'attachment; filename="ap-manageur-backup-{now_str}.json"') + self.send_header('Content-Length', str(len(json_bytes))) + self.end_headers() + self.wfile.write(json_bytes) + log('export_configuration_json', username(self) or 'Administrateur', request_ip(self), 'SYSTEM') + return + except Exception as e: + self.send_json({'error': f'Erreur génération sauvegarde: {e}'}, 500); return + else: + # Format par défaut : Archive ZIP unifiée (Configuration JSON + Base SQLite brute) + try: + backup = export_backup_data() + json_bytes = json.dumps(backup, ensure_ascii=False, indent=2).encode('utf-8') + buf = io.BytesIO() + with zipfile.ZipFile(buf, 'w', zipfile.ZIP_DEFLATED) as zf: + zf.writestr('configuration.json', json_bytes) + if os.path.exists(DB_FILE): + try: + with open(DB_FILE, 'rb') as f_db: + zf.writestr('ap-dashboard.sqlite3', f_db.read()) + except Exception as e_db: + print(f"[backup] Inclusion sqlite impossible : {e_db}", flush=True) + readme_text = ( + f"Sauvegarde AP Manageur ({APP_VERSION})\n" + f"Date d'export : {datetime.datetime.now(datetime.timezone.utc).strftime('%Y-%m-%d %H:%M:%S UTC')}\n\n" + "Contenu de cette archive :\n" + "- configuration.json : Configuration complète (profils VPN WireGuard & OpenVPN, routage appareils, noms et logos des équipements, catégories, blocage et réglages système).\n" + "- ap-dashboard.sqlite3 : Base de données SQLite brute complète.\n\n" + "Restauration :\n" + "Vous pouvez importer directement cette archive .zip (ou le fichier configuration.json) " + "dans AP Manageur (Réglages > Zone dangereuse > Importer une sauvegarde).\n" + ) + zf.writestr('README.txt', readme_text.encode('utf-8')) + zip_bytes = buf.getvalue() + self.send_response(200) + self.send_header('Content-Type', 'application/zip') + self.send_header('Content-Disposition', f'attachment; filename="ap-manageur-sauvegarde-{now_str}.zip"') + self.send_header('Content-Length', str(len(zip_bytes))) + self.end_headers() + self.wfile.write(zip_bytes) + log('export_sauvegarde_complete', username(self) or 'Administrateur', request_ip(self), 'SYSTEM') + return + except Exception as e: + self.send_json({'error': f'Erreur génération archive ZIP: {e}'}, 500); return + if self.path in ('/api/auth/admin', '/api/auth/user'): + if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + c = db() + row = c.execute('SELECT username FROM auth_users LIMIT 1').fetchone() + c.close() + admin_user = row[0] if row else (username(self) or 'admin') + self.send_json({'ok': True, 'username': admin_user}); return if self.path == '/api/auth/sessions': if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return - self.send_json(list_sessions(extract_token(self))); return - if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + self.send_json(list_sessions(extract_token(self), self.get_req_lang())); return + if self.path == '/api/auth/passkey/list': + if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + u = username(self) or 'admin' + c = db() + rows = c.execute('SELECT id, name, device_type, sign_count, created_at, last_used_at FROM auth_passkeys WHERE username=? ORDER BY created_at DESC', (u,)).fetchall() + c.close() + is_en = self.get_req_lang().startswith('en') + never_label = 'Never' if is_en else 'Jamais' + items = [{'id': r[0], 'name': r[1], 'device_type': r[2], 'sign_count': r[3], 'created_at': r[4], 'last_used_at': r[5] or never_label} for r in rows] + self.send_json({'ok': True, 'passkeys': items}); return + if self.path == '/api/settings/proxy': + if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + cfg = get_reverse_proxy_config() + raw_sock = self.client_address[0] if hasattr(self, 'client_address') and self.client_address else '127.0.0.1' + raw_direct = self.headers.get('X-Client-Raw-IP', '').strip() + self.send_json({ + 'ok': True, + 'config': cfg, + 'detected': { + 'real_ip': request_ip(self), + 'raw_direct_ip': raw_direct or raw_sock, + 'socket_ip': raw_sock, + 'x_client_raw_ip': raw_direct or '—', + 'x_forwarded_for': self.headers.get('X-Forwarded-For', '') or '—', + 'x_real_ip': self.headers.get('X-Real-IP', '') or '—', + 'cf_connecting_ip': self.headers.get('CF-Connecting-IP', '') or '—', + 'true_client_ip': self.headers.get('True-Client-IP', '') or '—', + 'x_forwarded_proto': self.headers.get('X-Forwarded-Proto', '') or '—', + 'host': self.headers.get('X-Forwarded-Host', '') or self.headers.get('Host', '') or '—' + } + }) + return path_only = self.path.split('?')[0] + if path_only == '/api/preferences': + c=db(); rows=dict(c.execute("SELECT key,value FROM preferences").fetchall()); c.close() + self.send_json({ + 'theme': rows.get('theme', 'dark'), + 'language': rows.get('language', 'fr'), + 'app_name': rows.get('app_name', 'Administration de l’AP Wi‑Fi'), + 'app_short_name': rows.get('app_short_name', 'AP Manageur') + }) + return + if path_only == '/api/notifications/settings': + if auth_state().get('configured') and not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + self.send_json(get_notifications_settings_public()) + return + if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return if path_only == '/api/status': self.send_json(status()) elif path_only == '/api/clients': self.send_json(clients()) elif path_only == '/api/clients/blocked': self.send_json(blocked_list()) + elif path_only == '/api/devices': self.send_json(all_devices(self.get_req_lang())) + elif path_only == '/api/devices/limits': + parsed = urllib.parse.urlparse(self.path) + qs = urllib.parse.parse_qs(parsed.query) + target_mac = (qs.get('mac', [''])[0]).strip().upper() + lim = get_client_limits_dict(target_mac) + self.send_json({'ok': True, 'mac': target_mac, 'limits': lim}) elif path_only == '/api/logs': self.send_json(logs()) elif path_only == '/api/stats': self.send_json(stats()) elif path_only == '/api/network/topology': self.send_json(network_topology()) @@ -5160,22 +7426,15 @@ class Handler(BaseHTTPRequestHandler): self.send_json({'ok': False, 'error': 'Tunnel VPN déconnecté'}); return force = qs.get('force', ['1'])[0] == '1' ip = get_vpn_public_ip(iface, force_refresh=force) - hs = get_wireguard_handshake_info(iface) if prof['type'] == 'wireguard' else None + hs, hs_sec = get_wireguard_handshake_info(iface) if prof['type'] == 'wireguard' else (None, None) if ip: geo = get_ip_geo(ip) - self.send_json({'ok': True, 'public_ip': ip, 'public_ip_geo': geo, 'handshake': hs, 'iface': iface}) + self.send_json({'ok': True, 'public_ip': ip, 'public_ip_geo': geo, 'handshake': hs, 'handshake_age_seconds': hs_sec, 'iface': iface}) else: - self.send_json({'ok': False, 'error': 'IP publique introuvable via ce tunnel', 'handshake': hs, 'iface': iface}) + self.send_json({'ok': False, 'error': 'IP publique introuvable via ce tunnel', 'handshake': hs, 'handshake_age_seconds': hs_sec, 'iface': iface}) return elif path_only == '/api/notifications/settings': self.send_json(get_notifications_settings_public()) - elif path_only == '/api/preferences': - c=db(); rows=dict(c.execute("SELECT key,value FROM preferences").fetchall()); c.close() - self.send_json({ - 'theme': rows.get('theme', 'dark'), - 'app_name': rows.get('app_name', 'Administration de l’AP Wi‑Fi'), - 'app_short_name': rows.get('app_short_name', 'AP Manageur') - }) elif path_only == '/api/advanced/capture/status': with capture_lock: wifi_if = capture_iface_used or get_wifi_interface() @@ -5211,13 +7470,13 @@ class Handler(BaseHTTPRequestHandler): qs = urllib.parse.parse_qs(parsed.query) try: since = int(qs.get('since', [0])[0]) except Exception: since = 0 - try: limit = min(2000, max(1, int(qs.get('limit', [200])[0]))) - except Exception: limit = 200 + try: limit = min(50000, max(1, int(qs.get('limit', [1000])[0]))) + except Exception: limit = 1000 with capture_lock: if since > 0: - pkts = [p for p in capture_packets if p['id'] > since][-limit:] + pkts = [p for p in capture_packets if p['id'] > since][:limit] else: - pkts = list(capture_packets[-limit:]) + pkts = list(capture_packets[-limit:] if limit < len(capture_packets) else capture_packets) running = capture_running buf_count = len(capture_packets) tot_count = capture_id_counter @@ -5303,6 +7562,183 @@ class Handler(BaseHTTPRequestHandler): c_name = str(data.get('device_name', '')).strip() or urllib.parse.unquote(self.headers.get('X-Device-Name', '')) dispatch_notification('admin_login', "🔒 Connexion au compte administrateur", f"Connexion réussie au compte administrateur « {row[0]} ».", details={"Compte": row[0], "Machine": c_name or "Machine non spécifiée", "Adresse IP": request_ip(self), "Navigateur": parse_browser(self.headers.get('User-Agent', '')), "Date": time.strftime('%d/%m/%Y %H:%M:%S')}, priority=5, level="info") self.send_json({'ok':True,'token':new_session(row[0], request_ip(self), self.headers.get('User-Agent',''), c_name),'used_recovery':used_recovery}); return + if self.path == '/api/auth/passkey/login/options': + c = db() + pks = c.execute('SELECT id FROM auth_passkeys').fetchall() + c.close() + if not pks: + raise ValueError('Aucune Passkey n’est encore enregistrée sur ce système. Connectez-vous d’abord avec vos identifiants administrateur pour en ajouter une dans Réglages > Compte Administrateur.') + now = time.time() + for k in [k for k, v in passkey_pending_challenges.items() if now - v.get('time', 0) > 120]: + passkey_pending_challenges.pop(k, None) + raw_chal = secrets.token_bytes(32) + chal_b64 = b64url_encode(raw_chal) + passkey_pending_challenges[chal_b64] = {'type': 'login', 'time': time.time()} + req_host = (self.headers.get('Host') or '').split(':')[0] or 'localhost' + options = { + 'ok': True, + 'challenge': chal_b64, + 'rpId': req_host, + 'timeout': 60000, + 'userVerification': 'preferred', + 'allowCredentials': [{'type': 'public-key', 'id': r[0]} for r in pks] + } + self.send_json(options); return + if self.path == '/api/auth/passkey/login/verify': + c_data_b64 = data.get('response', {}).get('clientDataJSON', '') + if not c_data_b64: raise ValueError('Données clientData manquantes') + c_data_raw = b64url_decode(c_data_b64) + c_data = json.loads(c_data_raw.decode('utf-8')) + if c_data.get('type') != 'webauthn.get': + raise ValueError('Type d’opération clientData invalide') + chal = c_data.get('challenge', '') + p_info = passkey_pending_challenges.pop(chal, None) + if not p_info or p_info.get('type') != 'login': + raise ValueError('Challenge invalide ou expiré. Veuillez réessayer.') + cred_id = str(data.get('id', '')).strip() + c = db() + row = c.execute('SELECT id, username, public_key, name, sign_count FROM auth_passkeys WHERE id=?', (cred_id,)).fetchone() + if not row: + c.close() + raise ValueError('Passkey inconnue ou non enregistrée') + u = row[1] + pk_info = json.loads(row[2]) + auth_data_raw = b64url_decode(data.get('response', {}).get('authenticatorData', '')) + sig_raw = b64url_decode(data.get('response', {}).get('signature', '')) + if len(auth_data_raw) < 37: + c.close(); raise ValueError('authenticatorData invalide') + flags = auth_data_raw[32] + if not (flags & 0x01): + c.close(); raise ValueError('Présence utilisateur non vérifiée par le capteur') + c_data_hash = hashlib.sha256(c_data_raw).digest() + signed_data = auth_data_raw + c_data_hash + valid_sig = False + if pk_info.get('alg') == 'ES256': + pub_x = b64url_decode(pk_info['x']) + pub_y = b64url_decode(pk_info['y']) + valid_sig = verify_es256_signature(pub_x, pub_y, sig_raw, signed_data) + elif pk_info.get('alg') == 'RS256': + n_bytes = b64url_decode(pk_info['n']) + e_bytes = b64url_decode(pk_info['e']) + valid_sig = verify_rs256_signature(n_bytes, e_bytes, sig_raw, signed_data) + if not valid_sig: + c.close() + log('echec_connexion_passkey', u, request_ip(self), 'AUTH') + raise ValueError('Signature biométrique ou cryptographique de la Passkey invalide') + new_count = int.from_bytes(auth_data_raw[33:37], 'big') + now_str = time.strftime('%Y-%m-%d %H:%M:%S') + c.execute('UPDATE auth_passkeys SET sign_count=?, last_used_at=? WHERE id=?', (new_count, now_str, cred_id)) + c.commit(); c.close() + c_name = str(data.get('device_name', '')).strip() or urllib.parse.unquote(self.headers.get('X-Device-Name', '')) + dispatch_notification('admin_login', "🔑 Connexion par Passkey réussie", f"Connexion immédiate par Passkey « {row[3]} » sans mot de passe ni 2FA.", details={"Compte": u, "Passkey": row[3], "Machine": c_name or "Machine non spécifiée", "Adresse IP": request_ip(self), "Navigateur": parse_browser(self.headers.get('User-Agent', '')), "Date": time.strftime('%d/%m/%Y %H:%M:%S')}, priority=5, level="info") + log('connexion_passkey', u, request_ip(self), 'AUTH') + tok = new_session(u, request_ip(self), self.headers.get('User-Agent', ''), c_name) + self.send_json({'ok': True, 'token': tok, 'message': f'Authentification réussie avec « {row[3]} » !'}); return + if self.path == '/api/auth/passkey/register/options': + if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + u = username(self) or 'admin' + now = time.time() + for k in [k for k, v in passkey_pending_challenges.items() if now - v.get('time', 0) > 120]: + passkey_pending_challenges.pop(k, None) + raw_chal = secrets.token_bytes(32) + chal_b64 = b64url_encode(raw_chal) + passkey_pending_challenges[chal_b64] = {'type': 'register', 'username': u, 'time': time.time()} + req_host = (self.headers.get('Host') or '').split(':')[0] or 'localhost' + options = { + 'ok': True, + 'challenge': chal_b64, + 'rp': {'name': 'AP Manageur', 'id': req_host}, + 'user': { + 'id': b64url_encode(u.encode('utf-8')), + 'name': u, + 'displayName': u + }, + 'pubKeyCredParams': [ + {'type': 'public-key', 'alg': -7}, + {'type': 'public-key', 'alg': -257} + ], + 'timeout': 60000, + 'attestation': 'none', + 'authenticatorSelection': { + 'residentKey': 'preferred', + 'userVerification': 'preferred' + } + } + self.send_json(options); return + if self.path == '/api/auth/passkey/register/verify': + if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + u = username(self) or 'admin' + c_data_b64 = data.get('response', {}).get('clientDataJSON', '') + if not c_data_b64: raise ValueError('Données clientData manquantes') + c_data_raw = b64url_decode(c_data_b64) + c_data = json.loads(c_data_raw.decode('utf-8')) + if c_data.get('type') != 'webauthn.create': + raise ValueError('Type clientData incorrect') + chal = c_data.get('challenge', '') + p_info = passkey_pending_challenges.pop(chal, None) + if not p_info or p_info.get('type') != 'register' or p_info.get('username') != u: + raise ValueError('Challenge invalide ou expiré') + att_raw = b64url_decode(data.get('response', {}).get('attestationObject', '')) + att_obj, _ = decode_cbor(att_raw) + auth_data = att_obj.get('authData', b'') + if len(auth_data) < 55: + raise ValueError('authData trop court') + flags = auth_data[32] + if not (flags & 0x01): raise ValueError('Présence utilisateur non vérifiée') + if not (flags & 0x40): raise ValueError('Données d’attestation absentes') + id_len = int.from_bytes(auth_data[53:55], 'big') + cred_id = auth_data[55:55+id_len] + cred_id_b64 = b64url_encode(cred_id) + cose_map, _ = decode_cbor(auth_data[55+id_len:]) + alg = cose_map.get(3) + if alg == -7: + x_bytes = cose_map.get(-2, b'') + y_bytes = cose_map.get(-3, b'') + if len(x_bytes) != 32 or len(y_bytes) != 32: + raise ValueError('Coordonnées de clé publique P-256 invalides') + pk_stored = json.dumps({'kty': 'EC', 'crv': 'P-256', 'alg': 'ES256', 'x': b64url_encode(x_bytes), 'y': b64url_encode(y_bytes)}) + elif alg == -257: + n_bytes = cose_map.get(-1, b'') + e_bytes = cose_map.get(-2, b'') + pk_stored = json.dumps({'kty': 'RSA', 'alg': 'RS256', 'n': b64url_encode(n_bytes), 'e': b64url_encode(e_bytes)}) + else: + raise ValueError(f'Algorithme cryptographique non supporté : {alg}') + p_name = (data.get('name') or '').strip() or 'Passkey' + now_str = time.strftime('%Y-%m-%d %H:%M:%S') + c = db() + c.execute(''' + INSERT INTO auth_passkeys(id, username, public_key, name, device_type, sign_count, created_at, last_used_at) + VALUES(?, ?, ?, ?, "security_key", 0, ?, "") + ON CONFLICT(id) DO UPDATE SET public_key=excluded.public_key, name=excluded.name + ''', (cred_id_b64, u, pk_stored, p_name, now_str)) + c.commit(); c.close() + log('passkey_enregistree', f"{u} ({p_name})", request_ip(self), 'AUTH') + self.send_json({'ok': True, 'message': f'Passkey « {p_name} » enregistrée avec succès !'}); return + if self.path == '/api/auth/passkey/delete': + if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + cred_id = str(data.get('id', '')).strip() + if not cred_id: raise ValueError('Identifiant de Passkey manquant') + c = db() + c.execute('DELETE FROM auth_passkeys WHERE id=?', (cred_id,)) + c.commit(); c.close() + log('passkey_supprimee', username(self) or 'admin', request_ip(self), 'AUTH') + self.send_json({'ok': True, 'message': 'Passkey supprimée avec succès'}); return + if self.path == '/api/auth/passkey/rename': + if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + cred_id = str(data.get('id', '')).strip() + new_name = str(data.get('name', '')).strip() + if not cred_id: raise ValueError('Identifiant de Passkey manquant') + if not new_name: raise ValueError('Le nom de la clé ne peut pas être vide') + c = db() + row = c.execute('SELECT name FROM auth_passkeys WHERE id=?', (cred_id,)).fetchone() + if not row: + c.close() + raise ValueError('Passkey introuvable') + old_name = row[0] + c.execute('UPDATE auth_passkeys SET name=? WHERE id=?', (new_name, cred_id)) + c.commit(); c.close() + log('passkey_renommee', f"{username(self) or 'admin'} ({old_name} -> {new_name})", request_ip(self), 'AUTH') + self.send_json({'ok': True, 'message': 'Clé de sécurité renommée avec succès'}); return if self.path == '/api/logout': log('deconnexion_admin', username(self) or 'Administrateur', request_ip(self), 'AUTH') delete_session(self.headers.get('X-Session-Token','')) @@ -5346,6 +7782,124 @@ class Handler(BaseHTTPRequestHandler): return if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return if self.path == '/api/clients/block': set_blocked(str(data.get('mac','')),bool(data.get('blocked',True))); self.send_json({'ok':True}); return + if self.path == '/api/devices/limits': + mac = str(data.get('mac', '')).strip().upper() + if not re.fullmatch(r'[0-9A-F]{2}(:[0-9A-F]{2}){5}', mac): + self.send_json({'error': 'Adresse MAC invalide'}, 400); return + try: + updated_lim = save_client_limits(mac, data) + name, ip = known_device(mac) + log('limites_appareil_modifiees', name, ip, mac) + self.send_json({'ok': True, 'message': 'Limitations enregistrées avec succès', 'limits': updated_lim}) + except Exception as e: + self.send_json({'error': f'Erreur enregistrement limitations : {e}'}, 400) + return + if self.path == '/api/devices/rename': + mac = str(data.get('mac', '')).strip().upper() + new_name = str(data.get('name', '')).strip() + if not mac: raise ValueError('Adresse MAC manquante') + if not new_name: raise ValueError('Nom manquant') + c = db() + c.execute('INSERT INTO client_names(mac, name, last_ip, last_seen) VALUES(?, ?, "Non attribuée", ?) ON CONFLICT(mac) DO UPDATE SET name=excluded.name', (mac, new_name, time.strftime('%Y-%m-%d %H:%M:%S'))) + c.commit(); c.close() + self.send_json({'ok': True, 'message': 'Appareil renommé avec succès'}); return + if self.path == '/api/devices/set_type': + mac = str(data.get('mac', '')).strip().upper() + dev_type = str(data.get('device_type', '')).strip().lower() + if not mac: raise ValueError('Adresse MAC manquante') + c = db() + known_types = {r[0] for r in c.execute('SELECT id FROM custom_device_types').fetchall()} + known_types.update({'', 'generic', 'phone', 'tablet', 'laptop', 'desktop', 'tv', 'console', 'iot'}) + if dev_type not in known_types: + c.close() + raise ValueError(f'Type d’appareil non valide : {dev_type}') + cn_cols = {row[1] for row in c.execute('PRAGMA table_info(client_names)').fetchall()} + if 'device_type' not in cn_cols: + try: + c.execute('ALTER TABLE client_names ADD COLUMN device_type TEXT DEFAULT ""') + c.commit() + except Exception: pass + default_name = 'Client ' + mac.replace(':', '')[-4:] + c.execute(''' + INSERT INTO client_names(mac, name, last_ip, last_seen, device_type) + VALUES(?, ?, "Non attribuée", ?, ?) + ON CONFLICT(mac) DO UPDATE SET device_type=excluded.device_type + ''', (mac, default_name, time.strftime('%Y-%m-%d %H:%M:%S'), dev_type)) + c.commit(); c.close() + self.send_json({'ok': True, 'message': 'Type d’appareil modifié avec succès', 'device_type': dev_type}); return + if self.path == '/api/device-types/save': + if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + label = str(data.get('label', '')).strip() + icon = str(data.get('icon', '')).strip() or '💻' + desc = str(data.get('desc', '')).strip() + raw_id = str(data.get('id', '')).strip().lower() + orig_id = str(data.get('original_id', '')).strip().lower() + if not label: raise ValueError('Le nom de la catégorie est obligatoire') + if not raw_id: + raw_id = re.sub(r'[^a-z0-9_-]', '', label.lower().replace(' ', '_'))[:24] + if not raw_id: + raw_id = f"type_{int(time.time())}" + if not re.fullmatch(r'[a-z0-9_-]{2,32}', raw_id): + raise ValueError("L'identifiant doit contenir entre 2 et 32 caractères alphanumériques (minuscules, tirets ou underscores)") + c = db() + if orig_id and orig_id != raw_id: + c.execute('UPDATE client_names SET device_type=? WHERE device_type=?', (raw_id, orig_id)) + c.execute('DELETE FROM custom_device_types WHERE id=?', (orig_id,)) + existing = c.execute('SELECT sort_order FROM custom_device_types WHERE id=?', (raw_id,)).fetchone() + if existing: + sort_order = existing[0] + else: + max_order = c.execute('SELECT COALESCE(MAX(sort_order), 0) FROM custom_device_types').fetchone()[0] + sort_order = max_order + 1 + c.execute(''' + INSERT INTO custom_device_types(id, label, icon, desc, sort_order) + VALUES(?, ?, ?, ?, ?) + ON CONFLICT(id) DO UPDATE SET label=excluded.label, icon=excluded.icon, desc=excluded.desc + ''', (raw_id, label, icon, desc, sort_order)) + c.commit(); c.close() + log('categorie_appareil_enregistree', f"{username(self) or 'admin'} ({label})", request_ip(self), 'SETTINGS') + self.send_json({'ok': True, 'message': 'Catégorie d’appareil enregistrée avec succès', 'id': raw_id}); return + if self.path == '/api/device-types/delete': + if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + tid = str(data.get('id', '')).strip().lower() + if not tid: raise ValueError("Identifiant manquant") + c = db() + count = c.execute('SELECT COUNT(*) FROM custom_device_types').fetchone()[0] + if count <= 1: + c.close() + raise ValueError("Impossible de supprimer la dernière catégorie d'appareil") + c.execute("UPDATE client_names SET device_type='generic' WHERE device_type=?", (tid,)) + c.execute('DELETE FROM custom_device_types WHERE id=?', (tid,)) + c.commit(); c.close() + log('categorie_appareil_supprimee', f"{username(self) or 'admin'} ({tid})", request_ip(self), 'SETTINGS') + self.send_json({'ok': True, 'message': 'Catégorie supprimée avec succès'}); return + if self.path == '/api/device-types/reset': + if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + c = db() + c.execute('DELETE FROM custom_device_types') + defaults = [ + ('phone', 'Smartphone', '📱', 'iPhone, Android, Galaxy...', 1), + ('tablet', 'Tablette', 'tablet_svg', 'iPad, Galaxy Tab, Kindle...', 2), + ('laptop', 'PC Portable', '💻', 'MacBook, ThinkPad, Laptop...', 3), + ('desktop', 'Ordinateur fixe', '🖥️', 'PC Bureau, Mac Pro, Tour...', 4), + ('tv', 'Smart TV / Box', '📺', 'Apple TV, Chromecast, Box...', 5), + ('console', 'Console de jeux', '🎮', 'PlayStation, Switch, Xbox...', 6), + ('iot', 'Objet connecté', '📟', 'IoT, Caméra, Domotique, RPi...', 7), + ('generic', 'Standard / Autre', '💻', 'Appareil générique / inconnu', 8) + ] + c.executemany('INSERT INTO custom_device_types(id, label, icon, desc, sort_order) VALUES(?,?,?,?,?)', defaults) + c.commit(); c.close() + log('categories_appareils_reinitialisees', username(self) or 'admin', request_ip(self), 'SETTINGS') + self.send_json({'ok': True, 'message': 'Catégories réinitialisées avec succès'}); return + if self.path == '/api/devices/delete': + mac = str(data.get('mac', '')).strip().upper() + if not mac: raise ValueError('Adresse MAC manquante') + c = db() + c.execute('DELETE FROM client_names WHERE UPPER(mac)=?', (mac,)) + c.execute('DELETE FROM client_traffic WHERE UPPER(mac)=?', (mac,)) + c.execute('DELETE FROM client_traffic_daily WHERE UPPER(mac)=?', (mac,)) + c.commit(); c.close() + self.send_json({'ok': True, 'message': 'Appareil supprimé de l’historique'}); return if self.path == '/api/advanced/capture/start': target_iface = (data.get('interface') or '').strip() if isinstance(data, dict) else '' ok, msg = start_capture(target_iface or None) @@ -5374,11 +7928,28 @@ class Handler(BaseHTTPRequestHandler): elif action == 'stop': try: os.remove(UPTIME_FILE) except OSError: pass + invalidate_status_cache() log({'start':'démarrage','stop':'arrêt','restart':'redémarrage'}.get(action,'action'), 'Point d’accès Wi-Fi', ip=request_ip(self), mac='AP'); self.send_json({'ok':True}); return if self.path == '/api/setup': self.send_json({'ok':True,'message':'Configuration enregistrée','connection':configure_ap(data,True,caller_ip=request_ip(self))}); return if self.path == '/api/settings': self.send_json({'ok':True,'message':'Réglages enregistrés','connection':configure_ap(data,caller_ip=request_ip(self))}); return - if self.path == '/api/vpn/profiles': + if self.path == '/api/settings/proxy': if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + enabled = '1' if data.get('enabled') else '0' + header = str(data.get('header', 'auto')).strip().lower() + valid_hdrs = {'auto', 'x-forwarded-for', 'x-real-ip', 'cf-connecting-ip', 'true-client-ip'} + if header not in valid_hdrs: header = 'auto' + trust_private = '1' if data.get('trust_all_private', True) else '0' + trusted_proxies = str(data.get('trusted_proxies', '')).strip() + c = db() + c.execute("INSERT INTO preferences(key, value) VALUES('reverse_proxy_enabled', ?) ON CONFLICT(key) DO UPDATE SET value=excluded.value", (enabled,)) + c.execute("INSERT INTO preferences(key, value) VALUES('reverse_proxy_header', ?) ON CONFLICT(key) DO UPDATE SET value=excluded.value", (header,)) + c.execute("INSERT INTO preferences(key, value) VALUES('reverse_proxy_trust_all_private', ?) ON CONFLICT(key) DO UPDATE SET value=excluded.value", (trust_private,)) + c.execute("INSERT INTO preferences(key, value) VALUES('reverse_proxy_trusted_proxies', ?) ON CONFLICT(key) DO UPDATE SET value=excluded.value", (trusted_proxies,)) + c.commit(); c.close() + log('configuration_proxy_inverse_modifiee', username(self) or 'Administrateur', request_ip(self), 'SETTINGS') + self.send_json({'ok': True, 'message': 'Réglages du proxy inversé enregistrés avec succès !'}); return + if self.path == '/api/vpn/profiles': + if not valid_session(self) and auth_state()['configured']: self.send_json({'error':'Authentification requise'},401); return pid = create_or_update_vpn_profile(data) self.send_json({'ok': True, 'message': 'Profil VPN enregistré avec succès', 'id': pid}); return if self.path == '/api/vpn/profiles/delete': @@ -5406,14 +7977,14 @@ class Handler(BaseHTTPRequestHandler): if not is_iface_up(iface): self.send_json({'ok': False, 'error': 'Le tunnel VPN est actuellement déconnecté'}); return ip = get_vpn_public_ip(iface, force_refresh=True) - hs = get_wireguard_handshake_info(iface) if prof['type'] == 'wireguard' else None + hs, hs_sec = get_wireguard_handshake_info(iface) if prof['type'] == 'wireguard' else (None, None) if ip: - self.send_json({'ok': True, 'public_ip': ip, 'handshake': hs, 'iface': iface}) + self.send_json({'ok': True, 'public_ip': ip, 'handshake': hs, 'handshake_age_seconds': hs_sec, 'iface': iface}) else: err = 'Impossible de joindre Internet via ce tunnel VPN. ' if hs: err += f"({hs}). " err += "Vérifiez que le serveur VPN distant est actif et que les clés/AllowedIPs sont correctes." - self.send_json({'ok': False, 'error': err, 'handshake': hs, 'iface': iface}) + self.send_json({'ok': False, 'error': err, 'handshake': hs, 'handshake_age_seconds': hs_sec, 'iface': iface}) return if self.path == '/api/vpn/clients/assign': if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return @@ -5423,11 +7994,11 @@ class Handler(BaseHTTPRequestHandler): assign_client_vpn(mac, pid, ks) self.send_json({'ok': True, 'message': 'Assignation VPN du client mise à jour avec succès'}); return if self.path == '/api/notifications/settings': - if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + if auth_state().get('configured') and not valid_session(self): self.send_json({'error':'Authentification requise'},401); return save_notifications_settings(data) self.send_json({'ok':True, 'message':'Réglages des notifications enregistrés avec succès'}); return if self.path == '/api/notifications/test': - if not valid_session(self): self.send_json({'error':'Authentification requise'},401); return + if auth_state().get('configured') and not valid_session(self): self.send_json({'error':'Authentification requise'},401); return channel = str(data.get('channel', 'all')).strip().lower() test_cfg = data.get('config') results = test_notifications(channel, test_config=test_cfg) @@ -5481,6 +8052,40 @@ class Handler(BaseHTTPRequestHandler): with traffic_lock: station_traffic.clear() log('reinitialisation_donnees', 'Système', request_ip(self), 'SYSTEM') self.send_json({'ok':True,'message':'Toutes les données et le point d’accès ont été réinitialisés et supprimés'}); return + if self.path == '/api/backup/inspect': + if not valid_session(self) and auth_state()['configured']: self.send_json({'error':'Authentification requise'},401); return + fname = str(data.get('filename', 'sauvegarde')).strip() + b64_content = str(data.get('data_base64', '')).strip() + raw_json = data.get('backup') + if raw_json and isinstance(raw_json, dict): + self.send_json({'ok': True, 'filename': fname, 'backup': raw_json}); return + if not b64_content: + self.send_json({'error': 'Contenu du fichier manquant'}, 400); return + try: + raw_bytes = base64.b64decode(b64_content) + backup = inspect_backup_bytes(raw_bytes, fname) + self.send_json({'ok': True, 'filename': fname, 'backup': backup}) + except Exception as e: + self.send_json({'error': f'Impossible d’analyser le fichier : {e}'}, 400) + return + if self.path == '/api/backup/import': + if not valid_session(self) and auth_state()['configured']: self.send_json({'error':'Authentification requise'},401); return + try: + if 'data_base64' in data and data['data_base64']: + raw_bytes = base64.b64decode(data['data_base64']) + backup = inspect_backup_bytes(raw_bytes, data.get('filename', '')) + stats = import_backup_data(backup, data.get('options', {})) + else: + stats = import_backup_data(data) + log('import_configuration_complete', username(self) or 'Administrateur', request_ip(self), 'SYSTEM') + self.send_json({ + 'ok': True, + 'message': f"Sauvegarde restaurée avec succès ({stats.get('vpn_profiles',0)} profils VPN, {stats.get('client_names',0)} appareils, {stats.get('preferences',0)} réglages restaurés).", + 'stats': stats + }) + except Exception as e: + self.send_json({'error': f'Erreur lors de la restauration: {e}'}, 400) + return if self.path == '/api/auth/2fa/status': self.send_json({'enabled':auth_state()['two_factor'],'recovery_remaining':recovery_remaining()}); return if self.path == '/api/auth/2fa/enable': @@ -5524,13 +8129,19 @@ class Handler(BaseHTTPRequestHandler): c=db() if 'theme' in data: theme=str(data.get('theme','')) - if theme not in ('dark','light','auto'): raise ValueError('Thème invalide') + if theme not in ('dark','light','auto','winxp','futuristic','macos','hacker'): raise ValueError('Thème invalide') c.execute("INSERT OR REPLACE INTO preferences(key,value) VALUES('theme',?)",(theme,)) + if 'language' in data: + lang=str(data.get('language','fr')).strip().lower() + if lang not in ('fr','en-us','en-gb'): lang = 'fr' + c.execute("INSERT OR REPLACE INTO preferences(key,value) VALUES('language',?)",(lang,)) if 'app_name' in data: + if not valid_session(self): raise ValueError('Authentification requise') app_name=str(data.get('app_name','')).strip() if not app_name or len(app_name)>64: raise ValueError('Nom de l’application invalide') c.execute("INSERT OR REPLACE INTO preferences(key,value) VALUES('app_name',?)",(app_name,)) if 'app_short_name' in data: + if not valid_session(self): raise ValueError('Authentification requise') app_short_name=str(data.get('app_short_name','')).strip() if not app_short_name or len(app_short_name)>32: raise ValueError('Nom court invalide') c.execute("INSERT OR REPLACE INTO preferences(key,value) VALUES('app_short_name',?)",(app_short_name,)) @@ -5552,6 +8163,7 @@ connected_stations_order = [] def monitor(): global connected_stations_order sync_vpn_counter = 0 + sync_limits_counter = 0 while True: try: sync_vpn_counter += 1 @@ -5561,6 +8173,15 @@ def monitor(): sync_vpn_client_rules() except Exception: pass + + sync_limits_counter += 1 + if sync_limits_counter >= 2: + sync_limits_counter = 0 + try: + sync_client_bandwidth_and_quotas() + except Exception: + pass + items = clients() max_c = get_max_clients() # CORRECTION : éjecter en continu les appareils bloqués qui se reconnectent. @@ -5630,17 +8251,26 @@ if __name__ == '__main__': try: c = db() c.execute('DELETE FROM auth_sessions WHERE expires < ?', (time.time(),)) + c.execute("UPDATE vpn_profiles SET status='disconnected', last_error='' WHERE status IN ('connecting', 'connected')") c.commit(); c.close() - except Exception: pass - if is_bridge_mode(): + except Exception as e_db: + print(f"[ap-vpn] Erreur réinitialisation statut VPN : {e_db}", flush=True) + b_name = get_pref('bridge_name', os.environ.get('AP_BRIDGE_NAME', 'br0')) + b_eth = get_pref('bridge_eth', os.environ.get('AP_BRIDGE_ETH', '')) + if not b_eth: + candidates = detect_ethernet_interfaces() + if candidates: b_eth = candidates[0] + + # Le pont ne doit être configuré que si le setup initial est terminé, le mode est pont et le Wi-Fi actif + if is_bridge_mode() and auth_state().get('setup_completed') and is_iface_up(INTERFACE): clean_stale_router_leases() - b_name = get_pref('bridge_name', os.environ.get('AP_BRIDGE_NAME', 'br0')) - b_eth = get_pref('bridge_eth', os.environ.get('AP_BRIDGE_ETH', '')) - if not b_eth: - candidates = detect_ethernet_interfaces() - if candidates: b_eth = candidates[0] setup_bridge(b_name, b_eth) + else: + # En mode AP (par défaut) ou tant que le setup n'est pas terminé, s'assurer que l'Ethernet hôte est totalement libre et le pont démonté + teardown_bridge(b_name, b_eth) apply_radio_defaults() + try: sync_client_bandwidth_and_quotas(force=True) + except Exception: pass threading.Thread(target=arp_listener, daemon=True).start() threading.Thread(target=monitor, daemon=True).start() threading.Thread(target=auto_connect_vpn_profiles, daemon=True).start() diff --git a/apache-ap.conf b/apache-ap.conf index eb654cc..aec6f3b 100644 --- a/apache-ap.conf +++ b/apache-ap.conf @@ -5,20 +5,52 @@ ServerName localhost DirectoryIndex index.html - Options -Indexes + Options -Indexes +FollowSymLinks + AllowOverride None Require all granted Header set Cache-Control "no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires "0" + + + RewriteEngine On + + # Ne pas modifier les requêtes API + RewriteRule ^api/ - [L] + + # Rediriger les ressources statiques relatives dans /setup/ et le favicon racine + RewriteRule ^setup/lang/(.*)$ lang/$1 [L] + RewriteRule ^setup/images/(.*)$ images/$1 [L] + RewriteRule ^(?:setup/)?favicon\.png$ images/favicon.png [L] + + # Rediriger /index.html vers / + RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\.html[^\s]* [NC] + RewriteRule ^index\.html$ / [R=301,L] + + # Rediriger /setup.html vers /setup + RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+(setup\.html|Setup\.HTML|Setup\.html)[^\s]* [NC] + RewriteRule ^(setup\.html|Setup\.HTML|Setup\.html)$ /setup [R=301,L] + + # Réécriture interne /setup -> setup.html + RewriteRule ^setup/?$ setup.html [L,QSA] + - # L'API Python lit l'IP réelle du client dans X-Real-IP - RequestHeader set X-Real-IP "expr=%{REMOTE_ADDR}" + # Module RemoteIP pour honorer les proxys en amont + RemoteIPHeader X-Forwarded-For + RemoteIPInternalProxy 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 127.0.0.1 ::1 + + # Transmet l'IP brute de connexion et préserve X-Real-IP si déjà défini par le proxy amont + RequestHeader set X-Client-Raw-IP "expr=%{REMOTE_ADDR}" + RequestHeader setifempty X-Real-IP "expr=%{REMOTE_ADDR}" ProxyPreserveHost On - ProxyPass /api unix:/run/ap-api.sock|http://localhost/api + ProxyPass /api unix:/run/ap-api.sock|http://localhost/api retry=0 timeout=30 ProxyPassReverse /api http://localhost/api ErrorLog /var/log/apache2/error.log - CustomLog /var/log/apache2/access.log combined + + # Ne pas journaliser les requêtes GET /api dans les logs Docker (polling permanent) + SetEnvIfExpr "%{REQUEST_METHOD} =~ m#^(GET|HEAD)$# && %{REQUEST_URI} =~ m#^/api#" dontlog + CustomLog /var/log/apache2/access.log combined env=!dontlog diff --git a/attach-wifi.sh b/attach-wifi.sh deleted file mode 100644 index e252f64..0000000 --- a/attach-wifi.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# Déplace la carte Wi-Fi de l'hôte dans le conteneur ap-wifi. -# Usage : sudo ./attach-wifi.sh (carte détectée automatiquement) -# ou : sudo ./attach-wifi.sh wlan0 (pour en imposer une) -# À relancer après chaque (re)démarrage du conteneur : la carte revient -# automatiquement sur l'hôte quand le conteneur s'arrête. -set -euo pipefail - -IFACE="${1:-${AP_INTERFACE:-}}" -CONTAINER="${CONTAINER:-ap-wifi}" - -[[ $EUID -eq 0 ]] || { echo "Lancez en root : sudo $0 wlan0"; exit 1; } -# Sans argument, reprendre AP_INTERFACE écrit dans le compose (lu depuis le conteneur) -[[ -n "$IFACE" ]] || IFACE="$(docker inspect -f '{{range .Config.Env}}{{println .}}{{end}}' "$CONTAINER" 2>/dev/null | sed -n 's/^AP_INTERFACE=//p')" - -if [[ -z "$IFACE" ]]; then - mapfile -t HOST_IFACES < <(iw dev 2>/dev/null | awk '$1=="Interface"{print $2}') - [[ ${#HOST_IFACES[@]} -gt 0 ]] || { echo "Aucune carte Wi-Fi détectée sur l'hôte (voir : iw dev)."; exit 1; } - IFACE="${HOST_IFACES[0]}" - for d in "${HOST_IFACES[@]}"; do - p="$(iw dev "$d" info 2>/dev/null | awk '/wiphy/{print "phy"$2}')" - if [[ -n "$p" ]] && iw "$p" info 2>/dev/null | grep -qE '^\s+\* AP$'; then IFACE="$d"; break; fi - done - echo "Carte détectée automatiquement : $IFACE" -fi - -PID="$(docker inspect -f '{{.State.Pid}}' "$CONTAINER" 2>/dev/null || echo 0)" -[[ "$PID" != "0" ]] || { echo "Le conteneur $CONTAINER n'est pas démarré."; exit 1; } - -PHY="$(iw dev "$IFACE" info 2>/dev/null | awk '/wiphy/{print "phy"$2}')" -[[ -n "$PHY" ]] || { echo "Interface $IFACE introuvable sur l'hôte (voir : iw dev)."; exit 1; } - -# L'hôte ne doit plus gérer la carte -nmcli device set "$IFACE" managed no 2>/dev/null || true - -iw phy "$PHY" set netns "$PID" -echo "Carte $IFACE ($PHY) injectée dans $CONTAINER. Suivez le démarrage : docker logs -f $CONTAINER" diff --git a/entrypoint.sh b/entrypoint.sh old mode 100644 new mode 100755 index 784058e..df4e6ed --- a/entrypoint.sh +++ b/entrypoint.sh @@ -69,47 +69,95 @@ if [[ ! -c /dev/net/tun ]]; then chmod 666 /dev/net/tun 2>/dev/null || true fi modprobe wireguard 2>/dev/null || true -modprobe ebtable_broute 2>/dev/null || true -modprobe ebtables 2>/dev/null || true -modprobe br_netfilter 2>/dev/null || true sysctl -w net.ipv4.ip_forward=1 2>/dev/null || true sysctl -w net.ipv4.conf.all.forwarding=1 2>/dev/null || true sysctl -w net.ipv4.conf.all.rp_filter=0 2>/dev/null || true sysctl -w net.ipv4.conf.default.rp_filter=0 2>/dev/null || true -sysctl -w net.bridge.bridge-nf-call-iptables=1 2>/dev/null || true -# Suppression des anciens profils NetworkManager qui auraient asservi l'Ethernet physique de l'hôte -rm -f /etc/NetworkManager/system-connections/ap-bridge-eth-*.nmconnection 2>/dev/null || true - -# Libération de toute interface physique qui aurait été asservie par erreur par une session précédente -for d in /sys/class/net/*; do - _n="$(basename "$d")" - if [[ -d "$d/master" && "$_n" != "$IFACE" && ! "$_n" =~ ^(veth|docker) ]]; then - _m="$(basename "$(readlink "$d/master" 2>/dev/null || true)")" - if [[ "$_m" == "${AP_BRIDGE_NAME:-br0}" || "$_m" =~ ^(br0|ap-bridge) ]]; then - log "Rétablissement de l'interface hôte $_n (retrait du pont $_m)..." - _ip="$(ip -4 -o addr show dev "$_m" 2>/dev/null | awk '{print $4}' | head -n1)" - _gw="$(ip route show default dev "$_m" 2>/dev/null | awk '{print $3}' | head -n1)" - ip link set "$_n" nomaster 2>/dev/null || true - if [[ -n "$_ip" ]]; then - ip addr flush dev "$_m" 2>/dev/null || true - ip addr add "$_ip" dev "$_n" 2>/dev/null || true - [[ -n "$_gw" ]] && ip route replace default via "$_gw" dev "$_n" 2>/dev/null || true - fi - fi - fi +# Nettoyage des anciennes interfaces et tables VPN résiduelles d'une précédente session +for ifc in $(ip -o link show 2>/dev/null | awk -F': ' '{print $2}' | grep -E '^(wg_ap|tun_ap)'); do + log "Nettoyage interface VPN résiduelle : $ifc" + ip link delete "$ifc" 2>/dev/null || true +done +for tid in $(seq 101 125); do + ip route flush table "$tid" 2>/dev/null || true + while ip rule del table "$tid" 2>/dev/null; do :; done done -# Les interfaces physiques Ethernet restent strictement non-gérées (unmanaged) par NetworkManager -NM_EXCEPTS="except:interface-name:${IFACE},except:type:bridge,except:interface-name:${AP_BRIDGE_NAME}" +# Nettoyage complet des règles iptables DNS et filtrage résiduelles d'une précédente session +for proto in udp tcp; do + while iptables -t nat -D PREROUTING -p "$proto" --dport 53 -j AP_BRIDGE_DNS 2>/dev/null; do :; done + while iptables -t nat -D PREROUTING -p "$proto" --dport 53 -j AP_VPN_DNS 2>/dev/null; do :; done + for ifc in $(ip -o link show 2>/dev/null | awk -F': ' '{print $2}'); do + while iptables -t nat -D PREROUTING -i "$ifc" -p "$proto" --dport 53 -j AP_BRIDGE_DNS 2>/dev/null; do :; done + while iptables -t nat -D PREROUTING -i "$ifc" -p "$proto" --dport 53 -j AP_VPN_DNS 2>/dev/null; do :; done + done +done +while iptables -t nat -D PREROUTING -j AP_BRIDGE_DNS 2>/dev/null; do :; done +iptables -t nat -F AP_BRIDGE_DNS 2>/dev/null || true +iptables -t nat -X AP_BRIDGE_DNS 2>/dev/null || true +while iptables -t nat -D POSTROUTING -j AP_BRIDGE_DNS_POST 2>/dev/null; do :; done +iptables -t nat -F AP_BRIDGE_DNS_POST 2>/dev/null || true +iptables -t nat -X AP_BRIDGE_DNS_POST 2>/dev/null || true +while iptables -t nat -D PREROUTING -j AP_VPN_DNS 2>/dev/null; do :; done +iptables -t nat -F AP_VPN_DNS 2>/dev/null || true +iptables -t nat -X AP_VPN_DNS 2>/dev/null || true +while iptables -D INPUT -j AP_VPN_INPUT 2>/dev/null; do :; done +iptables -F AP_VPN_INPUT 2>/dev/null || true +iptables -X AP_VPN_INPUT 2>/dev/null || true +while iptables -D FORWARD -j AP_VPN_ISOLATION 2>/dev/null; do :; done +iptables -F AP_VPN_ISOLATION 2>/dev/null || true +iptables -X AP_VPN_ISOLATION 2>/dev/null || true +# Suppression des anciens profils NetworkManager résiduels créés par APmanageur +rm -f /etc/NetworkManager/system-connections/ap-bridge-*.nmconnection 2>/dev/null || true + +# Libération uniquement d'un pont résiduel qui aurait été créé par APmanageur (/run/ap-created-bridge) +if [[ -f /run/ap-created-bridge ]]; then + _info="$(cat /run/ap-created-bridge 2>/dev/null || true)" + _b="${_info%%:*}" + _e="${_info##*:}" + if [[ -n "$_e" && -d "/sys/class/net/$_e" ]]; then + ip link set "$_e" nomaster 2>/dev/null || true + if [[ -d "/sys/class/net/$_b" ]]; then + _ip="$(ip -4 -o addr show dev "$_b" 2>/dev/null | awk '{print $4}' | head -n1)" + _gw="$(ip route show default dev "$_b" 2>/dev/null | awk '{print $3}' | head -n1)" + if [[ -n "$_ip" ]]; then + ip addr flush dev "$_b" 2>/dev/null || true + ip addr add "$_ip" dev "$_e" 2>/dev/null || true + [[ -n "$_gw" ]] && ip route replace default via "$_gw" dev "$_e" 2>/dev/null || true + fi + ip link set "$_b" down 2>/dev/null || true + ip link delete name "$_b" type bridge 2>/dev/null || true + fi + fi + rm -f /run/ap-created-bridge 2>/dev/null || true +fi + +# En mode AP (par défaut), s'assurer que la base de données ne force pas un ancien mode pont résiduel +if [[ "${AP_MODE:-ap}" == "ap" ]] && [[ -f /data/ap-dashboard.sqlite3 ]]; then + sqlite3 /data/ap-dashboard.sqlite3 "UPDATE preferences SET value='ap' WHERE key='mode' AND value='bridge';" 2>/dev/null || true +fi + +# Les interfaces physiques Ethernet et autres interfaces hôtes restent strictement non-gérées (unmanaged) par NetworkManager cat > /etc/NetworkManager/conf.d/10-ap.conf </dev/null; then + log "Avertissement : aucun serveur DNS actif dans /etc/resolv.conf, injection de serveurs de secours (1.1.1.1, 8.8.8.8)..." + echo -e "nameserver 1.1.1.1\nnameserver 8.8.8.8" >> /etc/resolv.conf 2>/dev/null || true + fi +fi + # 2b. Serveur DHCP/DNS (dnsmasq lancé par NetworkManager en mode « shared ») ------- -# Support du filtrage et de la redirection DNS au niveau du pont (mode Bridge) -modprobe br_netfilter 2>/dev/null || true SHARED_DIR=/etc/NetworkManager/dnsmasq-shared.d mkdir -p "$SHARED_DIR" rm -f "$SHARED_DIR"/10-ap-manageur.conf -# Quelque chose écoute déjà sur le port ? (réseau hôte partagé : Pi-hole, AdGuard, autre dnsmasq...) +# Quelque chose écoute déjà sur le port ? (réseau hôte partagé : systemd-resolved, Pi-hole, AdGuard, autre dnsmasq...) port_busy() { # $1 = udp|tcp $2 = port local flag=u; [[ "$1" == tcp ]] && flag=t - ss -H -ln"$flag" 2>/dev/null | awk '{print $4}' | grep -Eq "^(0\.0\.0\.0|\*|\[::\]):$2\$" + ss -H -ln"$flag" 2>/dev/null | awk '{print $4}' | grep -Eq ":$2\$" } { @@ -139,6 +193,12 @@ port_busy() { # $1 = udp|tcp $2 = port echo "# Journalise chaque échange DHCP (DISCOVER/OFFER/REQUEST/ACK) dans les logs du conteneur" echo "log-dhcp" echo "log-facility=-" + echo "# Écoute strictement limitée à l'interface du point d'accès Wi-Fi" + echo "bind-interfaces" + echo "interface=${IFACE}" + echo "except-interface=lo" + echo "# dnsmasq sert exclusivement de serveur DHCP pour le Wi-Fi : port=0 désactive l'écoute DNS pour ne JAMAIS interférer avec l'hôte" + echo "port=0" } > "$SHARED_DIR/10-ap-manageur.conf" if [[ "$AP_MAX_CLIENTS" =~ ^[0-9]+$ ]] && (( AP_MAX_CLIENTS > 0 )); then @@ -164,7 +224,7 @@ log "Serveurs DNS pour les clients Wi-Fi (AP_DNS) : ${AP_DNS_CLEAN}" } > "$SHARED_DIR/15-ap-dns.conf" if port_busy udp 53 || port_busy tcp 53; then - log "ATTENTION : le port 53 est déjà utilisé sur l'hôte, dnsmasq désactive son écoute DNS locale (DHCP conservé avec DNS ${AP_DNS_CLEAN})." + log "ATTENTION : le port 53 est utilisé sur l'hôte (systemd-resolved, Pi-hole ou résolveur local). dnsmasq désactive son écoute DNS (port=0) pour préserver la résolution de l'hôte. Les clients Wi-Fi reçoivent AP_DNS (${AP_DNS_CLEAN}) via DHCP (Option 6)." echo "port=0" >> "$SHARED_DIR/10-ap-manageur.conf" fi if port_busy udp 67; then @@ -184,10 +244,10 @@ for _ in $(seq 1 30); do done nmcli -t general status >/dev/null 2>&1 || { log "ERREUR : NetworkManager ne répond pas"; exit 1; } -# Supprimer toute connexion NetworkManager résiduelle qui aurait asservi l'Ethernet physique +# Supprimer uniquement les connexions Wi-Fi AP ou pont résiduelles créées par APmanageur (NE JAMAIS TOUCHER AUX INTERFACES HÔTE COMME br0 OU eth0) for con in $(nmcli -t -g NAME connection show 2>/dev/null || true); do - if [[ "$con" =~ ^ap-bridge-eth- ]]; then - log "Suppression de la connexion résiduelle $con..." + if [[ "$con" =~ ^(ap-bridge-|AP-) ]]; then + log "Nettoyage connexion Wi-Fi APmanageur résiduelle : $con" nmcli connection down "$con" 2>/dev/null || true nmcli connection delete "$con" 2>/dev/null || true fi @@ -206,9 +266,16 @@ log "NetworkManager opérationnel et configuré" # 3. API Python (socket Unix, aucun port) + Apache (port AP_WEB_PORT) ----------- log "Démarrage de l'API AP Manageur (Python)..." +rm -f /run/ap-api.sock 2>/dev/null || true python3 /app/ap.py & API_PID=$! +# Attente de la création effective du socket Unix par Python avant de démarrer Apache +for _ in $(seq 1 50); do + [[ -S /run/ap-api.sock ]] && break + sleep 0.2 +done + log "Démarrage du serveur Apache (port ${AP_WEB_PORT})..." apache2ctl -D FOREGROUND & WEB_PID=$! @@ -243,6 +310,7 @@ cleanup() { log "Arrêt des services et nettoyage..." # Suppression du fichier d'uptime lors de l'arrêt du conteneur rm -f "${AP_UPTIME_FILE:-/data/uptime}" /app/ap-dashboard-uptime 2>/dev/null || true + # Restauration uniquement d'un pont créé par APmanageur (/run/ap-created-bridge) if [[ -f /run/ap-created-bridge ]]; then _info="$(cat /run/ap-created-bridge 2>/dev/null || true)" _b="${_info%%:*}" @@ -263,15 +331,36 @@ cleanup() { fi rm -f /run/ap-created-bridge 2>/dev/null || true fi - # Nettoyage des règles iptables de redirection DNS du mode pont + # Nettoyage complet des règles iptables de redirection DNS du mode pont et VPN + for proto in udp tcp; do + while iptables -t nat -D PREROUTING -p "$proto" --dport 53 -j AP_BRIDGE_DNS 2>/dev/null; do :; done + while iptables -t nat -D PREROUTING -p "$proto" --dport 53 -j AP_VPN_DNS 2>/dev/null; do :; done + for ifc in $(ip -o link show 2>/dev/null | awk -F': ' '{print $2}'); do + while iptables -t nat -D PREROUTING -i "$ifc" -p "$proto" --dport 53 -j AP_BRIDGE_DNS 2>/dev/null; do :; done + while iptables -t nat -D PREROUTING -i "$ifc" -p "$proto" --dport 53 -j AP_VPN_DNS 2>/dev/null; do :; done + done + done + while iptables -t nat -D PREROUTING -j AP_BRIDGE_DNS 2>/dev/null; do :; done iptables -t nat -F AP_BRIDGE_DNS 2>/dev/null || true + iptables -t nat -X AP_BRIDGE_DNS 2>/dev/null || true + while iptables -t nat -D POSTROUTING -j AP_BRIDGE_DNS_POST 2>/dev/null; do :; done iptables -t nat -F AP_BRIDGE_DNS_POST 2>/dev/null || true + iptables -t nat -X AP_BRIDGE_DNS_POST 2>/dev/null || true + while iptables -t nat -D PREROUTING -j AP_VPN_DNS 2>/dev/null; do :; done + iptables -t nat -F AP_VPN_DNS 2>/dev/null || true + iptables -t nat -X AP_VPN_DNS 2>/dev/null || true # Nettoyage des règles ebtables et iptables VPN nft delete table bridge ap_vpn_broute 2>/dev/null || true ebtables -t broute -F BROUTING 2>/dev/null || true iptables -t mangle -F AP_VPN_MANGLE 2>/dev/null || true - iptables -t mangle -D PREROUTING -j AP_VPN_MANGLE 2>/dev/null || true + while iptables -t mangle -D PREROUTING -j AP_VPN_MANGLE 2>/dev/null; do :; done iptables -t mangle -X AP_VPN_MANGLE 2>/dev/null || true + while iptables -D INPUT -j AP_VPN_INPUT 2>/dev/null; do :; done + iptables -F AP_VPN_INPUT 2>/dev/null || true + iptables -X AP_VPN_INPUT 2>/dev/null || true + while iptables -D FORWARD -j AP_VPN_ISOLATION 2>/dev/null; do :; done + iptables -F AP_VPN_ISOLATION 2>/dev/null || true + iptables -X AP_VPN_ISOLATION 2>/dev/null || true kill "$WEB_PID" "$API_PID" "$NM_PID" 2>/dev/null || true exit 0 } diff --git a/favicon.png b/images/favicon.png similarity index 100% rename from favicon.png rename to images/favicon.png diff --git a/images/gotify.png b/images/gotify.png new file mode 100644 index 0000000..5d29004 Binary files /dev/null and b/images/gotify.png differ diff --git a/images/gotify.svg b/images/gotify.svg new file mode 100644 index 0000000..17fdb79 --- /dev/null +++ b/images/gotify.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/index.html b/index.html index 0115536..0a16b0a 100644 --- a/index.html +++ b/index.html @@ -1,2044 +1,8795 @@ + - - - - - -AP Manageur - - + body { + margin: 0; + font-family: system-ui, -apple-system, sans-serif; + background: var(--bg); + color: var(--text); + transition: background .2s, color .2s + } + + .wrap { + max-width: 1100px; + margin: 0 auto; + padding: 24px; + width: 100% + } + + header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 20px; + gap: 12px; + flex-wrap: wrap + } + + h1 { + margin: 0; + font-size: 26px + } + + .sub { + color: var(--muted); + font-size: 14px; + margin-top: 4px + } + + .header-actions { + display: flex; + gap: 8px; + flex-wrap: wrap; + align-items: center + } + + .header-actions button { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + height: 38px; + padding: 9px 16px; + font-size: 14px; + font-weight: 600; + border-radius: 8px; + box-sizing: border-box; + line-height: 1; + } + + nav { + display: flex; + gap: 8px; + margin-bottom: 20px; + border-bottom: 1px solid var(--line); + padding-bottom: 12px; + overflow-x: auto; + -webkit-overflow-scrolling: touch + } + + nav button, + nav button.secondary { + background: var(--panel2) !important; + border: 1px solid var(--line) !important; + color: var(--muted) !important; + font-size: 15px; + font-weight: 600; + padding: 8px 16px; + border-radius: 8px; + cursor: pointer; + white-space: nowrap; + flex-shrink: 0; + transition: all .18s ease; + user-select: none + } + + nav button:hover:not(.active) { + background: var(--panel) !important; + color: var(--text) !important; + border-color: var(--blue) !important + } + + nav button.active { + background: var(--green) !important; + color: #061a12 !important; + border-color: var(--green) !important; + font-weight: 700 !important; + box-shadow: 0 2px 10px rgba(50, 213, 131, .35) + } + + html[data-theme="light"] nav button, + html[data-theme="light"] nav button.secondary { + background: var(--panel2) !important; + border: 1px solid var(--line) !important; + color: var(--muted) !important + } + + html[data-theme="light"] nav button.active { + background: var(--green) !important; + color: #ffffff !important; + border-color: var(--green) !important; + box-shadow: 0 2px 8px rgba(19, 160, 106, .3) + } + + /* Boutons et éléments actifs avec fond bleu en thème clair */ + html[data-theme="light"] button:not(.secondary):not(.danger):not(.settings-nav-btn):not(.stats-range-btn):not(.filter-chip):not(.clear-filter-btn):not([class*="badge"]):not([class*="pill"]):not(.device-pill), + html[data-theme="light"] button.primary, + html[data-theme="light"] .btn-primary, + html[data-theme="light"] #apControl, + html[data-theme="light"] #refresh, + html[data-theme="light"] #startCaptureBtn, + html[data-theme="light"] .stats-range-btn.active, + html[data-theme="light"] .filter-chip.active, + html[data-theme="light"] .settings-nav-btn.active, + html[data-theme="light"] button[style*="var(--blue)"], + html[data-theme="light"] button[style*="background: var(--blue)"], + html[data-theme="light"] button[style*="background:var(--blue)"], + html[data-theme="light"] .secondary[style*="var(--blue)"], + html[data-theme="light"] .secondary[style*="background: var(--blue)"], + html[data-theme="light"] .secondary[style*="background:var(--blue)"], + html[data-theme="light"] .pagination-btns button[style*="var(--blue)"], + html[data-theme="light"] .pagination-btns button[style*="background:var(--blue)"], + html[data-theme="light"] .pagination-btns button.active, + html[data-theme="light"] .pagination button[style*="var(--blue)"], + html[data-theme="light"] .pagination button[style*="background:var(--blue)"], + html[data-theme="light"] .pagination button.active { + color: #ffffff !important; + } + + /* Onglets de sous-navigation inactifs en thème clair (ex: Network Topology) */ + html[data-theme="light"] .settings-nav-btn:not(.active) { + background: var(--panel2) !important; + color: var(--muted) !important; + border: 1px solid var(--line) !important; + } + html[data-theme="light"] .settings-nav-btn:hover:not(.active) { + background: var(--panel) !important; + color: var(--text) !important; + border-color: var(--blue) !important; + } + + /* Périodes de stats inactives en thème clair (Weekly, Monthly, Yearly) */ + html[data-theme="light"] .stats-range-btn:not(.active) { + background: transparent !important; + color: var(--muted) !important; + } + html[data-theme="light"] .stats-range-btn:hover:not(.active) { + color: var(--text) !important; + } + + /* Puces de filtrage Wireshark inactives en thème clair */ + html[data-theme="light"] .filter-chip:not(.active) { + background: var(--panel2) !important; + color: var(--muted) !important; + border: 1px solid var(--line) !important; + } + html[data-theme="light"] .filter-chip:hover:not(.active) { + color: var(--text) !important; + border-color: var(--blue) !important; + } + + html[data-theme="light"] #authView .card { + background: #ffffff !important; + border: 1px solid #d2dcec !important; + box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08) !important; + } + + html[data-theme="light"] #authView h1 { + color: #15203a !important; + } + + html[data-theme="light"] #authView .muted { + color: #5b6b8c !important; + } + + html[data-theme="light"] #authSubmit { + background: #1e6ef0 !important; + color: #ffffff !important; + border: none !important; + box-shadow: 0 2px 8px rgba(30, 110, 240, 0.25) !important; + } + + html[data-theme="light"] #authSubmit:hover { + background: #1558c4 !important; + } + + html[data-theme="light"] #btnAuthPasskey { + background: rgba(30, 110, 240, 0.08) !important; + border: 1px solid rgba(30, 110, 240, 0.35) !important; + color: #1e6ef0 !important; + } + + html[data-theme="light"] #btnAuthPasskey:hover { + background: rgba(30, 110, 240, 0.16) !important; + border-color: rgba(30, 110, 240, 0.6) !important; + } + + html[data-theme="light"] #authPasskeyDivider span { + color: #5b6b8c !important; + } + + html[data-theme="light"] #authPasskeyDivider div { + background: #d2dcec !important; + } + + .grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); + gap: 16px; + margin-bottom: 20px + } + + .grid>.card { + min-width: 0; + overflow: hidden + } + + .card { + background: var(--panel); + border: 1px solid var(--line); + border-radius: 14px; + padding: 20px + } + + .metric { + font-size: 28px; + font-weight: 700; + margin-top: 6px; + overflow-wrap: anywhere; + word-break: break-word + } + + .status { + display: flex; + align-items: center; + gap: 10px; + flex-wrap: wrap + } + + .dot { + width: 12px; + height: 12px; + border-radius: 50%; + background: var(--green); + box-shadow: 0 0 10px rgba(50, 213, 131, .5); + flex-shrink: 0 + } + + .layout { + display: grid; + grid-template-columns: minmax(0, 1fr) 340px; + gap: 20px; + align-items: start + } + + .layout>section, + .layout>aside { + min-width: 0; + max-width: 100% + } + + .layout>aside { + position: sticky; + top: 18px; + align-self: start + } + + .qr-card-content { + width: 100%; + max-width: 320px; + margin: 0 auto; + text-align: center + } + + .qr-card-content h2 { + margin: 0 0 14px + } + + .qr-card-content .label { + text-align: left + } + + #qrcode, + #twoFaQr { + background: #ffffff !important; + padding: 16px !important; + border-radius: 12px; + margin: 0 auto 16px; + box-sizing: border-box; + box-shadow: 0 4px 18px rgba(0, 0, 0, .28); + width: 222px; + height: 222px; + max-width: 100%; + display: flex; + justify-content: center; + align-items: center; + overflow: hidden + } + + #qrcode canvas, + #qrcode img, + #twoFaQr canvas, + #twoFaQr img { + max-width: 100% !important; + max-height: 100% !important; + image-rendering: pixelated; + image-rendering: -webkit-optimize-contrast; + margin: 0 auto + } + + .settings-nav { + display: flex; + flex-wrap: wrap; + gap: 6px; + margin-bottom: 20px; + align-items: center + } + + .settings-nav::-webkit-scrollbar { + display: none + } + + .settings-nav-btn { + background: var(--panel2) !important; + border: 1px solid var(--line) !important; + color: var(--muted) !important; + font-size: 13px; + font-weight: 600; + padding: 7px 11px; + border-radius: 8px; + cursor: pointer; + white-space: nowrap; + flex-shrink: 0; + transition: all .18s ease; + user-select: none; + display: inline-flex; + align-items: center; + gap: 6px + } + + .settings-nav-btn:hover:not(.active) { + background: var(--panel) !important; + color: var(--text) !important; + border-color: var(--blue) !important + } + + .settings-nav-btn.active { + background: var(--blue) !important; + color: var(--blue-text, #071326) !important; + border-color: var(--blue) !important; + font-weight: 700 !important; + box-shadow: 0 2px 8px rgba(92, 167, 255, .3) + } + + html[data-theme="light"] .settings-nav-btn.active { + background: var(--blue) !important; + color: #ffffff !important; + border-color: var(--blue) !important + } + + .settings-panel { + max-width: 760px; + margin: 0 auto + } + + .topline { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 14px + } + + .table-wrap { + overflow-x: auto; + -webkit-overflow-scrolling: touch; + width: 100%; + max-width: 100%; + border-radius: 8px + } + + table { + width: 100%; + border-collapse: collapse + } + + th, + td { + padding: 12px; + text-align: left; + border-bottom: 1px solid var(--line); + font-size: 14px + } + + th { + color: var(--muted); + font-size: 12px; + text-transform: uppercase; + letter-spacing: .5px + } + + .client { + display: flex; + align-items: center; + gap: 10px; + min-width: 0 + } + + .client strong { + max-width: 180px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: inline-block; + vertical-align: middle + } + + .avatar { + width: 34px; + height: 34px; + border-radius: 50%; + background: var(--panel2); + display: grid; + place-items: center; + font-weight: 700; + color: var(--blue); + font-size: 13px; + flex-shrink: 0 + } + + html[data-theme="light"] .avatar { + background: #cfe0fb; + color: #15203a + } + + .signal { + font-weight: 600; + font-size: 13px + } + + .signal-excellent { + color: var(--green) + } + + .signal-bon { + color: #68d391 + } + + .signal-moyen { + color: #f6ad55 + } + + .signal-faible { + color: var(--red) + } + + button { + background: var(--blue); + color: var(--blue-text, #071326); + border: 0; + padding: 9px 16px; + border-radius: 8px; + font-weight: 600; + cursor: pointer; + font-size: 14px; + transition: opacity .15s + } + + button:hover { + opacity: .9 + } + + button.secondary { + background: var(--panel2); + color: var(--text); + border: 1px solid var(--line) + } + + button[style*="var(--blue)"], + button[style*="background: var(--blue)"], + button[style*="background:var(--blue)"] { + color: var(--blue-text, #071326); + } + + #btnAuthPasskey { + border: 1px solid rgba(56, 189, 248, 0.4); + background: rgba(56, 189, 248, 0.08); + color: var(--blue); + cursor: pointer; + transition: all .2s ease; + } + + #btnAuthPasskey:hover { + background: rgba(56, 189, 248, 0.18); + border-color: rgba(56, 189, 248, 0.7); + } + + .pill { + background: var(--panel2); + color: var(--text); + padding: 4px 10px; + border-radius: 999px; + font-size: 12px; + font-weight: 600 + } + + .badge { + background: rgba(50, 213, 131, .16); + color: var(--green); + border: 1px solid rgba(50, 213, 131, .38); + padding: 4px 10px; + border-radius: 999px; + font-size: 12px; + font-weight: 600 + } + + .pill-blue { + background: rgba(92, 167, 255, .16) !important; + color: var(--blue) !important; + border: 1px solid rgba(92, 167, 255, .38) !important; + font-weight: 600; + display: inline-flex; + align-items: center; + gap: 6px + } + + #networkModeBadge.pill-blue { + background: rgba(92, 167, 255, .16) !important; + color: var(--blue) !important; + border: 1px solid rgba(92, 167, 255, .38) !important; + } + + #networkModeBadge.pill-green { + background: rgba(50, 213, 131, .16) !important; + color: var(--green) !important; + border: 1px solid rgba(50, 213, 131, .38) !important; + } + + #updated, + #topoUpdated, + #statsChartUpdated, + #statsTrafficUpdated, + #statsHistoryUpdated, + #captureUpdated, + #logsUpdated, + #blockedUpdated, + .pill-updated, + .pill-green { + background: rgba(50, 213, 131, .16) !important; + color: var(--green) !important; + border: 1px solid rgba(50, 213, 131, .38) !important; + font-weight: 600; + display: inline-flex; + align-items: center; + gap: 6px + } + + #updated::before, + #topoUpdated::before, + #statsChartUpdated::before, + #statsTrafficUpdated::before, + #statsHistoryUpdated::before, + #captureUpdated::before, + #logsUpdated::before, + #blockedUpdated::before, + .pill-updated::before, + .pill-green:not(.pill-no-dot)::before { + content: ""; + display: inline-block; + width: 7px; + height: 7px; + border-radius: 50%; + background: currentColor; + box-shadow: 0 0 6px currentColor; + flex-shrink: 0 + } + + .pill-no-dot::before { + display: none !important + } + + html[data-theme="light"] #updated, + html[data-theme="light"] #topoUpdated, + html[data-theme="light"] #statsChartUpdated, + html[data-theme="light"] #statsTrafficUpdated, + html[data-theme="light"] #statsHistoryUpdated, + html[data-theme="light"] #captureUpdated, + html[data-theme="light"] #logsUpdated, + html[data-theme="light"] #blockedUpdated, + html[data-theme="light"] .pill-updated, + html[data-theme="light"] .pill-green { + background: #d9f5e8 !important; + color: #13a06a !important; + border: 1px solid #a3e6c5 !important + } + + html[data-theme="light"] .badge { + background: #d9f5e8; + color: #13a06a; + border: 1px solid #a3e6c5; + } + + html[data-theme="light"] .pill-blue, + html[data-theme="light"] #networkModeBadge.pill-blue { + background: #e1edfe !important; + color: #1558c4 !important; + border: 1px solid #b8d5fb !important; + } + + html[data-theme="light"] #networkModeBadge.pill-green { + background: #d9f5e8 !important; + color: #13a06a !important; + border: 1px solid #a3e6c5 !important; + } + + .view { + display: none + } + + .view.active { + display: block + } + + .label { + font-size: 13px; + color: var(--muted); + font-weight: 600; + display: block; + margin-top: 14px + } + + input[type="text"], + input[type="password"], + input[type="number"], + select { + width: 100%; + padding: 10px 12px; + background: var(--panel2); + border: 1px solid var(--line); + border-radius: 8px; + color: var(--text); + margin-top: 6px; + font-size: 14px + } + + .check { + display: flex; + align-items: center; + gap: 8px; + margin-top: 14px; + cursor: pointer; + font-size: 14px + } + + .notice { + background: rgba(92, 167, 255, .08); + border: 1px solid var(--line); + border-radius: 10px; + padding: 12px; + font-size: 13px; + margin: 16px 0; + line-height: 1.5 + } + + .empty { + color: var(--muted); + text-align: center; + padding: 24px + } + + #loader { + position: fixed; + inset: 0; + background: var(--bg); + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + z-index: 9999; + transition: opacity .35s ease, visibility .35s ease; + padding: 20px + } + + #loader.hide { + opacity: 0 !important; + pointer-events: none !important + } + + #loader.hidden { + display: none !important; + visibility: hidden !important; + opacity: 0 !important; + pointer-events: none !important + } + + .loader-card { + background: var(--panel); + border: 1px solid var(--line); + border-radius: 18px; + padding: 32px 28px; + max-width: 440px; + width: 100%; + box-shadow: 0 12px 36px rgba(0, 0, 0, .35); + display: flex; + flex-direction: column; + align-items: center; + gap: 18px + } + + .loader-logo-wrap { + position: relative; + width: 64px; + height: 64px; + display: flex; + align-items: center; + justify-content: center + } + + .loader-radar { + position: absolute; + inset: 0; + border-radius: 50%; + border: 2px solid rgba(56, 189, 248, .35); + animation: radarPulse 2s ease-out infinite + } + + @keyframes radarPulse { + 0% { + transform: scale(0.7); + opacity: 1 + } + + 100% { + transform: scale(1.5); + opacity: 0 + } + } + + .loader-icon { + font-size: 32px; + z-index: 1; + animation: iconFloat 2s ease-in-out infinite + } + + @keyframes iconFloat { + + 0%, + 100% { + transform: translateY(0) + } + + 50% { + transform: translateY(-3px) + } + } + + .loader-progress-box { + width: 100%; + margin-top: 4px + } + + .loader-bar-bg { + background: var(--panel2); + height: 10px; + border-radius: 8px; + overflow: hidden; + border: 1px solid var(--line); + position: relative + } + + .loader-bar-fill { + width: 0%; + height: 100%; + background: linear-gradient(90deg, var(--blue), #38bdf8); + border-radius: 8px; + transition: width .35s ease; + box-shadow: 0 0 10px rgba(56, 189, 248, .4) + } + + .loader-checklist { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 8px; + width: 100%; + margin-top: 6px; + border-top: 1px solid var(--line); + padding-top: 14px + } + + .loader-step { + display: flex; + align-items: center; + gap: 7px; + padding: 6px 10px; + background: var(--panel2); + border-radius: 8px; + border: 1px solid transparent; + font-size: 11px; + color: var(--muted); + transition: all .2s ease + } + + .loader-step.active { + border-color: rgba(56, 189, 248, .4); + background: rgba(56, 189, 248, .08); + color: var(--text); + font-weight: 600 + } + + .loader-step.done { + border-color: rgba(50, 213, 131, .3); + background: rgba(50, 213, 131, .08); + color: var(--green) + } + + .loader-step .step-state { + margin-left: auto; + font-size: 12px + } + + .spinner { + width: 36px; + height: 36px; + border: 3px solid var(--line); + border-top-color: var(--blue); + border-radius: 50%; + animation: spin 1s linear infinite + } + + @keyframes spin { + to { + transform: rotate(360deg) + } + } + + .recovery-card { + background: rgba(92, 167, 255, .06); + border: 1px solid var(--blue); + border-radius: 12px; + padding: 16px; + margin: 16px 0 + } + + .recovery-grid { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 10px; + margin: 12px 0 + } + + .code-chip { + background: var(--bg); + border: 1px solid var(--line); + padding: 8px 10px; + border-radius: 8px; + font-family: monospace; + font-size: 15px; + font-weight: 700; + letter-spacing: 1px; + text-align: center; + color: var(--blue); + user-select: all + } + + .recovery-actions { + display: flex; + gap: 10px; + margin-top: 10px; + flex-wrap: wrap + } + + .stats-range-container { + display: inline-flex; + background: var(--panel2); + border-radius: 10px; + padding: 3px; + gap: 2px; + border: 1px solid var(--line) + } + + .stats-range-btn { + border: 0; + cursor: pointer; + background: transparent; + color: var(--muted); + font-size: 13px; + font-weight: 600; + padding: 7px 14px; + border-radius: 8px; + transition: all .2s ease + } + + .stats-range-btn:hover { + color: var(--text) + } + + .stats-range-btn.active { + background: var(--blue) !important; + color: var(--blue-text, #071326) !important; + font-weight: 700; + box-shadow: 0 2px 8px rgba(92, 167, 255, .35) + } + + .chart-box { + position: relative; + width: 100%; + min-height: 300px; + height: 340px; + margin-top: 10px + } + + .device-pill { + display: inline-block; + padding: 3px 8px; + border-radius: 6px; + background: var(--panel2); + border: 1px solid var(--line); + color: var(--text); + font-size: 11px; + margin: 2px 4px 2px 0 + } + + .svg-bar { + transition: opacity .2s; + cursor: pointer + } + + .svg-bar:hover { + opacity: .8 + } + + .pagination { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 14px; + padding-top: 12px; + border-top: 1px solid var(--line); + font-size: 13px; + color: var(--muted); + gap: 10px; + flex-wrap: wrap + } + + .pagination-info { + font-size: 13px; + color: var(--muted) + } + + .pagination-info strong { + color: var(--text) + } + + .pagination-btns { + display: flex; + gap: 6px; + align-items: center; + flex-wrap: wrap + } + + .pagination button { + padding: 6px 12px; + font-size: 12px; + border-radius: 8px; + min-width: 32px; + text-align: center + } + + .pagination button:disabled { + opacity: .35; + cursor: not-allowed; + pointer-events: none + } + + .proto-badge { + display: inline-block; + padding: 2px 8px; + border-radius: 5px; + font-size: 11px; + font-weight: 700; + letter-spacing: 0.5px; + font-family: monospace; + text-transform: uppercase + } + + .proto-dns { + background: rgba(30, 144, 255, .2); + color: #38bdf8; + border: 1px solid rgba(56, 189, 248, .35) + } + + .proto-icmp { + background: rgba(236, 72, 153, .2); + color: #f472b6; + border: 1px solid rgba(244, 114, 182, .35) + } + + .proto-tcp { + background: rgba(148, 163, 184, .2); + color: #cbd5e1; + border: 1px solid rgba(203, 213, 225, .35) + } + + .proto-udp { + background: rgba(168, 85, 247, .2); + color: #c084fc; + border: 1px solid rgba(192, 132, 252, .35) + } + + .proto-arp { + background: rgba(234, 179, 8, .2); + color: #facc15; + border: 1px solid rgba(250, 204, 21, .35) + } + + .proto-dhcp { + background: rgba(249, 115, 22, .2); + color: #fb923c; + border: 1px solid rgba(251, 146, 60, .35) + } + + .proto-tls { + background: rgba(34, 197, 94, .2); + color: #4ade80; + border: 1px solid rgba(74, 222, 128, .35) + } + + .proto-http { + background: rgba(16, 185, 129, .2); + color: #34d399; + border: 1px solid rgba(52, 211, 153, .35) + } + + .proto-mdns { + background: rgba(99, 102, 241, .2); + color: #818cf8; + border: 1px solid rgba(129, 140, 248, .35) + } + + .proto-other { + background: rgba(100, 116, 139, .2); + color: #94a3b8; + border: 1px solid rgba(148, 163, 184, .35) + } + + html[data-theme="light"] .proto-dns { + background: #e0f2fe; + color: #0284c7; + border-color: #bae6fd + } + + html[data-theme="light"] .proto-icmp { + background: #fce7f3; + color: #db2777; + border-color: #fbcfe8 + } + + html[data-theme="light"] .proto-tcp { + background: #f1f5f9; + color: #475569; + border-color: #cbd5e1 + } + + html[data-theme="light"] .proto-udp { + background: #f3e8ff; + color: #7e22ce; + border-color: #e9d5ff + } + + html[data-theme="light"] .proto-arp { + background: #fef9c3; + color: #a16207; + border-color: #fde047 + } + + html[data-theme="light"] .proto-dhcp { + background: #ffedd5; + color: #c2410c; + border-color: #fed7aa + } + + html[data-theme="light"] .proto-tls { + background: #dcfce7; + color: #15803d; + border-color: #bbf7d0 + } + + html[data-theme="light"] .proto-http { + background: #d1fae5; + color: #047857; + border-color: #a7f3d0 + } + + .capture-actions { + display: flex; + gap: 8px; + flex-wrap: wrap; + align-items: center + } + + .filter-chips { + display: flex; + gap: 6px; + flex-wrap: wrap; + align-items: center; + margin: 10px 0 6px + } + + .filter-chip { + background: var(--panel2); + border: 1px solid var(--line); + color: var(--muted); + padding: 5px 12px; + border-radius: 7px; + font-size: 12px; + cursor: pointer; + font-family: monospace; + font-weight: 600; + transition: all .15s ease + } + + .filter-chip:hover { + color: var(--text); + border-color: var(--blue) + } + + .filter-chip.active { + background: var(--blue) !important; + color: var(--blue-text, #071326) !important; + border-color: var(--blue) !important; + font-weight: 700 + } + + .wireshark-filter-bar { + display: flex; + gap: 12px; + align-items: center; + margin: 10px 0 14px; + flex-wrap: wrap + } + + .filter-input-wrap { + position: relative; + flex: 1; + min-width: 240px + } + + .filter-input-wrap input { + width: 100%; + padding: 10px 38px 10px 36px; + border-radius: 8px; + border: 1px solid var(--line); + background: var(--panel2); + color: var(--text); + font-family: monospace; + font-size: 13px; + box-sizing: border-box + } + + .filter-input-wrap .filter-icon { + position: absolute; + left: 12px; + top: 50%; + transform: translateY(-50%); + color: var(--muted); + pointer-events: none + } + + .filter-input-wrap .clear-filter-btn { + position: absolute; + right: 8px; + top: 50%; + transform: translateY(-50%); + background: transparent; + border: none; + color: var(--muted); + cursor: pointer; + padding: 4px 8px; + font-size: 14px + } + + .filter-side-controls { + display: flex; + gap: 12px; + align-items: center; + flex-shrink: 0 + } + + .packet-row { + cursor: pointer; + transition: background .15s + } + + .packet-row:hover { + background: rgba(92, 167, 255, .08) !important + } + + .ip-country-badge { + display: inline-flex; + align-items: center; + gap: 4px; + padding: 2px 6px; + border-radius: 4px; + font-size: 11px; + font-weight: 700; + line-height: 1.2; + white-space: nowrap; + background: rgba(255, 255, 255, 0.06); + border: 1px solid var(--line); + cursor: default; + vertical-align: middle + } + + .ip-country-badge.badge-lan { + background: rgba(92, 167, 255, .14); + border-color: rgba(92, 167, 255, .35); + color: var(--blue) + } + + .ip-country-badge.badge-country { + background: rgba(34, 197, 94, .14); + border-color: rgba(34, 197, 94, .35); + color: var(--green) + } + + .ip-country-badge.badge-ext { + background: rgba(234, 179, 8, .14); + border-color: rgba(234, 179, 8, .35); + color: #facc15 + } + + .ip-country-badge .country-code { + font-family: monospace; + font-size: 10px; + opacity: .95; + letter-spacing: 0.5px + } + + .ip-country-badge .flag-icon-wrap { + display: inline-flex; + align-items: center; + justify-content: center; + line-height: 1; + flex-shrink: 0 + } + + .ip-country-badge .flag-icon { + display: inline-block; + vertical-align: middle; + border-radius: 2px; + box-shadow: 0 0 1px rgba(0, 0, 0, 0.5); + flex-shrink: 0 + } + + .ip-country-badge.country-filter-tag { + cursor: pointer; + transition: transform .12s, filter .12s + } + + .ip-country-badge.country-filter-tag:hover { + filter: brightness(1.2); + border-color: var(--blue); + transform: translateY(-1px) + } + + html[data-theme="light"] .ip-country-badge.badge-lan { + background: #e0f2fe; + border-color: #bae6fd; + color: #0284c7 + } + + html[data-theme="light"] .ip-country-badge.badge-country { + background: #dcfce7; + border-color: #bbf7d0; + color: #15803d + } + + html[data-theme="light"] .ip-country-badge.badge-ext { + background: #fef9c3; + border-color: #fde047; + color: #a16207 + } + + .badge-vpn-wg { + background: rgba(184, 27, 27, .18); + border: 1px solid rgba(220, 38, 38, .4); + color: #fca5a5 + } + + .badge-vpn-ovpn { + background: rgba(234, 88, 12, .18); + border: 1px solid rgba(234, 88, 12, .4); + color: #fdba74 + } + + .vpn-badge-mini { + display: inline-flex; + align-items: center; + padding: 2px 4px; + border-radius: 4px; + vertical-align: middle + } + + .vpn-type-logo { + filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); + flex-shrink: 0 + } + + html[data-theme="light"] .badge-vpn-wg { + background: #fee2e2; + border-color: #fca5a5; + color: #991b1b + } + + html[data-theme="light"] .badge-vpn-ovpn { + background: #ffedd5; + border-color: #fed7aa; + color: #c2410c + } + + .icon-result-card { + background: var(--panel2); + border: 1px solid var(--line); + border-radius: 8px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + cursor: pointer; + padding: 4px 2px; + height: 44px; + transition: all .15s ease; + user-select: none; + box-sizing: border-box + } + + .icon-result-card:hover { + border-color: var(--blue); + background: rgba(56, 189, 248, .12); + transform: translateY(-1px) + } + + .icon-result-card.active { + border-color: var(--blue); + background: rgba(56, 189, 248, .2); + box-shadow: 0 0 0 1.5px var(--blue) + } + + .icon-result-tag { + font-size: 9px; + color: var(--muted); + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-top: 2px; + line-height: 1; + padding: 0 2px + } + + .settings-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 18px; + margin-top: 18px; + align-items: start + } + + .mode-selector-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 12px; + margin: 7px 0 16px + } + + .modal-overlay { + display: none; + position: fixed; + inset: 0; + background: rgba(0, 0, 0, 0.72); + z-index: 999; + align-items: center; + justify-content: center; + padding: 16px; + backdrop-filter: blur(3px) + } + + .modal-overlay.active { + display: flex + } + + .modal-card { + background: var(--panel); + border: 1px solid var(--line); + border-radius: 14px; + max-width: 760px; + width: 100%; + max-height: 90vh; + display: flex; + flex-direction: column; + box-shadow: 0 12px 40px rgba(0, 0, 0, .5); + overflow: hidden + } + + .modal-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 16px 20px; + border-bottom: 1px solid var(--line) + } + + .modal-body { + padding: 16px 20px; + overflow-y: auto; + display: flex; + flex-direction: column; + gap: 14px + } + + .modal-footer { + padding: 12px 20px; + border-top: 1px solid var(--line); + display: flex; + justify-content: flex-end + } + + /* Topologie Réseau */ + .topo-map-card { + background: linear-gradient(180deg, rgba(13, 29, 54, .96), rgba(7, 19, 38, .98)); + border: 1px solid var(--line); + border-radius: 14px; + box-shadow: inset 0 0 60px rgba(0, 0, 0, .3); + position: relative; + overflow: hidden; + min-height: 520px; + padding: 28px 16px + } + + html[data-theme="light"] .topo-map-card { + background: linear-gradient(180deg, #ffffff, #f2f6fc); + box-shadow: inset 0 0 40px rgba(0, 0, 0, .03) + } + + .topo-node { + background: var(--panel2); + border: 1px solid var(--line); + border-radius: 14px; + padding: 12px 18px; + display: flex; + align-items: center; + gap: 14px; + cursor: pointer; + transition: all .2s ease; + box-shadow: 0 4px 16px rgba(0, 0, 0, .25); + position: relative; + user-select: none; + max-width: 420px; + width: 100% + } + + .topo-node:hover { + transform: translateY(-3px); + border-color: var(--blue); + box-shadow: 0 8px 24px rgba(92, 167, 255, .22) + } + + .topo-node-icon { + width: 44px; + height: 44px; + border-radius: 12px; + background: var(--panel); + border: 1px solid var(--line); + display: grid; + place-items: center; + font-size: 22px; + flex-shrink: 0 + } + + .topo-node-title { + font-weight: 700; + font-size: 15px; + color: var(--text) + } + + .topo-node-sub { + font-size: 13px; + color: var(--muted); + font-family: ui-monospace, monospace + } + + .topo-node-ap { + border-color: var(--line); + background: var(--panel2); + } + + .topo-node-ap:hover { + border-color: var(--blue); + } + + .topo-level1-single { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + max-width: 920px + } + + .topo-level1-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 20px; + width: 100%; + max-width: 920px; + align-items: start + } + + @media (max-width:680px) { + .topo-level1-grid { + display: grid !important; + grid-template-columns: 1fr 1fr !important; + gap: 10px !important; + align-items: start !important + } + + .topo-level1-grid .topo-node { + padding: 10px 10px !important; + gap: 8px !important + } + + .topo-level1-grid .topo-node-icon { + width: 36px !important; + height: 36px !important; + font-size: 18px !important; + border-radius: 10px !important + } + + .topo-level1-grid .topo-node-title { + font-size: 12px !important; + line-height: 1.2 !important + } + + .topo-level1-grid .topo-node-sub { + font-size: 11px !important + } + + .topo-level1-grid .muted { + font-size: 10px !important + } + } + + @media (max-width:480px) { + .topo-level1-grid { + gap: 8px !important + } + + .topo-level1-grid .topo-node { + padding: 8px 8px !important; + gap: 6px !important; + border-radius: 10px !important + } + + .topo-level1-grid .topo-node-icon { + width: 30px !important; + height: 30px !important; + font-size: 15px !important; + border-radius: 8px !important + } + + .topo-level1-grid .topo-node-title { + font-size: 11px !important + } + + .topo-level1-grid .topo-node-sub { + font-size: 9.5px !important + } + + .topo-level1-grid .dot { + width: 8px !important; + height: 8px !important + } + } + + .topo-vertical-link { + display: flex; + flex-direction: column; + align-items: center; + gap: 6px + } + + @keyframes topoDashFlow { + to { + stroke-dashoffset: -24 + } + } + + @keyframes topoPulseGlow { + + 0%, + 100% { + opacity: 0.2; + stroke-width: 2.5px + } + + 50% { + opacity: 0.55; + stroke-width: 4px + } + } + + @keyframes topoPulseDot { + + 0%, + 100% { + transform: scale(1); + opacity: 0.8 + } + + 50% { + transform: scale(1.35); + opacity: 1 + } + } + + @keyframes topoWanFlow { + 0% { + background-position: 0 0 + } + + 100% { + background-position: 0 24px + } + } + + .topo-link-line { + width: 4px; + height: 28px; + background-color: #5ca7ff; + background-color: var(--blue); + border-left: 2px solid var(--blue); + border-right: 2px solid var(--blue); + background-image: repeating-linear-gradient(to bottom, var(--blue) 0px, var(--blue) 6px, rgba(92, 167, 255, 0.25) 6px, rgba(92, 167, 255, 0.25) 12px); + background-size: 100% 24px; + animation: topoWanFlow 0.85s linear infinite; + box-shadow: 0 0 12px rgba(92, 167, 255, .7); + border-radius: 2px + } + + .topo-line-glow { + animation: topoPulseGlow 3s ease-in-out infinite + } + + .topo-line-flow { + stroke-dasharray: 6 6; + animation: topoDashFlow 1.1s linear infinite + } + + .topo-end-dot { + transform-origin: center; + animation: topoPulseDot 2s ease-in-out infinite + } + + .topo-link-badge { + font-size: 11px; + font-weight: 600; + color: var(--muted); + background: var(--panel); + padding: 2px 10px; + border-radius: 10px; + border: 1px solid var(--line) + } + + .topo-clients-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); + gap: 16px; + width: 100%; + margin-top: 8px + } + + .topo-client-card { + background: var(--panel2); + border: 1px solid var(--line); + border-radius: 12px; + padding: 14px; + display: flex; + flex-direction: column; + gap: 10px; + cursor: pointer; + transition: all .2s ease; + box-shadow: 0 3px 12px rgba(0, 0, 0, .2); + position: relative + } + + .topo-client-card:hover { + transform: translateY(-3px); + border-color: var(--blue); + box-shadow: 0 6px 20px rgba(92, 167, 255, .2) + } + + .topo-client-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 8px + } + + .topo-client-type { + width: 34px; + height: 34px; + border-radius: 8px; + background: var(--panel); + display: grid; + place-items: center; + font-size: 18px; + flex-shrink: 0 + } + + .topo-client-name { + font-weight: 700; + font-size: 14px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + max-width: 140px + } + + .topo-client-body { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 6px; + font-size: 12px; + background: var(--panel); + padding: 8px 10px; + border-radius: 8px; + border: 1px solid rgba(255, 255, 255, .04) + } + + html[data-theme="light"] .topo-client-body { + border-color: rgba(0, 0, 0, .06) + } + + .topo-client-speeds { + display: flex; + justify-content: space-between; + font-size: 12px; + font-weight: 600; + padding: 2px 4px + } + + .topo-signal-bars { + display: inline-flex; + gap: 2px; + align-items: flex-end; + height: 12px + } + + .topo-signal-bar { + width: 3px; + background: rgba(255, 255, 255, .2); + border-radius: 1px + } + + .topo-signal-bar.active-green { + background: var(--green) + } + + .topo-signal-bar.active-yellow { + background: #f6ad55 + } + + .topo-signal-bar.active-red { + background: var(--red) + } + + .topo-actions { + display: flex; + gap: 6px; + margin-top: 2px + } + + .topo-actions button { + flex: 1; + padding: 5px 8px; + font-size: 12px + } + + .topo-progress-track { + height: 6px; + background: var(--panel); + border-radius: 3px; + overflow: hidden; + position: relative + } + + .topo-progress-fill { + height: 100%; + border-radius: 3px; + transition: width .3s ease + } + + + /* Tablette et écrans intermédiaires (<= 1100px) */ + @media (max-width:1100px) { + .wrap { + padding: 18px 16px 36px; + max-width: 100% + } + + .layout { + grid-template-columns: 1fr; + gap: 18px + } + + .layout>aside { + position: static; + width: 100% + } + + .settings-grid { + grid-template-columns: 1fr; + gap: 16px + } + + .grid { + grid-template-columns: repeat(2, 1fr); + gap: 14px + } + + .chart-box { + height: 280px; + min-height: 260px + } + } + + /* Téléphone et écrans compacts (<= 600px) */ + @media (max-width:600px) { + .wrap { + padding: 12px 10px 32px + } + + header { + flex-direction: column; + align-items: stretch; + gap: 12px; + margin-bottom: 14px + } + + h1 { + font-size: 20px; + line-height: 1.25 + } + + h2 { + font-size: 16px + } + + .sub { + font-size: 13px + } + + .header-actions { + display: grid !important; + grid-template-columns: 1fr 1fr; + gap: 8px; + width: 100% + } + + .topo-clients-grid { + grid-template-columns: 1fr !important + } + + .topo-node { + max-width: 100% !important + } + + .header-actions button { + width: 100%; + padding: 10px 6px; + font-size: 13px; + min-height: 42px; + height: auto; + text-align: center + } + + nav { + gap: 6px; + padding-bottom: 8px; + margin-bottom: 14px; + -webkit-overflow-scrolling: touch; + scrollbar-width: none + } + + nav::-webkit-scrollbar { + display: none + } + + nav button, + nav button.secondary { + padding: 7px 12px; + font-size: 13px; + min-height: 38px + } + + .card { + padding: 14px 12px; + border-radius: 12px; + margin-bottom: 14px + } + + .grid { + grid-template-columns: repeat(2, 1fr); + gap: 10px; + margin-bottom: 14px + } + + .metric { + font-size: 20px; + margin-top: 4px + } + + .card .label { + font-size: 11px; + margin-top: 2px + } + + .layout { + grid-template-columns: 1fr; + gap: 14px + } + + .layout>aside { + position: static; + width: 100% + } + + .qr-card-content { + max-width: 100% + } + + .client strong { + max-width: 120px + } + + #qrcode, + #twoFaQr { + width: 202px; + height: 202px; + padding: 12px !important; + margin-bottom: 12px + } + + .settings-nav { + gap: 6px; + margin-bottom: 14px + } + + .settings-nav-btn { + padding: 6px 9px; + font-size: 12px; + min-height: 36px + } + + .settings-panel { + max-width: 100% + } + + .topline { + flex-direction: column; + align-items: flex-start; + gap: 8px + } + + .table-wrap { + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + border-radius: 8px + } + + th, + td { + padding: 8px 6px; + font-size: 13px + } + + th { + font-size: 11px + } + + .stats-range-container { + display: grid !important; + grid-template-columns: repeat(2, 1fr) !important; + gap: 4px !important; + width: 100% + } + + .stats-range-btn { + padding: 8px 6px; + font-size: 12px; + text-align: center; + width: 100% + } + + .chart-box { + height: 240px; + min-height: 220px + } + + .capture-actions { + display: grid !important; + grid-template-columns: 1fr 1fr; + gap: 8px; + width: 100% + } + + .capture-actions button { + width: 100%; + padding: 9px 6px; + font-size: 12px; + min-height: 40px; + text-align: center + } + + .filter-chips { + gap: 4px; + overflow-x: auto; + -webkit-overflow-scrolling: touch + } + + .filter-chip { + padding: 4px 8px; + font-size: 11px + } + + .wireshark-filter-bar { + flex-direction: column; + align-items: stretch; + gap: 8px + } + + .filter-input-wrap { + width: 100%; + min-width: unset + } + + .filter-side-controls { + display: flex; + justify-content: space-between; + align-items: center; + width: 100% + } + + .settings-grid { + grid-template-columns: 1fr; + gap: 14px + } + + .mode-selector-grid { + grid-template-columns: 1fr !important; + gap: 8px !important + } + + .pagination { + flex-direction: column; + align-items: center; + gap: 10px; + text-align: center + } + + .pagination-btns { + justify-content: center; + width: 100% + } + + #authView .card, + #setupView .card { + margin: 16px auto !important; + padding: 16px 14px !important; + max-width: 100% !important + } + + .modal-overlay { + padding: 8px + } + + .modal-card { + max-height: 94vh; + width: 100%; + border-radius: 10px + } + + .modal-header { + padding: 12px 14px + } + + .modal-body { + padding: 12px 14px; + gap: 10px + } + + .modal-footer { + padding: 10px 14px + } + } + + /* Écrans très étroits (<= 380px) */ + @media (max-width:380px) { + .grid { + grid-template-columns: 1fr + } + + .header-actions { + grid-template-columns: 1fr + } + + .capture-actions { + grid-template-columns: 1fr + } + } + + /* ============================================================ + Thème Windows XP (Luna Edition) + ============================================================ */ + html[data-theme="winxp"] body { + background: #1c52b5 linear-gradient(180deg, #1855a8 0%, #2f75d6 28%, #5da2e7 52%, #8ec0ee 64%, #4ea824 64.2%, #388a1b 76%, #286612 100%) fixed no-repeat !important; + background-size: cover !important; + font-family: 'Tahoma', 'Segoe UI', system-ui, sans-serif !important; + color: #000000 !important; + } + + html[data-theme="winxp"] header { + background: linear-gradient(180deg, #0058e6 0%, #3b88fc 12%, #2c6cf5 40%, #004fe4 88%, #0036a4 100%) !important; + padding: 12px 18px !important; + border-radius: 8px 8px 0 0 !important; + border: 1px solid #002277 !important; + border-bottom: 2px solid #002277 !important; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45) !important; + color: #ffffff !important; + } + + html[data-theme="winxp"] header h1 { + color: #ffffff !important; + font-weight: 700 !important; + text-shadow: 1px 1px 2px #001f5c !important; + font-family: 'Tahoma', 'Segoe UI', sans-serif !important; + } + + html[data-theme="winxp"] header .sub { + color: #d6e5ff !important; + text-shadow: 1px 1px 1px #001f5c !important; + } + + html[data-theme="winxp"] nav { + background: linear-gradient(180deg, #245edb 0%, #3a79f6 10%, #1e52c8 90%, #0d3aa9 100%) !important; + padding: 8px 12px !important; + border-radius: 0 0 6px 6px !important; + border: 1px solid #002277 !important; + border-top: 0 !important; + box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35) !important; + } + + html[data-theme="winxp"] nav button, + html[data-theme="winxp"] nav button.secondary { + background: linear-gradient(180deg, #ffffff 0%, #ecebe5 15%, #d8d6c7 85%, #b4b2a3 100%) !important; + color: #000000 !important; + border: 1px solid #003c74 !important; + border-radius: 3px !important; + font-weight: 600 !important; + box-shadow: inset 0 1px 0 #ffffff !important; + } + + html[data-theme="winxp"] nav button.active { + background: linear-gradient(180deg, #3c9c37 0%, #46bd41 12%, #389e34 75%, #257820 100%) !important; + color: #ffffff !important; + border: 1px solid #1a5715 !important; + border-radius: 4px !important; + text-shadow: 1px 1px 2px #0f3d0c !important; + box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.65), 0 2px 6px rgba(0, 0, 0, 0.3) !important; + } + + html[data-theme="winxp"] .card { + background: #ece9d8 !important; + border: 1px solid #0055ea !important; + border-radius: 6px !important; + box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.35), inset 1px 1px 0 #ffffff !important; + color: #000000 !important; + } + + html[data-theme="winxp"] h2, + html[data-theme="winxp"] h3, + html[data-theme="winxp"] .card-title, + html[data-theme="winxp"] .label { + color: #003399 !important; + font-family: 'Tahoma', 'Segoe UI', sans-serif !important; + font-weight: 700 !important; + } + + html[data-theme="winxp"] button, + html[data-theme="winxp"] .header-actions button { + background: linear-gradient(180deg, #ffffff 0%, #ecebe5 15%, #d8d6c7 85%, #b4b2a3 100%) !important; + color: #000000 !important; + border: 1px solid #003c74 !important; + border-radius: 4px !important; + box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #d8d6c7, 0 1px 2px rgba(0, 0, 0, 0.15) !important; + font-family: 'Tahoma', 'Segoe UI', sans-serif !important; + font-weight: 600 !important; + transition: none !important; + } + + html[data-theme="winxp"] button:hover:not(:disabled), + html[data-theme="winxp"] .header-actions button:hover:not(:disabled) { + background: linear-gradient(180deg, #fff7d8 0%, #fedc84 50%, #fec85a 51%, #ffbe43 100%) !important; + border-color: #e59700 !important; + box-shadow: inset 0 1px 0 #fffdf0, 0 1px 3px rgba(229, 151, 0, 0.35) !important; + color: #000000 !important; + } + + html[data-theme="winxp"] button:active:not(:disabled), + html[data-theme="winxp"] .header-actions button:active:not(:disabled) { + background: linear-gradient(180deg, #d3d1c1 0%, #e2dfcf 40%, #eae8dc 100%) !important; + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25) !important; + } + + html[data-theme="winxp"] button.secondary { + background: linear-gradient(180deg, #ffffff 0%, #ecebe5 15%, #d8d6c7 85%, #b4b2a3 100%) !important; + color: #000000 !important; + border: 1px solid #7f9db9 !important; + } + + html[data-theme="winxp"] #authSubmit, + html[data-theme="winxp"] #saveCustomization, + html[data-theme="winxp"] .btn-primary { + background: linear-gradient(180deg, #3c9c37 0%, #46bd41 14%, #389e34 70%, #257820 100%) !important; + border: 1px solid #1a5715 !important; + color: #ffffff !important; + font-weight: 700 !important; + text-shadow: 1px 1px 2px #0f3d0c !important; + box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.65), 0 2px 4px rgba(0, 0, 0, 0.3) !important; + } + + html[data-theme="winxp"] #authSubmit:hover, + html[data-theme="winxp"] #saveCustomization:hover, + html[data-theme="winxp"] .btn-primary:hover { + background: linear-gradient(180deg, #4ec248 0%, #59db53 14%, #44b63f 70%, #2c9126 100%) !important; + border-color: #1e6417 !important; + color: #ffffff !important; + } + + html[data-theme="winxp"] #btnStop, + html[data-theme="winxp"] button.danger, + html[data-theme="winxp"] .btn-danger { + background: linear-gradient(180deg, #f48074 0%, #e04434 15%, #c82818 70%, #9a180a 100%) !important; + border: 1px solid #7a1005 !important; + color: #ffffff !important; + text-shadow: 1px 1px 1px #5a0a04 !important; + } + + html[data-theme="winxp"] input[type="text"], + html[data-theme="winxp"] input[type="password"], + html[data-theme="winxp"] input[type="number"], + html[data-theme="winxp"] select, + html[data-theme="winxp"] textarea { + background: #ffffff !important; + border: 1px solid #7f9db9 !important; + color: #000000 !important; + border-radius: 2px !important; + box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.15) !important; + font-family: 'Tahoma', 'Segoe UI', sans-serif !important; + } + + html[data-theme="winxp"] input:focus, + html[data-theme="winxp"] select:focus, + html[data-theme="winxp"] textarea:focus { + outline: none !important; + border-color: #0055ea !important; + box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.2), 0 0 3px rgba(0, 85, 234, 0.5) !important; + } + + html[data-theme="winxp"] table { + background: #ffffff !important; + border: 1px solid #7f9db9 !important; + color: #000000 !important; + } + + html[data-theme="winxp"] th { + background: linear-gradient(180deg, #ffffff 0%, #ebe9d8 100%) !important; + color: #000000 !important; + border-right: 1px solid #d4d0c8 !important; + border-bottom: 2px solid #7f9db9 !important; + font-weight: 700 !important; + } + + html[data-theme="winxp"] td { + border-bottom: 1px solid #e0dfd6 !important; + color: #000000 !important; + } + + html[data-theme="winxp"] tr:hover td { + background: #316ac5 !important; + color: #ffffff !important; + } + + html[data-theme="winxp"] tr:hover td a, + html[data-theme="winxp"] tr:hover td span:not([class*="badge"]):not([class*="pill"]):not([class*="proto"]) { + color: #ffffff !important; + } + + html[data-theme="winxp"] .modal-overlay { + background: rgba(0, 30, 80, 0.45) !important; + backdrop-filter: blur(2px) !important; + } + + html[data-theme="winxp"] .modal-card { + background: #ece9d8 !important; + border: 3px solid #0055ea !important; + border-radius: 8px 8px 3px 3px !important; + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 1px 1px 0 #ffffff !important; + color: #000000 !important; + } + + html[data-theme="winxp"] #authView .card, + html[data-theme="winxp"] #setupView .card { + background: #ece9d8 !important; + border: 3px solid #0055ea !important; + border-radius: 8px !important; + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important; + color: #000000 !important; + font-family: 'Tahoma', 'Segoe UI', sans-serif !important; + } + + html[data-theme="winxp"] #authView h1, + html[data-theme="winxp"] #authView h2, + html[data-theme="winxp"] #authView .sub { + color: #003399 !important; + font-family: 'Tahoma', 'Segoe UI', sans-serif !important; + font-weight: 700 !important; + text-shadow: none !important; + } + + html[data-theme="winxp"] #authView .muted, + html[data-theme="winxp"] #authView label, + html[data-theme="winxp"] #authView .label { + color: #333333 !important; + font-family: 'Tahoma', sans-serif !important; + } + + html[data-theme="winxp"] #authView input[type="text"], + html[data-theme="winxp"] #authView input[type="password"], + html[data-theme="winxp"] #authThemeSelect { + background: #ffffff !important; + border: 1px solid #7f9db9 !important; + border-radius: 3px !important; + color: #000000 !important; + font-family: 'Tahoma', sans-serif !important; + box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.15) !important; + } + + html[data-theme="winxp"] #toggleAuthPassword { + background: linear-gradient(180deg, #ffffff 0%, #ecebe5 15%, #d8d6c7 85%, #b4b2a3 100%) !important; + border: 1px solid #003c74 !important; + border-radius: 3px !important; + color: #000000 !important; + box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #d8d6c7, 0 1px 2px rgba(0, 0, 0, 0.15) !important; + } + + html[data-theme="winxp"] #toggleAuthPassword:hover { + background: linear-gradient(180deg, #fff2be 0%, #ffdf79 12%, #ffcf45 75%, #f6b509 100%) !important; + border-color: #e5a000 !important; + } + + html[data-theme="winxp"] #authSubmit { + background: linear-gradient(180deg, #3c9c37 0%, #46bd41 12%, #389e34 75%, #257820 100%) !important; + border: 1px solid #1a5715 !important; + border-radius: 4px !important; + color: #ffffff !important; + font-family: 'Tahoma', 'Segoe UI', sans-serif !important; + font-weight: 700 !important; + text-shadow: 1px 1px 1px #0f3d0c !important; + box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.45), 0 2px 4px rgba(0, 0, 0, 0.3) !important; + } + + html[data-theme="winxp"] #authSubmit:hover { + background: linear-gradient(180deg, #4ed348 0%, #54d84f 12%, #42b23d 75%, #2d9226 100%) !important; + box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.6), 0 0 8px rgba(70, 189, 65, 0.6) !important; + } + + html[data-theme="winxp"] #authPasskeyDivider span { + color: #49546a !important; + font-family: 'Tahoma', sans-serif !important; + font-size: 11px !important; + } + + html[data-theme="winxp"] #authPasskeyDivider div { + background: #7f9db9 !important; + } + + html[data-theme="winxp"] #btnAuthPasskey { + background: linear-gradient(180deg, #ffffff 0%, #ecebe5 15%, #d8d6c7 85%, #b4b2a3 100%) !important; + border: 1px solid #003c74 !important; + border-radius: 4px !important; + color: #003399 !important; + font-family: 'Tahoma', 'Segoe UI', sans-serif !important; + font-weight: 700 !important; + box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #d8d6c7, 0 1px 2px rgba(0, 0, 0, 0.15) !important; + } + + html[data-theme="winxp"] #btnAuthPasskey:hover { + background: linear-gradient(180deg, #fff2be 0%, #ffdf79 12%, #ffcf45 75%, #f6b509 100%) !important; + border-color: #e5a000 !important; + color: #000000 !important; + box-shadow: inset 0 1px 0 #ffffff, 0 0 6px rgba(246, 181, 9, 0.5) !important; + } + + html[data-theme="winxp"] #authPasskeyInfo { + color: #49546a !important; + font-family: 'Tahoma', sans-serif !important; + } + + html[data-theme="winxp"] .settings-nav-btn { + background: linear-gradient(180deg, #ffffff 0%, #ecebe5 15%, #d8d6c7 85%, #b4b2a3 100%) !important; + color: #000000 !important; + border: 1px solid #7f9db9 !important; + } + + html[data-theme="winxp"] .settings-nav-btn.active { + background: linear-gradient(180deg, #3c9c37 0%, #46bd41 12%, #389e34 75%, #257820 100%) !important; + color: #ffffff !important; + border: 1px solid #1a5715 !important; + text-shadow: 1px 1px 1px #0f3d0c !important; + } + + html[data-theme="winxp"] .notice { + background: #ffffdf !important; + border: 1px solid #dcd9a0 !important; + color: #333300 !important; + border-radius: 4px !important; + } + + html[data-theme="winxp"] .pill, + html[data-theme="winxp"] .badge { + border: 1px solid #7f9db9 !important; + font-family: 'Tahoma', sans-serif !important; + } + + html[data-theme="winxp"] #updated, + html[data-theme="winxp"] #topoUpdated, + html[data-theme="winxp"] #statsChartUpdated, + html[data-theme="winxp"] #statsTrafficUpdated, + html[data-theme="winxp"] #statsHistoryUpdated, + html[data-theme="winxp"] #captureUpdated, + html[data-theme="winxp"] #logsUpdated, + html[data-theme="winxp"] #blockedUpdated, + html[data-theme="winxp"] .pill-updated, + html[data-theme="winxp"] .pill-green { + background: #d4f0d0 !important; + color: #1a5715 !important; + border: 1px solid #388a1b !important; + } + + html[data-theme="winxp"] .lang-card { + background: #ffffff !important; + border: 1px solid #7f9db9 !important; + color: #000000 !important; + } + + html[data-theme="winxp"] .lang-card.active { + border: 2px solid #0055ea !important; + background: #eef3ff !important; + box-shadow: 0 0 8px rgba(0, 85, 234, 0.3) !important; + } + + html[data-theme="winxp"] .topo-map-card, + html[data-theme="winxp"] .topo-client-body { + background: #ffffff !important; + color: #000000 !important; + border-color: #7f9db9 !important; + } + + html[data-theme="winxp"] ::-webkit-scrollbar { + width: 16px; + height: 16px; + } + + html[data-theme="winxp"] ::-webkit-scrollbar-track { + background: #ece9d8; + border: 1px solid #d4d0c8; + } + + html[data-theme="winxp"] ::-webkit-scrollbar-thumb { + background: linear-gradient(180deg, #ffffff 0%, #ecebe5 15%, #d8d6c7 85%, #b4b2a3 100%); + border: 1px solid #7f9db9; + border-radius: 2px; + box-shadow: inset 1px 1px 0 #ffffff; + } + + html[data-theme="winxp"] ::-webkit-scrollbar-thumb:hover { + background: linear-gradient(180deg, #fff7d8 0%, #fedc84 50%, #fec85a 51%, #ffbe43 100%); + border-color: #e59700; + } + + /* ============================================================ + Thème Futuriste (Cyberpunk & Sci-Fi HUD Edition) + ============================================================ */ + html[data-theme="futuristic"] body { + background: #050814 radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.12) 0%, transparent 55%), + linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px), + linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, #050814 1px) fixed !important; + background-size: 100% 100%, 36px 36px, 36px 36px !important; + font-family: 'Rajdhani', 'Segoe UI', system-ui, sans-serif !important; + color: #e6f6ff !important; + } + + html[data-theme="futuristic"] header { + background: linear-gradient(180deg, rgba(16, 25, 53, 0.95) 0%, rgba(11, 17, 36, 0.98) 100%) !important; + border: 1px solid rgba(0, 240, 255, 0.35) !important; + border-bottom: 2px solid #00f0ff !important; + border-radius: 8px !important; + box-shadow: 0 0 20px rgba(0, 240, 255, 0.2), inset 0 0 15px rgba(0, 240, 255, 0.05) !important; + backdrop-filter: blur(8px) !important; + } + + html[data-theme="futuristic"] header h1 { + color: #00f0ff !important; + text-shadow: 0 0 12px rgba(0, 240, 255, 0.7) !important; + letter-spacing: 0.5px !important; + font-weight: 700 !important; + } + + html[data-theme="futuristic"] header .sub { + color: #7890b8 !important; + letter-spacing: 0.3px !important; + } + + html[data-theme="futuristic"] nav { + border-bottom: 1px solid rgba(0, 240, 255, 0.25) !important; + padding-bottom: 14px !important; + } + + html[data-theme="futuristic"] nav button, + html[data-theme="futuristic"] nav button.secondary { + background: rgba(11, 17, 36, 0.75) !important; + border: 1px solid rgba(0, 240, 255, 0.25) !important; + color: #7890b8 !important; + border-radius: 4px !important; + box-shadow: inset 0 0 8px rgba(0, 240, 255, 0.03) !important; + transition: all .2s ease !important; + } + + html[data-theme="futuristic"] nav button:hover:not(.active), + html[data-theme="futuristic"] nav button.secondary:hover:not(.active) { + border-color: #00f0ff !important; + color: #00f0ff !important; + box-shadow: 0 0 12px rgba(0, 240, 255, 0.3) !important; + } + + html[data-theme="futuristic"] nav button.active { + background: rgba(5, 255, 161, 0.15) !important; + border: 1px solid #05ffa1 !important; + color: #05ffa1 !important; + font-weight: 700 !important; + text-shadow: 0 0 8px rgba(5, 255, 161, 0.6) !important; + box-shadow: 0 0 16px rgba(5, 255, 161, 0.35), inset 0 0 8px rgba(5, 255, 161, 0.15) !important; + } + + html[data-theme="futuristic"] .card { + background: rgba(11, 17, 36, 0.88) !important; + border: 1px solid rgba(0, 240, 255, 0.25) !important; + border-radius: 8px !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 240, 255, 0.08), inset 0 0 12px rgba(0, 240, 255, 0.03) !important; + backdrop-filter: blur(6px) !important; + } + + html[data-theme="futuristic"] .card:hover { + border-color: rgba(0, 240, 255, 0.45) !important; + box-shadow: 0 4px 24px rgba(0, 0, 0, 0.65), 0 0 20px rgba(0, 240, 255, 0.15), inset 0 0 15px rgba(0, 240, 255, 0.05) !important; + } + + html[data-theme="futuristic"] h2, + html[data-theme="futuristic"] h3, + html[data-theme="futuristic"] .card-title { + color: #00f0ff !important; + text-shadow: 0 0 8px rgba(0, 240, 255, 0.4) !important; + letter-spacing: 0.5px !important; + } + + html[data-theme="futuristic"] .label { + color: #7890b8 !important; + text-transform: uppercase !important; + letter-spacing: 0.8px !important; + font-size: 11px !important; + font-weight: 700 !important; + } + + html[data-theme="futuristic"] button, + html[data-theme="futuristic"] .header-actions button { + background: rgba(0, 240, 255, 0.1) !important; + border: 1px solid rgba(0, 240, 255, 0.45) !important; + color: #00f0ff !important; + border-radius: 6px !important; + font-weight: 600 !important; + letter-spacing: 0.4px !important; + box-shadow: 0 0 10px rgba(0, 240, 255, 0.15) !important; + transition: all .2s ease !important; + } + + html[data-theme="futuristic"] button:hover:not(:disabled), + html[data-theme="futuristic"] .header-actions button:hover:not(:disabled) { + background: rgba(0, 240, 255, 0.25) !important; + border-color: #00f0ff !important; + color: #ffffff !important; + box-shadow: 0 0 18px rgba(0, 240, 255, 0.5) !important; + } + + html[data-theme="futuristic"] #authSubmit, + html[data-theme="futuristic"] #saveCustomization, + html[data-theme="futuristic"] .btn-primary { + background: linear-gradient(135deg, rgba(0, 240, 255, 0.3) 0%, rgba(5, 255, 161, 0.35) 100%) !important; + border: 1px solid #05ffa1 !important; + color: #05ffa1 !important; + font-weight: 700 !important; + text-shadow: 0 0 8px rgba(5, 255, 161, 0.6) !important; + box-shadow: 0 0 18px rgba(5, 255, 161, 0.3) !important; + } + + html[data-theme="futuristic"] #authSubmit:hover, + html[data-theme="futuristic"] #saveCustomization:hover, + html[data-theme="futuristic"] .btn-primary:hover { + background: linear-gradient(135deg, rgba(0, 240, 255, 0.5) 0%, rgba(5, 255, 161, 0.55) 100%) !important; + color: #ffffff !important; + box-shadow: 0 0 24px rgba(5, 255, 161, 0.6) !important; + } + + html[data-theme="futuristic"] #btnStop, + html[data-theme="futuristic"] button.danger, + html[data-theme="futuristic"] .btn-danger { + background: rgba(255, 42, 109, 0.15) !important; + border: 1px solid #ff2a6d !important; + color: #ff2a6d !important; + text-shadow: 0 0 8px rgba(255, 42, 109, 0.6) !important; + box-shadow: 0 0 14px rgba(255, 42, 109, 0.25) !important; + } + + html[data-theme="futuristic"] #btnStop:hover, + html[data-theme="futuristic"] button.danger:hover, + html[data-theme="futuristic"] .btn-danger:hover { + background: rgba(255, 42, 109, 0.35) !important; + color: #ffffff !important; + box-shadow: 0 0 22px rgba(255, 42, 109, 0.6) !important; + } + + html[data-theme="futuristic"] input[type="text"], + html[data-theme="futuristic"] input[type="password"], + html[data-theme="futuristic"] input[type="number"], + html[data-theme="futuristic"] select, + html[data-theme="futuristic"] textarea { + background: #080d1f !important; + border: 1px solid rgba(0, 240, 255, 0.3) !important; + color: #00f0ff !important; + border-radius: 4px !important; + box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6) !important; + transition: all .2s ease !important; + } + + html[data-theme="futuristic"] input:focus, + html[data-theme="futuristic"] select:focus, + html[data-theme="futuristic"] textarea:focus { + outline: none !important; + border-color: #00f0ff !important; + box-shadow: 0 0 12px rgba(0, 240, 255, 0.4), inset 0 0 8px rgba(0, 0, 0, 0.6) !important; + } + + html[data-theme="futuristic"] table { + background: rgba(11, 17, 36, 0.9) !important; + border: 1px solid rgba(0, 240, 255, 0.2) !important; + } + + html[data-theme="futuristic"] th { + background: rgba(16, 25, 53, 0.95) !important; + color: #00f0ff !important; + border-bottom: 2px solid rgba(0, 240, 255, 0.35) !important; + text-transform: uppercase !important; + letter-spacing: 0.8px !important; + font-size: 11px !important; + } + + html[data-theme="futuristic"] td { + border-bottom: 1px solid rgba(0, 240, 255, 0.12) !important; + color: #e6f6ff !important; + } + + html[data-theme="futuristic"] tr:hover td { + background: rgba(0, 240, 255, 0.08) !important; + } + + html[data-theme="futuristic"] .modal-overlay { + background: rgba(4, 7, 16, 0.75) !important; + backdrop-filter: blur(6px) !important; + } + + html[data-theme="futuristic"] .modal-card { + background: #0b1124 !important; + border: 1px solid #00f0ff !important; + box-shadow: 0 0 35px rgba(0, 240, 255, 0.35), inset 0 0 15px rgba(0, 240, 255, 0.08) !important; + border-radius: 8px !important; + } + + html[data-theme="futuristic"] #authView .card, + html[data-theme="futuristic"] #setupView .card { + background: rgba(11, 17, 36, 0.95) !important; + border: 1px solid #00f0ff !important; + box-shadow: 0 0 35px rgba(0, 240, 255, 0.35), inset 0 0 20px rgba(0, 240, 255, 0.08) !important; + border-radius: 8px !important; + } + + html[data-theme="futuristic"] #authView h1 { + color: #00f0ff !important; + text-shadow: 0 0 15px rgba(0, 240, 255, 0.8) !important; + letter-spacing: 1.5px !important; + } + + html[data-theme="futuristic"] #authView .muted { + color: #7890b8 !important; + letter-spacing: 0.5px !important; + } + + html[data-theme="futuristic"] #authView .label { + color: #00f0ff !important; + text-transform: uppercase !important; + letter-spacing: 1px !important; + font-size: 11px !important; + font-weight: 700 !important; + } + + html[data-theme="futuristic"] #authView input[type="text"], + html[data-theme="futuristic"] #authView input[type="password"], + html[data-theme="futuristic"] #authThemeSelect { + background: rgba(7, 12, 28, 0.85) !important; + border: 1px solid rgba(0, 240, 255, 0.35) !important; + color: #e6f6ff !important; + border-radius: 6px !important; + box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.1) !important; + } + + html[data-theme="futuristic"] #authView input[type="text"]:focus, + html[data-theme="futuristic"] #authView input[type="password"]:focus, + html[data-theme="futuristic"] #authThemeSelect:focus { + border-color: #00f0ff !important; + box-shadow: 0 0 15px rgba(0, 240, 255, 0.4), inset 0 0 10px rgba(0, 240, 255, 0.2) !important; + } + + html[data-theme="futuristic"] #toggleAuthPassword { + background: rgba(0, 240, 255, 0.1) !important; + border: 1px solid rgba(0, 240, 255, 0.45) !important; + color: #00f0ff !important; + border-radius: 6px !important; + box-shadow: 0 0 10px rgba(0, 240, 255, 0.15) !important; + } + + html[data-theme="futuristic"] #authSubmit { + background: linear-gradient(135deg, #00f0ff 0%, #7928ca 100%) !important; + border: 1px solid #00f0ff !important; + color: #ffffff !important; + border-radius: 8px !important; + font-weight: 700 !important; + text-shadow: 0 0 8px rgba(0, 0, 0, 0.8) !important; + box-shadow: 0 0 20px rgba(0, 240, 255, 0.5) !important; + letter-spacing: 1px !important; + } + + html[data-theme="futuristic"] #authSubmit:hover { + box-shadow: 0 0 30px rgba(0, 240, 255, 0.8), 0 0 15px rgba(121, 40, 202, 0.6) !important; + transform: translateY(-1px); + } + + html[data-theme="futuristic"] #authPasskeyDivider span { + color: #00f0ff !important; + text-shadow: 0 0 6px rgba(0, 240, 255, 0.5) !important; + letter-spacing: 1px !important; + } + + html[data-theme="futuristic"] #authPasskeyDivider div { + background: rgba(0, 240, 255, 0.35) !important; + } + + html[data-theme="futuristic"] #btnAuthPasskey { + background: rgba(255, 0, 127, 0.1) !important; + border: 1px solid #ff007f !important; + color: #ff007f !important; + border-radius: 8px !important; + text-shadow: 0 0 8px rgba(255, 0, 127, 0.6) !important; + box-shadow: 0 0 15px rgba(255, 0, 127, 0.25) !important; + letter-spacing: 0.5px !important; + font-weight: 700 !important; + } + + html[data-theme="futuristic"] #btnAuthPasskey:hover { + background: rgba(255, 0, 127, 0.22) !important; + box-shadow: 0 0 25px rgba(255, 0, 127, 0.55) !important; + transform: translateY(-1px); + } + + html[data-theme="futuristic"] #authPasskeyInfo { + color: #7890b8 !important; + letter-spacing: 0.4px !important; + } + + html[data-theme="futuristic"] .settings-nav-btn { + background: rgba(11, 17, 36, 0.75) !important; + border: 1px solid rgba(0, 240, 255, 0.25) !important; + color: #7890b8 !important; + } + + html[data-theme="futuristic"] .settings-nav-btn.active { + background: rgba(0, 240, 255, 0.2) !important; + border-color: #00f0ff !important; + color: #00f0ff !important; + text-shadow: 0 0 8px rgba(0, 240, 255, 0.6) !important; + box-shadow: 0 0 15px rgba(0, 240, 255, 0.3) !important; + } + + html[data-theme="futuristic"] .notice { + background: rgba(0, 240, 255, 0.07) !important; + border: 1px solid rgba(0, 240, 255, 0.35) !important; + color: #e6f6ff !important; + border-radius: 6px !important; + } + + html[data-theme="futuristic"] .pill, + html[data-theme="futuristic"] .badge { + border: 1px solid rgba(0, 240, 255, 0.3) !important; + background: rgba(0, 240, 255, 0.08) !important; + color: #00f0ff !important; + letter-spacing: 0.3px !important; + } + + html[data-theme="futuristic"] #updated, + html[data-theme="futuristic"] #topoUpdated, + html[data-theme="futuristic"] #statsChartUpdated, + html[data-theme="futuristic"] #statsTrafficUpdated, + html[data-theme="futuristic"] #statsHistoryUpdated, + html[data-theme="futuristic"] #captureUpdated, + html[data-theme="futuristic"] #logsUpdated, + html[data-theme="futuristic"] #blockedUpdated, + html[data-theme="futuristic"] .pill-updated, + html[data-theme="futuristic"] .pill-green { + background: rgba(5, 255, 161, 0.12) !important; + color: #05ffa1 !important; + border: 1px solid #05ffa1 !important; + box-shadow: 0 0 8px rgba(5, 255, 161, 0.25) !important; + } + + html[data-theme="futuristic"] .lang-card { + background: rgba(11, 17, 36, 0.8) !important; + border: 1px solid rgba(0, 240, 255, 0.25) !important; + color: #e6f6ff !important; + } + + html[data-theme="futuristic"] .lang-card.active { + border-color: #00f0ff !important; + background: rgba(0, 240, 255, 0.15) !important; + box-shadow: 0 0 15px rgba(0, 240, 255, 0.35) !important; + } + + html[data-theme="futuristic"] .topo-map-card, + html[data-theme="futuristic"] .topo-client-body { + background: rgba(11, 17, 36, 0.95) !important; + border-color: rgba(0, 240, 255, 0.3) !important; + color: #e6f6ff !important; + } + + html[data-theme="futuristic"] ::-webkit-scrollbar { + width: 10px; + height: 10px; + } + + html[data-theme="futuristic"] ::-webkit-scrollbar-track { + background: #050814; + border: 1px solid rgba(0, 240, 255, 0.15); + } + + html[data-theme="futuristic"] ::-webkit-scrollbar-thumb { + background: rgba(0, 240, 255, 0.3); + border: 1px solid #00f0ff; + border-radius: 4px; + box-shadow: 0 0 8px rgba(0, 240, 255, 0.4); + } + + html[data-theme="futuristic"] ::-webkit-scrollbar-thumb:hover { + background: rgba(0, 240, 255, 0.6); + box-shadow: 0 0 14px rgba(0, 240, 255, 0.7); + } + + /* ============================================================ + Thème macOS (Apple Aqua & Glassmorphism) + ============================================================ */ + html[data-theme="macos"] body { + background: #f5f5f7 linear-gradient(180deg, #e4ecf7 0%, #f5f5f7 400px) fixed no-repeat !important; + font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif !important; + color: #1d1d1f !important; + -webkit-font-smoothing: antialiased !important; + } + + html[data-theme="macos"] header { + background: rgba(255, 255, 255, 0.8) !important; + backdrop-filter: saturate(180%) blur(20px) !important; + -webkit-backdrop-filter: saturate(180%) blur(20px) !important; + border: 1px solid rgba(0, 0, 0, 0.08) !important; + border-radius: 12px !important; + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important; + padding: 14px 20px !important; + } + + html[data-theme="macos"] header h1 { + color: #1d1d1f !important; + font-weight: 700 !important; + letter-spacing: -0.5px !important; + } + + html[data-theme="macos"] header .sub { + color: #86868b !important; + font-weight: 400 !important; + } + + html[data-theme="macos"] nav { + background: rgba(235, 235, 240, 0.7) !important; + backdrop-filter: blur(12px) !important; + padding: 6px !important; + border-radius: 10px !important; + border: 1px solid rgba(0, 0, 0, 0.06) !important; + gap: 4px !important; + } + + html[data-theme="macos"] nav button, + html[data-theme="macos"] nav button.secondary { + background: transparent !important; + border: 0 !important; + color: #515154 !important; + border-radius: 7px !important; + font-weight: 500 !important; + font-size: 13px !important; + box-shadow: none !important; + transition: all .15s ease !important; + } + + html[data-theme="macos"] nav button:hover:not(.active), + html[data-theme="macos"] nav button.secondary:hover:not(.active) { + background: rgba(0, 0, 0, 0.05) !important; + color: #1d1d1f !important; + } + + html[data-theme="macos"] nav button.active { + background: #ffffff !important; + color: #1d1d1f !important; + font-weight: 600 !important; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.15) !important; + } + + html[data-theme="macos"] .card { + background: #ffffff !important; + border: 1px solid rgba(0, 0, 0, 0.07) !important; + border-radius: 14px !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02) !important; + color: #1d1d1f !important; + } + + html[data-theme="macos"] h2, + html[data-theme="macos"] h3, + html[data-theme="macos"] .card-title { + color: #1d1d1f !important; + letter-spacing: -0.3px !important; + } + + html[data-theme="macos"] .label { + color: #86868b !important; + font-weight: 500 !important; + font-size: 12px !important; + } + + html[data-theme="macos"] button, + html[data-theme="macos"] .header-actions button { + background: #f2f2f7 !important; + border: 1px solid rgba(0, 0, 0, 0.08) !important; + color: #1d1d1f !important; + border-radius: 8px !important; + font-weight: 500 !important; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important; + transition: all .15s ease !important; + } + + html[data-theme="macos"] button:hover:not(:disabled), + html[data-theme="macos"] .header-actions button:hover:not(:disabled) { + background: #e5e5ea !important; + color: #000000 !important; + } + + html[data-theme="macos"] #authSubmit, + html[data-theme="macos"] #saveCustomization, + html[data-theme="macos"] .btn-primary { + background: #0071e3 !important; + border: 1px solid #0062c4 !important; + color: #ffffff !important; + font-weight: 600 !important; + box-shadow: 0 2px 6px rgba(0, 113, 227, 0.3) !important; + } + + html[data-theme="macos"] #authSubmit:hover, + html[data-theme="macos"] #saveCustomization:hover, + html[data-theme="macos"] .btn-primary:hover { + background: #0077ed !important; + box-shadow: 0 4px 10px rgba(0, 113, 227, 0.4) !important; + } + + html[data-theme="macos"] #btnStop, + html[data-theme="macos"] button.danger, + html[data-theme="macos"] .btn-danger { + background: #ff3b30 !important; + border: 1px solid #e0281d !important; + color: #ffffff !important; + box-shadow: 0 2px 6px rgba(255, 59, 48, 0.3) !important; + } + + html[data-theme="macos"] input[type="text"], + html[data-theme="macos"] input[type="password"], + html[data-theme="macos"] input[type="number"], + html[data-theme="macos"] select, + html[data-theme="macos"] textarea { + background: #ffffff !important; + border: 1px solid #d1d1d6 !important; + color: #1d1d1f !important; + border-radius: 8px !important; + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03) !important; + transition: border-color .15s ease, box-shadow .15s ease !important; + } + + html[data-theme="macos"] input:focus, + html[data-theme="macos"] select:focus, + html[data-theme="macos"] textarea:focus { + outline: none !important; + border-color: #0071e3 !important; + box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.25) !important; + } + + html[data-theme="macos"] table { + background: #ffffff !important; + border: 1px solid #e5e5ea !important; + border-radius: 10px !important; + overflow: hidden !important; + } + + html[data-theme="macos"] th { + background: #fbfbfd !important; + color: #86868b !important; + font-weight: 600 !important; + border-bottom: 1px solid #e5e5ea !important; + } + + html[data-theme="macos"] td { + border-bottom: 1px solid #f2f2f7 !important; + color: #1d1d1f !important; + } + + html[data-theme="macos"] tr:hover td { + background: #f5f8ff !important; + } + + html[data-theme="macos"] .modal-overlay { + background: rgba(0, 0, 0, 0.3) !important; + backdrop-filter: blur(16px) !important; + -webkit-backdrop-filter: blur(16px) !important; + } + + html[data-theme="macos"] .modal-card { + background: #ffffff !important; + border: 1px solid rgba(0, 0, 0, 0.1) !important; + border-radius: 16px !important; + box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18) !important; + } + + html[data-theme="macos"] #authView .card, + html[data-theme="macos"] #setupView .card { + background: rgba(255, 255, 255, 0.85) !important; + backdrop-filter: blur(25px) !important; + -webkit-backdrop-filter: blur(25px) !important; + border: 1px solid rgba(0, 0, 0, 0.08) !important; + border-radius: 18px !important; + box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08) !important; + } + + html[data-theme="macos"] #authView h1 { + color: #1d1d1f !important; + font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", sans-serif !important; + font-weight: 700 !important; + letter-spacing: -0.5px !important; + } + + html[data-theme="macos"] #authView .muted { + color: #86868b !important; + } + + html[data-theme="macos"] #authView .label { + color: #6e6e73 !important; + font-weight: 500 !important; + } + + html[data-theme="macos"] #authView input[type="text"], + html[data-theme="macos"] #authView input[type="password"], + html[data-theme="macos"] #authThemeSelect { + background: #ffffff !important; + border: 1px solid rgba(0, 0, 0, 0.15) !important; + border-radius: 8px !important; + color: #1d1d1f !important; + } + + html[data-theme="macos"] #toggleAuthPassword { + background: #f2f2f7 !important; + border: 1px solid rgba(0, 0, 0, 0.1) !important; + color: #1d1d1f !important; + border-radius: 8px !important; + } + + html[data-theme="macos"] #authSubmit { + background: #0071e3 !important; + color: #ffffff !important; + border: none !important; + border-radius: 10px !important; + font-weight: 500 !important; + box-shadow: 0 2px 8px rgba(0, 113, 227, 0.35) !important; + } + + html[data-theme="macos"] #authSubmit:hover { + background: #0077ed !important; + } + + html[data-theme="macos"] #authPasskeyDivider span { + color: #86868b !important; + font-size: 11px !important; + font-weight: 600 !important; + } + + html[data-theme="macos"] #authPasskeyDivider div { + background: rgba(0, 0, 0, 0.1) !important; + } + + html[data-theme="macos"] #btnAuthPasskey { + background: rgba(0, 0, 0, 0.04) !important; + border: 1px solid rgba(0, 0, 0, 0.1) !important; + border-radius: 10px !important; + color: #0071e3 !important; + font-weight: 500 !important; + } + + html[data-theme="macos"] #btnAuthPasskey:hover { + background: rgba(0, 113, 227, 0.1) !important; + border-color: #0071e3 !important; + } + + html[data-theme="macos"] #authPasskeyInfo { + color: #86868b !important; + } + + html[data-theme="macos"] .settings-nav-btn { + background: #f2f2f7 !important; + border: 1px solid rgba(0, 0, 0, 0.06) !important; + color: #1d1d1f !important; + border-radius: 8px !important; + } + + html[data-theme="macos"] .settings-nav-btn.active { + background: #0071e3 !important; + border-color: #0071e3 !important; + color: #ffffff !important; + } + + html[data-theme="macos"] .notice { + background: #f0f7ff !important; + border: 1px solid #cce3ff !important; + color: #004085 !important; + border-radius: 10px !important; + } + + html[data-theme="macos"] .pill, + html[data-theme="macos"] .badge { + border-radius: 20px !important; + font-weight: 500 !important; + } + + html[data-theme="macos"] #updated, + html[data-theme="macos"] #topoUpdated, + html[data-theme="macos"] #statsChartUpdated, + html[data-theme="macos"] #statsTrafficUpdated, + html[data-theme="macos"] #statsHistoryUpdated, + html[data-theme="macos"] #captureUpdated, + html[data-theme="macos"] #logsUpdated, + html[data-theme="macos"] #blockedUpdated, + html[data-theme="macos"] .pill-updated, + html[data-theme="macos"] .pill-green { + background: #e8f8ed !important; + color: #248a3d !important; + border: 1px solid #c2eccd !important; + } + + html[data-theme="macos"] .lang-card { + background: #ffffff !important; + border: 1px solid #e5e5ea !important; + border-radius: 12px !important; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important; + } + + html[data-theme="macos"] .lang-card.active { + border: 2px solid #0071e3 !important; + box-shadow: 0 4px 14px rgba(0, 113, 227, 0.2) !important; + } + + html[data-theme="macos"] ::-webkit-scrollbar { + width: 8px; + height: 8px; + } + + html[data-theme="macos"] ::-webkit-scrollbar-track { + background: transparent; + } + + html[data-theme="macos"] ::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.2); + border-radius: 10px; + } + + html[data-theme="macos"] ::-webkit-scrollbar-thumb:hover { + background: rgba(0, 0, 0, 0.35); + } + + + /* macOS Mode Sombre (Automatique selon le système) */ + @media (prefers-color-scheme: dark) { + html[data-theme="macos"] body { + background: #1c1c1e linear-gradient(180deg, #252830 0%, #1c1c1e 400px) fixed no-repeat !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"] header { + background: rgba(36, 36, 38, 0.85) !important; + border: 1px solid rgba(255, 255, 255, 0.12) !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important; + } + + html[data-theme="macos"] header h1 { + color: #f5f5f7 !important; + } + + html[data-theme="macos"] header .sub { + color: #98989d !important; + } + + html[data-theme="macos"] nav { + background: rgba(44, 44, 46, 0.75) !important; + border-color: rgba(255, 255, 255, 0.1) !important; + } + + html[data-theme="macos"] nav button, + html[data-theme="macos"] nav button.secondary { + color: #98989d !important; + } + + html[data-theme="macos"] nav button:hover:not(.active), + html[data-theme="macos"] nav button.secondary:hover:not(.active) { + background: rgba(255, 255, 255, 0.08) !important; + color: #ffffff !important; + } + + html[data-theme="macos"] nav button.active { + background: #636366 !important; + color: #ffffff !important; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important; + } + + html[data-theme="macos"] .card { + background: #28282a !important; + border-color: rgba(255, 255, 255, 0.1) !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2) !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"] h2, + html[data-theme="macos"] h3, + html[data-theme="macos"] .card-title { + color: #f5f5f7 !important; + } + + html[data-theme="macos"] .label { + color: #98989d !important; + } + + html[data-theme="macos"] button, + html[data-theme="macos"] .header-actions button { + background: #323236 !important; + border-color: rgba(255, 255, 255, 0.12) !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"] button:hover:not(:disabled), + html[data-theme="macos"] .header-actions button:hover:not(:disabled) { + background: #3e3e42 !important; + color: #ffffff !important; + } + + html[data-theme="macos"] #authSubmit, + html[data-theme="macos"] #saveCustomization, + html[data-theme="macos"] .btn-primary { + background: #0a84ff !important; + border-color: #0077ed !important; + color: #ffffff !important; + box-shadow: 0 2px 8px rgba(10, 132, 255, 0.4) !important; + } + + html[data-theme="macos"] #authSubmit:hover, + html[data-theme="macos"] #saveCustomization:hover, + html[data-theme="macos"] .btn-primary:hover { + background: #208fff !important; + } + + html[data-theme="macos"] #btnStop, + html[data-theme="macos"] button.danger, + html[data-theme="macos"] .btn-danger { + background: #ff453a !important; + border-color: #e03228 !important; + color: #ffffff !important; + } + + html[data-theme="macos"] input[type="text"], + html[data-theme="macos"] input[type="password"], + html[data-theme="macos"] input[type="number"], + html[data-theme="macos"] select, + html[data-theme="macos"] textarea { + background: #1c1c1e !important; + border-color: #38383a !important; + color: #ffffff !important; + } + + html[data-theme="macos"] input:focus, + html[data-theme="macos"] select:focus, + html[data-theme="macos"] textarea:focus { + border-color: #0a84ff !important; + box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.3) !important; + } + + html[data-theme="macos"] table { + background: #252528 !important; + border-color: #38383a !important; + } + + html[data-theme="macos"] th { + background: #2c2c2e !important; + color: #98989d !important; + border-bottom-color: #38383a !important; + } + + html[data-theme="macos"] td { + border-bottom-color: #323236 !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"] tr:hover td { + background: rgba(10, 132, 255, 0.15) !important; + } + + html[data-theme="macos"] .modal-overlay { + background: rgba(0, 0, 0, 0.6) !important; + } + + html[data-theme="macos"] .modal-card { + background: #2c2c2e !important; + border-color: rgba(255, 255, 255, 0.12) !important; + box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important; + } + + html[data-theme="macos"] #authView .card, + html[data-theme="macos"] #setupView .card { + background: rgba(40, 40, 42, 0.88) !important; + backdrop-filter: blur(25px) !important; + -webkit-backdrop-filter: blur(25px) !important; + border: 1px solid rgba(255, 255, 255, 0.12) !important; + border-radius: 18px !important; + box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important; + } + + html[data-theme="macos"] #authView h1 { + color: #f5f5f7 !important; + } + + html[data-theme="macos"] #authView .muted { + color: #98989d !important; + } + + html[data-theme="macos"] #authView .label { + color: #98989d !important; + } + + html[data-theme="macos"] #authView input[type="text"], + html[data-theme="macos"] #authView input[type="password"] { + background: #1c1c1e !important; + border: 1px solid rgba(255, 255, 255, 0.15) !important; + border-radius: 8px !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"] #toggleAuthPassword { + background: #323236 !important; + border: 1px solid rgba(255, 255, 255, 0.12) !important; + color: #f5f5f7 !important; + border-radius: 8px !important; + } + + html[data-theme="macos"] #authSubmit { + background: #0a84ff !important; + color: #ffffff !important; + border: none !important; + border-radius: 10px !important; + box-shadow: 0 2px 10px rgba(10, 132, 255, 0.4) !important; + } + + html[data-theme="macos"] #authSubmit:hover { + background: #1a8eff !important; + } + + html[data-theme="macos"] #authPasskeyDivider span { + color: #98989d !important; + } + + html[data-theme="macos"] #authPasskeyDivider div { + background: rgba(255, 255, 255, 0.12) !important; + } + + html[data-theme="macos"] #btnAuthPasskey { + background: rgba(255, 255, 255, 0.08) !important; + border: 1px solid rgba(255, 255, 255, 0.15) !important; + border-radius: 10px !important; + color: #0a84ff !important; + } + + html[data-theme="macos"] #btnAuthPasskey:hover { + background: rgba(10, 132, 255, 0.2) !important; + border-color: #0a84ff !important; + } + + html[data-theme="macos"] #authPasskeyInfo { + color: #98989d !important; + } + + html[data-theme="macos"] .settings-nav-btn { + background: #323236 !important; + border-color: rgba(255, 255, 255, 0.1) !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"] .settings-nav-btn.active { + background: #0a84ff !important; + border-color: #0a84ff !important; + color: #ffffff !important; + } + + html[data-theme="macos"] .notice { + background: rgba(10, 132, 255, 0.12) !important; + border-color: rgba(10, 132, 255, 0.3) !important; + color: #70b4ff !important; + } + + html[data-theme="macos"] #updated, + html[data-theme="macos"] #topoUpdated, + html[data-theme="macos"] #statsChartUpdated, + html[data-theme="macos"] #statsTrafficUpdated, + html[data-theme="macos"] #statsHistoryUpdated, + html[data-theme="macos"] #captureUpdated, + html[data-theme="macos"] #logsUpdated, + html[data-theme="macos"] #blockedUpdated, + html[data-theme="macos"] .pill-updated, + html[data-theme="macos"] .pill-green { + background: rgba(50, 215, 75, 0.15) !important; + color: #32d74b !important; + border-color: rgba(50, 215, 75, 0.35) !important; + } + + html[data-theme="macos"] .lang-card { + background: #28282a !important; + border-color: #38383a !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"] .lang-card.active { + border-color: #0a84ff !important; + box-shadow: 0 4px 14px rgba(10, 132, 255, 0.3) !important; + } + + html[data-theme="macos"] .topo-map-card, + html[data-theme="macos"] .topo-client-body { + background: #28282a !important; + color: #f5f5f7 !important; + border-color: #38383a !important; + } + + html[data-theme="macos"] ::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.25); + } + + html[data-theme="macos"] ::-webkit-scrollbar-thumb:hover { + background: rgba(255, 255, 255, 0.4); + } + } + + html[data-theme="macos"][data-macos-mode="dark"] body { + background: #1c1c1e linear-gradient(180deg, #252830 0%, #1c1c1e 400px) fixed no-repeat !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] header { + background: rgba(36, 36, 38, 0.85) !important; + border: 1px solid rgba(255, 255, 255, 0.12) !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] header h1 { + color: #f5f5f7 !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] header .sub { + color: #98989d !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] nav { + background: rgba(44, 44, 46, 0.75) !important; + border-color: rgba(255, 255, 255, 0.1) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] nav button, + html[data-theme="macos"][data-macos-mode="dark"] nav button.secondary { + color: #98989d !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] nav button:hover:not(.active), + html[data-theme="macos"][data-macos-mode="dark"] nav button.secondary:hover:not(.active) { + background: rgba(255, 255, 255, 0.08) !important; + color: #ffffff !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] nav button.active { + background: #636366 !important; + color: #ffffff !important; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] .card { + background: #28282a !important; + border-color: rgba(255, 255, 255, 0.1) !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2) !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] h2, + html[data-theme="macos"][data-macos-mode="dark"] h3, + html[data-theme="macos"][data-macos-mode="dark"] .card-title { + color: #f5f5f7 !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] .label { + color: #98989d !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] button, + html[data-theme="macos"][data-macos-mode="dark"] .header-actions button { + background: #323236 !important; + border-color: rgba(255, 255, 255, 0.12) !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] button:hover:not(:disabled), + html[data-theme="macos"][data-macos-mode="dark"] .header-actions button:hover:not(:disabled) { + background: #3e3e42 !important; + color: #ffffff !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #authSubmit, + html[data-theme="macos"][data-macos-mode="dark"] #saveCustomization, + html[data-theme="macos"][data-macos-mode="dark"] .btn-primary { + background: #0a84ff !important; + border-color: #0077ed !important; + color: #ffffff !important; + box-shadow: 0 2px 8px rgba(10, 132, 255, 0.4) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #authSubmit:hover, + html[data-theme="macos"][data-macos-mode="dark"] #saveCustomization:hover, + html[data-theme="macos"][data-macos-mode="dark"] .btn-primary:hover { + background: #208fff !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #btnStop, + html[data-theme="macos"][data-macos-mode="dark"] button.danger, + html[data-theme="macos"][data-macos-mode="dark"] .btn-danger { + background: #ff453a !important; + border-color: #e03228 !important; + color: #ffffff !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] input[type="text"], + html[data-theme="macos"][data-macos-mode="dark"] input[type="password"], + html[data-theme="macos"][data-macos-mode="dark"] input[type="number"], + html[data-theme="macos"][data-macos-mode="dark"] select, + html[data-theme="macos"][data-macos-mode="dark"] textarea { + background: #1c1c1e !important; + border-color: #38383a !important; + color: #ffffff !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] input:focus, + html[data-theme="macos"][data-macos-mode="dark"] select:focus, + html[data-theme="macos"][data-macos-mode="dark"] textarea:focus { + border-color: #0a84ff !important; + box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.3) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] table { + background: #252528 !important; + border-color: #38383a !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] th { + background: #2c2c2e !important; + color: #98989d !important; + border-bottom-color: #38383a !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] td { + border-bottom-color: #323236 !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] tr:hover td { + background: rgba(10, 132, 255, 0.15) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] .modal-overlay { + background: rgba(0, 0, 0, 0.6) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] .modal-card { + background: #2c2c2e !important; + border-color: rgba(255, 255, 255, 0.12) !important; + box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #authView .card, + html[data-theme="macos"][data-macos-mode="dark"] #setupView .card { + background: rgba(40, 40, 42, 0.88) !important; + backdrop-filter: blur(25px) !important; + -webkit-backdrop-filter: blur(25px) !important; + border: 1px solid rgba(255, 255, 255, 0.12) !important; + border-radius: 18px !important; + box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #authView h1 { + color: #f5f5f7 !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #authView .muted { + color: #98989d !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #authView .label { + color: #98989d !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #authView input[type="text"], + html[data-theme="macos"][data-macos-mode="dark"] #authView input[type="password"], + html[data-theme="macos"][data-macos-mode="dark"] #authThemeSelect { + background: #1c1c1e !important; + border: 1px solid rgba(255, 255, 255, 0.15) !important; + border-radius: 8px !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #toggleAuthPassword { + background: #323236 !important; + border: 1px solid rgba(255, 255, 255, 0.12) !important; + color: #f5f5f7 !important; + border-radius: 8px !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #authSubmit { + background: #0a84ff !important; + color: #ffffff !important; + border: none !important; + border-radius: 10px !important; + box-shadow: 0 2px 10px rgba(10, 132, 255, 0.4) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #authSubmit:hover { + background: #1a8eff !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #authPasskeyDivider span { + color: #98989d !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #authPasskeyDivider div { + background: rgba(255, 255, 255, 0.12) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #btnAuthPasskey { + background: rgba(255, 255, 255, 0.08) !important; + border: 1px solid rgba(255, 255, 255, 0.15) !important; + border-radius: 10px !important; + color: #0a84ff !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #btnAuthPasskey:hover { + background: rgba(10, 132, 255, 0.2) !important; + border-color: #0a84ff !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #authPasskeyInfo { + color: #98989d !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] .settings-nav-btn { + background: #323236 !important; + border-color: rgba(255, 255, 255, 0.1) !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] .settings-nav-btn.active { + background: #0a84ff !important; + border-color: #0a84ff !important; + color: #ffffff !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] .notice { + background: rgba(10, 132, 255, 0.12) !important; + border-color: rgba(10, 132, 255, 0.3) !important; + color: #70b4ff !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] #updated, + html[data-theme="macos"][data-macos-mode="dark"] #topoUpdated, + html[data-theme="macos"][data-macos-mode="dark"] #statsChartUpdated, + html[data-theme="macos"][data-macos-mode="dark"] #statsTrafficUpdated, + html[data-theme="macos"][data-macos-mode="dark"] #statsHistoryUpdated, + html[data-theme="macos"][data-macos-mode="dark"] #captureUpdated, + html[data-theme="macos"][data-macos-mode="dark"] #logsUpdated, + html[data-theme="macos"][data-macos-mode="dark"] #blockedUpdated, + html[data-theme="macos"][data-macos-mode="dark"] .pill-updated, + html[data-theme="macos"][data-macos-mode="dark"] .pill-green { + background: rgba(50, 215, 75, 0.15) !important; + color: #32d74b !important; + border-color: rgba(50, 215, 75, 0.35) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] .lang-card { + background: #28282a !important; + border-color: #38383a !important; + color: #f5f5f7 !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] .lang-card.active { + border-color: #0a84ff !important; + box-shadow: 0 4px 14px rgba(10, 132, 255, 0.3) !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] .topo-map-card, + html[data-theme="macos"][data-macos-mode="dark"] .topo-client-body { + background: #28282a !important; + color: #f5f5f7 !important; + border-color: #38383a !important; + } + + html[data-theme="macos"][data-macos-mode="dark"] ::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.25); + } + + html[data-theme="macos"][data-macos-mode="dark"] ::-webkit-scrollbar-thumb:hover { + background: rgba(255, 255, 255, 0.4); + } + + /* ============================================================ + Thème Hacker (Terminal Matrix & Kali Console) + ============================================================ */ + html[data-theme="hacker"] body { + background: #000000 linear-gradient(rgba(0, 255, 65, 0.03) 50%, rgba(0, 0, 0, 0.25) 50%) fixed !important; + background-size: 100% 4px !important; + font-family: 'Fira Code', 'JetBrains Mono', 'Courier New', Consolas, monospace !important; + color: #00ff41 !important; + text-shadow: 0 0 2px rgba(0, 255, 65, 0.4) !important; + } + + html[data-theme="hacker"] header { + background: #020802 !important; + border: 1px solid #00ff41 !important; + border-radius: 0 !important; + box-shadow: 0 0 15px rgba(0, 255, 65, 0.3), inset 0 0 10px rgba(0, 255, 65, 0.1) !important; + } + + html[data-theme="hacker"] header h1 { + color: #00ff41 !important; + text-shadow: 0 0 10px rgba(0, 255, 65, 0.8) !important; + font-weight: 700 !important; + letter-spacing: 1px !important; + } + + html[data-theme="hacker"] header h1::before { + content: "root@ap:~# "; + color: #00aa2b; + font-size: 16px; + margin-right: 6px; + } + + html[data-theme="hacker"] header .sub { + color: #00aa2b !important; + } + + html[data-theme="hacker"] nav { + border-bottom: 1px solid #00ff41 !important; + padding-bottom: 12px !important; + } + + html[data-theme="hacker"] nav button, + html[data-theme="hacker"] nav button.secondary { + background: #020802 !important; + border: 1px solid rgba(0, 255, 65, 0.4) !important; + color: #00aa2b !important; + border-radius: 0 !important; + font-family: inherit !important; + text-transform: uppercase !important; + letter-spacing: 1px !important; + font-size: 12px !important; + } + + html[data-theme="hacker"] nav button:hover:not(.active), + html[data-theme="hacker"] nav button.secondary:hover:not(.active) { + background: rgba(0, 255, 65, 0.15) !important; + border-color: #00ff41 !important; + color: #00ff41 !important; + box-shadow: 0 0 10px rgba(0, 255, 65, 0.4) !important; + } + + html[data-theme="hacker"] nav button.active { + background: #00ff41 !important; + color: #000000 !important; + border: 1px solid #00ff41 !important; + border-radius: 0 !important; + font-weight: 700 !important; + box-shadow: 0 0 15px rgba(0, 255, 65, 0.6) !important; + text-shadow: none !important; + } + + html[data-theme="hacker"] .card { + background: #030a03 !important; + border: 1px solid #00ff41 !important; + border-radius: 0 !important; + box-shadow: 0 0 12px rgba(0, 255, 65, 0.2), inset 0 0 8px rgba(0, 255, 65, 0.05) !important; + color: #00ff41 !important; + } + + html[data-theme="hacker"] h2, + html[data-theme="hacker"] h3, + html[data-theme="hacker"] .card-title { + color: #00ff41 !important; + text-shadow: 0 0 8px rgba(0, 255, 65, 0.6) !important; + font-family: inherit !important; + text-transform: uppercase !important; + letter-spacing: 1px !important; + } + + html[data-theme="hacker"] h2::before, + html[data-theme="hacker"] h3::before, + html[data-theme="hacker"] .card-title::before { + content: "> "; + color: #00ff41; + } + + html[data-theme="hacker"] .label { + color: #00aa2b !important; + font-family: inherit !important; + text-transform: uppercase !important; + letter-spacing: 1px !important; + } + + html[data-theme="hacker"] button, + html[data-theme="hacker"] .header-actions button { + background: #020802 !important; + border: 1px solid #00ff41 !important; + color: #00ff41 !important; + border-radius: 0 !important; + font-family: inherit !important; + font-weight: 700 !important; + text-transform: uppercase !important; + letter-spacing: 1px !important; + box-shadow: 0 0 8px rgba(0, 255, 65, 0.2) !important; + transition: all .15s ease !important; + } + + html[data-theme="hacker"] button:hover:not(:disabled), + html[data-theme="hacker"] .header-actions button:hover:not(:disabled) { + background: #00ff41 !important; + color: #000000 !important; + box-shadow: 0 0 18px rgba(0, 255, 65, 0.7) !important; + text-shadow: none !important; + } + + html[data-theme="hacker"] #authSubmit, + html[data-theme="hacker"] #saveCustomization, + html[data-theme="hacker"] .btn-primary { + background: #00ff41 !important; + border: 1px solid #00ff41 !important; + color: #000000 !important; + font-weight: 700 !important; + box-shadow: 0 0 16px rgba(0, 255, 65, 0.6) !important; + text-shadow: none !important; + } + + html[data-theme="hacker"] #authSubmit:hover, + html[data-theme="hacker"] #saveCustomization:hover, + html[data-theme="hacker"] .btn-primary:hover { + background: #33ff66 !important; + box-shadow: 0 0 24px rgba(0, 255, 65, 0.9) !important; + } + + html[data-theme="hacker"] #btnStop, + html[data-theme="hacker"] button.danger, + html[data-theme="hacker"] .btn-danger { + background: #1a0000 !important; + border: 1px solid #ff1133 !important; + color: #ff1133 !important; + text-shadow: 0 0 6px rgba(255, 17, 51, 0.6) !important; + box-shadow: 0 0 10px rgba(255, 17, 51, 0.3) !important; + } + + html[data-theme="hacker"] #btnStop:hover, + html[data-theme="hacker"] button.danger:hover, + html[data-theme="hacker"] .btn-danger:hover { + background: #ff1133 !important; + color: #000000 !important; + box-shadow: 0 0 20px rgba(255, 17, 51, 0.8) !important; + text-shadow: none !important; + } + + html[data-theme="hacker"] input[type="text"], + html[data-theme="hacker"] input[type="password"], + html[data-theme="hacker"] input[type="number"], + html[data-theme="hacker"] select, + html[data-theme="hacker"] textarea { + background: #020602 !important; + border: 1px solid #00aa2b !important; + color: #00ff41 !important; + border-radius: 0 !important; + font-family: inherit !important; + } + + html[data-theme="hacker"] input:focus, + html[data-theme="hacker"] select:focus, + html[data-theme="hacker"] textarea:focus { + outline: none !important; + border-color: #00ff41 !important; + box-shadow: 0 0 10px rgba(0, 255, 65, 0.5) !important; + } + + html[data-theme="hacker"] table { + background: #020602 !important; + border: 1px solid #00ff41 !important; + font-family: inherit !important; + } + + html[data-theme="hacker"] th { + background: #051405 !important; + color: #00ff41 !important; + border-bottom: 2px solid #00ff41 !important; + text-transform: uppercase !important; + letter-spacing: 1px !important; + } + + html[data-theme="hacker"] td { + border-bottom: 1px solid rgba(0, 255, 65, 0.2) !important; + color: #00ff41 !important; + } + + html[data-theme="hacker"] tr:hover td { + background: rgba(0, 255, 65, 0.12) !important; + } + + html[data-theme="hacker"] .modal-overlay { + background: rgba(0, 0, 0, 0.85) !important; + } + + html[data-theme="hacker"] .modal-card { + background: #030803 !important; + border: 2px solid #00ff41 !important; + border-radius: 0 !important; + box-shadow: 0 0 30px rgba(0, 255, 65, 0.4) !important; + } + + html[data-theme="hacker"] #authView .card, + html[data-theme="hacker"] #setupView .card { + background: #030803 !important; + border: 2px solid #00ff41 !important; + border-radius: 0 !important; + box-shadow: 0 0 25px rgba(0, 255, 65, 0.35) !important; + font-family: 'Fira Code', 'Courier New', monospace !important; + } + + html[data-theme="hacker"] #authView h1 { + color: #00ff41 !important; + font-family: inherit !important; + text-shadow: 0 0 8px rgba(0, 255, 65, 0.7) !important; + letter-spacing: 1px !important; + } + + html[data-theme="hacker"] #authView h1::before { + content: "root@auth:~# "; + color: #00aa2b; + font-size: 0.8em; + } + + html[data-theme="hacker"] #authView .muted { + color: #00aa2b !important; + font-family: inherit !important; + } + + html[data-theme="hacker"] #authView .label { + color: #00ff41 !important; + font-family: inherit !important; + text-transform: uppercase !important; + letter-spacing: 1px !important; + font-size: 11px !important; + } + + html[data-theme="hacker"] #authView input[type="text"], + html[data-theme="hacker"] #authView input[type="password"], + html[data-theme="hacker"] #authThemeSelect { + background: #010401 !important; + border: 1px solid #00aa2b !important; + color: #00ff41 !important; + border-radius: 0 !important; + font-family: inherit !important; + box-shadow: inset 0 0 8px rgba(0, 255, 65, 0.15) !important; + } + + html[data-theme="hacker"] #authView input[type="text"]:focus, + html[data-theme="hacker"] #authView input[type="password"]:focus, + html[data-theme="hacker"] #authThemeSelect:focus { + border-color: #00ff41 !important; + box-shadow: 0 0 10px rgba(0, 255, 65, 0.4), inset 0 0 8px rgba(0, 255, 65, 0.25) !important; + } + + html[data-theme="hacker"] #toggleAuthPassword { + background: #020802 !important; + border: 1px solid #00aa2b !important; + color: #00ff41 !important; + border-radius: 0 !important; + } + + html[data-theme="hacker"] #authSubmit { + background: #00ff41 !important; + border: 1px solid #00ff41 !important; + color: #000000 !important; + border-radius: 0 !important; + font-family: inherit !important; + font-weight: 700 !important; + text-transform: uppercase !important; + letter-spacing: 1px !important; + box-shadow: 0 0 15px rgba(0, 255, 65, 0.5) !important; + } + + html[data-theme="hacker"] #authSubmit:hover { + background: #33ff66 !important; + box-shadow: 0 0 25px rgba(0, 255, 65, 0.8) !important; + } + + html[data-theme="hacker"] #authPasskeyDivider span { + color: #00aa2b !important; + font-family: inherit !important; + letter-spacing: 1px !important; + } + + html[data-theme="hacker"] #authPasskeyDivider div { + background: #00aa2b !important; + } + + html[data-theme="hacker"] #btnAuthPasskey { + background: #020602 !important; + border: 1px solid #00aa2b !important; + color: #00ff41 !important; + border-radius: 0 !important; + font-family: inherit !important; + font-weight: 700 !important; + box-shadow: 0 0 10px rgba(0, 255, 65, 0.2) !important; + } + + html[data-theme="hacker"] #btnAuthPasskey:hover { + background: rgba(0, 255, 65, 0.15) !important; + border-color: #00ff41 !important; + box-shadow: 0 0 20px rgba(0, 255, 65, 0.5) !important; + } + + html[data-theme="hacker"] #authPasskeyInfo { + color: #00aa2b !important; + font-family: inherit !important; + } + + html[data-theme="hacker"] .settings-nav-btn { + background: #020602 !important; + border: 1px solid #00aa2b !important; + color: #00aa2b !important; + border-radius: 0 !important; + font-family: inherit !important; + } + + html[data-theme="hacker"] .settings-nav-btn.active { + background: #00ff41 !important; + border-color: #00ff41 !important; + color: #000000 !important; + text-shadow: none !important; + } + + html[data-theme="hacker"] .notice { + background: rgba(0, 255, 65, 0.08) !important; + border: 1px solid #00ff41 !important; + color: #00ff41 !important; + border-radius: 0 !important; + } + + html[data-theme="hacker"] .pill, + html[data-theme="hacker"] .badge { + border: 1px solid #00ff41 !important; + border-radius: 0 !important; + background: rgba(0, 255, 65, 0.1) !important; + color: #00ff41 !important; + font-family: inherit !important; + } + + html[data-theme="hacker"] #updated, + html[data-theme="hacker"] #topoUpdated, + html[data-theme="hacker"] #statsChartUpdated, + html[data-theme="hacker"] #statsTrafficUpdated, + html[data-theme="hacker"] #statsHistoryUpdated, + html[data-theme="hacker"] #captureUpdated, + html[data-theme="hacker"] #logsUpdated, + html[data-theme="hacker"] #blockedUpdated, + html[data-theme="hacker"] .pill-updated, + html[data-theme="hacker"] .pill-green { + background: #00ff41 !important; + color: #000000 !important; + border: 1px solid #00ff41 !important; + border-radius: 0 !important; + text-shadow: none !important; + box-shadow: 0 0 10px rgba(0, 255, 65, 0.4) !important; + } + + html[data-theme="hacker"] .lang-card { + background: #020602 !important; + border: 1px solid #00aa2b !important; + border-radius: 0 !important; + color: #00ff41 !important; + } + + html[data-theme="hacker"] .lang-card.active { + border-color: #00ff41 !important; + background: rgba(0, 255, 65, 0.2) !important; + box-shadow: 0 0 15px rgba(0, 255, 65, 0.4) !important; + } + + html[data-theme="hacker"] .topo-map-card, + html[data-theme="hacker"] .topo-client-body { + background: #020602 !important; + border-color: #00ff41 !important; + border-radius: 0 !important; + color: #00ff41 !important; + } + + html[data-theme="hacker"] ::-webkit-scrollbar { + width: 8px; + height: 8px; + } + + html[data-theme="hacker"] ::-webkit-scrollbar-track { + background: #000000; + border: 1px solid #00aa2b; + } + + html[data-theme="hacker"] ::-webkit-scrollbar-thumb { + background: #00ff41; + box-shadow: 0 0 8px rgba(0, 255, 65, 0.6); + } + -

Administration de l’AP Wi‑Fi

Chargement de l’API…
- -
-
-

Connexion

-

Connectez-vous pour accéder à l’administration de l’AP Wi‑Fi.

- - - -
- - -
- - - - -
-
- -
-
-

Administration de l’AP Wi‑Fi

AP Manageur V1.9
-
- - - - -
-
- - - -
-
-

Configuration initiale

-

Aucun réseau Wi‑Fi n’est configuré. Créez votre point d’accès avec un SSID et un mot de passe.

-
Caractéristiques requises
SSID : 1 à 32 caractères.
Mot de passe WPA : 8 à 63 caractères, recommandé avec des lettres, des chiffres et des symboles.
Le réseau sera démarré automatiquement au démarrage de la machine.
- - - -
- - -
- -
- - -
- - - -
- - -
- - - - -
-
- -
-
-
État de l’AP
Chargement
—
-
Clients connectés
—
-
SSID
—
-
Uptime du SSID
—
-
-
-

Clients connectés

Dernière actualisation : —
-
APPAREILIPMACROUTAGE INTERNETSIGNALDÉBIT (TEMPS RÉEL)ACTION
- -
- -
-
- -
-
- - -
- - -
-
-
Aujourd’hui
0
0 connexion(s) au total
-
Cette semaine
0
0 connexion(s) au total
-
Ce mois-ci
0
0 connexion(s) au total
-
Cette année
0
0 connexion(s) au total
-
-
-
-

Fréquentation & Connexions

Fréquentation par heure (aujourd’hui)
-
-
- - - - -
- -
-
-
-
-
-
-

Top des clients (Consommation de données)

Appareils ayant le plus consommé aujourd’hui (Par jour)
-Dernière actualisation : — -
-
#APPAREILIPMACTÉLÉCHARGÉ (↓)UPLOADÉ (↑)TOTAL TRANSFÉRÉ
Chargement…
- -
-
-
-

Détail des connexions

Aujourd’hui
-Dernière actualisation : — -
-
PÉRIODEAPPAREILS UNIQUESCONNEXIONS TOTALESAPPAREILS IDENTIFIÉS
Chargement…
- -
-
- - - -
- -
-
- - -
- - -
-
-
Profils VPN disponibles
0
0 connecté(s)
-
Clients routés via VPN
0
Trafic acheminé par tunnel
-
Clients en WAN direct
0
Sans VPN (connexion normale)
-
Kill-Switch actifs
0
Protection anti-fuite
-
- -
-
-
-

Routage réseau Wi‑Fi par client

-
Choisissez quel profil VPN chaque équipement doit emprunter, ou laissez-le en accès direct Internet.
-
-🔒 Isolation LAN active : Tout équipement connecté à un VPN est strictement isolé du réseau local (aucun accès aux box, NAS, imprimantes ou à l'AP Manageur). Tout son trafic transite exclusivement par le tunnel VPN. -
-
-
- -
-
- -
- - - - - - - - - - - - - -
ÉQUIPEMENTADRESSES IP & MACPROFIL VPN ASSIGNÉKILL-SWITCHSTATUT EFFECTIF
-
- -
-
- - - -
- -
- - -
- - - - - - -
- - -
-

Réglages AP

-

Les changements redémarrent la connexion Wi‑Fi active.

- - - -
- - -
- - - -
- - -
- - - - -
- - -
-
- - - - - - - - - - - - - - - - -
- -
-
-

Journaux de connexion

-
DATEÉVÉNEMENTAPPAREILIPMAC
- -
-
- -
-
-

Appareils bloqués

-

Ces appareils sont enregistrés dans la liste de blocage et peuvent être autorisés à nouveau.

-
APPAREILADRESSE MACBLOQUÉ LEACTION
- -
-
- - - - - - - - - - -
- - - - + + +
+
+

Connexion

+

Connectez-vous pour accéder à l’administration de l’AP Wi‑Fi.

+ + + +
+ + +
+ + + +
+
+
+ OU SANS MOT DE PASSE +
+
+ +
Touch ID, Face ID, Windows Hello ou clé physique sans mot de passe ni 2FA
+ +
+
+ +
+
+
+

Administration de l’AP Wi‑Fi

+
AP Manageur V5.5 +
+
+
+ + + + + +
+
+ + + +
+
+
+
État de l’AP
+
Chargement
+
—
+
+
+
Clients connectés
+
—
+
+
+
SSID
+
—
+
+
+
Uptime du SSID
+
—
+
+
+
+
+
+

Clients connectés

Dernière actualisation : — +
+
+ + + + + + + + + + + + + +
APPAREILIPMACROUTAGE INTERNETSIGNALDÉBIT (TEMPS RÉEL)ACTION
+
+ +
+ +
+
+ +
+
+ + +
+ + +
+
+
+
Aujourd’hui
+
0
+
0 connexion(s) au total
+
+
+
Cette semaine
+
0
+
0 connexion(s) au total
+
+
+
Ce mois-ci
+
0
+
0 connexion(s) au total
+
+
+
Cette année
+
0
+
0 connexion(s) au total
+
+
+
+
+
+

Fréquentation & Connexions

+
+ Fréquentation par heure (aujourd’hui)
+
+
+
+ + + + +
+ Dernière + actualisation : — +
+
+
+ +
+
+
+
+
+

Top des clients (Consommation de données) +

+
+ Appareils ayant le plus consommé aujourd’hui (Par jour)
+
+ Dernière + actualisation : — +
+
+ + + + + + + + + + + + + + + + + +
#APPAREILIPMACTÉLÉCHARGÉ (↓)UPLOADÉ (↑)TOTAL TRANSFÉRÉ
Chargement…
+
+ +
+
+
+
+

Détail des connexions

Aujourd’hui +
+ Dernière + actualisation : — +
+
+ + + + + + + + + + + + + + +
PÉRIODEAPPAREILS UNIQUESCONNEXIONS TOTALESAPPAREILS IDENTIFIÉS
Chargement…
+
+ +
+
+ + + +
+ + +
+
+
+
Total appareils enregistrés
+
0
+
Mémorisés en + base SQLite
+
+
+
Actuellement connectés
+
0
+
En ligne sur le + Wi‑Fi
+
+
+
Appareils hors ligne
+
0
+
Non connectés + actuellement
+
+
+
Appareils bloqués
+
0
+
Accès Wi‑Fi interdit +
+
+
+ +
+
+
+

Historique de tous les appareils

+
Consultez l'ensemble des équipements + s’étant déjà connectés au point d'accès Wi‑Fi (récupérés depuis la base de données).
+
+
+ Dernière actualisation : — +
+
+ + +
+
+ 🔍 + +
+
+ + + + +
+
+ +
+ + + + + + + + + + + + + + + + +
APPAREILADRESSE MACDERNIÈRE IPSTATUT ACTUELQUOTA & DÉBITDERNIÈRE ACTIVITÉPREMIÈRE CONNEXIONACTIONS
+
+ +
+
+ +
+
+ + +
+ + +
+
+
+
Profils VPN disponibles
+
0
+
0 connecté(s)
+
+
+
Clients routés via VPN
+
0
+
Trafic + acheminé par tunnel
+
+
+
Clients en WAN direct
+
0
+
Sans VPN (connexion normale)
+
+
+
Kill-Switch actifs
+
0
+
Protection anti-fuite
+
+
+ +
+
+
+

Routage réseau Wi‑Fi par client

+
Choisissez quel profil VPN chaque + équipement doit emprunter, ou laissez-le en accès direct Internet.
+
+ 🔒 Isolation LAN active : + Tout équipement connecté à un VPN est strictement isolé du réseau local (aucun accès aux box, NAS, + imprimantes ou à l'AP Manageur). Tout son trafic transite exclusivement par le tunnel VPN. +
+
+
+ + +
+
+ 🔍 + +
+
+ + + + +
+
+ +
+ + + + + + + + + + + + + +
ÉQUIPEMENTADRESSES IP & MACPROFIL VPN ASSIGNÉKILL-SWITCHSTATUT EFFECTIF
+
+ + +
+
+ + + +
+ +
+ + +
+ + + + + + + +
+ + +
+

Réglages AP

+

Les changements redémarrent la connexion Wi‑Fi active.

+ + + +
+ + +
+ + + +
+ + +
+ + + + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+

Journaux de connexion

+
+
+
+
+ + + + + + + + + + + +
DATEÉVÉNEMENTAPPAREILIPMAC
+
+ +
+
+ +
+
+
+
+

Appareils bloqués

+
+
+

Ces appareils sont enregistrés dans la liste de blocage et peuvent + être autorisés à nouveau.

+
+ + + + + + + + + + +
APPAREILADRESSE MACBLOQUÉ LEACTION
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + diff --git a/lang/en-gb.js b/lang/en-gb.js new file mode 100644 index 0000000..390a16d --- /dev/null +++ b/lang/en-gb.js @@ -0,0 +1,1158 @@ +// AP Manageur - English (United Kingdom) Dictionary +window.I18N = window.I18N || {}; +window.I18N['en-gb'] = { + "adv_lan_isolation": "🔒 Active LAN Isolation: Devices connected to a VPN are strictly isolated from the local network.", + "adv_lan_isolation_body": "All devices connected to a VPN are strictly isolated from the local network.", + "adv_lan_isolation_full": "LAN Isolation Active: All devices connected to a VPN are strictly isolated from the local network (no access to routers, NAS, printers, or AP Manageur). All their traffic routes exclusively through the VPN tunnel.", + "adv_lan_isolation_title": "LAN Isolation Active:", + "adv_pcap_active": "Active", + "adv_pcap_autoscroll": "Live autoscroll", + "adv_pcap_buffer_size": "All packets retained", + "adv_pcap_captured_label": "Captured Packets", + "adv_pcap_clear": "🗑️ Clear", + "adv_pcap_count_suffix": "packet(s)", + "adv_pcap_desc": "Real-time network traffic capture and packet inspection on the Wi-Fi interface", + "adv_pcap_domains_desc": "Unique domain names", + "adv_pcap_domains_detected": "Detected Domains", + "adv_pcap_domains_unique": "Unique domain names", + "adv_pcap_empty": "No packets captured. Click 'Start' to launch Wireshark analysis.", + "adv_pcap_export_csv": "📄 Export CSV", + "adv_pcap_export_pcap": "📥 Export PCAP", + "adv_pcap_export_size": "PCAP export size", + "adv_pcap_filter_all": "All", + "adv_pcap_filter_domains": "🌐 Domains only", + "adv_pcap_format_desc": "Libpcap 2.4 format (Wireshark)", + "adv_pcap_hint": "💡 Click on a packet to inspect decoded header and Wireshark-style hex/ASCII dump.", + "adv_pcap_iface_info": "Wi-Fi Interface:", + "adv_pcap_inactive": "Inactive", + "adv_pcap_packets_captured": "Captured packets", + "adv_pcap_proto_label": "Detected Protocols", + "adv_pcap_protocols": "Detected protocols", + "adv_pcap_quick_filters": "Quick filters:", + "adv_pcap_search_ph": "Filter packets or domain (e.g. google.com, dns, icmp, 10.42.0.1...)", + "adv_pcap_start": "▶ Start", + "adv_pcap_state_label": "Wireshark Analyser State", + "adv_pcap_state_title": "Wireshark Analyzer Status", + "adv_pcap_stop": "■ Stop", + "adv_pcap_stop_btn": "■ Stop", + "adv_pcap_title": "Wi-Fi Network Analyser (Wireshark)", + "adv_routing_desc": "Choose which VPN profile each device should route through, or leave on direct Internet.", + "adv_routing_title": "Wi-Fi Network Routing by Client", + "adv_subtab_pcap": "Packet Capture (PCAP)", + "adv_subtab_vpn": "Per-Client VPN Routing", + "alert_copied": "Copied to clipboard!", + "api_unavailable": "API unavailable", + "app_main_heading": "Wi-Fi AP Administration", + "app_title_sub": "Wi-Fi AP administration", + "app_title_text": "Wi-Fi AP Administration", + "auth_confirm_password": "Confirm password", + "auth_current_password": "Current password", + "auth_intro": "Sign in to access the Wi-Fi AP administration.", + "auth_intro_prefix": "Sign in to access", + "auth_intro_title": "Wi-Fi AP administration", + "auth_new_password": "New password", + "auth_otp": "Two-factor authentication code (TOTP or backup)", + "auth_passkey_btn": "Sign in with a Passkey", + "auth_passkey_desc": "Touch ID, Face ID, Windows Hello or security key without password or 2FA", + "auth_passkey_or": "OR WITHOUT PASSWORD", + "auth_password": "Password", + "auth_remember": "Remember me", + "auth_submit": "Sign In", + "auth_title": "Sign In", + "auth_username": "Username", + "auth_setup_title": "Create Administrator Account", + "auth_setup_intro": "Set up the account that will protect the dashboard.", + "auth_setup_submit": "Create Account", + "auth_otp_placeholder": "6-digit code or backup code (e.g. ABCDE-12345)", + "auth_processing": "Processing…", + "auth_account_created": "Account created. Signing in…", + "passkey_auth_success": "Passkey authentication successful!", + "passkey_login_rejected": "Passkey authentication rejected", + "passkey_error_prefix": "Passkey error: ", + "badge_limited": "Limited", + "block": "Block", + "blocked_desc": "These devices are currently restricted from Wi-Fi access and can be unblocked anytime.", + "blocked_title": "Blocked Devices", + "btn_add": "Add", + "btn_add_category": "➕ Add a Category", + "btn_apply": "Apply", + "btn_cancel": "Cancel", + "btn_clear": "Clear", + "btn_close": "Close", + "btn_confirm": "Confirm", + "btn_connect": "Connect", + "btn_copy": "Copy", + "btn_delete": "Delete", + "btn_disconnect": "Disconnect", + "btn_download": "Download", + "btn_edit": "Edit", + "btn_export": "Export", + "btn_hide_pwd": "Hide Password", + "btn_import": "Import", + "btn_logout": "Sign out", + "btn_next": "Next →", + "btn_paste_svg": "📋 Paste SVG", + "btn_prev": "← Previous", + "btn_refresh": "Refresh", + "btn_rename": "Rename", + "btn_reset": "Reset", + "btn_reset_defaults": "↺ Reset to Default", + "btn_restart": "Restart", + "btn_save": "Save", + "btn_search": "Search", + "btn_show_pwd": "Show Password", + "btn_start": "Start", + "btn_stop": "Stop", + "chart_current_slot": "Current slot:", + "chart_sub_day": "Traffic by hour (today)", + "chart_sub_month": "Connected devices per month (last 12 months)", + "chart_sub_week": "Connected devices per week (last 12 weeks)", + "chart_sub_year": "Connected devices per year", + "clients_blocked_desc": "Wi-Fi access blocked", + "clients_mac_filtering_desc": "Hardware filtering by MAC address", + "clients_offline_desc": "Currently disconnected", + "clients_online_wifi_desc": "Online on Wi-Fi", + "clients_saved_sqlite_desc": "Stored in SQLite database", + "clients_vpn_tunneled_desc": "Traffic routed through tunnel", + "confirm_clear_logs": "Are you sure you want to clear all connection logs?", + "confirm_delete_all_data": "⚠️ WARNING: Do you really want to delete all application data?", + "confirm_delete_device": "Are you sure you want to delete device \"{name}\" ({mac}) from the database?", + "confirm_delete_passkey": "Are you sure you want to delete Passkey \"{name}\"?", + "confirm_reboot_ap": "Do you want to restart the Wi-Fi access point?", + "confirm_reset_device_types": "Do you want to reset all device categories to defaults?", + "confirm_reset_quota": "Do you want to reset the data counter for device \"{name}\" to zero?", + "connected_count_suffix": "connected", + "connected_live": "Connected live", + "custom_add_category": "➕ Add a Category", + "custom_app_name": "Full Application Name", + "custom_db_notice": "Saved in database: name, language, and theme apply across all your devices.", + "custom_dev_types_desc": "Manage device categories (name, logo/emoji, identifier) and customise their display.", + "custom_dev_types_title": "🏷️ Device Types & Categories", + "custom_device_types_desc": "Manage device categories (name, logo/emoji, identifier) and customise their display.", + "custom_device_types_title": "🏷️ Device Types & Categories", + "custom_lang": "Interface Language", + "custom_reset_defaults": "↺ Reset to Defaults", + "custom_save_btn": "Save Customisation", + "custom_short_name": "Short Name (browser tab)", + "custom_subtitle": "Customise service title, language, and visual appearance.", + "custom_theme": "Theme", + "custom_theme_auto": "Automatic (system preference)", + "custom_theme_dark": "Dark", + "custom_theme_light": "Light", + "custom_theme_winxp": "Windows XP (Luna)", + "custom_theme_futuristic": "Futuristic (Cyber / Neon)", + "custom_theme_macos": "macOS (Adaptive Light / Dark)", + "custom_theme_hacker": "Hacker (Terminal Matrix)", + "custom_title": "Customisation", + "danger_backup_desc": "Export the full system configuration (Wi-Fi settings, WireGuard & OpenVPN profiles, device routings, device names and logos, blocklist, and SQLite database) to a secure file, or restore a previous configuration in one click.", + "danger_backup_title": "📦 Global Backup & Restore", + "danger_clear_btn": "Delete All Data", + "danger_clear_desc": "Deletes connection log history, blocked devices list, and saved network settings.", + "danger_clear_title": "⚠️ Irreversible Deletion", + "danger_delete_all_btn": "Delete All Data", + "danger_delete_desc": "Deletes log history, blocked devices, and saved network configuration.", + "danger_delete_title": "⚠️ Irreversible Deletion", + "danger_desc": "Backup management, configuration restore, and critical maintenance actions.", + "danger_export_btn": "📥 Export Configuration & Database", + "danger_import_btn": "📤 Import Backup…", + "danger_subtitle": "Backup management, configuration restore, and critical system maintenance actions.", + "danger_title": "Danger Zone & Maintenance", + "dash_card_clients": "Connected Clients", + "dash_card_ssid": "SSID", + "dash_card_status": "AP Status", + "dash_card_uptime": "SSID Uptime", + "dash_clients_title": "Connected Clients", + "dash_connected_clients": "Connected Clients", + "dash_qr_desc": "The QR code uses the actual SSID and password of the AP.", + "dash_qr_pwd_label": "Password retrieved by API", + "dash_qr_title": "Join Network", + "dash_ssid_title": "SSID", + "dash_state_title": "AP Status", + "dash_updated": "Last updated:", + "dash_updated_initial": "Last updated: —", + "dash_uptime_title": "SSID Uptime", + "delete_history_attr": "Delete from database history", + "dev_blocked": "Blocked Devices", + "dev_blocked_count": "Blocked Devices", + "dev_blocked_sub": "Wi‑Fi access forbidden", + "dev_click_change_type": "Click to change device type", + "dev_connected": "Currently Connected", + "dev_connected_sub": "Online on Wi‑Fi", + "dev_currently_connected": "Currently Connected", + "dev_direct_sub": "Without VPN (normal connection)", + "dev_edit_type": "Edit device type", + "dev_filter_all": "All", + "dev_filter_block": "🔴 Blocked", + "dev_filter_conn": "🟢 Connected", + "dev_filter_off": "⚪ Offline", + "dev_history_desc": "View all devices that have ever connected to the Wi-Fi AP.", + "dev_history_title": "All Devices History", + "dev_ks_sub": "Leak protection", + "dev_lan_isolation_desc": "Any device connected to a VPN is strictly isolated from the local network (no access to gateway, NAS, printers or AP Manager). All its traffic travels exclusively through the VPN tunnel.", + "dev_lan_isolation_title": "Active LAN isolation:", + "dev_offline": "Offline Devices", + "dev_offline_count": "Offline Devices", + "dev_offline_sub": "Currently disconnected", + "dev_routed_sub": "Traffic routed via tunnel", + "dev_search_ph": "Filter by name, MAC address, IP...", + "dev_total": "Total Registered Devices", + "dev_total_registered": "Total Registered Devices", + "dev_total_sub": "Saved in SQLite DB", + "device_click_to_change_type": "Click to change device type", + "device_speed_label": "Speed:", + "devices_count_suffix": "device(s)", + "err_auth_required": "Authentication required", + "err_bad_login": "Incorrect username or password", + "err_delete_history": "Error while deleting device", + "err_killswitch_update": "Error updating Kill-Switch", + "err_network": "Network error or server unreachable", + "err_passwords_mismatch": "Passwords do not match", + "err_prefix": "Error: ", + "err_reset_quota": "Error while resetting allowance", + "err_save_limits": "Error while saving allowance", + "err_timeout": "Request timed out", + "err_unknown": "An unknown error occurred.", + "err_vpn_assignment": "Error during VPN assignment", + "explore_on_sites": "Explore online sites:", + "filter_all": "All", + "filter_by_domain": "Filter by this domain", + "filter_this_domain": "Filter by this domain", + "header_lang_tooltip": "Language settings", + "last_activity": "Last activity:", + "limits_dev_name_label": "Device Name", + "loader_connecting": "connecting…", + "loader_finished": "Startup complete!", + "loader_finished_badge": "Startup complete", + "loader_ip_pending": "fetching IP…", + "loader_no_vpn_needed": "No automatic VPN tunnel required", + "loader_ready": "System ready!", + "loader_ready_badge": "System ready", + "loader_refreshing": "Refreshing…", + "loader_refreshing_badge": "Refreshing", + "loader_skip": "Skip to dashboard →", + "loader_starting": "Starting up…", + "loader_starting_badge": "Starting up", + "loader_step1": "API & Session", + "loader_step1_admin": "Administrator privileges confirmed", + "loader_step1_conn": "Connecting to API and verifying access…", + "loader_step1_label": "Step 1 of 4", + "loader_step1_ok": "Administrator permissions confirmed", + "loader_step1_sub": "Connecting to server and verifying session…", + "loader_step2": "Wi-Fi Network", + "loader_step2_activating": "Activating Wi-Fi network ({s}s)…", + "loader_step2_ap_cfg": "Access point configured", + "loader_step2_ap_init": "Initial configuration", + "loader_step2_ap_up": "Access point operational (SSID: {ssid})", + "loader_step2_checking": "Checking Wi-Fi network status…", + "loader_step2_configured": "Access Point configured", + "loader_step2_ok": "Access Point operational", + "loader_step2_sub": "Checking Wi-Fi interface and AP status…", + "loader_step3": "Tests & VPN", + "loader_step3_detecting": "Detecting and verifying VPN profiles…", + "loader_step3_none": "No automatic VPN tunnel required", + "loader_step3_ok": "VPN tunnels operational ({connected}/{target}): {details}", + "loader_step3_sub": "Checking VPN profiles and tunnels…", + "loader_step3_waiting": "VPN tunnels ({connected}/{target}): {details} [{elapsed}s]", + "loader_step4": "Dashboard", + "loader_step4_done": "Startup complete!", + "loader_step4_done_badge": "Startup complete", + "loader_step4_inventory": "Scanning network devices inventory…", + "loader_step4_opening": "Opening administration dashboard", + "loader_step4_ready": "System ready!", + "loader_step4_ready_badge": "System ready", + "loader_step4_sub": "Loading dashboard and devices…", + "loader_step4_sync": "Synchronising devices, tunnels, and metrics…", + "loader_step_x_of_y": "Step {step} of 4", + "loader_title": "Wi‑Fi AP Management", + "loader_tunnels_vpn": "VPN Tunnels", + "loader_tunnels_vpn_ok": "VPN tunnels operational", + "loader_waiting": "waiting…", + "loader_waiting_api": "Waiting for API server", + "loader_wifi_activating": "Activating Wi-Fi network ({sec}s)…", + "loading": "Loading…", + "loading_categories": "Loading categories…", + "loading_passkeys": "Loading Passkeys…", + "log_activation_2fa": "🛡️ 2FA Enabled", + "log_arret": "■ AP Stopped", + "log_blocage": "⛔ Blocked", + "log_config_modified": "✓ AP Config updated", + "log_connexion": "● Wi-Fi Connected", + "log_connexion_admin": "● Admin Login", + "log_connexion_code_recuperation": "🔑 Backup Code Login", + "log_creation": "+ AP Created", + "log_creation_compte_admin": "👤 Account Created", + "log_deblocage": "✓ Unblocked", + "log_deconnexion": "○ Wi-Fi Disconnected", + "log_deconnexion_admin": "○ Admin Logout", + "log_demarrage": "▶ AP Started", + "log_desactivation_2fa": "🔓 2FA Disabled", + "log_echec_connexion": "❌ Login Failed", + "log_generation_secret_2fa": "⚙️ 2FA Secret Generated", + "log_limites_appareil_modifiees": "⚖️ Quota & Speed updated", + "log_modification_identifiants": "🔑 Credentials Updated", + "log_modification_preferences": "🎨 Preferences Updated", + "log_redemarrage": "↻ AP Restarted", + "log_regeneration_codes_secours": "🔄 New Backup Codes", + "log_reinitialisation_donnees": "⚠️ Data Reset", + "log_rejet_limite": "⚠️ Limit reached (rejected)", + "log_suppression_journaux": "🗑️ Logs Cleared", + "log_vpn_connect": "🌐 VPN Connected", + "log_vpn_disconnect": "🔌 VPN Disconnected", + "log_vpn_route": "🛡️ VPN Routing", + "logs_clear_btn": "Clear Logs", + "logs_title": "Connection Logs", + "modal_bw_chk": "Bandwidth Limiting (Speed)", + "modal_bw_desc": "💡 Regulated by Linux kernel (QoS / Traffic Control). 0 = unlimited.", + "modal_bw_down": "Max Download Speed", + "modal_bw_profiles": "Quick profiles:", + "modal_bw_up": "Max Upload Speed", + "modal_cat_add_title": "➕ Add Device Category", + "modal_cat_choose": "Choose a device category:", + "modal_cat_desc_label": "Description / Device examples", + "modal_cat_edit_title": "🏷️ Edit Device Type", + "modal_cat_explore": "Explore on websites:", + "modal_cat_filter_all": "All", + "modal_cat_filter_emoji": "😀 Emojis", + "modal_cat_filter_svg": "⚡ SVG (Iconify)", + "modal_cat_icon_label": "Logo / Icon (Emoji or SVG) *", + "modal_cat_id_help": "Lowercase letters, numbers, hyphens or underscores only.", + "modal_cat_id_label": "Unique technical identifier *", + "modal_cat_name_label": "Category name *", + "modal_cat_paste_svg": "📋 Paste SVG", + "modal_cat_quick_sugg": "Quick suggestions:", + "modal_cat_save_btn": "Save", + "modal_cat_search_btn": "Search", + "modal_cat_search_title": "🔍 Search emoji or SVG icon", + "modal_cat_table_loading": "Loading categories…", + "modal_change_dev_type_title": "🏷️ Change Device Type", + "modal_choose_category": "Choose an equipment category:", + "modal_current_usage": "Current usage:", + "modal_device_type_attr": "Change device type (Smartphone, Tablet, PC, TV...)", + "modal_device_type_click": "Click to change device type", + "modal_device_type_title": "Change device type", + "modal_import_admin": "Admin account & passkeys", + "modal_import_blocked": "Blocked devices list", + "modal_import_btn_confirm": "Confirm and restore", + "modal_import_config": "Configuration & preferences", + "modal_import_created_at": "Creation date:", + "modal_import_created_date": "Creation date: —", + "modal_import_detected": "Elements detected in archive:", + "modal_import_item_admin": "🔐 Administrator account & passkeys (⚠️ will overwrite current account)", + "modal_import_item_config": "⚙️ Configuration & preferences (Wi-Fi, network, themes, etc.)", + "modal_import_item_names": "📱 Device names & assigned types", + "modal_import_item_types": "🎨 Device categories & custom logos", + "modal_import_item_vpn": "🌐 VPN profiles & routings (WireGuard & OpenVPN)", + "modal_import_names": "Device names", + "modal_import_select": "Select data to restore:", + "modal_import_title": "Restore Backup", + "modal_import_types": "Device categories", + "modal_import_vpn": "VPN profiles & routing", + "modal_limits_title": "Data Allowance & Bandwidth Limiting", + "modal_limits_title_attr": "Set quota and limit bandwidth", + "modal_period_day": "Daily (reset at midnight)", + "modal_period_month": "Monthly (reset 1st of month)", + "modal_period_total": "Total cumulative", + "modal_period_week": "Weekly (reset Monday)", + "modal_presets": "Presets:", + "modal_quota_action_desc": "Action on limit: Device will be blocked from browsing Internet (WAN traffic blocked automatically).", + "modal_quota_chk": "Internet Data Allowance", + "modal_quota_exceeded": "Allowance exceeded", + "modal_quota_exhausted": "Quota exhausted (0 B remaining)", + "modal_quota_max": "Max Allowed Allowance", + "modal_quota_period": "Calculation Period", + "modal_quota_preset_1": "1 GB", + "modal_quota_preset_10": "10 GB", + "modal_quota_preset_20": "20 GB", + "modal_quota_preset_5": "5 GB", + "modal_quota_preset_50": "50 GB", + "modal_quota_remaining": "Remaining:", + "modal_reset_counter": "🔄 Reset counter", + "modal_save_limits": "Save Limitations", + "modal_saved_ok": "✓ Limitations saved and applied successfully!", + "modal_saving": "Applying quotas and network limitations…", + "modal_search_icon_title": "🔍 Search an emoji or SVG icon", + "modal_vpn_auth_optional": "OpenVPN Credentials (optional)", + "modal_vpn_autoconnect": "Automatically connect this profile on AP startup", + "modal_vpn_config_file": "Configuration File", + "modal_vpn_copy": "📋 Copy", + "modal_vpn_download": "💾 Download", + "modal_vpn_import_btn": "📁 Import a file (.conf / .ovpn)", + "modal_vpn_openvpn_sub": "Standard .ovpn file", + "modal_vpn_save_btn": "Save Profile", + "modal_vpn_view_title": "VPN Configuration", + "modal_vpn_wireguard_sub": "Modern & fast .conf file", + "nav_advanced": "Advanced", + "nav_blocked": "Blocked Devices", + "nav_dashboard": "Dashboard", + "nav_devices": "Devices", + "nav_logs": "Logs", + "nav_settings": "Settings", + "nav_stats": "Statistics", + "net_lan": "Local Area Network (LAN)", + "net_multicast": "Broadcast / Multicast", + "net_wan": "Internet / WAN", + "no_blocked_clients": "No blocked devices", + "no_clients": "No devices connected", + "no_devices_found": "No devices matching search criteria", + "no_logs": "No logs available", + "no_packets_captured": "No packets captured. Click \"Start\" to launch Wireshark analysis.", + "no_packets_match": "No packets match filter \"{filter}\"", + "no_traffic_history": "No traffic history available", + "no_vpn_clients_match": "No devices match search criteria", + "not_assigned": "Not assigned", + "notif_check_admin_login_failed": "⚠️ Admin Login Failed", + "notif_check_device_blocked": "🛑 Device Blocked or Unblocked", + "notif_check_device_connected": "📶 Known Wi-Fi Device Reconnected", + "notif_check_device_disconnected": "📴 Wi-Fi Device Disconnected", + "notif_check_new_device": "📱 New Wi-Fi Device (First Connection)", + "notif_check_quota_exceeded": "⚖️ Device Data Quota Exceeded", + "notif_check_settings_changed": "⚙️ Wi-Fi / AP Settings Changed", + "notif_check_vpn_client_disconnected": "🌐 Client Disconnected / Removed from VPN", + "notif_check_vpn_profile_disconnected": "⚠️ VPN Profile Disconnected (Tunnel Down)", + "notif_custom_desc": "HTTP request to any API, home automation, or cloud service", + "notif_custom_enable": "Enable Webhook", + "notif_custom_headers_label": "Custom headers (optional, JSON or Key: Value)", + "notif_custom_method": "Method", + "notif_custom_method_label": "Method", + "notif_custom_test_btn": "Test Webhook", + "notif_custom_title": "Custom Webhook (HTTP)", + "notif_custom_url_dest": "Destination URL", + "notif_custom_url_label": "Destination URL", + "notif_custom_webhook_desc": "HTTP request to any API, home automation, or external server", + "notif_custom_webhook_header": "Custom Webhook (HTTP)", + "notif_discord_bot_full": "Bot Name (Optional)", + "notif_discord_bot_label": "Bot Name (Optional)", + "notif_discord_channel_desc": "Direct delivery to a channel via Webhook", + "notif_discord_desc": "Direct delivery to a channel via Webhook", + "notif_discord_enable": "Enable Discord", + "notif_discord_test_btn": "Test Discord", + "notif_discord_title": "Discord Notification", + "notif_discord_url_label": "Discord Webhook URL", + "notif_email_desc": "Direct delivery via your mail server", + "notif_email_enable": "Enable Email", + "notif_email_from": "Sender (From)", + "notif_email_from_full": "Sender (From)", + "notif_email_from_label": "Sender Name", + "notif_email_host": "SMTP Host", + "notif_email_host_label": "SMTP Host", + "notif_email_none_hint": "None (Port 25 unencrypted)", + "notif_email_pass": "SMTP Password", + "notif_email_pass_label": "SMTP Password", + "notif_email_pass_smtp": "SMTP Password", + "notif_email_port": "SMTP Port", + "notif_email_port_label": "SMTP Port", + "notif_email_sec_label": "Security", + "notif_email_sec_none": "None (Plain text)", + "notif_email_sec_ssl": "Implicit SSL/TLS", + "notif_email_sec_ssl_465": "SSL / TLS (Port 465)", + "notif_email_sec_starttls": "STARTTLS (Recommended)", + "notif_email_security": "Security", + "notif_email_starttls_hint": "STARTTLS (Recommended port 587)", + "notif_email_sub": "Direct delivery through your mail server", + "notif_email_test": "Test Email sending", + "notif_email_test_action": "Test Email Delivery", + "notif_email_test_btn": "Test Email Delivery", + "notif_email_title": "Email Notification (SMTP)", + "notif_email_to": "Recipient(s) (To)", + "notif_email_to_label": "Recipient(s) (To)", + "notif_email_user": "SMTP Username", + "notif_email_user_label": "SMTP Username", + "notif_event_admin_login": "🔒 Admin Account Login", + "notif_event_admin_login_failed": "⚠️ Admin Login Failed", + "notif_event_device_blocked": "🛑 Device Blocked or Unblocked", + "notif_event_device_connected": "📶 Known Wi-Fi Device Reconnected", + "notif_event_device_disconnected": "📴 Wi-Fi Device Disconnected", + "notif_event_new_device": "📱 New Wi-Fi Device (First Connection)", + "notif_event_quota_exceeded": "⚖️ Device Data Quota Exceeded", + "notif_event_settings_changed": "⚙️ Wi-Fi / AP Settings Changed", + "notif_event_stats_report": "📊 Statistics & Metrics Report (Cron Task)", + "notif_event_vpn_client_connected": "🛡️ Client Routed via VPN", + "notif_event_vpn_client_disconnected": "🌐 Client Disconnected / Removed from VPN", + "notif_event_vpn_profile_connected": "🛡️ VPN Profile Connected (Tunnel Active)", + "notif_event_vpn_profile_disconnected": "⚠️ VPN Profile Disconnected (Tunnel Down)", + "notif_events_desc": "Select events that will trigger sending a notification:", + "notif_events_title": "Alert Trigger Events", + "notif_evt_admin_login": "🔒 Admin account login", + "notif_evt_admin_login_failed": "⚠️ Admin login failed", + "notif_evt_device_blocked": "🛑 Device blocked or unblocked", + "notif_evt_device_connected": "📶 Reconnection of a known Wi-Fi device", + "notif_evt_device_disconnected": "📴 Wi-Fi device disconnection", + "notif_evt_new_device": "📱 New Wi-Fi device (first connection)", + "notif_evt_quota_exceeded": "⚖️ Data quota exceeded by a device", + "notif_evt_settings_changed": "⚙️ Wi-Fi / AP settings changed", + "notif_evt_stats_report": "📊 Statistics & metrics report (Cron task)", + "notif_evt_vpn_client_connected": "🛡️ Client routed via VPN", + "notif_evt_vpn_client_disconnected": "🌐 Client disconnected / removed from VPN", + "notif_evt_vpn_profile_connected": "🛡️ VPN profile connected (active tunnel)", + "notif_evt_vpn_profile_disconnected": "⚠️ VPN profile disconnected (tunnel down)", + "notif_gotify_alert_box": "⚠️ Important for Gotify 3.1.1: The token must come from the Gotify APPS tab (starting with gtfya... in v3 or A... in v2). Tokens from the CLIENTS tab (starting with gtfyc... or C...) cannot publish alerts. HTTPS with self-signed certificates is supported.", + "notif_gotify_compat_desc": "Lightweight and instant self-hosted push server (Compatible Gotify 3.1.1+)", + "notif_gotify_desc": "Lightweight and instant self-hosted push server (Compatible Gotify v2 & v3.1.1+)", + "notif_gotify_enable": "Enable Gotify", + "notif_gotify_hint": "The token must come from the Gotify APPS tab (starting with A...). CLIENTS tokens do not work for posting messages.", + "notif_gotify_important": "Important for Gotify 3.1.1:", + "notif_gotify_priority_label": "Priority (1 - 10)", + "notif_gotify_priority_range": "Priority (1 - 10)", + "notif_gotify_test_btn": "Test Gotify", + "notif_gotify_title": "Gotify Notification", + "notif_gotify_token_apps": "Application Token (APPS Token)", + "notif_gotify_token_label": "Application Token (APPS Token)", + "notif_gotify_url_label": "Gotify Server URL", + "notif_ntfy_desc": "Push notifications via ntfy.sh or self-hosted server", + "notif_ntfy_enable": "Enable ntfy", + "notif_ntfy_priority_label": "Priority (1 - 5)", + "notif_ntfy_priority_range": "Priority (1 - 5)", + "notif_ntfy_server_desc": "Push notifications via ntfy.sh or self-hosted server", + "notif_ntfy_server_label": "ntfy Server", + "notif_ntfy_test_btn": "Test ntfy", + "notif_ntfy_title": "ntfy.sh Notification", + "notif_ntfy_token_label": "Token / Password (optional for private topic)", + "notif_ntfy_token_opt": "Token / Password (optional for private topic)", + "notif_ntfy_topic_label": "Topic (Subject)", + "notif_ntfy_url_label": "Server URL", + "notif_pushbullet_desc": "Instant push on phones, tablets, and browsers", + "notif_pushbullet_device_iden": "Device ID (Device Iden, optional — leave blank for all)", + "notif_pushbullet_device_label": "Device ID (Device Iden, optional — leave blank for all)", + "notif_pushbullet_devices_desc": "Instant push on phones, tablets, and browsers", + "notif_pushbullet_enable": "Enable Pushbullet", + "notif_pushbullet_test_btn": "Test Pushbullet", + "notif_pushbullet_title": "Pushbullet Notification", + "notif_pushbullet_token_access": "Access Token (Access Token)", + "notif_pushbullet_token_label": "Access Token", + "notif_pushover_desc": "Push for Android, iOS, and Desktop", + "notif_pushover_devices_desc": "Push for Android, iOS, and Desktop", + "notif_pushover_enable": "Enable Pushover", + "notif_pushover_priority_label": "Priority (-2 to 2: 0 = Normal, 1 = High)", + "notif_pushover_test_btn": "Test Pushover", + "notif_pushover_title": "Pushover Notification", + "notif_pushover_token_label": "Application Token (API Token)", + "notif_pushover_user_label": "User Key", + "notif_save_btn": "Save notifications", + "notif_slack_bot_label": "Bot sender name (optional)", + "notif_slack_desc": "Alerts on a Slack channel via Incoming Webhook", + "notif_slack_enable": "Enable Slack", + "notif_slack_incoming_desc": "Alerts on a Slack channel via Incoming Webhook", + "notif_slack_sender_name": "Bot sender name (optional)", + "notif_slack_test_btn": "Test Slack", + "notif_slack_title": "Slack Notification", + "notif_slack_url_label": "Slack Incoming Webhook URL", + "notif_slack_webhook_url_label": "Slack Incoming Webhook URL", + "notif_telegram_chat_full": "Discussion Identifier (Chat ID)", + "notif_telegram_chat_label": "Discussion Identifier (Chat ID)", + "notif_telegram_desc": "Instant alerts via Telegram bot (channel, group, or direct)", + "notif_telegram_enable": "Enable Telegram", + "notif_telegram_test_btn": "Test Telegram", + "notif_telegram_thread_label": "Topic / Thread (Optional)", + "notif_telegram_title": "Telegram Notification", + "notif_telegram_token_father": "Bot Token (Bot Token @BotFather)", + "notif_telegram_token_label": "Bot Token (@BotFather)", + "notif_test_all": "🧪 Test all active channels", + "notif_tmpl_customize": "Customise ▾", + "notif_tmpl_main_desc": "Customise alert title and text. Click a variable to insert it into the message.", + "notif_tmpl_main_title": "Alert Messages Customisation", + "notif_tmpl_msg_label": "Message Content", + "notif_tmpl_reset_btn": "↺ Reset to Default", + "notif_tmpl_title_label": "Title / Subject", + "notif_tmpl_toggle_collapse": "Collapse All", + "notif_tmpl_toggle_expand": "Expand All", + "notif_tmpl_vars_label": "Variables:", + "notif_webhook_desc": "Universal REST / JSON Integration", + "notif_webhook_headers_label": "Custom HTTP Headers (JSON)", + "notif_webhook_test_btn": "Test Webhook", + "notif_webhook_title": "Custom Webhook (HTTP POST)", + "notif_webhook_url_label": "Webhook URL", + "packet_all_kept": "All packets retained", + "packet_btn_stop": "■ Stop", + "packet_bytes_unit": "bytes", + "packet_captured_label": "Captured Packets", + "packet_destination": "Destination:", + "packet_details_title": "Packet Details #", + "packet_domain": "Domain / Host:", + "packet_domains_label": "Detected Domains", + "packet_hexdump": "Hexadecimal & ASCII Dump (Wireshark):", + "packet_iface_info": "Wi-Fi Interface: —", + "packet_layers": "Network Layers Decoding:", + "packet_pcap_format": "Libpcap 2.4 format (Wireshark)", + "packet_pcap_size_label": "PCAP Export Size", + "packet_protocols_label": "Detected Protocols", + "packet_quick_filters": "Quick filters:", + "packet_size": "Size:", + "packet_source": "Source:", + "packet_status_analyzer": "Wireshark Analyzer Status", + "packet_time": "Time:", + "packet_unique_domains": "Unique domain names", + "packets_count_plural": "packets", + "packets_count_singular": "packet", + "page_x_of_y": "Page {p} of {total}", + "pcap_export_csv_title": "Export as CSV", + "pcap_export_pcap_title": "Download .pcap file compatible with Wireshark Desktop", + "pcap_stop_capture_title": "Stop Wireshark packet capture", + "placeholder_0_unlimited": "0 for unlimited", + "placeholder_current_pwd": "Current password", + "placeholder_dev_desc": "e.g. PlayStation, Xbox, Switch...", + "placeholder_dev_icon": "Emoji (📱, 💻...) or SVG code", + "placeholder_dev_id": "e.g. console, robot, iot...", + "placeholder_dev_label": "e.g. Gaming console, Robot vacuum...", + "placeholder_email_pass": "Password or app password", + "placeholder_filter_clients": "Filter by name, MAC address, IP, profile...", + "placeholder_filter_packets": "Filter packets or domain (e.g. google.com, dns, icmp, 10.42.0.1...)", + "placeholder_icon_search": "Search (e.g. laptop, wifi, console, camera, robot, apple...)", + "placeholder_my_wifi": "My Wi-Fi Network", + "placeholder_new_pwd": "New password", + "placeholder_pwd_confirm": "Confirm password", + "placeholder_pwd_min8": "8 characters minimum", + "placeholder_totp_code": "6-digit TOTP code or backup code", + "placeholder_trusted_proxies": "e.g. 172.18.0.0/16, 192.168.1.254, 10.0.4.1", + "placeholder_vpn_config": "Paste or import WireGuard or OpenVPN file content...", + "placeholder_vpn_name": "e.g. ProtonVPN Paris, Mullvad WG, NordVPN...", + "placeholder_vpn_pass": "Leave blank if unchanged", + "placeholder_vpn_user": "VPN Username", + "prompt_device_name": "Enter a custom name for this device:", + "protocol_label": "Protocol", + "proxy_auto_hint": "In automatic mode, the system inspects standard headers in order and uses the most reliable IP address.", + "proxy_auto_hint_full": "In automatic mode, the system inspects Cloudflare, X-Forwarded-For (first non-proxy client IP), and then X-Real-IP headers in order.", + "proxy_enable_desc": "When this option is enabled, AP Manageur extracts the real client IP address from the HTTP headers forwarded by your Reverse Proxy instead of the proxy internal IP.", + "proxy_enable_desc_full": "When this option is enabled, AP Manageur extracts the real client machine IP address from HTTP headers forwarded by your reverse proxy instead of recording the local proxy IP itself.", + "proxy_examples_desc": "To configure your reverse proxy to correctly forward client machine IPs:", + "proxy_examples_desc_full": "To ensure your reverse proxy correctly forwards client machine IPs to AP Manageur, make sure to configure these headers:", + "proxy_examples_title": "💡 Configuration Examples for your Reverse Proxy", + "proxy_label_cf_ip": "Cloudflare Header (CF-Connecting-IP):", + "proxy_label_host": "Host:", + "proxy_label_raw_socket_ip": "RAW RECEIVED IP (PROXY OR SOCKET)", + "proxy_label_real_client_ip": "RECORDED REAL CLIENT IP", + "proxy_label_xff": "X-FORWARDED-FOR HEADER", + "proxy_label_xrealip": "X-REAL-IP HEADER", + "proxy_live_diag_badge": "● Active detection", + "proxy_live_diag_title": "🔍 Live IP Detection (Your Current Connection)", + "proxy_opt_auto": "Intelligent Auto-detection (Recommended: CF > XFF > X-Real-IP)", + "proxy_opt_cf": "CF-Connecting-IP (Cloudflare Specific)", + "proxy_opt_xrealip": "X-Real-IP (Common with Nginx / Apache)", + "proxy_trusted_desc": "Allows proxy headers originating from RFC1918 private networks and Docker containers (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x).", + "proxy_trusted_desc_full": "Allows proxy headers originating from local private networks (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.1). Recommended if your reverse proxy is a Docker container or LAN gateway.", + "proxy_trusted_ips_hint": "Separate multiple IP addresses or CIDR subnets with commas or newlines.", + "proxy_trusted_ips_hint_full": "Separate multiple IP addresses or CIDR subnets with commas or newlines. If your proxy is not on a private IP, you MUST specify its public IP here to prevent IP spoofing.", + "qr_info": "The QR code uses the real SSID and password of the AP.", + "qr_pwd_label": "Password retrieved via API", + "qr_title": "Join Network", + "rate_down": "Download speed", + "rate_up": "Upload speed", + "rename_device": "Rename this device", + "rename_device_attr": "Rename this device", + "rename_passkey": "Rename this security key", + "sessions_loading": "Loading sessions…", + "settings_2fa_confirm_btn": "Verify 2FA Code", + "settings_2fa_copy_btn": "📋 Copy Codes", + "settings_2fa_disable_btn": "Disable 2FA", + "settings_2fa_download_btn": "💾 Download (.txt)", + "settings_2fa_enable_btn": "Enable 2FA", + "settings_2fa_qr_desc": "Scan this QR code with your authenticator app, or enter the key manually:", + "settings_2fa_recovery_desc": "Keep these 8 codes in a safe place. Each code allows single-use emergency login.", + "settings_2fa_recovery_title": "⚠️ Recovery Codes (Backup)", + "settings_2fa_regen_btn": "Regenerate Codes", + "settings_2fa_title": "Two-Factor Authentication (2FA) & Backup Codes", + "twofa_loading": "Loading…", + "twofa_state_disabled": "Disabled.", + "twofa_state_enabled": "Enabled: a TOTP code or backup code will be required at each login. (Remaining backup codes: {rem} / 8)", + "twofa_state_pending": "Setup in progress: scan the QR code and enter the 6-digit code from your app.", + "session_current_badge": "● Current", + "session_unknown_machine": "Unknown machine", + "session_browser_default": "Web Browser", + "session_no_active": "No active sessions found", + "session_load_failed": "Failed to load sessions", + "session_rename_prompt": "Enter a custom name for this machine:", + "session_rename_saving": "Saving name…", + "session_renamed_success": "Machine renamed successfully!", + "session_revoke_confirm_current": "Disconnect this current session? You will be immediately redirected to the login page.", + "session_revoke_confirm_other": "Force disconnection of device \"{device}\" ({ip})?", + "session_revoke_progress": "Disconnecting session…", + "session_revoked_success": "Session disconnected successfully.", + "rename_session_device": "Rename this device", + "passkey_empty": "No Passkey registered yet. Click \"➕ Register a new Passkey\" above to link your fingerprint (Touch ID / Windows Hello), Face ID or hardware key (YubiKey).", + "passkey_never": "Never", + "passkey_biometric_desc": "Biometric security / FIDO2", + "passkey_load_failed": "Failed to load Passkeys", + "passkey_not_supported_alert": "⚠️ Your browser does not support WebAuthn / Passkeys API or you are on an insecure connection (HTTPS or localhost required).", + "passkey_not_supported_row": "Browser or context not compatible with WebAuthn", + "rename_passkey_tooltip": "Rename this security key", + "passkey_rename_prompt": "Enter the new name for the security key:", + "passkey_rename_empty_alert": "The security key name cannot be empty.", + "passkey_rename_saving": "Saving new name…", + "passkey_renamed_success": "Key renamed successfully!", + "passkey_delete_confirm": "Are you sure you want to delete the Passkey \"{name}\"?", + "passkey_register_success": "Passkey registered successfully!", + "unknown_m": "Unknown", + "settings_admin_confirm_pwd": "Confirm Password", + "settings_admin_confirm_pwd_label": "Confirm Password", + "settings_admin_current_pwd": "Current Password", + "settings_admin_current_pwd_label": "Current Password", + "settings_admin_new_pwd": "New Password", + "settings_admin_new_pwd_label": "New Password", + "settings_admin_save_btn": "Update Credentials", + "settings_admin_sub": "Update username and password for dashboard access.", + "settings_admin_subtitle": "Change login username and password for the dashboard.", + "settings_admin_title": "Admin Account", + "settings_admin_user_label": "Administrator Username", + "settings_admin_username": "Admin Username", + "settings_autoconnect": "Start automatically on boot", + "settings_bridge_desc": "Wi-Fi clients will receive their IP addresses directly from your internet gateway router.", + "settings_bridge_eth_label": "Gateway Ethernet interface (bridge mode)", + "settings_max_clients_label": "Simultaneous clients limit (0 = unlimited)", + "settings_mode_label": "Operating Mode", + "settings_notif_desc": "Receive real-time alerts via Email, Gotify, Discord, or other services on critical events or quota exceeded.", + "settings_notif_save_btn": "Save Notifications", + "settings_notif_sub": "Receive real-time alerts via Email, Gotify, or Discord upon network or access events.", + "settings_notif_subtab_alerts": "✏️ Alert Customization", + "settings_notif_subtab_services": "📡 Notification Services", + "settings_notif_tab_alerts": "Alert Customisation", + "settings_notif_tab_services": "Notification Services (9)", + "settings_notif_test_all": "🧪 Test All Active Channels", + "settings_notif_title": "Notifications & Alerts", + "settings_passkeys_add_btn": "➕ Register a New Passkey", + "settings_passkeys_desc": "Log in instantly without password and without 2FA codes using Touch ID, Face ID, Windows Hello, or a physical USB key (YubiKey).", + "settings_passkeys_loading": "Loading Passkeys…", + "settings_passkeys_title": "🔑 Security Keys & Passkeys (FIDO2 / Biometrics)", + "settings_proxy_btn_test": "🔄 Test detection", + "settings_proxy_desc": "Configure detection of real client IP addresses when your Access Point is behind a reverse proxy (Nginx, Traefik, Caddy, Cloudflare, HAProxy, etc.). This ensures logs and sessions display the client's actual IP rather than the proxy's IP.", + "settings_proxy_diag_active": "● Detection active", + "settings_proxy_diag_raw": "RAW IP RECEIVED (PROXY OR SOCKET)", + "settings_proxy_diag_real": "RECORDED REAL CLIENT IP", + "settings_proxy_diag_title": "🔍 Live IP Detection (Your current connection)", + "settings_proxy_diag_xff": "X-FORWARDED-FOR HEADER", + "settings_proxy_diag_xri": "X-REAL-IP HEADER", + "settings_proxy_enable_chk": "Enable Reverse Proxy support", + "settings_proxy_enable_desc": "When enabled, AP Manager extracts the real client machine IP address from HTTP headers sent by your reverse proxy instead of logging the local IP of the proxy itself.", + "settings_proxy_examples_title": "💡 Configuration examples for your Reverse Proxy", + "settings_proxy_header_label": "Priority HTTP header for real IP", + "settings_proxy_save_btn": "💾 Save proxy settings", + "settings_proxy_title": "🔀 Reverse Proxy Configuration", + "settings_proxy_trust_private": "Trust all private networks and Docker containers", + "settings_proxy_trusted_ips_label": "Additional trusted proxy IP addresses or CIDR ranges", + "settings_pwd_label": "Wi-Fi Password", + "settings_save_wifi": "Save Settings", + "settings_security_label": "Wi-Fi Security", + "settings_sessions_desc": "Devices and browsers currently logged in with administrator credentials.", + "settings_sessions_loading": "Loading sessions…", + "settings_sessions_title": "Sessions Connected to Admin Account", + "settings_show_confirm_pwd": "Show password confirmation", + "settings_show_cur_pwd": "Show current password", + "settings_show_key": "Show key", + "settings_show_new_pwd": "Show new password", + "settings_show_token": "Show token", + "settings_ssid_label": "SSID Name", + "settings_tab_admin": "Admin Account", + "settings_tab_custom": "Customisation", + "settings_tab_danger": "Danger Zone", + "settings_tab_notif": "Notifications", + "settings_tab_proxy": "Reverse Proxy", + "settings_tab_vpn": "VPN Profiles", + "settings_tab_wifi": "Wi‑Fi & Network", + "settings_vpn_add_btn": "➕ Add VPN Profile", + "settings_vpn_direct_clients": "Direct WAN Clients", + "settings_vpn_empty_desc": "Import a .conf (WireGuard) or .ovpn (OpenVPN) file to get started.", + "settings_vpn_empty_title": "No VPN profiles configured", + "settings_vpn_killswitch_active": "Active Kill-Switches", + "settings_vpn_profiles_count": "Available VPN Profiles", + "settings_vpn_routed_clients": "Clients Routed via VPN", + "settings_vpn_sub": "Manage VPN profiles to route Wi-Fi client traffic through encrypted tunnels.", + "settings_vpn_subtitle": "Manage your VPN profiles to route client traffic and secure communications.", + "settings_vpn_title": "WireGuard & OpenVPN Profiles", + "settings_wifi_autoconnect": "Start automatically on boot", + "settings_wifi_eth": "Router Ethernet Interface (bridge mode)", + "settings_wifi_max_clients": "Max concurrent clients (0 = unlimited)", + "settings_wifi_mode": "Operating Mode", + "settings_wifi_pwd": "Wi-Fi Password", + "settings_wifi_save_btn": "Save Settings", + "settings_wifi_security": "Wi-Fi Security", + "settings_wifi_ssid": "SSID Name", + "settings_wifi_sub": "Changes will restart the active Wi-Fi connection.", + "settings_wifi_subtitle": "Changes will restart the active Wi-Fi connection.", + "settings_wifi_title": "AP Settings", + "setup_create_btn": "Create Network", + "setup_eth_desc": "Wi-Fi clients will receive IP addresses directly from your home router/modem.", + "setup_eth_label": "Router Ethernet Interface (bridge mode)", + "setup_intro": "No Wi-Fi network configured. Create your access point with an SSID and password.", + "setup_max_clients_label": "Max concurrent clients (0 = unlimited)", + "setup_mode_ap": "AP Mode (Router)", + "setup_mode_ap_desc": "Internal DHCP (10.42.0.x) & NAT", + "setup_mode_bridge": "Bridge Mode", + "setup_mode_bridge_desc": "Uses modem/router DHCP", + "setup_mode_label": "Operating Mode", + "setup_notice": "Required specifications: SSID from 1 to 32 characters, WPA password from 8 to 63 characters. Network will start automatically on boot.", + "setup_notice_req": "Required Specifications
SSID: 1 to 32 characters.
WPA Password: 8 to 63 characters, recommended with letters, numbers, and symbols.
The network will be started automatically upon system boot.", + "setup_pwd_confirm_label": "Confirm Wi-Fi Password", + "setup_pwd_label": "Wi-Fi Password", + "setup_security_label": "Wi-Fi Security", + "setup_ssid_label": "SSID Name", + "setup_submit": "Create Network", + "setup_title": "Initial Setup", + "signal_excellent": "Excellent", + "signal_fair": "Fair", + "signal_good": "Good", + "signal_weak": "Weak", + "stats_chart_sub_day": "Traffic per hour (today)", + "stats_chart_subtitle_day": "Traffic by hour (today)", + "stats_chart_title": "Traffic & Connections", + "stats_chart_total_connections": "Total connections", + "stats_chart_unique_devices": "Unique devices", + "stats_connections_total": "total connection(s)", + "stats_cron_day_all": "Every day (*)", + "stats_cron_day_label": "📅 Execution Day", + "stats_cron_day_workdays": "Workdays (Monday to Friday)", + "stats_cron_desc": "Configure automatic delivery periodicity (Day, Hour, Minute)", + "stats_cron_range_all": "All periods (Day, Week, Month, Year)", + "stats_cron_range_day": "Today (Daily)", + "stats_cron_range_month": "This month (Monthly)", + "stats_cron_range_week": "This week (Weekly)", + "stats_cron_range_year": "This year (Yearly)", + "stats_cron_send_now_btn": "Send Report Now (Test)", + "stats_cron_tab_title": "📊 Scheduled Statistics & Metrics Report (Cron Task)", + "stats_cron_title": "Statistical Report Cron Scheduling", + "stats_cron_top_range_label": "📊 Top Clients Range", + "stats_current_slot_badge": "● Current slot", + "stats_details_title": "Connection Details", + "stats_loading": "Loading…", + "stats_no_data": "No statistics available", + "stats_range_day": "Daily", + "stats_range_month": "Monthly", + "stats_range_week": "Weekly", + "stats_range_year": "Yearly", + "stats_report_cron_default": "📅 Every day at 08:00", + "stats_report_cron_expr_label": "⚙️ Calculated Cron Expression", + "stats_report_hour_label": "🕐 Hour (00 - 23)", + "stats_report_minute_label": "⏱️ Minute (00 - 59)", + "stats_subtab_metrics": "Traffic & Metrics", + "stats_subtab_topology": "Network Topology", + "stats_this_month": "This month", + "stats_this_week": "This week", + "stats_this_year": "This year", + "stats_tip_clients": "unique client(s)", + "stats_tip_connections": "connection(s)", + "stats_today": "Today", + "stats_top_clients_sub": "Devices with highest data usage today (Daily)", + "stats_top_clients_title": "Top Clients (Data Usage)", + "stats_upcoming": "(Upcoming)", + "status_active": "Active", + "status_blocked": "Blocked", + "status_connected": "Connected", + "status_disconnected": "Disconnected", + "status_error": "Error", + "status_inactive": "Inactive", + "status_offline": "Offline", + "status_offline_conn": "Offline", + "status_online": "Online", + "status_online_live": "Live", + "currently_online": "Currently online", + "unknown_f": "Unknown", + "stored_in_db": "Stored in DB", + "th_action": "ACTION", + "th_actions": "ACTIONS", + "th_added_date": "DATE ADDED", + "th_blocked_on": "BLOCKED ON", + "th_browser": "BROWSER", + "th_cat_desc": "DESCRIPTION", + "th_cat_id": "IDENTIFIER", + "th_cat_name": "CATEGORY NAME", + "th_category_desc": "DESCRIPTION", + "th_category_id": "IDENTIFIER", + "th_category_name": "CATEGORY NAME", + "th_date": "DATE", + "th_device": "DEVICE", + "th_domain": "DOMAIN NAME", + "th_downloaded": "DOWNLOADED (↓)", + "th_dst": "DESTINATION", + "th_effective_status": "EFFECTIVE STATUS", + "th_event": "EVENT", + "th_first_connection": "FIRST SEEN", + "th_identified_devices": "IDENTIFIED DEVICES", + "th_info": "INFO & DETAILS", + "th_ip": "IP", + "th_ip_mac": "IP & MAC ADDRESSES", + "th_killswitch": "KILL-SWITCH", + "th_last_activity": "LAST ACTIVITY", + "th_last_ip": "LAST IP", + "th_last_used": "LAST USED", + "th_logo": "LOGO", + "th_mac": "MAC ADDRESS", + "th_num": "NO.", + "th_os": "OPERATING SYSTEM", + "th_passkey_name": "PASSKEY NAME", + "th_period": "PERIOD", + "th_proto": "PROTO", + "th_quota": "ALLOWANCE & SPEED", + "th_routing": "INTERNET ROUTING", + "th_signal": "SIGNAL", + "th_size": "SIZE", + "th_speed": "SPEED (REAL TIME)", + "th_src": "SOURCE", + "th_status": "CURRENT STATUS", + "th_time": "TIME", + "th_total_connections": "TOTAL CONNECTIONS", + "th_total_transferred": "TOTAL TRANSFERRED", + "th_unique_devices": "UNIQUE DEVICES", + "th_uploaded": "UPLOADED (↑)", + "th_vpn_assigned": "ASSIGNED VPN PROFILE", + "top_clients_sub_day": "Top consuming devices today (Daily)", + "top_clients_sub_month": "Top consuming devices this month (Monthly)", + "top_clients_sub_week": "Top consuming devices this week (Weekly)", + "top_clients_sub_year": "Top consuming devices this year (Yearly)", + "topo_ap_status": "AP: wlan0 (Channel 6)", + "topo_ap_title": "Wi-Fi AP", + "topo_blocked_devices": "Blocked / Isolated Devices", + "topo_clients_connected": "{count} connected", + "topo_clients_connected_count": "0 connected", + "topo_device_repartition": "Device Breakdown", + "topo_direct_wan": "Direct WAN (Gateway)", + "topo_down_tx": "Cumulative Download Speed (TX)", + "topo_export": "Export Topology ▾", + "topo_export_jpg": "📷 JPG Format (.jpg)", + "topo_export_png": "🖼️ PNG Format (.png)", + "topo_gateway": "Internet Gateway", + "topo_gateway_online": "Gateway: Online", + "topo_gateway_standby": "Gateway: Standby", + "topo_gateway_title": "Internet Gateway", + "topo_legend_fair": "● Fair (-70 dBm)", + "topo_legend_good": "● Good (-60 dBm)", + "topo_legend_links": "Links:", + "topo_legend_vpn": "● Red: Active VPN tunnel", + "topo_legend_weak": "● Weak (< -70 dBm)", + "topo_legend_wifi_good": "● Green: Wi-Fi > -50 dBm", + "topo_link_excellent": "● Green: Wi‑Fi > -50 dBm", + "topo_link_fair": "● Fair (-70 dBm)", + "topo_link_good": "● Good (-60 dBm)", + "topo_link_vpn": "● Red: Active VPN tunnel", + "topo_link_weak": "● Weak (< -70 dBm)", + "topo_link_wifi": "● Green: Wi-Fi > -50 dBm", + "topo_links_legend": "Links:", + "topo_live_badge": "Live", + "topo_live_bandwidth": "Live Bandwidth", + "topo_mac_filtering": "Hardware filtering by MAC address", + "topo_modal_ap_title": "Wi-Fi Access Point (AP Manager)", + "topo_modal_title": "Device Inspection", + "topo_modal_wan_title": "Internet Gateway (WAN)", + "topo_no_clients": "No clients connected", + "topo_no_clients_desc": "No clients connected", + "topo_search_ph": "Filter a device (name, IP, MAC)…", + "topo_security_filtering": "Security & Filtering", + "topo_sig_excellent": "● Excellent", + "topo_sig_fair": "● Fair", + "topo_sig_good": "● Good", + "topo_sig_weak": "● Weak", + "topo_signal_quality": "Wi-Fi Signal Quality", + "topo_status_wan": "Gateway: Online", + "topo_subtitle": "Real-time interactive mapping of devices and network links", + "topo_title": "Wi-Fi Network Topology", + "topo_up_rx": "Cumulative Upload Speed (RX)", + "topo_vpn_active": "🛡️ VPN: {count} active", + "topo_vpn_active_badge": "🛡️ VPN: {n} active", + "topo_wan_gateway_label": "Internet Gateway", + "topo_wan_link": "⚡ Wired Link / WAN", + "topo_wan_link_badge": "⚡ Wired Link / WAN", + "topo_wifi_links": "📶 Wireless Wi‑Fi Links (802.11)", + "topo_wifi_links_label": "📶 Wireless Wi-Fi Links (802.11)", + "twofa_download_codes_btn": "💾 Download Recovery Codes", + "twofa_help_text": "The current password entered above and a code (TOTP or backup) are required.", + "twofa_key_label": "Key:", + "twofa_qr_scan_prompt": "Scan this QR code with your authenticator app, or enter the key manually:", + "twofa_recovery_desc": "Keep these 8 codes in a safe place. If you lose your TOTP app, each code can only be used once.", + "twofa_recovery_title": "⚠️ Recovery Codes (Backup)", + "unblock": "Unblock", + "unknown_client": "Unknown name", + "unlimited": "Unlimited", + "view_config": "View Configuration", + "vpn_add_first_profile_btn": "Add First Profile", + "vpn_add_profile_btn": "Add VPN Profile", + "vpn_assigned_offline": "🛡️ Assigned to", + "vpn_auth_pass_label": "Password", + "vpn_auth_user_label": "Username", + "vpn_auto_test_5min": "Automatic test run every 5 min", + "vpn_autoconnect_badge": "⚡ Auto-connect active", + "vpn_block_if_down": "Block if down", + "vpn_btn_filter_online": "🟢 Online", + "vpn_btn_filter_routed": "🛡️ Routed", + "vpn_clients_empty_msg": "No Wi-Fi devices detected at this time.", + "vpn_direct": "🌐 Direct WAN Connection (No VPN)", + "vpn_killswitch_blocked": "⚠️ Blocked (Kill-Switch)", + "vpn_killswitch_chk": "Block if disconnected", + "vpn_lan_isolated": "🔒 LAN Isolated", + "vpn_lan_isolated_title": "Local network unreachable (LAN isolation active)", + "vpn_lan_isolated_tooltip": "Local network unreachable (LAN Isolation active)", + "vpn_modal_title": "Add VPN Profile", + "vpn_no_profiles_desc": "Import a .conf (WireGuard) or .ovpn (OpenVPN) file to begin routing your devices.", + "vpn_no_profiles_title": "No VPN profiles configured", + "vpn_offline_wan": "⚪ Offline (Direct WAN)", + "vpn_pending_test": "⚠️ Awaiting test", + "vpn_profile_name_label": "Profile Name", + "vpn_profile_type_label": "Protocol Type", + "vpn_public_ip_label": "VPN Public IP:", + "vpn_routed_tooltip": "Routed via VPN", + "vpn_routed_via": "🟢 Routed via", + "vpn_test_btn": "🔄 Test", + "vpn_test_tooltip": "Test connection and refresh public IP", + "vpn_traffic_encrypted_via": "Traffic encrypted via", + "vpn_view_config": "View configuration", + "vpn_wan_direct": "🌐 Direct WAN", + "vpn_wan_direct_down": "⚠️ Direct WAN (VPN inactive)", + "vpn_card_interface": "Interface:", + "vpn_card_table_pbr": "PBR Table:", + "vpn_card_transfer": "Transfer:", + "vpn_last_test": "Last test:", + "vpn_handshake_active": "Active handshake ({sec}s ago)", + "vpn_handshake_recent": "Last handshake {min} min ago", + "vpn_handshake_older": "Last handshake {h} h ago", + "vpn_handshake_waiting": "Waiting for handshake (not received)", + "vpn_error_prefix": "Error:", + "vpn_connected_suffix": "connected", + "vpn_protocol_label": "Protocol:", + "status_connecting": "Connecting...", + "btn_test": "Test", + "vpn_modal_edit_title": "Edit VPN Profile: {name}", + "vpn_err_enter_name": "Please enter a name for this profile.", + "vpn_err_enter_config": "Please paste or import the VPN configuration.", + "vpn_btn_saving": "Saving...", + "vpn_delete_confirm": "Are you sure you want to delete the VPN profile \"{name}\"?\\nAll assigned clients will revert to Direct WAN connection.", + "vpn_view_modal_title": "VPN Configuration: {name} ({type})", + "vpn_copied_btn": "✓ Copied!", + "vpn_ip_detected": "VPN public IP detected: {ip}", + "vpn_ip_error": "Unable to get public IP via this VPN profile", + "btn_block": "Block", + "btn_block_action": "🚫 Block", + "btn_block_this_device": "🚫 Block this device", + "btn_details": "🔍 Details", + "btn_manage_vpn_routing": "⚙️ Manage VPN routing", + "btn_unblock": "Unblock", + "client_unknown": "Unknown client", + "mode_bridge_label": "Network Bridge (Bridge)", + "mode_nat_label": "Access Point (Wi-Fi Router)", + "stats_today_from_to": "Today from {start} to {end}", + "topo_active_clients_count": "{n} active client(s)", + "topo_channel": "Channel", + "topo_devices_routed_tunnel": "{count} device(s) routed via this tunnel", + "topo_ip_bridge_lan": "LAN Bridge IP", + "topo_modal_connected_devs": "CONNECTED DEVICES", + "topo_modal_dev_details": "Device Details: {name}", + "topo_modal_dev_name": "DEVICE NAME", + "topo_modal_dns_servers": "DNS SERVERS", + "topo_modal_gw_ip": "GATEWAY IP ADDRESS", + "topo_modal_hw_type": "HARDWARE TYPE", + "topo_modal_inst_speed": "INSTANT THROUGHPUT", + "topo_modal_ip_addr": "IP ADDRESS", + "topo_modal_live_speed": "LIVE THROUGHPUT", + "topo_modal_local_ip": "AP LOCAL IP", + "topo_modal_mac_addr": "MAC ADDRESS", + "topo_modal_net_mode": "NETWORK MODE", + "topo_modal_out_iface": "OUTGOING INTERFACE", + "topo_modal_pbr_table": "KERNEL PBR TABLE", + "topo_modal_prof_name": "PROFILE NAME", + "topo_modal_public_ip": "TUNNEL PUBLIC IP", + "topo_modal_radio_channel": "RADIO & CHANNEL", + "topo_modal_routed_devs": "ROUTED DEVICES", + "topo_modal_routing_vpn": "INTERNET / VPN ROUTING", + "topo_modal_security": "SECURITY", + "topo_modal_sig_quality": "SIGNAL QUALITY", + "topo_modal_ssid": "SSID NAME", + "topo_modal_sys_iface": "SYSTEM INTERFACE", + "topo_modal_vpn_desc": "All Internet traffic from devices associated with this profile is encrypted and routed exclusively through this VPN tunnel.", + "topo_modal_vpn_proto": "VPN PROTOCOL", + "topo_modal_vpn_title": "VPN Tunnel: {name}", + "topo_modal_wan_desc": "The gateway provides Internet connectivity for all devices connected to the Wi-Fi access point via routing and NAT address translation.", + "topo_modal_wan_status": "WAN STATUS", + "topo_modal_wifi_iface": "WIRELESS INTERFACE", + "topo_no_clients_title": "No devices connected to the access point", + "topo_tunnel_active": "Active tunnel", + "topo_tunnel_encrypted_ok": "Encrypted tunnel operational", + "vpn_status_disconnected_short": "(Down)", + "btn_hide_token": "Hide Token", + "btn_show_token": "Show Token", + "backup_no_pending": "No pending backup data.", + "backup_select_one_category": "Please select at least one category of items to restore.", + "backup_confirm_restore_auth": "⚠️ WARNING: You chose to restore administrator account data. This will overwrite current credentials, passwords, and passkeys. Do you want to continue?", + "backup_restoring": "Restoring in progress…", + "backup_applying_to_db": "Applying backup into database…", + "backup_downloaded_success": "✓ Full backup downloaded ({size} KB)! Contains JSON configuration and raw SQLite database.", + "backup_export_err": "Export error: ", + "backup_invalid_file": "The selected file does not appear to be a valid AP Manageur backup (backup keys not found).", + "backup_json_read_err": "Error reading JSON file: ", + "backup_read_file_err": "Unable to read selected file.", + "backup_parse_err": "Backup parsing error: ", + "passkey_https_alert": "Passkeys require a modern browser and a secure context (HTTPS or localhost).", + "passkey_register_prompt": "Enter a name for this Passkey (e.g. MacBook Touch ID, iPhone Face ID, YubiKey 5C):", + "passkey_waiting_validation": "Waiting for biometric or physical verification on your device…", + "passkey_register_err": "Passkey registration error: ", + "twofa_codes_downloaded": "Recovery codes file downloaded!", + "twofa_codes_generating_dl": "Generating and downloading recovery codes…", + "twofa_codes_generating": "Generating new recovery codes…", + "err_enter_current_pwd": "Enter your current admin password", + "notif_testing_progress": "⏳ Sending test notification…", + "notif_testing_btn": "Testing in progress…", + "notif_test_success": "Test succeeded!", + "notif_test_partial_failure": "Some tests failed", + "notif_test_err": "❌ Test error: ", + "stats_cron_day_weekend": "Weekend (Saturday & Sunday)", + "stats_cron_day_mon": "Every Monday", + "stats_cron_day_tue": "Every Tuesday", + "stats_cron_day_wed": "Every Wednesday", + "stats_cron_day_thu": "Every Thursday", + "stats_cron_day_fri": "Every Friday", + "stats_cron_day_sat": "Every Saturday", + "stats_cron_day_sun": "Every Sunday", + "stats_cron_expr_label": "⚙️ Standard Cron Expression", + "stats_cron_format_hint": "Cron format: minute hour day month day_of_week (e.g. 0 8 * * * = 08:00 every day, 30 18 * * 5 = 18:30 every Friday).", + "stats_cron_hourly_at": "every hour at :{min}", + "stats_cron_at_time": "at {time}", + "stats_cron_day_all_short": "Every day", + "stats_cron_day_workdays_short": "Workdays (Mon-Fri)", + "stats_cron_day_weekend_short": "Weekend (Sat-Sun)", + "stats_cron_day_prefix": "Day ", + "stats_report_sending": "⏳ Sending statistics report…", + "proxy_label_proto": "Upstream protocol (X-Forwarded-Proto):", + "proxy_opt_xff": "X-Forwarded-For (Standard RFC 7239 / Nginx / Traefik / Caddy)", + "proxy_opt_true_client_ip": "True-Client-IP (Cloudflare Enterprise / Akamai)", + "lang_card_fr_name": "French", + "lang_card_fr_country": "France", + "lang_card_enus_name": "English (US)", + "lang_card_enus_country": "United States", + "lang_card_engb_name": "English (UK)", + "lang_card_engb_country": "United Kingdom", + "lang_opt_fr": "French (France)", + "lang_opt_enus": "English (US) — American", + "lang_opt_engb": "English (UK) — British", + "placeholder_app_name": "Wi-Fi AP Administration", + "placeholder_app_short_name": "AP Manageur", + "custom_saved_msg": "Customisation saved to server", + "custom_saving": "Saving…", + "no_categories_defined": "No categories defined", + "modal_cat_edit_title_with_name": "Edit category “{label}”", + "modal_cat_err_name": "Please enter a name for the category.", + "modal_cat_err_id": "Please enter a unique technical identifier.", + "modal_cat_err_id_chars": "Identifier can only contain lowercase letters, numbers, hyphens or underscores.", + "modal_cat_cannot_delete_last": "Cannot delete the last device category.", + "modal_cat_confirm_delete": "Are you sure you want to delete the category “{label}”?\n\nAll devices associated with this category will automatically switch to the Standard category.", + "saving_in_progress": "Saving in progress…", + "deleting_in_progress": "Deleting in progress…", + "resetting_in_progress": "Resetting in progress…", + "settings_hide_new_pwd": "Hide new password", + "settings_hide_confirm_pwd": "Hide password confirmation", + "settings_hide_cur_pwd": "Hide current password", + "settings_hide_token": "Hide token", + "settings_hide_key": "Hide key", + "vpn_direct_clients_desc": "Without VPN (standard connection)", + "vpn_killswitch_active_desc": "Leak protection active", + "vpn_btn_filter_all": "All", + "vpn_btn_filter_offline": "⚪ Offline", + "adv_routing_empty": "No Wi-Fi devices detected at the moment.", + "packets_kept_plural": "packets buffered", + "packets_kept_singular": "packet buffered", + "adv_pcap_status_running": "Recording...", + "adv_pcap_status_stopping": "Stopping...", + "adv_pcap_status_inactive": "Inactive", + "adv_pcap_capture_in_progress": "Capture in progress ({time})", + "adv_pcap_iface_label": "Wi-Fi Interface: ", + "adv_pcap_filter_domain_tooltip": "Filter by this domain", + "adv_pcap_confirm_clear": "Clear all captured packets?", + "adv_pcap_no_packets_export": "No packets to export", + "adv_pcap_err_start": "Error starting capture", + "adv_pcap_err_stop": "Error stopping capture", + "adv_pcap_err_clear": "Error clearing packets", + "adv_pcap_filter_icmp": "ICMP (Ping)", + "adv_pcap_filter_tls": "TLS / HTTPS", +}; diff --git a/lang/en-us.js b/lang/en-us.js new file mode 100644 index 0000000..096ed65 --- /dev/null +++ b/lang/en-us.js @@ -0,0 +1,1158 @@ +// AP Manageur - English (United States) Dictionary +window.I18N = window.I18N || {}; +window.I18N['en-us'] = { + "adv_lan_isolation": "🔒 Active LAN Isolation: Devices connected to a VPN are strictly isolated from the local network.", + "adv_lan_isolation_body": "All devices connected to a VPN are strictly isolated from the local network.", + "adv_lan_isolation_full": "LAN Isolation Active: All devices connected to a VPN are strictly isolated from the local network (no access to routers, NAS, printers, or AP Manageur). All their traffic routes exclusively through the VPN tunnel.", + "adv_lan_isolation_title": "LAN Isolation Active:", + "adv_pcap_active": "Active", + "adv_pcap_autoscroll": "Live autoscroll", + "adv_pcap_buffer_size": "All packets retained", + "adv_pcap_captured_label": "Captured Packets", + "adv_pcap_clear": "🗑️ Clear", + "adv_pcap_count_suffix": "packet(s)", + "adv_pcap_desc": "Real-time network traffic capture and packet inspection on the Wi-Fi interface", + "adv_pcap_domains_desc": "Unique domain names", + "adv_pcap_domains_detected": "Detected Domains", + "adv_pcap_domains_unique": "Unique domain names", + "adv_pcap_empty": "No packets captured. Click 'Start' to launch Wireshark analysis.", + "adv_pcap_export_csv": "📄 Export CSV", + "adv_pcap_export_pcap": "📥 Export PCAP", + "adv_pcap_export_size": "PCAP export size", + "adv_pcap_filter_all": "All", + "adv_pcap_filter_domains": "🌐 Domains only", + "adv_pcap_format_desc": "Libpcap 2.4 format (Wireshark)", + "adv_pcap_hint": "💡 Click on a packet to inspect decoded header and Wireshark-style hex/ASCII dump.", + "adv_pcap_iface_info": "Wi-Fi Interface:", + "adv_pcap_inactive": "Inactive", + "adv_pcap_packets_captured": "Captured packets", + "adv_pcap_proto_label": "Detected Protocols", + "adv_pcap_protocols": "Detected protocols", + "adv_pcap_quick_filters": "Quick filters:", + "adv_pcap_search_ph": "Filter packets or domain (e.g. google.com, dns, icmp, 10.42.0.1...)", + "adv_pcap_start": "▶ Start", + "adv_pcap_state_label": "Wireshark Analyzer State", + "adv_pcap_state_title": "Wireshark Analyzer Status", + "adv_pcap_stop": "■ Stop", + "adv_pcap_stop_btn": "■ Stop", + "adv_pcap_title": "Wi-Fi Network Analyzer (Wireshark)", + "adv_routing_desc": "Choose which VPN profile each device should route through, or leave on direct Internet.", + "adv_routing_title": "Wi-Fi Network Routing by Client", + "adv_subtab_pcap": "Packet Capture (PCAP)", + "adv_subtab_vpn": "Per-Client VPN Routing", + "alert_copied": "Copied to clipboard!", + "api_unavailable": "API unavailable", + "app_main_heading": "Wi-Fi AP Administration", + "app_title_sub": "Wi-Fi AP administration", + "app_title_text": "Wi-Fi AP Administration", + "auth_confirm_password": "Confirm password", + "auth_current_password": "Current password", + "auth_intro": "Sign in to access the Wi-Fi AP administration.", + "auth_intro_prefix": "Sign in to access", + "auth_intro_title": "Wi-Fi AP administration", + "auth_new_password": "New password", + "auth_otp": "Two-factor authentication code (TOTP or backup)", + "auth_passkey_btn": "Sign in with a Passkey", + "auth_passkey_desc": "Touch ID, Face ID, Windows Hello or security key without password or 2FA", + "auth_passkey_or": "OR WITHOUT PASSWORD", + "auth_password": "Password", + "auth_remember": "Remember me", + "auth_submit": "Sign In", + "auth_title": "Sign In", + "auth_username": "Username", + "auth_setup_title": "Create Administrator Account", + "auth_setup_intro": "Set up the account that will protect the dashboard.", + "auth_setup_submit": "Create Account", + "auth_otp_placeholder": "6-digit code or backup code (e.g. ABCDE-12345)", + "auth_processing": "Processing…", + "auth_account_created": "Account created. Signing in…", + "passkey_auth_success": "Passkey authentication successful!", + "passkey_login_rejected": "Passkey authentication rejected", + "passkey_error_prefix": "Passkey error: ", + "badge_limited": "Limited", + "block": "Block", + "blocked_desc": "These devices are currently restricted from Wi-Fi access and can be unblocked anytime.", + "blocked_title": "Blocked Devices", + "btn_add": "Add", + "btn_add_category": "➕ Add a Category", + "btn_apply": "Apply", + "btn_cancel": "Cancel", + "btn_clear": "Clear", + "btn_close": "Close", + "btn_confirm": "Confirm", + "btn_connect": "Connect", + "btn_copy": "Copy", + "btn_delete": "Delete", + "btn_disconnect": "Disconnect", + "btn_download": "Download", + "btn_edit": "Edit", + "btn_export": "Export", + "btn_hide_pwd": "Hide Password", + "btn_import": "Import", + "btn_logout": "Sign out", + "btn_next": "Next →", + "btn_paste_svg": "📋 Paste SVG", + "btn_prev": "← Previous", + "btn_refresh": "Refresh", + "btn_rename": "Rename", + "btn_reset": "Reset", + "btn_reset_defaults": "↺ Reset to Default", + "btn_restart": "Restart", + "btn_save": "Save", + "btn_search": "Search", + "btn_show_pwd": "Show Password", + "btn_start": "Start", + "btn_stop": "Stop", + "chart_current_slot": "Current slot:", + "chart_sub_day": "Traffic by hour (today)", + "chart_sub_month": "Connected devices per month (last 12 months)", + "chart_sub_week": "Connected devices per week (last 12 weeks)", + "chart_sub_year": "Connected devices per year", + "clients_blocked_desc": "Wi-Fi access blocked", + "clients_mac_filtering_desc": "Hardware filtering by MAC address", + "clients_offline_desc": "Currently disconnected", + "clients_online_wifi_desc": "Online on Wi-Fi", + "clients_saved_sqlite_desc": "Stored in SQLite database", + "clients_vpn_tunneled_desc": "Traffic routed through tunnel", + "confirm_clear_logs": "Are you sure you want to clear all connection logs?", + "confirm_delete_all_data": "⚠️ WARNING: Do you really want to delete all application data?", + "confirm_delete_device": "Are you sure you want to delete device \"{name}\" ({mac}) from the database?", + "confirm_delete_passkey": "Are you sure you want to delete Passkey \"{name}\"?", + "confirm_reboot_ap": "Do you want to reboot the Wi-Fi access point?", + "confirm_reset_device_types": "Do you want to reset all device categories to defaults?", + "confirm_reset_quota": "Do you want to reset the data counter for device \"{name}\" to zero?", + "connected_count_suffix": "connected", + "connected_live": "Connected live", + "custom_add_category": "➕ Add a Category", + "custom_app_name": "Full Application Name", + "custom_db_notice": "Saved in database: name, language, and theme apply across all your devices.", + "custom_dev_types_desc": "Manage device categories (name, logo/emoji, identifier) and customize their display.", + "custom_dev_types_title": "🏷️ Device Types & Categories", + "custom_device_types_desc": "Manage device categories (name, logo/emoji, identifier) and customize their display.", + "custom_device_types_title": "🏷️ Device Types & Categories", + "custom_lang": "Interface Language", + "custom_reset_defaults": "↺ Reset to Defaults", + "custom_save_btn": "Save Customization", + "custom_short_name": "Short Name (browser tab)", + "custom_subtitle": "Customize service title, language, and visual appearance.", + "custom_theme": "Theme", + "custom_theme_auto": "Automatic (system preference)", + "custom_theme_dark": "Dark", + "custom_theme_light": "Light", + "custom_theme_winxp": "Windows XP (Luna)", + "custom_theme_futuristic": "Futuristic (Cyber / Neon)", + "custom_theme_macos": "macOS (Adaptive Light / Dark)", + "custom_theme_hacker": "Hacker (Terminal Matrix)", + "custom_title": "Customization", + "danger_backup_desc": "Export the full system configuration (Wi-Fi settings, WireGuard & OpenVPN profiles, device routings, device names and logos, blocklist, and SQLite database) to a secure file, or restore a previous configuration in one click.", + "danger_backup_title": "📦 Global Backup & Restore", + "danger_clear_btn": "Delete All Data", + "danger_clear_desc": "Deletes connection log history, blocked devices list, and saved network settings.", + "danger_clear_title": "⚠️ Irreversible Deletion", + "danger_delete_all_btn": "Delete All Data", + "danger_delete_desc": "Deletes log history, blocked devices, and saved network configuration.", + "danger_delete_title": "⚠️ Irreversible Deletion", + "danger_desc": "Backup management, configuration restore, and critical maintenance actions.", + "danger_export_btn": "📥 Export Configuration & Database", + "danger_import_btn": "📤 Import Backup…", + "danger_subtitle": "Backup management, configuration restore, and critical system maintenance actions.", + "danger_title": "Danger Zone & Maintenance", + "dash_card_clients": "Connected Clients", + "dash_card_ssid": "SSID", + "dash_card_status": "AP Status", + "dash_card_uptime": "SSID Uptime", + "dash_clients_title": "Connected Clients", + "dash_connected_clients": "Connected Clients", + "dash_qr_desc": "The QR code uses the actual SSID and password of the AP.", + "dash_qr_pwd_label": "Password retrieved by API", + "dash_qr_title": "Join Network", + "dash_ssid_title": "SSID", + "dash_state_title": "AP Status", + "dash_updated": "Last updated:", + "dash_updated_initial": "Last updated: —", + "dash_uptime_title": "SSID Uptime", + "delete_history_attr": "Delete from database history", + "dev_blocked": "Blocked Devices", + "dev_blocked_count": "Blocked Devices", + "dev_blocked_sub": "Wi‑Fi access forbidden", + "dev_click_change_type": "Click to change device type", + "dev_connected": "Currently Connected", + "dev_connected_sub": "Online on Wi‑Fi", + "dev_currently_connected": "Currently Connected", + "dev_direct_sub": "Without VPN (normal connection)", + "dev_edit_type": "Edit device type", + "dev_filter_all": "All", + "dev_filter_block": "🔴 Blocked", + "dev_filter_conn": "🟢 Connected", + "dev_filter_off": "⚪ Offline", + "dev_history_desc": "View all devices that have ever connected to the Wi-Fi AP.", + "dev_history_title": "All Devices History", + "dev_ks_sub": "Leak protection", + "dev_lan_isolation_desc": "Any device connected to a VPN is strictly isolated from the local network (no access to gateway, NAS, printers or AP Manager). All its traffic travels exclusively through the VPN tunnel.", + "dev_lan_isolation_title": "Active LAN isolation:", + "dev_offline": "Offline Devices", + "dev_offline_count": "Offline Devices", + "dev_offline_sub": "Currently disconnected", + "dev_routed_sub": "Traffic routed via tunnel", + "dev_search_ph": "Filter by name, MAC address, IP...", + "dev_total": "Total Registered Devices", + "dev_total_registered": "Total Registered Devices", + "dev_total_sub": "Saved in SQLite DB", + "device_click_to_change_type": "Click to change device type", + "device_speed_label": "Speed:", + "devices_count_suffix": "device(s)", + "err_auth_required": "Authentication required", + "err_bad_login": "Incorrect username or password", + "err_delete_history": "Error while deleting device", + "err_killswitch_update": "Error updating Kill-Switch", + "err_network": "Network error or server unreachable", + "err_passwords_mismatch": "Passwords do not match", + "err_prefix": "Error: ", + "err_reset_quota": "Error while resetting quota", + "err_save_limits": "Error while saving limits", + "err_timeout": "Request timed out", + "err_unknown": "An unknown error occurred.", + "err_vpn_assignment": "Error during VPN assignment", + "explore_on_sites": "Explore online sites:", + "filter_all": "All", + "filter_by_domain": "Filter by this domain", + "filter_this_domain": "Filter by this domain", + "header_lang_tooltip": "Language settings", + "last_activity": "Last activity:", + "limits_dev_name_label": "Device Name", + "loader_connecting": "connecting…", + "loader_finished": "Startup complete!", + "loader_finished_badge": "Startup complete", + "loader_ip_pending": "fetching IP…", + "loader_no_vpn_needed": "No automatic VPN tunnel required", + "loader_ready": "System ready!", + "loader_ready_badge": "System ready", + "loader_refreshing": "Refreshing…", + "loader_refreshing_badge": "Refreshing", + "loader_skip": "Skip to dashboard →", + "loader_starting": "Starting up…", + "loader_starting_badge": "Starting up", + "loader_step1": "API & Session", + "loader_step1_admin": "Administrator privileges confirmed", + "loader_step1_conn": "Connecting to API and verifying access…", + "loader_step1_label": "Step 1 of 4", + "loader_step1_ok": "Administrator rights confirmed", + "loader_step1_sub": "Connecting to server and verifying session…", + "loader_step2": "Wi-Fi Network", + "loader_step2_activating": "Activating Wi-Fi network ({s}s)…", + "loader_step2_ap_cfg": "Access point configured", + "loader_step2_ap_init": "Initial configuration", + "loader_step2_ap_up": "Access point operational (SSID: {ssid})", + "loader_step2_checking": "Checking Wi-Fi network status…", + "loader_step2_configured": "Access Point configured", + "loader_step2_ok": "Access Point operational", + "loader_step2_sub": "Checking Wi-Fi interface and AP status…", + "loader_step3": "Tests & VPN", + "loader_step3_detecting": "Detecting and verifying VPN profiles…", + "loader_step3_none": "No automatic VPN tunnel required", + "loader_step3_ok": "VPN tunnels operational ({connected}/{target}): {details}", + "loader_step3_sub": "Checking VPN profiles and tunnels…", + "loader_step3_waiting": "VPN tunnels ({connected}/{target}): {details} [{elapsed}s]", + "loader_step4": "Dashboard", + "loader_step4_done": "Startup complete!", + "loader_step4_done_badge": "Startup complete", + "loader_step4_inventory": "Scanning network devices inventory…", + "loader_step4_opening": "Opening administration dashboard", + "loader_step4_ready": "System ready!", + "loader_step4_ready_badge": "System ready", + "loader_step4_sub": "Loading dashboard and devices…", + "loader_step4_sync": "Synchronizing devices, tunnels, and metrics…", + "loader_step_x_of_y": "Step {step} of 4", + "loader_title": "Wi‑Fi AP Management", + "loader_tunnels_vpn": "VPN Tunnels", + "loader_tunnels_vpn_ok": "VPN tunnels operational", + "loader_waiting": "waiting…", + "loader_waiting_api": "Waiting for API server", + "loader_wifi_activating": "Activating Wi-Fi network ({sec}s)…", + "loading": "Loading…", + "loading_categories": "Loading categories…", + "loading_passkeys": "Loading Passkeys…", + "log_activation_2fa": "🛡️ 2FA Enabled", + "log_arret": "■ AP Stopped", + "log_blocage": "⛔ Blocked", + "log_config_modified": "✓ AP Config updated", + "log_connexion": "● Wi-Fi Connected", + "log_connexion_admin": "● Admin Login", + "log_connexion_code_recuperation": "🔑 Backup Code Login", + "log_creation": "+ AP Created", + "log_creation_compte_admin": "👤 Account Created", + "log_deblocage": "✓ Unblocked", + "log_deconnexion": "○ Wi-Fi Disconnected", + "log_deconnexion_admin": "○ Admin Logout", + "log_demarrage": "▶ AP Started", + "log_desactivation_2fa": "🔓 2FA Disabled", + "log_echec_connexion": "❌ Login Failed", + "log_generation_secret_2fa": "⚙️ 2FA Secret Generated", + "log_limites_appareil_modifiees": "⚖️ Quota & Speed updated", + "log_modification_identifiants": "🔑 Credentials Updated", + "log_modification_preferences": "🎨 Preferences Updated", + "log_redemarrage": "↻ AP Restarted", + "log_regeneration_codes_secours": "🔄 New Backup Codes", + "log_reinitialisation_donnees": "⚠️ Data Reset", + "log_rejet_limite": "⚠️ Limit reached (rejected)", + "log_suppression_journaux": "🗑️ Logs Cleared", + "log_vpn_connect": "🌐 VPN Connected", + "log_vpn_disconnect": "🔌 VPN Disconnected", + "log_vpn_route": "🛡️ VPN Routing", + "logs_clear_btn": "Clear Logs", + "logs_title": "Connection Logs", + "modal_bw_chk": "Bandwidth Limiting (Speed)", + "modal_bw_desc": "💡 Regulated by Linux kernel (QoS / Traffic Control). 0 = unlimited.", + "modal_bw_down": "Max Download Speed", + "modal_bw_profiles": "Quick profiles:", + "modal_bw_up": "Max Upload Speed", + "modal_cat_add_title": "➕ Add Device Category", + "modal_cat_choose": "Choose a device category:", + "modal_cat_desc_label": "Description / Device examples", + "modal_cat_edit_title": "🏷️ Edit Device Type", + "modal_cat_explore": "Explore on websites:", + "modal_cat_filter_all": "All", + "modal_cat_filter_emoji": "😀 Emojis", + "modal_cat_filter_svg": "⚡ SVG (Iconify)", + "modal_cat_icon_label": "Logo / Icon (Emoji or SVG) *", + "modal_cat_id_help": "Lowercase letters, numbers, hyphens or underscores only.", + "modal_cat_id_label": "Unique technical identifier *", + "modal_cat_name_label": "Category name *", + "modal_cat_paste_svg": "📋 Paste SVG", + "modal_cat_quick_sugg": "Quick suggestions:", + "modal_cat_save_btn": "Save", + "modal_cat_search_btn": "Search", + "modal_cat_search_title": "🔍 Search emoji or SVG icon", + "modal_cat_table_loading": "Loading categories…", + "modal_change_dev_type_title": "🏷️ Change Device Type", + "modal_choose_category": "Choose an equipment category:", + "modal_current_usage": "Current usage:", + "modal_device_type_attr": "Change device type (Smartphone, Tablet, PC, TV...)", + "modal_device_type_click": "Click to change device type", + "modal_device_type_title": "Change device type", + "modal_import_admin": "Admin account & passkeys", + "modal_import_blocked": "Blocked devices list", + "modal_import_btn_confirm": "Confirm and restore", + "modal_import_config": "Configuration & preferences", + "modal_import_created_at": "Creation date:", + "modal_import_created_date": "Creation date: —", + "modal_import_detected": "Elements detected in archive:", + "modal_import_item_admin": "🔐 Administrator account & passkeys (⚠️ will overwrite current account)", + "modal_import_item_config": "⚙️ Configuration & preferences (Wi-Fi, network, themes, etc.)", + "modal_import_item_names": "📱 Device names & assigned types", + "modal_import_item_types": "🎨 Device categories & custom logos", + "modal_import_item_vpn": "🌐 VPN profiles & routings (WireGuard & OpenVPN)", + "modal_import_names": "Device names", + "modal_import_select": "Select data to restore:", + "modal_import_title": "Restore Backup", + "modal_import_types": "Device categories", + "modal_import_vpn": "VPN profiles & routing", + "modal_limits_title": "Data Quota & Bandwidth Limiting", + "modal_limits_title_attr": "Set quota and limit bandwidth", + "modal_period_day": "Daily (reset at midnight)", + "modal_period_month": "Monthly (reset 1st of month)", + "modal_period_total": "Total cumulative", + "modal_period_week": "Weekly (reset Monday)", + "modal_presets": "Presets:", + "modal_quota_action_desc": "Action on limit: Device will be blocked from browsing Internet (WAN traffic blocked automatically).", + "modal_quota_chk": "Internet Data Quota", + "modal_quota_exceeded": "Quota exceeded", + "modal_quota_exhausted": "Quota exhausted (0 B remaining)", + "modal_quota_max": "Max Allowed Volume", + "modal_quota_period": "Calculation Period", + "modal_quota_preset_1": "1 GB", + "modal_quota_preset_10": "10 GB", + "modal_quota_preset_20": "20 GB", + "modal_quota_preset_5": "5 GB", + "modal_quota_preset_50": "50 GB", + "modal_quota_remaining": "Remaining:", + "modal_reset_counter": "🔄 Reset counter", + "modal_save_limits": "Save Limitations", + "modal_saved_ok": "✓ Limitations saved and applied successfully!", + "modal_saving": "Applying quotas and network limitations…", + "modal_search_icon_title": "🔍 Search an emoji or SVG icon", + "modal_vpn_auth_optional": "OpenVPN Credentials (optional)", + "modal_vpn_autoconnect": "Automatically connect this profile on AP startup", + "modal_vpn_config_file": "Configuration File", + "modal_vpn_copy": "📋 Copy", + "modal_vpn_download": "💾 Download", + "modal_vpn_import_btn": "📁 Import a file (.conf / .ovpn)", + "modal_vpn_openvpn_sub": "Standard .ovpn file", + "modal_vpn_save_btn": "Save Profile", + "modal_vpn_view_title": "VPN Configuration", + "modal_vpn_wireguard_sub": "Modern & fast .conf file", + "nav_advanced": "Advanced", + "nav_blocked": "Blocked Devices", + "nav_dashboard": "Dashboard", + "nav_devices": "Devices", + "nav_logs": "Logs", + "nav_settings": "Settings", + "nav_stats": "Statistics", + "net_lan": "Local Area Network (LAN)", + "net_multicast": "Broadcast / Multicast", + "net_wan": "Internet / WAN", + "no_blocked_clients": "No blocked devices", + "no_clients": "No devices connected", + "no_devices_found": "No devices matching search criteria", + "no_logs": "No logs available", + "no_packets_captured": "No packets captured. Click \"Start\" to launch Wireshark analysis.", + "no_packets_match": "No packets match filter \"{filter}\"", + "no_traffic_history": "No traffic history available", + "no_vpn_clients_match": "No devices match search criteria", + "not_assigned": "Not assigned", + "notif_check_admin_login_failed": "⚠️ Admin Login Failed", + "notif_check_device_blocked": "🛑 Device Blocked or Unblocked", + "notif_check_device_connected": "📶 Known Wi-Fi Device Reconnected", + "notif_check_device_disconnected": "📴 Wi-Fi Device Disconnected", + "notif_check_new_device": "📱 New Wi-Fi Device (First Connection)", + "notif_check_quota_exceeded": "⚖️ Device Data Quota Exceeded", + "notif_check_settings_changed": "⚙️ Wi-Fi / AP Settings Changed", + "notif_check_vpn_client_disconnected": "🌐 Client Disconnected / Removed from VPN", + "notif_check_vpn_profile_disconnected": "⚠️ VPN Profile Disconnected (Tunnel Down)", + "notif_custom_desc": "HTTP request to any API, home automation, or cloud service", + "notif_custom_enable": "Enable Webhook", + "notif_custom_headers_label": "Custom headers (optional, JSON or Key: Value)", + "notif_custom_method": "Method", + "notif_custom_method_label": "Method", + "notif_custom_test_btn": "Test Webhook", + "notif_custom_title": "Custom Webhook (HTTP)", + "notif_custom_url_dest": "Destination URL", + "notif_custom_url_label": "Destination URL", + "notif_custom_webhook_desc": "HTTP request to any API, home automation, or external server", + "notif_custom_webhook_header": "Custom Webhook (HTTP)", + "notif_discord_bot_full": "Bot Name (Optional)", + "notif_discord_bot_label": "Bot Name (Optional)", + "notif_discord_channel_desc": "Direct delivery to a channel via Webhook", + "notif_discord_desc": "Direct delivery to a channel via Webhook", + "notif_discord_enable": "Enable Discord", + "notif_discord_test_btn": "Test Discord", + "notif_discord_title": "Discord Notification", + "notif_discord_url_label": "Discord Webhook URL", + "notif_email_desc": "Direct delivery via your mail server", + "notif_email_enable": "Enable Email", + "notif_email_from": "Sender (From)", + "notif_email_from_full": "Sender (From)", + "notif_email_from_label": "Sender Name", + "notif_email_host": "SMTP Host", + "notif_email_host_label": "SMTP Host", + "notif_email_none_hint": "None (Port 25 unencrypted)", + "notif_email_pass": "SMTP Password", + "notif_email_pass_label": "SMTP Password", + "notif_email_pass_smtp": "SMTP Password", + "notif_email_port": "SMTP Port", + "notif_email_port_label": "SMTP Port", + "notif_email_sec_label": "Security", + "notif_email_sec_none": "None (Plain text)", + "notif_email_sec_ssl": "Implicit SSL/TLS", + "notif_email_sec_ssl_465": "SSL / TLS (Port 465)", + "notif_email_sec_starttls": "STARTTLS (Recommended)", + "notif_email_security": "Security", + "notif_email_starttls_hint": "STARTTLS (Recommended port 587)", + "notif_email_sub": "Direct delivery through your mail server", + "notif_email_test": "Test Email sending", + "notif_email_test_action": "Test Email Delivery", + "notif_email_test_btn": "Test Email Delivery", + "notif_email_title": "Email Notification (SMTP)", + "notif_email_to": "Recipient(s) (To)", + "notif_email_to_label": "Recipient(s) (To)", + "notif_email_user": "SMTP Username", + "notif_email_user_label": "SMTP Username", + "notif_event_admin_login": "🔒 Admin Account Login", + "notif_event_admin_login_failed": "⚠️ Admin Login Failed", + "notif_event_device_blocked": "🛑 Device Blocked or Unblocked", + "notif_event_device_connected": "📶 Known Wi-Fi Device Reconnected", + "notif_event_device_disconnected": "📴 Wi-Fi Device Disconnected", + "notif_event_new_device": "📱 New Wi-Fi Device (First Connection)", + "notif_event_quota_exceeded": "⚖️ Device Data Quota Exceeded", + "notif_event_settings_changed": "⚙️ Wi-Fi / AP Settings Changed", + "notif_event_stats_report": "📊 Statistics & Metrics Report (Cron Task)", + "notif_event_vpn_client_connected": "🛡️ Client Routed via VPN", + "notif_event_vpn_client_disconnected": "🌐 Client Disconnected / Removed from VPN", + "notif_event_vpn_profile_connected": "🛡️ VPN Profile Connected (Tunnel Active)", + "notif_event_vpn_profile_disconnected": "⚠️ VPN Profile Disconnected (Tunnel Down)", + "notif_events_desc": "Select events that will trigger sending a notification:", + "notif_events_title": "Alert Trigger Events", + "notif_evt_admin_login": "🔒 Admin account login", + "notif_evt_admin_login_failed": "⚠️ Admin login failed", + "notif_evt_device_blocked": "🛑 Device blocked or unblocked", + "notif_evt_device_connected": "📶 Reconnection of a known Wi-Fi device", + "notif_evt_device_disconnected": "📴 Wi-Fi device disconnection", + "notif_evt_new_device": "📱 New Wi-Fi device (first connection)", + "notif_evt_quota_exceeded": "⚖️ Data quota exceeded by a device", + "notif_evt_settings_changed": "⚙️ Wi-Fi / AP settings changed", + "notif_evt_stats_report": "📊 Statistics & metrics report (Cron task)", + "notif_evt_vpn_client_connected": "🛡️ Client routed via VPN", + "notif_evt_vpn_client_disconnected": "🌐 Client disconnected / removed from VPN", + "notif_evt_vpn_profile_connected": "🛡️ VPN profile connected (active tunnel)", + "notif_evt_vpn_profile_disconnected": "⚠️ VPN profile disconnected (tunnel down)", + "notif_gotify_alert_box": "⚠️ Important for Gotify 3.1.1: The token must come from the Gotify APPS tab (starting with gtfya... in v3 or A... in v2). Tokens from the CLIENTS tab (starting with gtfyc... or C...) cannot publish alerts. HTTPS with self-signed certificates is supported.", + "notif_gotify_compat_desc": "Lightweight and instant self-hosted push server (Compatible Gotify 3.1.1+)", + "notif_gotify_desc": "Lightweight and instant self-hosted push server (Compatible Gotify v2 & v3.1.1+)", + "notif_gotify_enable": "Enable Gotify", + "notif_gotify_hint": "The token must come from the Gotify APPS tab (starting with A...). CLIENTS tokens do not work for posting messages.", + "notif_gotify_important": "Important for Gotify 3.1.1:", + "notif_gotify_priority_label": "Priority (1 - 10)", + "notif_gotify_priority_range": "Priority (1 - 10)", + "notif_gotify_test_btn": "Test Gotify", + "notif_gotify_title": "Gotify Notification", + "notif_gotify_token_apps": "Application Token (APPS Token)", + "notif_gotify_token_label": "Application Token (APPS Token)", + "notif_gotify_url_label": "Gotify Server URL", + "notif_ntfy_desc": "Push notifications via ntfy.sh or self-hosted server", + "notif_ntfy_enable": "Enable ntfy", + "notif_ntfy_priority_label": "Priority (1 - 5)", + "notif_ntfy_priority_range": "Priority (1 - 5)", + "notif_ntfy_server_desc": "Push notifications via ntfy.sh or self-hosted server", + "notif_ntfy_server_label": "ntfy Server", + "notif_ntfy_test_btn": "Test ntfy", + "notif_ntfy_title": "ntfy.sh Notification", + "notif_ntfy_token_label": "Token / Password (optional for private topic)", + "notif_ntfy_token_opt": "Token / Password (optional for private topic)", + "notif_ntfy_topic_label": "Topic (Subject)", + "notif_ntfy_url_label": "Server URL", + "notif_pushbullet_desc": "Instant push on phones, tablets, and browsers", + "notif_pushbullet_device_iden": "Device ID (Device Iden, optional — leave blank for all)", + "notif_pushbullet_device_label": "Device ID (Device Iden, optional — leave blank for all)", + "notif_pushbullet_devices_desc": "Instant push on phones, tablets, and browsers", + "notif_pushbullet_enable": "Enable Pushbullet", + "notif_pushbullet_test_btn": "Test Pushbullet", + "notif_pushbullet_title": "Pushbullet Notification", + "notif_pushbullet_token_access": "Access Token (Access Token)", + "notif_pushbullet_token_label": "Access Token", + "notif_pushover_desc": "Push for Android, iOS, and Desktop", + "notif_pushover_devices_desc": "Push for Android, iOS, and Desktop", + "notif_pushover_enable": "Enable Pushover", + "notif_pushover_priority_label": "Priority (-2 to 2: 0 = Normal, 1 = High)", + "notif_pushover_test_btn": "Test Pushover", + "notif_pushover_title": "Pushover Notification", + "notif_pushover_token_label": "Application Token (API Token)", + "notif_pushover_user_label": "User Key", + "notif_save_btn": "Save notifications", + "notif_slack_bot_label": "Bot sender name (optional)", + "notif_slack_desc": "Alerts on a Slack channel via Incoming Webhook", + "notif_slack_enable": "Enable Slack", + "notif_slack_incoming_desc": "Alerts on a Slack channel via Incoming Webhook", + "notif_slack_sender_name": "Bot sender name (optional)", + "notif_slack_test_btn": "Test Slack", + "notif_slack_title": "Slack Notification", + "notif_slack_url_label": "Slack Incoming Webhook URL", + "notif_slack_webhook_url_label": "Slack Incoming Webhook URL", + "notif_telegram_chat_full": "Discussion Identifier (Chat ID)", + "notif_telegram_chat_label": "Discussion Identifier (Chat ID)", + "notif_telegram_desc": "Instant alerts via Telegram bot (channel, group, or direct)", + "notif_telegram_enable": "Enable Telegram", + "notif_telegram_test_btn": "Test Telegram", + "notif_telegram_thread_label": "Topic / Thread (Optional)", + "notif_telegram_title": "Telegram Notification", + "notif_telegram_token_father": "Bot Token (Bot Token @BotFather)", + "notif_telegram_token_label": "Bot Token (@BotFather)", + "notif_test_all": "🧪 Test all active channels", + "notif_tmpl_customize": "Customize ▾", + "notif_tmpl_main_desc": "Customize alert title and text. Click a variable to insert it into the message.", + "notif_tmpl_main_title": "Alert Messages Customization", + "notif_tmpl_msg_label": "Message Content", + "notif_tmpl_reset_btn": "↺ Reset to Default", + "notif_tmpl_title_label": "Title / Subject", + "notif_tmpl_toggle_collapse": "Collapse All", + "notif_tmpl_toggle_expand": "Expand All", + "notif_tmpl_vars_label": "Variables:", + "notif_webhook_desc": "Universal REST / JSON Integration", + "notif_webhook_headers_label": "Custom HTTP Headers (JSON)", + "notif_webhook_test_btn": "Test Webhook", + "notif_webhook_title": "Custom Webhook (HTTP POST)", + "notif_webhook_url_label": "Webhook URL", + "packet_all_kept": "All packets retained", + "packet_btn_stop": "■ Stop", + "packet_bytes_unit": "bytes", + "packet_captured_label": "Captured Packets", + "packet_destination": "Destination:", + "packet_details_title": "Packet Details #", + "packet_domain": "Domain / Host:", + "packet_domains_label": "Detected Domains", + "packet_hexdump": "Hexadecimal & ASCII Dump (Wireshark):", + "packet_iface_info": "Wi-Fi Interface: —", + "packet_layers": "Network Layers Decoding:", + "packet_pcap_format": "Libpcap 2.4 format (Wireshark)", + "packet_pcap_size_label": "PCAP Export Size", + "packet_protocols_label": "Detected Protocols", + "packet_quick_filters": "Quick filters:", + "packet_size": "Size:", + "packet_source": "Source:", + "packet_status_analyzer": "Wireshark Analyzer Status", + "packet_time": "Time:", + "packet_unique_domains": "Unique domain names", + "packets_count_plural": "packets", + "packets_count_singular": "packet", + "page_x_of_y": "Page {p} of {total}", + "pcap_export_csv_title": "Export as CSV", + "pcap_export_pcap_title": "Download .pcap file compatible with Wireshark Desktop", + "pcap_stop_capture_title": "Stop Wireshark packet capture", + "placeholder_0_unlimited": "0 for unlimited", + "placeholder_current_pwd": "Current password", + "placeholder_dev_desc": "e.g. PlayStation, Xbox, Switch...", + "placeholder_dev_icon": "Emoji (📱, 💻...) or SVG code", + "placeholder_dev_id": "e.g. console, robot, iot...", + "placeholder_dev_label": "e.g. Gaming console, Robot vacuum...", + "placeholder_email_pass": "Password or app password", + "placeholder_filter_clients": "Filter by name, MAC address, IP, profile...", + "placeholder_filter_packets": "Filter packets or domain (e.g. google.com, dns, icmp, 10.42.0.1...)", + "placeholder_icon_search": "Search (e.g. laptop, wifi, console, camera, robot, apple...)", + "placeholder_my_wifi": "My Wi-Fi Network", + "placeholder_new_pwd": "New password", + "placeholder_pwd_confirm": "Confirm password", + "placeholder_pwd_min8": "8 characters minimum", + "placeholder_totp_code": "6-digit TOTP code or backup code", + "placeholder_trusted_proxies": "e.g. 172.18.0.0/16, 192.168.1.254, 10.0.4.1", + "placeholder_vpn_config": "Paste or import WireGuard or OpenVPN file content...", + "placeholder_vpn_name": "e.g. ProtonVPN Paris, Mullvad WG, NordVPN...", + "placeholder_vpn_pass": "Leave blank if unchanged", + "placeholder_vpn_user": "VPN Username", + "prompt_device_name": "Enter a custom name for this device:", + "protocol_label": "Protocol", + "proxy_auto_hint": "In automatic mode, the system inspects standard headers in order and uses the most reliable IP address.", + "proxy_auto_hint_full": "In automatic mode, the system inspects Cloudflare, X-Forwarded-For (first non-proxy client IP), and then X-Real-IP headers in order.", + "proxy_enable_desc": "When this option is enabled, AP Manageur extracts the real client IP address from the HTTP headers forwarded by your Reverse Proxy instead of the proxy internal IP.", + "proxy_enable_desc_full": "When this option is enabled, AP Manageur extracts the real client machine IP address from HTTP headers forwarded by your reverse proxy instead of recording the local proxy IP itself.", + "proxy_examples_desc": "To configure your reverse proxy to correctly forward client machine IPs:", + "proxy_examples_desc_full": "To ensure your reverse proxy correctly forwards client machine IPs to AP Manageur, make sure to configure these headers:", + "proxy_examples_title": "💡 Configuration Examples for your Reverse Proxy", + "proxy_label_cf_ip": "Cloudflare Header (CF-Connecting-IP):", + "proxy_label_host": "Host:", + "proxy_label_raw_socket_ip": "RAW RECEIVED IP (PROXY OR SOCKET)", + "proxy_label_real_client_ip": "RECORDED REAL CLIENT IP", + "proxy_label_xff": "X-FORWARDED-FOR HEADER", + "proxy_label_xrealip": "X-REAL-IP HEADER", + "proxy_live_diag_badge": "● Active detection", + "proxy_live_diag_title": "🔍 Live IP Detection (Your Current Connection)", + "proxy_opt_auto": "Intelligent Auto-detection (Recommended: CF > XFF > X-Real-IP)", + "proxy_opt_cf": "CF-Connecting-IP (Cloudflare Specific)", + "proxy_opt_xrealip": "X-Real-IP (Common with Nginx / Apache)", + "proxy_trusted_desc": "Allows proxy headers originating from RFC1918 private networks and Docker containers (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x).", + "proxy_trusted_desc_full": "Allows proxy headers originating from local private networks (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.1). Recommended if your reverse proxy is a Docker container or LAN gateway.", + "proxy_trusted_ips_hint": "Separate multiple IP addresses or CIDR subnets with commas or newlines.", + "proxy_trusted_ips_hint_full": "Separate multiple IP addresses or CIDR subnets with commas or newlines. If your proxy is not on a private IP, you MUST specify its public IP here to prevent IP spoofing.", + "qr_info": "The QR code uses the real SSID and password of the AP.", + "qr_pwd_label": "Password retrieved via API", + "qr_title": "Join Network", + "rate_down": "Download speed", + "rate_up": "Upload speed", + "rename_device": "Rename this device", + "rename_device_attr": "Rename this device", + "rename_passkey": "Rename this security key", + "sessions_loading": "Loading sessions…", + "settings_2fa_confirm_btn": "Verify 2FA Code", + "settings_2fa_copy_btn": "📋 Copy Codes", + "settings_2fa_disable_btn": "Disable 2FA", + "settings_2fa_download_btn": "💾 Download (.txt)", + "settings_2fa_enable_btn": "Enable 2FA", + "settings_2fa_qr_desc": "Scan this QR code with your authenticator app, or enter the key manually:", + "settings_2fa_recovery_desc": "Keep these 8 codes in a safe place. Each code allows single-use emergency login.", + "settings_2fa_recovery_title": "⚠️ Recovery Codes (Backup)", + "settings_2fa_regen_btn": "Regenerate Codes", + "settings_2fa_title": "Two-Factor Authentication (2FA) & Backup Codes", + "twofa_loading": "Loading…", + "twofa_state_disabled": "Disabled.", + "twofa_state_enabled": "Enabled: a TOTP code or backup code will be required at each login. (Remaining backup codes: {rem} / 8)", + "twofa_state_pending": "Setup in progress: scan the QR code and enter the 6-digit code from your app.", + "session_current_badge": "● Current", + "session_unknown_machine": "Unknown machine", + "session_browser_default": "Web Browser", + "session_no_active": "No active sessions found", + "session_load_failed": "Failed to load sessions", + "session_rename_prompt": "Enter a custom name for this machine:", + "session_rename_saving": "Saving name…", + "session_renamed_success": "Machine renamed successfully!", + "session_revoke_confirm_current": "Disconnect this current session? You will be immediately redirected to the login page.", + "session_revoke_confirm_other": "Force disconnection of device \"{device}\" ({ip})?", + "session_revoke_progress": "Disconnecting session…", + "session_revoked_success": "Session disconnected successfully.", + "rename_session_device": "Rename this device", + "passkey_empty": "No Passkey registered yet. Click \"➕ Register a new Passkey\" above to link your fingerprint (Touch ID / Windows Hello), Face ID or hardware key (YubiKey).", + "passkey_never": "Never", + "passkey_biometric_desc": "Biometric security / FIDO2", + "passkey_load_failed": "Failed to load Passkeys", + "passkey_not_supported_alert": "⚠️ Your browser does not support WebAuthn / Passkeys API or you are on an insecure connection (HTTPS or localhost required).", + "passkey_not_supported_row": "Browser or context not compatible with WebAuthn", + "rename_passkey_tooltip": "Rename this security key", + "passkey_rename_prompt": "Enter the new name for the security key:", + "passkey_rename_empty_alert": "The security key name cannot be empty.", + "passkey_rename_saving": "Saving new name…", + "passkey_renamed_success": "Key renamed successfully!", + "passkey_delete_confirm": "Are you sure you want to delete the Passkey \"{name}\"?", + "passkey_register_success": "Passkey registered successfully!", + "unknown_m": "Unknown", + "settings_admin_confirm_pwd": "Confirm Password", + "settings_admin_confirm_pwd_label": "Confirm Password", + "settings_admin_current_pwd": "Current Password", + "settings_admin_current_pwd_label": "Current Password", + "settings_admin_new_pwd": "New Password", + "settings_admin_new_pwd_label": "New Password", + "settings_admin_save_btn": "Update Credentials", + "settings_admin_sub": "Update username and password for dashboard access.", + "settings_admin_subtitle": "Change login username and password for the dashboard.", + "settings_admin_title": "Admin Account", + "settings_admin_user_label": "Administrator Username", + "settings_admin_username": "Admin Username", + "settings_autoconnect": "Start automatically on boot", + "settings_bridge_desc": "Wi-Fi clients will receive their IP addresses directly from your internet gateway router.", + "settings_bridge_eth_label": "Gateway Ethernet interface (bridge mode)", + "settings_max_clients_label": "Simultaneous clients limit (0 = unlimited)", + "settings_mode_label": "Operating Mode", + "settings_notif_desc": "Receive real-time alerts via Email, Gotify, Discord, or other services on critical events or quota exceeded.", + "settings_notif_save_btn": "Save Notifications", + "settings_notif_sub": "Receive real-time alerts via Email, Gotify, or Discord upon network or access events.", + "settings_notif_subtab_alerts": "✏️ Alert Customization", + "settings_notif_subtab_services": "📡 Notification Services", + "settings_notif_tab_alerts": "Alert Customization", + "settings_notif_tab_services": "Notification Services (9)", + "settings_notif_test_all": "🧪 Test All Active Channels", + "settings_notif_title": "Notifications & Alerts", + "settings_passkeys_add_btn": "➕ Register a New Passkey", + "settings_passkeys_desc": "Log in instantly without password and without 2FA codes using Touch ID, Face ID, Windows Hello, or a physical USB key (YubiKey).", + "settings_passkeys_loading": "Loading Passkeys…", + "settings_passkeys_title": "🔑 Security Keys & Passkeys (FIDO2 / Biometrics)", + "settings_proxy_btn_test": "🔄 Test detection", + "settings_proxy_desc": "Configure detection of real client IP addresses when your Access Point is behind a reverse proxy (Nginx, Traefik, Caddy, Cloudflare, HAProxy, etc.). This ensures logs and sessions display the client's actual IP rather than the proxy's IP.", + "settings_proxy_diag_active": "● Detection active", + "settings_proxy_diag_raw": "RAW IP RECEIVED (PROXY OR SOCKET)", + "settings_proxy_diag_real": "RECORDED REAL CLIENT IP", + "settings_proxy_diag_title": "🔍 Live IP Detection (Your current connection)", + "settings_proxy_diag_xff": "X-FORWARDED-FOR HEADER", + "settings_proxy_diag_xri": "X-REAL-IP HEADER", + "settings_proxy_enable_chk": "Enable Reverse Proxy support", + "settings_proxy_enable_desc": "When enabled, AP Manager extracts the real client machine IP address from HTTP headers sent by your reverse proxy instead of logging the local IP of the proxy itself.", + "settings_proxy_examples_title": "💡 Configuration examples for your Reverse Proxy", + "settings_proxy_header_label": "Priority HTTP header for real IP", + "settings_proxy_save_btn": "💾 Save proxy settings", + "settings_proxy_title": "🔀 Reverse Proxy Configuration", + "settings_proxy_trust_private": "Trust all private networks and Docker containers", + "settings_proxy_trusted_ips_label": "Additional trusted proxy IP addresses or CIDR ranges", + "settings_pwd_label": "Wi-Fi Password", + "settings_save_wifi": "Save Settings", + "settings_security_label": "Wi-Fi Security", + "settings_sessions_desc": "Devices and browsers currently logged in with administrator credentials.", + "settings_sessions_loading": "Loading sessions…", + "settings_sessions_title": "Sessions Connected to Admin Account", + "settings_show_confirm_pwd": "Show password confirmation", + "settings_show_cur_pwd": "Show current password", + "settings_show_key": "Show key", + "settings_show_new_pwd": "Show new password", + "settings_show_token": "Show token", + "settings_ssid_label": "SSID Name", + "settings_tab_admin": "Admin Account", + "settings_tab_custom": "Customization", + "settings_tab_danger": "Danger Zone", + "settings_tab_notif": "Notifications", + "settings_tab_proxy": "Reverse Proxy", + "settings_tab_vpn": "VPN Profiles", + "settings_tab_wifi": "Wi‑Fi & Network", + "settings_vpn_add_btn": "➕ Add VPN Profile", + "settings_vpn_direct_clients": "Direct WAN Clients", + "settings_vpn_empty_desc": "Import a .conf (WireGuard) or .ovpn (OpenVPN) file to get started.", + "settings_vpn_empty_title": "No VPN profiles configured", + "settings_vpn_killswitch_active": "Active Kill-Switches", + "settings_vpn_profiles_count": "Available VPN Profiles", + "settings_vpn_routed_clients": "Clients Routed via VPN", + "settings_vpn_sub": "Manage VPN profiles to route Wi-Fi client traffic through encrypted tunnels.", + "settings_vpn_subtitle": "Manage your VPN profiles to route client traffic and secure communications.", + "settings_vpn_title": "WireGuard & OpenVPN Profiles", + "settings_wifi_autoconnect": "Start automatically on boot", + "settings_wifi_eth": "Router Ethernet Interface (bridge mode)", + "settings_wifi_max_clients": "Max concurrent clients (0 = unlimited)", + "settings_wifi_mode": "Operating Mode", + "settings_wifi_pwd": "Wi-Fi Password", + "settings_wifi_save_btn": "Save Settings", + "settings_wifi_security": "Wi-Fi Security", + "settings_wifi_ssid": "SSID Name", + "settings_wifi_sub": "Changes will restart the active Wi-Fi connection.", + "settings_wifi_subtitle": "Changes will restart the active Wi-Fi connection.", + "settings_wifi_title": "AP Settings", + "setup_create_btn": "Create Network", + "setup_eth_desc": "Wi-Fi clients will receive IP addresses directly from your home router/modem.", + "setup_eth_label": "Router Ethernet Interface (bridge mode)", + "setup_intro": "No Wi-Fi network configured. Create your access point with an SSID and password.", + "setup_max_clients_label": "Max concurrent clients (0 = unlimited)", + "setup_mode_ap": "AP Mode (Router)", + "setup_mode_ap_desc": "Internal DHCP (10.42.0.x) & NAT", + "setup_mode_bridge": "Bridge Mode", + "setup_mode_bridge_desc": "Uses modem/router DHCP", + "setup_mode_label": "Operating Mode", + "setup_notice": "Required specifications: SSID from 1 to 32 characters, WPA password from 8 to 63 characters. Network will start automatically on boot.", + "setup_notice_req": "Required Specifications
SSID: 1 to 32 characters.
WPA Password: 8 to 63 characters, recommended with letters, numbers, and symbols.
The network will be started automatically upon system boot.", + "setup_pwd_confirm_label": "Confirm Wi-Fi Password", + "setup_pwd_label": "Wi-Fi Password", + "setup_security_label": "Wi-Fi Security", + "setup_ssid_label": "SSID Name", + "setup_submit": "Create Network", + "setup_title": "Initial Setup", + "signal_excellent": "Excellent", + "signal_fair": "Fair", + "signal_good": "Good", + "signal_weak": "Weak", + "stats_chart_sub_day": "Traffic per hour (today)", + "stats_chart_subtitle_day": "Traffic by hour (today)", + "stats_chart_title": "Traffic & Connections", + "stats_chart_total_connections": "Total connections", + "stats_chart_unique_devices": "Unique devices", + "stats_connections_total": "total connection(s)", + "stats_cron_day_all": "Every day (*)", + "stats_cron_day_label": "📅 Execution Day", + "stats_cron_day_workdays": "Workdays (Monday to Friday)", + "stats_cron_desc": "Configure automatic delivery periodicity (Day, Hour, Minute)", + "stats_cron_range_all": "All periods (Day, Week, Month, Year)", + "stats_cron_range_day": "Today (Daily)", + "stats_cron_range_month": "This month (Monthly)", + "stats_cron_range_week": "This week (Weekly)", + "stats_cron_range_year": "This year (Yearly)", + "stats_cron_send_now_btn": "Send Report Now (Test)", + "stats_cron_tab_title": "📊 Scheduled Statistics & Metrics Report (Cron Task)", + "stats_cron_title": "Statistical Report Cron Scheduling", + "stats_cron_top_range_label": "📊 Top Clients Range", + "stats_current_slot_badge": "● Current slot", + "stats_details_title": "Connection Details", + "stats_loading": "Loading…", + "stats_no_data": "No statistics available", + "stats_range_day": "Daily", + "stats_range_month": "Monthly", + "stats_range_week": "Weekly", + "stats_range_year": "Yearly", + "stats_report_cron_default": "📅 Every day at 08:00", + "stats_report_cron_expr_label": "⚙️ Calculated Cron Expression", + "stats_report_hour_label": "🕐 Hour (00 - 23)", + "stats_report_minute_label": "⏱️ Minute (00 - 59)", + "stats_subtab_metrics": "Traffic & Metrics", + "stats_subtab_topology": "Network Topology", + "stats_this_month": "This month", + "stats_this_week": "This week", + "stats_this_year": "This year", + "stats_tip_clients": "unique client(s)", + "stats_tip_connections": "connection(s)", + "stats_today": "Today", + "stats_top_clients_sub": "Devices with highest data usage today (Daily)", + "stats_top_clients_title": "Top Clients (Data Usage)", + "stats_upcoming": "(Upcoming)", + "status_active": "Active", + "status_blocked": "Blocked", + "status_connected": "Connected", + "status_disconnected": "Disconnected", + "status_error": "Error", + "status_inactive": "Inactive", + "status_offline": "Offline", + "status_offline_conn": "Offline", + "status_online": "Online", + "status_online_live": "Live", + "currently_online": "Currently online", + "unknown_f": "Unknown", + "stored_in_db": "Stored in DB", + "th_action": "ACTION", + "th_actions": "ACTIONS", + "th_added_date": "DATE ADDED", + "th_blocked_on": "BLOCKED ON", + "th_browser": "BROWSER", + "th_cat_desc": "DESCRIPTION", + "th_cat_id": "IDENTIFIER", + "th_cat_name": "CATEGORY NAME", + "th_category_desc": "DESCRIPTION", + "th_category_id": "IDENTIFIER", + "th_category_name": "CATEGORY NAME", + "th_date": "DATE", + "th_device": "DEVICE", + "th_domain": "DOMAIN NAME", + "th_downloaded": "DOWNLOADED (↓)", + "th_dst": "DESTINATION", + "th_effective_status": "EFFECTIVE STATUS", + "th_event": "EVENT", + "th_first_connection": "FIRST SEEN", + "th_identified_devices": "IDENTIFIED DEVICES", + "th_info": "INFO & DETAILS", + "th_ip": "IP", + "th_ip_mac": "IP & MAC ADDRESSES", + "th_killswitch": "KILL-SWITCH", + "th_last_activity": "LAST ACTIVITY", + "th_last_ip": "LAST IP", + "th_last_used": "LAST USED", + "th_logo": "LOGO", + "th_mac": "MAC ADDRESS", + "th_num": "NO.", + "th_os": "OPERATING SYSTEM", + "th_passkey_name": "PASSKEY NAME", + "th_period": "PERIOD", + "th_proto": "PROTO", + "th_quota": "QUOTA & SPEED", + "th_routing": "INTERNET ROUTING", + "th_signal": "SIGNAL", + "th_size": "SIZE", + "th_speed": "SPEED (REAL TIME)", + "th_src": "SOURCE", + "th_status": "CURRENT STATUS", + "th_time": "TIME", + "th_total_connections": "TOTAL CONNECTIONS", + "th_total_transferred": "TOTAL TRANSFERRED", + "th_unique_devices": "UNIQUE DEVICES", + "th_uploaded": "UPLOADED (↑)", + "th_vpn_assigned": "ASSIGNED VPN PROFILE", + "top_clients_sub_day": "Top consuming devices today (Daily)", + "top_clients_sub_month": "Top consuming devices this month (Monthly)", + "top_clients_sub_week": "Top consuming devices this week (Weekly)", + "top_clients_sub_year": "Top consuming devices this year (Yearly)", + "topo_ap_status": "AP: wlan0 (Channel 6)", + "topo_ap_title": "Wi-Fi AP", + "topo_blocked_devices": "Blocked / Isolated Devices", + "topo_clients_connected": "{count} connected", + "topo_clients_connected_count": "0 connected", + "topo_device_repartition": "Device Breakdown", + "topo_direct_wan": "Direct WAN (Gateway)", + "topo_down_tx": "Cumulative Download Speed (TX)", + "topo_export": "Export Topology ▾", + "topo_export_jpg": "📷 JPG Format (.jpg)", + "topo_export_png": "🖼️ PNG Format (.png)", + "topo_gateway": "Internet Gateway", + "topo_gateway_online": "Gateway: Online", + "topo_gateway_standby": "Gateway: Standby", + "topo_gateway_title": "Internet Gateway", + "topo_legend_fair": "● Fair (-70 dBm)", + "topo_legend_good": "● Good (-60 dBm)", + "topo_legend_links": "Links:", + "topo_legend_vpn": "● Red: Active VPN tunnel", + "topo_legend_weak": "● Weak (< -70 dBm)", + "topo_legend_wifi_good": "● Green: Wi-Fi > -50 dBm", + "topo_link_excellent": "● Green: Wi‑Fi > -50 dBm", + "topo_link_fair": "● Fair (-70 dBm)", + "topo_link_good": "● Good (-60 dBm)", + "topo_link_vpn": "● Red: Active VPN tunnel", + "topo_link_weak": "● Weak (< -70 dBm)", + "topo_link_wifi": "● Green: Wi-Fi > -50 dBm", + "topo_links_legend": "Links:", + "topo_live_badge": "Live", + "topo_live_bandwidth": "Live Bandwidth", + "topo_mac_filtering": "Hardware filtering by MAC address", + "topo_modal_ap_title": "Wi-Fi Access Point (AP Manager)", + "topo_modal_title": "Device Inspection", + "topo_modal_wan_title": "Internet Gateway (WAN)", + "topo_no_clients": "No clients connected", + "topo_no_clients_desc": "No clients connected", + "topo_search_ph": "Filter a device (name, IP, MAC)…", + "topo_security_filtering": "Security & Filtering", + "topo_sig_excellent": "● Excellent", + "topo_sig_fair": "● Fair", + "topo_sig_good": "● Good", + "topo_sig_weak": "● Weak", + "topo_signal_quality": "Wi-Fi Signal Quality", + "topo_status_wan": "Gateway: Online", + "topo_subtitle": "Real-time interactive mapping of devices and network links", + "topo_title": "Wi-Fi Network Topology", + "topo_up_rx": "Cumulative Upload Speed (RX)", + "topo_vpn_active": "🛡️ VPN: {count} active", + "topo_vpn_active_badge": "🛡️ VPN: {n} active", + "topo_wan_gateway_label": "Internet Gateway", + "topo_wan_link": "⚡ Wired Link / WAN", + "topo_wan_link_badge": "⚡ Wired Link / WAN", + "topo_wifi_links": "📶 Wireless Wi‑Fi Links (802.11)", + "topo_wifi_links_label": "📶 Wireless Wi-Fi Links (802.11)", + "twofa_download_codes_btn": "💾 Download Recovery Codes", + "twofa_help_text": "The current password entered above and a code (TOTP or backup) are required.", + "twofa_key_label": "Key:", + "twofa_qr_scan_prompt": "Scan this QR code with your authenticator app, or enter the key manually:", + "twofa_recovery_desc": "Keep these 8 codes in a safe place. If you lose your TOTP app, each code can only be used once.", + "twofa_recovery_title": "⚠️ Recovery Codes (Backup)", + "unblock": "Unblock", + "unknown_client": "Unknown name", + "unlimited": "Unlimited", + "view_config": "View Configuration", + "vpn_add_first_profile_btn": "Add First Profile", + "vpn_add_profile_btn": "Add VPN Profile", + "vpn_assigned_offline": "🛡️ Assigned to", + "vpn_auth_pass_label": "Password", + "vpn_auth_user_label": "Username", + "vpn_auto_test_5min": "Automatic test run every 5 min", + "vpn_autoconnect_badge": "⚡ Auto-connect active", + "vpn_block_if_down": "Block if down", + "vpn_btn_filter_online": "🟢 Online", + "vpn_btn_filter_routed": "🛡️ Routed", + "vpn_clients_empty_msg": "No Wi-Fi devices detected at this time.", + "vpn_direct": "🌐 Direct WAN Connection (No VPN)", + "vpn_killswitch_blocked": "⚠️ Blocked (Kill-Switch)", + "vpn_killswitch_chk": "Block if disconnected", + "vpn_lan_isolated": "🔒 LAN Isolated", + "vpn_lan_isolated_title": "Local network unreachable (LAN isolation active)", + "vpn_lan_isolated_tooltip": "Local network unreachable (LAN Isolation active)", + "vpn_modal_title": "Add VPN Profile", + "vpn_no_profiles_desc": "Import a .conf (WireGuard) or .ovpn (OpenVPN) file to begin routing your devices.", + "vpn_no_profiles_title": "No VPN profiles configured", + "vpn_offline_wan": "⚪ Offline (Direct WAN)", + "vpn_pending_test": "⚠️ Awaiting test", + "vpn_profile_name_label": "Profile Name", + "vpn_profile_type_label": "Protocol Type", + "vpn_public_ip_label": "VPN Public IP:", + "vpn_routed_tooltip": "Routed via VPN", + "vpn_routed_via": "🟢 Routed via", + "vpn_test_btn": "🔄 Test", + "vpn_test_tooltip": "Test connection and refresh public IP", + "vpn_traffic_encrypted_via": "Traffic encrypted via", + "vpn_view_config": "View configuration", + "vpn_wan_direct": "🌐 Direct WAN", + "vpn_wan_direct_down": "⚠️ Direct WAN (VPN inactive)", + "vpn_card_interface": "Interface:", + "vpn_card_table_pbr": "PBR Table:", + "vpn_card_transfer": "Transfer:", + "vpn_last_test": "Last test:", + "vpn_handshake_active": "Active handshake ({sec}s ago)", + "vpn_handshake_recent": "Last handshake {min} min ago", + "vpn_handshake_older": "Last handshake {h} h ago", + "vpn_handshake_waiting": "Waiting for handshake (not received)", + "vpn_error_prefix": "Error:", + "vpn_connected_suffix": "connected", + "vpn_protocol_label": "Protocol:", + "status_connecting": "Connecting...", + "btn_test": "Test", + "vpn_modal_edit_title": "Edit VPN Profile: {name}", + "vpn_err_enter_name": "Please enter a name for this profile.", + "vpn_err_enter_config": "Please paste or import the VPN configuration.", + "vpn_btn_saving": "Saving...", + "vpn_delete_confirm": "Are you sure you want to delete the VPN profile \"{name}\"?\\nAll assigned clients will revert to Direct WAN connection.", + "vpn_view_modal_title": "VPN Configuration: {name} ({type})", + "vpn_copied_btn": "✓ Copied!", + "vpn_ip_detected": "VPN public IP detected: {ip}", + "vpn_ip_error": "Unable to get public IP via this VPN profile", + "btn_block": "Block", + "btn_block_action": "🚫 Block", + "btn_block_this_device": "🚫 Block this device", + "btn_details": "🔍 Details", + "btn_manage_vpn_routing": "⚙️ Manage VPN routing", + "btn_unblock": "Unblock", + "client_unknown": "Unknown client", + "mode_bridge_label": "Network Bridge (Bridge)", + "mode_nat_label": "Access Point (Wi-Fi Router)", + "stats_today_from_to": "Today from {start} to {end}", + "topo_active_clients_count": "{n} active client(s)", + "topo_channel": "Channel", + "topo_devices_routed_tunnel": "{count} device(s) routed via this tunnel", + "topo_ip_bridge_lan": "LAN Bridge IP", + "topo_modal_connected_devs": "CONNECTED DEVICES", + "topo_modal_dev_details": "Device Details: {name}", + "topo_modal_dev_name": "DEVICE NAME", + "topo_modal_dns_servers": "DNS SERVERS", + "topo_modal_gw_ip": "GATEWAY IP ADDRESS", + "topo_modal_hw_type": "HARDWARE TYPE", + "topo_modal_inst_speed": "INSTANT THROUGHPUT", + "topo_modal_ip_addr": "IP ADDRESS", + "topo_modal_live_speed": "LIVE THROUGHPUT", + "topo_modal_local_ip": "AP LOCAL IP", + "topo_modal_mac_addr": "MAC ADDRESS", + "topo_modal_net_mode": "NETWORK MODE", + "topo_modal_out_iface": "OUTGOING INTERFACE", + "topo_modal_pbr_table": "KERNEL PBR TABLE", + "topo_modal_prof_name": "PROFILE NAME", + "topo_modal_public_ip": "TUNNEL PUBLIC IP", + "topo_modal_radio_channel": "RADIO & CHANNEL", + "topo_modal_routed_devs": "ROUTED DEVICES", + "topo_modal_routing_vpn": "INTERNET / VPN ROUTING", + "topo_modal_security": "SECURITY", + "topo_modal_sig_quality": "SIGNAL QUALITY", + "topo_modal_ssid": "SSID NAME", + "topo_modal_sys_iface": "SYSTEM INTERFACE", + "topo_modal_vpn_desc": "All Internet traffic from devices associated with this profile is encrypted and routed exclusively through this VPN tunnel.", + "topo_modal_vpn_proto": "VPN PROTOCOL", + "topo_modal_vpn_title": "VPN Tunnel: {name}", + "topo_modal_wan_desc": "The gateway provides Internet connectivity for all devices connected to the Wi-Fi access point via routing and NAT address translation.", + "topo_modal_wan_status": "WAN STATUS", + "topo_modal_wifi_iface": "WIRELESS INTERFACE", + "topo_no_clients_title": "No devices connected to the access point", + "topo_tunnel_active": "Active tunnel", + "topo_tunnel_encrypted_ok": "Encrypted tunnel operational", + "vpn_status_disconnected_short": "(Down)", + "btn_hide_token": "Hide Token", + "btn_show_token": "Show Token", + "backup_no_pending": "No pending backup data.", + "backup_select_one_category": "Please select at least one category of items to restore.", + "backup_confirm_restore_auth": "⚠️ WARNING: You chose to restore administrator account data. This will overwrite current credentials, passwords, and passkeys. Do you want to continue?", + "backup_restoring": "Restoring in progress…", + "backup_applying_to_db": "Applying backup into database…", + "backup_downloaded_success": "✓ Full backup downloaded ({size} KB)! Contains JSON configuration and raw SQLite database.", + "backup_export_err": "Export error: ", + "backup_invalid_file": "The selected file does not appear to be a valid AP Manageur backup (backup keys not found).", + "backup_json_read_err": "Error reading JSON file: ", + "backup_read_file_err": "Unable to read selected file.", + "backup_parse_err": "Backup parsing error: ", + "passkey_https_alert": "Passkeys require a modern browser and a secure context (HTTPS or localhost).", + "passkey_register_prompt": "Enter a name for this Passkey (e.g. MacBook Touch ID, iPhone Face ID, YubiKey 5C):", + "passkey_waiting_validation": "Waiting for biometric or physical verification on your device…", + "passkey_register_err": "Passkey registration error: ", + "twofa_codes_downloaded": "Recovery codes file downloaded!", + "twofa_codes_generating_dl": "Generating and downloading recovery codes…", + "twofa_codes_generating": "Generating new recovery codes…", + "err_enter_current_pwd": "Enter your current admin password", + "notif_testing_progress": "⏳ Sending test notification…", + "notif_testing_btn": "Testing in progress…", + "notif_test_success": "Test succeeded!", + "notif_test_partial_failure": "Some tests failed", + "notif_test_err": "❌ Test error: ", + "stats_cron_day_weekend": "Weekend (Saturday & Sunday)", + "stats_cron_day_mon": "Every Monday", + "stats_cron_day_tue": "Every Tuesday", + "stats_cron_day_wed": "Every Wednesday", + "stats_cron_day_thu": "Every Thursday", + "stats_cron_day_fri": "Every Friday", + "stats_cron_day_sat": "Every Saturday", + "stats_cron_day_sun": "Every Sunday", + "stats_cron_expr_label": "⚙️ Standard Cron Expression", + "stats_cron_format_hint": "Cron format: minute hour day month day_of_week (e.g. 0 8 * * * = 08:00 every day, 30 18 * * 5 = 18:30 every Friday).", + "stats_cron_hourly_at": "every hour at :{min}", + "stats_cron_at_time": "at {time}", + "stats_cron_day_all_short": "Every day", + "stats_cron_day_workdays_short": "Workdays (Mon-Fri)", + "stats_cron_day_weekend_short": "Weekend (Sat-Sun)", + "stats_cron_day_prefix": "Day ", + "stats_report_sending": "⏳ Sending statistics report…", + "proxy_label_proto": "Upstream protocol (X-Forwarded-Proto):", + "proxy_opt_xff": "X-Forwarded-For (Standard RFC 7239 / Nginx / Traefik / Caddy)", + "proxy_opt_true_client_ip": "True-Client-IP (Cloudflare Enterprise / Akamai)", + "lang_card_fr_name": "French", + "lang_card_fr_country": "France", + "lang_card_enus_name": "English (US)", + "lang_card_enus_country": "United States", + "lang_card_engb_name": "English (UK)", + "lang_card_engb_country": "United Kingdom", + "lang_opt_fr": "French (France)", + "lang_opt_enus": "English (US) — American", + "lang_opt_engb": "English (UK) — British", + "placeholder_app_name": "Wi-Fi AP Administration", + "placeholder_app_short_name": "AP Manageur", + "custom_saved_msg": "Customization saved to server", + "custom_saving": "Saving…", + "no_categories_defined": "No categories defined", + "modal_cat_edit_title_with_name": "Edit category “{label}”", + "modal_cat_err_name": "Please enter a name for the category.", + "modal_cat_err_id": "Please enter a unique technical identifier.", + "modal_cat_err_id_chars": "Identifier can only contain lowercase letters, numbers, hyphens or underscores.", + "modal_cat_cannot_delete_last": "Cannot delete the last device category.", + "modal_cat_confirm_delete": "Are you sure you want to delete the category “{label}”?\n\nAll devices associated with this category will automatically switch to the Standard category.", + "saving_in_progress": "Saving in progress…", + "deleting_in_progress": "Deleting in progress…", + "resetting_in_progress": "Resetting in progress…", + "settings_hide_new_pwd": "Hide new password", + "settings_hide_confirm_pwd": "Hide password confirmation", + "settings_hide_cur_pwd": "Hide current password", + "settings_hide_token": "Hide token", + "settings_hide_key": "Hide key", + "vpn_direct_clients_desc": "Without VPN (standard connection)", + "vpn_killswitch_active_desc": "Leak protection active", + "vpn_btn_filter_all": "All", + "vpn_btn_filter_offline": "⚪ Offline", + "adv_routing_empty": "No Wi-Fi devices detected at the moment.", + "packets_kept_plural": "packets buffered", + "packets_kept_singular": "packet buffered", + "adv_pcap_status_running": "Recording...", + "adv_pcap_status_stopping": "Stopping...", + "adv_pcap_status_inactive": "Inactive", + "adv_pcap_capture_in_progress": "Capture in progress ({time})", + "adv_pcap_iface_label": "Wi-Fi Interface: ", + "adv_pcap_filter_domain_tooltip": "Filter by this domain", + "adv_pcap_confirm_clear": "Clear all captured packets?", + "adv_pcap_no_packets_export": "No packets to export", + "adv_pcap_err_start": "Error starting capture", + "adv_pcap_err_stop": "Error stopping capture", + "adv_pcap_err_clear": "Error clearing packets", + "adv_pcap_filter_icmp": "ICMP (Ping)", + "adv_pcap_filter_tls": "TLS / HTTPS", +}; diff --git a/lang/fr.js b/lang/fr.js new file mode 100644 index 0000000..bb5c037 --- /dev/null +++ b/lang/fr.js @@ -0,0 +1,1158 @@ +// AP Manageur - Dictionnaire Français (France) +window.I18N = window.I18N || {}; +window.I18N['fr'] = { + "adv_lan_isolation": "🔒 Isolation LAN active : Tout équipement connecté à un VPN est strictement isolé du réseau local.", + "adv_lan_isolation_body": "Tout équipement connecté à un VPN est strictement isolé du réseau local.", + "adv_lan_isolation_full": "Isolation LAN active : Tout équipement connecté à un VPN est strictement isolé du réseau local (aucun accès aux box, NAS, imprimantes ou à l'AP Manageur). Tout son trafic transite exclusivement par le tunnel VPN.", + "adv_lan_isolation_title": "Isolation LAN active :", + "adv_pcap_active": "Actif", + "adv_pcap_autoscroll": "Défilement live", + "adv_pcap_buffer_size": "Tous les paquets conservés", + "adv_pcap_captured_label": "Paquets capturés", + "adv_pcap_clear": "🗑️ Effacer", + "adv_pcap_count_suffix": "paquet(s)", + "adv_pcap_desc": "Capture et analyse des flux réseau en temps réel sur l’interface Wi-Fi", + "adv_pcap_domains_desc": "Noms de domaine uniques", + "adv_pcap_domains_detected": "Domaines détectés", + "adv_pcap_domains_unique": "Noms de domaine uniques", + "adv_pcap_empty": "Aucun paquet capturé. Cliquez sur « Démarrer » pour lancer l’analyse Wireshark.", + "adv_pcap_export_csv": "📄 Exporter CSV", + "adv_pcap_export_pcap": "📥 Exporter PCAP", + "adv_pcap_export_size": "Taille export PCAP", + "adv_pcap_filter_all": "Tous", + "adv_pcap_filter_domains": "🌐 Domaines uniquement", + "adv_pcap_format_desc": "Format Libpcap 2.4 (Wireshark)", + "adv_pcap_hint": "💡 Cliquez sur un paquet pour inspecter l’en-tête décodé et le dump hexadécimal / ASCII style Wireshark.", + "adv_pcap_iface_info": "Interface Wi-Fi :", + "adv_pcap_inactive": "Inactif", + "adv_pcap_packets_captured": "Paquets capturés", + "adv_pcap_proto_label": "Protocoles détectés", + "adv_pcap_protocols": "Protocoles détectés", + "adv_pcap_quick_filters": "Filtres rapides :", + "adv_pcap_search_ph": "Filtrer paquets ou domaine (ex: google.com, dns, icmp, 10.42.0.1...)", + "adv_pcap_start": "▶ Démarrer", + "adv_pcap_state_label": "État Analyseur Wireshark", + "adv_pcap_state_title": "État Analyseur Wireshark", + "adv_pcap_stop": "■ Arrêter", + "adv_pcap_stop_btn": "■ Arrêter", + "adv_pcap_title": "Analyseur Réseau Wi-Fi (Wireshark)", + "adv_routing_desc": "Choisissez quel profil VPN chaque équipement doit emprunter, ou laissez-le en accès direct Internet.", + "adv_routing_title": "Routage réseau Wi‑Fi par client", + "adv_subtab_pcap": "Capture de paquets (PCAP)", + "adv_subtab_vpn": "Routage VPN par client", + "alert_copied": "Copié dans le presse-papier !", + "api_unavailable": "API indisponible", + "app_main_heading": "Administration de l’AP Wi‑Fi", + "app_title_sub": "l’administration de l’AP Wi‑Fi", + "app_title_text": "Administration de l’AP Wi‑Fi", + "auth_confirm_password": "Confirmation du mot de passe", + "auth_current_password": "Mot de passe actuel", + "auth_intro": "Connectez-vous pour accéder à l’administration de l’AP Wi‑Fi.", + "auth_intro_prefix": "Connectez-vous pour accéder à", + "auth_intro_title": "l’administration de l’AP Wi‑Fi", + "auth_new_password": "Nouveau mot de passe", + "auth_otp": "Code de double identification (TOTP ou secours)", + "auth_passkey_btn": "Se connecter avec une Passkey", + "auth_passkey_desc": "Touch ID, Face ID, Windows Hello ou clé physique sans mot de passe ni 2FA", + "auth_passkey_or": "OU SANS MOT DE PASSE", + "auth_password": "Mot de passe", + "auth_remember": "Se rappeler de moi", + "auth_submit": "Se connecter", + "auth_title": "Connexion", + "auth_username": "Utilisateur", + "auth_setup_title": "Créer le compte administrateur", + "auth_setup_intro": "Définissez le compte qui protégera le tableau de bord.", + "auth_setup_submit": "Créer le compte", + "auth_otp_placeholder": "Code à 6 chiffres ou code de secours (ex: ABCDE-12345)", + "auth_processing": "Traitement…", + "auth_account_created": "Compte créé. Connexion…", + "passkey_auth_success": "Authentification Passkey réussie !", + "passkey_login_rejected": "Connexion Passkey refusée", + "passkey_error_prefix": "Erreur Passkey : ", + "badge_limited": "Limité", + "block": "Bloquer", + "blocked_desc": "Ces appareils sont enregistrés dans la liste de blocage et peuvent être autorisés à nouveau.", + "blocked_title": "Appareils bloqués", + "btn_add": "Ajouter", + "btn_add_category": "➕ Ajouter une catégorie", + "btn_apply": "Appliquer", + "btn_cancel": "Annuler", + "btn_clear": "Effacer", + "btn_close": "Fermer", + "btn_confirm": "Confirmer", + "btn_connect": "Connecter", + "btn_copy": "Copier", + "btn_delete": "Supprimer", + "btn_disconnect": "Déconnecter", + "btn_download": "Télécharger", + "btn_edit": "Modifier", + "btn_export": "Exporter", + "btn_hide_pwd": "Masquer le mot de passe", + "btn_import": "Importer", + "btn_logout": "Déconnexion", + "btn_next": "Suivant →", + "btn_paste_svg": "📋 Coller SVG", + "btn_prev": "← Précédent", + "btn_refresh": "Actualiser", + "btn_rename": "Renommer", + "btn_reset": "Réinitialiser", + "btn_reset_defaults": "↺ Réinitialiser par défaut", + "btn_restart": "Redémarrer", + "btn_save": "Enregistrer", + "btn_search": "Chercher", + "btn_show_pwd": "Afficher le mot de passe", + "btn_start": "Démarrer", + "btn_stop": "Arrêter", + "chart_current_slot": "Tranche actuelle :", + "chart_sub_day": "Fréquentation par heure (aujourd’hui)", + "chart_sub_month": "Nombre de connectés par mois (12 derniers mois)", + "chart_sub_week": "Nombre de connectés par semaine (12 dernières semaines)", + "chart_sub_year": "Nombre de connectés par année", + "clients_blocked_desc": "Accès Wi‑Fi interdit", + "clients_mac_filtering_desc": "Filtrage matériel par adresse MAC", + "clients_offline_desc": "Non connectés actuellement", + "clients_online_wifi_desc": "En ligne sur le Wi‑Fi", + "clients_saved_sqlite_desc": "Mémorisés en base SQLite", + "clients_vpn_tunneled_desc": "Trafic acheminé par tunnel", + "confirm_clear_logs": "Êtes-vous sûr de vouloir vider l’intégralité des journaux de connexion ?", + "confirm_delete_all_data": "⚠️ ATTENTION : Voulez-vous vraiment supprimer toutes les données de l’application ?", + "confirm_delete_device": "Voulez-vous vraiment supprimer l'appareil « {name} » ({mac}) de la base de données ?", + "confirm_delete_passkey": "Êtes-vous sûr de vouloir supprimer la Passkey « {name} » ?", + "confirm_reboot_ap": "Voulez-vous redémarrer le point d’accès Wi‑Fi ?", + "confirm_reset_device_types": "Voulez-vous réinitialiser toutes les catégories d’appareils par défaut ?", + "confirm_reset_quota": "Voulez-vous remettre à zéro le compteur de données de l'appareil « {name} » ?", + "connected_count_suffix": "connecté(s)", + "connected_live": "Connecté en direct", + "custom_add_category": "➕ Ajouter une catégorie", + "custom_app_name": "Nom complet de l’application", + "custom_db_notice": "Enregistré dans la base de données : le nom, la langue et le thème se retrouvent sur tous vos appareils.", + "custom_dev_types_desc": "Gérez les catégories d’appareils (nom, logo/emoji, identifiant) et personnalisez leur affichage.", + "custom_dev_types_title": "🏷️ Types et catégories d’appareils", + "custom_device_types_desc": "Gérez les catégories d’appareils (nom, logo/emoji, identifiant) et personnalisez leur affichage.", + "custom_device_types_title": "🏷️ Types et catégories d’appareils", + "custom_lang": "Langue de l’interface", + "custom_reset_defaults": "↺ Réinitialiser par défaut", + "custom_save_btn": "Enregistrer la personnalisation", + "custom_short_name": "Nom court (onglet navigateur)", + "custom_subtitle": "Personnalisez le titre du service, la langue et l’apparence visuelle.", + "custom_theme": "Thème", + "custom_theme_auto": "Automatique (selon l’appareil)", + "custom_theme_dark": "Sombre", + "custom_theme_light": "Clair", + "custom_theme_winxp": "Windows XP (Luna)", + "custom_theme_futuristic": "Futuriste (Cyber / Néon)", + "custom_theme_macos": "macOS (Adaptatif Clair / Sombre)", + "custom_theme_hacker": "Hacker (Terminal Matrix)", + "custom_title": "Personnalisation", + "danger_backup_desc": "Exportez l'intégralité de la configuration système (réglages Wi-Fi, profils VPN WireGuard & OpenVPN, routages des équipements, noms et logos des appareils, liste noire de blocage et base de données SQLite) dans un fichier sécurisé, ou restaurez une configuration précédente en un clic.", + "danger_backup_title": "📦 Sauvegarde & Restauration globale", + "danger_clear_btn": "Supprimer toutes les données", + "danger_clear_desc": "Supprime l’historique des logs, les appareils bloqués et la configuration réseau enregistrée.", + "danger_clear_title": "⚠️ Suppression irréversible", + "danger_delete_all_btn": "Supprimer toutes les données", + "danger_delete_desc": "Supprime l’historique des logs, les appareils bloqués et la configuration réseau enregistrée.", + "danger_delete_title": "⚠️ Suppression irréversible", + "danger_desc": "Gestion des sauvegardes, restauration de la configuration et actions critiques de maintenance du système.", + "danger_export_btn": "📥 Exporter la configuration & base de données", + "danger_import_btn": "📤 Importer une sauvegarde…", + "danger_subtitle": "Gestion des sauvegardes, restauration de la configuration et actions critiques de maintenance du système.", + "danger_title": "Zone dangereuse & Maintenance", + "dash_card_clients": "Clients connectés", + "dash_card_ssid": "SSID", + "dash_card_status": "État de l’AP", + "dash_card_uptime": "Uptime du SSID", + "dash_clients_title": "Clients connectés", + "dash_connected_clients": "Clients connectés", + "dash_qr_desc": "Le QR code utilise le SSID et le mot de passe réels de l’AP.", + "dash_qr_pwd_label": "Mot de passe récupéré par l’API", + "dash_qr_title": "Rejoindre le réseau", + "dash_ssid_title": "SSID", + "dash_state_title": "État de l’AP", + "dash_updated": "Dernière actualisation :", + "dash_updated_initial": "Dernière actualisation : —", + "dash_uptime_title": "Uptime du SSID", + "delete_history_attr": "Supprimer de l'historique BDD", + "dev_blocked": "Appareils bloqués", + "dev_blocked_count": "Appareils bloqués", + "dev_blocked_sub": "Accès Wi‑Fi interdit", + "dev_click_change_type": "Cliquer pour changer le type d’appareil", + "dev_connected": "Actuellement connectés", + "dev_connected_sub": "En ligne sur le Wi‑Fi", + "dev_currently_connected": "Actuellement connectés", + "dev_direct_sub": "Sans VPN (connexion normale)", + "dev_edit_type": "Modifier le type d’appareil", + "dev_filter_all": "Tous", + "dev_filter_block": "🔴 Bloqués", + "dev_filter_conn": "🟢 Connectés", + "dev_filter_off": "⚪ Hors ligne", + "dev_history_desc": "Consultez l'ensemble des équipements s’étant déjà connectés au point d'accès Wi‑Fi.", + "dev_history_title": "Historique de tous les appareils", + "dev_ks_sub": "Protection anti-fuite", + "dev_lan_isolation_desc": "Tout équipement connecté à un VPN est strictement isolé du réseau local (aucun accès aux box, NAS, imprimantes ou à l'AP Manageur). Tout son trafic transite exclusivement par le tunnel VPN.", + "dev_lan_isolation_title": "Isolation LAN active :", + "dev_offline": "Appareils hors ligne", + "dev_offline_count": "Appareils hors ligne", + "dev_offline_sub": "Non connectés actuellement", + "dev_routed_sub": "Trafic acheminé par tunnel", + "dev_search_ph": "Filtrer par nom, adresse MAC, IP...", + "dev_total": "Total appareils enregistrés", + "dev_total_registered": "Total appareils enregistrés", + "dev_total_sub": "Mémorisés en base SQLite", + "device_click_to_change_type": "Cliquer pour changer le type d’appareil", + "device_speed_label": "Débit :", + "devices_count_suffix": "appareil(s)", + "err_auth_required": "Authentification requise", + "err_bad_login": "Nom d’utilisateur ou mot de passe incorrect", + "err_delete_history": "Erreur lors de la suppression", + "err_killswitch_update": "Erreur lors de la modification du Kill-Switch", + "err_network": "Erreur réseau ou serveur inaccessible", + "err_passwords_mismatch": "Les mots de passe ne correspondent pas", + "err_prefix": "Erreur : ", + "err_reset_quota": "Erreur lors de la réinitialisation", + "err_save_limits": "Erreur lors de l’enregistrement", + "err_timeout": "Délai d’attente dépassé", + "err_unknown": "Une erreur inconnue est survenue.", + "err_vpn_assignment": "Erreur lors de l’assignation VPN", + "explore_on_sites": "Explorer sur les sites :", + "filter_all": "Tous", + "filter_by_domain": "Filtrer sur ce domaine", + "filter_this_domain": "Filtrer sur ce domaine", + "header_lang_tooltip": "Paramètres de langue", + "last_activity": "Dernière activité :", + "limits_dev_name_label": "Nom de l'appareil", + "loader_connecting": "connexion…", + "loader_finished": "Démarrage terminé !", + "loader_finished_badge": "Démarrage terminé", + "loader_ip_pending": "IP en cours…", + "loader_no_vpn_needed": "Aucun tunnel VPN automatique requis", + "loader_ready": "Système prêt !", + "loader_ready_badge": "Système prêt", + "loader_refreshing": "Actualisation en cours…", + "loader_refreshing_badge": "Actualisation en cours", + "loader_skip": "Passer au tableau de bord →", + "loader_starting": "Démarrage en cours…", + "loader_starting_badge": "Démarrage en cours", + "loader_step1": "API & Session", + "loader_step1_admin": "Droits administrateur confirmés", + "loader_step1_conn": "Connexion à l’API et vérification des accès…", + "loader_step1_label": "Étape 1 / 4", + "loader_step1_ok": "Droits administrateur confirmés", + "loader_step1_sub": "Connexion au serveur et vérification de la session…", + "loader_step2": "Réseau Wi-Fi", + "loader_step2_activating": "Activation du réseau Wi-Fi ({s}s)…", + "loader_step2_ap_cfg": "Point d'accès configuré", + "loader_step2_ap_init": "Configuration initiale", + "loader_step2_ap_up": "Point d'accès opérationnel (SSID : {ssid})", + "loader_step2_checking": "Vérification de l'état du réseau Wi-Fi…", + "loader_step2_configured": "Point d'accès configuré", + "loader_step2_ok": "Point d'accès opérationnel", + "loader_step2_sub": "Vérification de l’interface Wi-Fi et de l’AP…", + "loader_step3": "Tests & VPN", + "loader_step3_detecting": "Détection et vérification des profils VPN…", + "loader_step3_none": "Aucun tunnel VPN automatique requis", + "loader_step3_ok": "Tunnels VPN opérationnels ({connected}/{target}) : {details}", + "loader_step3_sub": "Vérification des profils et tunnels VPN…", + "loader_step3_waiting": "Tunnels VPN ({connected}/{target}) : {details} [{elapsed}s]", + "loader_step4": "Tableau de bord", + "loader_step4_done": "Démarrage terminé !", + "loader_step4_done_badge": "Démarrage terminé", + "loader_step4_inventory": "Inventaire des appareils réseau…", + "loader_step4_opening": "Ouverture du tableau de bord d'administration", + "loader_step4_ready": "Système prêt !", + "loader_step4_ready_badge": "Système prêt", + "loader_step4_sub": "Chargement du tableau de bord et des appareils…", + "loader_step4_sync": "Synchronisation des équipements, tunnels et métriques…", + "loader_step_x_of_y": "Étape {step} / 4", + "loader_title": "Administration de l’AP Wi‑Fi", + "loader_tunnels_vpn": "Tunnels VPN", + "loader_tunnels_vpn_ok": "Tunnels VPN opérationnels", + "loader_waiting": "attente…", + "loader_waiting_api": "Attente du serveur API", + "loader_wifi_activating": "Activation du réseau Wi-Fi ({sec}s)…", + "loading": "Chargement…", + "loading_categories": "Chargement des catégories…", + "loading_passkeys": "Chargement des Passkeys…", + "log_activation_2fa": "🛡️ Activation 2FA", + "log_arret": "■ Arrêt AP", + "log_blocage": "⛔ Blocage", + "log_config_modified": "✓ Config AP modifiée", + "log_connexion": "● Connexion Wi-Fi", + "log_connexion_admin": "● Connexion Admin", + "log_connexion_code_recuperation": "🔑 Connexion Code Secours", + "log_creation": "+ Création AP", + "log_creation_compte_admin": "👤 Création Compte", + "log_deblocage": "✓ Déblocage", + "log_deconnexion": "○ Déconnexion Wi-Fi", + "log_deconnexion_admin": "○ Déconnexion Admin", + "log_demarrage": "▶ Démarrage AP", + "log_desactivation_2fa": "🔓 Désactivation 2FA", + "log_echec_connexion": "❌ Échec Connexion", + "log_generation_secret_2fa": "⚙️ Secret 2FA généré", + "log_limites_appareil_modifiees": "⚖️ Quota & Débit modifiés", + "log_modification_identifiants": "🔑 Modif. Identifiants", + "log_modification_preferences": "🎨 Modif. Préférences", + "log_redemarrage": "↻ Redémarrage AP", + "log_regeneration_codes_secours": "🔄 Nouveaux Codes Secours", + "log_reinitialisation_donnees": "⚠️ Réinitialisation Data", + "log_rejet_limite": "⚠️ Limite atteinte (rejet)", + "log_suppression_journaux": "🗑️ Suppr. Journaux", + "log_vpn_connect": "🌐 Connexion VPN", + "log_vpn_disconnect": "🔌 Déconnexion VPN", + "log_vpn_route": "🛡️ Routage VPN", + "logs_clear_btn": "Supprimer les journaux", + "logs_title": "Journaux de connexion", + "modal_bw_chk": "Limitation de la bande passante (Débit)", + "modal_bw_desc": "💡 Régulation appliquée par le noyau Linux (QoS / Traffic Control). 0 = illimité.", + "modal_bw_down": "Téléchargement max (Download)", + "modal_bw_profiles": "Profils rapides :", + "modal_bw_up": "Téléversement max (Upload)", + "modal_cat_add_title": "➕ Ajouter une catégorie d’appareil", + "modal_cat_choose": "Choisissez une catégorie d’équipement :", + "modal_cat_desc_label": "Description / Exemples d’appareils", + "modal_cat_edit_title": "🏷️ Modifier le type d’appareil", + "modal_cat_explore": "Explorer sur les sites :", + "modal_cat_filter_all": "Tous", + "modal_cat_filter_emoji": "😀 Emojis", + "modal_cat_filter_svg": "⚡ SVG (Iconify)", + "modal_cat_icon_label": "Logo / Icône (Emoji ou SVG) *", + "modal_cat_id_help": "Lettres minuscules, chiffres, tirets ou soulignés uniquement.", + "modal_cat_id_label": "Identifiant technique unique *", + "modal_cat_name_label": "Nom de la catégorie *", + "modal_cat_paste_svg": "📋 Coller SVG", + "modal_cat_quick_sugg": "Suggestions rapides :", + "modal_cat_save_btn": "Enregistrer", + "modal_cat_search_btn": "Chercher", + "modal_cat_search_title": "🔍 Rechercher un emoji ou icône SVG", + "modal_cat_table_loading": "Chargement des catégories…", + "modal_change_dev_type_title": "🏷️ Modifier le type d’appareil", + "modal_choose_category": "Choisissez une catégorie d’équipement :", + "modal_current_usage": "Consommation actuelle :", + "modal_device_type_attr": "Modifier le type d’appareil (Smartphone, Tablette, PC, TV...)", + "modal_device_type_click": "Cliquer pour changer le type d’appareil", + "modal_device_type_title": "Modifier le type d’appareil", + "modal_import_admin": "Compte administrateur & passkeys", + "modal_import_blocked": "Liste des appareils bloqués", + "modal_import_btn_confirm": "Confirmer et restaurer", + "modal_import_config": "Configuration & préférences", + "modal_import_created_at": "Date de création :", + "modal_import_created_date": "Date de création : —", + "modal_import_detected": "Éléments détectés dans l’archive :", + "modal_import_item_admin": "🔐 Compte administrateur & passkeys (⚠️ écrasera le compte courant)", + "modal_import_item_config": "⚙️ Configuration & préférences (Wi-Fi, réseau, thèmes, etc.)", + "modal_import_item_names": "📱 Noms des équipements & types attribués", + "modal_import_item_types": "🎨 Catégories d'appareils & logos personnalisés", + "modal_import_item_vpn": "🌐 Profils VPN & routages (WireGuard & OpenVPN)", + "modal_import_names": "Noms des équipements", + "modal_import_select": "Sélectionnez les données à restaurer :", + "modal_import_title": "Restauration de la sauvegarde", + "modal_import_types": "Catégories d'appareils", + "modal_import_vpn": "Profils VPN & routages", + "modal_limits_title": "Quota & Limitation de débit", + "modal_limits_title_attr": "Définir un quota et limiter la bande passante", + "modal_period_day": "Par jour (réinit. à minuit)", + "modal_period_month": "Par mois (réinit. le 1er)", + "modal_period_total": "Total cumulé", + "modal_period_week": "Par semaine (réinit. lundi)", + "modal_presets": "Préréglages :", + "modal_quota_action_desc": "Action au dépassement : L’appareil ne pourra plus naviguer sur Internet (trafic WAN coupé automatiquement).", + "modal_quota_chk": "Quota de données Internet", + "modal_quota_exceeded": "Quota dépassé", + "modal_quota_exhausted": "Quota épuisé (0 o restant)", + "modal_quota_max": "Volume max autorisé", + "modal_quota_period": "Période de calcul", + "modal_quota_preset_1": "1 Go", + "modal_quota_preset_10": "10 Go", + "modal_quota_preset_20": "20 Go", + "modal_quota_preset_5": "5 Go", + "modal_quota_preset_50": "50 Go", + "modal_quota_remaining": "Reste :", + "modal_reset_counter": "🔄 Réinitialiser le compteur", + "modal_save_limits": "Enregistrer les limitations", + "modal_saved_ok": "✓ Limitations enregistrées et appliquées avec succès !", + "modal_saving": "Application des quotas et limitations réseau…", + "modal_search_icon_title": "🔍 Rechercher un emoji ou icône SVG", + "modal_vpn_auth_optional": "Identifiants de connexion OpenVPN (optionnels)", + "modal_vpn_autoconnect": "Connecter automatiquement ce profil au démarrage de l'AP", + "modal_vpn_config_file": "Fichier de configuration", + "modal_vpn_copy": "📋 Copier", + "modal_vpn_download": "💾 Télécharger", + "modal_vpn_import_btn": "📁 Importer un fichier (.conf / .ovpn)", + "modal_vpn_openvpn_sub": "Fichier .ovpn standard", + "modal_vpn_save_btn": "Enregistrer le profil", + "modal_vpn_view_title": "Configuration VPN", + "modal_vpn_wireguard_sub": "Fichier .conf moderne & rapide", + "nav_advanced": "Avancé", + "nav_blocked": "Appareils bloqués", + "nav_dashboard": "Tableau de bord", + "nav_devices": "Appareils", + "nav_logs": "Journaux", + "nav_settings": "Réglages", + "nav_stats": "Statistiques", + "net_lan": "Réseau local (LAN)", + "net_multicast": "Diffusion / Multicast", + "net_wan": "Internet / WAN", + "no_blocked_clients": "Aucun appareil bloqué", + "no_clients": "Aucun appareil connecté", + "no_devices_found": "Aucun appareil correspondant aux critères de recherche", + "no_logs": "Aucun journal disponible", + "no_packets_captured": "Aucun paquet capturé. Cliquez sur « Démarrer » pour lancer l’analyse Wireshark.", + "no_packets_match": "Aucun paquet ne correspond au filtre \"{filter}\"", + "no_traffic_history": "Aucun historique de consommation disponible", + "no_vpn_clients_match": "Aucun équipement correspondant aux critères de recherche", + "not_assigned": "Non attribuée", + "notif_check_admin_login_failed": "⚠️ Échec de connexion administrateur", + "notif_check_device_blocked": "🛑 Équipement bloqué ou débloqué", + "notif_check_device_connected": "📶 Reconnexion d’un appareil Wi‑Fi connu", + "notif_check_device_disconnected": "📴 Déconnexion d’un appareil Wi‑Fi", + "notif_check_new_device": "📱 Nouvel appareil Wi‑Fi (première connexion)", + "notif_check_quota_exceeded": "⚖️ Quota de données dépassé par un appareil", + "notif_check_settings_changed": "⚙️ Modification réglages Wi‑Fi / AP", + "notif_check_vpn_client_disconnected": "🌐 Déconnexion / Retrait client du VPN", + "notif_check_vpn_profile_disconnected": "⚠️ Déconnexion profil VPN (tunnel coupé)", + "notif_custom_desc": "Requête HTTP vers n’importe quelle API, domotique ou service cloud", + "notif_custom_enable": "Activer Webhook", + "notif_custom_headers_label": "En-têtes personnalisés (optionnel, JSON ou Clé: Valeur)", + "notif_custom_method": "Méthode", + "notif_custom_method_label": "Méthode", + "notif_custom_test_btn": "Tester le Webhook", + "notif_custom_title": "Webhook personnalisé (HTTP)", + "notif_custom_url_dest": "URL de destination", + "notif_custom_url_label": "URL de destination", + "notif_custom_webhook_desc": "Requête HTTP vers n’importe quelle API, domotique ou serveur externe", + "notif_custom_webhook_header": "Webhook personnalisé (HTTP)", + "notif_discord_bot_full": "Nom du Bot (optionnel)", + "notif_discord_bot_label": "Nom du Bot (optionnel)", + "notif_discord_channel_desc": "Envoi direct sur un canal de salon via Webhook", + "notif_discord_desc": "Envoi direct sur un canal de salon via Webhook", + "notif_discord_enable": "Activer Discord", + "notif_discord_test_btn": "Tester Discord", + "notif_discord_title": "Notification Discord", + "notif_discord_url_label": "URL du Webhook Discord", + "notif_email_desc": "Envoi direct via votre serveur de messagerie", + "notif_email_enable": "Activer Email", + "notif_email_from": "Expéditeur (From)", + "notif_email_from_full": "Expéditeur (From)", + "notif_email_from_label": "Nom de l’expéditeur", + "notif_email_host": "Hôte SMTP", + "notif_email_host_label": "Hôte SMTP", + "notif_email_none_hint": "Aucune (port 25 non chiffré)", + "notif_email_pass": "Mot de passe SMTP", + "notif_email_pass_label": "Mot de passe SMTP", + "notif_email_pass_smtp": "Mot de passe SMTP", + "notif_email_port": "Port SMTP", + "notif_email_port_label": "Port SMTP", + "notif_email_sec_label": "Sécurité", + "notif_email_sec_none": "Aucune (Texte clair)", + "notif_email_sec_ssl": "SSL/TLS implicite", + "notif_email_sec_ssl_465": "SSL / TLS (port 465)", + "notif_email_sec_starttls": "STARTTLS (Recommandé)", + "notif_email_security": "Sécurité", + "notif_email_starttls_hint": "STARTTLS (recommandé port 587)", + "notif_email_sub": "Envoi direct via votre serveur de messagerie", + "notif_email_test": "Tester l’envoi Email", + "notif_email_test_action": "Tester l’envoi Email", + "notif_email_test_btn": "Tester l’envoi Email", + "notif_email_title": "Notification par Email (SMTP)", + "notif_email_to": "Destinataire(s) (To)", + "notif_email_to_label": "Destinataire(s) (To)", + "notif_email_user": "Identifiant SMTP", + "notif_email_user_label": "Identifiant SMTP", + "notif_event_admin_login": "🔒 Connexion au compte administrateur", + "notif_event_admin_login_failed": "⚠️ Échec de connexion administrateur", + "notif_event_device_blocked": "🛑 Équipement bloqué ou débloqué", + "notif_event_device_connected": "📶 Reconnexion d’un appareil Wi‑Fi connu", + "notif_event_device_disconnected": "📴 Déconnexion d’un appareil Wi‑Fi", + "notif_event_new_device": "📱 Nouvel appareil Wi‑Fi (première connexion)", + "notif_event_quota_exceeded": "⚖️ Quota de données dépassé par un appareil", + "notif_event_settings_changed": "⚙️ Modification réglages Wi‑Fi / AP", + "notif_event_stats_report": "📊 Rapport statistiques & métriques (Tâche Cron)", + "notif_event_vpn_client_connected": "🛡️ Client routé via VPN", + "notif_event_vpn_client_disconnected": "🌐 Déconnexion / Retrait client du VPN", + "notif_event_vpn_profile_connected": "🛡️ Profil VPN connecté (tunnel actif)", + "notif_event_vpn_profile_disconnected": "⚠️ Déconnexion profil VPN (tunnel coupé)", + "notif_events_desc": "Sélectionnez les événements qui déclencheront l’envoi d’une notification :", + "notif_events_title": "Événements déclencheurs d’alerte", + "notif_evt_admin_login": "🔒 Connexion au compte administrateur", + "notif_evt_admin_login_failed": "⚠️ Échec de connexion administrateur", + "notif_evt_device_blocked": "🛑 Équipement bloqué ou débloqué", + "notif_evt_device_connected": "📶 Reconnexion d’un appareil Wi‑Fi connu", + "notif_evt_device_disconnected": "📴 Déconnexion d’un appareil Wi‑Fi", + "notif_evt_new_device": "📱 Nouvel appareil Wi‑Fi (première connexion)", + "notif_evt_quota_exceeded": "⚖️ Quota de données dépassé par un appareil", + "notif_evt_settings_changed": "⚙️ Modification réglages Wi‑Fi / AP", + "notif_evt_stats_report": "📊 Rapport statistiques & métriques (Tâche Cron)", + "notif_evt_vpn_client_connected": "🛡️ Client routé via VPN", + "notif_evt_vpn_client_disconnected": "🌐 Déconnexion / Retrait client du VPN", + "notif_evt_vpn_profile_connected": "🛡️ Profil VPN connecté (tunnel actif)", + "notif_evt_vpn_profile_disconnected": "⚠️ Déconnexion profil VPN (tunnel coupé)", + "notif_gotify_alert_box": "⚠️ Important pour Gotify 3.1.1 : Le jeton doit provenir de l'onglet APPS de Gotify (commençant par gtfya... en v3 ou A... en v2). Les jetons de l'onglet CLIENTS (commençant par gtfyc... ou C...) ne permettent pas de publier des alertes. Le HTTPS avec certificat auto-signé est supporté.", + "notif_gotify_compat_desc": "Serveur de push auto-hébergé léger et instantané (Compatible Gotify 3.1.1+)", + "notif_gotify_desc": "Serveur de push auto-hébergé léger et instantané (Compatible Gotify v2 & v3.1.1+)", + "notif_gotify_enable": "Activer Gotify", + "notif_gotify_hint": "Le jeton doit provenir de l'onglet APPS de Gotify (commençant par A...). Les jetons CLIENTS ne fonctionnent pas pour poster des messages.", + "notif_gotify_important": "Important pour Gotify 3.1.1 :", + "notif_gotify_priority_label": "Priorité (1 - 10)", + "notif_gotify_priority_range": "Priorité (1 - 10)", + "notif_gotify_test_btn": "Tester Gotify", + "notif_gotify_title": "Notification Gotify", + "notif_gotify_token_apps": "Jeton d’application (Token APPS)", + "notif_gotify_token_label": "Jeton d’application (Token APPS)", + "notif_gotify_url_label": "URL du serveur Gotify", + "notif_ntfy_desc": "Notifications push via ntfy.sh ou serveur auto-hébergé", + "notif_ntfy_enable": "Activer ntfy", + "notif_ntfy_priority_label": "Priorité (1 - 5)", + "notif_ntfy_priority_range": "Priorité (1 - 5)", + "notif_ntfy_server_desc": "Notifications push via ntfy.sh ou serveur auto-hébergé", + "notif_ntfy_server_label": "Serveur ntfy", + "notif_ntfy_test_btn": "Tester ntfy", + "notif_ntfy_title": "Notification ntfy.sh", + "notif_ntfy_token_label": "Jeton / Mot de passe (optionnel pour topic privé)", + "notif_ntfy_token_opt": "Jeton / Mot de passe (optionnel pour topic privé)", + "notif_ntfy_topic_label": "Topic (sujet)", + "notif_ntfy_url_label": "URL du serveur", + "notif_pushbullet_desc": "Push instantané sur téléphones, tablettes et navigateurs", + "notif_pushbullet_device_iden": "ID de l’appareil (Device Iden, optionnel — laisser vide pour tous)", + "notif_pushbullet_device_label": "ID de l’appareil (Device Iden, optionnel — laisser vide pour tous)", + "notif_pushbullet_devices_desc": "Push instantané sur téléphones, tablettes et navigateurs", + "notif_pushbullet_enable": "Activer Pushbullet", + "notif_pushbullet_test_btn": "Tester Pushbullet", + "notif_pushbullet_title": "Notification Pushbullet", + "notif_pushbullet_token_access": "Jeton d’accès (Access Token)", + "notif_pushbullet_token_label": "Jeton d’accès (Access Token)", + "notif_pushover_desc": "Push pour Android, iOS et Desktop", + "notif_pushover_devices_desc": "Push pour Android, iOS et Desktop", + "notif_pushover_enable": "Activer Pushover", + "notif_pushover_priority_label": "Priorité (-2 à 2 : 0 = Normal, 1 = Élevée)", + "notif_pushover_test_btn": "Tester Pushover", + "notif_pushover_title": "Notification Pushover", + "notif_pushover_token_label": "Jeton d’application (API Token)", + "notif_pushover_user_label": "Clé utilisateur (User Key)", + "notif_save_btn": "Enregistrer les notifications", + "notif_slack_bot_label": "Nom d’expéditeur du bot (optionnel)", + "notif_slack_desc": "Alertes sur un canal Slack via Webhook entrant (Incoming Webhook)", + "notif_slack_enable": "Activer Slack", + "notif_slack_incoming_desc": "Alertes sur un canal Slack via Webhook entrant (Incoming Webhook)", + "notif_slack_sender_name": "Nom d’expéditeur du bot (optionnel)", + "notif_slack_test_btn": "Tester Slack", + "notif_slack_title": "Notification Slack", + "notif_slack_url_label": "URL du Webhook entrant Slack", + "notif_slack_webhook_url_label": "URL du Webhook entrant Slack", + "notif_telegram_chat_full": "Identifiant de discussion (Chat ID)", + "notif_telegram_chat_label": "Identifiant de discussion (Chat ID)", + "notif_telegram_desc": "Alertes instantanées par bot Telegram (canal, groupe ou privé)", + "notif_telegram_enable": "Activer Telegram", + "notif_telegram_test_btn": "Tester Telegram", + "notif_telegram_thread_label": "Fil / Topic (optionnel)", + "notif_telegram_title": "Notification Telegram", + "notif_telegram_token_father": "Jeton du Bot (Bot Token @BotFather)", + "notif_telegram_token_label": "Jeton du Bot (Bot Token @BotFather)", + "notif_test_all": "🧪 Tester tous les canaux actifs", + "notif_tmpl_customize": "Personnaliser ▾", + "notif_tmpl_main_desc": "Modifiez le titre et le texte des alertes. Cliquez sur une variable pour l’insérer dans le message.", + "notif_tmpl_main_title": "Personnalisation des messages d’alerte", + "notif_tmpl_msg_label": "Contenu du message", + "notif_tmpl_reset_btn": "↺ Rétablir par défaut", + "notif_tmpl_title_label": "Titre / Sujet", + "notif_tmpl_toggle_collapse": "Tout replier", + "notif_tmpl_toggle_expand": "Tout déplier", + "notif_tmpl_vars_label": "Variables :", + "notif_webhook_desc": "Intégration universelle REST / JSON", + "notif_webhook_headers_label": "En-têtes HTTP personnalisés (JSON)", + "notif_webhook_test_btn": "Tester Webhook", + "notif_webhook_title": "Webhook personnalisable (HTTP POST)", + "notif_webhook_url_label": "URL du Webhook", + "packet_all_kept": "Tous les paquets conservés", + "packet_btn_stop": "■ Arrêter", + "packet_bytes_unit": "octets", + "packet_captured_label": "Paquets capturés", + "packet_destination": "Destination :", + "packet_details_title": "Détails du paquet #", + "packet_domain": "Domaine / Hôte :", + "packet_domains_label": "Domaines détectés", + "packet_hexdump": "Dump Hexadécimal & ASCII (Wireshark) :", + "packet_iface_info": "Interface Wi-Fi : —", + "packet_layers": "Décodage des couches réseau :", + "packet_pcap_format": "Format Libpcap 2.4 (Wireshark)", + "packet_pcap_size_label": "Taille export PCAP", + "packet_protocols_label": "Protocoles détectés", + "packet_quick_filters": "Filtres rapides :", + "packet_size": "Taille :", + "packet_source": "Source :", + "packet_status_analyzer": "État Analyseur Wireshark", + "packet_time": "Heure :", + "packet_unique_domains": "Noms de domaine uniques", + "packets_count_plural": "paquets", + "packets_count_singular": "paquet", + "page_x_of_y": "Page {p} sur {total}", + "pcap_export_csv_title": "Exporter au format CSV", + "pcap_export_pcap_title": "Télécharger le fichier .pcap compatible Wireshark Desktop", + "pcap_stop_capture_title": "Arrêter l’analyse de trames Wireshark", + "placeholder_0_unlimited": "0 pour illimité", + "placeholder_current_pwd": "Mot de passe actuel", + "placeholder_dev_desc": "Ex: PlayStation, Xbox, Switch...", + "placeholder_dev_icon": "Emoji (📱, 💻...) ou code SVG", + "placeholder_dev_id": "Ex: console, robot, iot...", + "placeholder_dev_label": "Ex: Console de jeux, Robot aspirateur...", + "placeholder_email_pass": "Mot de passe ou mot de passe d’application", + "placeholder_filter_clients": "Filtrer par nom, adresse MAC, IP, profil...", + "placeholder_filter_packets": "Filtrer paquets ou domaine (ex: google.com, dns, icmp, 10.42.0.1...)", + "placeholder_icon_search": "Rechercher (ex: laptop, wifi, console, camera, robot, apple...)", + "placeholder_my_wifi": "Mon réseau Wi‑Fi", + "placeholder_new_pwd": "Nouveau mot de passe", + "placeholder_pwd_confirm": "Confirmation du mot de passe", + "placeholder_pwd_min8": "8 caractères minimum", + "placeholder_totp_code": "Code TOTP à 6 chiffres ou code de secours", + "placeholder_trusted_proxies": "Ex: 172.18.0.0/16, 192.168.1.254, 10.0.4.1", + "placeholder_vpn_config": "Collez ou importez le contenu du fichier WireGuard ou OpenVPN...", + "placeholder_vpn_name": "Ex : ProtonVPN Paris, Mullvad WG, NordVPN...", + "placeholder_vpn_pass": "Laisser vide si inchangé", + "placeholder_vpn_user": "Utilisateur VPN", + "prompt_device_name": "Entrez un nom personnalisé pour cet appareil :", + "protocol_label": "Protocole", + "proxy_auto_hint": "En mode automatique, le système examine dans l'ordre les en-têtes standards puis utilise l'adresse IP la plus fiable.", + "proxy_auto_hint_full": "En mode automatique, le système examine dans l'ordre les en-têtes Cloudflare, X-Forwarded-For (le premier IP client non mandataire) puis X-Real-IP.", + "proxy_enable_desc": "Lorsque cette option est activée, AP Manageur extrait l'adresse IP réelle des clients depuis les en-têtes HTTP transmis par votre Reverse Proxy au lieu de l'IP interne du proxy.", + "proxy_enable_desc_full": "Lorsque cette option est activée, AP Manageur extrait l'adresse IP réelle de la machine cliente à partir des en-têtes HTTP transmis par votre reverse proxy au lieu de consigner l'adresse IP locale du proxy lui-même.", + "proxy_examples_desc": "Pour que votre reverse proxy transmette correctement l'IP de la machine cliente :", + "proxy_examples_desc_full": "Pour que votre reverse proxy transmette correctement l'IP de la machine cliente à AP Manageur, assurez-vous d'avoir configuré ces en-têtes :", + "proxy_examples_title": "💡 Exemples de configuration pour votre Reverse Proxy", + "proxy_label_cf_ip": "En-tête Cloudflare (CF-Connecting-IP) :", + "proxy_label_host": "Hôte :", + "proxy_label_raw_socket_ip": "IP BRUTE REÇUE (PROXY OU SOCKET)", + "proxy_label_real_client_ip": "IP CLIENT RÉELLE ENREGISTRÉE", + "proxy_label_xff": "EN-TÊTE X-FORWARDED-FOR", + "proxy_label_xrealip": "EN-TÊTE X-REAL-IP", + "proxy_live_diag_badge": "● Détection active", + "proxy_live_diag_title": "🔍 Détection de l'IP en direct (Votre connexion actuelle)", + "proxy_opt_auto": "Détection automatique intelligente (Recommandé : CF > XFF > X-Real-IP)", + "proxy_opt_cf": "CF-Connecting-IP (Spécifique Cloudflare)", + "proxy_opt_xrealip": "X-Real-IP (Commun avec Nginx / Apache)", + "proxy_trusted_desc": "Autorise les en-têtes de proxy provenant des réseaux privés RFC1918 et conteneurs Docker (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x).", + "proxy_trusted_desc_full": "Autorise les en-têtes de proxy provenant des réseaux privés locaux (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.1). Recommandé si votre reverse proxy est un conteneur Docker ou une passerelle LAN.", + "proxy_trusted_ips_hint": "Séparez plusieurs adresses IP ou sous-réseaux CIDR par des virgules ou des retours à la ligne.", + "proxy_trusted_ips_hint_full": "Séparez plusieurs adresses IP ou sous-réseaux CIDR par des virgules ou retours à la ligne. Si votre proxy n'est pas sur une IP privée, vous DEVEZ indiquer son IP publique ici pour éviter toute usurpation d'adresse IP (IP spoofing).", + "qr_info": "Le QR code utilise le SSID et le mot de passe réels de l’AP.", + "qr_pwd_label": "Mot de passe récupéré par l’API", + "qr_title": "Rejoindre le réseau", + "rate_down": "Débit descendant", + "rate_up": "Débit montant", + "rename_device": "Renommer cet appareil", + "rename_device_attr": "Renommer cet appareil", + "rename_passkey": "Renommer cette clé de sécurité", + "sessions_loading": "Chargement des sessions…", + "settings_2fa_confirm_btn": "Valider le code 2FA", + "settings_2fa_copy_btn": "📋 Copier les codes", + "settings_2fa_disable_btn": "Désactiver la 2FA", + "settings_2fa_download_btn": "💾 Télécharger (.txt)", + "settings_2fa_enable_btn": "Activer la 2FA", + "settings_2fa_qr_desc": "Scannez ce QR code avec votre application d’authentification, ou saisissez la clé manuellement :", + "settings_2fa_recovery_desc": "Conservez ces 8 codes en lieu sûr. Chaque code permet de vous connecter une fois en secours.", + "settings_2fa_recovery_title": "⚠️ Codes de récupération (secours)", + "settings_2fa_regen_btn": "Régénérer les codes", + "settings_2fa_title": "Double identification (2FA) & Codes de secours", + "twofa_loading": "Chargement…", + "twofa_state_disabled": "Désactivée.", + "twofa_state_enabled": "Activée : un code TOTP ou un code de secours sera demandé à chaque connexion. (Codes de secours restants : {rem} / 8)", + "twofa_state_pending": "Activation en cours : scannez le QR code et saisissez le code à 6 chiffres de votre application.", + "session_current_badge": "● Actuelle", + "session_unknown_machine": "Machine inconnue", + "session_browser_default": "Navigateur Web", + "session_no_active": "Aucune session active trouvée", + "session_load_failed": "Impossible de charger les sessions", + "session_rename_prompt": "Entrez un nom personnalisé pour cette machine :", + "session_rename_saving": "Enregistrement du nom…", + "session_renamed_success": "Machine renommée avec succès !", + "session_revoke_confirm_current": "Déconnecter cette session actuelle ? Vous serez immédiatement redirigé vers la page de connexion.", + "session_revoke_confirm_other": "Forcer la déconnexion de l'appareil « {device} » ({ip}) ?", + "session_revoke_progress": "Déconnexion de la session en cours…", + "session_revoked_success": "Session déconnectée avec succès.", + "rename_session_device": "Renommer cet appareil", + "passkey_empty": "Aucune Passkey enregistrée pour le moment. Cliquez sur « ➕ Enregistrer une nouvelle Passkey » ci-dessus pour associer votre empreinte (Touch ID / Windows Hello), Face ID ou clé physique (YubiKey).", + "passkey_never": "Jamais", + "passkey_biometric_desc": "Sécurité biométrique / FIDO2", + "passkey_load_failed": "Impossible de charger les Passkeys", + "passkey_not_supported_alert": "⚠️ Votre navigateur ne supporte pas l’API WebAuthn / Passkeys ou vous êtes en connexion non sécurisée (HTTPS ou localhost requis).", + "passkey_not_supported_row": "Navigateur ou contexte non compatible avec WebAuthn", + "rename_passkey_tooltip": "Renommer cette clé de sécurité", + "passkey_rename_prompt": "Entrez le nouveau nom de la clé de sécurité :", + "passkey_rename_empty_alert": "Le nom de la clé de sécurité ne peut pas être vide.", + "passkey_rename_saving": "Enregistrement du nouveau nom…", + "passkey_renamed_success": "Clé renommée avec succès !", + "passkey_delete_confirm": "Êtes-vous sûr de vouloir supprimer la Passkey « {name} » ?", + "passkey_register_success": "Passkey enregistrée avec succès !", + "unknown_m": "Inconnu", + "settings_admin_confirm_pwd": "Confirmation du mot de passe", + "settings_admin_confirm_pwd_label": "Confirmation du mot de passe", + "settings_admin_current_pwd": "Mot de passe actuel", + "settings_admin_current_pwd_label": "Mot de passe actuel", + "settings_admin_new_pwd": "Nouveau mot de passe", + "settings_admin_new_pwd_label": "Nouveau mot de passe", + "settings_admin_save_btn": "Modifier les identifiants", + "settings_admin_sub": "Modifier l’identifiant et le mot de passe de connexion au tableau de bord.", + "settings_admin_subtitle": "Modifier l’identifiant et le mot de passe de connexion au tableau de bord.", + "settings_admin_title": "Compte Administrateur", + "settings_admin_user_label": "Utilisateur administrateur", + "settings_admin_username": "Utilisateur administrateur", + "settings_autoconnect": "Démarrer automatiquement au démarrage", + "settings_bridge_desc": "Les clients Wi‑Fi recevront directement leur adresse IP de votre box Internet.", + "settings_bridge_eth_label": "Interface Ethernet de la box (mode pont)", + "settings_max_clients_label": "Limite de clients simultanés (0 = illimité)", + "settings_mode_label": "Mode de fonctionnement", + "settings_notif_desc": "Recevez des alertes en temps réel par Email, Gotify ou Discord lors d’événements critiques ou de dépassement de quota.", + "settings_notif_save_btn": "Enregistrer les notifications", + "settings_notif_sub": "Recevez des alertes en temps réel par Email, Gotify ou Discord lors d’événements réseau ou d’accès.", + "settings_notif_subtab_alerts": "✏️ Personnalisation des alertes", + "settings_notif_subtab_services": "📡 Services de notification", + "settings_notif_tab_alerts": "Personnalisation des alertes", + "settings_notif_tab_services": "Services de notification (9)", + "settings_notif_test_all": "🧪 Tester tous les canaux actifs", + "settings_notif_title": "Notifications & Alertes", + "settings_passkeys_add_btn": "➕ Enregistrer une nouvelle Passkey", + "settings_passkeys_desc": "Connectez-vous instantanément sans mot de passe et sans double vérification avec Touch ID, Face ID, Windows Hello ou une clé USB physique (YubiKey).", + "settings_passkeys_loading": "Chargement des Passkeys…", + "settings_passkeys_title": "🔑 Clés de sécurité & Passkeys (FIDO2 / Biométrie)", + "settings_proxy_btn_test": "🔄 Tester la détection", + "settings_proxy_desc": "Définissez la détection de la véritable adresse IP cliente lorsque votre point d’accès est placé derrière un reverse proxy (Nginx, Traefik, Caddy, Cloudflare, HAProxy, etc.). Cela garantit que les journaux de connexion et sessions affichent la vraie IP de la machine cliente plutôt que celle du proxy.", + "settings_proxy_diag_active": "● Détection active", + "settings_proxy_diag_raw": "IP BRUTE REÇUE (PROXY OU SOCKET)", + "settings_proxy_diag_real": "IP CLIENT RÉELLE ENREGISTRÉE", + "settings_proxy_diag_title": "🔍 Détection de l'IP en direct (Votre connexion actuelle)", + "settings_proxy_diag_xff": "EN-TÊTE X-FORWARDED-FOR", + "settings_proxy_diag_xri": "EN-TÊTE X-REAL-IP", + "settings_proxy_enable_chk": "Activer la prise en charge du Reverse Proxy", + "settings_proxy_enable_desc": "Lorsque cette option est activée, AP Manageur extrait l'adresse IP réelle de la machine cliente à partir des en-têtes HTTP transmis par votre reverse proxy au lieu de consigner l'adresse IP locale du proxy lui-même.", + "settings_proxy_examples_title": "💡 Exemples de configuration pour votre Reverse Proxy", + "settings_proxy_header_label": "En-tête HTTP prioritaire pour l'IP réelle", + "settings_proxy_save_btn": "💾 Enregistrer les réglages du proxy", + "settings_proxy_title": "🔀 Configuration du Proxy Inversé (Reverse Proxy)", + "settings_proxy_trust_private": "Faire confiance à tous les réseaux privés et conteneurs Docker", + "settings_proxy_trusted_ips_label": "Adresses IP ou plages CIDR des proxys de confiance supplémentaires", + "settings_pwd_label": "Mot de passe Wi‑Fi", + "settings_save_wifi": "Enregistrer les réglages", + "settings_security_label": "Sécurité Wi‑Fi", + "settings_sessions_desc": "Appareils et navigateurs actuellement connectés avec les identifiants d’administration.", + "settings_sessions_loading": "Chargement des sessions…", + "settings_sessions_title": "Sessions connectées au compte administrateur", + "settings_show_confirm_pwd": "Afficher la confirmation du mot de passe", + "settings_show_cur_pwd": "Afficher le mot de passe actuel", + "settings_show_key": "Afficher la clé", + "settings_show_new_pwd": "Afficher le nouveau mot de passe", + "settings_show_token": "Afficher le jeton", + "settings_ssid_label": "Nom du SSID", + "settings_tab_admin": "Compte Admin", + "settings_tab_custom": "Personnalisation", + "settings_tab_danger": "Zone dangereuse", + "settings_tab_notif": "Notifications", + "settings_tab_proxy": "Proxy inversé", + "settings_tab_vpn": "Profils VPN", + "settings_tab_wifi": "Wi‑Fi & Réseau", + "settings_vpn_add_btn": "➕ Ajouter un profil VPN", + "settings_vpn_direct_clients": "Clients en WAN direct", + "settings_vpn_empty_desc": "Importez un fichier .conf (WireGuard) ou .ovpn (OpenVPN) pour commencer.", + "settings_vpn_empty_title": "Aucun profil VPN configuré", + "settings_vpn_killswitch_active": "Kill-Switch actifs", + "settings_vpn_profiles_count": "Profils VPN disponibles", + "settings_vpn_routed_clients": "Clients routés via VPN", + "settings_vpn_sub": "Gérez vos profils VPN pour router le trafic Internet via des tunnels chiffrés.", + "settings_vpn_subtitle": "Gérez vos profils VPN pour router le trafic client et sécuriser les échanges.", + "settings_vpn_title": "Profils VPN WireGuard & OpenVPN", + "settings_wifi_autoconnect": "Démarrer automatiquement au démarrage", + "settings_wifi_eth": "Interface Ethernet de la box (mode pont)", + "settings_wifi_max_clients": "Limite de clients simultanés (0 = illimité)", + "settings_wifi_mode": "Mode de fonctionnement", + "settings_wifi_pwd": "Mot de passe Wi‑Fi", + "settings_wifi_save_btn": "Enregistrer les réglages", + "settings_wifi_security": "Sécurité Wi‑Fi", + "settings_wifi_ssid": "Nom du SSID", + "settings_wifi_sub": "Les changements redémarrent la connexion Wi‑Fi active.", + "settings_wifi_subtitle": "Les changements redémarrent la connexion Wi‑Fi active.", + "settings_wifi_title": "Réglages AP", + "setup_create_btn": "Créer le réseau", + "setup_eth_desc": "Les clients Wi‑Fi recevront directement leur adresse IP de votre box Internet.", + "setup_eth_label": "Interface Ethernet de la box (mode pont)", + "setup_intro": "Aucun réseau Wi‑Fi n’est configuré. Créez votre point d’accès avec un SSID et un mot de passe.", + "setup_max_clients_label": "Limite de clients simultanés (0 = illimité)", + "setup_mode_ap": "Mode AP (Routeur)", + "setup_mode_ap_desc": "DHCP interne (10.42.0.x) & NAT", + "setup_mode_bridge": "Mode Bridge (Pont)", + "setup_mode_bridge_desc": "Utilise le DHCP de la box", + "setup_mode_label": "Mode de fonctionnement", + "setup_notice": "Caractéristiques requises : SSID de 1 à 32 caractères, mot de passe WPA de 8 à 63 caractères. Le réseau sera démarré automatiquement.", + "setup_notice_req": "Caractéristiques requises
SSID : 1 à 32 caractères.
Mot de passe WPA : 8 à 63 caractères, recommandé avec des lettres, des chiffres et des symboles.
Le réseau sera démarré automatiquement au démarrage de la machine.", + "setup_pwd_confirm_label": "Confirmation du mot de passe Wi‑Fi", + "setup_pwd_label": "Mot de passe Wi‑Fi", + "setup_security_label": "Sécurité Wi‑Fi", + "setup_ssid_label": "Nom du SSID", + "setup_submit": "Créer le réseau", + "setup_title": "Configuration initiale", + "signal_excellent": "Excellent", + "signal_fair": "Moyen", + "signal_good": "Bon", + "signal_weak": "Faible", + "stats_chart_sub_day": "Fréquentation par heure (aujourd’hui)", + "stats_chart_subtitle_day": "Fréquentation par heure (aujourd’hui)", + "stats_chart_title": "Fréquentation & Connexions", + "stats_chart_total_connections": "Connexions totales", + "stats_chart_unique_devices": "Appareils uniques", + "stats_connections_total": "connexion(s) au total", + "stats_cron_day_all": "Tous les jours (*)", + "stats_cron_day_label": "📅 Jour d’exécution", + "stats_cron_day_workdays": "Jours ouvrés (Lundi à Vendredi)", + "stats_cron_desc": "Configurez la périodicité d'envoi automatique (Jour, Heure, Minute)", + "stats_cron_range_all": "Toutes les périodes (Jour, Sem., Mois, An)", + "stats_cron_range_day": "Aujourd’hui (Par jour)", + "stats_cron_range_month": "Ce mois (Par mois)", + "stats_cron_range_week": "Cette semaine (Par semaine)", + "stats_cron_range_year": "Cette année (Par année)", + "stats_cron_send_now_btn": "Envoyer le rapport maintenant (Test)", + "stats_cron_tab_title": "📊 Rapport planifié des statistiques et métriques (Tâche Cron)", + "stats_cron_title": "Planification Cron du rapport statistique", + "stats_cron_top_range_label": "📊 Période Top clients", + "stats_current_slot_badge": "● Tranche actuelle", + "stats_details_title": "Détail des connexions", + "stats_loading": "Chargement…", + "stats_no_data": "Aucune statistique disponible", + "stats_range_day": "Par jour", + "stats_range_month": "Par mois", + "stats_range_week": "Par semaine", + "stats_range_year": "Par année", + "stats_report_cron_default": "📅 Tous les jours à 08:00", + "stats_report_cron_expr_label": "⚙️ Expression Cron calculée", + "stats_report_hour_label": "🕐 Heure (00 - 23)", + "stats_report_minute_label": "⏱️ Minute (00 - 59)", + "stats_subtab_metrics": "Fréquentation & Métriques", + "stats_subtab_topology": "Topologie du réseau", + "stats_this_month": "Ce mois-ci", + "stats_this_week": "Cette semaine", + "stats_this_year": "Cette année", + "stats_tip_clients": "client(s) unique(s)", + "stats_tip_connections": "connexion(s)", + "stats_today": "Aujourd’hui", + "stats_top_clients_sub": "Appareils ayant le plus consommé aujourd’hui (Par jour)", + "stats_top_clients_title": "Top des clients (Consommation de données)", + "stats_upcoming": "(À venir)", + "status_active": "Actif", + "status_blocked": "Bloqué", + "status_connected": "Connecté", + "status_disconnected": "Déconnecté", + "status_error": "Erreur", + "status_inactive": "Inactif", + "status_offline": "Hors ligne", + "status_offline_conn": "Hors connexion", + "status_online": "En ligne", + "status_online_live": "En direct", + "currently_online": "Actuellement en ligne", + "unknown_f": "Inconnue", + "stored_in_db": "Mémorisé en BDD", + "th_action": "ACTION", + "th_actions": "ACTIONS", + "th_added_date": "DATE D’AJOUT", + "th_blocked_on": "BLOQUÉ LE", + "th_browser": "NAVIGATEUR", + "th_cat_desc": "DESCRIPTION", + "th_cat_id": "IDENTIFIANT", + "th_cat_name": "NOM DE LA CATÉGORIE", + "th_category_desc": "DESCRIPTION", + "th_category_id": "IDENTIFIANT", + "th_category_name": "NOM DE LA CATÉGORIE", + "th_date": "DATE", + "th_device": "APPAREIL", + "th_domain": "NOM DE DOMAINE", + "th_downloaded": "TÉLÉCHARGÉ (↓)", + "th_dst": "DESTINATION", + "th_effective_status": "STATUT EFFECTIF", + "th_event": "ÉVÉNEMENT", + "th_first_connection": "PREMIÈRE CONNEXION", + "th_identified_devices": "APPAREILS IDENTIFIÉS", + "th_info": "INFO & DÉTAILS", + "th_ip": "IP", + "th_ip_mac": "ADRESSES IP & MAC", + "th_killswitch": "KILL-SWITCH", + "th_last_activity": "DERNIÈRE ACTIVITÉ", + "th_last_ip": "DERNIÈRE IP", + "th_last_used": "DERNIÈRE UTILISATION", + "th_logo": "LOGO", + "th_mac": "ADRESSE MAC", + "th_num": "N°", + "th_os": "SYSTÈME (OS)", + "th_passkey_name": "NOM DE LA PASSKEY", + "th_period": "PÉRIODE", + "th_proto": "PROTO", + "th_quota": "QUOTA & DÉBIT", + "th_routing": "ROUTAGE INTERNET", + "th_signal": "SIGNAL", + "th_size": "TAILLE", + "th_speed": "DÉBIT (TEMPS RÉEL)", + "th_src": "SOURCE", + "th_status": "STATUT ACTUEL", + "th_time": "HEURE", + "th_total_connections": "CONNEXIONS TOTALES", + "th_total_transferred": "TOTAL TRANSFÉRÉ", + "th_unique_devices": "APPAREILS UNIQUES", + "th_uploaded": "UPLOADÉ (↑)", + "th_vpn_assigned": "PROFIL VPN ASSIGNÉ", + "top_clients_sub_day": "Appareils ayant le plus consommé aujourd’hui (Par jour)", + "top_clients_sub_month": "Appareils ayant le plus consommé ce mois-ci (Par mois)", + "top_clients_sub_week": "Appareils ayant le plus consommé cette semaine (Par semaine)", + "top_clients_sub_year": "Appareils ayant le plus consommé cette année (Par année)", + "topo_ap_status": "AP : wlan0 (Canal 6)", + "topo_ap_title": "AP Wi-Fi", + "topo_blocked_devices": "Appareils bloqués / isolés", + "topo_clients_connected": "{count} connecté(s)", + "topo_clients_connected_count": "0 connecté(s)", + "topo_device_repartition": "Répartition des Appareils", + "topo_direct_wan": "Direct WAN (Box)", + "topo_down_tx": "Débit descendant cumulé (TX)", + "topo_export": "Exporter la topologie ▾", + "topo_export_jpg": "📷 Format JPG (.jpg)", + "topo_export_png": "🖼️ Format PNG (.png)", + "topo_gateway": "Passerelle Internet", + "topo_gateway_online": "Passerelle : En ligne", + "topo_gateway_standby": "Passerelle : En veille", + "topo_gateway_title": "Passerelle Internet", + "topo_legend_fair": "● Moyen (-70 dBm)", + "topo_legend_good": "● Bon (-60 dBm)", + "topo_legend_links": "Liaisons :", + "topo_legend_vpn": "● Rouge : Tunnel VPN actif", + "topo_legend_weak": "● Faible (< -70 dBm)", + "topo_legend_wifi_good": "● Vert : Wi‑Fi > -50 dBm", + "topo_link_excellent": "● Vert : Wi‑Fi > -50 dBm", + "topo_link_fair": "● Moyen (-70 dBm)", + "topo_link_good": "● Bon (-60 dBm)", + "topo_link_vpn": "● Rouge : Tunnel VPN actif", + "topo_link_weak": "● Faible (< -70 dBm)", + "topo_link_wifi": "● Vert : Wi‑Fi > -50 dBm", + "topo_links_legend": "Liaisons :", + "topo_live_badge": "En direct", + "topo_live_bandwidth": "Bande Passante en Direct", + "topo_mac_filtering": "Filtrage matériel par adresse MAC", + "topo_modal_ap_title": "Point d’Accès Wi‑Fi (AP Manageur)", + "topo_modal_title": "Inspection de l'équipement", + "topo_modal_wan_title": "Passerelle Internet (WAN)", + "topo_no_clients": "Aucun client connecté", + "topo_no_clients_desc": "Aucun client connecté", + "topo_search_ph": "Filtrer un appareil (nom, IP, MAC)…", + "topo_security_filtering": "Sécurité & Filtrage", + "topo_sig_excellent": "● Excellent", + "topo_sig_fair": "● Moyen", + "topo_sig_good": "● Bon", + "topo_sig_weak": "● Faible", + "topo_signal_quality": "Qualité du Signal Wi-Fi", + "topo_status_wan": "Passerelle : En ligne", + "topo_subtitle": "Cartographie interactive des équipements et liaisons réseau en temps réel", + "topo_title": "Topologie du réseau Wi‑Fi", + "topo_up_rx": "Débit montant cumulé (RX)", + "topo_vpn_active": "🛡️ VPN : {count} actif", + "topo_vpn_active_badge": "🛡️ VPN : {n} actif(s)", + "topo_wan_gateway_label": "Passerelle Internet", + "topo_wan_link": "⚡ Liaison Filaire / WAN", + "topo_wan_link_badge": "⚡ Liaison Filaire / WAN", + "topo_wifi_links": "📶 Liaisons Wi‑Fi sans fil (802.11)", + "topo_wifi_links_label": "📶 Liaisons Wi‑Fi sans fil (802.11)", + "twofa_download_codes_btn": "💾 Télécharger les codes de récupération", + "twofa_help_text": "Le mot de passe actuel saisi ci-dessus et un code (TOTP ou secours) sont requis.", + "twofa_key_label": "Clé :", + "twofa_qr_scan_prompt": "Scannez ce QR code avec votre application d’authentification, ou saisissez la clé manuellement :", + "twofa_recovery_desc": "Conservez ces 8 codes en lieu sûr. En cas de perte de votre application TOTP, chaque code ne peut servir qu’une seule fois.", + "twofa_recovery_title": "⚠️ Codes de récupération (secours)", + "unblock": "Débloquer", + "unknown_client": "Nom non communiqué", + "unlimited": "Illimité", + "view_config": "Voir la configuration", + "vpn_add_first_profile_btn": "Ajouter un premier profil", + "vpn_add_profile_btn": "Ajouter un profil VPN", + "vpn_assigned_offline": "🛡️ Assigné à", + "vpn_auth_pass_label": "Mot de passe", + "vpn_auth_user_label": "Nom d’utilisateur", + "vpn_auto_test_5min": "Test automatique effectué toutes les 5 min", + "vpn_autoconnect_badge": "⚡ Démarrage automatique actif", + "vpn_block_if_down": "Bloquer si coupé", + "vpn_btn_filter_online": "🟢 En ligne", + "vpn_btn_filter_routed": "🛡️ Routés", + "vpn_clients_empty_msg": "Aucun équipement Wi‑Fi détecté pour le moment.", + "vpn_direct": "🌐 Connexion directe WAN (Sans VPN)", + "vpn_killswitch_blocked": "⚠️ Bloqué (Kill-Switch)", + "vpn_killswitch_chk": "Bloquer si coupé", + "vpn_lan_isolated": "🔒 Isolé LAN", + "vpn_lan_isolated_title": "Réseau local inaccessible (Isolation LAN active)", + "vpn_lan_isolated_tooltip": "Réseau local inaccessible (Isolation LAN active)", + "vpn_modal_title": "Ajouter un profil VPN", + "vpn_no_profiles_desc": "Importez un fichier .conf (WireGuard) ou .ovpn (OpenVPN) pour commencer à router vos appareils.", + "vpn_no_profiles_title": "Aucun profil VPN configuré", + "vpn_offline_wan": "⚪ Hors ligne (WAN direct)", + "vpn_pending_test": "⚠️ En attente de test", + "vpn_profile_name_label": "Nom du profil", + "vpn_profile_type_label": "Type de protocole", + "vpn_public_ip_label": "IP publique VPN :", + "vpn_routed_tooltip": "Routé via VPN", + "vpn_routed_via": "🟢 Routé via", + "vpn_test_btn": "🔄 Tester", + "vpn_test_tooltip": "Tester la connexion et rafraîchir l'IP publique", + "vpn_traffic_encrypted_via": "Trafic chiffré via", + "vpn_view_config": "Voir la configuration", + "vpn_wan_direct": "🌐 WAN Direct", + "vpn_wan_direct_down": "⚠️ WAN Direct (VPN inactif)", + "vpn_card_interface": "Interface :", + "vpn_card_table_pbr": "Table PBR :", + "vpn_card_transfer": "Transfert :", + "vpn_last_test": "Dernier test :", + "vpn_handshake_active": "Handshake actif (il y a {sec}s)", + "vpn_handshake_recent": "Dernier handshake il y a {min} min", + "vpn_handshake_older": "Dernier handshake il y a {h} h", + "vpn_handshake_waiting": "En attente du handshake (non reçu)", + "vpn_error_prefix": "Erreur :", + "vpn_connected_suffix": "connecté(s)", + "vpn_protocol_label": "Protocole :", + "status_connecting": "Connexion...", + "btn_test": "Tester", + "vpn_modal_edit_title": "Modifier le profil VPN : {name}", + "vpn_err_enter_name": "Veuillez saisir un nom pour ce profil.", + "vpn_err_enter_config": "Veuillez coller ou importer la configuration du VPN.", + "vpn_btn_saving": "Enregistrement...", + "vpn_delete_confirm": "Êtes-vous sûr de vouloir supprimer le profil VPN « {name} » ?\\nToute assignation client associée reviendra sur la connexion directe WAN.", + "vpn_view_modal_title": "Configuration VPN : {name} ({type})", + "vpn_copied_btn": "✓ Copié !", + "vpn_ip_detected": "IP publique VPN détectée : {ip}", + "vpn_ip_error": "Impossible d’obtenir l’IP publique via ce profil VPN", + "btn_block": "Bloquer", + "btn_block_action": "🚫 Bloquer", + "btn_block_this_device": "🚫 Bloquer cet appareil", + "btn_details": "🔍 Détails", + "btn_manage_vpn_routing": "⚙️ Gérer le routage VPN", + "btn_unblock": "Débloquer", + "client_unknown": "Client inconnu", + "mode_bridge_label": "Pont réseau (Bridge)", + "mode_nat_label": "Point d’accès (Routeur Wi-Fi)", + "stats_today_from_to": "Aujourd’hui de {start} à {end}", + "topo_active_clients_count": "{n} client(s) actif(s)", + "topo_channel": "Canal", + "topo_devices_routed_tunnel": "{count} appareil(s) routé(s) via ce tunnel", + "topo_ip_bridge_lan": "IP Pont LAN", + "topo_modal_connected_devs": "APPAREILS CONNECTÉS", + "topo_modal_dev_details": "Détails de l’équipement : {name}", + "topo_modal_dev_name": "NOM DE L’APPAREIL", + "topo_modal_dns_servers": "SERVEURS DNS", + "topo_modal_gw_ip": "ADRESSE IP PASSERELLE", + "topo_modal_hw_type": "TYPE MATÉRIEL", + "topo_modal_inst_speed": "DÉBIT INSTANTANÉ", + "topo_modal_ip_addr": "ADRESSE IP", + "topo_modal_live_speed": "DÉBIT EN DIRECT", + "topo_modal_local_ip": "IP LOCALE AP", + "topo_modal_mac_addr": "ADRESSE MAC", + "topo_modal_net_mode": "MODE RÉSEAU", + "topo_modal_out_iface": "INTERFACE SORTANTE", + "topo_modal_pbr_table": "TABLE PBR NOYAU", + "topo_modal_prof_name": "NOM DU PROFIL", + "topo_modal_public_ip": "IP PUBLIQUE DU TUNNEL", + "topo_modal_radio_channel": "RADIO & CANAL", + "topo_modal_routed_devs": "APPAREILS ROUTÉS", + "topo_modal_routing_vpn": "ROUTAGE INTERNET / VPN", + "topo_modal_security": "SÉCURITÉ", + "topo_modal_sig_quality": "QUALITÉ DU SIGNAL", + "topo_modal_ssid": "NOM DU SSID", + "topo_modal_sys_iface": "INTERFACE SYSTÈME", + "topo_modal_vpn_desc": "Tout le trafic Internet des équipements associés à ce profil est chiffré et acheminé exclusivement à travers ce tunnel VPN.", + "topo_modal_vpn_proto": "PROTOCOLE VPN", + "topo_modal_vpn_title": "Tunnel VPN : {name}", + "topo_modal_wan_desc": "La passerelle assure la connectivité vers Internet pour tous les appareils connectés au point d’accès Wi‑Fi via routage et translation d’adresses NAT.", + "topo_modal_wan_status": "STATUT WAN", + "topo_modal_wifi_iface": "INTERFACE SANS FIL", + "topo_no_clients_title": "Aucun appareil connecté au point d'accès", + "topo_tunnel_active": "Tunnel actif", + "topo_tunnel_encrypted_ok": "Tunnel chiffré opérationnel", + "vpn_status_disconnected_short": "(Coupé)", + "btn_hide_token": "Masquer le jeton", + "btn_show_token": "Afficher le jeton", + "backup_no_pending": "Aucune donnée de sauvegarde en attente.", + "backup_select_one_category": "Veuillez cocher au moins une catégorie d'éléments à restaurer.", + "backup_confirm_restore_auth": "⚠️ ATTENTION : Vous avez choisi de restaurer le compte administrateur. Cela écrasera les identifiants, mots de passe et clés passkeys actuels. Voulez-vous continuer ?", + "backup_restoring": "Restauration en cours…", + "backup_applying_to_db": "Application de la sauvegarde dans la base de données…", + "backup_downloaded_success": "✓ Sauvegarde complète téléchargée ({size} Ko) ! Contient la configuration JSON et la base SQLite brute.", + "backup_export_err": "Erreur exportation : ", + "backup_invalid_file": "Le fichier sélectionné ne semble pas être une sauvegarde valide d'AP Manageur (clés de sauvegarde introuvables).", + "backup_json_read_err": "Erreur lors de la lecture du fichier JSON : ", + "backup_read_file_err": "Impossible de lire le fichier sélectionné.", + "backup_parse_err": "Erreur d'analyse de la sauvegarde : ", + "passkey_https_alert": "Les Passkeys nécessitent un navigateur moderne et un contexte sécurisé (HTTPS ou localhost).", + "passkey_register_prompt": "Donnez un nom à cette Passkey (ex: MacBook Touch ID, iPhone Face ID, YubiKey 5C) :", + "passkey_waiting_validation": "En attente de votre validation biométrique ou physique sur votre appareil…", + "passkey_register_err": "Erreur d’enregistrement Passkey : ", + "twofa_codes_downloaded": "Fichier des codes de récupération téléchargé !", + "twofa_codes_generating_dl": "Génération et téléchargement des codes de secours…", + "twofa_codes_generating": "Génération de nouveaux codes…", + "err_enter_current_pwd": "Saisissez votre mot de passe administrateur actuel", + "notif_testing_progress": "⏳ Envoi de la notification de test en cours…", + "notif_testing_btn": "Test en cours…", + "notif_test_success": "Test réussi !", + "notif_test_partial_failure": "Certains tests ont échoué", + "notif_test_err": "❌ Erreur lors du test : ", + "stats_cron_day_weekend": "Week-end (Samedi & Dimanche)", + "stats_cron_day_mon": "Chaque Lundi", + "stats_cron_day_tue": "Chaque Mardi", + "stats_cron_day_wed": "Chaque Mercredi", + "stats_cron_day_thu": "Chaque Jeudi", + "stats_cron_day_fri": "Chaque Vendredi", + "stats_cron_day_sat": "Chaque Samedi", + "stats_cron_day_sun": "Chaque Dimanche", + "stats_cron_expr_label": "⚙️ Expression Cron standard", + "stats_cron_format_hint": "Format Cron : minute heure jour mois jour_semaine (ex : 0 8 * * * = 08h00 chaque jour, 30 18 * * 5 = 18h30 chaque vendredi).", + "stats_cron_hourly_at": "toutes les heures à :{min}", + "stats_cron_at_time": "à {time}", + "stats_cron_day_all_short": "Tous les jours", + "stats_cron_day_workdays_short": "Jours ouvrés (Lun-Ven)", + "stats_cron_day_weekend_short": "Week-end (Sam-Dim)", + "stats_cron_day_prefix": "Jour ", + "stats_report_sending": "⏳ Envoi du rapport statistiques en cours…", + "proxy_label_proto": "Protocole amont (X-Forwarded-Proto) :", + "proxy_opt_xff": "X-Forwarded-For (Standard RFC 7239 / Nginx / Traefik / Caddy)", + "proxy_opt_true_client_ip": "True-Client-IP (Cloudflare Enterprise / Akamai)", + "lang_card_fr_name": "Français", + "lang_card_fr_country": "France", + "lang_card_enus_name": "English (US)", + "lang_card_enus_country": "United States", + "lang_card_engb_name": "English (UK)", + "lang_card_engb_country": "United Kingdom", + "lang_opt_fr": "Français (France)", + "lang_opt_enus": "English (US) — American", + "lang_opt_engb": "English (UK) — British", + "placeholder_app_name": "Administration de l’AP Wi‑Fi", + "placeholder_app_short_name": "AP Manageur", + "custom_saved_msg": "Personnalisation enregistrée sur le serveur", + "custom_saving": "Enregistrement…", + "no_categories_defined": "Aucune catégorie définie", + "modal_cat_edit_title_with_name": "Modifier la catégorie « {label} »", + "modal_cat_err_name": "Veuillez indiquer un nom pour la catégorie.", + "modal_cat_err_id": "Veuillez indiquer un identifiant technique unique.", + "modal_cat_err_id_chars": "L’identifiant ne peut contenir que des lettres minuscules, chiffres, tirets ou soulignés.", + "modal_cat_cannot_delete_last": "Impossible de supprimer la dernière catégorie d’appareil.", + "modal_cat_confirm_delete": "Êtes-vous sûr de vouloir supprimer la catégorie « {label} » ?\n\nTous les appareils associés à cette catégorie basculeront automatiquement sur la catégorie Standard.", + "saving_in_progress": "Enregistrement en cours…", + "deleting_in_progress": "Suppression en cours…", + "resetting_in_progress": "Réinitialisation en cours…", + "settings_hide_new_pwd": "Masquer le nouveau mot de passe", + "settings_hide_confirm_pwd": "Masquer la confirmation du mot de passe", + "settings_hide_cur_pwd": "Masquer le mot de passe actuel", + "settings_hide_token": "Masquer le jeton", + "settings_hide_key": "Masquer la clé", + "vpn_direct_clients_desc": "Sans VPN (connexion normale)", + "vpn_killswitch_active_desc": "Protection anti-fuite", + "vpn_btn_filter_all": "Tous", + "vpn_btn_filter_offline": "⚪ Hors ligne", + "adv_routing_empty": "Aucun équipement Wi‑Fi détecté pour le moment.", + "packets_kept_plural": "paquets conservés", + "packets_kept_singular": "paquet conservé", + "adv_pcap_status_running": "Enregistrement...", + "adv_pcap_status_stopping": "Arrêt...", + "adv_pcap_status_inactive": "Inactif", + "adv_pcap_capture_in_progress": "Capture en cours ({time})", + "adv_pcap_iface_label": "Interface Wi-Fi : ", + "adv_pcap_filter_domain_tooltip": "Filtrer sur ce domaine", + "adv_pcap_confirm_clear": "Effacer tous les paquets capturés ?", + "adv_pcap_no_packets_export": "Aucun paquet à exporter", + "adv_pcap_err_start": "Erreur démarrage capture", + "adv_pcap_err_stop": "Erreur arrêt capture", + "adv_pcap_err_clear": "Erreur effacement", + "adv_pcap_filter_icmp": "ICMP (Ping)", + "adv_pcap_filter_tls": "TLS / HTTPS", +}; diff --git a/setup.html b/setup.html new file mode 100644 index 0000000..c826732 --- /dev/null +++ b/setup.html @@ -0,0 +1,3949 @@ + + + + + + + + + + Configuration initiale - AP Manageur + + + + + + + + + + + + + + +
+
+
+

+ Logo + Logo + Administration de l’AP Wi‑Fi +

+
+ AP Manageur + V5.5 + Configuration initiale +
+
+
+ + + + + +
+ + + + +
+ + + + +
+
+

👋 Bienvenue sur AP Manageur

+

+ Cet assistant vous accompagne pas à pas pour initialiser votre point d'accès Wi-Fi et sécuriser l'accès à + votre tableau de bord. +

+
+ +
+ 🚀 Mise en route en 6 étapes simples : +
    +
  • Définition du nom (SSID) et du mot de passe de votre réseau sans fil
  • +
  • Création du compte administrateur du tableau de bord
  • +
  • Paramétrage des alertes et notifications (optionnel)
  • +
  • Personnalisation du thème, des profils VPN et des préférences (optionnel) +
  • +
+
+ +
+ +
+ +
+ + + + + +
+
Français
+
France
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
English (US)
+
United States
+
+
+ + +
+ + + + + + + + + + + + +
+
English (UK)
+
United Kingdom
+
+
+
+
+ + + + +
+
Étape 1 sur 6 +
+
+ + +
+
+
+ + + + +
+
+

📶 Configuration du réseau Wi-Fi +

+

+ Configurez le nom de diffusion (SSID), la clé de sécurité et le mode de routage. +

+
+ + + +

1 à 32 caractères + visibles par vos téléphones, PC et équipements.

+ + +
+ + +
+ + +
+ + +
+ + + + + +
+ + +
+ + + + + + + + +
+ +
+ +
+
+
+ + + + +
+
+

🛡️ Création du compte + administrateur

+

+ Définissez le compte d'administration qui protégera l'accès au tableau de bord. +

+
+ + + + + + + +
+ + +
+ + +
+ + +
+ +
+ 🔐 Sécurité renforcée : Une fois le compte créé, vous pourrez activer l'authentification à + double facteur (2FA TOTP) et enregistrer des clés Passkeys (WebAuthn / Empreinte) dans les Paramètres. +
+ + + +
+ +
+ +
+
+
+ + + + +
+
+

🔔 Notifications & Alertes

+

+ Configurez des alertes en temps réel lors des connexions, déconnexions ou blocages d'appareils. +

+
+ + + + + +
+ 💡 Facultatif : Vous pouvez ignorer cette étape et configurer vos notifications + ultérieurement depuis le tableau de bord. +
+ +
+ +
+ + +
+
+
+ + + + +
+
+

🎨 Options facultatives

+

+ Personnalisez l'apparence visuelle, les profils VPN et le comportement de votre point d'accès. +

+
+ + +
+
+
🖥️
+
Auto (Système)
+
+
+
🌙
+
Sombre
+
+
+
☀️
+
Clair
+
+
+
🪟
+
Windows XP
+
+
+
🚀
+
Futuriste
+
+
+
🍏
+
macOS
+
+
+
🟩
+
Hacker
+
+
+ + + + + + + +
+
+
+

+ + + + + Profils VPN (WireGuard / OpenVPN) + Optionnel +

+

+ Importez ou configurez dès maintenant des tunnels VPN pour router le trafic de vos appareils. +

+
+ +
+ +
+
+ Aucun profil VPN ajouté pour le moment. +
+
+
+ +
+ +
+ +
+
+
+ + + + +
+
+

✨ Fin de configuration

+

+ Tous vos paramètres sont prêts ! Vérifiez les informations ci-dessous puis lancez le point d'accès. +

+
+ +
+ +
+
📶 Réseau Wi-Fi
+
—
+
Mode AP • WPA2
+
+ + +
+
🛡️ Administrateur +
+
admin
+
Mot de passe défini + (••••••••)
+
+ + +
+
🔔 Notifications +
+
Désactivées
+
Modifiable ultérieurement +
+
+ + +
+
🌐 Profils VPN
+
Aucun profil configuré
+
Internet direct par défaut
+
+ + +
+
🎨 Options & Thème +
+
Auto (Système)
+
Démarrage auto : Oui +
+
+
+ +
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/up.sh b/up.sh new file mode 100755 index 0000000..a37c0af --- /dev/null +++ b/up.sh @@ -0,0 +1,21 @@ +# Connexion au registre Gitea +read -rsp "Jeton Gitea : " GITEA_TOKEN; echo +printf '%s' "$GITEA_TOKEN" | docker login \ + gitea.yoann-nas.fr \ + -u yoannmultigaming \ + --password-stdin +unset GITEA_TOKEN + +# Créer le constructeur s'il n'existe pas encore +if ! docker buildx inspect ap-builder >/dev/null 2>&1; then + docker buildx create --name ap-builder --driver docker-container +fi + +docker buildx use ap-builder +docker buildx inspect --bootstrap + +# Construire et publier directement les deux architectures +docker buildx build \ + --platform linux/amd64,linux/arm64 \ + -t gitea.yoann-nas.fr/yoannmultigaming/apmanageur:latest \ + --push .