fix: propagate dynamic IPs/ports to service pages; add apply restart feedback
Service pages (Email, Calendar, Files) now read IPs and ports from the config API instead of hardcoded 172.20.0.x constants: - GET /api/config now includes service_ips (dns, vip_mail, vip_calendar, vip_files, vip_webdav) computed from ip_range via ip_utils - Email.jsx: mailIp, dnsIp, imapPort, smtpPort, webmailPort from context - Calendar.jsx: calendarIp, dnsIp, calendarPort from context - Files.jsx: filesIp, webdavIp, webdavPort, filegatorPort from context Apply button now shows restart progress: - "Restarting containers — please wait…" spinner while polling /health - "Containers restarted successfully" on success (clears after 4s) - "Timed out" / error message if health doesn't come back in 45s Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+10
@@ -400,6 +400,16 @@ def get_config():
|
||||
'ip_range': identity.get('ip_range', os.environ.get('CELL_IP_RANGE', '172.20.0.0/16')),
|
||||
'wireguard_port': identity.get('wireguard_port', int(os.environ.get('WG_PORT', '51820'))),
|
||||
}
|
||||
# Expose computed per-service IPs so the frontend doesn't need to derive them
|
||||
import ip_utils as _ip_utils_cfg
|
||||
_ips = _ip_utils_cfg.get_service_ips(config['ip_range'])
|
||||
config['service_ips'] = {
|
||||
'dns': _ips['dns'],
|
||||
'vip_mail': _ips['vip_mail'],
|
||||
'vip_calendar': _ips['vip_calendar'],
|
||||
'vip_files': _ips['vip_files'],
|
||||
'vip_webdav': _ips['vip_webdav'],
|
||||
}
|
||||
config['service_configs'] = service_configs
|
||||
return jsonify(config)
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user