Skip to content

feat: add LINBO Docker sync endpoints#17

Open
amolani wants to merge 1 commit intolinuxmuster:lmn73from
amolani:feature/linbo-docker-endpoints
Open

feat: add LINBO Docker sync endpoints#17
amolani wants to merge 1 commit intolinuxmuster:lmn73from
amolani:feature/linbo-docker-endpoints

Conversation

@amolani
Copy link

@amolani amolani commented Mar 19, 2026

Summary

Adds read-only API endpoints under /v1/linbo/ that enable LINBO Docker (the modern caching server replacement) to sync data from the LMN server.

These endpoints provide:

  • Host sync — Delta-feed with cursor-based change detection from devices.csv
  • Config sync — Batch retrieval of start.conf.* and GRUB *.cfg files
  • DHCP export — ISC DHCP and dnsmasq proxy configs generated from school data
  • Image sync — Manifest, download (with HTTP Range resume), and chunked upload
  • Server info — Network config from setup.ini for automated Docker setup

All endpoints are read-only (except image upload which stages to .incoming/), school-aware via ?school= parameter, and require the global-administrator role.

New Endpoints

Method Path Purpose
GET /v1/linbo/server-info Server network config for auto-setup
GET /v1/linbo/health Subsystem health check
GET /v1/linbo/changes Cursor-based delta feed
POST /v1/linbo/hosts:batch Batch get hosts by MAC (max 500)
POST /v1/linbo/startconfs:batch Batch get start.conf files (max 100)
POST /v1/linbo/configs:batch Batch get GRUB configs (max 100)
GET /v1/linbo/grub-configs All GRUB configs for a school
GET /v1/linbo/dhcp/export/isc-dhcp ISC DHCP subnet + devices export
GET /v1/linbo/dhcp/export/dnsmasq-proxy dnsmasq proxy config (ETag support)
GET /v1/linbo/images/manifest Image list with sizes and checksums
GET/HEAD /v1/linbo/images/download/{name}/{file} Image download with Range support
PUT /v1/linbo/images/upload/{name}/{file} Chunked upload with Content-Range
GET /v1/linbo/images/upload/{name}/{file}/status Upload resume status
POST /v1/linbo/images/upload/{name}/complete Finalize staged upload
DELETE /v1/linbo/images/upload/{name} Cancel/cleanup upload

Files Changed

  • New: routers_v1/linbo.py (1215 lines) — all LINBO endpoints
  • Modified: routers_v1/body_schemas.py — added LinboBatchMacs and LinboBatchIds Pydantic models
  • Modified: main.py — registered linbo.router

Context

This is part of the LINBO Docker project which provides a containerized LINBO caching server as a modern replacement for linuxmuster-cachingserver-satellite. The endpoints have been running in production on LMN 7.3 since March 2026.

Testing

  • Tested on linuxmuster.net 7.3 (Ubuntu 24.04, linuxmuster-linbo7 4.3.31)
  • All endpoints visible at /docs (Swagger UI)
  • Verified with LINBO Docker sync service (delta-feed, image pull/push, DHCP export)

Add read-only API endpoints for LINBO Docker to sync host data,
configurations, GRUB configs, DHCP exports, and images from the
LMN server.

New file: routers_v1/linbo.py with endpoints:
- GET /v1/linbo/server-info — server network config for auto-setup
- GET /v1/linbo/health — subsystem health check
- GET /v1/linbo/changes — cursor-based delta feed for sync
- POST /v1/linbo/hosts:batch — batch get hosts by MAC
- POST /v1/linbo/startconfs:batch — batch get start.conf files
- POST /v1/linbo/configs:batch — batch get GRUB configs
- GET /v1/linbo/grub-configs — all GRUB configs for a school
- GET /v1/linbo/dhcp/export/isc-dhcp — ISC DHCP config export
- GET /v1/linbo/dhcp/export/dnsmasq-proxy — dnsmasq proxy config
- GET /v1/linbo/images/manifest — image list with checksums
- GET/HEAD /v1/linbo/images/download/{name}/{file} — image download
- PUT /v1/linbo/images/upload/{name}/{file} — chunked image upload
- POST /v1/linbo/images/upload/{name}/complete — finalize upload

All endpoints are read-only (except image upload), school-aware
via ?school= parameter, and require global-administrator role.

Modified: body_schemas.py (add LinboBatchMacs, LinboBatchIds)
Modified: main.py (register linbo router)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant