Repository navigation
Conversation
Routes under /api/runtime/images run climg as a fixed absolute-path program under a configured non-root user. They cover search, show, pull/build/add jobs with a FIFO queue, streaming upload, Node Template sync and health. The feature is off unless WEB_LOCAL_CLIMG_PATH is set and is only enabled for the local endpoint.
Search, details, pull, upload, build, a jobs panel with the queue, a health card and Node Template management, in the existing workspace style.
Member
|
Closing reason: #156 (comment) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #156
Hi CLAB team, thanks so much for your works on this clab app, after sometimes wondering around with this, I come with the updates for the Web, which is used climg (my personal clone ishare2 cli for containerlab)
Summary
Adds an Images entry to the workspace rail, under Overview. It opens a document view for managing VM images on the local lab host:
The work is done by
climg, an external Python CLI (pipx install git+https://github.com/dathtd119/climg). The server runs it as a fixed absolute-path program with a versioned JSON contract (climg --versionreportscontract 1). The app never builds a shell command line.Off by default. Nothing changes unless
WEB_LOCAL_CLIMG_PATHis set, and the view only exists for the local (WEB_LOCAL_LABS) endpoint.Security
With local labs there is no sign-in, so anyone who can open the app can pull, upload and build images and edit Node Templates. This is the same trust level local labs already have. Mitigations:
WEB_LOCAL_CLIMG_USER, or as the app's own user. It never runs as root: uid 0 is refused.--.Documented in
docs/reference/app-settings.md(Images).Settings
WEB_LOCAL_CLIMG_PATHclimg; the only program run for ImagesWEB_LOCAL_CLIMG_CONFIGCLIMG_CONFIGpassed to climg (absolute path)WEB_LOCAL_CLIMG_STATECLIMG_STATEpassed to climg (absolute path)WEB_LOCAL_CLIMG_USERuid:gidto run climg as; required when the app runs as root; uid 0 refusedWEB_LOCAL_CLIMG_HOMEHOMEfor climg (absolute path)WEB_LOCAL_IMAGES_UPLOAD_MAX20GWEB_LOCAL_IMAGES_MAX_RUNNING1WEB_LOCAL_IMAGES_MAX_QUEUED20How to try it
pipx install git+https://github.com/dathtd119/climg(Yes currently it is relying on my own package to use, I can let you guys handle this climg)climg init(points climg at a vrnetlab checkout and an image folder)export WEB_LOCAL_LABS=true WEB_LOCAL_CLIMG_PATH="$(command -v climg)"scripts/run-images-container.shfor the container variant).vios, and pull it. The image appears in the Lab Palette as a Node Template.Testing
pnpm typecheck: exit 0.pnpm lint: exit 0, knip clean.packages/app-servertest:unit: 221 tests, 217 pass, 0 fail, 4 skipped. The skipped tests are root-only ownership tests; run them withbash packages/app-server/scripts/run-root-tests.sh(Docker, 4/4).packages/clab-uitest:unit: 1028/1028.climg search --jsonacross 7 queries;main(2e3fbe6): test-kit "reports its runtime, and offers nothing the runtime lacks" (captureStream on docker,packages/test-kit/src/contracts/labBackend.ts:216). It fails whenever the host's containerlab has thecapturecommand.Screenshots
Known limitations / follow-ups
/dev/kvmshows a warning unless the run-as group can access it;uid:gidcannot add supplementary groups.eth{n}.Open questions for maintainers
Dockerfile.images+ script acceptable in this repo, or should it live outside it?