feat: Fix D-Bus type compatibility and establish successful daemon communication
Some checks failed
Compile apt-layer (v2) / compile (push) Has been cancelled
Some checks failed
Compile apt-layer (v2) / compile (push) Has been cancelled
- Fix D-Bus type errors by flattening status dictionary - Remove nested 'config' dictionary that caused TypeError - Convert all values to D-Bus-compatible types (string, int, bool, double) - Confirm production security policy working (root-only access) - Successfully test GetStatus method with valid response - Update D-Bus policy to allow root access to specific interfaces - Update CHANGELOG.md with D-Bus communication milestone - Update TODO.md to reflect completed daemon integration The apt-ostree daemon now has working D-Bus communication with proper type handling and production-ready security policies. Ready for full integration with apt-layer.sh client.
This commit is contained in:
parent
883fa1e70f
commit
9d0fd2ca67
4 changed files with 44 additions and 8 deletions
9
TODO.md
9
TODO.md
|
|
@ -35,8 +35,13 @@
|
|||
|
||||
### VM Testing & Daemon Integration
|
||||
- ✅ VM environment setup and apt-layer/apt-ostree integration testing
|
||||
- 🔄 Diagnosing daemon startup issue: Python entry point not launching daemon as expected
|
||||
- 🔄 Next: Verify Python package install, test running daemon directly, fix entry point/install process
|
||||
- ✅ Daemon startup and D-Bus registration working correctly
|
||||
- ✅ D-Bus communication established with proper method signatures
|
||||
- ✅ D-Bus type compatibility resolved (flattened status dictionary)
|
||||
- ✅ Production security policy confirmed (root-only access)
|
||||
- ✅ GetStatus method tested and returning valid responses
|
||||
- 🎯 Next: Implement additional D-Bus methods (InstallPackages, RemovePackages, etc.)
|
||||
- 🎯 Next: Integrate with apt-layer.sh client for full daemon orchestration
|
||||
|
||||
## Next Phase 🎯
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### [2025-07-16 UTC] - DAEMON INTEGRATION: D-BUS COMMUNICATION SUCCESSFUL
|
||||
- **Major Milestone**: Successfully established D-Bus communication with apt-ostree daemon.
|
||||
- **D-Bus Method Testing**: Successfully tested `GetStatus` method with proper D-Bus type handling:
|
||||
- Method call: `org.debian.aptostree1.Sysroot.GetStatus`
|
||||
- Object path: `/org/debian/aptostree1/Sysroot`
|
||||
- Interface: `org.debian.aptostree1.Sysroot`
|
||||
- Valid response with daemon status information
|
||||
- **D-Bus Type Compatibility**: Fixed D-Bus type errors by flattening status dictionary:
|
||||
- Removed nested `config` dictionary that caused `TypeError`
|
||||
- Converted all values to D-Bus-compatible types (string, int, bool, double)
|
||||
- Ensured all returned values are simple, serializable types
|
||||
- **Production Security**: Confirmed root-only D-Bus policy is working correctly:
|
||||
- Non-root users receive `AccessDenied` (expected)
|
||||
- Root users can successfully call D-Bus methods
|
||||
- Policy file properly installed and D-Bus reloaded
|
||||
- **Daemon Status Response**: Confirmed daemon returns comprehensive status:
|
||||
- `running`: boolean true (daemon is active)
|
||||
- `clients`: int32 0 (no active clients)
|
||||
- `active_transactions`: int32 0 (no active transactions)
|
||||
- `sysroot_path`: string "/" (system root path)
|
||||
- `uptime`: double (daemon uptime in seconds)
|
||||
- `idle_exit_timeout`: int32 60 (idle timeout configuration)
|
||||
- `auto_update_policy`: string "none" (update policy setting)
|
||||
- **Integration Readiness**: Daemon is now ready for full integration:
|
||||
- ✅ D-Bus communication working
|
||||
- ✅ Security policy enforced
|
||||
- ✅ Method signatures correct
|
||||
- ✅ Type compatibility resolved
|
||||
- ✅ Status reporting functional
|
||||
- **Next Steps**: Ready to implement additional D-Bus methods and integrate with apt-layer.sh client.
|
||||
|
||||
### [2025-07-16 UTC] - PRODUCTION SECURITY: D-BUS POLICY HARDENING
|
||||
- **Production Security Enhancement**: Updated D-Bus policy for production use with root-only access.
|
||||
- **D-Bus Policy Hardening**: Modified `src/apt-ostree.py/dbus-policy/org.debian.aptostree1.conf`:
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
<!-- Allow root user to own the apt-ostree service -->
|
||||
<policy user="root">
|
||||
<allow own="org.debian.aptostree1"/>
|
||||
<allow send_destination="org.debian.aptostree1"/>
|
||||
<allow receive_sender="org.debian.aptostree1"/>
|
||||
</policy>
|
||||
|
||||
<!-- Production policy: Only root can communicate with apt-ostree service -->
|
||||
|
|
|
|||
|
|
@ -331,10 +331,8 @@ class AptOstreeDaemon(GObject.Object):
|
|||
'running': self.running,
|
||||
'clients': len(self.client_manager.clients),
|
||||
'active_transactions': len(self.active_transactions),
|
||||
'sysroot_path': self.sysroot.path if self.sysroot else None,
|
||||
'uptime': time.time() - getattr(self, '_start_time', time.time()),
|
||||
'config': {
|
||||
'idle_exit_timeout': self.idle_exit_timeout,
|
||||
'auto_update_policy': self.auto_update_policy
|
||||
}
|
||||
'sysroot_path': str(self.sysroot.path) if self.sysroot else "",
|
||||
'uptime': float(time.time() - getattr(self, '_start_time', time.time())),
|
||||
'idle_exit_timeout': int(self.idle_exit_timeout),
|
||||
'auto_update_policy': str(self.auto_update_policy)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue