Skip to content

Layout and conventions

Layout

Path
cmd/limdm-server server: serve, keygen, sign, local-admin, audit, keys
cmd/limdm-agent agent daemon and enroll
cmd/limdm device CLI, the command line counterpart of the desktop app (talks to the agent's local socket)
cmd/limdm-desktop desktop helper in the user session (notifications, tray, branding)
internal/api wire protocol types, declaration types and validation, blueprint resolution and merging, release and command signatures, remote shell frames
internal/server console, agent API, admin API and OpenAPI document, SCIM, directory sync, notifications, keys, tenants, remote shell relay, schema (schema.sql) and data migrations (library.go)
internal/server/web templates, CSS, scripts (blueprint editor, remote shell terminal)
internal/server/web/static/vendor/xterm vendored xterm.js for the remote shell
internal/server/webapp/dist build of the console app (generated by make web, committed)
web source of the console app under /app/
internal/agent agent: enforcement, compliance checks, inventory, PAM, desktop socket, remote shell
packaging systemd and OpenRC units, package scripts, PAM config, desktop files, artwork
deploy Docker Compose, Caddy, CrowdSec, fail2ban
scripts install-agent.sh, vendor-xterm.sh, vendor-swagger-ui.sh
docs this documentation; console help links point here

Conventions

  • Validation lives in internal/api and runs on server and agent.
  • Server texts are English keys, wrapped as {{t "..."}} in templates. Every such text, every declaration type label, audit action, command label, agent event format and literal problem detail needs a German entry in deCatalog in internal/server/i18n.go (TestGermanCatalogComplete) and a French, Spanish, Italian and Russian one in i18n_<lang>.go (TestCatalogsComplete); see Languages.
  • Device side texts (limdm, limdm-desktop, agent notifications and the PAM prompt) are English keys passed to tr, trn or locale.T/locale.N, translated in internal/locale/catalog/<lang>.json; the GTK app uses _() and ngettext() with packaging/locale/<lang>.po. TestCatalogs and TestPoFiles in internal/locale fail on a missing text, wrong plural forms or changed printf verbs. See Languages and translation.
  • internal/server/schema.sql runs at every start, so every statement must be idempotent (CREATE TABLE IF NOT EXISTS, ADD COLUMN IF NOT EXISTS, CREATE OR REPLACE, guarded constraints). The integration test applies the schema twice and fails when the second run fails. Data conversions that must run once go into the versioned migrations list in internal/server/library.go (recorded in schema_migrations). Migrations run in one transaction under an advisory lock, so several instances can start together. The schema and the migrations are applied only when their hash (schemaHash) is not in schema_applied yet, so statements in schema.sql must not depend on running at every start: data repairs and backfills over big tables belong in a migration. Indexes on tables that grow with the fleet go into concurrentIndexes (same file): they are built with CREATE INDEX CONCURRENTLY after the schema transaction, so a first build does not block writes. LIMDM_TEST_EXPLAIN=1 go test -run TestExplainFleet -v ./internal/server fills the test database with 50,000 devices and directory users and prints the plans of the hot queries.
  • internal/server/openapi.json is written by hand and embedded in the server; the tests only check that it is valid, so update it with every admin API change.
  • Commits are signed; main only accepts pull requests with passing checks.