APmanageur Wi-Fi V1.0

This commit is contained in:
yoannmultigaming committed 2026-11-21 20:00:54 +01:00
1 parent 5eed2d607e
commit ecc8e872f7
8 files changed
+87 -12

No files matched your search

+25
View File
@@ -3508,6 +3508,7 @@ def get_current_commit():
# 2. Sinon, lecture de version.json (conteneur Docker où .git n'est pas présent)
for path in (
'/data/version.json',
os.path.join(BASE_DIR, 'version.json'),
'/app/version.json',
'/var/www/html/version.json',
@@ -10725,6 +10726,30 @@ class Handler(BaseHTTPRequestHandler):
log('modification_identifiants', f"Renommage machine -> {new_name}", request_ip(self), 'AUTH')
self.send_json({'ok': True, 'message': 'Machine renommée avec succès', 'name': new_name})
return
if self.path == '/api/system/update/sync':
if not valid_session(self) and auth_state()['configured']: self.send_json({'error':'Authentification requise'},401); return
target_commit = str(data.get('commit', '')).strip()
if not target_commit:
chk = check_gitea_update(force_refresh=True)
target_commit = chk.get('latest_commit_full') or chk.get('latest_commit') or ''
if not target_commit:
raise ValueError('Impossible de déterminer le dernier commit')
v_data = {
'version': 'V5.5',
'commit': target_commit,
'build_date': datetime.datetime.now(datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')
}
for v_path in ('/data/version.json', os.path.join(BASE_DIR, 'version.json'), 'version.json'):
try:
with open(v_path, 'w', encoding='utf-8') as f:
json.dump(v_data, f, indent=2)
except Exception:
pass
with _update_lock:
_update_cache['time'] = 0
res = check_gitea_update(force_refresh=True)
self.send_json({'ok': True, 'update': res, 'message': 'Synchronisé avec succè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()