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/apiand 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 indeCatalogininternal/server/i18n.go(TestGermanCatalogComplete) and a French, Spanish, Italian and Russian one ini18n_<lang>.go(TestCatalogsComplete); see Languages. - Device side texts (
limdm,limdm-desktop, agent notifications and the PAM prompt) are English keys passed totr,trnorlocale.T/locale.N, translated ininternal/locale/catalog/<lang>.json; the GTK app uses_()andngettext()withpackaging/locale/<lang>.po.TestCatalogsandTestPoFilesininternal/localefail on a missing text, wrong plural forms or changed printf verbs. See Languages and translation. internal/server/schema.sqlruns 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 versionedmigrationslist ininternal/server/library.go(recorded inschema_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 inschema_appliedyet, so statements inschema.sqlmust 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 intoconcurrentIndexes(same file): they are built withCREATE INDEX CONCURRENTLYafter the schema transaction, so a first build does not block writes.LIMDM_TEST_EXPLAIN=1 go test -run TestExplainFleet -v ./internal/serverfills the test database with 50,000 devices and directory users and prints the plans of the hot queries.internal/server/openapi.jsonis 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;
mainonly accepts pull requests with passing checks.