How micromdm/nanomdm works
NanoMDM is a composable Apple MDM server: devices send check-ins and command results over HTTP; handlers adapt those requests to services, which process enrollment state and commands through storage. API clients can queue commands and pushes, while APNs delivery, webhooks, certificate authorization, declarative-management hooks, and migration are additional product capabilities. The README documents the handler/service/storage layers; excerpts show core service and push behavior. Some wiring and subsystem details are unsampled, so unsupported call relationships are omitted.
Main entry points: service.go Core MDM service · mdm_cert.go MDM HTTP handlers · api.go API handlers · allmulti.go Multi-store dispatch
Components 21
HTTP ingress
- MDM HTTP handlers
http/mdm/mdm_cert.go - API handlers
http/api/api.go
MDM services
- MDM protocol
mdm/checkin.go - Core MDM service
service/nanomdm/service.go - Certificate authorization
service/certauth/service.go - Multi-command targeting
service/multi/multi.go - Declarative management hook
service/dmhook/dmhook.go
Persistence
- Storage interfaces
storage/storage.go - Multi-store dispatch
storage/allmulti/allmulti.go - KV storage
storage/kv/mdm.go - SQL storage
storage/mysql/mysql.go - File storage
storage/file/file.go
External integrations
- Webhook events
service/webhook/service.go - Push delivery service
push/service/service.go - APNs provider
push/nanopush/provider.go
Server runtime
- NanoMDM server
cmd/nanomdm/main.go - Migration client
cmd/nano2nano/main.go
Other components
- Apple devices
- API clients
- Apple APNs
- Webhook target
Connections 25
- Apple devices → MDM HTTP handlers: send check-ins
- MDM HTTP handlers → Core MDM service: adapts requests
- MDM HTTP handlers → MDM protocol: handles messages
http/mdm/mdm_cert.go - API clients → API handlers: submit API requests
- API handlers → Core MDM service: queues commands
http/api/api.go - API handlers → Push delivery service: requests pushes
http/api/api.go - Core MDM service → Storage interfaces: dispatches state operations
service/nanomdm/service.go - Core MDM service → Certificate authorization: uses authorization wrapper
- Core MDM service → Declarative management hook: delegates DM
service/nanomdm/service.go - Core MDM service → Webhook events: dispatches events
service/webhook/service.go - MDM HTTP handlers → Webhook events: sends event requests
- Webhook events → Webhook target: posts events
service/webhook/service.go - Core MDM service → Multi-command targeting: supports targeting
- Storage interfaces → Multi-store dispatch: implemented by
storage/allmulti/allmulti.go - Multi-store dispatch → KV storage: dispatches storage calls
storage/allmulti/allmulti.go - Multi-store dispatch → SQL storage: dispatches storage calls
- Multi-store dispatch → File storage: dispatches storage calls
- Push delivery service → Storage interfaces: retrieves push data
push/service/service.go - Push delivery service → APNs provider: sends notifications
push/service/service.go - APNs provider → Apple APNs: delivers pushes
push/nanopush/provider.go - NanoMDM server → MDM HTTP handlers: configures handlers
cmd/nanomdm/main.go - NanoMDM server → API handlers: configures handlers
cmd/nanomdm/main.go - NanoMDM server → Core MDM service: configures service
cmd/nanomdm/main.go - Migration client → Storage interfaces: retrieves check-ins
cmd/nano2nano/main.go - Migration client → API handlers: sends migration requests