fix: propagate Settings config changes to service managers and live pages
- PUT /api/config now calls service_manager.update_config() for each service so changes write to the service's own config file, not just cell_config.json - email_manager.get_status() now reads smtp_port/imap_port/domain from its config file (defaults: 587/993/cell.local) and includes them in the response - calendar_manager.get_status() includes configured port (default 5232) - file_manager.get_status() uses configured port from service config - Email.jsx reads imap_port/smtp_port from API status instead of hardcoding - Settings service sections show "port changes require container restart" note Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+21
-7
@@ -403,15 +403,29 @@ def update_config():
|
||||
config_manager.configs['_identity'] = stored
|
||||
config_manager._save_all_configs()
|
||||
|
||||
# Update service configurations
|
||||
# Map service names to their manager instances
|
||||
_svc_managers = {
|
||||
'network': network_manager,
|
||||
'wireguard': wireguard_manager,
|
||||
'email': email_manager,
|
||||
'calendar': calendar_manager,
|
||||
'files': file_manager,
|
||||
'routing': routing_manager,
|
||||
'vault': app.vault_manager,
|
||||
}
|
||||
|
||||
# Update service configurations in both config_manager and service managers
|
||||
for service, config in data.items():
|
||||
if service in config_manager.service_schemas:
|
||||
success = config_manager.update_service_config(service, config)
|
||||
if success:
|
||||
service_bus.publish_event(EventType.CONFIG_CHANGED, service, {
|
||||
'service': service,
|
||||
'config': config
|
||||
})
|
||||
config_manager.update_service_config(service, config)
|
||||
# Propagate to the service manager's own config file
|
||||
mgr = _svc_managers.get(service)
|
||||
if mgr:
|
||||
mgr.update_config(config)
|
||||
service_bus.publish_event(EventType.CONFIG_CHANGED, service, {
|
||||
'service': service,
|
||||
'config': config
|
||||
})
|
||||
|
||||
logger.info(f"Updated config: {data}")
|
||||
return jsonify({"message": "Configuration updated successfully"})
|
||||
|
||||
Reference in New Issue
Block a user