AP manageur V1.1 (Bêta)

This commit is contained in:
yoannmultigaming committed 2026-11-25 17:07:50 +01:00
1 parent 8f2ad04086
commit 23b6ccdfa4
5 files changed
+52 -9

No files matched your search

+5 -3
View File
@@ -7418,6 +7418,9 @@ def get_wifi_interface():
def start_capture(target_iface=None):
global capture_running, capture_thread, capture_pcap_bytes, capture_iface_used, capture_started_at
st = status()
if not st.get('active'):
return False, "Le Wi-Fi est coupé : démarrez le point d’accès pour lancer l’analyse des trames"
with capture_lock:
if capture_running:
return True, f"Capture déjà en cours sur {capture_iface_used}"
@@ -10667,9 +10670,6 @@ def _delete_s3(cfg, remote_filename):
req.add_header('Authorization', auth_hdr)
ctx = ssl.create_default_context()
try:
with urllib.request.urlopen(req, context=ctx, timeout=30) as resp:
return True, f"Fichier {remote_filename} supprimé sur S3"
except Exception as e:
return False, f"Erreur suppression S3 : {e}"
def delete_remote_file(remote_filename, custom_cfg=None):
@@ -13153,6 +13153,7 @@ class Handler(BaseHTTPRequestHandler):
start_bridge_hostapd(db_ssid, db_pass, sec=db_sec, bridge_name=b_name, iface=wifi_if)
mark_ap_started()
elif action == 'stop':
stop_capture()
stop_hostapd(wifi_if)
teardown_bridge_dns_redirection(b_name, wifi_if)
try: os.remove(UPTIME_FILE)
@@ -13187,6 +13188,7 @@ class Handler(BaseHTTPRequestHandler):
setup_ap_nat(wifi_if)
mark_ap_started()
elif action == 'stop':
stop_capture()
if name:
r = subprocess.run(['nmcli', 'connection', 'down', name], capture_output=True, text=True, timeout=5)
if r.returncode and 'not an active connection' not in r.stderr.lower():